當前位置: 首頁>>代碼示例>>PHP>>正文


PHP JCckPluginField::g_onCCK_FieldPrepareStore_X方法代碼示例

本文整理匯總了PHP中JCckPluginField::g_onCCK_FieldPrepareStore_X方法的典型用法代碼示例。如果您正苦於以下問題:PHP JCckPluginField::g_onCCK_FieldPrepareStore_X方法的具體用法?PHP JCckPluginField::g_onCCK_FieldPrepareStore_X怎麽用?PHP JCckPluginField::g_onCCK_FieldPrepareStore_X使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在JCckPluginField的用法示例。


在下文中一共展示了JCckPluginField::g_onCCK_FieldPrepareStore_X方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: onCCK_FieldPrepareStore

 public function onCCK_FieldPrepareStore(&$field, $value = '', &$config = array(), $inherit = array(), $return = false)
 {
     if (self::$type != $field->type) {
         return;
     }
     // Init
     if (count($inherit)) {
         $name = isset($inherit['name']) && $inherit['name'] != '' ? $inherit['name'] : $field->name;
     } else {
         $name = $field->name;
     }
     $dispatcher = JDispatcher::getInstance();
     // Prepare
     $store = '';
     $text = '';
     $xi = 0;
     if (count($value)) {
         $store = '<br />';
         foreach ($value as $key => $val) {
             $store .= '<br />::cck_' . $name . '::' . $field->extended . '::/cck_' . $name . '::';
             $text .= '- ' . $field->label . ' ' . $xi . ': <ul style="line-height:10px;">';
             $fields = self::_getChildren($field, $config);
             if (count($fields)) {
                 foreach ($fields as $f) {
                     $f->storage = $field->storage;
                     $f->storage_table = $field->storage_table;
                     $f->storage_field = $field->storage_field;
                     $f->state = '';
                     //todo;
                     $f_label = $f->label;
                     $f_name = $f->name;
                     $f_value = @$val[$f_name];
                     $inherit = array('xk' => $key, 'xi' => $xi, 'parent' => $name, 'array_x' => 1, 'post' => $val);
                     $results = $dispatcher->trigger('onCCK_FieldPrepareStore', array(&$f, $f_value, &$config, $inherit, true));
                     $v = $results[0];
                     $store .= '<br />::' . $f_name . '|' . $xi . '|' . $name . '::' . $v . '::/' . $f_name . '|' . $xi . '|' . $name . '::';
                     $text .= '<li style="line-height:10px;">' . $f_label . ' : ' . $v . '</li>';
                     // todo: add childs (secondary) storages.. not primary!
                 }
             }
             $store .= '<br />::cckend_' . $name . '::::/cckend_' . $name . '::';
             $text .= '</ul>';
             $xi++;
         }
         $store .= '<br />';
     }
     $value = $xi;
     $field->value = $value;
     $field->text = $text;
     parent::g_onCCK_FieldPrepareStore_X($field, $name, $value, $store, $config);
 }
開發者ID:codigoaberto,項目名稱:SEBLOD,代碼行數:51,代碼來源:group_x.php

示例2: onCCK_FieldPrepareStore

 public function onCCK_FieldPrepareStore(&$field, $value = '', &$config = array(), $inherit = array(), $return = false)
 {
     if (self::$type != $field->type) {
         return;
     }
     // Init
     if (count($inherit)) {
         $name = isset($inherit['name']) && $inherit['name'] != '' ? $inherit['name'] : $field->name;
     } else {
         $name = $field->name;
     }
     $value = isset($config['post'][$name . '_hidden']) ? $config['post'][$name . '_hidden'] : $value;
     $dispatcher = JDispatcher::getInstance();
     // Prepare
     $store = '';
     $xk = 0;
     $xi = 0;
     if (count($value)) {
         $store = '<br />';
         //begin?
         $f = self::_getChild($field, $config);
         $f_name = $f->name;
         $f->state = '';
         //todo;
         foreach ($value as $val) {
             //if ( $val != '' ) {
             $inherit = array('name' => $name, 'xk' => $xk, 'xi' => $xi, 'parent' => $name);
             $results = $dispatcher->trigger('onCCK_FieldPrepareStore', array(&$f, $val, &$config, $inherit, true));
             $v = $results[0];
             if ($v != '') {
                 $store .= '<br />::' . $f_name . '|' . $xi . '|' . $name . '::' . $v . '::/' . $f_name . '|' . $xi . '|' . $name . '::';
                 $xi++;
             }
             // todo: add childs (secondary) storages.. not primary!
             //}
             $xk++;
         }
         $store .= '<br />';
         //end?
     }
     $value = $xi;
     $field->value = $value;
     parent::g_onCCK_FieldPrepareStore_X($field, $name, $value, $store, $config);
 }
開發者ID:hamby,項目名稱:SEBLOD,代碼行數:44,代碼來源:field_x.php


注:本文中的JCckPluginField::g_onCCK_FieldPrepareStore_X方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。