public final function __construct() { parent::__construct(); $this->RegisterContentType('Content2', dirname(__FILE__) . DIRECTORY_SEPARATOR . 'contenttype.Content2.php', $this->lang('AdvancedContent')); $config = cmsms()->GetConfig(); $this->smarty->plugins_dir[] = $config["root_path"] . '/modules/AdvancedContent/plugins'; }
public function __construct() { global $CMS_INSTALL_PAGE, $CMS_PHAR_INSTALL; if (isset($CMS_INSTALL_PAGE) || isset($CMS_PHAR_INSTALL)) { return; } parent::__construct(); $fn = __DIR__ . '/class.cgsimple.php'; require_once $fn; $smarty = cmsms()->GetSmarty(); if (!$smarty) { return; } $cgsimple = new cgsimple(); $smarty->assign('cgsimple', $cgsimple); $smarty->registerClass('cgsimple', 'cgsimple'); $smarty->register_function('module_action_link', 'module_action_link'); $smarty->register_function('module_action_url', 'module_action_url'); $smarty->register_function('cgrepeat', 'smarty_function_cgrepeat'); $smarty->register_function('session_put', 'smarty_function_session_put'); $smarty->register_function('session_erase', 'smarty_function_session_erase'); $smarty->register_function('cgsi_array_set', array($this, 'plugin_array_set')); $smarty->register_function('cgsi_array_unset', array($this, 'plugin_array_unset')); $smarty->register_function('anchor_link', array($this, 'plugin_anchorlink')); }
public function __construct() { parent::__construct(); $smarty = cms_utils::get_smarty(); $this->check_compiler(); $smarty->assign('module_url_path',$this->GetModuleURLPath()); $smarty->assign('module_root_path',$this->GetModulePath()); }
public function __construct() { parent::__construct(); $this->_loaded = false; $smarty = CmsApp::get_instance()->GetSmarty(); if (!$smarty) { return; } $smarty->register_modifier('markdown', array($this, 'exec_parser')); }
public function __construct() { parent::__construct(); if (!$this->GetPreference('hide_deprecated', 0)) { $this->RegisterContentType('Content2', dirname(__FILE__) . '/lib/class.Content2.php', 'AdvancedContent (deprecated)'); } $this->RegisterContentType('advanced_content', dirname(__FILE__) . '/lib/class.advanced_content.php', $this->lang('AdvancedContent')); $smarty =& cmsms()->GetSmarty(); $smarty->registerPlugin('function', 'get_global_contents', array('ac_smarty_plugins', 'get_global_contents')); }
function __construct() { parent::__construct(); $this->module_ptr =& $this; $this->dbHandle = $this->GetDb(); $this->module_id = ''; $this->email_regex = "/^([\\w\\d\\.\\-\\_])+\\@([\\w\\d\\.\\-\\_]+)\\.(\\w+)\$/i"; $this->email_regex_relaxed = "/^([\\w\\d\\.\\-\\_])+\\@([\\w\\d\\.\\-\\_])+\$/i"; require_once dirname(__FILE__) . '/classes/Form.class.php'; require_once dirname(__FILE__) . '/classes/FieldBase.class.php'; }
public function __construct() { parent::__construct(); $this->havemcrypt = function_exists('mcrypt_encrypt'); global $CMS_VERSION; $this->before20 = version_compare($CMS_VERSION, '2.0') < 0; $fp = cms_join_path(__DIR__, 'lib', 'Stripe', 'Stripe.php'); // Stripe singleton always require $fp; spl_autoload_register(array($this, 'stripe_spacedload')); }
public function __construct() { spl_autoload_register(array($this, 'autoload')); parent::__construct(); if ($this->_initialized) { return; } $this->_initialized = TRUE; // setup caching if (get_class($this) == 'CGExtensions' && !is_object(cms_cache_handler::get_instance()->get_driver())) { $lifetime = (int) $this->GetPreference('cache_lifetime', 300); $filelock = (int) $this->GetPreference('cache_filelock', 1); $autoclean = (int) $this->GetPreference('cache_autoclean', 1); if ($autoclean) { // autoclean is enabled... but we don't want to search through the directory for files to delete // on each request... so we just do that once per interval. $tmp = $this->GetPreference('cache_autoclean_last', 0); if (time() - $tmp < $lifetime) { $autoclean = 0; } else { $autoclean - 1; $this->SetPreference('cache_autoclean_last', time()); } } $driver = new cms_filecache_driver(array('cache_dir' => TMP_CACHE_LOCATION, 'lifetime' => $lifetime, 'locking' => $filelock, 'auto_cleaning' => $autoclean)); cms_cache_handler::get_instance()->set_driver($driver); } $this->_obj = false; $this->_actionid = ''; $smarty = cmsms()->GetSmarty(); $smarty->register_function('cge_yesno_options', array('cge_smarty_plugins', 'smarty_function_cge_yesno_options')); $smarty->register_function('cge_have_module', array('cge_smarty_plugins', 'smarty_function_have_module')); $smarty->register_block('cgerror', array('cge_smarty_plugins', 'blockDisplayError')); $smarty->register_block('jsmin', array('cge_smarty_plugins', 'jsmin')); $smarty->register_function('cgimage', array('cge_smarty_plugins', 'smarty_function_cgimage')); $smarty->register_function('cge_state_options', array('cge_smarty_plugins', 'smarty_function_cge_state_options')); $smarty->register_function('cge_country_options', array('cge_smarty_plugins', 'smarty_function_cge_country_options')); $smarty->register_function('cge_textarea', array('cge_smarty_plugins', 'smarty_function_cge_textarea')); $smarty->register_function('get_current_url', array('cge_smarty_plugins', 'smarty_function_get_current_url')); $smarty->register_function('cge_str_to_assoc', array('cge_smarty_plugins', 'smarty_function_str_to_assoc')); $smarty->register_modifier('rfc_date', array('cge_smarty_plugins', 'smarty_modifier_rfc_date')); $smarty->register_modifier('cge_entity_decode', array('cge_smarty_plugins', 'smarty_modifier_cge_entity_decode')); $smarty->register_compiler_function('cge_cache', array('cge_smarty_plugins', 'cache_start')); $smarty->register_compiler_function('/cge_cache', array('cge_smarty_plugins', 'cache_end')); $smarty->register_function('cge_array_set', array('cge_smarty_plugins', 'cge_array_set')); $smarty->register_function('cge_array_erase', array('cge_smarty_plugins', 'cge_array_erase')); $smarty->register_function('cge_array_get', array('cge_smarty_plugins', 'cge_array_get')); $smarty->register_function('cge_array_getall', array('cge_smarty_plugins', 'cge_array_getall')); $smarty->register_function('cge_admin_error', array('cge_smarty_plugins', 'cge_admin_error')); $smarty->register_function('cge_isbot', array('cge_smarty_plugins', 'cge_isbot')); $smarty->register_function('cge_is_smartphone', array('cge_smarty_plugins', 'cge_is_smartphone')); $smarty->register_function('cge_wysiwyg', array('cge_smarty_plugins', 'cge_wysiwyg')); }
public function __construct() { parent::__construct(); $fn = dirname(__FILE__) . '/class.cgsimple.php'; require_once $fn; $smarty = cmsms()->GetSmarty(); $obj = new cgsimple(); $smarty->assign('cgsimple', $obj); $smarty->register_function('module_action_link', 'module_action_link'); $smarty->register_function('cgrepeat', 'smarty_function_cgrepeat'); $smarty->register_function('session_put', 'smarty_function_session_put'); $smarty->register_function('session_erase', 'smarty_function_session_erase'); }
public function __construct() { parent::__construct(); $this->templateid = -1; }
function __construct() { parent::__construct(); }
/** * The constructor. * This method does numerous things, including setup an extended autoloader, * create defines for the module itself. i.e: MOD_CGEXTENSIONS, or MOD_FRONTENDUSERS. * sets up a built in cache driver for temporarily caching data. * and register numerous smarty plugins (see the documentation for those). */ public function __construct() { spl_autoload_register(array($this, 'autoload')); parent::__construct(); global $CMS_INSTALL_PAGE, $CMS_PHAR_INSTALL; if (isset($CMS_INSTALL_PAGE) || isset($CMS_PHAR_INSTALL)) { return; } $class = get_class($this); if (!defined('MOD_' . strtoupper($class))) { /** * @ignore */ define('MOD_' . strtoupper($class), $class); } if (self::$_initialized || $class != 'CGExtensions') { return; } self::$_initialized = TRUE; // from here down only happens once per request (for CGExtensions only) // setup caching if ($class == MOD_CGEXTENSIONS && !is_object(cms_cache_handler::get_instance()->get_driver())) { $lifetime = (int) $this->GetPreference('cache_lifetime', 300); $filelock = (int) $this->GetPreference('cache_filelock', 1); $autoclean = (int) $this->GetPreference('cache_autoclean', 1); if ($autoclean) { // autoclean is enabled... but we don't want to search through the directory for files to delete // on each request... so we just do that once per interval. $tmp = $this->GetPreference('cache_autoclean_last', 0); if (time() - $tmp < $lifetime) { $autoclean = 0; } else { $autoclean = 1; $this->SetPreference('cache_autoclean_last', time()); } } $driver = new cms_filecache_driver(array('cache_dir' => TMP_CACHE_LOCATION, 'lifetime' => $lifetime, 'locking' => $filelock, 'auto_cleaning' => $autoclean)); cms_cache_handler::get_instance()->set_driver($driver); } $smarty = CmsApp::get_instance()->GetSmarty(); if (!$smarty) { return; } $smarty->register_function('cge_yesno_options', 'cge_smarty_plugins::smarty_function_cge_yesno_options'); $smarty->register_function('cge_have_module', array('cge_smarty_plugins', 'plugin_have_module')); $smarty->register_block('cgerror', array('cge_smarty_plugins', 'blockDisplayError')); $smarty->register_block('jsmin', array('cge_smarty_plugins', 'jsmin')); $smarty->register_function('cge_cached_url', array('cge_smarty_plugins', 'cge_cached_url')); $smarty->register_function('cgimage', array('cge_smarty_plugins', 'smarty_function_cgimage')); $smarty->register_function('cge_helptag', array('cge_smarty_plugins', 'smarty_function_helptag')); $smarty->register_function('cge_helphandler', array('cge_smarty_plugins', 'smarty_function_helphandler')); $smarty->register_function('cge_helpcontent', array('cge_smarty_plugins', 'smarty_function_helpcontent')); $smarty->register_function('cge_state_options', array('cge_smarty_plugins', 'smarty_function_cge_state_options')); $smarty->register_function('cge_country_options', array('cge_smarty_plugins', 'smarty_function_cge_country_options')); $smarty->register_function('cge_textarea', array('cge_smarty_plugins', 'smarty_function_cge_textarea')); $smarty->register_function('get_current_url', array('cge_smarty_plugins', 'smarty_function_get_current_url')); $smarty->register_function('cge_str_to_assoc', array('cge_smarty_plugins', 'smarty_function_str_to_assoc')); $smarty->register_modifier('rfc_date', array('cge_smarty_plugins', 'smarty_modifier_rfc_date')); $smarty->register_modifier('time_fmt', array('cge_smarty_plugins', 'smarty_modifier_time_fmt')); $smarty->register_modifier('cge_entity_decode', array('cge_smarty_plugins', 'smarty_modifier_cge_entity_decode')); $smarty->register_compiler_function('cge_cache', array('cge_smarty_plugins', 'cache_start')); $smarty->register_compiler_function('cge_cacheclose', array('cge_smarty_plugins', 'cache_end')); $smarty->register_function('cge_module_hint', array('cge_smarty_plugins', 'cge_module_hint')); $smarty->register_function('cge_file_list', array('cge_smarty_plugins', 'cge_file_list')); $smarty->register_function('cge_image_list', array('cge_smarty_plugins', 'cge_image_list')); $smarty->register_function('cge_array_set', array('cge_smarty_plugins', 'cge_array_set')); $smarty->register_function('cge_array_erase', array('cge_smarty_plugins', 'cge_array_erase')); $smarty->register_function('cge_array_get', array('cge_smarty_plugins', 'cge_array_get')); $smarty->register_function('cge_array_getall', array('cge_smarty_plugins', 'cge_array_getall')); $smarty->register_function('cge_admin_error', array('cge_smarty_plugins', 'cge_admin_error')); $smarty->register_function('cge_wysiwyg', array('cge_smarty_plugins', 'cge_wysiwyg')); $smarty->register_modifier('cge_createurl', array('cge_smarty_plugins', 'smarty_modifier_createurl')); $smarty->register_function('cge_setlist', array('cge_smarty_plugins', 'cge_setlist')); $smarty->register_function('cge_unsetlist', array('cge_smarty_plugins', 'cge_unsetlist')); $smarty->register_function('cge_message', array('cge_smarty_plugins', 'cge_message')); $smarty->register_function('cge_isbot', array('cge_smarty_plugins', 'cge_isbot')); $smarty->register_function('cge_is_smartphone', array('cge_smarty_plugins', 'cge_is_smartphone')); $smarty->register_function('cge_getbrowser', array('cge_smarty_plugins', 'cge_get_browser')); $smarty->register_function('cge_isie', array('cge_smarty_plugins', 'cge_isie')); $smarty->register_function('cge_content_type', array('cge_smarty_plugins', 'cge_content_type')); $smarty->register_function('cge_start_tabs', array('cge_smarty_plugins', 'cge_start_tabs')); $smarty->register_function('cge_end_tabs', array('cge_smarty_plugins', 'cge_end_tabs')); $smarty->register_function('cge_tabheader', array('cge_smarty_plugins', 'cge_tabheader')); $smarty->register_function('cge_tabcontent_start', array('cge_smarty_plugins', 'cge_tabcontent_start')); $smarty->register_function('cge_tabcontent_end', array('cge_smarty_plugins', 'cge_tabcontent_end')); $smarty->register_function('cgjs_render', array('cge_smarty_plugins', 'cgjs_render')); $smarty->register_function('cgjs_require', array('cge_smarty_plugins', 'cgjs_require')); $smarty->register_block('cgjs_add', array('cge_smarty_plugins', 'cgjs_add')); $smarty->register_block('cgcss_add', array('cge_smarty_plugins', 'cgcss_add')); // should be admin only $smarty->register_function('cge_pageoptions', array('cge_smarty_plugins', 'cge_pageoptions')); $db = cms_utils::get_db(); if (is_object($db)) { $query = 'SET @CG_ZEROTIME = NOW() - INTERVAL 150 YEAR,@CG_FUTURETIME = NOW() + INTERVAL 5 YEAR'; $db->Execute($query); } }
function __construct() { parent::__construct(); $this->_tools_loaded = false; }
function __construct() { parent::__construct(); $this->RegisterModulePlugin(); }