dolibarr  7.0.0-beta
Public Member Functions | Private Member Functions | List of all members
modResource Class Reference

Description and activation class for module Resource. More...

+ Inheritance diagram for modResource:
+ Collaboration diagram for modResource:

Public Member Functions

 __construct ($db)
 Constructor. More...
 
 init ($options= '')
 Function called when module is enabled. More...
 
- Public Member Functions inherited from DolibarrModules
 __construct ($db)
 Constructor. More...
 
 _init ($array_sql, $options='')
 Enables a module. More...
 
 _remove ($array_sql, $options='')
 Disable function. More...
 
 getName ()
 Gives the translated module name if translation exists in admin.lang or into language files of module. More...
 
 getDesc ()
 Gives the translated module description if translation exists in admin.lang or the default module description. More...
 
 getDescLong ()
 Gives the long description of a module. More...
 
 getDescLongReadmeFound ()
 Return path of file if a README file was found. More...
 
 getChangeLog ()
 Gives the changelog. More...
 
 getPublisher ()
 Gives the publisher name. More...
 
 getPublisherUrl ()
 Gives the publisher url. More...
 
 getVersion ($translated=1)
 Gives module version (translated if param $translated is on) For 'experimental' modules, gives 'experimental' translation For 'dolibarr' modules, gives Dolibarr version. More...
 
 isCoreOrExternalModule ()
 Tells if module is core or external. More...
 
 getLangFilesArray ()
 Gives module related language files list. More...
 
 getExportDatasetLabel ($r)
 Gives translated label of an export dataset. More...
 
 getImportDatasetLabel ($r)
 Gives translated label of an import dataset. More...
 
 getLastActivationDate ()
 Gives the last date of activation. More...
 
 getLastActivationInfo ()
 Gives the last author of activation. More...
 
 _active ()
 Insert constants for module activation. More...
 
 _unactive ()
 Module deactivation. More...
 
 _load_tables ($reldir)
 Create tables and keys required by module. More...
 
 insert_boxes ($option='')
 Adds boxes. More...
 
 delete_boxes ()
 Removes boxes. More...
 
 insert_cronjobs ()
 Adds cronjobs. More...
 
 delete_cronjobs ()
 Removes boxes. More...
 
 delete_tabs ()
 Removes tabs. More...
 
 insert_tabs ()
 Adds tabs. More...
 
 insert_const ()
 Adds constants. More...
 
 delete_const ()
 Removes constants tagged 'deleteonunactive'. More...
 
 insert_permissions ($reinitadminperms=0, $force_entity=null, $notrigger=0)
 Adds access rights. More...
 
 delete_permissions ()
 Removes access rights. More...
 
 insert_menus ()
 Adds menu entries. More...
 
 delete_menus ()
 Removes menu entries. More...
 
 create_dirs ()
 Creates directories. More...
 
 insert_dirs ($name, $dir)
 Adds directories definitions. More...
 
 delete_dirs ()
 Removes directories. More...
 
 insert_module_parts ()
 Adds generic parts. More...
 
 delete_module_parts ()
 Removes generic parts. More...
 
 init ($options= '')
 Function called when module is enabled. More...
 
 remove ($options= '')
 Function called when module is disabled. More...
 

Private Member Functions

 loadTables ()
 Create tables, keys and data required by module Files llx_table1.sql, llx_table1.key.sql llx_data.sql with create table, create keys and create data commands must be stored in directory /resource/sql/ This function is called by this->init. More...
 

Detailed Description

Description and activation class for module Resource.

Definition at line 33 of file modResource.class.php.

Constructor & Destructor Documentation

modResource::__construct (   $db)

Constructor.

Define names, constants, directories, boxes, permissions

Parameters
DoliDB$dbDatabase handler

Definition at line 41 of file modResource.class.php.

References $resql, description, and name.

Member Function Documentation

modResource::init (   $options = '')

Function called when module is enabled.

The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database. It also creates data directories

Parameters
string$optionsOptions when enabling module ('', 'noboxes')
Returns
int 1 if OK, 0 if KO

Definition at line 322 of file modResource.class.php.

References DolibarrModules\_init(), and loadTables().

modResource::loadTables ( )
private

Create tables, keys and data required by module Files llx_table1.sql, llx_table1.key.sql llx_data.sql with create table, create keys and create data commands must be stored in directory /resource/sql/ This function is called by this->init.

Returns
int <=0 if KO, >0 if OK

Definition at line 339 of file modResource.class.php.

References DolibarrModules\_load_tables().

Referenced by init().


The documentation for this class was generated from the following file: