Methods summary
public
|
#
__construct( integer $idmod = NULL )
Constructor for the class cModuleHandler. With this class you can create a
new module, rename a module. You can save a Output from modules and Input in a
file. The save rules are [Modulname] (is unique) the files input and output will
be named [Modulname]_input.php , [Modulname]_output.php
Constructor for the class cModuleHandler. With this class you can create a
new module, rename a module. You can save a Output from modules and Input in a
file. The save rules are [Modulname] (is unique) the files input and output will
be named [Modulname]_input.php , [Modulname]_output.php
Parameters
- $idmod
integer $idmod [optional] the id of the module
Throws
cExceptionif the module directory can not be created
|
public static
mixed
|
#
getEncoding( integer $overrideLanguageId = 0 )
Parameters
- $overrideLanguageId
integer $overrideLanguageId [optional]
Returns
mixed
|
public
boolean
|
|
public
boolean|string
|
#
saveContentToFile( string $templateName, string $fileType, string $fileContent, string $saveDirectory = 'cache' )
Save a content in the file, use for css/js
Save a content in the file, use for css/js
Parameters
- $templateName
string $templateName
- $fileType
string $fileType
- $fileContent
string $fileContent
- $saveDirectory
string $saveDirectory [optional]
Returns
boolean|string
|
public static
string
|
#
getCleanName( string $name, string $defaultChar = '_' )
Get the cleaned name
Parameters
- $name
string $name mod name
- $defaultChar
string $defaultChar [optional] default character
Returns
string
|
public
|
#
initWithDatabaseRow( mixed $db )
Init the vars of the class.
Init the vars of the class.
Parameters
|
protected
|
#
_initByModule( integer $idmod = NULL )
Init the vars of the class, make a query to the Db
Init the vars of the class, make a query to the Db
Parameters
- $idmod
integer $idmod [optional] the id of the modul
|
public
string
|
#
getModulePath( )
Get the Modul Path also cms path + module + module name.
Get the Modul Path also cms path + module + module name.
Returns
string
|
public
string
|
#
getTemplatePath( string $file = '' )
Get the template path. If file is set it will return the complete path +
file
Get the template path. If file is set it will return the complete path +
file
Parameters
- $file
string $file [optional]
Returns
string
|
public
string
|
#
getCssPath( )
Get the css path of the modul
Get the css path of the modul
Returns
string
|
public
string
|
#
getPhpPath( )
Get the php path of the modul
Get the php path of the modul
Returns
string
|
public
string
|
#
getJsPath( )
Get the js path of the modul
Get the js path of the modul
Returns
string
|
public
string
|
#
getCssFileName( )
Get the main css file modulenam.css
Get the main css file modulenam.css
Returns
string
|
protected
string
|
#
getRandomCharacters( integer $count )
Returns random characters
Returns random characters
Parameters
- $count
integer $count amount of characters
Returns
string
|
public
boolean
|
#
existFile( string $type, string $fileName )
Check if exist a file
Parameters
- $type
string $type js | template | css the directory of the file
- $fileName
string $fileName file name
Returns
boolean
|
public
boolean
|
#
deleteFile( string $type, string $fileName )
Delete file
Parameters
- $type
string $type js |template | css directory of the file
- $fileName
string $fileName file name
Returns
boolean
|
public
boolean
|
#
createModuleFile( string $type, string $fileName = NULL, string $content = '' )
Create and save new file
Parameters
- $type
string $type css | js | template directory of the file
- $fileName
string $fileName [optional] file name
- $content
string $content [optional] content of the file
Returns
boolean true if file can be created, and false otherwise
|
public
boolean
|
#
renameModuleFile( string $type, string $oldFileName, string $newFileName )
Rename a file
Parameters
- $type
string $type css | js | template directory of the file
- $oldFileName
string $oldFileName old name of the file
- $newFileName
string $newFileName the new name of the file
Returns
boolean by success return true
|
public
string
|
#
getJsFileName( )
Get the name of the main js file (modulname.js)
Get the name of the main js file (modulname.js)
Returns
string the name of the js file
|
public
string|boolean
|
#
getFilesContent( string $directory, string $fileTyp, string $fileName = NULL )
Get the content of file, modul js or css or template or php
Get the content of file, modul js or css or template or php
Parameters
- $directory
string $directory where in module should we look
- $fileTyp
string $fileTyp css or js
- $fileName
string $fileName [optional]
Returns
string|boolean
|
protected
boolean
|
|
public
array
|
#
getAllFilesFromDirectory( string $moduleDirectory )
Get all files from a module directory
Get all files from a module directory
Parameters
- $moduleDirectory
string $moduleDirectory template css or js...
Returns
array
|
public
|
|
public
boolean
|
#
eraseModule( )
Removes this module from the filesystem. Also deletes the version files.
Removes this module from the filesystem. Also deletes the version files.
Returns
boolean true on success or false on failure
|
public
boolean|string
|
#
readInput( boolean $issource = false )
Read the input of the file _input.php
Read the input of the file _input.php
Parameters
- $issource
boolean $issource [optional]
Returns
boolean|string Contents of the Module file (_input.php)
|
public
boolean|string
|
#
readOutput( boolean $issource = false )
Read the output of the file _output.php
Read the output of the file _output.php
Parameters
- $issource
boolean $issource [optional]
Returns
boolean|string Contents of the Module file( _output.php)
|
protected
boolean
|
#
createModuleDirectory( string $type )
Make a directory template/css/image/js/php if not exist
Make a directory template/css/image/js/php if not exist
Parameters
Returns
boolean
|
public
boolean
|
#
isWritable( string $fileName, string $directory )
Can write/create a file
Parameters
- $fileName
string $fileName file name
- $directory
string $directory directory where is the file
Returns
boolean success true else false
|
public
boolean
|
#
moduleWriteable( string $type )
Check write permissions for this module
Check write permissions for this module
Parameters
- $type
string $type php oder template
Returns
boolean true or false
|
public
boolean
|
#
saveOutput( string $output = NULL )
Save a string into the file (_output.php).
Save a string into the file (_output.php).
Parameters
- $output
string $output [optional]
Returns
boolean if the action (save contents into the file _output.php) is successful return
true else false
|
public
boolean
|
#
saveInput( string $input = NULL )
Save a string into the file (_input.php)
Save a string into the file (_input.php)
Parameters
- $input
string $input [optional]
Returns
boolean if the action (save contents into the file _input.php) is successful return true
else false
|
public
true
|
#
saveInfoXML( string $moduleName = NULL, string $description = NULL, string $type = NULL, string $alias = NULL )
This method save a xml file with modul information. If the params not set,
get the value from this
This method save a xml file with modul information. If the params not set,
get the value from this
Parameters
- $moduleName
string $moduleName [optional] name of the modul
- $description
string $description [optional] description of the modul
- $type
string $type [optional] type of the modul
- $alias
string $alias [optional]
Returns
true if success else false
|
public
boolean
|
#
createModule( string $input = '', string $output = '' )
Create a new module in the module dir. The module name will be [ModuleName]
example Contact_Form or GoogleMaps2.
Create a new module in the module dir. The module name will be [ModuleName]
example Contact_Form or GoogleMaps2.
Parameters
- $input
string $input [optional]
- $output
string $output [optional]
Returns
boolean if module exist or mkdir and saveInput and saveOutput success return true. Else
if the mkdir or saveInput or saveOutput not success return false.
|
public
boolean
|
#
renameModul( string $old, string $new )
Rename a modul and the input and output files.
Rename a modul and the input and output files.
Parameters
- $old
string $old old name of the modul
- $new
string $new new name of the modul
Returns
boolean true if success
|
public
boolean
|
#
modulePathExists( )
Show if the Modul with the modul name exist in modul dir.
Show if the Modul with the modul name exist in modul dir.
Returns
boolean if the modul exist return true, else false
|
public
array
|
#
testInput( )
Test input code
Returns
array bool state, string errorMessage
|
public
array
|
#
testOutput( )
Test output code
Returns
array bool state, string errorMessage
|
protected
array
|
#
_testCode( unknown_type $inputType )
Test module code
Parameters
- $inputType
unknown_type $inputType string code field type
Returns
array bool state, string errorMessage
|
protected
array
|
#
_verifyCode( string $code, string $id, string $output = false )
Check module php code
Parameters
- $code
string $code Code to evaluate
- $id
string $id Unique ID for the test function
- $output
string $output [optional] true if start in php mode, otherwise false
Returns
array bool state, string errorMessage
|
protected static
mixed
|
#
_getModulePath( )
Get method for module path value Path to a module dir
Get method for module path value Path to a module dir
Returns
mixed $modulePath string
|
Properties summary
private
string
|
$_modulePath
|
|
|
private
string
|
$_path
|
|
#
Path to the modul dir where are all the moduls of a client (frontendpath)
Path to the modul dir where are all the moduls of a client (frontendpath)
|
protected
integer
|
$_idmod
|
NULL |
|
private
string
|
$_moduleName
|
NULL |
|
protected
string
|
$_description
|
|
#
Description of the modul.
Description of the modul.
|
protected
string
|
$_type
|
|
|
protected
string
|
$_moduleAlias
|
|
#
The alias name of the modul
The alias name of the modul
|
protected
array
|
$_directories
|
array(
'css' => 'css/',
'js' => 'js/',
'template' => 'template/',
'image' => 'image/',
'lang' => 'lang/',
'php' => 'php/'
) |
#
The names of the modul directories.
The names of the modul directories.
|
protected
array
|
$_cfg
|
NULL |
|
protected
array
|
$_cfgClient
|
NULL |
|
protected
integer
|
$_client
|
'0' |
|
protected
string
|
$_input
|
'' |
#
The code of the modul input
The code of the modul input
|
protected
string
|
$_output
|
'' |
#
The code of the modul output
The code of the modul output
|
protected
string
|
$_encoding
|
'' |
|
protected
string
|
$_fileEncoding
|
'' |
#
Which format of encoding should be files (input/output/translation...)
getEffectiveSetting('encoding', 'file_encoding', 'UTF-8')
Which format of encoding should be files (input/output/translation...)
getEffectiveSetting('encoding', 'file_encoding', 'UTF-8')
|
protected
integer
|
$_idlang
|
-1 |
|
private
cDb
|
$_db
|
NULL |
|
protected static
array
|
$_encodingStore
|
array() |
|