本文整理汇总了PHP中icms_getModuleHandler函数的典型用法代码示例。如果您正苦于以下问题:PHP icms_getModuleHandler函数的具体用法?PHP icms_getModuleHandler怎么用?PHP icms_getModuleHandler使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了icms_getModuleHandler函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: content_content_display_edit
function content_content_display_edit($options)
{
include_once ICMS_ROOT_PATH . '/modules/' . basename(dirname(dirname(__FILE__))) . '/include/common.php';
$content_content_handler = icms_getModuleHandler('content', basename(dirname(dirname(__FILE__))), 'content');
$selpages = new icms_form_elements_Select('', 'options[0]', $options[0]);
$selpages->addOptionArray($content_content_handler->getContentList());
$showsubs = new icms_form_elements_Radioyn('', 'options[1]', $options[1]);
$showbreadc = new icms_form_elements_Radioyn('', 'options[2]', $options[2]);
$showinfo = new icms_form_elements_Radioyn('', 'options[3]', $options[3]);
$form = '<table width="100%">';
$form .= '<tr>';
$form .= '<td width="30%">' . _MB_CONTENT_CONTENT_SELPAGE . '</td>';
$form .= '<td>' . $selpages->render() . '</td>';
$form .= '</tr>';
$form .= '<tr>';
$form .= '<td>' . _MB_CONTENT_CONTENT_SHOWSUBS . '</td>';
$form .= '<td>' . $showsubs->render() . '</td>';
$form .= '</tr>';
$form .= '<tr>';
$form .= '<td>' . _MB_CONTENT_CONTENT_SHOWBREADCRUMB . '</td>';
$form .= '<td>' . $showbreadc->render() . '</td>';
$form .= '</tr>';
$form .= '<tr>';
$form .= '<td>' . _MB_CONTENT_CONTENT_SHOWINFO . '</td>';
$form .= '<td>' . $showinfo->render() . '</td>';
$form .= '</tr>';
$form .= '</table>';
return $form;
}
示例2: eventAfterSaveSystemAdminPreferencesItems
/**
* Do this event when saving item
*
* @param array config array
*/
function eventAfterSaveSystemAdminPreferencesItems($array) {
if (!isset($array[ICMS_CONF_AUTOTASKS])) return;
$handler = icms_getModuleHandler('autotasks', 'system');
$handler->virtual_config = array();
$array = &$array[ICMS_CONF_AUTOTASKS];
$vconfig1 = array();
$vconfig2 = array();
foreach ($array as $key => $values) {
$vconfig1[$key] = $values[0];
$vconfig2[$key] = $values[1];
}
$handler->enableVirtualConfig($vconfig1);
$system = $handler->getCurrentSystemHandler(true);
if ($system->isEnabled()) {
$system->stop();
}
$handler->enableVirtualConfig($vconfig2);
$system = $handler->getCurrentSystemHandler(true);
if ($rez = $system->canRun()) {
$time = (int) ($handler->getRealTasksRunningTime());
$rez = $system->start($time);
} else {
icms_loadLanguageFile('system', 'autotasks', true);
icms_core_Message::error(_CO_ICMS_AUTOTASKS_INIT_ERROR);
return false;
}
$handler->disableVirtualConfig();
}
示例3: b_profile_friends_show
function b_profile_friends_show($options)
{
global $xoTheme;
if (!empty(icms::$user)) {
$profile_friendship_handler = icms_getModuleHandler('friendship', basename(dirname(dirname(__FILE__))), 'profile');
$friends = $profile_friendship_handler->getFriendships(0, 0, icms::$user->getVar('uid'), 0, PROFILE_FRIENDSHIP_STATUS_ACCEPTED);
if (count($friends) == 0) {
return;
}
$block = array();
$i = 0;
foreach ($friends as $friend) {
$friend_uid = icms::$user->getVar('uid') == $friend['friend1_uid'] ? $friend['friend2_uid'] : $friend['friend1_uid'];
$block['friends'][$i]['uname'] = icms_member_user_Handler::getUserLink($friend_uid);
$block['friends'][$i]['friend_uid'] = $friend_uid;
$block['friends'][$i]['sort'] = icms_member_user_Object::getUnameFromId($friend_uid);
$i++;
}
if (isset($block['friends']) && count($block['friends']) > 0) {
usort($block['friends'], 'sortFriendsArray');
}
// adding PM javascript, $xoTheme cannot be used in this place because jQuery is not yet loaded
if (count($block['friends']) > 0) {
$block['jQuery'] = 'jQuery(document).ready(function(){jQuery("a.block-profile-pm").colorbox({width:600, height:395, iframe:true});});';
}
}
return $block;
}
示例4: delete
/**
* Delete an object from the database
* @see icms_ipf_Handler::delete()
*
* @param mod_profile_Regstep $obj
* @param bool $force
* @return bool
*/
public function delete(&$obj, $force = false)
{
if (parent::delete($obj, $force)) {
$field_handler = icms_getModuleHandler('field', basename(dirname(dirname(__FILE__))), 'profile');
return $field_handler->updateAll('step_id', 0, new icms_db_criteria_Item('step_id', $obj->getVar('step_id')));
}
return false;
}
示例5: icms_getModuleHandler
function &getFields()
{
static $fields_array;
if (!isset($fields_array)) {
$profile_handler = icms_getModuleHandler('profile', basename(dirname(dirname(__FILE__))), 'profile');
$fields_array = $profile_handler->loadFields();
}
return $fields_array;
}
示例6: beforeDelete
protected function beforeDelete(&$obj)
{
$profile_fields_handler = icms_getModuleHandler('field', basename(dirname(dirname(__FILE__))), 'profile');
$fields_count = $profile_fields_handler->getCount(icms_buildCriteria(array('catid' => $obj->getVar('catid'))));
if ($fields_count == 0) {
return true;
}
$obj->setErrors(sprintf(_AM_PROFILE_CATEGORY_NOTDELETED_FIELDS, $fields_count));
return false;
}
示例7: getCommandLine
function getCommandLine()
{
$atasks_handler =& icms_getModuleHandler('autotasks', 'system');
$config_atasks =& $atasks_handler->getConfig();
if (($config_atasks['autotasks_helper_path'] = trim($config_atasks['autotasks_helper_path'])) != '') {
if (substr($config_atasks['autotasks_helper_path'], -1) != '\\') {
$config_atasks['autotasks_helper_path'] .= '\\';
}
}
return (isset($_SERVER['COMSPEC']) ? $_SERVER['COMSPEC'] : $_SERVER['ComSpec']) . ' /C ' . str_replace(array('\\/', '/\\', '/'), array('/', '\\', '\\'), '"' . $config_atasks['autotasks_helper_path'] . str_replace(array('%path%', '%url%'), array(str_replace('/', '\\', ICMS_ROOT_PATH . '/include/autotasks.php'), ICMS_URL . '/include/autotasks.php'), $config_atasks['autotasks_helper']) . ' > NUL"');
}
示例8: eventStartOutputInit
/**
* Function to be triggered at the end of the output init process
*
* @return void
*/
public function eventStartOutputInit() {
global $icmsTpl;
$icms_adsense_handler = icms_getModuleHandler("adsense", "system");
$icms_adsensesObj = $icms_adsense_handler->getAdsensesByTag();
$adsenses_array = array();
if (is_object($icmsTpl)) {
foreach ($icms_adsensesObj as $k => $v) {
$adsenses_array[$k] = $v->render();
}
$icmsTpl->assign('icmsAdsenses', $adsenses_array);
}
}
示例9: eventStartOutputInit
/**
* Function to be triggered at the end of the output init process
*
* @return void
*/
function eventStartOutputInit() {
global $icmsTpl;
$icms_customtag_handler = icms_getModuleHandler("customtag", "system");
$icms_customTagsObj = $icms_customtag_handler->getCustomtagsByName();
$customtags_array = array();
if (is_object($icmsTpl)) {
foreach ($icms_customTagsObj as $k => $v) {
$customtags_array[$k] = $v->render();
}
$icmsTpl->assign("icmsCustomtags", $customtags_array);
}
}
示例10: b_waiting_catads
function b_waiting_catads()
{
$block = array();
$ads_hnd =& icms_getModuleHandler('ads', 'catads');
$criteria = new icms_db_criteria_Item('waiting', '1', '=');
$nbads = $ads_hnd->getCount($criteria);
if ($nbads > 0) {
$block['adminlink'] = ICMS_URL . "/modules/catads/admin/index.php?action=waiting";
$block['pendingnum'] = $nbads;
$block['lang_linkname'] = _PI_WAITING_WAITINGS;
}
return $block;
}
示例11: billboard_slides_show
function billboard_slides_show()
{
include_once ICMS_ROOT_PATH . '/modules/billboard/include/common.php';
$billboard_slide_handler = icms_getModuleHandler('slide', 'billboard');
$billboard_config = icms_getModuleConfig('billboard');
$criteria = new CriteriaCompo();
$criteria->setStart(0);
$criteria->setLimit(10);
$criteria->setSort('slide_order');
$criteria->setOrder('ASC');
$block = array();
$block['slides'] = $billboard_slide_handler->getObjects($criteria, true, false);
$block['config'] = $billboard_config;
return $block;
}
示例12: content_search
function content_search($queryarray, $andor, $limit, $offset, $userid)
{
$imcontent_content_handler = icms_getModuleHandler('content', basename(dirname(dirname(__FILE__))), 'content');
$contentsArray = $imcontent_content_handler->getContentsForSearch($queryarray, $andor, $limit, $offset, $userid);
$ret = array();
foreach ($contentsArray as $contentArray) {
$item['image'] = "images/content.png";
$item['link'] = $contentArray['itemUrl'];
$item['title'] = $contentArray['content_title'];
$item['time'] = strtotime($contentArray['content_published_date']);
$item['uid'] = $contentArray['content_posterid'];
$ret[] = $item;
unset($item);
}
return $ret;
}
示例13: __construct
/**
* Constructor
* @param object $object reference to targetobject (@link icms_ipf_Object)
* @param string $key the form name
*/
public function __construct($object, $key)
{
$var = $object->vars[$key];
$control = $object->getControl($key);
if (isset($control['delimeter'])) {
$this->_delimeter = $control['delimeter'];
}
parent::__construct($var['form_caption'], $key, $object->getVar($key, 'e'), $this->_delimeter);
// Adding the options inside this Radio element
// If the custom method is not from a module, than it's from the core
if (isset($control['options'])) {
$this->addOptionArray($control['options']);
} else {
// let's find out if the method we need to call comes from an already defined object
if (isset($control['object'])) {
if (method_exists($control['object'], $control['method'])) {
if ($option_array = $control['object']->{$control}['method']()) {
// Adding the options array to the Radio element
$this->addOptionArray($option_array);
}
}
} else {
// finding the itemHandler; if none, let's take the itemHandler of the $object
if (isset($control['itemHandler'])) {
if (!$control['module']) {
// Creating the specified core object handler
$control_handler = icms::handler($control['itemHandler']);
} else {
$control_handler =& icms_getModuleHandler($control['itemHandler'], $control['module']);
}
} else {
$control_handler =& $object->handler;
}
// Checking if the specified method exists
if (method_exists($control_handler, $control['method'])) {
// TODO : How could I pass the parameters in the following call ...
if ($option_array = $control_handler->{$control}['method']()) {
// Adding the options array to the Radio element
$this->addOptionArray($option_array);
}
}
}
}
}
示例14: __construct
/**
* Constructor
* @param object $object reference to targetobject (@link icms_ipf_Object)
* @param string $key the form name
*/
public function __construct($object, $key)
{
$var = $object->vars[$key];
$size = isset($var['size']) ? $var['size'] : ($this->_multiple ? 5 : 1);
// Adding the options inside this SelectBox
// If the custom method is not from a module, than it's from the core
$control = $object->getControl($key);
$value = isset($control['value']) ? $control['value'] : $object->getVar($key, 'e');
parent::__construct($var['form_caption'], $key, $value, $size, $this->_multiple);
if (isset($control['options'])) {
$this->addOptionArray($control['options']);
} else {
// let's find if the method we need to call comes from an already defined object
if (isset($control['object'])) {
if (method_exists($control['object'], $control['method'])) {
if ($option_array = $control['object']->{$control}['method']()) {
// Adding the options array to the select element
$this->addOptionArray($option_array);
}
}
} else {
// finding the itemHandler; if none, let's take the itemHandler of the $object
if (isset($control['itemHandler'])) {
if (!isset($control['module'])) {
// Creating the specified core object handler
$control_handler = icms::handler($control['itemHandler']);
} else {
$control_handler =& icms_getModuleHandler($control['itemHandler'], $control['module']);
}
} else {
$control_handler =& $object->handler;
}
// Checking if the specified method exists
if (method_exists($control_handler, $control['method'])) {
$option_array = call_user_func_array(array($control_handler, $control['method']), isset($control['params']) ? $control['params'] : array());
if (is_array($option_array) && count($option_array) > 0) {
// Adding the options array to the select element
$this->addOptionArray($option_array);
}
}
}
}
}
示例15: __construct
/**
* Constructor
* @param object $object reference to targetobject (@link icms_ipf_Object)
* @param string $key the form name
*/
public function __construct($object, $key)
{
$control = $object->getControl($key);
if (isset($control['delimeter'])) {
$this->_delimeter = $control['delimeter'];
}
parent::__construct($object->vars[$key]['form_caption'], $key, $object->getVar($key), $this->_delimeter);
if (isset($control['options'])) {
$this->addOptionArray($control['options']);
} else {
// let's find if the method we need to call comes from an already defined object
if (isset($control['object'])) {
if (method_exists($control['object'], $control['method'])) {
if ($option_array = $control['object']->{$control}['method']()) {
// Adding the options array to the select element
$this->addOptionArray($option_array);
}
}
} else {
// finding the itemHandler; if none, let's take the itemHandler of the $object
if (isset($control['itemHandler'])) {
if (!isset($control['module'])) {
// Creating the specified core object handler
$control_handler = icms::handler($control['itemHandler']);
} else {
$control_handler =& icms_getModuleHandler($control['itemHandler'], $control['module']);
}
} else {
$control_handler =& $object->handler;
}
// Checking if the specified method exists
if (method_exists($control_handler, $control['method'])) {
$option_array = call_user_func_array(array($control_handler, $control['method']), isset($control['params']) ? $control['params'] : array());
if (is_array($option_array) && count($option_array) > 0) {
// Adding the options array to the select element
$this->addOptionArray($option_array);
}
}
}
}
}