本文整理汇总了PHP中SearchHelper::getFieldsets方法的典型用法代码示例。如果您正苦于以下问题:PHP SearchHelper::getFieldsets方法的具体用法?PHP SearchHelper::getFieldsets怎么用?PHP SearchHelper::getFieldsets使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SearchHelper
的用法示例。
在下文中一共展示了SearchHelper::getFieldsets方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: do_guiBuilder
function do_guiBuilder()
{
$this->oPage->setBreadcrumbDetails(_kt("Advanced Search"));
$this->oPage->title = _kt("Advanced Search");
$result = array();
// TODO: need to escape the parameters
$result['fieldsets'] = SearchHelper::getFieldsets();
$result['fieldset_str'] = SearchHelper::getJSfieldsetStruct($result['fieldsets']);
$result['workflows'] = SearchHelper::getWorkflows();
$result['workflow_str'] = SearchHelper::getJSworkflowStruct($result['workflows']);
$result['fields'] = SearchHelper::getSearchFields();
$result['fields_str'] = SearchHelper::getJSfieldsStruct($result['fields']);
$result['users_str'] = SearchHelper::getJSusersStruct();
$result['mimetypes_str'] = SearchHelper::getJSmimeTypesStruct();
$result['documenttypes_str'] = SearchHelper::getJSdocumentTypesStruct();
$oTemplating =& KTTemplating::getSingleton();
$oTemplate = $oTemplating->loadTemplate("ktcore/search2/adv_query_builder");
$aTemplateData = array("context" => $this, 'metainfo' => $result);
return $oTemplate->render($aTemplateData);
}
示例2: getFieldsets
public static function getFieldsets()
{
$rs = SearchHelper::getFieldsets();
if (PEAR::isError($rs)) {
AjaxSearchHelper::createResponse(AjaxSearchHelper::STATUS_INTERNAL, $rs->getMessage());
}
AjaxSearchHelper::createResponse(AjaxSearchHelper::STATUS_SUCCESS, null, 'fieldsets', $rs);
}
示例3: 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;
}