本文整理汇总了PHP中SFUtils::getLabels方法的典型用法代码示例。如果您正苦于以下问题:PHP SFUtils::getLabels方法的具体用法?PHP SFUtils::getLabels怎么用?PHP SFUtils::getLabels使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SFUtils
的用法示例。
在下文中一共展示了SFUtils::getLabels方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: formHTML
//.........这里部分代码省略.........
// 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') {
$input_type = 'datetime';
$field_args['include timezone'] = true;
} elseif ($input_type == 'text' || $input_type == 'textarea') {
// Also for backwards compatibility,
// in that once b/c goes away,
// this will no longer be
// necessary.
$field_args['no autocomplete'] = true;
}
if ($allow_multiple) {
$field_args['part_of_multiple'] = $allow_multiple;
}
if (count($show_on_select) > 0) {
$field_args['show on select'] = $show_on_select;
}
if (array_key_exists('delimiter', $field_args)) {
$delimiter = $field_args['delimiter'];
} else {
$delimiter = ",";
}
// Get the value from the request, if
// it's there, and if it's not an array.
$cur_value = null;
$escaped_field_name = str_replace("'", "\\'", $field_name);
if (isset($template_instance_query_values) && $template_instance_query_values != null && is_array($template_instance_query_values)) {
// If the field name contains an