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


PHP SMWQueryProcessor::getParameters方法代码示例

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


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

示例1: getFormatParameters

 /**
  * Returns the definitions of all parameters supported by the specified format.
  *
  * @since 1.8
  *
  * @param string $format
  *
  * @return array of IParamDefinition
  */
 public static function getFormatParameters($format)
 {
     SMWParamFormat::resolveFormatAliases($format);
     if (array_key_exists($format, $GLOBALS['smwgResultFormats'])) {
         return ParamDefinition::getCleanDefinitions(SMWQueryProcessor::getResultPrinter($format)->getParamDefinitions(SMWQueryProcessor::getParameters()));
     } else {
         return array();
     }
 }
开发者ID:brandonphuong,项目名称:mediawiki,代码行数:18,代码来源:SMW_QueryProcessor.php

示例2: getFormatParameters

 /**
  * @param string $format
  *
  * @return array of IParamDefinition
  */
 protected function getFormatParameters($format)
 {
     if (array_key_exists($format, $GLOBALS['smwgResultFormats'])) {
         return ParamDefinition::getCleanDefinitions(SMWQueryProcessor::getResultPrinter($format)->getParamDefinitions(SMWQueryProcessor::getParameters()));
     } else {
         return array();
     }
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:13,代码来源:SMW_SMWDoc.php

示例3: render

 /**
  * Renders and returns the output.
  * @see ParserHook::render
  *
  * @since 1.0
  *
  * @param array $parameters
  *
  * @return string
  */
 public function render(array $parameters)
 {
     $this->language = $parameters['language'];
     $params = array();
     if (in_array($parameters['parameters'], array('all', 'base'))) {
         $params = array_merge($params, SMWQueryProcessor::getParameters());
     }
     if (in_array($parameters['parameters'], array('all', 'specific'))) {
         $params = array_merge($params, $this->getFormatParameters($parameters['format']));
     }
     return $this->getParameterTable($params);
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:22,代码来源:SMW_SMWDoc.php

示例4: testGetParamDefinitions

 /**
  * @dataProvider instanceProvider
  *
  * @param \SMWResultPrinter $printer
  */
 public function testGetParamDefinitions(\SMWResultPrinter $printer)
 {
     $params = $printer->getParamDefinitions(\SMWQueryProcessor::getParameters());
     $params = \ParamDefinition::getCleanDefinitions($params);
     $this->assertInternalType('array', $params);
 }
开发者ID:seedbank,项目名称:old-repo,代码行数:11,代码来源:ResultPrintersTest.php

示例5: showFormatOptions

	/**
	 * Display a form section showing the options for a given format,
	 * based on the getParameters() value for that format's query printer.
	 *
	 * @param string $format
	 * @param array $paramValues The current values for the parameters (name => value)
	 *
	 * @return string
	 */
	protected function showFormatOptions( $format, array $paramValues ) {
		$printer = SMWQueryProcessor::getResultPrinter( $format, SMWQueryProcessor::SPECIAL_PAGE );

		$params = SMWQueryProcessor::getParameters();

		if ( method_exists( $printer, 'getValidatorParameters' ) ) {
			$params = array_merge( $params, $printer->getValidatorParameters() );
		}

		$optionsHtml = array();

		foreach ( $params as $param ) {
			// Ignore the format parameter, as we got a special control in the GUI for it already.
			if ( $param->getName() == 'format' ) {
				continue;
			}

			$currentValue = array_key_exists( $param->getName(), $paramValues ) ? $paramValues[$param->getName()] : false;

			$optionsHtml[] =
				Html::rawElement(
					'div',
					array(
						'style' => 'width: 30%; padding: 5px; float: left;'
					),
					htmlspecialchars( $param->getName() ) . ': ' .
					$this->showFormatOption( $param, $currentValue ) .
					'<br />' .
					Html::element( 'em', array(), $param->getDescription() )
				);
		}

		for ( $i = 0, $n = count( $optionsHtml ); $i < $n; $i++ ) {
			if ( $i % 3 == 2 || $i == $n - 1 ) {
				$optionsHtml[$i] .= "<div style=\"clear: both\";></div>\n";
			}
		}

		$i = 0;
		$rowHtml = '';
		$resultHtml = '';

		while ( $option = array_shift( $optionsHtml ) ) {
			$rowHtml .= $option;
			$i++;

			$resultHtml .= Html::rawElement(
				'div',
				array(
					'style' => 'background: ' . ( $i % 6 == 0 ? 'white' : '#dddddd' ) . ';'
				),
				$rowHtml
			);

			$rowHtml = '';
		}

		return $resultHtml;
	}
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:68,代码来源:SMW_SpecialAsk.php

示例6: getParameters

	public function getParameters() {		
		global $smwgQMaxInlineLimit;

		$params = array();
		$dfltParams = SMWQueryProcessor::getParameters();
		
		### adjusted basic SMW params: ###
		
		$params['limit'] = $dfltParams['limit'];
		$params['limit']->setDefault( $smwgQMaxInlineLimit );
		
		$params['link'] = $dfltParams['link'];
		$params['link']->setDefault( 'none' );
		
		$params['headers'] = $dfltParams['headers'];
		$params['headers']->setDefault( 'hide' );
		
		### new params: ###
		
		$params['titles'] = new Parameter( 'titles' );
		$params['titles']->setMessage( 'srf_paramdesc_pagetitle' );
		$params['titles']->addCriteria( new CriterionInArray( 'show', 'hide' ) );
		$params['titles']->addAliases( 'pagetitle', 'pagetitles' );
		$params['titles']->setDefault( 'show' );
		
		$params['hidegaps'] = new Parameter( 'hidegaps' );
		$params['hidegaps']->setMessage( 'srf_paramdesc_hidegaps' );
		$params['hidegaps']->addCriteria( new CriterionInArray( 'none', 'all', 'property', 'record' ) );
		$params['hidegaps']->setDefault( 'none' );
		
		# name to create 'real' array with if set (empty string '' counts as set!):
		$params['name'] = new Parameter( 'name' );
		$params['name']->setMessage( 'srf_paramdesc_arrayname' );
		$params['name']->setDefault( false, false );
		
		# separators (default values are defined in the following globals:)
		global $srfgArraySep, $srfgArrayPropSep, $srfgArrayManySep, $srfgArrayRecordSep, $srfgArrayHeaderSep;
		
		$params['sep'] = new Parameter( 'sep' );
		$params['sep']->setMessage( 'smw_paramdesc_sep' );
		$params['sep']->setDefault( $this->initializeCfgValue( $srfgArraySep, 'sep' ) );
		
		$params['propsep'] = new Parameter( 'propsep' );
		$params['propsep']->setMessage( 'srf_paramdesc_propsep' );
		$params['propsep']->setDefault( $this->initializeCfgValue( $srfgArrayPropSep, 'propsep' ) );
		
		$params['manysep'] = new Parameter( 'manysep' );
		$params['manysep']->setMessage( 'srf_paramdesc_manysep' );
		$params['manysep']->setDefault( $this->initializeCfgValue( $srfgArrayManySep, 'manysep' ) );
		
		$params['recordsep'] = new Parameter( 'recordsep' );
		$params['recordsep']->setMessage( 'srf_paramdesc_recordsep' );
		$params['recordsep']->addAliases( 'narysep', 'rcrdsep', 'recsep' );
		$params['recordsep']->setDefault( $this->initializeCfgValue( $srfgArrayRecordSep, 'recordsep' ) );
		
		$params['headersep'] = new Parameter( 'headersep' );
		$params['headersep']->setMessage( 'srf_paramdesc_headersep' );
		$params['headersep']->addAliases( 'narysep', 'rcrdsep', 'recsep' );
		$params['headersep']->setDefault( $this->initializeCfgValue( $srfgArrayHeaderSep, 'headersep' ) );
		
		return $params;
	}
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:62,代码来源:SRF_Array.php


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