function getInputHTML($value)
 {
     $datalist = new XmlSelect(false, $this->mName . '-datalist');
     $datalist->setTagName('datalist');
     $datalist->addOptions($this->getOptions());
     return parent::getInputHTML($value) . $datalist->getHTML();
 }
 function getInputHTML($value)
 {
     $valInSelect = false;
     if ($value !== false) {
         $value = strval($value);
         $valInSelect = in_array($value, HTMLFormField::flattenOptions($this->getOptions()), true);
     }
     $selected = $valInSelect ? $value : 'other';
     $select = new XmlSelect($this->mName, $this->mID, $selected);
     $select->addOptions($this->getOptions());
     $select->setAttribute('class', 'mw-htmlform-select-or-other');
     $tbAttribs = array('id' => $this->mID . '-other', 'size' => $this->getSize());
     if (!empty($this->mParams['disabled'])) {
         $select->setAttribute('disabled', 'disabled');
         $tbAttribs['disabled'] = 'disabled';
     }
     if (isset($this->mParams['tabindex'])) {
         $select->setAttribute('tabindex', $this->mParams['tabindex']);
         $tbAttribs['tabindex'] = $this->mParams['tabindex'];
     }
     $select = $select->getHTML();
     if (isset($this->mParams['maxlength'])) {
         $tbAttribs['maxlength'] = $this->mParams['maxlength'];
     }
     if ($this->mClass !== '') {
         $tbAttribs['class'] = $this->mClass;
     }
     $textbox = Html::input($this->mName . '-other', $valInSelect ? '' : $value, 'text', $tbAttribs);
     return "{$select}<br />\n{$textbox}";
 }
 function getInputHTML($value)
 {
     $select = new XmlSelect($this->mName, $this->mID, strval($value));
     if (!empty($this->mParams['disabled'])) {
         $select->setAttribute('disabled', 'disabled');
     }
     if (isset($this->mParams['tabindex'])) {
         $select->setAttribute('tabindex', $this->mParams['tabindex']);
     }
     if ($this->mClass !== '') {
         $select->setAttribute('class', $this->mClass);
     }
     $select->addOptions($this->getOptions());
     return $select->getHTML();
 }
 /**
  * Executes the special page
  *
  * @param $param string the parameter passed in the url
  */
 public function execute($param)
 {
     $out = $this->getOutput();
     $title = Title::newFromText($param);
     if ($title) {
         $pageId = $title->getArticleID();
     } else {
         $out->addWikiMsg('articlefeedbackv5-invalid-page-id');
         return;
     }
     $ratings = $this->fetchOverallRating($pageId);
     $found = isset($ratings['found']) ? $ratings['found'] : null;
     $rating = isset($ratings['rating']) ? $ratings['rating'] : null;
     $out->setPagetitle($this->msg('articlefeedbackv5-special-pagetitle', $title)->escaped());
     if (!$pageId) {
         $out->addWikiMsg('articlefeedbackv5-invalid-page-id');
     } else {
         # TODO: Fix links.
         $out->addHTML(Html::openElement('div', array('id' => 'articleFeedbackv5-header-links')) . Linker::link(Title::newFromText($param), $this->msg('articlefeedbackv5-go-to-article')->escaped()) . ' | ' . Linker::link(Title::newFromText($param), $this->msg('articlefeedbackv5-discussion-page')->escaped()) . ' | ' . Linker::link(Title::newFromText($param), $this->msg('articlefeedbackv5-whats-this')->escaped()) . Html::closeElement('div'));
     }
     $out->addHTML(Html::openElement('div', array('id' => 'articleFeedbackv5-showing-count-wrap')) . $this->msg('articlefeedbackv5-special-showing', Html::element('span', array('id' => 'articleFeedbackv5-feedback-count-total'), '0')) . Html::closeElement('div'));
     if ($found) {
         $out->addHtml(Html::openElement('div', array('id' => 'articleFeedbackv5-percent-found-wrap')) . $this->msg('articlefeedbackv5-percent-found', $found)->escaped() . Html::closeElement('div'));
     }
     #		if ( $rating ) {
     #			$out->addWikiMsg( 'articlefeedbackv5-overall-rating', $rating );
     #		}
     $out->addWikiMsg('articlefeedbackv5-special-title');
     $out->addJsConfigVars('afPageId', $pageId);
     $out->addModules('jquery.articleFeedbackv5.special');
     $sortLabels = array();
     $sortOpts = array('newest', 'oldest');
     foreach ($sortOpts as $sort) {
         $sortLabels[] = Html::element('a', array('href' => '#', 'id' => 'articleFeedbackv5-special-sort-' . $sort, 'class' => 'articleFeedbackv5-sort-link'), $this->msg('articlefeedbackv5-special-sort-' . $sort)->text());
     }
     $opts = array();
     $counts = $this->getFilterCounts($pageId);
     foreach ($this->filters as $filter) {
         $count = isset($counts[$filter]) ? $counts[$filter] : 0;
         $key = $this->msg('articlefeedbackv5-special-filter-' . $filter, $count)->escaped();
         $opts[(string) $key] = $filter;
     }
     $filterSelect = new XmlSelect(false, 'articleFeedbackv5-filter');
     $filterSelect->addOptions($opts);
     $out->addHTML(Html::openElement('div', array('id' => 'articleFeedbackv5-sort-filter-controls')) . $this->msg('articlefeedbackv5-special-sort-label-before')->escaped() . implode($this->msg('pipe-separator')->escaped(), $sortLabels) . $this->msg('articlefeedbackv5-special-sort-label-after')->escaped() . $this->msg('articlefeedbackv5-special-filter-label-before')->escaped() . $filterSelect->getHTML() . $this->msg('articlefeedbackv5-special-filter-label-after')->escaped() . Html::element('a', array('href' => '#', 'id' => 'articleFeedbackv5-special-add-feedback'), $this->msg('articlefeedbackv5-special-add-feedback')->text()) . Html::closeElement('div'));
     $out->addHTML(Html::element('div', array('id' => 'articleFeedbackv5-show-feedback')) . Html::element('a', array('href' => '#', 'id' => 'articleFeedbackv5-show-more'), $this->msg('articlefeedbackv5-special-more')->text()));
 }
Example #5
0
 function getInputHTML($value)
 {
     $select = new XmlSelect($this->mName, $this->mID, strval($value));
     if (!empty($this->mParams['disabled'])) {
         $select->setAttribute('disabled', 'disabled');
     }
     $allowedParams = ['tabindex', 'size'];
     $customParams = $this->getAttributes($allowedParams);
     foreach ($customParams as $name => $value) {
         $select->setAttribute($name, $value);
     }
     if ($this->mClass !== '') {
         $select->setAttribute('class', $this->mClass);
     }
     $select->addOptions($this->getOptions());
     return $select->getHTML();
 }
Example #6
0
	/**
	 * Get a "<select>" element which has options for each of the allowed limits
	 *
	 * @param $attribs String: Extra attributes to set
	 * @return String: HTML fragment
	 */
	public function getLimitSelect( $attribs = array() ) {
		$select = new XmlSelect( 'limit', false, $this->mLimit );
		$select->addOptions( $this->getLimitSelectList() );
		foreach ( $attribs as $name => $value ) {
			$select->setAttribute( $name, $value );
		}
		return $select->getHTML();
	}
Example #7
0
 function getInputHTML($value)
 {
     $valInSelect = false;
     if ($value !== false) {
         $valInSelect = in_array($value, HTMLFormField::flattenOptions($this->mParams['options']));
     }
     $selected = $valInSelect ? $value : 'other';
     $opts = self::forceToStringRecursive($this->mParams['options']);
     $select = new XmlSelect($this->mName, $this->mID, $selected);
     $select->addOptions($opts);
     $select->setAttribute('class', 'mw-htmlform-select-or-other');
     $tbAttribs = array('id' => $this->mID . '-other', 'size' => $this->getSize());
     if (!empty($this->mParams['disabled'])) {
         $select->setAttribute('disabled', 'disabled');
         $tbAttribs['disabled'] = 'disabled';
     }
     $select = $select->getHTML();
     if (isset($this->mParams['maxlength'])) {
         $tbAttribs['maxlength'] = $this->mParams['maxlength'];
     }
     $textbox = Html::input($this->mName . '-other', $valInSelect ? '' : $value, 'text', $tbAttribs);
     return Html::rawElement('span', array('class' => 'input_like'), "{$select}<br />\n{$textbox}");
 }
 function getInputHTML($value)
 {
     $oldClass = $this->mClass;
     $this->mClass = (array) $this->mClass;
     $valInSelect = false;
     $ret = '';
     if ($this->getOptions()) {
         if ($value !== false) {
             $value = strval($value);
             $valInSelect = in_array($value, HTMLFormField::flattenOptions($this->getOptions()), true);
         }
         $selected = $valInSelect ? $value : 'other';
         $select = new XmlSelect($this->mName . '-select', $this->mID . '-select', $selected);
         $select->addOptions($this->getOptions());
         $select->setAttribute('class', 'mw-htmlform-select-or-other');
         if (!empty($this->mParams['disabled'])) {
             $select->setAttribute('disabled', 'disabled');
         }
         if (isset($this->mParams['tabindex'])) {
             $select->setAttribute('tabindex', $this->mParams['tabindex']);
         }
         $ret = $select->getHTML() . "<br />\n";
         $this->mClass[] = 'mw-htmlform-hide-if';
     }
     if ($valInSelect) {
         $value = '';
     } else {
         $key = array_search(strval($value), $this->autocomplete, true);
         if ($key !== false) {
             $value = $key;
         }
     }
     $this->mClass[] = 'mw-htmlform-autocomplete';
     $ret .= parent::getInputHTML($valInSelect ? '' : $value);
     $this->mClass = $oldClass;
     return $ret;
 }
Example #9
0
 /**
  * Returns a <select multiple> element with a list of change tags that can be
  * applied by users.
  *
  * @param array $selectedTags The tags that should be preselected in the
  * list. Any tags in this list, but not in the list returned by
  * ChangeTags::listExplicitlyDefinedTags, will be appended to the <select>
  * element.
  * @param string $label The text of a <label> to precede the <select>
  * @return array HTML <label> element at index 0, HTML <select> element at
  * index 1
  */
 protected function getTagSelect($selectedTags, $label)
 {
     $result = [];
     $result[0] = Xml::label($label, 'mw-edittags-tag-list');
     $select = new XmlSelect('wpTagList[]', 'mw-edittags-tag-list', $selectedTags);
     $select->setAttribute('multiple', 'multiple');
     $select->setAttribute('size', '8');
     $tags = ChangeTags::listExplicitlyDefinedTags();
     $tags = array_unique(array_merge($tags, $selectedTags));
     // Values of $tags are also used as <option> labels
     $select->addOptions(array_combine($tags, $tags));
     $result[1] = $select->getHTML();
     return $result;
 }
Example #10
0
 /**
  * Gets the HTML for a filter control.
  *
  * @since 0.1
  *
  * @param boolean $hideWhenNoResults When true, there are no results, and no filters are applied, an empty string is returned.
  *
  * @return string
  */
 public function getFilterControl($hideWhenNoResults = true)
 {
     $filterOptions = $this->getFilterOptions();
     foreach ($this->conds as $name => $value) {
         if (array_key_exists($name, $filterOptions)) {
             unset($filterOptions[$name]);
         }
     }
     if (count($filterOptions) < 1) {
         return '';
     }
     $this->addFilterValues($filterOptions);
     if ($hideWhenNoResults && $this->getNumRows() < 1) {
         $noFiltersSet = array_reduce($filterOptions, function ($current, array $data) {
             return $current && ($data['value'] === '' || is_null($data['value']));
         }, true);
         if ($noFiltersSet) {
             return '';
         }
     }
     $controls = array();
     foreach ($filterOptions as $optionName => $optionData) {
         switch ($optionData['type']) {
             case 'select':
                 $select = new XmlSelect($optionName, $optionName, $optionData['value']);
                 $select->addOptions($optionData['options']);
                 $control = $select->getHTML();
                 break;
         }
         $control = '&#160;' . $this->getMsg('filter-' . $optionName) . '&#160;' . $control;
         $controls[] = $control;
     }
     $title = $this->getTitle()->getFullText();
     return '<fieldset>' . '<legend>' . wfMsgHtml('ep-pager-showonly') . '</legend>' . '<form method="post" action="' . htmlspecialchars(wfAppendQuery($GLOBALS['wgScript'], array('title' => $title))) . '">' . Html::hidden('title', $title) . implode('', $controls) . '&#160;<input type="submit" class="ep-pager-go" value="' . wfMsgHtml('ep-pager-go') . '">' . '&#160;<button class="ep-pager-clear">' . wfMsgHtml('ep-pager-clear') . '</button>' . '</form>' . '</fieldset>';
 }
Example #11
0
 /**
  * Adds a control to add a term org to the provided context.
  * Additional arguments can be provided to set the default values for the control fields.
  *
  * @since 0.1
  *
  * @param IContextSource $context
  * @param array $args
  *
  * @return boolean
  */
 public static function displayAddNewControl(IContextSource $context, array $args)
 {
     if (!$context->getUser()->isAllowed('ep-course')) {
         return false;
     }
     $out = $context->getOutput();
     $out->addModules('ep.addcourse');
     $out->addHTML(Html::openElement('form', array('method' => 'post', 'action' => self::getTitleFor('NAME_PLACEHOLDER')->getLocalURL(array('action' => 'edit')))));
     $out->addHTML('<fieldset>');
     $out->addHTML('<legend>' . wfMsgHtml('ep-courses-addnew') . '</legend>');
     $out->addElement('p', array(), wfMsg('ep-courses-namedoc'));
     $out->addElement('label', array('for' => 'neworg'), wfMsg('ep-courses-neworg'));
     $select = new XmlSelect('neworg', 'neworg', array_key_exists('org', $args) ? $args['org'] : false);
     $select->addOptions(EPOrg::getOrgOptions());
     $out->addHTML($select->getHTML());
     $out->addHTML('&#160;' . Xml::inputLabel(wfMsg('ep-courses-newname'), 'newname', 'newname', 20, array_key_exists('name', $args) ? $args['name'] : false));
     $out->addHTML('&#160;' . Xml::inputLabel(wfMsg('ep-courses-newterm'), 'newterm', 'newterm', 10, array_key_exists('term', $args) ? $args['term'] : false));
     $out->addHTML('&#160;' . Html::input('addnewcourse', wfMsg('ep-courses-add'), 'submit', array('disabled' => 'disabled', 'class' => 'ep-course-add')));
     $out->addHTML(Html::hidden('isnew', 1));
     $out->addHTML('</fieldset></form>');
     return true;
 }
	protected function showPermissions( $step ) {
		global $wgLang, $wgRequest;
		$header = new HtmlTag( 'h2' );
		$step_message = 'translate-fs-permissions-title';
		$header->content( wfMsg( $step_message ) )->style( 'opacity', 0.4 );

		if ( $step ) {
			$this->out->addHtml( $header );
			return $step;
		}

		if ( $wgRequest->wasPosted() &&
			$this->user->matchEditToken( $wgRequest->getVal( 'token' ) ) &&
			$wgRequest->getText( 'step' ) === 'permissions' )
		{
			// This is ridiculous
			global $wgCaptchaTriggers;
			$captcha = $wgCaptchaTriggers;
			$wgCaptchaTriggers = null;

			$language = $wgRequest->getVal( 'primary-language' );
			$message = $wgRequest->getText( 'message', '...' );
			$params = array(
				'action' => 'threadaction',
				'threadaction' => 'newthread',
				'token' => $this->user->editToken(),
				'talkpage' => 'Project:Translator',
				'subject' => "{{LanguageHeader|$language}}",
				'reason' => 'Using Special:FirstSteps',
				'text' => $message,
			);
			$request = new FauxRequest( $params, true, $_SESSION );
			$api = new ApiMain( $request, true );
			$api->execute();
			$result = $api->getResultData();
			$wgCaptchaTriggers = $captcha;
			$page = $result['threadaction']['thread']['thread-title'];
			$this->user->setOption( 'translate-firststeps-request', $page );
			$this->user->saveSettings();
		}

		$page = $this->user->getOption( 'translate-firststeps-request' );
		if ( $this->user->isAllowed( 'translate' ) ) {
			$header->content( $header->content . wfMsg( 'translate-fs-pagetitle-done' ) );
			$this->out->addHtml( $header );
			return $step;
		} elseif ( $page ) {
			$header->content( $header->content . wfMsg( 'translate-fs-pagetitle-pending' ) );
			$this->out->addHtml( $header->style( 'opacity', false ) );
			$this->out->addWikiMsg( 'translate-fs-permissions-pending', $page );
			return $step_message;
		}

		$this->out->addHtml( $header->style( 'opacity', false ) );
		$this->out->addWikiMsg( 'translate-fs-permissions-help' );

		$output = Html::openElement( 'form', array( 'method' => 'post' ) );
		$output .= Html::hidden( 'step', 'permissions' );
		$output .= Html::hidden( 'token', $this->user->editToken() );
		$output .= Html::hidden( 'title', $this->getTitle() );
		$name = $id = 'primary-language';
		$selector = new XmlSelect();
		$selector->addOptions( $this->languages( $wgLang->getCode() ) );
		$selector->setAttribute( 'id', $id );
		$selector->setAttribute( 'name', $name );
		$selector->setDefault( $wgLang->getCode() );
		$text = wfMessage( 'translate-fs-permissions-planguage' )->text();
		$output .= Xml::label( $text, $id ) . "&#160;" . $selector->getHtml() . '<br />';
		$output .= Html::element( 'textarea', array( 'rows' => 5, 'name' => 'message' ), '' );
		$output .= Xml::submitButton( wfMsg( 'translate-fs-permissions-submit' ) );
		$output .= Html::closeElement( 'form' );

		$this->out->addHtml( $output );
		return $step_message;
	}
 /**
  * Executes the special page
  *
  * @param $param string the parameter passed in the url
  */
 public function execute($param)
 {
     global $wgArticleFeedbackv5DashboardCategory, $wgUser;
     $out = $this->getOutput();
     // set robot policy
     $out->setIndexPolicy('noindex');
     if (!$param) {
         $out->addWikiMsg('articlefeedbackv5-invalid-page-id');
         return;
     }
     if (preg_match('/^(.+)\\/(\\d+)$/', $param, $m)) {
         $param = $m[1];
     }
     $title = Title::newFromText($param);
     // Page does not exist.
     if (!$title->exists()) {
         $out->addWikiMsg('articlefeedbackv5-invalid-page-id');
         return;
     }
     $pageId = $title->getArticleID();
     $dbr = wfGetDB(DB_SLAVE);
     $t = $dbr->select('categorylinks', 'cl_from', array('cl_from' => $pageId, 'cl_to' => $wgArticleFeedbackv5DashboardCategory), __METHOD__, array('LIMIT' => 1));
     // Page exists, but feedback is disabled.
     if ($dbr->numRows($t) == 0) {
         $out->addWikiMsg('articlefeedbackv5-page-disabled');
         return;
     }
     // Success!
     $ratings = $this->fetchOverallRating($pageId);
     $found = isset($ratings['found']) ? $ratings['found'] : null;
     $rating = isset($ratings['rating']) ? $ratings['rating'] : null;
     $out->setPagetitle($this->msg('articlefeedbackv5-special-pagetitle', $title)->escaped());
     if (!$pageId) {
         $out->addWikiMsg('articlefeedbackv5-invalid-page-id');
         return;
     }
     $helpPage = 'Article_Feedback_Tool/Version_5/Help/Feedback_page';
     if ($wgUser->isAllowed('aftv5-delete-feedback')) {
         $helpPage = 'Article_Feedback_Tool/Version_5/Help/Feedback_page_Oversighters';
     } elseif ($wgUser->isAllowed('aftv5-hide-feedback')) {
         $helpPage = 'Article_Feedback_Tool/Version_5/Help/Feedback_page_Hiders';
     } elseif (!$wgUser->isAnon()) {
         $helpPage = 'Article_Feedback_Tool/Version_5/Help/Feedback_page_Editors';
     }
     $helpTitle = Title::newFromText($helpPage, NS_PROJECT);
     $out->addHTML(Html::openElement('div', array('id' => 'articleFeedbackv5-header-wrap')) . Html::openElement('div', array('id' => 'articleFeedbackv5-header-links')) . Linker::link($title, $this->msg('articlefeedbackv5-go-to-article')->escaped()) . ' | ' . Linker::link($title->getTalkPage(), $this->msg('articlefeedbackv5-discussion-page')->escaped()) . ' | ' . Linker::link($helpTitle, $this->msg('articlefeedbackv5-whats-this')->escaped()) . Html::closeElement('div') . Html::openElement('div', array('id' => 'articleFeedbackv5-showing-count-wrap')) . $this->msg('articlefeedbackv5-special-showing', Html::element('span', array('id' => 'articleFeedbackv5-feedback-count-total'), '0')) . Html::closeElement('div'));
     if ($found) {
         $class = $found > 50 ? 'positive' : 'negative';
         $span = Html::rawElement('span', array('class' => "stat-marker {$class}"), wfMsg('percent', $found));
         $out->addHtml(Html::openElement('div', array('id' => 'articleFeedbackv5-percent-found-wrap')) . $this->msg('articlefeedbackv5-percent-found')->rawParams($span)->escaped() . Html::closeElement('div'));
     }
     // BETA notice
     $out->addHTML(Html::element('span', array('class' => 'articlefeedbackv5-beta-notice'), $this->msg('articlefeedbackv5-beta-notice')->text()) . Html::element('div', array('class' => 'float-clear')));
     $out->addHtml(Html::element('a', array('href' => '#', 'id' => 'articleFeedbackv5-special-add-feedback'), $this->msg('articlefeedbackv5-special-add-feedback')->text()) . Html::element('div', array('class' => 'float-clear')) . Html::closeElement('div'));
     #		if ( $rating ) {
     #			$out->addWikiMsg( 'articlefeedbackv5-overall-rating', $rating );
     #		}
     $out->addJsConfigVars('afPageId', $pageId);
     // Only show the abuse counts to editors (ie, anyone allowed to
     // hide content).
     if ($wgUser->isAllowed('aftv5-see-hidden-feedback')) {
         $out->addJsConfigVars('afCanEdit', 1);
     }
     $out->addModules('ext.articleFeedbackv5.dashboard');
     $sortLabels = array();
     foreach ($this->sorts as $sort) {
         $sortLabels[] = Html::element('img', array('id' => 'articleFeedbackv5-sort-arrow-' . $sort, 'class' => 'articleFeedbackv5-sort-arrow'), '') . Html::element('a', array('href' => '#', 'id' => 'articleFeedbackv5-special-sort-' . $sort, 'class' => 'articleFeedbackv5-sort-link'), $this->msg('articlefeedbackv5-special-sort-' . $sort)->text());
     }
     $opts = array();
     $counts = $this->getFilterCounts($pageId);
     foreach ($this->filters as $filter) {
         $count = array_key_exists($filter, $counts) ? $counts[$filter] : 0;
         $key = $this->msg('articlefeedbackv5-special-filter-' . $filter, $count)->escaped();
         if (in_array($filter, array('comment', 'helpful', 'visible'))) {
             $opts[(string) $key] = $filter;
         } else {
             $opts['---------'][(string) $key] = $filter;
         }
     }
     $filterSelect = new XmlSelect(false, 'articleFeedbackv5-filter-select');
     $filterSelect->addOptions($opts);
     $out->addHTML(Html::openElement('div', array('id' => 'articleFeedbackv5-sort-filter-controls')) . Html::openElement('div', array('id' => 'articleFeedbackv5-sort')) . Html::openElement('span', array('class' => 'articleFeedbackv5-sort-label')) . $this->msg('articlefeedbackv5-special-sort-label-before')->escaped() . Html::closeElement('span') . implode($this->msg('pipe-separator')->escaped(), $sortLabels) . $this->msg('articlefeedbackv5-special-sort-label-after')->escaped() . Html::closeElement('div') . Html::openElement('div', array('id' => 'articleFeedbackv5-filter')) . Html::openElement('span', array('class' => 'articleFeedbackv5-filter-label')) . $this->msg('articlefeedbackv5-special-filter-label-before')->escaped() . Html::closeElement('span') . $filterSelect->getHTML() . $this->msg('articlefeedbackv5-special-filter-label-after')->escaped() . Html::closeElement('div') . Html::closeElement('div'));
     $out->addHTML(Html::element('div', array('id' => 'articleFeedbackv5-show-feedback')) . Html::element('a', array('href' => '#', 'id' => 'articleFeedbackv5-show-more'), $this->msg('articlefeedbackv5-special-more')->text()));
 }
</a>
	<?php 
}
?>

<?php 
if ($accessControls) {
    ?>

<form action="<?php 
    echo $submitUrl;
    ?>
" method="get" id="ImageReviewControls">
	Sort order: <?php 
    $sortSelect = new XmlSelect('sort', 'sort', intval($order));
    $sortSelect->addOptions(ImageReviewHelper::$sortOptions);
    echo $sortSelect->getHTML();
    ?>

	<input type="submit" class="wikia-button secondary" value="Change sort order" />
</form>

<a href="<?php 
    echo $fullUrl;
    ?>
/stats" class="wikia-button secondary">View stats</a>

<?php 
}
?>
Example #15
0
 /**
  * Get a "<select>" element which has options for each of the allowed limits
  *
  * @return String: HTML fragment
  */
 public function getLimitSelect()
 {
     $select = new XmlSelect('limit', false, $this->mLimit);
     $select->addOptions($this->getLimitSelectList());
     return $select->getHTML();
 }
Example #16
0
 /**
  * Create a date selector
  *
  * @param string $selected The month which should be selected, default ''.
  * @param string $allmonths Value of a special item denoting all month.
  *   Null to not include (default).
  * @param string $id Element identifier
  * @return string Html string containing the month selector
  */
 public static function monthSelector($selected = '', $allmonths = null, $id = 'month')
 {
     global $wgLang;
     $options = [];
     $data = new XmlSelect('month', $id, $selected);
     if (is_null($selected)) {
         $selected = '';
     }
     if (!is_null($allmonths)) {
         $options[wfMessage('monthsall')->text()] = $allmonths;
     }
     for ($i = 1; $i < 13; $i++) {
         $options[$wgLang->getMonthName($i)] = $i;
     }
     $data->addOptions($options);
     $data->setAttribute('class', 'mw-month-selector');
     return $data->getHTML();
 }
Example #17
0
 /**
  * Adds a control to add a term org to the provided context.
  * Additional arguments can be provided to set the default values for the control fields.
  *
  * @since 0.1
  *
  * @param IContextSource $context
  * @param array $args
  *
  * @return boolean
  */
 public static function displayAddNewControl(IContextSource $context, array $args)
 {
     if (!$context->getUser()->isAllowed('ep-term')) {
         return false;
     }
     $out = $context->getOutput();
     $out->addHTML(Html::openElement('form', array('method' => 'post', 'action' => SpecialPage::getTitleFor('EditTerm')->getLocalURL())));
     $out->addHTML('<fieldset>');
     $out->addHTML('<legend>' . wfMsgHtml('ep-terms-addnew') . '</legend>');
     $out->addHTML(Html::element('p', array(), wfMsg('ep-terms-namedoc')));
     $out->addHTML(Html::element('label', array('for' => 'newcourse'), wfMsg('ep-terms-newcourse')));
     $select = new XmlSelect('newcourse', 'newcourse', array_key_exists('course', $args) ? $args['course'] : false);
     $select->addOptions(EPCourse::getCourseOptions());
     $out->addHTML($select->getHTML());
     $out->addHTML('&#160;' . Xml::inputLabel(wfMsg('ep-terms-newyear'), 'newyear', 'newyear', 10));
     $out->addHTML('&#160;' . Html::input('addnewterm', wfMsg('ep-terms-add'), 'submit'));
     $out->addHTML(Html::hidden('isnew', 1));
     $out->addHTML('</fieldset></form>');
     return true;
 }
Example #18
0
echo htmlspecialchars(wfMsg('themedesigner-interface-skinlabel'));
$validSkinNames = Skin::getUsableSkins();
foreach ($validSkinNames as $skinkey => &$skinname) {
    $msgName = "skinname-{$skinkey}";
    $localisedSkinName = wfMsg($msgName);
    if (!wfEmptyMsg($msgName, $localisedSkinName)) {
        $skinname = htmlspecialchars($localisedSkinName);
    }
}
asort($validSkinNames);
/*		if ( empty($par) || !isset($validSkinNames[strtolower($par)]) ) {
			$par = $GLOBALS["wgUser"]->getSkin()->skinname;
		}
		$skinSelect = new XmlSelect( 'skin', false, strtolower($par) );*/
$skinSelect = new XmlSelect('skin', false, $GLOBALS["wgUser"]->getSkin()->skinname);
$skinSelect->addOptions(array_combine(array_values($validSkinNames), array_keys($validSkinNames)));
echo $skinSelect->getHTML();
?>
	</div>
	<h2>Basic</h2>
	<section>
		...
	</section>
	<h2>Advanced</h2>
	<section>
		<textarea rows=15 id=advanced-css></textarea>
	</section>
</div>
<div id=designer-viewer>
	<noscript><?php 
echo wfMsgWikiHtml('themedesigner-noscript');