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


PHP FlexicontentFields::triggerContentPlugins方法代码示例

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


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

示例1: renderField


//.........这里部分代码省略.........
             $field->value = isset($item->fieldvalues[$field->id]) ? $item->fieldvalues[$field->id] : array();
         }
         FlexicontentFields::loadFieldConfig($field, $item);
     }
     // **********************************************
     // Return no access message if user has no ACCESS
     // **********************************************
     // Calculate has_access flag if it is missing ... FLEXI_ACCESS ... no longer supported here ...
     if (!isset($first_item_field->has_access)) {
         $first_item_field->has_access = FLEXI_J16GE ? in_array($first_item_field->access, $aid) : $first_item_field->access <= $aid;
     }
     if (!$first_item_field->has_access) {
         // Get configuration out of the field of the first item, any CONFIGURATION that is different
         // per content TYPE, must not use this, instead it must be retrieved inside the item loops
         $show_acc_msg = $first_item_field->parameters->get('show_acc_msg', 0);
         $no_acc_msg = $first_item_field->parameters->get('no_acc_msg');
         $no_acc_msg = JText::_($no_acc_msg ? $no_acc_msg : 'FLEXI_FIELD_NO_ACCESS');
         foreach ($items as $item) {
             $field = is_object($_field) ? $_field : $item->fields[$field_name];
             // only rendering 1 item the field object was given
             $field->{$method} = $show_acc_msg ? '<span class="fc-noauth fcfield_inaccessible_' . $field->id . '">' . $no_acc_msg . '</span>' : '';
         }
         // Return field only if single item was given (with a field object)
         return !is_object($_field) ? null : $_field;
     }
     // ***************************************************************************************************
     // Create field HTML by calling the appropriate DISPLAY-CREATING field plugin method.
     // NOTE 1: We will not pass the 'values' method parameter to the display-creating field method,
     //         instead we have set it above as the 'value' field property
     // NOTE 2: For CUSTOM fields the 'values' method parameter is prefered over the 'value' field property
     //         For CORE field, both the above ('values' method parameter and 'value' field property) are
     //         ignored and instead the other method parameters are used, along with the ITEM properties
     // ****************************************************************************************************
     // Log content plugin and other performance information
     $print_logging_info = $cparams->get('print_logging_info');
     if ($print_logging_info) {
         global $fc_run_times;
     }
     if ($print_logging_info) {
         $start_microtime = microtime(true);
     }
     if ($first_item_field->iscore == 1) {
         //$results = $dispatcher->trigger('onDisplayCoreFieldValue', array( &$_field, $_item, &$_item->parameters, $_item->tags, $_item->cats, $_item->favs, $_item->fav, $_item->vote ));
         //FLEXIUtilities::call_FC_Field_Func('core', 'onDisplayCoreFieldValue', array( &$_field, & $_item, &$_item->parameters, $_item->tags, $_item->cats, $_item->favs, $_item->fav, $_item->vote, null, $method ) );
         $items_params = null;
         FLEXIUtilities::call_FC_Field_Func('core', 'onDisplayCoreFieldValue', array(&$_field, &$items, &$items_params, false, false, false, false, false, null, $method));
     } else {
         // DOES NOT support multiple items YET, do it 1 at a time
         foreach ($items as $item) {
             $field = is_object($_field) ? $_field : $item->fields[$field_name];
             // only rendering 1 item the field object was given
             //$results = $dispatcher->trigger('onDisplayFieldValue', array( &$field, $item ));
             FLEXIUtilities::call_FC_Field_Func($field->field_type, 'onDisplayFieldValue', array(&$field, $item, null, $method));
         }
     }
     if ($print_logging_info) {
         $field_render_time = round(1000000 * 10 * (microtime(true) - $start_microtime)) / 10;
         if (isset($fc_run_times['render_subfields'][$item->id . "_" . $field->id])) {
             $field_render_time = $field_render_time - $fc_run_times['render_subfields'][$item->id . "_" . $field->id];
             @($fc_run_times['render_subfields'][$field->field_type] += $fc_run_times['render_subfields'][$item->id . "_" . $field->id]);
             unset($fc_run_times['render_subfields'][$item->id . "_" . $field->id]);
         }
         @($fc_run_times['render_field'][$field->field_type] += $field_render_time);
     }
     // *****************************************
     // Trigger content plugins on the field text
     // *****************************************
     // Get configuration out of the field of the first item, if this CONFIGURATION was
     // different per content TYPE, then we should move this inside the item loop (below)
     if (!is_array($_item)) {
         $field = $_field;
     } else {
         $item = reset($items);
         $field = $item->fields[$field_name];
     }
     if (!isset($_trigger_plgs_ft[$field_name])) {
         $_t = $field->parameters->get('trigger_onprepare_content', 0);
         if ($flexiview == 'category') {
             $_t = $_t && $field->parameters->get('trigger_plgs_incatview', 1);
         }
         $_trigger_plgs_ft[$field_name] = $_t;
     }
     // DOES NOT support multiple items, do it 1 at a time
     if ($_trigger_plgs_ft[$field_name]) {
         //echo "RENDER: ".$field_name."<br/>";
         foreach ($items as $item) {
             $field = is_object($_field) ? $_field : $item->fields[$field_name];
             // only rendering 1 item the field object was given
             if ($print_logging_info) {
                 $start_microtime = microtime(true);
             }
             FlexicontentFields::triggerContentPlugins($field, $item, $method, $view);
             if ($print_logging_info) {
                 @($fc_run_times['content_plg'] += round(1000000 * 10 * (microtime(true) - $start_microtime)) / 10);
             }
         }
     }
     // Return field only if single item was given (with a field object)
     return !is_object($_field) ? null : $_field;
 }
开发者ID:jakesyl,项目名称:flexicontent,代码行数:101,代码来源:flexicontent.fields.php


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