当前位置: 首页>>代码示例>>PHP>>正文


PHP TemplateEngine::setPostfix方法代码示例

本文整理汇总了PHP中TemplateEngine::setPostfix方法的典型用法代码示例。如果您正苦于以下问题:PHP TemplateEngine::setPostfix方法的具体用法?PHP TemplateEngine::setPostfix怎么用?PHP TemplateEngine::setPostfix使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TemplateEngine的用法示例。


在下文中一共展示了TemplateEngine::setPostfix方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getImageTemplate

 public function getImageTemplate($cal_id, $tag)
 {
     $template = new TemplateEngine($this->getPath() . "templates/" . $this->templateFile);
     $template->setPostfix($tag . $cal_id);
     $template->setCacheable(true);
     // check if template is in cache
     if (!$template->isCached()) {
         $searchcriteria = array('cal_id' => $cal_id, 'activated' => true);
         $imageSelect = array();
         $htdocsPathAbs = $this->plugin->getContentPath(true);
         $htdocsPath = $this->plugin->getContentPath(false);
         $list = $this->getList($searchcriteria);
         foreach ($list['data'] as &$item) {
             $imageSelect[] = $item['id'];
             if ($item['image']) {
                 $img = new Image($item['image'], $htdocsPathAbs);
                 $item['image'] = array('src' => $htdocsPath . $img->getFileName(false), 'width' => $img->getWidth(), 'height' => $img->getHeight());
             }
             if ($item['thumbnail']) {
                 $img = new Image($item['thumbnail'], $htdocsPathAbs);
                 $item['thumbnail'] = array('src' => $htdocsPath . $img->getFileName(false), 'width' => $img->getWidth(), 'height' => $img->getHeight());
             }
         }
         $template->setVariable('calendarimage', $list);
     }
     $theme = $this->director->theme;
     $theme->addHeader('<script type="text/javascript" src="' . DIF_VIRTUAL_WEB_ROOT . 'js/prototype.js"></script>');
     $theme->addHeader('<script type="text/javascript" src="' . DIF_VIRTUAL_WEB_ROOT . 'js/scriptaculous.js"></script>');
     $theme->addHeader('<script type="text/javascript" src="' . DIF_VIRTUAL_WEB_ROOT . 'js/lightbox.js"></script>');
     $theme->addHeader('<link rel="stylesheet" href="' . DIF_VIRTUAL_WEB_ROOT . 'css/lightbox.css" type="text/css" media="screen" />');
     return $template;
 }
开发者ID:rverbrugge,项目名称:dif,代码行数:32,代码来源:CalendarImage.php

示例2: handleOverview

 /**
  * handle overview request
  */
 private function handleOverview()
 {
     $request = Request::getInstance();
     $view = ViewManager::getInstance();
     // retrieve tags that are linked to this plugin
     $taglist = $this->plugin->getTagList(array('plugin_type' => Reservation::TYPE_LIST));
     if (!$taglist) {
         return;
     }
     foreach ($taglist as $tag) {
         $template = new TemplateEngine($this->getPath() . "templates/" . $this->templateFile);
         $template->setPostfix($tag['tag']);
         $template->setCacheable(false);
         $template->setVariable($tag, null, false);
         $this->template[$tag['tag']] = $template;
     }
     $this->director->theme->addJavascript('Event.observe( window, "load", function() { getReservationList();} );');
 }
开发者ID:rverbrugge,项目名称:dif,代码行数:21,代码来源:ReservationList.php

示例3: handleOverview

 /**
  * handle overview request
  */
 private function handleOverview()
 {
     $taglist = $this->getTagList();
     if (!$taglist) {
         return;
     }
     foreach ($taglist as $item) {
         $template = new TemplateEngine($this->getPath() . "templates/" . $this->templateFile);
         $template->setCacheable(true);
         $template->setPostfix($item['tag']);
         $skip = false;
         $key = array('tree_id' => $item['tree_id'], 'tag' => $item['tag']);
         $detail = $this->exists($key) ? $this->getDetail($key) : $this->getFields(SqlParser::MOD_INSERT);
         switch ($detail['type']) {
             case self::TYPE_HORIZONTAL_LEVEL1:
             case self::TYPE_VERTICAL_LEVEL1:
             case self::TYPE_VERTICAL_LEVEL2:
                 $this->handleSingleMenu($detail, $template);
                 break;
             case self::TYPE_HORIZONTAL_PULLDOWN:
             case self::TYPE_VERTICAL_PULLDOWN:
                 $this->handlePulldownMenu($detail, $template);
                 break;
             default:
                 $skip = true;
         }
         // skip if no type defined
         if ($skip) {
             continue;
         }
         $this->template[$item['tag']] = $template;
     }
 }
开发者ID:rverbrugge,项目名称:dif,代码行数:36,代码来源:Menu.php

示例4: handleDetail

 /**
  * handle detail request
  */
 private function handleDetail()
 {
     $request = Request::getInstance();
     $view = ViewManager::getInstance();
     // process attachments
     $attachment = $this->getAttachment();
     $attachment->handleHttpGetRequest();
     // clear subtitle
     $view->setName('');
     // check security
     if (!$request->exists('id')) {
         throw new Exception('Poll item is missing.');
     }
     $id = intval($request->getValue('id'));
     $key = array('id' => $id, 'activated' => true);
     if (!$this->exists($key)) {
         throw new HttpException('404');
     }
     $detail = $this->getDetail($key);
     // check if tree node of poll item is accessable
     $tree = $this->director->tree;
     if (!$tree->exists($detail['tree_id'])) {
         throw new HttpException('404');
     }
     // process request
     $template = new TemplateEngine($this->getPath() . "templates/" . $this->templateFile);
     $template->setPostfix($detail['tag']);
     // disable cache because we want to count visits
     $template->setCacheable(false);
     Cache::disableCache();
     // update view counter
     $this->updateCount($key);
     // overwrite default naming
     $template->setVariable('pageTitle', $detail['name'], false);
     // add breadcrumb item
     $url = new Url(true);
     $url->clearParameter('id');
     $breadcrumb = array('name' => $detail['name'], 'path' => $url->getUrl(true));
     $this->director->theme->addBreadcrumb($breadcrumb);
     // check if template is in cache
     /*
     if(!$template->isCached())
     {
     	$template->setVariable('poll',  $detail, false);
     }
     */
     $template->setVariable('poll', $detail, false);
     $settings = $this->getPollSettings();
     $treeSettings = $settings->getSettings($detail['tag'], $detail['tree_id']);
     $template->setVariable('newssettings', $treeSettings, false);
     // get settings
     if ($treeSettings['item']) {
         // process items
         $item = $this->getItem();
         $item->handleHttpGetRequest();
     }
     $url = new Url(true);
     $url->clearParameter('id');
     $url->setParameter($view->getUrlId(), ViewManager::OVERVIEW);
     $template->setVariable('href_back', $url->getUrl(true), false);
     $this->template[$detail['tag']] = $template;
 }
开发者ID:rverbrugge,项目名称:dif,代码行数:65,代码来源:PollOverview.php

示例5: handleOverview

 /**
  * handle overview request
  */
 private function handleOverview()
 {
     $request = Request::getInstance();
     $view = ViewManager::getInstance();
     $page = $this->getPage();
     $this->pagerUrl->setParameter($view->getUrlId(), $view->getType());
     // retrieve tags that are linked to this plugin
     $taglist = $this->plugin->getTagList();
     if (!$taglist) {
         return;
     }
     // get settings
     $settings = $this->getSettings();
     foreach ($taglist as $tag) {
         $template = new TemplateEngine($this->getPath() . "templates/" . $this->templateFile);
         $template->setPostfix($tag['tag']);
         $template->setCacheable(true);
         $template->setVariable($settings, NULL, false);
         // check if template is in cache
         if (!$template->isCached()) {
             $pagesize = $settings['rows'];
             $searchcriteria = array('tree_id' => $tag['tree_id'], 'tag' => $tag['tag'], 'activated' => true);
             $list = $this->getList($searchcriteria, $pagesize, $page, $settings['display_order']);
             foreach ($list['data'] as &$item) {
                 $item['href_detail'] = $item['file'] ? $this->plugin->getFileUrl($item['id']) : '';
             }
             $template->setVariable('attachment', $list);
         }
         $this->template[$tag['tag']] = $template;
     }
 }
开发者ID:rverbrugge,项目名称:dif,代码行数:34,代码来源:AttachmentOverview.php

示例6: getAttachmentTemplate

 public function getAttachmentTemplate($nl_id, $tag)
 {
     $template = new TemplateEngine($this->getPath() . "templates/" . $this->templateFile);
     $template->setPostfix($tag . $nl_id);
     $template->setCacheable(true);
     // check if template is in cache
     if (!$template->isCached()) {
         $searchcriteria = array('nl_id' => $nl_id, 'activated' => true);
         $list = $this->getList($searchcriteria);
         foreach ($list['data'] as &$item) {
             $item['href_detail'] = $item['file'] ? $this->plugin->getFileUrl($item['id']) : '';
         }
         $template->setVariable('attachment', $list);
     }
     return $template;
 }
开发者ID:rverbrugge,项目名称:dif,代码行数:16,代码来源:NewsLetterAttachment.php

示例7: handleOverview

 /**
  * handle overview request
  */
 private function handleOverview()
 {
     $taglist = $this->getTagList();
     if (!$taglist) {
         return;
     }
     foreach ($taglist as $item) {
         $template = new TemplateEngine();
         $template->setPostfix($item['tag']);
         $template->setCacheable(true);
         // check if template is in cache
         if (!$template->isCached()) {
             $key = array('tree_id' => $item['tree_id'], 'tag' => $item['tag']);
             $detail = $this->getDetail($key);
             $template->setFile($detail['text']);
             $template->setIncludeFile(false);
         }
         $this->template[$item['tag']] = $template;
     }
 }
开发者ID:rverbrugge,项目名称:dif,代码行数:23,代码来源:Source.php

示例8: handleDetail

 /**
  * handle detail request
  */
 private function handleDetail()
 {
     $request = Request::getInstance();
     $view = ViewManager::getInstance();
     // process attachments
     $attachment = $this->plugin->getObject(Calendar::TYPE_ATTACHMENT);
     $attachment->handleHttpGetRequest();
     // process images
     $image = $this->plugin->getObject(Calendar::TYPE_IMAGE);
     $image->handleHttpGetRequest();
     // clear subtitle
     $view->setName('');
     // check security
     if (!$request->exists('id')) {
         throw new Exception('Calendar id is missing.');
     }
     $id = intval($request->getValue('id'));
     $key = array('id' => $id, 'activated' => $settings['history'] ? strftime('%Y-%m-%d', $settings['history']) : '');
     if (!$this->exists($key)) {
         throw new HttpException('404');
     }
     $detail = $this->getDetail($key);
     $objSettings = $this->plugin->getObject(Calendar::TYPE_SETTINGS);
     $settings = $objSettings->getSettings($detail['tree_id'], $detail['tag']);
     // check if tree node of cal item is accessable
     $tree = $this->director->tree;
     if (!$tree->exists($detail['tree_id'])) {
         throw new HttpException('404');
     }
     if ($detail['thumbnail']) {
         $img = new Image($detail['thumbnail'], $this->plugin->getContentPath(true));
         $detail['thumbnail'] = array('src' => $this->plugin->getContentPath(false) . $img->getFileName(false), 'width' => $img->getWidth(), 'height' => $img->getHeight());
     }
     // process request
     $template = new TemplateEngine($this->getPath() . "templates/" . $this->templateFile);
     $template->setPostfix($detail['tag']);
     // disable cache because we want to count visits
     $template->setCacheable(false);
     Cache::disableCache();
     // update view counter
     $this->updateCount($key);
     // overwrite default naming
     $template->setVariable('pageTitle', $detail['name'], false);
     // add breadcrumb item
     $url = new Url(true);
     $url->clearParameter('id');
     $breadcrumb = array('name' => $detail['name'], 'path' => $url->getUrl(true));
     $this->director->theme->addBreadcrumb($breadcrumb);
     $template->setVariable('cal', $detail, false);
     $template->setVariable('settings', $settings);
     $template->setVariable('calsettings', $settings, false);
     // get settings
     if ($settings['comment']) {
         // process comments
         $comment = $this->plugin->getObject(Calendar::TYPE_COMMENT);
         $comment->setSettings($settings);
         $comment->handleHttpGetRequest();
     }
     $url->setParameter($view->getUrlId(), ViewManager::OVERVIEW);
     $template->setVariable('href_back', $url->getUrl(true), false);
     $this->template[$detail['tag']] = $template;
 }
开发者ID:rverbrugge,项目名称:dif,代码行数:65,代码来源:CalendarOverview.php

示例9: handleTreeEditGet

 /**
  * handle edit request
  */
 private function handleTreeEditGet($retrieveFields = true)
 {
     $template = new TemplateEngine($this->getPath() . "templates/" . $this->templateFile);
     $request = Request::getInstance();
     $view = ViewManager::getInstance();
     $view->setType(ViewManager::TREE_EDIT);
     $element = $this->plugin->getObject(Form::TYPE_ELEMENT);
     $record = $this->plugin->getObject(Form::TYPE_RECORD);
     $recordItem = $this->plugin->getObject(Form::TYPE_RECORD_ITEM);
     if (!$request->exists('rcd_id')) {
         throw new Exception('Record id is missing.');
     }
     $rcd_id = intval($request->getValue('rcd_id'));
     $key = array('id' => $rcd_id);
     if (!$record->exists($key)) {
         throw new Exception('Record does not exist.');
     }
     $recordDetail = $record->getDetail($key);
     $tree_id = $recordDetail['tree_id'];
     $tag = $recordDetail['tag'];
     // get record items
     if ($request->getRequestType() == Request::GET) {
         $recordItemList = $recordItem->getRecordElementList($rcd_id);
     } else {
         $recordItemList = array();
     }
     // get settings
     $settings = $this->plugin->getSettings($tree_id, $tag);
     $templateItem = new TemplateEngine($this->getPath() . "templates/formoverviewitem.tpl");
     $template->setPostfix($tag);
     $template->setCacheable(true);
     $templateItem->setVariable('settings', $settings);
     $searchcriteria = array('tree_id' => $tree_id, 'tag' => $tag, 'active' => true);
     $list = $element->getList($searchcriteria, 0, 1, SqlParser::ORDER_ASC);
     foreach ($list['data'] as &$item) {
         $obj = $element->getObject($item['type'], $item);
         $obj->setId($element->getTypeId($item['id']));
         if ($request->getRequestType() == Request::POST) {
             $obj->handlePostRequest();
         } elseif (array_key_exists($obj->getId(), $recordItemList)) {
             $obj->handleSetValue($recordItemList[$obj->getId()]['value']);
         }
         $item['html'] = $obj->getHtml();
         $item['class'] = get_class($obj);
     }
     $templateItem->setVariable('fields', $list);
     $template->setVariable('rcd_id', $rcd_id);
     $template->setVariable('tag', $tag);
     $template->setVariable('settings', $settings);
     $template->setVariable('tpl_element_item', $templateItem);
     $this->handleTreeSettings($template);
     $this->template[$this->director->theme->getConfig()->main_tag] = $template;
 }
开发者ID:rverbrugge,项目名称:dif,代码行数:56,代码来源:FormOverview.php

示例10: handleOverview

 /**
  * handle overview request
  */
 private function handleOverview()
 {
     $request = Request::getInstance();
     $view = ViewManager::getInstance();
     $tag = 'poll_item';
     if (!$request->exists('id')) {
         throw new Exception('Poll is missing.');
     }
     $poll_id = intval($request->getValue('id'));
     $template = new TemplateEngine($this->getPath() . "templates/" . $this->templateFile);
     $template->setPostfix($tag);
     $template->setCacheable(true);
     // add item if requested
     if ($request->exists(self::VIEW_KEY)) {
         $this->handleItemAdd($template);
     }
     // check if template is in cache
     if (!$template->isCached()) {
         // retrieve items
         $searchcriteria = array('poll_id' => $poll_id, 'activated' => true);
         $list = $this->getList($searchcriteria);
         $template->setVariable('item', $list);
     }
     $this->template[$tag] = $template;
 }
开发者ID:rverbrugge,项目名称:dif,代码行数:28,代码来源:PollItem.php

示例11: handleOverview

 /**
  * handle overview request
  */
 private function handleOverview()
 {
     $taglist = $this->getTagList();
     if (!$taglist) {
         return;
     }
     $tree = $this->director->tree;
     foreach ($taglist as $item) {
         $template = new TemplateEngine($this->getPath() . "templates/" . $this->templateFile);
         $template->setCacheable(true);
         $template->setPostfix($item['tag']);
         $key = array('tree_id' => $item['tree_id'], 'tag' => $item['tag']);
         // check if template is in cache
         if (!$template->isCached()) {
             $siteGroup = $this->getSiteGroup();
             $id = $siteGroup->getCurrentId();
             $detail = $this->exists($key) ? $this->getDetail($key) : $this->getFields(SqlParser::MOD_INSERT);
             $template->setVariable('detail', $detail);
             $url = new Url();
             $url->setPath('/');
             $grouplist = $siteGroup->getList(array('active' => true));
             if ($grouplist['totalItems'] < 2) {
                 continue;
             }
             foreach ($grouplist['data'] as &$list) {
                 $url->setParameter(SystemSiteGroup::CURRENT_ID_KEY, $list['id']);
                 $list['path'] = $url->getUrl(true);
                 $list['selected'] = $list['id'] == $id;
                 $list['img'] = $this->getImage($list['language']);
             }
             $template->setVariable('sitegroup', $grouplist, false);
             $template->setVariable('sitegroupId', $id);
         }
         $this->template[$item['tag']] = $template;
     }
 }
开发者ID:rverbrugge,项目名称:dif,代码行数:39,代码来源:SiteSelect.php

示例12: handleOverview

 /**
  * handle overview request
  */
 private function handleOverview()
 {
     $request = Request::getInstance();
     $view = ViewManager::getInstance();
     $page = $this->getPage();
     $this->pagerUrl->setParameter($view->getUrlId(), $view->getType());
     // retrieve tags that are linked to this plugin
     $taglist = $this->plugin->getTagList(array('plugin_type' => Gallery::TYPE_DEFAULT));
     if (!$taglist) {
         return;
     }
     $url = new Url(true);
     $url->setParameter($view->getUrlId(), Gallery::VIEW_DETAIL);
     $htdocsPathAbs = $this->plugin->getContentPath(true);
     $htdocsPath = $this->plugin->getContentPath(false);
     foreach ($taglist as $tag) {
         $template = new TemplateEngine($this->getPath() . "templates/" . $this->templateFile);
         $template->setPostfix($tag['tag']);
         $template->setCacheable(true);
         // get settings
         $settings = $this->getSettings($tag['tree_id'], $tag['tag']);
         $this->handleDisplaySettings($settings['display']);
         $template->setVariable('settings', $settings);
         // check if template is in cache
         if (!$template->isCached()) {
             $pagesize = $settings['rows'];
             $searchcriteria = array('tree_id' => $tag['tree_id'], 'tag' => $tag['tag'], 'activated' => true);
             $imageSelect = array();
             $list = $this->getList($searchcriteria, $pagesize, $page);
             foreach ($list['data'] as &$item) {
                 $imageSelect[] = $item['id'];
                 $url->setParameter('id', $item['id']);
                 $item['href_detail'] = $url->getUrl(true);
                 if ($item['image']) {
                     $img = new Image($item['image'], $htdocsPathAbs);
                     $item['image'] = array('src' => $htdocsPath . $img->getFileName(false), 'width' => $img->getWidth(), 'height' => $img->getHeight());
                 }
                 if ($item['thumbnail']) {
                     $img = new Image($item['thumbnail'], $htdocsPathAbs);
                     $item['thumbnail'] = array('src' => $htdocsPath . $img->getFileName(false), 'width' => $img->getWidth(), 'height' => $img->getHeight());
                 }
             }
             if ($settings['display'] == Gallery::DISP_LIGHTBOX) {
                 // retrieve all images for lightbox
                 $all = $this->getList($searchcriteria);
                 $pregallery = array();
                 $postgallery = array();
                 $pre = true;
                 foreach ($all['data'] as $allImg) {
                     if (in_array($allImg['id'], $imageSelect)) {
                         // image is in selection, skip image and change array to post
                         $pre = false;
                         continue;
                     }
                     if ($allImg['image']) {
                         $img = new Image($allImg['image'], $htdocsPathAbs);
                         $allImg['image'] = array('src' => $htdocsPath . $img->getFileName(false), 'width' => $img->getWidth(), 'height' => $img->getHeight());
                     }
                     // add to right array
                     $pre ? $pregallery[] = $allImg : ($postgallery[] = $allImg);
                 }
                 $template->setVariable('pregallery', $pregallery);
                 $template->setVariable('postgallery', $postgallery);
             }
             $template->setVariable('gallery', $list);
             $template->setVariable('display', $settings['display'], false);
         }
         $this->template[$tag['tag']] = $template;
     }
 }
开发者ID:rverbrugge,项目名称:dif,代码行数:73,代码来源:GalleryOverview.php

示例13: handleDetail

 /**
  * handle detail request
  */
 private function handleDetail()
 {
     $request = Request::getInstance();
     $view = ViewManager::getInstance();
     // it makes no sense to have multiple tags for this plugin.
     // if someone did it, you get strange results and he probably can figure out why.. no multiple detail stuff in 1 page supported!
     // so take a shot and get the first tag to set the content
     $taglist = $this->plugin->getTagList(array('plugin_type' => Calendar::TYPE_ARCHIVE));
     if (!$taglist) {
         return;
     }
     $taginfo = current($taglist);
     // process attachments
     $attachment = $this->plugin->getObject(Calendar::TYPE_ATTACHMENT);
     $attachment->handleHttpGetRequest();
     // process images
     $image = $this->plugin->getObject(Calendar::TYPE_IMAGE);
     $image->handleHttpGetRequest();
     // clear subtitle
     $view->setName('');
     if (!$request->exists('id')) {
         throw new Exception('Calendar id is missing.');
     }
     $id = intval($request->getValue('id'));
     $key = array('id' => $id, 'active' => true, 'finished' => true);
     $overview = $this->plugin->getObject(Calendar::TYPE_DEFAULT);
     if (!$overview->exists($key)) {
         return;
     }
     $detail = $overview->getDetail($key);
     // check if tree node of cal item is accessable
     $tree = $this->director->tree;
     if (!$tree->exists($detail['tree_id'])) {
         throw new HttpException('404');
     }
     $objSettings = $this->plugin->getObject(Calendar::TYPE_SETTINGS);
     $settings = $objSettings->getSettings($detail['tree_id'], $detail['tag']);
     if ($detail['thumbnail']) {
         $img = new Image($detail['thumbnail'], $this->plugin->getContentPath(true));
         $detail['thumbnail'] = array('src' => $this->plugin->getContentPath(false) . $img->getFileName(false), 'width' => $img->getWidth(), 'height' => $img->getHeight());
     }
     $template = new TemplateEngine($this->getPath() . "templates/" . $this->templateFile);
     $template->setPostfix($detail['tag']);
     // disable cache because we want to count visits
     $template->setCacheable(false);
     Cache::disableCache();
     // update view counter
     $overview->updateCount($key);
     // overwrite default naming
     $template->setVariable('pageTitle', $detail['name'], false);
     $url = new Url(true);
     $url->clearParameter('id');
     $url->setParameter($view->getUrlId(), ViewManager::OVERVIEW);
     $template->setVariable('href_back', $url->getUrl(true), false);
     $breadcrumb = array('name' => $detail['name'], 'path' => $url->getUrl(true));
     $this->director->theme->addBreadcrumb($breadcrumb);
     $template->setVariable('cal', $detail, false);
     $template->setVariable('settings', $settings);
     $template->setVariable('calsettings', $settings, false);
     // get settings
     if ($settings['comment']) {
         // process comments
         $comment = $this->plugin->getObject(Calendar::TYPE_COMMENT);
         $comment->setSettings($settings);
         $comment->handleHttpGetRequest();
     }
     $this->template[$taginfo['tag']] = $template;
 }
开发者ID:rverbrugge,项目名称:dif,代码行数:71,代码来源:CalendarArchive.php

示例14: handleDetail

 /**
  * handle detail request
  */
 private function handleDetail()
 {
     $request = Request::getInstance();
     $view = ViewManager::getInstance();
     // clear subtitle
     $view->setName('');
     // check security
     if (!$request->exists('id')) {
         throw new Exception('Link is missing.');
     }
     $id = intval($request->getValue('id'));
     $key = array('id' => $id, 'activated' => true);
     if (!$this->exists($key)) {
         throw new HttpException('404');
     }
     $detail = $this->getDetail($key);
     // check if tree node of thumb item is accessable
     $tree = $this->director->tree;
     if (!$tree->exists($detail['tree_id'])) {
         throw new HttpException('404');
     }
     // process request
     $template = new TemplateEngine($this->getPath() . "templates/" . $this->templateFile);
     $template->setPostfix($detail['tag']);
     // overwrite default naming
     $template->setVariable('pageTitle', $detail['name'], false);
     // add breadcrumb item
     $url = new Url(true);
     $breadcrumb = array('name' => $detail['name'], 'path' => $url->getUrl(true));
     $this->director->theme->addBreadcrumb($breadcrumb);
     $template->setVariable('links', $detail, false);
     $url = new Url(true);
     $url->clearParameter('id');
     $url->setParameter($view->getUrlId(), ViewManager::OVERVIEW);
     $template->setVariable('href_back', $url->getUrl(true), false);
     $settings = $this->plugin->getObject(Links::TYPE_SETTINGS)->getSettings($detail['tag'], $detail['tree_id']);
     $tag = $detail['tag'];
     if ($settings['target']) {
         $tag = $settings['target'];
         $this->overrideTag[] = $tag;
         $this->handleOverview($detail['tree_id'], $detail['tag']);
     }
     $this->template[$tag] = $template;
 }
开发者ID:rverbrugge,项目名称:dif,代码行数:47,代码来源:LinksOverview.php

示例15: handleOverview

 /**
  * handle overview request
  */
 private function handleOverview()
 {
     $view = ViewManager::getInstance();
     $taglist = $this->plugin->getTagList();
     if (!$taglist) {
         return;
     }
     $tree = $this->director->tree;
     // link to attachment tree nodes
     $treeRef = new AttachmentTreeRef();
     foreach ($taglist as $item) {
         $key = array('tree_id' => $item['tree_id'], 'tag' => $item['tag']);
         $detail = $this->getDetail($key);
         $template = new TemplateEngine($this->getPath() . "templates/" . $this->templateFile);
         $template->setPostfix($item['tag']);
         $template->setCacheable($detail['display_order'] != Attachment::ORDER_RAND);
         // check if template is in cache
         if (!$template->isCached()) {
             // get settings
             $settings = $this->getSettings();
             $treeRefList = $treeRef->getList($key);
             $treeItemList = array();
             foreach ($treeRefList['data'] as $treeRefItem) {
                 if (!$tree->exists($treeRefItem['ref_tree_id'])) {
                     continue;
                 }
                 $treeItemList[] = $treeRefItem['ref_tree_id'];
             }
             if (!$treeItemList) {
                 continue;
             }
             $searchcriteria = array('activated' => true, 'tree_id' => $treeItemList);
             $display_order = $detail['display_order'] ? $detail['display_order'] : $settings['display_order'];
             $overview = $this->getAttachmentOverview();
             $list = $overview->getList($searchcriteria, $detail['rows'], 1, $display_order);
             // skip if empty
             if ($list['totalItems'] < 1) {
                 continue;
             }
             foreach ($list['data'] as &$att) {
                 $att['href_detail'] = $att['file'] ? $this->plugin->getFileUrl($att['id']) : '';
             }
             $template->setVariable('attachment', $list);
             $template->setVariable('name', $detail['name']);
             $template->setVariable('display', $settings['display_hdl']);
         }
         $this->template[$item['tag']] = $template;
     }
 }
开发者ID:rverbrugge,项目名称:dif,代码行数:52,代码来源:AttachmentHeadlines.php


注:本文中的TemplateEngine::setPostfix方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。