当前位置: 首页>>代码示例>>PHP>>正文


PHP Common::module_factory方法代码示例

本文整理汇总了PHP中Common::module_factory方法的典型用法代码示例。如果您正苦于以下问题:PHP Common::module_factory方法的具体用法?PHP Common::module_factory怎么用?PHP Common::module_factory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Common的用法示例。


在下文中一共展示了Common::module_factory方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: get_link_by_id

 function get_link_by_id($obj_id, $page_link, $node_id = null)
 {
     static $tree_pathes;
     if ($tree_path = explode('/', $page_link)) {
         $this->_tree->recursiveChildCollectFast(1, array('_CATGROUP'), 'ASC', 0, true);
         if (!$tree_pathes[md5($page_link)]) {
             $tree_path = XARRAY::clear_empty_items($tree_path);
             $pages =& Common::module_factory('pages.front');
             if (!$node_id) {
                 $node_id = $pages->_tree->IdByBasicPath($tree_path, array('_PAGE', '_GROUP'), true);
             }
             if ($node_id) {
                 $module = $pages->_common_obj->get_module_by_action($node_id, 'show_catalog_server');
             }
             $module_id = $tree_pathes[md5($page_link)] = $module['params']['showBasicPointId'];
         } else {
             $module_id = $tree_pathes[md5($page_link)];
         }
         $cat_node = $this->_tree->getNodeStruct($obj_id);
         if ($cat_node['obj_type'] == '_CATOBJ') {
             $id = $this->_tree->getAncestor($obj_id);
             $basic = '/' . $cat_node['basic'];
         } else {
             $basic = '';
             $id = $obj_id;
         }
         return $rpath = $page_link . '/' . $this->_tree->calculate_r_path($id, $module_id, array('_CATGROUP'), 2) . $basic;
     }
 }
开发者ID:umaxfun,项目名称:x4m,代码行数:29,代码来源:catalog.front.class.php

示例2: xroute

 function xroute($data)
 {
     if (is_array($data)) {
         foreach ($data as $modulename => $route_function) {
             //wake up module
             if ($module = Common::module_factory($modulename . '.xfront')) {
                 //execute + result context
                 $module->executex($route_function, $this);
             }
         }
     }
 }
开发者ID:umaxfun,项目名称:x4m,代码行数:12,代码来源:front.api.class.php

示例3: start

 function start()
 {
     if ($this->tasks) {
         foreach ($this->tasks as $taskid => $module_task) {
             if ($m = Common::module_factory($module_task['module'] . '.cron')) {
                 if ($module_task['status'] != 3) {
                     $method_name = key($module_task['method']);
                     $this->tasks[$taskid]['status'] = $m->{$method_name}($module_task['method'][$method_name], $this->tasks[$taskid]['status']);
                 }
             }
         }
     }
 }
开发者ID:umaxfun,项目名称:x4m,代码行数:13,代码来源:cron.php

示例4: render_module

 function render_module($id, $call_dynamic = false)
 {
     if (!$call_dynamic) {
         $module = $this->_tree->getNodeInfo($id);
         if (!$module['params']['Active']) {
             return;
         }
     } else {
         $module['params'] = $id;
     }
     if (is_object($module_obj =& Common::module_factory($module['params']['type'] . '.front'))) {
         return $module_obj->execute($module['params'], array('__module_id' => $module['id']));
     }
 }
开发者ID:umaxfun,项目名称:x4m,代码行数:14,代码来源:pages.common.class.php

示例5: restore_it

 function restore_it($params)
 {
     if (is_array($params['id'])) {
         foreach ($params['id'] as $id) {
             if ($rnode = $this->_tree->getNodeInfo($id)) {
                 $m = Common::module_factory($rnode['params']['module'] . '.back');
                 $m->common_call();
                 if ($m->_tree->IsNodeExist($rnode['params']['ancestor'])) {
                     $this->_tree->ExportNodes($id, $m->_tree->getBrachOT());
                     $m->_tree->ImportNodes($rnode['params']['ancestor'], $id, $this->_tree->EXPcache);
                     $this->_tree->DelNode($id);
                     $this->result['isRestor'] = true;
                 }
             }
         }
     }
 }
开发者ID:umaxfun,项目名称:x4m,代码行数:17,代码来源:recycle.back.class.php

示例6: get_cslotz

 function get_cslotz($params)
 {
     global $_DB;
     if (!$params['tpl_name']) {
         $tpl_name = $this->_tree->ReadNodeParam($params['node_id'], 'Template');
     } else {
         $tpl_name = $params['tpl_name'];
     }
     if (!$params['load_all_tpl_slotz']) {
         $tpl_slotz = $this->_common_obj->get_tpl_slotz($tpl_name);
     } else {
         $tpl_slotz = $this->get_tpl_slotz_all(null, true);
     }
     if ($params['node_id']) {
         //для уменьшения объема выборки по модулям
         $node_slots = $this->_common_obj->get_page_slotz($params['node_id']);
         $slotz_in_page = array();
         $slotz_in_page = array_intersect(XARRAY::askeyval($node_slots, 'basic'), XARRAY::askeyval($tpl_slotz, 'basic'));
     }
     if ($tpl_slotz) {
         $i = 0;
         //cборка слотов
         reset($tpl_slotz);
         while (list($id, $tpl_slot) = each($tpl_slotz)) {
             $i++;
             if (!$params['get_modules_only']) {
                 $this->result['slotz'][$i]['basic'] = $tpl_slot['basic'];
                 $this->result['slotz'][$i]['alias'] = $tpl_slot['params']['SlotAlias'];
             }
             if (($fkey = array_search($tpl_slot['basic'], $slotz_in_page)) !== false) {
                 //проверка на модули
                 //if ((!$params['tpl_name'])&&(!$params['get_slotz_only']))
                 //  {
                 //$modules=$this->_tree->GetChildsParam($fkey, '%', true);
                 $mk[$fkey] = $tpl_slot['basic'];
                 //   $this->result['modules'][$tpl_slot['basic']]=$this->_tree->GetChildsParam($fkey, '%', true);
                 // }
             }
         }
         if ($mk && !$params['tpl_name'] && !$params['get_slotz_only']) {
             if ($modules_crotch = $this->_tree->get_anc_multiply_childs(array_keys($mk), array('_MODULE'), true)) {
                 foreach ($modules_crotch as $id => $module) {
                     $mi = Common::module_factory($module['params']['type'] . '.front');
                     $module['params']['RAction'] = $mi->_common_obj->front_action_list[$module['params']['Action']]['front_name'];
                     if (method_exists($mi->_common_obj, $method = $module['params']['Action'] . '_extra')) {
                         $module['params'] = $mi->_common_obj->{$method}($module['params']);
                     }
                     $this->result['modules'][$mk[$module['ancestor']]][$id] = $module;
                 }
             }
         }
         return true;
     }
 }
开发者ID:umaxfun,项目名称:x4m,代码行数:54,代码来源:pages.back.class.php

示例7: call_module_method

 public static function call_module_method($module, $func, $params)
 {
     if (!is_object($module)) {
         $m = Common::module_factory($module);
     } else {
         $m = $module;
     }
     if (method_exists($m, $func)) {
         return call_user_func_array(array($m, $func), $params);
     }
 }
开发者ID:umaxfun,项目名称:x4m,代码行数:11,代码来源:helpers.php

示例8: call_module

 function call_module($params)
 {
     Common::module_factory($params[0]);
 }
开发者ID:umaxfun,项目名称:x4m,代码行数:4,代码来源:helpers.tpl.php

示例9: load_xlist_data

 function load_xlist_data($parameters)
 {
     $catalog =& Common::module_factory('catalog.back');
     $catalog->common_call();
     $catalog->load_xlist_data($parameters);
     $this->result['data_set'] = $catalog->result['data_set'];
 }
开发者ID:umaxfun,项目名称:x4m,代码行数:7,代码来源:ishop.back.class.php

示例10: intialize_trees_roots

 function intialize_trees_roots()
 {
     $mod_list = Common::get_module_list();
     if ($mod_list) {
         foreach ($mod_list as $module) {
             $_module =& Common::module_factory($module['name'] . '.back');
             if ($_module) {
                 if (method_exists($_module, 'common_call')) {
                     $_module->common_call();
                     if ($_module->_tree) {
                         $_module->_tree->WriteNodeParam(1, 'Name', $module['alias'] . '(' . $_SERVER["HTTP_HOST"] . ')');
                     }
                     $this->result['modules'][] = 'Модуль ' . $module['name'] . " инициализирован\r\n";
                 }
             }
         }
     }
 }
开发者ID:umaxfun,项目名称:x4m,代码行数:18,代码来源:install.php

示例11: on_module_save

 function on_module_save($params, $page_id)
 {
     $pages = Common::module_factory('pages.back');
     $pages->set_routes_to_server($page_id, 'showcontent');
     return $params;
 }
开发者ID:umaxfun,项目名称:x4m,代码行数:6,代码来源:content.back.class.php


注:本文中的Common::module_factory方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。