当前位置: 首页>>代码示例>>PHP>>正文


PHP SFUtils::getAllValuesForProperty方法代码示例

本文整理汇总了PHP中SFUtils::getAllValuesForProperty方法的典型用法代码示例。如果您正苦于以下问题:PHP SFUtils::getAllValuesForProperty方法的具体用法?PHP SFUtils::getAllValuesForProperty怎么用?PHP SFUtils::getAllValuesForProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SFUtils的用法示例。


在下文中一共展示了SFUtils::getAllValuesForProperty方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: formHTML


//.........这里部分代码省略.........
							} elseif ( $sub_components[0] == 'autocomplete on property' ) {
								$property_name = $sub_components[1];
								$propValue = SMWPropertyValue::makeUserProperty( $property_name );
								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 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[$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] ) )
								);
							}
						}
					} // 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
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:67,代码来源:SF_FormPrinter.php

示例2: newFromFormFieldTag


//.........这里部分代码省略.........
                     } else {
                         $show_on_select[$val] = array();
                     }
                 }
             } 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') {
开发者ID:paladox,项目名称:mediawiki-extensions-SemanticForms,代码行数:67,代码来源:SF_FormField.php


注:本文中的SFUtils::getAllValuesForProperty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。