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


PHP ContentObjectRenderer::calc方法代码示例

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


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

示例1: makeMenu


//.........这里部分代码省略.........
                             } else {
                                 // If the mount point could not be fetched with respect to
                                 // enableFields, unset the row so it does not become a part of the menu!
                                 unset($row);
                             }
                         } else {
                             $row = $loadDB->results['pages'][$val['id']];
                         }
                         //Add versioning overlay for current page (to respect workspaces)
                         if (is_array($row)) {
                             $this->sys_page->versionOL('pages', $row, TRUE);
                         }
                         // Add external MP params, then the row:
                         if (is_array($row)) {
                             if ($MP) {
                                 $row['_MP_PARAM'] = $MP . ($row['_MP_PARAM'] ? ',' . $row['_MP_PARAM'] : '');
                             }
                             $temp[] = $this->sys_page->getPageOverlay($row);
                         }
                     }
                     break;
                 case 'updated':
                     if ($value == '') {
                         $value = $GLOBALS['TSFE']->page['uid'];
                     }
                     $items = GeneralUtility::intExplode(',', $value);
                     if (MathUtility::canBeInterpretedAsInteger($this->conf['special.']['depth'])) {
                         $depth = MathUtility::forceIntegerInRange($this->conf['special.']['depth'], 1, 20);
                     } else {
                         $depth = 20;
                     }
                     // Max number of items
                     $limit = MathUtility::forceIntegerInRange($this->conf['special.']['limit'], 0, 100);
                     $maxAge = (int) $this->parent_cObj->calc($this->conf['special.']['maxAge']);
                     if (!$limit) {
                         $limit = 10;
                     }
                     // *'auto', 'manual', 'tstamp'
                     $mode = $this->conf['special.']['mode'];
                     // Get id's
                     $id_list_arr = array();
                     foreach ($items as $id) {
                         $bA = MathUtility::forceIntegerInRange($this->conf['special.']['beginAtLevel'], 0, 100);
                         $id_list_arr[] = $this->parent_cObj->getTreeList(-1 * $id, $depth - 1 + $bA, $bA - 1);
                     }
                     $id_list = implode(',', $id_list_arr);
                     // Get sortField (mode)
                     switch ($mode) {
                         case 'starttime':
                             $sortField = 'starttime';
                             break;
                         case 'lastUpdated':
                         case 'manual':
                             $sortField = 'lastUpdated';
                             break;
                         case 'tstamp':
                             $sortField = 'tstamp';
                             break;
                         case 'crdate':
                             $sortField = 'crdate';
                             break;
                         default:
                             $sortField = 'SYS_LASTCHANGED';
                     }
                     // Get
                     $extraWhere = ($this->conf['includeNotInMenu'] ? '' : ' AND pages.nav_hide=0') . $this->getDoktypeExcludeWhere();
开发者ID:rob-ot-dot-be,项目名称:ggallkeysecurity,代码行数:67,代码来源:AbstractMenuContentObject.php

示例2: prepareMenuItemsForUpdatedMenu

 /**
  * Fetches all menuitems if special = updated is set
  *
  * @param string $specialValue The value from special.value
  * @param string $sortingField The sorting field
  * @return array
  */
 protected function prepareMenuItemsForUpdatedMenu($specialValue, $sortingField)
 {
     $tsfe = $this->getTypoScriptFrontendController();
     $menuItems = array();
     if ($specialValue == '') {
         $specialValue = $tsfe->page['uid'];
     }
     $items = GeneralUtility::intExplode(',', $specialValue);
     if (MathUtility::canBeInterpretedAsInteger($this->conf['special.']['depth'])) {
         $depth = MathUtility::forceIntegerInRange($this->conf['special.']['depth'], 1, 20);
     } else {
         $depth = 20;
     }
     // Max number of items
     $limit = MathUtility::forceIntegerInRange($this->conf['special.']['limit'], 0, 100);
     $maxAge = (int) $this->parent_cObj->calc($this->conf['special.']['maxAge']);
     if (!$limit) {
         $limit = 10;
     }
     // *'auto', 'manual', 'tstamp'
     $mode = $this->conf['special.']['mode'];
     // Get id's
     $id_list_arr = array();
     foreach ($items as $id) {
         $bA = MathUtility::forceIntegerInRange($this->conf['special.']['beginAtLevel'], 0, 100);
         $id_list_arr[] = $this->parent_cObj->getTreeList(-1 * $id, $depth - 1 + $bA, $bA - 1);
     }
     $id_list = implode(',', $id_list_arr);
     // Get sortField (mode)
     switch ($mode) {
         case 'starttime':
             $sortField = 'starttime';
             break;
         case 'lastUpdated':
         case 'manual':
             $sortField = 'lastUpdated';
             break;
         case 'tstamp':
             $sortField = 'tstamp';
             break;
         case 'crdate':
             $sortField = 'crdate';
             break;
         default:
             $sortField = 'SYS_LASTCHANGED';
     }
     $extraWhere = ($this->conf['includeNotInMenu'] ? '' : ' AND pages.nav_hide=0') . $this->getDoktypeExcludeWhere();
     if ($this->conf['special.']['excludeNoSearchPages']) {
         $extraWhere .= ' AND pages.no_search=0';
     }
     if ($maxAge > 0) {
         $extraWhere .= ' AND ' . $sortField . '>' . ($GLOBALS['SIM_ACCESS_TIME'] - $maxAge);
     }
     $res = $this->parent_cObj->exec_getQuery('pages', array('pidInList' => '0', 'uidInList' => $id_list, 'where' => $sortField . '>=0' . $extraWhere, 'orderBy' => $sortingField ?: $sortField . ' DESC', 'max' => $limit));
     while ($row = $this->getDatabaseConnection()->sql_fetch_assoc($res)) {
         $tsfe->sys_page->versionOL('pages', $row, true);
         if (is_array($row)) {
             $menuItems[$row['uid']] = $this->sys_page->getPageOverlay($row);
         }
     }
     $this->getDatabaseConnection()->sql_free_result($res);
     return $menuItems;
 }
开发者ID:vip3out,项目名称:TYPO3.CMS,代码行数:70,代码来源:AbstractMenuContentObject.php


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