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


PHP Poll::getTagList方法代码示例

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


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

示例1: 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();
     if (!$taglist) {
         return;
     }
     $taginfo = current($taglist);
     // clear subtitle
     $view->setName('');
     if (!$request->exists('id')) {
         continue;
     }
     $id = intval($request->getValue('id'));
     $key = array('id' => $id, 'active' => true);
     $overview = $this->getPollOverview();
     if (!$overview->exists($key)) {
         throw new HttpException('404');
     }
     $detail = $overview->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');
     }
     $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();
     // overwrite default naming
     $template->setVariable('pageTitle', $detail['name'], false);
     $template->setVariable('poll', $detail, 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);
     $this->template[$taginfo['tag']] = $template;
 }
开发者ID:rverbrugge,项目名称:dif,代码行数:48,代码来源:PollArchive.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();
     if (!$taglist) {
         return;
     }
     $url = new Url(true);
     $url->setParameter($view->getUrlId(), Poll::VIEW_DETAIL);
     Cache::disableCache();
     foreach ($taglist as $tag) {
         $template = new TemplateEngine($this->getPath() . "templates/" . $this->templateFile);
         //$template->setPostfix($tag['tag']);
         $template->setCacheable(false);
         // check if template is in cache
         if (!$template->isCached()) {
             // get settings
             $settings = array_merge($this->getPollSettings()->getSettings($tag['tag'], $tag['tree_id']), $this->plugin->getSettings());
             $template->setVariable('settings', $settings);
             $searchcriteria = array('tree_id' => $tag['tree_id'], 'tag' => $tag['tag'], 'activated' => true);
             if (!$this->exists($searchcriteria)) {
                 continue;
             }
             $poll = $this->getDetail($searchcriteria);
             $searchcriteria['poll_id'] = $poll['id'];
             $voted = $this->hasVoted($poll['id']);
             $template->setVariable('voted', $voted);
             $template->setVariable('poll', $poll);
             $itemlist = $this->getPollResult($poll['id'], $tag['tag'], $settings, $voted);
             $template->setVariable('tpl_poll_result', $itemlist);
         }
         $this->template[$tag['tag']] = $template;
     }
 }
开发者ID:rverbrugge,项目名称:dif,代码行数:39,代码来源:PollOverview.php


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