Esempio n. 1
0
 function show_logs_on_main_page($xcall = false)
 {
     global $TMS, $_PATH;
     if (!$TMS->isSectionDefined('last_modification')) {
         $lang = Common::get_module_lang('admin', $_SESSION['lang'], 'run');
         $TMS->AddFileSection(Common::translate_to(file($_PATH['PATH_ADM'] . 'tpl/run.html'), $lang));
     }
     if ($logs = logger::getLogs()) {
         Common::call_common_instance('users');
         $users =& users_module_common::getInstance();
         $users_list = XARRAY::arr_to_lev($users->load_users_list(), 'id', 'params', 'Name');
         $mod_list = XARRAY::arr_to_keyarr(admin_mod::get_module_list(), 'name', 'alias');
         $actions = $users->collect_module_actions();
         $lm = '';
         foreach ($logs as $log) {
             if ($action = $actions[$log['module']][$log['action']]) {
                 $log['action'] = $action;
             }
             $log['module'] = $mod_list[$log['module']];
             $log['user'] = $users_list[$log['user_id']];
             $log['time'] = date("d.m.y G:i:s", $log['time']);
             $TMS->AddMassReplace('last_modification', $log);
             if (!$xcall) {
                 $TMS->parseSection('last_modification', true);
             } else {
                 $lm .= $TMS->parseSection('last_modification', false, true);
             }
         }
         if ($xcall) {
             return $lm;
         }
     }
 }
Esempio n. 2
0
 function show_forms_extra($params)
 {
     $this->obj_tree->GetFullBonesUp($params['formsId']);
     if ($this->obj_tree->FullBonesMas) {
         $params['_Extra'] = $params['showformsName'] = implode('/', XARRAY::arr_to_lev($this->obj_tree->FullBonesMas, 'id', 'params', 'Name'));
     }
     $this->obj_tree->FullBonesMas = null;
     return $params;
 }
Esempio n. 3
0
 function loadRoles($user_id)
 {
     $roles_scheme = array();
     $node = $this->_tree->GetAncestor($user_id);
     if ($node = $this->_tree->getNodeInfo($node)) {
         if (is_array($roles = explode(':', $node['params']['Roles']))) {
             $ms = array();
             foreach ($roles as $role_id) {
                 if ($maccess = XARRAY::arr_to_lev($this->rolesTree->GetChildsParam($role_id, array('is_accesible'), true), 'basic', 'params', 'is_accesible')) {
                     $ms = array_merge(XARRAY::clear_empty_items($maccess), $ms);
                 }
             }
             return array($roles, $ms);
         }
     }
 }
Esempio n. 4
0
 function get_fields_data($id)
 {
     return XARRAY::arr_to_lev($this->obj_tree->GetChildsParam($id, array('field_value'), true), 'basic', 'params', 'field_value');
 }
Esempio n. 5
0
 function get_action_properties($parameters)
 {
     global $TMS, $Adm;
     if (array_key_exists($parameters['Action'], $this->_common_obj->get_actions())) {
         $TMS->AddFileSection($Adm->load_module_tpls($this->_module_name, array(array('tpl_name' => 'ainterface')), true), true);
         switch ($parameters['Action']) {
             case 'show_search_form':
                 $this->result['action_properties'] = true;
                 $files = Common::get_module_template_list('search', array('.' . $parameters['Action'] . '.html'));
                 $this->result['action_properties_form']['Template'] = XHTML::arr_select_opt(XARRAY::combine($files, $files), null, true);
                 Common::call_common_instance('pages');
                 $pages =& pages_module_common::getInstance();
                 $this->result['action_properties_form']['Destination_page'] = XHTML::arr_select_opt(XARRAY::arr_to_lev($pages->get_page_module_servers('search_server'), 'id', 'params', 'Name'), false, true);
                 $this->lct['action_properties'] = $TMS->parseSection('show_search_form');
                 break;
             case 'search_server':
                 $this->result['action_properties'] = true;
                 $files = Common::get_module_template_list($this->_module_name, array('.' . $parameters['Action'] . '.html'));
                 $this->result['action_properties_form']['Template'] = XHTML::arr_select_opt(XARRAY::combine($files, $files), null, true);
                 $this->lct['action_properties'] = $TMS->parseSection('search_server');
                 break;
         }
     }
 }
Esempio n. 6
0
 function get_action_properties($parameters)
 {
     global $TMS, $Adm;
     if (array_key_exists($parameters['Action'], $this->_common_obj->get_actions())) {
         $TMS->AddFileSection($Adm->load_module_tpls($this->_module_name, array(array('tpl_name' => 'ainterface')), true), true);
         switch ($parameters['Action']) {
             case 'show_categories':
                 $this->result['xlist'] = true;
                 $this->result['action_properties'] = true;
                 Common::call_common_instance('pages');
                 $pages =& pages_module_common::getInstance();
                 $this->result['action_properties_form']['page'] = XHTML::arr_select_opt(XARRAY::arr_to_lev($pages->get_page_module_servers('show_faq_server'), 'id', 'params', 'Name'), false, true);
                 $root = $this->_tree->GetChildsParam(1);
                 $this->result['action_properties_form']['folder'] = XHTML::arr_select_opt(XARRAY::askeyval($root, 'Name'), null, true);
                 $this->lct['action_properties'] = $TMS->parseSection($parameters['Action']);
                 $files = Common::get_module_template_list($this->_module_name, array('.show_categories.html'));
                 $this->result['action_properties_form']['Template'] = XHTML::arr_select_opt(XARRAY::combine($files, $files), $se, true);
                 break;
             case 'show_folder_questions':
                 $this->result['xlist'] = true;
                 $this->result['action_properties'] = true;
                 Common::call_common_instance('pages');
                 $pages =& pages_module_common::getInstance();
                 $this->result['action_properties_form']['page'] = XHTML::arr_select_opt(XARRAY::arr_to_lev($pages->get_page_module_servers('show_faq_server'), 'id', 'params', 'Name'), false, true);
                 $root = $this->_tree->GetChildsParam(1);
                 $this->result['action_properties_form']['folder'] = XHTML::arr_select_opt(XARRAY::askeyval($root, 'Name'), null, true);
                 $this->lct['action_properties'] = $TMS->parseSection($parameters['Action']);
                 $files = Common::get_module_template_list($this->_module_name, array('.' . $parameters['Action'] . '.html'));
                 $this->result['action_properties_form']['Template'] = XHTML::arr_select_opt(XARRAY::combine($files, $files), $se, true);
                 break;
             case 'show_faq_server':
                 $this->result['action_properties'] = true;
                 $this->result['xlist'] = false;
                 $files = Common::get_module_template_list($this->_module_name, array('.show_question.html'));
                 $this->result['action_properties_form']['qTemplate'] = XHTML::arr_select_opt(XARRAY::combine($files, $files), $se, true);
                 $files = Common::get_module_template_list($this->_module_name, array('.show_category.html'));
                 $this->result['action_properties_form']['cTemplate'] = XHTML::arr_select_opt(XARRAY::combine($files, $files), $se, true);
                 $this->result['action_properties_form']['Default_action'] = XHTML::arr_select_opt(XARRAY::askeyval($this->_common_obj->get_non_server_actions(), 'front_name'), null, true);
                 $root = $this->_tree->GetChildsParam(1);
                 $this->result['action_properties_form']['root'] = XHTML::arr_select_opt(XARRAY::askeyval($root, 'Name'), null, true);
                 $this->lct['action_properties'] = $TMS->parseSection($parameters['Action']);
                 break;
             case 'show_selected_category':
                 $this->result['action_properties'] = true;
                 Common::call_common_instance('pages');
                 $pages =& pages_module_common::getInstance();
                 $this->result['action_properties_form']['Destination_page'] = XHTML::arr_select_opt(XARRAY::arr_to_lev($pages->get_page_module_servers('show_faq_server'), 'id', 'params', 'Name'), false, true);
                 $this->result['xlist'] = true;
                 $files = Common::get_module_template_list($this->_module_name, array('.show_category.html'));
                 $this->result['action_properties_form']['Template'] = XHTML::arr_select_opt(XARRAY::combine($files, $files), $se, true);
                 $this->lct['action_properties'] = $TMS->parseSection($parameters['Action']);
                 break;
             case 'show_faq_search':
                 $this->result['action_properties'] = true;
                 Common::call_common_instance('pages');
                 $pages =& pages_module_common::getInstance();
                 $this->result['action_properties_form']['Destination_page'] = XHTML::arr_select_opt(XARRAY::arr_to_lev($pages->get_page_module_servers('show_faq_search_server'), 'id', 'params', 'Name'), false, true);
                 $this->result['xlist'] = false;
                 $files = Common::get_module_template_list($this->_module_name, array('.' . $parameters['Action'] . '.html'));
                 $this->result['action_properties_form']['Template'] = XHTML::arr_select_opt(XARRAY::combine($files, $files), $se, true);
                 $this->lct['action_properties'] = $TMS->parseSection($parameters['Action']);
                 break;
             case 'show_faq_search_server':
                 $this->result['action_properties'] = true;
                 $this->result['xlist'] = false;
                 $this->result['action_properties_form']['Default_action'] = XHTML::arr_select_opt(XARRAY::askeyval($this->_common_obj->get_non_server_actions(), 'front_name'), null, true);
                 Common::call_common_instance('pages');
                 $pages =& pages_module_common::getInstance();
                 $this->result['action_properties_form']['MDestination_page'] = XHTML::arr_select_opt(XARRAY::arr_to_lev($pages->get_page_module_servers('show_faq_server'), 'id', 'params', 'Name'), false, true);
                 $files = Common::get_module_template_list($this->_module_name, array('.show_search_results.html'));
                 $this->result['action_properties_form']['MTemplate'] = XHTML::arr_select_opt(XARRAY::combine($files, $files), $se, true);
                 $this->lct['action_properties'] = $TMS->parseSection($parameters['Action']);
                 break;
         }
     }
 }
Esempio n. 7
0
 function getDiscoutsSchemes()
 {
     return XARRAY::arr_to_lev($this->discount_scheme_tree->GetChildsParam(1, '%', true), 'id', 'params', 'Name');
 }
Esempio n. 8
0
 function get_action_properties($parameters)
 {
     global $TMS, $Adm;
     if (array_key_exists($parameters['Action'], $this->_common_obj->get_actions())) {
         $TMS->AddFileSection($Adm->load_module_tpls($this->_module_name, array(array('tpl_name' => 'ainterface')), true), true);
         switch ($parameters['Action']) {
             case 'show_news_by_author':
                 $this->result['action_properties'] = true;
                 Common::call_common_instance('pages');
                 $pages =& pages_module_common::getInstance();
                 $this->result['action_properties_form']['Destination_page'] = XHTML::arr_select_opt(XARRAY::arr_to_lev($pages->get_page_module_servers('show_news_server'), 'id', 'params', 'Name'), false, true);
                 $files = Common::get_module_template_list($this->_module_name, array('.show_news_interval.html', '.' . $parameters['Action'] . '.html'));
                 $this->result['action_properties_form']['Template'] = XHTML::arr_select_opt(XARRAY::combine($files, $files), $se, true);
                 Common::call_common_instance('users');
                 $users =& users_module_common::getInstance();
                 $this->result['action_properties_form']['author_id'] = XHTML::arr_select_opt(XARRAY::arr_to_lev($users->load_users_list(true), 'id', 'params', 'Name'), false, true);
                 $this->lct['action_properties'] = $TMS->parseSection($parameters['Action']);
                 break;
             case 'show_news_interval':
                 $this->result['action_properties'] = true;
                 Common::call_common_instance('pages');
                 $pages =& pages_module_common::getInstance();
                 $this->result['action_properties_form']['Destination_page'] = XHTML::arr_select_opt(XARRAY::arr_to_lev($pages->get_page_module_servers('show_news_server'), 'id', 'params', 'Name'), false, true);
                 $files = Common::get_module_template_list($this->_module_name, array('.' . $parameters['Action'] . '.html'));
                 $this->get_categories('action_properties_form', null, true, 'Category');
                 $this->result['action_properties_form']['Template'] = XHTML::arr_select_opt(XARRAY::combine($files, $files), $se, true);
                 $this->lct['action_properties'] = $TMS->parseSection($parameters['Action']);
                 break;
             case 'show_news_archive':
                 $this->result['action_properties'] = true;
                 Common::call_common_instance('pages');
                 $pages =& pages_module_common::getInstance();
                 $this->result['action_properties_form']['Destination_page'] = XHTML::arr_select_opt(XARRAY::arr_to_lev($pages->get_page_module_servers('show_news_server'), 'id', 'params', 'Name'), false, true);
                 $files = Common::get_module_template_list($this->_module_name, array('.show_news_interval.html', '.' . $parameters['Action'] . '.html'));
                 $this->get_categories('action_properties_form', null, true, 'Category');
                 $this->result['action_properties_form']['Template'] = XHTML::arr_select_opt(XARRAY::combine($files, $files), $se, true);
                 $this->lct['action_properties'] = $TMS->parseSection($parameters['Action']);
                 break;
             case 'show_news_categories':
                 $this->result['action_properties'] = true;
                 Common::call_common_instance('pages');
                 $pages =& pages_module_common::getInstance();
                 $this->result['action_properties_form']['Destination_page'] = XHTML::arr_select_opt(XARRAY::arr_to_lev($pages->get_page_module_servers('show_news_server'), 'id', 'params', 'Name'), false, true);
                 $files = Common::get_module_template_list($this->_module_name, array('.' . $parameters['Action'] . '.html'));
                 $this->result['action_properties_form']['Template'] = XHTML::arr_select_opt(XARRAY::combine($files, $files), $se, true);
                 $this->result['action_properties_form']['TemplateInterval'] = $this->result['action_properties_form']['Template'];
                 $this->result['action_properties_form']['TemplateSingle'] = $this->result['action_properties_form']['Template'];
                 $this->lct['action_properties'] = $TMS->parseSection($parameters['Action']);
                 break;
             case 'show_news_server':
                 $this->result['action_properties'] = true;
                 $files = Common::get_module_template_list($this->_module_name, array('.show_news_interval.html', '.' . $parameters['Action'] . '.html'));
                 $this->result['action_properties_form']['Default_action'] = XHTML::arr_select_opt(XARRAY::askeyval($this->_common_obj->get_non_server_actions(), 'front_name'), null, true);
                 $this->result['action_properties_form']['MTemplate'] = XHTML::arr_select_opt(XARRAY::combine($files, $files), $se, true);
                 $this->lct['action_properties'] = $TMS->parseSection($parameters['Action']);
         }
     }
 }
Esempio n. 9
0
 function get_action_properties($parameters)
 {
     global $TMS, $Adm;
     if (array_key_exists($parameters['Action'], $this->_common_obj->get_actions())) {
         $TMS->AddFileSection($Adm->load_module_tpls($this->_module_name, array(array('tpl_name' => 'ainterface')), true), true);
         switch ($parameters['Action']) {
             case 'show_gallery_list':
                 Common::call_common_instance('pages');
                 $pages =& pages_module_common::getInstance();
                 $this->result['action_properties'] = true;
                 $this->result['xlist'] = false;
                 $galleries = $this->_tree->GetChilds(1, 'ASC', 0, 0, '_GALLERY');
                 $sel_galleries = array(array("value" => "", "text" => ""));
                 foreach ($galleries as $gallery) {
                     $node = $this->_tree->GetNodeParam($gallery["id"]);
                     $sel_galleries[] = array("value" => $gallery["id"], "text" => $node["Name"]);
                 }
                 $this->result['action_properties_form']['GalleryStartId'] = $sel_galleries;
                 $this->result['action_properties_form']['Template'] = $this->get_template_list($this->_module_name, array('.' . $parameters['Action'] . '.html'));
                 $this->result['action_properties_form']['page'] = XHTML::arr_select_opt(XARRAY::arr_to_lev($pages->get_page_module_servers(array('show_gallery_server', 'show_selected_gallery')), 'id', 'params', 'Name'), false, true);
                 $this->lct['action_properties'] = $TMS->parseSection($parameters['Action']);
                 break;
             case 'show_selected_album':
                 $this->result['action_properties'] = true;
                 $this->result['xlist'] = true;
                 $this->result['action_properties_form']['Template'] = $this->get_template_list($this->_module_name, array('.' . $parameters['Action'] . '.html'));
                 Common::call_common_instance('pages');
                 $pages =& pages_module_common::getInstance();
                 $pppp = $pages->get_page_module_servers('show_search_results');
                 $this->result['action_properties_form']['page'] = XHTML::arr_select_opt(XARRAY::arr_to_lev($pages->get_page_module_servers('show_search_results'), 'id', 'params', 'Name'), false, true);
                 $albums = $this->_tree->GetChilds();
                 $this->lct['action_properties'] = $TMS->parseSection($parameters['Action']);
                 break;
             case 'show_from_folder':
                 $this->result['action_properties'] = true;
                 $files = Common::get_module_template_list('gallery');
                 $this->result['xlist'] = false;
                 $this->result['action_properties_form']['Template'] = $this->get_template_list($this->_module_name, array('.' . $parameters['Action'] . '.html'));
                 Common::call_common_instance('pages');
                 $pages =& pages_module_common::getInstance();
                 $pppp = $pages->get_page_module_servers('show_search_results');
                 $this->result['action_properties_form']['page'] = XHTML::arr_select_opt(XARRAY::arr_to_lev($pages->get_page_module_servers('show_search_results'), 'id', 'params', 'Name'), false, true);
                 $albums = $this->_tree->GetChilds();
                 $this->result['action_properties_form']['GalleryStart'] = XHTML::arr_select_opt(XARRAY::arr_to_keyarr($this->_tree->GetChilds(1), 'id', 'basic'), $category_selected, true);
                 $this->lct['action_properties'] = $TMS->parseSection($parameters['Action']);
                 break;
             case 'show_gallery_server':
                 $this->result['action_properties'] = true;
                 $files = Common::get_module_template_list('gallery');
                 $this->result['xlist'] = null;
                 $this->result['action_properties_form']['MTemplate'] = $this->get_template_list($this->_module_name, array('.show_selected_album.html'));
                 $this->result['action_properties_form']['Default_action'] = XHTML::arr_select_opt(XARRAY::askeyval($this->_common_obj->get_non_server_actions(), 'front_name'), null, true);
                 $this->lct['action_properties'] = $TMS->parseSection($parameters['Action']);
                 break;
             case 'show_search_results':
                 $this->result['action_properties'] = true;
                 $this->result['xlist'] = false;
                 $this->result['action_properties_form']['Template'] = $this->get_template_list($this->_module_name, array(''));
                 $this->lct['action_properties'] = $TMS->parseSection($parameters['Action']);
                 break;
         }
     }
 }
Esempio n. 10
0
 function add_form($params)
 {
     $this->result['categories']['category'] = XHTML::arr_select_opt(XARRAY::arr_to_lev($this->_tree->GetChildsParam(1, '%', true, array('obj_type' => array('_FORMSGROUP'))), 'id', 'params', 'Name'), $params['group_id'], true);
 }
Esempio n. 11
0
 function get_action_properties($parameters)
 {
     global $TMS, $Adm;
     if (array_key_exists($parameters['Action'], $this->_common_obj->get_actions())) {
         $TMS->AddFileSection($Adm->load_module_tpls($this->_module_name, array(array('tpl_name' => 'ainterface')), true), true);
         switch ($parameters['Action']) {
             case 'show_content':
                 $this->result['action_properties'] = true;
                 $files = Common::get_module_template_list('content', array('.' . $parameters['Action'] . '.html'));
                 $this->result['action_properties_form']['Template'] = XHTML::arr_select_opt(XARRAY::combine($files, $files), $se, true);
                 //включает xlist
                 $this->result['xlist'] = true;
                 $this->result['action_template'] = true;
                 $this->lct['action_properties'] = $TMS->parseSection('show_content');
                 break;
             case 'show_content_announce':
                 $this->result['action_properties'] = true;
                 $files = Common::get_module_template_list('content', array('show_content', '.' . $parameters['Action'] . '.html'));
                 $this->result['action_properties_form']['aTemplate'] = XHTML::arr_select_opt(XARRAY::combine($files, $files), $se, true);
                 $this->result['action_properties_form']['show_category_with_link_contents_list'] = Common::call_common_instance('pages');
                 $pages =& pages_module_common::getInstance();
                 $this->result['action_properties_form']['page'] = XHTML::arr_select_opt(XARRAY::arr_to_lev($pages->get_page_module_servers('content_server'), 'id', 'params', 'Name'), false, true);
                 //включает xlist
                 $this->result['xlist'] = true;
                 $this->result['action_template'] = true;
                 $this->lct['action_properties'] = $TMS->parseSection('show_content_announce');
                 break;
             case 'show_contents_list':
                 $this->result['action_properties'] = true;
                 $categories = $this->result['Category'] = $files = Common::get_module_template_list('content', array('.' . $parameters['Action'] . '.html'));
                 $this->result['action_properties_form']['xTemplate'] = XHTML::arr_select_opt(XARRAY::combine($files, $files), $se, true);
                 Common::call_common_instance('pages');
                 $pages =& pages_module_common::getInstance();
                 $this->result['action_properties_form']['Category'] = XHTML::arr_select_opt(XARRAY::arr_to_keyarr($this->_tree->GetChilds(1), 'id', 'basic'), false, true);
                 $this->result['action_properties_form']['page'] = XHTML::arr_select_opt(XARRAY::arr_to_lev($pages->get_page_module_servers('content_server'), 'id', 'params', 'Name'), false, true);
                 $this->result['xlist'] = false;
                 $this->result['action_template'] = true;
                 $this->lct['action_properties'] = $TMS->parseSection('show_contents_list');
                 break;
             case 'show_contentgroups_list':
                 $this->result['action_properties'] = true;
                 $files = Common::get_module_template_list('content', array('.' . $parameters['Action'] . '.html'));
                 $this->result['action_properties_form']['Template'] = XHTML::arr_select_opt(XARRAY::combine($files, $files), $se, true);
                 Common::call_common_instance('pages');
                 $pages =& pages_module_common::getInstance();
                 $this->result['action_properties_form']['page'] = XHTML::arr_select_opt(XARRAY::arr_to_lev($pages->get_page_module_servers('content_server'), 'id', 'params', 'Name'), false, true);
                 //$this->result['xlist']                         =true;
                 $this->lct['action_properties'] = $TMS->parseSection('show_contentgroups_list');
                 break;
             case 'content_server':
                 $this->result['action_properties'] = true;
                 $files = Common::get_module_template_list($this->_module_name, array('.show_content.html', '.' . $parameters['Action'] . '.html'));
                 $this->result['action_properties_form']['Template'] = XHTML::arr_select_opt(XARRAY::combine($files, $files), $se, true);
                 Common::call_common_instance('pages');
                 $pages =& pages_module_common::getInstance();
                 $this->result['xlist'] = false;
                 $this->result['action_template'] = true;
                 $this->lct['action_properties'] = $TMS->parseSection('content_server');
                 $this->result['action_properties_form']['Default_action'] = XHTML::arr_select_opt(XARRAY::askeyval($this->_common_obj->get_non_server_actions(), 'front_name'), null, true);
                 break;
         }
     }
 }
Esempio n. 12
0
 function show_search_form($params)
 {
     global $TMS, $TPA;
     static $property_sets;
     $psets =& $this->_common_obj->property_sets;
     $TMS->AddFileSection(Common::get_site_tpl($this->_module_name, $params['SearchTemplate']));
     if ($params["SearchProperty_set"]) {
         $TMS->AddReplace('_catalog_show_search', 'SearchProperty_set', $params["SearchProperty_set"]);
     }
     if ($params["ancestor"]) {
         $TMS->AddReplace('_catalog_show_search', 'ancestor', $params["ancestor"]);
     }
     // ??
     Common::call_common_instance('pages');
     $pages =& pages_module_common::getInstance();
     $cat_action = $pages->create_page_path($params['Destination_page']) . '/~catsearch/';
     $TMS->AddReplace('_catalog_show_search', 'action', $cat_action);
     if (!empty($_POST['search'])) {
         $spack = $_POST['search'];
     } elseif ($_SESSION['catalog']['last_search_form']) {
         $spack = $_SESSION['catalog']['last_search_form'];
     }
     if (is_array($spack)) {
         foreach ($spack as $group => $value) {
             if (is_array($value)) {
                 foreach ($value as $k => $v) {
                     $fields_values[$group . '_' . $k] = $v;
                 }
             }
         }
     }
     $_SESSION['catalog']['last_search_form'] = $spack;
     $sform = $this->_common_obj->search_forms_tree->GetNodeParam($params["SearchForm"]);
     $TMS->AddReplace('_catalog_show_search', 'SFromName', $sform["Name"]);
     $i = 0;
     if ($sfields = $this->_common_obj->search_forms_tree->GetChildsParam($params['SearchForm'], '%')) {
         foreach ($sfields as $sfid => $sfield) {
             //DebugBreak();
             if (!$property_sets[$sfield['property_set']]) {
                 if (!$psets[$sfield['property_set']]) {
                     $psets[$sfield['property_set']] = $this->_common_obj->get_properties($sfield['property_set']);
                 }
                 $prp = $psets[$sfield['property_set']];
                 if ($prp) {
                     $property_sets[$sfield['property_set']] = array(array_flip(XARRAY::arr_to_lev($prp, 'id', 'params', 'Name')), $prp);
                 } else {
                     $property_sets[$sfield['property_set']] = array();
                 }
             }
             $section = '_catalog_search_' . $sfield['criteria'];
             $psets = $property_sets[$sfield['property_set']][1][$property_sets[$sfield['property_set']][0][$sfield['property']]]['params'];
             if ($psets['catselector']) {
                 $sfield = $sfield + array('catselector' => $psets['catselector']);
             }
             $sfield = $sfield + array('type' => $psets['Type']);
             switch ($sfield['criteria']) {
                 case 'interval':
                     $sfield = $sfield + array('from' => 'search[from][' . $sfield['property'] . ']', 'to' => 'search[to][' . $sfield['property'] . ']', 'from_value' => $fields_values['from_' . $sfield['property']], 'to_value' => $fields_values['to_' . $sfield['property']]);
                     break;
                 case 'larger':
                     $sfield = $sfield + array('input_name' => 'search[from][' . $sfield['property'] . ']', 'value' => $fields_values['from_' . $sfield['property']]);
                     break;
                 case 'less':
                     $sfield = $sfield + array('input_name' => 'search[to][' . $sfield['property'] . ']', 'value' => $fields_values['to_' . $sfield['property']]);
                     break;
                 case 'equal':
                     $evalues = $params["search_objects"][$sfield['property']];
                     if ($evalues) {
                         $sfield['E_values'] = $evalues;
                     }
                     $sfield = $sfield + array('input_name' => 'search[' . $sfield['criteria'] . '][' . $sfield['property'] . ']', 'value' => $fields_values[$sfield['criteria'] . '_' . $sfield['property']]);
                     break;
                 case 'rlike':
                 case 'lrlike':
                 case 'rwords':
                     $sfield = $sfield + array('input_name' => 'search[' . $sfield['criteria'] . '][' . $sfield['property'] . ']', 'value' => $fields_values[$sfield['criteria'] . '_' . $sfield['property']]);
                     break;
             }
             $sfield["_num"] = $i++;
             //DebugBreak();
             $TMS->AddMassReplace($section, $sfield);
             $TMS->parseSection($section, true);
             $TMS->clear_section_fields($section);
         }
     }
     //if ($params[""])$TMS->AddMassReplace('_catalog_show_search', $fields_values);
     $TMS->AddMassReplace('_catalog_show_search', $fields_values);
     return $TMS->parseSection('_catalog_show_search');
 }
Esempio n. 13
0
 function get_action_properties($parameters)
 {
     global $TMS, $Adm;
     if (array_key_exists($parameters['Action'], $this->_common_obj->get_actions())) {
         $TMS->AddFileSection($Adm->load_module_tpls($this->_module_name, array(array('tpl_name' => 'ainterface')), true), true);
         Common::call_common_instance('pages');
         $pages =& pages_module_common::getInstance();
         if ($this->ishop) {
             $this->result['action_properties_form']['BasketPage'] = XHTML::arr_select_opt(XARRAY::arr_to_lev($pages->get_page_module_servers('show_ishop_basket'), 'id', 'params', 'Name'), false, true);
             $TMS->parseSection('ishop', true);
         }
         switch ($parameters['Action']) {
             case 'show_level_catmenu':
                 $this->result['action_properties'] = true;
                 $files = Common::get_module_template_list('catalog', array('.' . $parameters['Action'] . '.html'));
                 $this->result['xlist'] = true;
                 $this->result['action_properties_form']['Destination_page'] = XHTML::arr_select_opt(XARRAY::arr_to_lev($pages->get_page_module_servers('show_catalog_server'), 'id', 'params', 'Name'), false, true);
                 $this->result['action_properties_form']['Template'] = XHTML::arr_select_opt(XARRAY::combine($files, $files), $se, true);
                 $this->lct['action_properties'] = $TMS->parseSection($parameters['Action']);
                 $this->result['action_properties_form']['Cat_destination_page'] = XHTML::arr_select_opt(XARRAY::arr_to_lev($pages->get_page_module_servers('show_catalog_server'), 'id', 'params', 'Name'), false, true);
                 break;
             case 'show_catalog_server':
                 $this->result['action_properties'] = true;
                 $files = Common::get_module_template_list('catalog', array('.' . $parameters['Action'] . '.html', '.show_object.html', '.show_category.html'));
                 $tpls = XHTML::arr_select_opt(XARRAY::combine($files, $files), $se, true);
                 $this->result['action_properties_form']['CategoryTemplate'] = $tpls;
                 $this->result['action_properties_form']['ObjectTemplate'] = $tpls;
                 $this->result['url_point_xlist'] = true;
                 $this->result['action_properties_form']['Default_action'] = XHTML::arr_select_opt(XARRAY::askeyval($this->_common_obj->get_non_server_actions(), 'front_name'), null, true);
                 $this->lct['action_properties'] = $TMS->parseSection($parameters['Action']);
                 break;
             case 'show_search_results':
                 $this->result['action_properties'] = true;
                 $files = Common::get_module_template_list('catalog', array('.' . $parameters['Action'] . '.html'));
                 $tpls = XHTML::arr_select_opt(XARRAY::combine($files, $files), $se, true);
                 $this->result['action_properties_form']['Destination_page'] = XHTML::arr_select_opt(XARRAY::arr_to_lev($pages->get_page_module_servers('show_catalog_server'), 'id', 'params', 'Name'), false, true);
                 $this->result['action_properties_form']['ResultTemplate'] = $tpls;
                 $this->lct['action_properties'] = $TMS->parseSection($parameters['Action']);
                 break;
             case 'show_search_form':
                 $this->result['action_properties'] = true;
                 $files = Common::get_module_template_list('catalog', array('.' . $parameters['Action'] . '.html'));
                 $tpls = XHTML::arr_select_opt(XARRAY::combine($files, $files), $se, true);
                 $this->result['action_properties_form']['SearchTemplate'] = $tpls;
                 $this->result['action_properties_form']['SearchForm'] = XHTML::arr_select_opt(XARRAY::askeyval($this->_common_obj->search_forms_tree->GetChildsParam(1, '%'), 'Name'), false, true);
                 $this->result['action_properties_form']['Destination_page'] = XHTML::arr_select_opt(XARRAY::arr_to_lev($pages->get_page_module_servers('show_search_results'), 'id', 'params', 'Name'), false, true);
                 $this->lct['action_properties'] = $TMS->parseSection($parameters['Action']);
                 break;
             case 'show_smart_search_form':
                 $this->result['action_properties'] = true;
                 $files = Common::get_module_template_list('catalog', array('.' . $parameters['Action'] . '.html'));
                 $tpls = XHTML::arr_select_opt(XARRAY::combine($files, $files), $se, true);
                 $this->result['action_properties_form']['SearchTemplate'] = $tpls;
                 $this->result['action_properties_form']['Destination_page'] = XHTML::arr_select_opt(XARRAY::arr_to_lev($pages->get_page_module_servers('show_search_results'), 'id', 'params', 'Name'), false, true);
                 $this->lct['action_properties'] = $TMS->parseSection($parameters['Action']);
                 break;
             case 'show_branch_info':
                 $this->result['action_properties'] = true;
                 $files = Common::get_module_template_list('catalog', array('.' . $parameters['Action'] . '.html'));
                 $tpls = XHTML::arr_select_opt(XARRAY::combine($files, $files), $se, true);
                 $this->result['action_properties_form']['Template'] = $tpls;
                 $this->result['action_properties_form']['SearchForm'] = XHTML::arr_select_opt(XARRAY::askeyval($this->_common_obj->search_forms_tree->GetChildsParam(1, '%'), 'Name'), false, true);
                 $this->lct['action_properties'] = $TMS->parseSection($parameters['Action']);
                 break;
             case 'catalog_filter':
                 $this->result['action_properties'] = true;
                 $files = Common::get_module_template_list('catalog', array('.' . $parameters['Action'] . '.html'));
                 $tpls = XHTML::arr_select_opt(XARRAY::combine($files, $files), $se, true);
                 $this->result['action_properties_form']['Destination_page'] = XHTML::arr_select_opt(XARRAY::arr_to_lev($pages->get_page_module_servers('show_catalog_server'), 'id', 'params', 'Name'), false, true);
                 $this->result['action_properties_form']['FilterTemplate'] = $tpls;
                 $this->lct['action_properties'] = $TMS->parseSection($parameters['Action']);
                 break;
             case 'catalog_comparsion':
                 $this->result['action_properties'] = true;
                 $files = Common::get_module_template_list('catalog', array('.' . $parameters['Action'] . '.html'));
                 $tpls = XHTML::arr_select_opt(XARRAY::combine($files, $files), $se, true);
                 $this->result['action_properties_form']['ComparsionTemplate'] = $tpls;
                 $this->lct['action_properties'] = $TMS->parseSection($parameters['Action']);
                 break;
             case 'show_category':
                 $this->result['action_properties'] = true;
                 Common::call_common_instance('pages');
                 $pages =& pages_module_common::getInstance();
                 $files = Common::get_module_template_list('catalog', array('.' . $parameters['Action'] . '.html'));
                 $this->result['xlist'] = true;
                 $tpls = XHTML::arr_select_opt(XARRAY::combine($files, $files), $se, true);
                 $this->result['action_properties_form']['InnerCategoryTemplate'] = $tpls;
                 $this->result['action_properties_form']['Destination_page'] = XHTML::arr_select_opt(XARRAY::arr_to_lev($pages->get_page_module_servers('show_catalog_server'), 'id', 'params', 'Name'), false, true);
                 $this->lct['action_properties'] = $TMS->parseSection($parameters['Action']);
                 break;
             case 'catalog_filter_results':
                 $this->result['action_properties'] = true;
                 Common::call_common_instance('pages');
                 $pages =& pages_module_common::getInstance();
                 $this->result['action_properties_form']['Destination_page'] = XHTML::arr_select_opt(XARRAY::arr_to_lev($pages->get_page_module_servers('show_catalog_server'), 'id', 'params', 'Name'), false, true);
                 $files = Common::get_module_template_list('catalog', array('.' . $parameters['Action'] . '.html'));
                 $tpls = XHTML::arr_select_opt(XARRAY::combine($files, $files), $se, true);
                 $this->result['action_properties_form']['ResultTemplate'] = $tpls;
                 $this->lct['action_properties'] = $TMS->parseSection($parameters['Action']);
                 break;
             case 'show_react_menu':
                 $this->result['action_properties'] = true;
                 $this->result['xlist'] = true;
                 $this->result['action_properties_form']['CatObjDestination_page'] = XHTML::arr_select_opt(XARRAY::arr_to_lev($pages->get_page_module_servers('show_catalog_server'), 'id', 'params', 'Name'), false, true);
                 $files = Common::get_module_template_list('catalog', array('.' . $parameters['Action'] . '.html'));
                 $this->result['action_properties_form']['Template'] = XHTML::arr_select_opt(XARRAY::combine($files, $files), $se, true);
                 $this->lct['action_properties'] = $TMS->parseSection($parameters['Action']);
                 break;
         }
     }
 }
Esempio n. 14
0
 function get_action_properties($parameters)
 {
     global $TMS, $Adm;
     $TMS->AddFileSection($Adm->load_module_tpls($this->_module_name, array(array('tpl_name' => 'ainterface')), true), true);
     if (array_key_exists($parameters['Action'], $this->_common_obj->get_actions())) {
         switch ($parameters['Action']) {
             case 'show_subscribe_form':
                 $this->result['xlist'] = true;
                 $this->result['action_properties'] = true;
                 Common::call_common_instance('pages');
                 $pages =& pages_module_common::getInstance();
                 $this->result['action_properties_form']['news_page'] = XHTML::arr_select_opt(XARRAY::arr_to_lev($pages->get_page_module_servers('show_news_server'), 'id', 'params', 'Name'), false, true);
                 $this->result['action_properties_form']['page'] = XHTML::arr_select_opt(XARRAY::arr_to_lev($pages->get_page_module_servers('subscriber_page'), 'id', 'params', 'Name'), false, true);
                 $this->lct['action_properties'] = $TMS->parseSection($parameters['Action']);
                 $files = Common::get_module_template_list($this->_module_name, array('.' . $parameters['Action'] . '.html'));
                 $this->result['action_properties_form']['Template'] = XHTML::arr_select_opt(XARRAY::combine($files, $files), $se, true);
                 break;
             case 'subscriber_page':
                 $albums = $this->_tree->GetChilds();
                 $this->result['action_properties_form']['subscribeStart'] = XHTML::arr_select_opt(XARRAY::arr_to_keyarr($this->_tree->GetChilds(1), 'id', 'basic'), $category_selected, true);
                 $this->result['action_properties'] = true;
                 $this->result['xlist'] = false;
                 $files = Common::get_module_template_list($this->_module_name, array('.' . $parameters['Action'] . '.html'));
                 $this->result['action_properties_form']['aTemplate'] = XHTML::arr_select_opt(XARRAY::combine($files, $files), $se, true);
                 $this->lct['action_properties'] = $TMS->parseSection($parameters['Action']);
                 $this->result['action_properties_form']['Default_action'] = XHTML::arr_select_opt(XARRAY::askeyval($this->_common_obj->get_non_server_actions(), 'front_name'), null, true);
                 break;
         }
     }
 }
Esempio n. 15
0
 function getConnectedObjs($id, $only_params = false)
 {
     static $con_cache;
     if (!$con_cache[$id]) {
         $con_cache[$id] = $this->obj_tree->GetChildsParam($id, '%', true, array('obj_type' => array('_CATCONNOBJ')));
     }
     $c = $con_cache[$id];
     if (!$only_params && $c) {
         $con_ids = XARRAY::arr_to_lev($c, 'id', 'params', 'id');
         if ($con_ids = $this->obj_tree->GetNodesByIdArray($con_ids, null, true)) {
             $c = array();
             while (list($k, $v) = each($con_ids)) {
                 $c[$k] = $this->property_set_to_properties($v['params']['Property_set'], $v, $prefix, true, $this);
             }
         }
     }
     return $c;
 }
Esempio n. 16
0
 function load_root_data()
 {
     $root = $this->_common_obj->get_node(1);
     $this->result['root_data'] = $root['params'];
     $this->result['root_data']['basic'] = $root['basic'];
     $this->result['root_data']['Gacode'] = $root['params']['Gacode'];
     $this->result['root_data']['StartPage'] = XHTML::arr_select_opt(XARRAY::arr_to_lev($this->_tree->GetChildsParam(1, array('Name'), true), 'id', 'params', 'Name'), $root['params']['StartPage']);
     //$this->get_slotz(1, null, true);
 }
Esempio n. 17
0
 function build_content($content_id)
 {
     global $TMS;
     $fields = XARRAY::arr_to_lev($this->_tree->GetChildsParam($id, array('field_value'), true), 'basic', 'params', 'field_value');
 }
Esempio n. 18
0
 function edit_role($data)
 {
     $modules = Common::get_module_list();
     $this->result['roles_editor']['Name'] = $this->_rolesTree->ReadNodeParam($data['id'], 'Name');
     if ($data['id'] && ($maccess = $this->_rolesTree->GetChildsParam($data['id'], array('is_accesible'), true, array('obj_type' => array('_MODULE'))))) {
         $maccess = XARRAY::arr_to_lev($maccess, 'basic', 'params', 'is_accesible');
         foreach ($modules as $module) {
             $this->result['maccess'][$module['name']] = $maccess[$module['name']] ? 1 : 0;
         }
     } else {
         $this->result['maccess'] = XARRAY::arr_to_keyarr($modules, 'name', '_');
     }
 }
Esempio n. 19
0
 function get_childs($params)
 {
     if (!$params[0]['obj_type']) {
         $obj_type = array('obj_type' => array('_CATOBJ', '_CATGROUP'));
     }
     if ($nodes = $this->_tree->GetChildsParam($params[0]['id'], '%', true, $obj_type)) {
         switch ($params[0]['as']) {
             case 'options':
                 return XHTML::as_select_opt(XARRAY::arr_to_lev($nodes, 'id', 'params', 'Name'), $params[0]['selected']);
                 break;
             default:
                 return $nodes;
         }
     }
 }