コード例 #1
0
ファイル: SRF_ListWidget.php プロジェクト: Tjorriemorrie/app
 /**
  * @see SMWResultPrinter::getParamDefinitions
  *
  * @since 1.8
  *
  * @param $definitions array of IParamDefinition
  *
  * @return array of IParamDefinition|array
  */
 public function getParamDefinitions(array $definitions)
 {
     $params = parent::getParamDefinitions($definitions);
     $params['class'] = array('name' => 'class', 'message' => 'srf-paramdesc-class', 'default' => '');
     $params['listtype'] = array('name' => 'listtype', 'message' => 'srf-paramdesc-listtype', 'values' => array('unordered', 'ordered'), 'default' => 'unordered');
     $params['widget'] = array('name' => 'widget', 'message' => 'srf-paramdesc-widget', 'values' => array('alphabet', 'menu', 'pagination'), 'default' => 'alphabet');
     $params['pageitems'] = array('type' => 'integer', 'name' => 'pageitems', 'message' => 'srf-paramdesc-pageitems', 'default' => 5);
     return $params;
 }
コード例 #2
0
ファイル: SRF_Tree.php プロジェクト: Tjorriemorrie/app
 /**
  * @see SMWResultPrinter::getParamDefinitions
  *
  * @since 1.8
  *
  * @param $definitions array of IParamDefinition
  *
  * @return array of IParamDefinition|array
  */
 public function getParamDefinitions(array $definitions)
 {
     $params = parent::getParamDefinitions($definitions);
     $params['parent'] = array('default' => '', 'message' => 'srf-paramdesc-parent');
     return $params;
 }
コード例 #3
0
ファイル: SRF_SlideShow.php プロジェクト: Tjorriemorrie/app
 /**
  * Handles Ajax call
  * @param integer $pageId
  * @param type $template
  * @param type $printrequests
  * @return type
  */
 public static function handleGetResult($pageId, $template, $printrequests)
 {
     $title = Title::newFromID($pageId)->getPrefixedText();
     $rp = new SMWListResultPrinter('template', true);
     $paramDefinitions = ParamDefinition::getCleanDefinitions($rp->getParamDefinitions(array()));
     $params = array();
     /**
      * @param IParamDefinition $def
      */
     foreach ($paramDefinitions as $def) {
         $params[$def->getName()] = $def->getDefault();
     }
     $params = array_merge($params, array('format' => 'template', 'template' => $template, 'mainlabel' => '', 'sort' => '', 'order' => '', 'intro' => null, 'outro' => null, 'searchlabel' => null, 'link' => null, 'default' => null, 'headers' => null, 'introtemplate' => '', 'outrotemplate' => ''));
     $params = SMWQueryProcessor::getProcessedParams($params, array());
     $p = json_decode($printrequests, true);
     $extraprintouts = array();
     foreach ($p as $key => $prData) {
         // if printout mode is PRINT_PROP
         if ($prData[0] == SMWPrintRequest::PRINT_PROP) {
             // create property from property key
             $data = SMWPropertyValue::makeUserProperty($prData[2]);
         } else {
             $data = null;
         }
         // create printrequest from request mode, label, property name, output format, parameters
         $extraprintouts[] = new SMWPrintRequest($prData[0], $prData[1], $data, $prData[3], $prData[4]);
     }
     return SMWQueryProcessor::getResultFromQueryString('[[' . $title . ']]', $params, $extraprintouts, SMW_OUTPUT_HTML, SMWQueryProcessor::INLINE_QUERY);
 }
コード例 #4
0
 /**
  * @see SMWResultPrinter::getParamDefinitions
  *
  * @since 1.8
  *
  * @param $definitions array of IParamDefinition
  *
  * @return array of IParamDefinition|array
  */
 public function getParamDefinitions(array $definitions)
 {
     $params = parent::getParamDefinitions($definitions);
     $params['parent'] = array('default' => '', 'message' => 'srf-paramdesc-parent');
     $params['root'] = array('default' => '', 'message' => 'srf-paramdesc-root');
     $params['start level'] = array('default' => 1, 'message' => 'srf-paramdesc-startlevel', 'type' => 'integer');
     return $params;
 }
コード例 #5
0
ファイル: SRF_Tree.php プロジェクト: rduecyg/OU
 public function getParameters()
 {
     $params = array_merge(parent::getParameters(), parent::textDisplayParameters());
     $params['parent'] = new Parameter('parent');
     $params['parent']->setMessage('srf-paramdesc-parent');
     $params['parent']->setDefault('');
     return $params;
 }