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
 /**
  * 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 #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;
     $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 #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;
     $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 #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()
 {
     $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();
     // user need to set one of theses parameters
     $this->addParameter($this->source);
     $this->size = new XorParameter('size');
     $size_names = array_keys(self::$SIZES);
     foreach ($size_names as $size_name) {
         $this->size->addParameter(new Option($size_name));
     }
     $this->size->setDefaultValue($size_names[0]);
     $this->addParameter($this->size);
     $this->float = new XorParameter('float');
     $this->float->addParameter(new Option('right'));
     $this->float->addParameter(new Option('left'));
     $this->addParameter($this->float);
 }
 /**
  * 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->source = new XorParameter('source');
     $this->user = new String('user');
     $this->source->addParameter($this->user);
     $this->tag = new String('tag');
     $this->source->addParameter($this->tag);
     $this->addParameter($this->source);
     $this->source->setRequired();
     $this->size = new IntegerInPixel('size');
     $this->size->setDefaultValue(80);
     $this->addParameter($this->size);
     $this->width = new Integer('width');
     $this->width->setDefaultValue(9);
     $this->width->setMin(1);
     $this->width->setMax(10);
     $this->addParameter($this->width);
     $this->height = new Integer('height');
     $this->height->setDefaultValue(1);
     $this->height->setMin(1);
     $this->height->setMax(10);
     $this->addParameter($this->height);
     $this->padding = new Integer('padding');
     $this->padding->setDefaultValue(8);
     $this->padding->setMin(0);
     $this->addParameter($this->padding);
     $this->color = new String('color');
     $this->addParameter($this->color);
     $this->slideshow = new Boolean('slideshow');
     $this->addParameter($this->slideshow);
     $this->border = new Boolean('border');
     $this->addParameter($this->border);
     $this->float = new XorParameter('float');
     $right = new Option('right');
     $this->float->addParameter($right);
     $left = new Option('left');
     $this->float->addParameter($left);
     $this->addParameter($this->float);
     $this->category = new XorParameter('category');
     $this->category->addParameter(new Option('Abstract'));
     $this->category->addParameter(new Option('Animals'));
     $this->category->addParameter(new Option('Black and White'));
     $this->category->addParameter(new Option('Celebrities'));
     $this->category->addParameter(new Option('City and Architecture'));
     $this->category->addParameter(new Option('Commercial'));
     $this->category->addParameter(new Option('Concert'));
     $this->category->addParameter(new Option('Family'));
     $this->category->addParameter(new Option('Fashion'));
     $this->category->addParameter(new Option('Film'));
     $this->category->addParameter(new Option('Fine Art'));
     $this->category->addParameter(new Option('Food'));
     $this->category->addParameter(new Option('Journalism'));
     $this->category->addParameter(new Option('Landscapes'));
     $this->category->addParameter(new Option('Macro'));
     $this->category->addParameter(new Option('Nature'));
     $this->category->addParameter(new Option('Nude'));
     $this->category->addParameter(new Option('People'));
     $this->category->addParameter(new Option('Performing Arts'));
     $this->category->addParameter(new Option('Sport'));
     $this->category->addParameter(new Option('Still Life'));
     $this->category->addParameter(new Option('Street'));
     $this->category->addParameter(new Option('Transportation'));
     $this->category->addParameter(new Option('Travel'));
     $this->category->addParameter(new Option('Underwater'));
     $this->category->addParameter(new Option('Urban Exploration'));
     $this->category->addParameter(new Option('Wedding'));
     $this->category->addParameter(new Option('Uncategorized'));
     $this->addParameter($this->category);
 }