本文整理汇总了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);
}
示例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);
}