Class CAT_Helper_Addons
Methods for finding, listing, installing and checking addons.
Allows to get a list of installed addons.
- $selected
name or directory of the the addon to be selected in a dropdown - $type
addon type - can be an array (corresponds to 'type' column in addons table) - $function
addon function - can be an array (corresponds to 'function' column in addons table) - $permissions
array(!) of directories to check permissions - $order
value to handle "ORDER BY" for database request of addons
Get a list of installed templates, mark currently used
CAT_Helper_Addons::getInstance()->get_addons( DEFAULT_TEMPLATE , 'template' );
Get a list of page type modules
CAT_Helper_Addons::getInstance()->get_addons( -1 , 'module', 'page' );
Check addons requirements (precheck.php) before installation.
- $temp_addon_file
temp file (from file upload) - $temp_path temp path (from file upload)
- $delete_on_fail
delete $temp_addon_file if the check fails; default: true - $always_return_result
always return rendered result, also if all checks pass (used by installer); default: false
register_page_title($page_id, $module_name, $module_directory)
unregister_page_title($page_id, $module_directory)
is_registered_page_title($page_id, $module_directory)
register_page_description($page_id, $module_name, $module_directory)
unregister_page_description($page_id, $module_directory)
is_registered_page_description($page_id, $module_directory)
register_page_keywords($page_id, $module_name, $module_directory)
unregister_page_keywords($page_id, $module_directory)
is_registered_page_keywords($page_id, $module_directory)
get_page_title($page_id)
get_page_description($page_id)
get_page_keywords($page_id)
getVersion($version, $strip_suffix = true)
getVersion2($version)
versionCompare($version1, $version2, $operator = '>=')
installModule($directory, $install = false)
installTemplate($directory)
installLanguage($file)
getModuleVersion($modulename, $source = true)
upgradeModule($directory, $upgrade = false)
isModuleInstalled($module,$version=NULL)
sec_register_file($module, $filepath)
__sortPreCheckArray($precheck_array)
checkInfo($directory)
getError()
getLibraries($type=NULL)
get_page_footers()
completely replaces the old method register_frontend_modfiles_body()
.
Just add the function call directly before the closing </body>
-Tag of the template:
<html>
<head>
...more...
</head>
<body>
...
<?php get_page_footers(); ?>
</body>
</html>
Or, for Dwoo based templates:
{get_page_footers()}
For backend templates (which are always Dwoo based), use
{get_page_footers('backend')}
The function is backward compatible and automatically loads the following files of all modules used on the current page:
<Module>/frontend_body.js
In addition, every module can have a file named footers.inc.php
to define additional files.
The basics are the same as described in get_page_headers(). The file should define an array named $mod_footers
.
Of course, neither CSS files can be loaded nor META-settings can be made in the footer. But it is possible to load additional JavaScripts here.
Example:
$mod_footers = array(
'frontend' => array(
'script' => array(
array(
'alert("hello world!");'
),
),
),
);