本文整理匯總了PHP中SearchHelper::getFields方法的典型用法代碼示例。如果您正苦於以下問題:PHP SearchHelper::getFields方法的具體用法?PHP SearchHelper::getFields怎麽用?PHP SearchHelper::getFields使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類SearchHelper
的用法示例。
在下文中一共展示了SearchHelper::getFields方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getFields
public static function getFields($fieldsetID)
{
$result = SearchHelper::getFields($fieldsetID);
if (PEAR::isError($result)) {
AjaxSearchHelper::createResponse(AjaxSearchHelper::STATUS_INTERNAL, $result->getMessage());
}
AjaxSearchHelper::createResponse(AjaxSearchHelper::STATUS_SUCCESS, null, 'fields', $result);
}
示例2: getJSfieldsetStruct
public static function getJSfieldsetStruct($fieldsets = null)
{
if (is_null($fieldsets)) {
$fieldsets = SearchHelper::getFieldsets();
}
$fieldset_str = '[';
$fso = 0;
foreach ($fieldsets as $fieldset) {
$fsid = $fieldset['id'];
$name = searchfix($fieldset['name']);
$desc = searchfix($fieldset['description']);
if ($fso++ > 0) {
$fieldset_str .= ',';
}
$fieldset_str .= "\n\t{id:\"{$fsid}\",name:\"{$name}\",description:\"{$desc}\", fields: [";
$result['fieldsets'][$fsid] = $fieldset;
$fields = SearchHelper::getFields($fsid);
$result['fieldsets'][$fsid]['fields'] = array();
$fo = 0;
foreach ($fields as $field) {
if ($fo++ > 0) {
$fieldset_str .= ',';
}
$fid = $field['id'];
$name = searchfix($field['name']);
$desc = searchfix($field['description']);
$datatype = $field['datatype'];
$control = $field['control'];
$fieldset_str .= "\n\t\t{id:\"{$fid}\", name:\"{$name}\", description:\"{$desc}\", datatype:\"{$datatype}\", control:\"{$control}\", options: [";
$options = $field['options'];
$oo = 0;
if (!is_array($options)) {
$options = array();
}
foreach ($options as $option) {
if ($oo++ > 0) {
$fieldset_str .= ',';
}
$oid = $option['id'];
$name = searchfix($option['name']);
$fieldset_str .= "\n\t\t\t{id: \"{$oid}\", name: \"{$name}\"}";
}
$fieldset_str .= ']}';
$result['fieldsets'][$fsid]['fields'][$fid] = $field;
}
$fieldset_str .= ']}';
}
$fieldset_str .= ']';
return $fieldset_str;
}