CaMykS
1.0-20231201
|
ModuleLibrary abastract class for module libraries. More...
Public Member Functions | |
__construct ($id, &$module, $wf_version=false) | |
ModuleLibrary ($id, &$module, $wf_version=false) | |
init_library () | |
initialise () | |
get ($language=true) | |
get_fromHeader ($prefix='') | |
save () | |
delete () | |
reset () | |
install () | |
uninstall () | |
is_installed () | |
is_marked () | |
& | get_newObject ($id=0) |
get_databaseItems () | |
save_databaseItems () | |
delete_databaseItems () | |
reset_databaseItems () | |
install_databaseItems () | |
uninstall_databaseItems () | |
check_databaseInstallation () | |
get_objectList_databaseItemsSQLQuery ($where='', $limit=-1, $count=-1, $order='id', $sens='') | |
update_databaseSpecificItems ($updatedItems) | |
get_databaseLocalisedItems () | |
save_databaseLocalisedItems () | |
delete_databaseLocalisedItems () | |
reset_databaseLocalisedItems () | |
install_databaseLocalisedItems () | |
get_objectList_databaseLocalisedItemsSQLQuery ($ids) | |
get_allDatabaseItems ($language) | |
get_objectList_allDatabaseItemsSQLQuery ($language, $where='', $limit=-1, $count=-1, $order='id', $sens='') | |
get_textItems ($language=null) | |
save_textItems () | |
delete_textItems () | |
reset_textItems () | |
install_textItems () | |
get_fileItems ($language=null) | |
save_fileItems () | |
delete_fileItems () | |
reset_fileItems () | |
install_fileItems () | |
get_tempItems () | |
get_fromArray ($data, $match=null, $onlyAvailable=false) | |
get_fromItems () | |
check_data () | |
load_fromSession ($name='ObjectData', $onlyAvailable=false) | |
save_toSession ($name='ObjectData') | |
delete_fromSession ($name='ObjectData') | |
get_fileURL ($file, $full=true, $default='') | |
load_file ($file) | |
get_varFileURL ($file, $full=true, $default='') | |
load_varFile ($file) | |
get_translation ($str, $args=null) | |
build_SQLCondition ($params) | |
get_objectList ($language=false, $where='', $limit=-1, $count=-1, $order='id', $sens='') | |
get_objectIdList ($language=false, $where='', $orderBy='', $orderWay='asc') | |
get_nameList ($element='name', $where='', $language='', $orderBy='', $orderWay='asc') | |
get_objectCount ($where='', $language=false) | |
get_uniqueItemList ($element='name', $where='', $structured=false) | |
execute_DBQuery ($sql='', $line=-1, $file='', $resName=null) | |
execute_DBMultiQueries ($sql='', $line=-1, $file='', $resName=null) | |
get_DBQueryGeneratedId ($resName=null) | |
get_DBQueryDataLine ($resName=null) | |
get_DBQueryNumDataLine ($resName=null) | |
get_DBQueryError ($resName=null) | |
get_DBQueryAffectedRows ($resName=null) | |
escape_string ($string) | |
get_DBInsertExtra () | |
create_DBTable ($name, $fields, $charset='utf8') | |
Public Attributes | |
$object_type = 'ModuleLibrary' | |
Object type. More... | |
$_libName | |
Object name. More... | |
$_libParent | |
Parent module. More... | |
$_libItems = array() | |
Object item list. More... | |
$_libItemTypes = array('db' => array(), 'dbl' => array(), 'text' => array(), 'file' => array(), 'temp' => array()) | |
Object item list by type. More... | |
$_libSQLTable | |
Object table name in database. More... | |
$_libSQLLocaleTable | |
$_libDesc | |
Library description. More... | |
$_libError | |
Last error. More... | |
$_libIsInstalled = null | |
$id | |
Object instance id. More... | |
$vars = array() | |
Object item values. More... | |
Protected Member Functions | |
add_newItem ($name, $itemtype, $info0, $info1, $info2, $default=null, $localised=false) | |
insert_multiObjectsDatabaseItems ($keys, $values) | |
check_SQLCondition ($where, $localeOnly=false) | |
build_SQLOrderByStatement ($order, $way='') | |
Protected Attributes | |
$_libParentFile | |
Object library file. More... | |
$_libDBConnector | |
Database connection. More... | |
Private Member Functions | |
insert_databaseItems () | |
update_databaseItems () | |
get_quickObjectList ($where='', $limit=-1, $count=-1, $order='id', $sens='') | |
get_unlocalisedObjectList ($where='', $limit=-1, $count=-1, $order='id', $sens='') | |
get_completeObjectList ($where='', $limit=-1, $count=-1, $order='id', $sens='') | |
get_localisedObjectList ($language=null, $where='', $limit=-1, $count=-1, $order='id', $sens='') | |
ModuleLibrary abastract class for module libraries.
Engine / Object Library
Use to manage localised (or not) content from database, files or text objects ModuleLibrary class.
ModuleLibrary::__construct | ( | $id, | |
& | $module, | ||
$wf_version = false |
|||
) |
Class constructor.
integer | $id | |
Object | $module | |
mixed | $wf_version |
ModuleLibrary::ModuleLibrary | ( | $id, | |
& | $module, | ||
$wf_version = false |
|||
) |
Old style constructor.
integer | $id | |
Object | $module | |
mixed | $wf_version |
ModuleLibrary::init_library | ( | ) |
Finish library object initialisation.
|
protected |
Insert a new item in object.
string | $name | |
string | $itemtype | |
string | $info0 | |
string | $info1 | |
mixed | $info2 | |
mixed | $default | |
boolean | $localised | @ |
ModuleLibrary::initialise | ( | ) |
Initialise new object.
Reimplemented in Tool_InstallerParams, Content_GenericNewsItem, Content_GenericHTMLNewsItem, Content_GenericArticleItem, Admin_GenericBlogNewsItem, and Admin_GenericBlogLinkItem.
ModuleLibrary::get | ( | $language = true | ) |
Load object.
mixed | $language |
Reimplemented in Content_GenericLegalMentionsItem, and Admin_ToDoItem.
ModuleLibrary::get_fromHeader | ( | $prefix = '' | ) |
Load object from header POST/GET values
string | $prefix |
ModuleLibrary::save | ( | ) |
Save object.
Reimplemented in Content_GenericLegalMentionsItem, Admin_StatisticConfig, Admin_GenericMediaLibraryManagerPicture, Admin_GenericEmailingManagerEmailing, and Admin_GenericBlogNewsItem.
ModuleLibrary::delete | ( | ) |
Delete object.
Reimplemented in GenericRandomTextItem, and Admin_GenericMediaLibraryManagerPictureGallery.
ModuleLibrary::reset | ( | ) |
Delete all objects.
ModuleLibrary::install | ( | ) |
Install object.
ModuleLibrary::uninstall | ( | ) |
Uninstall object
ModuleLibrary::is_installed | ( | ) |
Check if object is installed.
ModuleLibrary::is_marked | ( | ) |
Check if object is marked, to be overwrite.
Reimplemented in Admin_SystemReportItem.
& ModuleLibrary::get_newObject | ( | $id = 0 | ) |
ModuleLibrary::get_databaseItems | ( | ) |
Load object items from database.
ModuleLibrary::save_databaseItems | ( | ) |
Save object database items.
|
private |
Create object instance into database.
|
protected |
Create multi object instances into database.
array | $keys | |
array | $values |
|
private |
ModuleLibrary::delete_databaseItems | ( | ) |
Delete object from database.
ModuleLibrary::reset_databaseItems | ( | ) |
Reset all objects from database
ModuleLibrary::install_databaseItems | ( | ) |
Install table in database.
ModuleLibrary::uninstall_databaseItems | ( | ) |
Delete table from database
ModuleLibrary::check_databaseInstallation | ( | ) |
Check if table is installed.
ModuleLibrary::get_objectList_databaseItemsSQLQuery | ( | $where = '' , |
|
$limit = -1 , |
|||
$count = -1 , |
|||
$order = 'id' , |
|||
$sens = '' |
|||
) |
Return sql query for database items object list gathering.
string | $where | |
int | $limit | |
int | $count | |
string | $order | |
string | $sens |
ModuleLibrary::update_databaseSpecificItems | ( | $updatedItems | ) |
Update specific items values from object to database.
array | $updatedItems |
ModuleLibrary::get_databaseLocalisedItems | ( | ) |
Load database localised items
ModuleLibrary::save_databaseLocalisedItems | ( | ) |
Save database localised items.
ModuleLibrary::delete_databaseLocalisedItems | ( | ) |
Delete object localised items from database.
ModuleLibrary::reset_databaseLocalisedItems | ( | ) |
Reset objects localised items from database.
ModuleLibrary::install_databaseLocalisedItems | ( | ) |
Install object localised items.
ModuleLibrary::get_objectList_databaseLocalisedItemsSQLQuery | ( | $ids | ) |
Return SQL query for database localised items object list gathering.
array | $ids |
ModuleLibrary::get_allDatabaseItems | ( | $language | ) |
Load database unlocalised and localised items at once for given language.
string | $language |
ModuleLibrary::get_objectList_allDatabaseItemsSQLQuery | ( | $language, | |
$where = '' , |
|||
$limit = -1 , |
|||
$count = -1 , |
|||
$order = 'id' , |
|||
$sens = '' |
|||
) |
Return SQL query for database items object list gathering
string | $language | |
string | $where | |
integer | $limit | |
integer | $count | |
mixed | $order | |
string | $sens |
ModuleLibrary::get_textItems | ( | $language = null | ) |
Load text files path
string | $language |
ModuleLibrary::save_textItems | ( | ) |
Save text items
ModuleLibrary::delete_textItems | ( | ) |
Delete text items
ModuleLibrary::reset_textItems | ( | ) |
Reset text items.
ModuleLibrary::install_textItems | ( | ) |
Install text items folders.
ModuleLibrary::get_fileItems | ( | $language = null | ) |
Reimplemented in Admin_GenericMediaLibraryManagerPicture.
ModuleLibrary::save_fileItems | ( | ) |
ModuleLibrary::delete_fileItems | ( | ) |
ModuleLibrary::reset_fileItems | ( | ) |
ModuleLibrary::install_fileItems | ( | ) |
ModuleLibrary::get_tempItems | ( | ) |
ModuleLibrary::get_fromArray | ( | $data, | |
$match = null , |
|||
$onlyAvailable = false |
|||
) |
Load each item value from an array
array | $data | |
array | $match | |
boolean | $onlyAvailable |
ModuleLibrary::get_fromItems | ( | ) |
Export vars to be easily usable.
Reimplemented in Tool_InstallerParams, Content_GooglePoIMapViewerItem, Content_GenericGlossaryViewerItem, Content_GenericBlogsViewerItem, and Admin_GenericEmailingManagerEmailing.
ModuleLibrary::check_data | ( | ) |
Check content data validity (to be overwritten).
Reimplemented in Content_TwitterStatusesViewerItem, Content_GoogleSearchResultsViewerItem, Content_GooglePoIMapViewerItem, Content_GenericSiteMapItem, GenericRandomTextList, GenericRandomTextItem, Content_GenericQuickMessageList, Content_GenericQuickMessageItem, Content_GenericPetitionViewerItem, Content_GenericPageRedirectorItem, Content_GenericPageListItem, Content_GenericNewsList, Content_GenericMenuItem, Content_GenericLegalMentionsItem, Content_GenericHTMLNewsList, Content_GenericHTMLContentItem, Content_GenericGuestBookViewerItem, Content_GenericGlossaryViewerItem, Content_GenericGalleryList, Content_GenericGalleryItem, Content_GenericFaqList, Content_GenericFaqItem, Content_GenericBlogsViewerItem, Content_GenericArticleItem, Admin_ToDoComment, Admin_SystemUniqueIDManagerKey, Admin_SystemNotificationsWebsite, Admin_StatisticData, Admin_SiteReportItem, Admin_SecurityIPFilterRule, Admin_UserShortcut, Admin_InternalMessage, Admin_MonitoringUserAgentCheckerRecord, Admin_GenericPetitionManagerSignature, Admin_GenericMediaLibraryManagerPicture, Admin_GenericGuestBookManagerMessage, Admin_GenericFAQManagerQuestion, Admin_GenericFAQManagerFamily, Admin_GenericEmailingManagerEmailing, Admin_GenericEmailingManagerContact, Admin_GenericDownloadManagerDocument, Admin_GenericContactFormManagerForm, Admin_GenericBlogTagItem, Admin_GenericBlogNewsItem, and Admin_GenericBlogCommentItem.
ModuleLibrary::load_fromSession | ( | $name = 'ObjectData' , |
|
$onlyAvailable = false |
|||
) |
Load object data from session.
string | $name | |
boolean | $onlyAvailable |
ModuleLibrary::save_toSession | ( | $name = 'ObjectData' | ) |
Save object data in session.
string | $name |
ModuleLibrary::delete_fromSession | ( | $name = 'ObjectData' | ) |
Delete object from session.
string | $name |
ModuleLibrary::get_fileURL | ( | $file, | |
$full = true , |
|||
$default = '' |
|||
) |
Return complete file url.
string | $file | |
boolean | $full | |
string | $default |
ModuleLibrary::load_file | ( | $file | ) |
Load a file.
string | $file |
ModuleLibrary::get_varFileURL | ( | $file, | |
$full = true , |
|||
$default = '' |
|||
) |
Return plugin var file.
string | $file | |
boolean | $full | |
string | $default |
ModuleLibrary::load_varFile | ( | $file | ) |
Return file from var plugin folder.
string | $file |
ModuleLibrary::get_translation | ( | $str, | |
$args = null |
|||
) |
Return localised string.
string | $str | |
mixed | $args |
ModuleLibrary::build_SQLCondition | ( | $params | ) |
Build SQL condition.
array | $params |
Reimplemented in Content_GenericHTMLNewsItem, Admin_SystemUniqueIDManagerKey, Admin_SystemReportItem, Admin_SystemNotificationsWebsite, Admin_SecurityURLFilterRule, Admin_SecurityIPFilterRule, Admin_UserShortcut, Admin_MonitoringUserAgentCheckerRecord, Admin_GooglePoIMapManagerPoint, Admin_GenericPetitionManagerSignature, Admin_GenericPetitionManagerPetition, Admin_GenericMediaLibraryManagerPictureGallery, Admin_GenericMediaLibraryManagerPicture, Admin_GenericGuestBookManagerMessage, Admin_GenericGlossaryManagerDefinition, Admin_GenericGlossaryManagerCategory, Admin_GenericFAQManagerQuestion, Admin_GenericFAQManagerFamily, Admin_GenericEmailingManagerEmailing, Admin_GenericEmailingManagerEmail, Admin_GenericEmailingManagerContact, Admin_GenericDownloadManagerDocument, Admin_GenericDownloadManagerCategory, Admin_GenericDirectoryManagerContact, Admin_GenericDirectoryManagerCategory, Admin_GenericContactFormManagerSubject, and Admin_GenericContactFormManagerForm.
|
protected |
Replace id reference in test string for joined SQL query.
string | $where | |
boolean | $localeOnly |
|
protected |
Build order by statement for SQL query.
mixed | $order | |
string | $way |
ModuleLibrary::get_objectList | ( | $language = false , |
|
$where = '' , |
|||
$limit = -1 , |
|||
$count = -1 , |
|||
$order = 'id' , |
|||
$sens = '' |
|||
) |
Return object list using the most optimised sub method.
mixed | $language | |
string | $where | |
integer | $limit | |
integer | $count | |
string | $order | |
string | $sens |
ModuleLibrary::get_objectIdList | ( | $language = false , |
|
$where = '' , |
|||
$orderBy = '' , |
|||
$orderWay = 'asc' |
|||
) |
Return object id list.
mixed | $language | |
string | $where | |
string | $orderBy | |
string | $orderWay |
ModuleLibrary::get_nameList | ( | $element = 'name' , |
|
$where = '' , |
|||
$language = '' , |
|||
$orderBy = '' , |
|||
$orderWay = 'asc' |
|||
) |
Return items id:element list.
string | $element | |
string | $where | |
string | $language | |
string | $orderBy | |
string | $orderWay |
ModuleLibrary::get_objectCount | ( | $where = '' , |
|
$language = false |
|||
) |
Return object count.
string | $where | |
mixed | $language |
|
private |
get_objectList sub methods : return database items only
string | $where | |
integer | $limit | |
integer | $count | |
mixed | $order | |
string | $sens |
|
private |
get_objectList sub methods : return complete items : unlocalised items only
string | $where | |
integer | $limit | |
integer | $count | |
mixed | $order | |
string | $sens |
|
private |
get_objectList sub methods : return complete objects
string | $where | |
integer | $limit | |
integer | $count | |
mixed | $order | |
string | $sens |
|
private |
get_objectList sub methods : return single language objects
mixed | $language | |
string | $where | |
integer | $limit | |
integer | $count | |
mixed | $order | |
string | $sens |
ModuleLibrary::get_uniqueItemList | ( | $element = 'name' , |
|
$where = '' , |
|||
$structured = false |
|||
) |
Return unique item values list.
string | $element | |
string | $where | |
boolean | $structured |
ModuleLibrary::execute_DBQuery | ( | $sql = '' , |
|
$line = -1 , |
|||
$file = '' , |
|||
$resName = null |
|||
) |
Execute database query.
string | $sql | |
integer | $line | |
integer | $file | |
string | $resName |
ModuleLibrary::execute_DBMultiQueries | ( | $sql = '' , |
|
$line = -1 , |
|||
$file = '' , |
|||
$resName = null |
|||
) |
Execute multiple database queries at once.
string | $sql | |
integer | $line | |
integer | $file | |
string | $resName |
ModuleLibrary::get_DBQueryGeneratedId | ( | $resName = null | ) |
Return id generated by last query.
string | $resName |
ModuleLibrary::get_DBQueryDataLine | ( | $resName = null | ) |
Return next query data line.
string | $resName |
ModuleLibrary::get_DBQueryNumDataLine | ( | $resName = null | ) |
Return next query data line with numeric index.
string | $resName |
ModuleLibrary::get_DBQueryError | ( | $resName = null | ) |
Return latest query error.
string | $resName |
ModuleLibrary::get_DBQueryAffectedRows | ( | $resName = null | ) |
Return latest query affected rows.
string | $resName |
ModuleLibrary::escape_string | ( | $string | ) |
Return espaced string.
string | $string |
ModuleLibrary::get_DBInsertExtra | ( | ) |
Return latest query affected rows.
ModuleLibrary::create_DBTable | ( | $name, | |
$fields, | |||
$charset = 'utf8' |
|||
) |
Create a table in database.
string | $name | |
array | $fields | |
string | $charset |
string ModuleLibrary::$object_type = 'ModuleLibrary' |
Object type.
string ModuleLibrary::$_libName |
Object name.
Module ModuleLibrary::$_libParent |
Parent module.
|
protected |
Object library file.
array ModuleLibrary::$_libItems = array() |
Object item list.
array ModuleLibrary::$_libItemTypes = array('db' => array(), 'dbl' => array(), 'text' => array(), 'file' => array(), 'temp' => array()) |
Object item list by type.
|
protected |
Database connection.
string ModuleLibrary::$_libSQLTable |
Object table name in database.
Object table name for localised data in database.
ModuleLibrary::$_libSQLLocaleTable |
string ModuleLibrary::$_libDesc |
Library description.
boolean ModuleLibrary::$_libError |
Last error.
Is library installed.
ModuleLibrary::$_libIsInstalled = null |
integer ModuleLibrary::$id |
Object instance id.
array ModuleLibrary::$vars = array() |
Object item values.