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


PHP CompositeField::insertBeforeRecursive方法代码示例

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


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

示例1: duplicateOrReplaceFields

 protected function duplicateOrReplaceFields(&$fields)
 {
     $tasks = array('dup' => array());
     foreach ($fields as $field) {
         if ($field->isComposite()) {
             $innertasks = $this->duplicateOrReplaceFields($field->FieldSet());
             $tasks['dup'] = array_merge($tasks['dup'], $innertasks['dup']);
         } else {
             if (($fieldname = $field->Name()) && array_key_exists($fieldname, $this->original_values)) {
                 // Get a copy of the original field to show the untranslated value
                 if (is_subclass_of($field->class, 'TextareaField')) {
                     $nonEditableField = new ToggleField($fieldname, $field->Title(), '', '+', '-');
                     $nonEditableField->labelMore = '+';
                     $nonEditableField->labelLess = '-';
                 } else {
                     $nonEditableField = $field->performDisabledTransformation();
                 }
                 $nonEditableField_holder = new CompositeField($nonEditableField);
                 $nonEditableField_holder->setName($fieldname . '_holder');
                 $nonEditableField_holder->addExtraClass('originallang_holder');
                 $nonEditableField->setValue($this->original_values[$fieldname]);
                 $nonEditableField->setName($fieldname . '_original');
                 $nonEditableField->addExtraClass('originallang');
                 if (array_search($fieldname, $this->translatableFields) !== false) {
                     // Duplicate the field
                     if ($field->Title()) {
                         $nonEditableField->setTitle('Original');
                     }
                     $nonEditableField_holder->insertBeforeRecursive($field, $fieldname . '_original');
                     $tasks['dup'][$fieldname] = $nonEditableField_holder;
                 }
             }
         }
     }
     return $tasks;
 }
开发者ID:ramziammar,项目名称:websites,代码行数:36,代码来源:Translatable.php

示例2: insertBeforeRecursive

 public function insertBeforeRecursive($field, $insertBefore, $level)
 {
     $level = parent::insertBeforeRecursive($field, $insertBefore, $level + 1);
     if ($level === 0) {
         $field->setTabSet($this);
     }
     return $level;
 }
开发者ID:ramziammar,项目名称:websites,代码行数:8,代码来源:TabSet.php


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