Exemplo 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;
         }
     }
 }
Exemplo n.º 2
0
 function common_call()
 {
     $this->_common_obj =& users_module_common::getInstance();
     //proxy for tree
     $_module_name = 'users';
     $this->_tree =& $this->_common_obj->obj_tree;
     $this->_rolesTree =& $this->_common_obj->rolesTree;
 }
Exemplo n.º 3
0
 function get_author($id, $type)
 {
     if (!$id) {
         return;
     }
     if ($type == 'fusers') {
         Common::call_common_instance('fusers');
         $ci = fusers_module_common::getInstance();
     } elseif ($type == 'users') {
         Common::call_common_instance('users');
         $ci = users_module_common::getInstance();
     }
     return $ci->obj_tree->getNodeInfo($id);
 }
Exemplo n.º 4
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']);
         }
     }
 }