protected function declareParameters() { global $wgWFMKMaxWidth; $this->title = new Title('title'); $this->title->setRequired(); $this->addParameter($this->title); $this->caption = new Wikitext('caption'); $this->caption->setParser($this->getParser()); $this->caption->setRequired(); $this->addParameter($this->caption); $this->color = new XorParameter('color'); $red = new Option('red'); $this->color->addParameter($red); $grey = new Option('grey'); $this->color->addParameter($grey); $this->color->setDefaultValue('red'); $this->addParameter($this->color); $this->width = new IntegerInPixel('width'); $this->width->setMax($wgWFMKMaxWidth); $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); }
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); }
/** * 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->profile = new String('profile'); $this->profile->setRequired(); $this->addParameter($this->profile); $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(556); $this->height->setMin(0); $this->addParameter($this->height); $this->faces = new Boolean('faces'); $this->faces->setDefaultValue(true); $this->addParameter($this->faces); $this->stream = new Boolean('stream'); $this->stream->setDefaultValue(true); $this->addParameter($this->stream); $this->force_wall = new Boolean('force_wall'); $this->addParameter($this->force_wall); $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); }
/** * 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); }
/** * 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->addParameter($this->id); $this->oldkey = new String('oldkey'); $this->oldkey->setEscapeMode('urlpathinfo'); $this->addParameter($this->oldkey); $this->width = new IntegerInPixel('width'); $this->width->setDefaultValue($wgWFMKMaxWidth - 2); // -2 because of frameborder $this->width->setMax($wgWFMKMaxWidth - 2); // -2 because of frameborder $this->addParameter($this->width); $this->height = new IntegerInPixel('height'); $this->height->setDefaultValue($wgWFMKMaxWidth); $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); }
/** * 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); }
/** * 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); }
/** * 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->url = new String('url'); $this->url->setValidateType('url'); $this->url->setRequired(); $this->addParameter($this->url); $this->width = new IntegerInPixel('width'); $this->width->setDefaultValue($wgWFMKMaxWidth); $this->width->setMax($wgWFMKMaxWidth); $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); }
/** * 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->id->setRequired(); $this->addParameter($this->id); $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(441); $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); }
/** * 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() { // Set $wgDisqusShortName in LocalSettings as you discus account name global $wgDisqusShortName, $wgWFMKMaxWidth; $this->shortname = new String('shortname'); $this->shortname->setEscapeMode('javascript'); $this->shortname->setDefaultValue($wgDisqusShortName); $this->addParameter($this->shortname); $this->id = new String('id'); $this->id->setEscapeMode('javascript'); $this->addParameter($this->id); $this->url = new String('url'); $this->url->setEscapeMode('javascript'); $this->url->setDefaultValue($this->parser->getTitle()->getCanonicalURL()); $this->addParameter($this->url); $this->title = new String('title'); $this->title->setEscapeMode('javascript'); $this->title->setDefaultValue($this->parser->getTitle()->getFullText()); $this->addParameter($this->title); $this->width = new IntegerInPixel('width'); $this->width->setMax($wgWFMKMaxWidth); $this->width->setMin(0); $this->addParameter($this->width); $this->height = new IntegerInPixel('height'); $this->height->setMin(0); $this->addParameter($this->height); $this->frame = new Option('frame'); $this->addParameter($this->frame); $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); $this->dev = new Option('dev'); $this->addParameter($this->dev); }
/** * 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); }