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
int
the 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.
bool
if 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)
string
css | js | template directory of the file
string
file name
string
content of the file
deleteFile(string $type, string $fileName)
string
js |template | css directory of the file
string
file name
eraseModule() : bool
Also deletes the version files.
bool
true on success or false on failureexistFile(string $type, string $fileName)
string
js | template | css the directory of the file
string
file name
getAllFilesFromDirectory(string $moduleDirectory) : array
string
template css or js...
array
getCleanName($name, $defaultChar)
getCssFileName() : string
string
getCssPath() : string
string
getEncoding()
getFilesContent(string $directory, string $fileTyp, $fileName)
string
where in module should we look
string
css or js
getJsFileName() : string
string
the name of the js filegetJsPath() : string
string
getModulePath() : string
string
getPhpPath() : string
string
getTemplatePath(string $file) : string
If file is set it will return the complete paht + file
string
string
initWithDatabaseRow($db)
isWritable(string $fileName, string $directory) : \bool,
string
file name
string
directory 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
string
Contents of the Module file (_input.php)readOutput() : string
string
Contents of the Module file( _output.php)renameModul(string $old, string $new) : bool
string
old name of the modul
string
new name of the modul
bool
true if successrenameModuleFile(string $type, string $oldFileName, string $newFileName) : boolean
string
css | js | template directory of the file
string
old name of the file
string
the new name of the file
boolean
by success return truesaveContentToFile(\unknown_type $templateName, \unknown_type $fileType, \unknown_type $fileContent, $saveDirectory) : false
\unknown_type
\unknown_type
\unknown_type
false
or stringsaveInfoXML(string $moduleName, string $description, string $type, $alias) : true
If the params not set, get the value from this
string
name of the modul
string
description of the modul
string
type of the modul
true
if success else falsesaveInput(string $input) : bool
string
bool
if the action (save contents into the file _input.php is
success) return true else falsesaveOutput(string $output) : bool
string
bool
if the action (save contents into the file _output.php is
success) return true else falsesetEncoding($encoding)
_initByModule(int $idmod)
int
the id of the modul
_initWithDatabaseRow($db)
deprecated | 2012-09-19 Use the public method initWithDatabaseRow instead! |
---|
_makeModuleDirectory() : boolean
boolean
createModuleDirectory(string $type)
string
getRandomCharacters(integer $count) : string
integer
amount 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