<?php require substr(dirname(__FILE__), 0, -6) . '/init.inc.php'; Validate::checkSession(); Validate::checkPremission('6', '警告,权限不足,您不能管理导航!'); global $_tpl; $_nav = new NavAction($_tpl); //入口 $_nav->_action(); $_tpl->display('nav.tpl');
<?php require '../init.inc.php'; Validate::Check_Login(); $nav = new NavAction('nav.tpl'); $nav->Action(); $templates->display($nav->tpl);
<?php define('IS_CACHE', false); global $_tpl, $_cache; if (IS_CACHE && !$_cache->noCache()) { ob_start(); $_tpl->cache(Tool::tplName() . '.tpl'); } $_nav = new NavAction($_tpl); $_nav->showfront(); $_cookie = new Cookie('user'); if (IS_CACHE) { $_tpl->assign('header', '<script>getHeader();</script>'); } else { if ($_cookie->getCookie()) { $_tpl->assign('header', 'Hello ' . $_cookie->getCookie() . ', <a href="register.php?action=logout">Logout</a>'); } else { $_tpl->assign('header', '<a href="register.php?action=reg" class="user">Register</a> <a href="register.php?action=login" class="user">Login</a>'); } }
<?php require 'init.inc.php'; global $templates; $nav = new NavAction('index.tpl'); $nav->Show_Nav(); $list = new ListAction('index.tpl'); $list->Action(); $templates->display('list.tpl');