Example #1
0
 public function declareParameters()
 {
     $track = new String('track');
     $track->setValidateType('int');
     $album = new String('album');
     $album->setValidateType('int');
     $this->source = new XorParameter('source');
     $this->source->addParameter($track);
     $this->source->addParameter($album);
     $this->source->setRequired();
     $this->source->setDefaultParameter($track);
     $this->addParameter($this->source);
     $this->autoplay = new Boolean('autoplay');
     $this->addParameter($this->autoplay);
     $this->lang = new XorParameter('lang');
     $this->lang->addParameter(new Option('en'));
     $this->lang->addParameter(new Option('fr'));
     $this->lang->setDefaultValue('en');
     $this->addParameter($this->lang);
     $float = new XorParameter('float');
     $this->right = new Option('right');
     $float->addParameter($this->right);
     $this->left = new Option('left');
     $float->addParameter($this->left);
     $this->addParameter($float);
 }
Example #2
0
 protected function declareParameters()
 {
     $this->source = new XorParameter('source');
     $email = new String('email');
     $email->setValidateType('email');
     $this->source->addParameter($email);
     $user = new User('user');
     $this->source->addParameter($user);
     $this->source->setDefaultParameter($user);
     global $wgUser;
     $this->source->setDefaultValue($wgUser, false);
     $this->addParameter($this->source);
     $this->size = new IntegerInPixel('size');
     global $wgWFMKMaxWidth;
     $this->size->setMax(min(array($wgWFMKMaxWidth, 2048)));
     $this->size->setDefaultValue(80);
     $this->addParameter($this->size);
     /*
     * Currently, rating is forced to G: "suitable for display on all websites with any audience type"
      $this->rating = new XorParameter('rating');
      $this->rating->addParameter(new Option('g')); // +++ all websites with any audience type
      $this->rating->addParameter(new Option('pg')); // ++
      $this->rating->addParameter(new Option('r')); // +
      $this->rating->addParameter(new Option('x')); // ! hardcore
      $this->addParameter($this->rating);
     */
     $float = new XorParameter('float');
     $this->right = new Option('right');
     $float->addParameter($this->right);
     $this->left = new Option('left');
     $float->addParameter($this->left);
     $this->addParameter($float);
 }
Example #3
0
 /**
  * Declares the widget's parameters:
  * <ul>
  * <li>instanciates Parameter objects,</li>
  * <li>configures them and</li>
  * <li>calls addParameter() for each of them.</li>
  * </ul>
  * 
  * @return void
  */
 protected function declareParameters()
 {
     global $wgWFMKMaxWidth;
     $user = new String('user');
     $user->setEscapeMode('quotes');
     $search = new String('search');
     $search->setEscapeMode('quotes');
     $this->source = new XorParameter('source');
     $this->source->addParameter($user);
     $this->source->addParameter($search);
     $this->source->setRequired();
     // one of theses parameters has to be set
     $this->source->setDefaultParameter($user);
     // user don't need to type "user=xxx", just "xxx" at right position
     $this->addParameter($this->source);
     $this->faves = new Option('faves');
     $this->list = new String('list');
     $this->list->setEscapeMode('quotes');
     $this->follow = new Option('follow');
     $mode = new XorParameter('mode');
     $mode->addParameter($this->faves);
     $mode->addParameter($this->list);
     $mode->addParameter($this->follow);
     $this->addParameter($mode);
     $this->title = new String('title');
     $this->title->setEscapeMode('quotes');
     $this->addParameter($this->title);
     $this->subject = new String('subject');
     $this->subject->setEscapeMode('quotes');
     $this->addParameter($this->subject);
     $this->width = new IntegerInPixel('width');
     $this->width->setDefaultValue($wgWFMKMaxWidth);
     $this->width->setMin(0);
     $this->width->setMax($wgWFMKMaxWidth);
     $this->addParameter($this->width);
     $this->height = new IntegerInPixel('height');
     $this->height->setDefaultValue(441);
     $this->height->setMin(0);
     $this->addParameter($this->height);
     $this->count = new Integer('count');
     $this->count->setDefaultValue(5);
     $this->count->setMin(0);
     $this->count->setMax(30);
     $this->addParameter($this->count);
     $this->scrollbar = new Boolean('scrollbar');
     $this->addParameter($this->scrollbar);
     $this->live = new Boolean('live');
     $this->addParameter($this->live);
     $this->loop = new Boolean('loop');
     $this->addParameter($this->loop);
     $this->all = new Boolean('all');
     $this->addParameter($this->all);
     $float = new XorParameter('float');
     $this->right = new Option('right');
     $float->addParameter($this->right);
     $this->left = new Option('left');
     $float->addParameter($this->left);
     $this->addParameter($float);
 }
Example #4
0
 /**
  * Declares the widget's parameters:
  * <ul>
  * <li>instanciates Parameter objects,</li>
  * <li>configures them and</li>
  * <li>calls addParameter() for each of them.</li>
  * </ul>
  * 
  * @return void
  */
 protected function declareParameters()
 {
     global $wgWFMKMaxWidth;
     $this->id = new String('id');
     $this->id->setEscapeMode('urlpathinfo');
     $this->playlist = new String('playlist');
     $this->playlist->setEscapeMode('urlpathinfo');
     $source = new XorParameter('source');
     $source->addParameter($this->id);
     $source->addParameter($this->playlist);
     $source->setRequired();
     // user need to set one of these parameter
     $source->setDefaultParameter($this->id);
     // user don't need to type "id=xxx", just "xxx" at right position
     $this->addParameter($source);
     $this->width = new IntegerInPixel('width');
     $this->width->setDefaultValue($wgWFMKMaxWidth);
     $this->width->setMin(0);
     $this->width->setMax($wgWFMKMaxWidth);
     $this->addParameter($this->width);
     $this->height = new IntegerInPixel('height');
     $this->height->setDefaultValue(441);
     $this->height->setMin(0);
     $this->addParameter($this->height);
     $float = new XorParameter('float');
     $this->right = new Option('right');
     $float->addParameter($this->right);
     $this->left = new Option('left');
     $float->addParameter($this->left);
     $this->addParameter($float);
 }
Example #5
0
 /**
  * Declares the widget's parameters:
  * <ul>
  * <li>instanciates Parameter objects,</li>
  * <li>configures them and</li>
  * <li>calls addParameter() for each of them.</li>
  * </ul>
  * 
  * @return void
  */
 protected function declareParameters()
 {
     $this->user = new String('user');
     $this->addParameter($this->user);
     $this->tag = new String('tag');
     $this->addParameter($this->tag);
     // hide link to fickr.com on top, and to photostream on bottom
     $this->nolink = new Boolean('nolink');
     $this->addParameter($this->nolink);
     $this->photostream = new OptionString('photostream');
     $this->photostream->setONValue('photostream...');
     $this->addParameter($this->photostream);
     $this->count = new Integer('count');
     $this->count->setDefaultValue(3);
     $this->count->setMin(1);
     $this->count->setMax(10);
     $this->addParameter($this->count);
     $this->random = new Boolean('random');
     // default = false = the most recent
     $this->addParameter($this->random);
     $square = new Option('square');
     $square->setONOutput('s');
     $thumbnail = new Option('thumbnail');
     $thumbnail->setONOutput('t');
     $medium = new Option('medium');
     $medium->setONOutput('m');
     $this->size = new XorParameter('size');
     $this->size->addParameter($square);
     $this->size->addParameter($thumbnail);
     $this->size->addParameter($medium);
     $this->size->setDefaultParameter($square);
     // size's default output is square's default output
     $square->setDefaultValue(true);
     // default value of square is true = square's default output is 's'
     $this->addParameter($this->size);
     $this->width = new IntegerInPixel('width');
     $this->addParameter($this->width);
     $this->height = new IntegerInPixel('height');
     $this->addParameter($this->height);
     $float = new XorParameter('float');
     $this->right = new Option('right');
     $float->addParameter($this->right);
     $this->left = new Option('left');
     $float->addParameter($this->left);
     $this->addParameter($float);
 }
Example #6
0
 /**
  * Declares the widget's parameters:
  * <ul>
  * <li>instanciates Parameter objects,</li>
  * <li>configures them and</li>
  * <li>calls addParameter() for each of them.</li>
  * </ul>
  * 
  * @return void
  */
 protected function declareParameters()
 {
     global $wgWFMKMaxWidth;
     $track = new Integer('track');
     $track->setMin(0);
     $user = new Integer('user');
     $user->setMin(0);
     $playlist = new Integer('playlist');
     $playlist->setMin(0);
     $this->source = new XorParameter('source');
     $this->source->addParameter($track);
     $this->source->addParameter($user);
     $this->source->addParameter($playlist);
     $this->source->setRequired();
     // user need to set one of these parameter
     $this->source->setDefaultParameter($track);
     // user don't need to type "track=xxx", just "xxx" at right position
     $this->addParameter($this->source);
     $this->width = new IntegerInPixel('width');
     $this->width->setDefaultValue($wgWFMKMaxWidth);
     $this->width->setMax($wgWFMKMaxWidth);
     $this->addParameter($this->width);
     $this->height = new IntegerInPixel('height');
     $this->height->setDefaultValue(450);
     // updated later to 166 if source is "track"
     $this->addParameter($this->height);
     $this->autoplay = new Boolean('autoplay');
     $this->addParameter($this->autoplay);
     $this->artwork = new Boolean('artwork');
     $this->addParameter($this->artwork);
     $this->comments = new Boolean('comments');
     $this->addParameter($this->comments);
     $this->playcount = new Boolean('playcount');
     $this->addParameter($this->playcount);
     $this->like = new Boolean('like');
     $this->addParameter($this->like);
     $float = new XorParameter('float');
     $this->right = new Option('right');
     $float->addParameter($this->right);
     $this->left = new Option('left');
     $float->addParameter($this->left);
     $this->addParameter($float);
 }
Example #7
0
 /**
  * Declares the widget's parameters:
  * <ul>
  * <li>instanciates Parameter objects,</li>
  * <li>configures them and</li>
  * <li>calls addParameter() for each of them.</li>
  * </ul>
  * 
  * @return void
  */
 protected function declareParameters()
 {
     global $wgWFMKMaxWidth;
     // the identifier is a numeric value, but very long
     // handling it as an Integer could break when MediaWiki runs on 32bits servers
     // the safer is to handle it as string, and validate only digits
     $user = new String('user');
     $user->setValidateType('digits');
     // a +1 take an url as value, the default is the current page
     $url = new String('url');
     $url->setValidateType('url');
     $url->setEscapeMode('none');
     $this->target = new XorParameter('target');
     $this->target->addParameter($url);
     $this->target->addParameter($user);
     $this->target->setDefaultParameter($url);
     // parse as "target = URL_VALUE" by default
     $this->addParameter($this->target);
     $this->size = new XorParameter('size');
     $small = new Option('small');
     // +1   badge   icon
     $medium = new Option('medium');
     // +1
     $standard = new Option('standard');
     // +1   badge   icon
     $large = new Option('large');
     // +1           icon
     $this->size = new XorParameter('size');
     $this->size->addParameter($small);
     $this->size->addParameter($medium);
     $this->size->addParameter($standard);
     $this->size->addParameter($large);
     $this->size->setDefaultParameter($standard);
     $standard->setDefaultValue(true);
     $this->addParameter($this->size);
     $none = new Option('none');
     $bubble = new Option('bubble');
     $inline = new Option('inline');
     $this->annotation = new XorParameter('annotation');
     // used for +1
     $this->annotation->addParameter($none);
     $this->annotation->addParameter($bubble);
     $this->annotation->addParameter($inline);
     $this->annotation->setDefaultParameter($none);
     // size's default output is none's default output
     $none->setDefaultValue(true);
     // default value of none is true = none's default output is 'none'
     $this->addParameter($this->annotation);
     $this->icon = new Boolean('icon');
     $this->addParameter($this->icon);
     $this->width = new IntegerInPixel('width');
     // used for +1 with annotation=inline
     $this->width->setMax($wgWFMKMaxWidth);
     $this->width->setDefaultValue(300);
     $this->addParameter($this->width);
     $float = new XorParameter('float');
     $this->right = new Option('right');
     $float->addParameter($this->right);
     $this->left = new Option('left');
     $float->addParameter($this->left);
     $this->addParameter($float);
 }