|
dolibarr 19.0.4
|
Set of function for modulebuilder management. More...
Go to the source code of this file.
Functions | |
| rebuildObjectClass ($destdir, $module, $objectname, $newmask, $readdir='', $addfieldentry=array(), $delfieldentry='') | |
| Regenerate files .class.php. | |
| rebuildObjectSql ($destdir, $module, $objectname, $newmask, $readdir='', $object=null, $moduletype='external') | |
| Save data into a memory area shared by all users, all sessions on server. | |
| dolGetListOfObjectClasses ($destdir) | |
| Get list of existing objects from directory. | |
| checkExistComment ($file, $number) | |
| function for check if comment begin an end exist in modMyModule class | |
| deletePerms ($file) | |
| Delete all permissions. | |
| compareFirstValue ($a, $b) | |
| Compare two value. | |
| reWriteAllPermissions ($file, $permissions, $key, $right, $objectname, $module, $action) | |
| Rewriting all permissions after any actions. | |
| parsePropertyString ($string) | |
| Converts a formatted properties string into an associative array. | |
| writePropsInAsciiDoc ($file, $objectname, $destfile) | |
| Write all properties of the object in AsciiDoc format. | |
| deletePropsAndPermsFromDoc ($file, $objectname) | |
| Delete property and permissions from documentation ascii file if we delete an object. | |
| getFromFile ($file, $start, $end) | |
| Search a string and return all lines needed from file. | |
| writePermsInAsciiDoc ($file, $destfile) | |
| Write all permissions of each object in AsciiDoc format. | |
| addObjectsToApiFile ($file, $objects, $modulename) | |
| Add Object in ModuleApi File. | |
| removeObjectFromApiFile ($file, $objectname, $modulename) | |
| Remove Object variables and methods from API_Module File. | |
| reWriteAllMenus ($file, $menus, $menuWantTo, $key, $action) | |
| updateDictionaryInFile ($module, $file, $dicts) | |
| Updates a dictionary in a module descriptor file. | |
| createNewDictionnary ($modulename, $file, $namedic, $dictionnaires=null) | |
| Creates a new dictionary table. | |
| writeApiUrlsInDoc ($file_api, $file_doc) | |
| Generate Urls and add them to documentaion module. | |
| countItemsInDirectory ($path, $type=1) | |
| count directories or files in modulebuilder folder | |
Set of function for modulebuilder management.
Definition in file modulebuilder.lib.php.
| addObjectsToApiFile | ( | $file, | |
| $objects, | |||
| $modulename ) |
Add Object in ModuleApi File.
| string | $file | path of file |
| array | $objects | array of objects in the module |
| string | $modulename | name of module |
Definition at line 943 of file modulebuilder.lib.php.
References dolReplaceInFile(), and getFromFile().
| checkExistComment | ( | $file, | |
| $number ) |
function for check if comment begin an end exist in modMyModule class
| string | $file | filename or path |
| int | $number | 0 = For Menus,1 = For permissions, 2 = For Dictionaries |
Definition at line 465 of file modulebuilder.lib.php.
| compareFirstValue | ( | $a, | |
| $b ) |
Compare two value.
| int | string | $a | value 1 |
| int | string | $b | value 2 |
Definition at line 525 of file modulebuilder.lib.php.
| countItemsInDirectory | ( | $path, | |
| $type = 1 ) |
count directories or files in modulebuilder folder
| string | $path | path of directory |
| int | $type | type of file 1= file,2=directory |
Definition at line 1342 of file modulebuilder.lib.php.
| createNewDictionnary | ( | $modulename, | |
| $file, | |||
| $namedic, | |||
| $dictionnaires = null ) |
Creates a new dictionary table.
for creating a new dictionary table in Dolibarr. It generates the necessary SQL code to define the table structure, including columns such as 'rowid', 'code', 'label', 'position', 'use_default', 'active', etc. The table name is constructed based on the provided $namedic parameter.
| string | $modulename | The lowercase name of the module for which the dictionary table is being created. |
| string | $file | The file path to the Dolibarr module builder file where the dictionaries are defined. |
| string | $namedic | The name of the dictionary, which will also be used as the base for the table name. |
| array | null | $dictionnaires | An optional array containing pre-existing dictionary data, including 'tabname', 'tablib', 'tabsql', etc. |
Definition at line 1205 of file modulebuilder.lib.php.
References dol_print_error(), setEventMessages(), and updateDictionaryInFile().
| deletePerms | ( | $file | ) |
Delete all permissions.
| string | $file | file with path |
Definition at line 492 of file modulebuilder.lib.php.
References dolReplaceInFile().
Referenced by reWriteAllPermissions().
| deletePropsAndPermsFromDoc | ( | $file, | |
| $objectname ) |
Delete property and permissions from documentation ascii file if we delete an object.
| string | $file | file or path |
| string | $objectname | name of object wants to deleted |
Definition at line 802 of file modulebuilder.lib.php.
References dol_is_file().
| dolGetListOfObjectClasses | ( | $destdir | ) |
Get list of existing objects from directory.
| string | $destdir | Directory |
Definition at line 434 of file modulebuilder.lib.php.
References dol_dir_list().
| getFromFile | ( | $file, | |
| $start, | |||
| $end ) |
Search a string and return all lines needed from file.
| string | $file | file for searching |
| string | $start | start line if exist |
| string | $end | end line if exist |
Definition at line 831 of file modulebuilder.lib.php.
Referenced by addObjectsToApiFile(), removeObjectFromApiFile(), reWriteAllMenus(), updateDictionaryInFile(), writeApiUrlsInDoc(), and writePermsInAsciiDoc().
| parsePropertyString | ( | $string | ) |
Converts a formatted properties string into an associative array.
| string | $string | The formatted properties string. |
Definition at line 658 of file modulebuilder.lib.php.
References parsePropertyString().
Referenced by parsePropertyString(), and writePropsInAsciiDoc().
| rebuildObjectClass | ( | $destdir, | |
| $module, | |||
| $objectname, | |||
| $newmask, | |||
| $readdir = '', | |||
| $addfieldentry = array(), | |||
| $delfieldentry = '' ) |
Regenerate files .class.php.
| string | $destdir | Directory |
| string | $module | Module name |
| string | $objectname | Name of object |
| string | $newmask | New mask |
| string | $readdir | Directory source (use $destdir when not defined) |
| string | $addfieldentry | Array of 1 field entry to add array('key'=>,'type'=>,''label'=>,'visible'=>,'enabled'=>,'position'=>,'notnull'=>','index'=>,'searchall'=>,'comment'=>,'help'=>,'isameasure') |
| string | $delfieldentry | Id of field to remove |
Definition at line 38 of file modulebuilder.lib.php.
References dol_copy(), dol_escape_js(), dol_escape_php(), dol_is_file(), dol_mkdir(), dol_osencode(), dol_print_error(), dol_sort_array(), dolChmod(), and setEventMessages().
| rebuildObjectSql | ( | $destdir, | |
| $module, | |||
| $objectname, | |||
| $newmask, | |||
| $readdir = '', | |||
| $object = null, | |||
| $moduletype = 'external' ) |
Save data into a memory area shared by all users, all sessions on server.
| string | $destdir | Directory |
| string | $module | Module name |
| string | $objectname | Name of object |
| string | $newmask | New mask |
| string | $readdir | Directory source (use $destdir when not defined) |
| Object | $object | If object was already loaded/known, it is pass to avoid another include and new. |
| string | $moduletype | 'external' or 'internal' |
Definition at line 256 of file modulebuilder.lib.php.
References dol_copy(), dol_is_file(), dol_mkdir(), dol_osencode(), dolChmod(), and setEventMessages().
| removeObjectFromApiFile | ( | $file, | |
| $objectname, | |||
| $modulename ) |
Remove Object variables and methods from API_Module File.
| string | $file | file api module |
| string | $objectname | name of object whant to remove |
| string | $modulename | name of module |
Definition at line 1002 of file modulebuilder.lib.php.
References dolReplaceInFile(), and getFromFile().
| reWriteAllMenus | ( | $file, | |
| $menus, | |||
| $menuWantTo, | |||
| $key, | |||
| $action ) |
| string | $file | path of filename |
| mixed | $menus | all menus for module |
| mixed | null | $menuWantTo | menu get for do actions |
| int | null | $key | key for the concerned menu |
| int | $action | for specify what action (0 = delete, 1 = add, 2 = update, -1 = when delete object) |
Definition at line 1050 of file modulebuilder.lib.php.
References dolReplaceInFile(), and getFromFile().
| reWriteAllPermissions | ( | $file, | |
| $permissions, | |||
| $key, | |||
| $right, | |||
| $objectname, | |||
| $module, | |||
| $action ) |
Rewriting all permissions after any actions.
| string | $file | filename or path |
| array | $permissions | permissions existing in file |
| int | null | $key | key for permission needed |
| array | null | $right | $right to update or add |
| string | null | $objectname | name of object |
| string | null | $module | name of module |
| int | $action | 0 for delete, 1 for add, 2 for update, -1 when delete object completly, -2 for generate rights after add |
Definition at line 540 of file modulebuilder.lib.php.
References deletePerms(), and dolReplaceInFile().
| updateDictionaryInFile | ( | $module, | |
| $file, | |||
| $dicts ) |
Updates a dictionary in a module descriptor file.
| string | $module | The name of the module. |
| string | $file | The path to the module descriptor file. |
| array | $dicts | The dictionary data to be updated. |
Definition at line 1149 of file modulebuilder.lib.php.
References dolReplaceInFile(), and getFromFile().
Referenced by createNewDictionnary().
| writeApiUrlsInDoc | ( | $file_api, | |
| $file_doc ) |
Generate Urls and add them to documentaion module.
| string | $file_api | filename or path of api |
| string | $file_doc | filename or path of documentation |
Definition at line 1285 of file modulebuilder.lib.php.
References dol_is_file(), dolReplaceInFile(), and getFromFile().
| writePermsInAsciiDoc | ( | $file, | |
| $destfile ) |
Write all permissions of each object in AsciiDoc format.
| string | $file | path of the class |
| string | $destfile | file where write table of permissions |
Definition at line 859 of file modulebuilder.lib.php.
References dolReplaceInFile(), and getFromFile().
| writePropsInAsciiDoc | ( | $file, | |
| $objectname, | |||
| $destfile ) |
Write all properties of the object in AsciiDoc format.
| string | $file | path of the class |
| string | $objectname | name of the objectClass |
| string | $destfile | file where write table of properties |
Definition at line 704 of file modulebuilder.lib.php.
References dolReplaceInFile(), and parsePropertyString().