本文整理汇总了PHP中I2CE_FormStorage::getMechanismByStorage方法的典型用法代码示例。如果您正苦于以下问题:PHP I2CE_FormStorage::getMechanismByStorage方法的具体用法?PHP I2CE_FormStorage::getMechanismByStorage怎么用?PHP I2CE_FormStorage::getMechanismByStorage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类I2CE_FormStorage
的用法示例。
在下文中一共展示了I2CE_FormStorage::getMechanismByStorage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildDataTree
//.........这里部分代码省略.........
unset($field);
$styles = array();
$ff = I2CE_FormFactory::instance();
if ($last_form) {
$avail_styles = array($last_form => $style);
$curr_style = $style;
foreach (array_reverse($fields) as $formfield) {
list($form, $link_field) = $formfield;
if (!$form || !($formObj = $ff->createContainer($form)) instanceof I2CE_Form) {
break;
}
if (array_key_exists($form, $avail_styles) && is_string($avail_styles[$form])) {
$curr_style = $avail_styles[$form];
} else {
$curr_style = 'default';
}
$styles["{$form}+{$link_field}"] = $curr_style;
if (!$link_field || !($fieldObj = $formObj->getField($link_field)) instanceof I2CE_FormField) {
break;
}
$avail_styles = I2CE_List::getDisplayFieldStyles($form, $style);
}
}
if (is_array($report)) {
$results = self::buildReportTree($fields, $forms, $displayed, $limits, $orders, $show_hidden, $report);
if (count($results) > 0) {
return $results;
} else {
I2CE::raiseError("buildReportTree returned no results so defaulting to regular display. If there is data then something went wrong so it should be fixed.");
}
}
$use_cache = true;
if (I2CE_ModuleFactory::instance()->isEnabled("CachedForms")) {
$fs = I2CE_FormStorage::getMechanismByStorage("cached");
if ($fs instanceof I2CE_FormStorage_cached) {
try {
return $fs->buildDataTree($fields, $forms, $displayed, $limits, $orders, $show_hidden, $style);
} catch (Exception $e) {
$use_cache = false;
I2CE::raiseError("Could not cache {$form}");
}
}
}
$phonebook = array();
//indexed by "$form|$id" with values (by reference) the arrays at which contains the 'children' sub-array for $form|$id node
$parent_links = array();
//indexed by "$form|$id" with values "$pform|$pid" which is the form/id that "$form|$id" is linked against
$display_string = array();
foreach ($fields as $formfield) {
list($form, $link_field) = $formfield;
if (array_key_exists("{$form}+{$link_field}", $limits)) {
$limit = $limits["{$form}+{$link_field}"];
} elseif (array_key_exists($form, $limits)) {
$limit = $limits[$form];
} else {
$limit = array();
}
if (!($formObj = $ff->createContainer($form)) instanceof I2CE_Form) {
continue;
}
$style = 'default';
if (array_key_exists("{$form}+{$link_field}", $styles)) {
$style = $styles["{$form}+{$link_field}"];
}
//if we dont show the hidden list memmber we need to include the limit where i2ce_disabled is false
$limit = self::showHiddenLimit($limit, $show_hidden);