本文整理汇总了PHP中AdminHelper::formatElementValue方法的典型用法代码示例。如果您正苦于以下问题:PHP AdminHelper::formatElementValue方法的具体用法?PHP AdminHelper::formatElementValue怎么用?PHP AdminHelper::formatElementValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AdminHelper
的用法示例。
在下文中一共展示了AdminHelper::formatElementValue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getElementValues
public static function getElementValues($storedElement)
{
$return_array = array();
$app_json = AdminHelper::getElementAppJSON($storedElement['type']);
if ($app_json) {
// start by getting defaults. this will populate scalars, etc.
$return_array = AdminHelper::getElementDefaults($app_json['options']);
foreach ($app_json['options'] as $section_name => $details) {
foreach ($details['data'] as $data => $value) {
if (isset($value['values'])) {
$formatting_data = $value['values'];
}
if ($value['type'] == 'options') {
if (is_array($value['values'])) {
foreach ($value['values'] as $subname => $subvalue) {
if (isset($storedElement['options'][$data][$subname])) {
$return_array['options_' . $value['name'] . '-' . $subname] = AdminHelper::formatElementValue($storedElement['options'][$data][$subname], $subvalue['type'], $formatting_data);
}
}
}
} else {
if ($value['type'] == 'scalar') {
$scalarcount = 0;
if (isset($storedElement['options'][$data])) {
if (is_array($storedElement['options'][$data])) {
$scalarcount = count($storedElement['options'][$data]);
}
}
for ($i = 0; $i < $scalarcount; $i++) {
foreach ($value['values'] as $subname => $subvalue) {
if (isset($subvalue['values'])) {
$formatting_data = $subvalue['values'];
}
if ($subvalue['type'] == 'options') {
if (is_array($subvalue['values'])) {
foreach ($subvalue['values'] as $sub2name => $sub2value) {
if (isset($sub2value['values'])) {
$formatting_data = $sub2value['values'];
}
if (isset($storedElement['options'][$data][$i][$subname][$sub2name])) {
$return_array['options_' . $subname . '-' . $sub2name . '-clone-' . $data . '-' . $i] = AdminHelper::formatElementValue($storedElement['options'][$data][$i][$subname][$sub2name], $sub2value['type'], $formatting_data);
}
}
}
} else {
if (isset($storedElement['options'][$data][$i][$subname])) {
$return_array['options_' . $subname . '-clone-' . $data . '-' . $i] = AdminHelper::formatElementValue($storedElement['options'][$data][$i][$subname], $subvalue['type'], $formatting_data);
}
}
}
}
} else {
if (isset($storedElement['options'][$data])) {
$return_array['options_' . $data] = AdminHelper::formatElementValue($storedElement['options'][$data], $value['type'], $formatting_data);
}
}
}
}
}
}
return $return_array;
}