Beispiel #1
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);
 }