public function show() { $news = App('news_model')->getLatestByLanguage(Env()->main['amount_latest_news']); $pages = App('page_model')->getLatestByLanguage(Env()->main['amount_latest_pages']); $breadcrumbs = App()->sitemap_model->getBreadcrumbs('main'); View()->render('show', array('title' => Env()->main['title'], 'description' => Env()->main['description'], 'news' => $news, 'pages' => $pages, 'breadcrumbs' => $breadcrumbs)); }
/** * Processus de création, rejoindre et lancement de partie. * * @throws Exception en cas de non définition de l'environnement. */ public final function run() { smarty()->assign('jeu', jeu()); if (partie()) { smarty()->assign('partie', partie()); smarty()->assign('host', new Joueur(partie()->host)); switch (partie()->etat) { case Partie::PREPARATION: // en cours de préparation Env()->setSlot(partie()->rejoindre()); $page_organize = new OrganizeGame(); $page_organize->run(); break; case Partie::EN_COURS: if (is_null(slot())) { env()->slot = partie()->rejoindre(); } smarty()->assign('slot', slot()); $this->process(); $this->display(); break; case Partie::TERMINEE: $page_scores = new Scores(); $page_scores->run(); break; default: throw new Exception('Etat de partie non reconnu : ' . partie()->etat); } } else { // Index & formulaire création partie $page_game_index = new GameIndex(); $page_game_index->run(); } }
/** * Мастер создания ссылок * @return string */ public function href() { if (!($href = func_get_args())) { return Reg()->host; } else { if (is_array($href[0])) { $href = $href[0]; } if ($href[0] == 'THIS') { $templ = Reg()->GET; unset($href[0]); if ((int) @$href[1]) { $temp = $templ; unset($templ); for ($x = 0; $x < $href[1]; $x++) { @($templ[] = $temp[$x]); } unset($href[1]); } $href = array_merge($templ, $href); } $divider = !empty(Env()->basis->divider) ? Env()->basis->divider : Reg()->divider; return Reg()->host . (!empty(Env()->basis->rewrite) ? implode($divider, $href) : '?' . $this->http_build_query($href)); } }
/** * Отобразить файл вида * @param string $name Название вида */ public function display($name = null, $type = 'html') { $default = !empty(Env()->basis->view) ? Env()->basis->view : Reg()->view; $view = (!empty($name) ? $name : $default) . '.' . $type; if (!$this->loadFile(Reg()->folderViewSite . $view)) { if (!$this->loadFile(Reg()->folderViewCore . $view)) { Core::exception('Файл шаблона не найден.'); } } }
<?php @ini_set('display_errors', 1); @ini_set('html_errors', 0); @ini_set('magic_quotes_runtime', 0); @ini_set('magic_quotes_sybase', 0); error_reporting(E_ALL); set_time_limit(30); mb_internal_encoding('UTF-8'); header('Content-Type: text/html; charset=utf-8'); session_start(); define('GLISS_DIR', defined('ENTRY_POINT') ? get_include_path() : dirname(__FILE__) . '/'); @define('ENTRY_POINT', true); include_once GLISS_DIR . 'core/Core.class.php'; Core::start(); // Временный мини роутер if (!App()->getApp(@$_GET[0])) { $GET = $_GET; $_GET = array_merge(@array(Env()->basis->appendix), $_GET); if (!App()->getApp(@Env()->basis->appendix)) { if (!App()->getApp(Reg()->appendix)) { $_GET = $GET; $_GET = array_merge(array(Reg()->appendix), $_GET); Core::exception('Приложение "' . Reg()->appendix . '" не найдено.'); } } } View()->display();
/** * Слить в одно, два окружения * @param string $name * @param array $arguments */ public function __call($name, $arguments) { if (!empty($arguments[0])) { return Env()->{$name} = Env()->{$name} + Env()->{$arguments[0]}; } }