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


PHP TemplateService::splitConfArray方法代码示例

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


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

示例1: procesItemStates

 /**
  * Generating the per-menu-item configuration arrays based on the settings for item states (NO, RO, ACT, CUR etc) set in ->mconf (config for the current menu object)
  * Basically it will produce an individual array for each menu item based on the item states. BUT in addition the "optionSplit" syntax for the values is ALSO evaluated here so that all property-values are "option-splitted" and the output will thus be resolved.
  * Is called from the "generate" functions in the extension classes. The function is processor intensive due to the option split feature in particular. But since the generate function is not always called (since the ->result array may be cached, see makeMenu) it doesn't hurt so badly.
  *
  * @param integer $splitCount Number of menu items in the menu
  * @return array An array with two keys: array($NOconf,$ROconf) - where $NOconf contains the resolved configuration for each item when NOT rolled-over and $ROconf contains the ditto for the mouseover state (if any)
  * @access private
  * @todo Define visibility
  */
 public function procesItemStates($splitCount)
 {
     // Prepare normal settings
     if (!is_array($this->mconf['NO.']) && $this->mconf['NO']) {
         // Setting a blank array if NO=1 and there are no properties.
         $this->mconf['NO.'] = array();
     }
     $NOconf = $this->tmpl->splitConfArray($this->mconf['NO.'], $splitCount);
     // Prepare rollOver settings, overriding normal settings
     $ROconf = array();
     if ($this->mconf['RO']) {
         $ROconf = $this->tmpl->splitConfArray($this->mconf['RO.'], $splitCount);
     }
     // Prepare IFSUB settings, overriding normal settings
     // IFSUB is TRUE if there exist submenu items to the current item
     if ($this->mconf['IFSUB']) {
         // Flag: If $IFSUB is generated
         $IFSUBinit = 0;
         foreach ($NOconf as $key => $val) {
             if ($this->isItemState('IFSUB', $key)) {
                 // if this is the first IFSUB element, we must generate IFSUB.
                 if (!$IFSUBinit) {
                     $IFSUBconf = $this->tmpl->splitConfArray($this->mconf['IFSUB.'], $splitCount);
                     if ($this->mconf['IFSUBRO']) {
                         $IFSUBROconf = $this->tmpl->splitConfArray($this->mconf['IFSUBRO.'], $splitCount);
                     }
                     $IFSUBinit = 1;
                 }
                 // Substitute normal with ifsub
                 $NOconf[$key] = $IFSUBconf[$key];
                 // If rollOver on normal, we must apply a state for rollOver on the active
                 if ($ROconf) {
                     // If RollOver on active then apply this
                     $ROconf[$key] = $IFSUBROconf[$key] ?: $IFSUBconf[$key];
                 }
             }
         }
     }
     // Prepare active settings, overriding normal settings
     if ($this->mconf['ACT']) {
         // Flag: If $ACT is generated
         $ACTinit = 0;
         // Find active
         foreach ($NOconf as $key => $val) {
             if ($this->isItemState('ACT', $key)) {
                 // If this is the first 'active', we must generate ACT.
                 if (!$ACTinit) {
                     $ACTconf = $this->tmpl->splitConfArray($this->mconf['ACT.'], $splitCount);
                     // Prepare active rollOver settings, overriding normal active settings
                     if ($this->mconf['ACTRO']) {
                         $ACTROconf = $this->tmpl->splitConfArray($this->mconf['ACTRO.'], $splitCount);
                     }
                     $ACTinit = 1;
                 }
                 // Substitute normal with active
                 $NOconf[$key] = $ACTconf[$key];
                 // If rollOver on normal, we must apply a state for rollOver on the active
                 if ($ROconf) {
                     // If RollOver on active then apply this
                     $ROconf[$key] = $ACTROconf[$key] ?: $ACTconf[$key];
                 }
             }
         }
     }
     // Prepare ACT (active)/IFSUB settings, overriding normal settings
     // ACTIFSUB is TRUE if there exist submenu items to the current item and the current item is active
     if ($this->mconf['ACTIFSUB']) {
         // Flag: If $ACTIFSUB is generated
         $ACTIFSUBinit = 0;
         // Find active
         foreach ($NOconf as $key => $val) {
             if ($this->isItemState('ACTIFSUB', $key)) {
                 // If this is the first 'active', we must generate ACTIFSUB.
                 if (!$ACTIFSUBinit) {
                     $ACTIFSUBconf = $this->tmpl->splitConfArray($this->mconf['ACTIFSUB.'], $splitCount);
                     // Prepare active rollOver settings, overriding normal active settings
                     if ($this->mconf['ACTIFSUBRO']) {
                         $ACTIFSUBROconf = $this->tmpl->splitConfArray($this->mconf['ACTIFSUBRO.'], $splitCount);
                     }
                     $ACTIFSUBinit = 1;
                 }
                 // Substitute normal with active
                 $NOconf[$key] = $ACTIFSUBconf[$key];
                 // If rollOver on normal, we must apply a state for rollOver on the active
                 if ($ROconf) {
                     // If RollOver on active then apply this
                     $ROconf[$key] = $ACTIFSUBROconf[$key] ?: $ACTIFSUBconf[$key];
                 }
             }
         }
//.........这里部分代码省略.........
开发者ID:rob-ot-dot-be,项目名称:ggallkeysecurity,代码行数:101,代码来源:AbstractMenuContentObject.php

示例2: splitConfArraytest

 /**
  * @test
  * @dataProvider splitConfDataProvider
  * @see https://docs.typo3.org/typo3cms/TyposcriptReference/ObjectsAndProperties/Index.html#objects-optionsplit
  */
 public function splitConfArraytest($configuration, $splitCount, $expected)
 {
     $actual = $this->templateService->splitConfArray($configuration, $splitCount);
     $this->assertSame($expected, $actual);
 }
开发者ID:rickymathew,项目名称:TYPO3.CMS,代码行数:10,代码来源:TemplateServiceTest.php


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