Class for new modul structere.
Saves the Modul-Input in a file (input.php) and Modul-Output in a file(output.php). All moduls of a clients are in [frontend]/modules/.
| author | rusmir.jusufovic |
|---|
__construct(int $idmod) : void
With this class you can make a new Modul, rename a Modul. You can save a Output from Modul and Input in a file. The save rules are [Modulname] (is uneque) the files input and output will be named [Modulname]_input.php , [Modulname]_output.php
intthe id of the modul
\cException |
if the module directory can not be created |
|---|
changeModuleName($name)
| var | string |
|---|
createAllMainDirectories() : void
\cException |
if the frontend path can not be found or the module directory cann ot be created |
|---|
createModule($input, $output) : bool
The modul name will be [ModulName] example Contact_Form or GoogleMaps2.
boolif modul exist or mkdir and saveInput and saveOutput success
return true.
Else if the mkdir or saveInput or saveOutput not success return
false.createModuleFile(string $type, string $fileName, string $content)
stringcss | js | template directory of the file
stringfile name
stringcontent of the file
deleteFile(string $type, string $fileName)
stringjs |template | css directory of the file
stringfile name
eraseModule() : bool
Also deletes the version files.
booltrue on success or false on failureexistFile(string $type, string $fileName)
stringjs | template | css the directory of the file
stringfile name
getAllFilesFromDirectory(string $moduleDirectory) : array
stringtemplate css or js...
arraygetCleanName($name, $defaultChar)
getCssFileName() : string
stringgetCssPath() : string
stringgetEncoding()
getFilesContent(string $directory, string $fileTyp, $fileName)
stringwhere in module should we look
stringcss or js
getJsFileName() : string
stringthe name of the js filegetJsPath() : string
stringgetModulePath() : string
stringgetPhpPath() : string
stringgetTemplatePath(string $file) : string
If file is set it will return the complete paht + file
string
stringinitWithDatabaseRow($db)
isWritable(string $fileName, string $directory) : \bool,
stringfile name
stringdirectory where is the file
\bool,success true else falsemodulePathExists()
return bool if the modul exist return true, else false
modulePathExistsInDirectory(string $name)
string
readInput() : string
stringContents of the Module file (_input.php)readOutput() : string
stringContents of the Module file( _output.php)renameModul(string $old, string $new) : bool
stringold name of the modul
stringnew name of the modul
booltrue if successrenameModuleFile(string $type, string $oldFileName, string $newFileName) : boolean
stringcss | js | template directory of the file
stringold name of the file
stringthe new name of the file
booleanby success return truesaveContentToFile(\unknown_type $templateName, \unknown_type $fileType, \unknown_type $fileContent, $saveDirectory) : false
\unknown_type
\unknown_type
\unknown_type
falseor stringsaveInfoXML(string $moduleName, string $description, string $type, $alias) : true
If the params not set, get the value from this
stringname of the modul
stringdescription of the modul
stringtype of the modul
trueif success else falsesaveInput(string $input) : bool
string
boolif the action (save contents into the file _input.php is
success) return true else falsesaveOutput(string $output) : bool
string
boolif the action (save contents into the file _output.php is
success) return true else falsesetEncoding($encoding)
_initByModule(int $idmod)
intthe id of the modul
_initWithDatabaseRow($db)
| deprecated | 2012-09-19 Use the public method initWithDatabaseRow instead! |
|---|
_makeModuleDirectory() : boolean
booleancreateModuleDirectory(string $type)
string
getRandomCharacters(integer $count) : string
integeramount of characters
string_rec_rmdir($path)
| deprecated | 2012-09-10 Use cFileHandler::recursiveRmdir($dirname) instead |
|---|
$_cfg : array
$_cfgClient : array
$_client : int
$_description : string
$_directories : array
$_encoding : string
$_encodingStore
$_fileEncoding : string
..) getEffectiveSetting('encoding', 'file_encoding','UTF-8')
$_idlang : int
$_idmod : int
$_input : string
$_moduleAlias : string
$_output : string
$_overrideEncoding
$_type : string
$_db : \DB_Contenido
$_moduleName : string
$_modulePath : string
$_path : string