/** * @param $translation array Translate the raw categories and page name into a more expressive name. * @return string */ public function MakeBreadcrumb() { $url = Taplod_Url::getInstance(); $breadcrumb = array_merge($url->getCurrentCategories(), array($url->getCurrentPage())); $attribs = array('ul' => array('class' => 'breadcrumb'), 'li' => array(0 => array('class' => 'first'))); return parent::MakeList(self::translate($breadcrumb), $attribs); }
public function PartialContent($partial, $page, $data = null) { if ($partial != null && $page != null) { self::init($partial, $page); } if (is_null($data)) { return $this; } $template = $this->cloneTemplates(); $template->clearVars(); $url = Taplod_Url::getInstance(); $template->loadPartialFile('partial-' . $this->partialName, $this->page . '-' . $this->partialName . '.tpl.phtml'); if (is_array($data)) { $template->assign($data); } else { $template->assign('partialVars', $data); } return $template->render('partial-' . $this->partialName); }
public function url($page, $arguments = false, $category = false) { $url = Taplod_Url::getInstance(); return $url->buildUri($page, $arguments, $category); }
<?php /** * @category Ayaq * @copyright Copyright (c) 2009, Bellière Ludovic * @license http://opensource.org/licenses/mit-license.php MIT license */ defined('APPLICATION_PATH') or define('APPLICATION_PATH', dirname(__FILE__)); defined('APPLICATION_ENVIRONMENT') or define('APPLICATION_ENVIRONMENT', 'development'); defined('TEMPLATE_PATH') or define('TEMPLATE_PATH', realpath(dirname(__FILE__) . '/../templates') . '/'); if (!isset($_SESSION['quizz_step'])) { // quizz_step = 0 -> n-1 $_SESSION['quizz_step'] = 0; } mb_internal_encoding("UTF-8"); $db = Taplod_Db::factory('Pdo_Mysql', $config->db); $db->exec("SET character_set_results='utf8'"); require_once 'Taplod/Url.php'; $url = Taplod_Url::getInstance($config->url); Taplod_ObjectCache::set('URL', $url); $tpl = new Taplod_Templates(); if ($category = $url->getCategoryPath()) { if (file_exists($category . 'bootstrap.php')) { require $category . 'bootstrap.php'; } unset($category); } require $url->getPagePath() . '.php';