本文整理汇总了PHP中SFUtils::getAllPagesForQuery方法的典型用法代码示例。如果您正苦于以下问题:PHP SFUtils::getAllPagesForQuery方法的具体用法?PHP SFUtils::getAllPagesForQuery怎么用?PHP SFUtils::getAllPagesForQuery使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SFUtils
的用法示例。
在下文中一共展示了SFUtils::getAllPagesForQuery方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: formHTML
//.........这里部分代码省略.........
if ($propValue->getPropertyTypeID() == '_wpg') {
$field_args['autocomplete field type'] = 'relation';
} else {
$field_args['autocomplete field type'] = 'attribute';
}
$field_args['autocompletion source'] = $sub_components[1];
} elseif ($sub_components[0] == 'autocomplete on category') {
$field_args['autocomplete field type'] = 'category';
$field_args['autocompletion source'] = $sub_components[1];
} elseif ($sub_components[0] == 'autocomplete on concept') {
$field_args['autocomplete field type'] = 'concept';
$field_args['autocompletion source'] = $sub_components[1];
} elseif ($sub_components[0] == 'autocomplete on namespace') {
$field_args['autocomplete field type'] = 'namespace';
$autocompletion_source = $sub_components[1];
// special handling for "main" (blank) namespace
if ($autocompletion_source == "") {
$autocompletion_source = "main";
}
$field_args['autocompletion source'] = $autocompletion_source;
} elseif ($sub_components[0] == 'autocomplete from url') {
$field_args['autocomplete field type'] = 'external_url';
$field_args['autocompletion source'] = $sub_components[1];
// 'external' autocompletion is always done remotely, i.e. via API
$field_args['remote autocompletion'] = true;
} elseif ($sub_components[0] == 'values') {
// Handle this one only after 'delimiter' has
// also been set.
$values = $sub_components[1];
} elseif ($sub_components[0] == 'values from property') {
$propertyName = $sub_components[1];
$possible_values = SFUtils::getAllValuesForProperty($propertyName);
} elseif ($sub_components[0] == 'values from query') {
$pages = SFUtils::getAllPagesForQuery($sub_components[1]);
foreach ($pages as $page) {
$page_name_for_values = $page->getDbKey();
$possible_values[] = $page_name_for_values;
}
} elseif ($sub_components[0] == 'values from category') {
$category_name = ucfirst($sub_components[1]);
$possible_values = SFUtils::getAllPagesForCategory($category_name, 10);
} elseif ($sub_components[0] == 'values from concept') {
$possible_values = SFUtils::getAllPagesForConcept($sub_components[1]);
} elseif ($sub_components[0] == 'values from namespace') {
$possible_values = SFUtils::getAllPagesForNamespace($sub_components[1]);
} elseif ($sub_components[0] == 'values dependent on') {
global $sfgDependentFields;
$sfgDependentFields[] = array($sub_components[1], $fullFieldName);
} elseif ($sub_components[0] == 'property') {
$semantic_property = $sub_components[1];
} elseif ($sub_components[0] == 'default filename') {
$default_filename = str_replace('<page name>', $page_name, $sub_components[1]);
// Parse value, so default filename can include parser functions.
$default_filename = $wgParser->recursiveTagParse($default_filename);
$field_args['default filename'] = $default_filename;
} elseif ($sub_components[0] == 'restricted') {
$is_restricted = !array_intersect($wgUser->getEffectiveGroups(), array_map('trim', explode(',', $sub_components[1])));
}
if (!is_null($possible_values) && array_key_exists('mapping template', $field_args)) {
$possible_values = SFUtils::getLabels($possible_values, $field_args['mapping template']);
}
}
}
// end for
// Backwards compatibility
if ($input_type == 'datetime with timezone') {
示例2: newFromFormFieldTag
//.........这里部分代码省略.........
}
}
} elseif ($sub_components[0] == 'autocomplete on property') {
$f->mFieldArgs['autocomplete field type'] = 'property';
$f->mFieldArgs['autocompletion source'] = $sub_components[1];
} elseif ($sub_components[0] == 'autocomplete on category') {
$f->mFieldArgs['autocomplete field type'] = 'category';
$f->mFieldArgs['autocompletion source'] = $sub_components[1];
} elseif ($sub_components[0] == 'autocomplete on concept') {
$f->mFieldArgs['autocomplete field type'] = 'concept';
$f->mFieldArgs['autocompletion source'] = $sub_components[1];
} elseif ($sub_components[0] == 'autocomplete on namespace') {
$f->mFieldArgs['autocomplete field type'] = 'namespace';
$autocompletion_source = $sub_components[1];
// Special handling for "main" (blank)
// namespace.
if ($autocompletion_source == "") {
$autocompletion_source = "main";
}
$f->mFieldArgs['autocompletion source'] = $autocompletion_source;
} elseif ($sub_components[0] == 'autocomplete from url') {
$f->mFieldArgs['autocomplete field type'] = 'external_url';
$f->mFieldArgs['autocompletion source'] = $sub_components[1];
// 'external' autocompletion is always done remotely, i.e. via API
$f->mFieldArgs['remote autocompletion'] = true;
} elseif ($sub_components[0] == 'values') {
// Handle this one only after
// 'delimiter' has also been set.
$values = $wgParser->recursiveTagParse($sub_components[1]);
} elseif ($sub_components[0] == 'values from property') {
$propertyName = $sub_components[1];
$f->mPossibleValues = SFUtils::getAllValuesForProperty($propertyName);
} elseif ($sub_components[0] == 'values from query') {
$pages = SFUtils::getAllPagesForQuery($sub_components[1]);
foreach ($pages as $page) {
$page_name_for_values = $page->getDbKey();
$f->mPossibleValues[] = $page_name_for_values;
}
} elseif ($sub_components[0] == 'values from category') {
$category_name = ucfirst($sub_components[1]);
$f->mPossibleValues = SFUtils::getAllPagesForCategory($category_name, 10);
} elseif ($sub_components[0] == 'values from concept') {
$f->mPossibleValues = SFUtils::getAllPagesForConcept($sub_components[1]);
} elseif ($sub_components[0] == 'values from namespace') {
$f->mPossibleValues = SFUtils::getAllPagesForNamespace($sub_components[1]);
} elseif ($sub_components[0] == 'values dependent on') {
global $sfgDependentFields;
$sfgDependentFields[] = array($sub_components[1], $fullFieldName);
} elseif ($sub_components[0] == 'unique for category') {
$f->mFieldArgs['unique'] = true;
$f->mFieldArgs['unique_for_category'] = $sub_components[1];
} elseif ($sub_components[0] == 'unique for namespace') {
$f->mFieldArgs['unique'] = true;
$f->mFieldArgs['unique_for_namespace'] = $sub_components[1];
} elseif ($sub_components[0] == 'unique for concept') {
$f->mFieldArgs['unique'] = true;
$f->mFieldArgs['unique_for_concept'] = $sub_components[1];
} elseif ($sub_components[0] == 'property') {
$semantic_property = $sub_components[1];
} elseif ($sub_components[0] == 'cargo table') {
$cargo_table = $sub_components[1];
} elseif ($sub_components[0] == 'cargo field') {
$cargo_field = $sub_components[1];
} elseif ($sub_components[0] == 'default filename') {
$default_filename = str_replace('<page name>', $page_name, $sub_components[1]);
// Parse value, so default filename can