function get_user_details($user_id) { return CAT_Users::get_user_details($user_id); }
/** * prints the top of the backend page * * @access public * @return void **/ public static function print_banner() { global $page_id, $parser; $results_array = CAT_Helper_Page::properties($page_id); $user = CAT_Users::get_user_details($results_array['modified_by']); $tpl_data = array(); foreach ($results_array as $key => $value) { $tpl_data[strtoupper($key)] = $value; } $tpl_data['MODIFIED_BY'] = $user['display_name']; $tpl_data['MODIFIED_BY_USERNAME'] = $user['username']; $tpl_data['MODIFIED_WHEN'] = $results_array['modified_when'] != 0 ? $modified_ts = CAT_Helper_DateTime::getDateTime($results_array['modified_when']) : false; $tpl_data['PAGE_HEADER'] = self::getInstance('')->lang()->translate('Modify page'); $tpl_data['CUR_TAB'] = 'modify'; $tpl_data['PAGE_LINK'] = CAT_Helper_Page::getLink($results_array['page_id']); $parser->output('backend_pages_header', $tpl_data); $parser->output('backend_pages_banner', $tpl_data); }
$tpl_data['blocks'][$bcnt]['current_block_name'] = $parser->get_template_block_name($current_template, $section['block']) . ' (' . $backend->lang()->translate('Block number') . ': ' . $section['block'] . ')'; $tpl_data['blocks'][$bcnt]['section_id'] = $section['section_id']; $tpl_data['blocks'][$bcnt]['module'] = $section['module']; $tpl_data['blocks'][$bcnt]['name'] = $section['name']; $tpl_data['blocks'][$bcnt]['date_day_from'] = $section['publ_start'] > 0 ? date('d', $section['publ_start']) : ''; $tpl_data['blocks'][$bcnt]['date_month_from'] = $section['publ_start'] > 0 ? date('m', $section['publ_start']) : ''; $tpl_data['blocks'][$bcnt]['date_year_from'] = $section['publ_start'] > 0 ? date('Y', $section['publ_start']) : ''; $tpl_data['blocks'][$bcnt]['date_hour_from'] = $section['publ_start'] > 0 ? date('H', $section['publ_start']) : ''; $tpl_data['blocks'][$bcnt]['date_minute_from'] = $section['publ_start'] > 0 ? date('i', $section['publ_start']) : ''; $tpl_data['blocks'][$bcnt]['date_day_to'] = $section['publ_start'] > 0 ? date('d', $section['publ_end']) : ''; $tpl_data['blocks'][$bcnt]['date_month_to'] = $section['publ_start'] > 0 ? date('m', $section['publ_end']) : ''; $tpl_data['blocks'][$bcnt]['date_year_to'] = $section['publ_start'] > 0 ? date('Y', $section['publ_end']) : ''; $tpl_data['blocks'][$bcnt]['date_hour_to'] = $section['publ_start'] > 0 ? date('H', $section['publ_end']) : ''; $tpl_data['blocks'][$bcnt]['date_minute_to'] = $section['publ_start'] > 0 ? date('i', $section['publ_end']) : ''; $tpl_data['blocks'][$bcnt]['modified_when'] = $section['modified_when'] ? CAT_Helper_DateTime::getDateTime($section['modified_when']) : ''; $tpl_data['blocks'][$bcnt]['modified_by'] = $section['modified_by'] ? (CAT_Users::get_user_details($section['modified_by'], 'display_name') ? CAT_Users::get_user_details($section['modified_by'], 'display_name') : '') . ' (' . CAT_Users::get_user_details($section['modified_by'], 'username') . ')' : ''; // load language file (if any) $langfile = CAT_Helper_Directory::sanitizePath(CAT_PATH . '/modules/' . $module . '/languages/' . LANGUAGE . '.php'); if (file_exists($langfile)) { if (!$backend->lang()->checkFile($langfile, 'LANG', true)) { // old fashioned language file include $langfile; } else { // modern language file $backend->lang()->addFile(LANGUAGE . '.php', CAT_Helper_Directory::sanitizePath(CAT_PATH . '/modules/' . $module . '/languages')); } } // ====================================================== // ! Include the module and add it to the output buffer // ====================================================== ob_start();
trigger_error(sprintf("[ <b>%s</b> ] Can't include class.secure.php!", $_SERVER['SCRIPT_NAME']), E_USER_ERROR); } } include 'functions.php'; $val = CAT_Helper_Validate::getInstance(); // =============== // ! Get page id // =============== $page_id = $val->get('_REQUEST', 'page_id', 'numeric'); if (!$page_id) { header("Location: index.php"); exit(0); } $backend = CAT_Backend::getInstance('Pages', 'pages_settings'); $page = CAT_Helper_Page::getPage($page_id); $user = CAT_Users::get_user_details($page['modified_by']); $files = CAT_Helper_Page::getExtraHeaderFiles($page_id); // ================================== // ! Add globals to the template data // ================================== $tpl_data['CUR_TAB'] = 'headers'; $tpl_data['PAGE_HEADER'] = $backend->lang()->translate('Modify header files'); $tpl_data['PAGE_ID'] = $page_id; $tpl_data['PAGE_LINK'] = CAT_Helper_Page::getLink($page['link']); $tpl_data['PAGE_TITLE'] = $page['page_title']; $tpl_data['MODIFIED_BY'] = $user['display_name']; $tpl_data['MODIFIED_BY_USERNAME'] = $user['username']; $tpl_data['MODIFIED_WHEN'] = $page['modified_when'] != 0 ? CAT_Helper_DateTime::getDateTime($page['modified_when']) : false; $tpl_data['page_js'] = isset($files['js']) ? $files['js'] : ''; $tpl_data['page_css'] = isset($files['css']) ? $files['css'] : ''; $tpl_data['use_core'] = isset($files['use_core']) ? $files['use_core'] : NULL;