示例#1
0
                    $main_template = $template_file;
                    include_once $work_file;
                } else {
                    messages::error404();
                }
            }
        }
    } elseif (isset($_GET['do']) && !empty($_GET['do'])) {
        $template_file = 'adm.' . $_GET['do'] . '.tpl';
        $work_file = 'core/includes/admin/adm.' . $_GET['do'] . '.php';
        if (@file_exists($work_file) && @file_exists(TEMPLATE_PATH_ADMIN . $template_file)) {
            $main_template = $template_file;
            include_once $work_file;
        } else {
            messages::error404();
        }
    } else {
        // Проверка наличия обновлений
        $avUpdates = array();
        $avUpdates['result'] = updates::checkUpdates();
        $avUpdates['error'] = is_numeric($avUpdates['result']) ? false : true;
        $smarty->assignByRef('avUpdates', $avUpdates);
    }
    // передаем в смарти "Наименование страницы" отображаемое форме
    isset($arrNamePage) && is_array($arrNamePage) ? $smarty->assignByRef('namePage', $arrNamePage) : $smarty->assign('namePage', false);
    /********** Собираем статистику запросов к БД **********/
    $smarty->assign('ScriptWorkReport', array('ID-DataBase' => db::$db_id, 'CountAllQuerysToDB' => db::$cntAllQuerys, 'ListAllQuerysToDB' => db::$arrAllQuerys));
    /********** Передаем в Smarty выводимый шаблон и отображаем его **********/
    $smarty->assignByRef('main_template', $main_template);
    $smarty->display('adm.index.tpl');
}