本文整理汇总了PHP中XmlSelect类的典型用法代码示例。如果您正苦于以下问题:PHP XmlSelect类的具体用法?PHP XmlSelect怎么用?PHP XmlSelect使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了XmlSelect类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: showToolbar
protected function showToolbar() {
$langSelector = Xml::languageSelector( $this->lang );
$fontSelector = new XmlSelect();
$fontSelector->setAttribute( 'id', 'webfonts-font-chooser' );
$sizeSelector = new XmlSelect();
$sizeSelector->setAttribute( 'id', 'webfonts-size-chooser' );
for ( $size = 8; $size <= 28; $size += 2 ) {
$sizeSelector->addOption( $size , $size );
}
$sizeSelector->setDefault( 16 );
$bold = Html::Element( 'button', array( 'id' => 'webfonts-preview-bold' ) , 'B' );
$italic = Html::Element( 'button', array( 'id' => 'webfonts-preview-italic' ) , 'I' );
$underline = Html::Element( 'button', array( 'id' => 'webfonts-preview-underline' ) , 'U' );
$download = Html::Element( 'a', array( 'id' => 'webfonts-preview-download', 'href' => '#' ) ,
wfMsg( 'webfonts-preview-download' ) );
return Html::openElement( 'div', array( 'id' => 'webfonts-preview-toolbar' ) )
. $langSelector[1]
. $fontSelector->getHtml()
. $sizeSelector->getHtml()
. $bold
. $italic
. $underline
. $download
. Html::closeElement( 'div' );
}
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:32,代码来源:SpecialWebFonts.php
示例2: getInputHTML
function getInputHTML($value)
{
$datalist = new XmlSelect(false, $this->mName . '-datalist');
$datalist->setTagName('datalist');
$datalist->addOptions($this->getOptions());
return parent::getInputHTML($value) . $datalist->getHTML();
}
开发者ID:claudinec,项目名称:galan-wiki,代码行数:7,代码来源:HTMLComboboxField.php
示例3: displayNavigation
private function displayNavigation()
{
global $wgOut;
$groupSelector = new XmlSelect('group', 'group-select');
// pull groups
$groups = MessageGroups::singleton()->getGroups();
foreach ($groups as $group) {
if (!$group->isMeta()) {
continue;
}
$groupSelector->addOption($group->getLabel(), $group->getId());
}
$fields = array();
$fields['transstats-choose-group'] = $groupSelector->getHTML();
$fields['transstats-group-mode-all'] = Xml::radio('mode', 0, empty($this->mMode));
$fields['transstats-group-mode-supress0'] = Xml::radio('mode', 1, $this->mMode == 1);
$fields['transstats-group-mode-supress100'] = Xml::radio('mode', 2, $this->mMode == 2);
$fields['transstats-group-mode-only100'] = Xml::radio('mode', 3, $this->mMode == 3);
$fields['transstats-group-langlist'] = Xml::input('langlist', false, $this->mLanglistPlain);
$out = Xml::openElement('form');
$out .= Xml::buildForm($fields);
$out .= Html::hidden('title', 'Special:' . $this->getName());
// FIXME: this is silly...
$out .= Xml::submitButton(wfMsg('transstats-submit'));
$out .= Xml::closeElement('form');
$wgOut->addHTML($out);
}
开发者ID:Tjorriemorrie,项目名称:app,代码行数:27,代码来源:SpecialGroupStats.body.php
示例4: execute
function execute($params)
{
global $wgOut, $wgUser, $wgRequest;
$wgOut->setPageTitle('WikiFactory Reporter');
$wgOut->setRobotpolicy('noindex,nofollow');
$wgOut->setArticleRelated(false);
if (!$wgUser->isAllowed('wikifactory')) {
$this->displayRestrictionError();
return;
}
$this->varid = $wgRequest->getInt('varid');
$this->disable_limit = $wgRequest->getBool('nolimit');
/***********************************************/
$vars = WikiFactory::getVariables("cv_name", 0, 0);
$select = new XmlSelect('varid', false, $this->varid);
if (!empty($this->varid)) {
//the cast is because the Xml select uses === to detect the default
$select->setDefault((string) $this->varid);
//change the name, using the var name
$variable = WikiFactory::getVarById($this->varid, 0);
$wgOut->setPageTitle('WikiFactory Reporter: ' . $variable->cv_name);
}
foreach ($vars as $variable) {
$select->addOption("{$variable->cv_name} ({$variable->cv_id})", $variable->cv_id);
}
$action = self::getTitle()->getLocalURL();
$wgOut->addHTML("<form action='{$action}' method='get'>\n");
$wgOut->addHTML($select->getHTML());
$wgOut->addHTML("<input type='submit'>\n");
$wgOut->addHTML("</form>\n");
/***********************************************/
if (!empty($this->varid)) {
$wgOut->addHTML($this->getCustomSettings());
}
}
开发者ID:Tjorriemorrie,项目名称:app,代码行数:35,代码来源:SpecialWikiFactoryReporter_body.php
示例5: getInputHTML
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}";
}
开发者ID:MediaWiki-stable,项目名称:1.26.1,代码行数:30,代码来源:HTMLSelectOrOtherField.php
示例6: moduleSelector
/**
* Helper function get module selector.
*
* @param $selectedId \string Which value should be selected by default
* @return \string HTML5-compatible select-element.
*/
protected function moduleSelector($selectedId)
{
$selector = new XmlSelect('module', 'module', $selectedId);
foreach ($this->aModules as $code) {
$selector->addOption(wfMsg('translate-magic-' . $code), $code);
}
return $selector->getHTML();
}
开发者ID:schwarer2006,项目名称:wikia,代码行数:14,代码来源:SpecialMagic.php
示例7: typeSelector
public static function typeSelector($name = 'type', $value = '', $id = false)
{
$s = new XmlSelect($name, $id, $value);
$s->addOption(wfMsg('userrestrictiontype-none'), '');
$s->addOption(wfMsg('userrestrictiontype-page'), UserRestriction::PAGE);
$s->addOption(wfMsg('userrestrictiontype-namespace'), UserRestriction::NAMESPACE);
return $s->getHTML();
}
开发者ID:ruizrube,项目名称:spdef,代码行数:8,代码来源:SpecialListUserRestrictions.php
示例8: buildSelect
protected function buildSelect($list, $name, $default = '')
{
sort($list);
$select = new XmlSelect($name);
$select->setDefault($default);
foreach ($list as $wiki) {
$select->addOption($wiki);
}
return $select->getHTML();
}
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:10,代码来源:CloseWikis.page.php
示例9: moduleSelector
/**
* Helper function get module selector.
*
* @param string $selectedId Which value should be selected by default
* @return string HTML5-compatible select-element.
*/
protected function moduleSelector($selectedId)
{
// Give grep a chance to find the usages:
// translate-magic-words, translate-magic-special, translate-magic-namespace
$selector = new XmlSelect('module', 'module', $selectedId);
foreach ($this->aModules as $code) {
$selector->addOption($this->msg('translate-magic-' . $code)->text(), $code);
}
return $selector->getHTML();
}
开发者ID:HuijiWiki,项目名称:mediawiki-extensions-Translate,代码行数:16,代码来源:SpecialMagic.php
示例10: switchForm
/**
* Output a form to allow searching for a user
*/
function switchForm()
{
global $wgScript;
$knownwiki = $this->getRequest()->getVal('wpKnownWiki');
$knownwiki = $knownwiki ? $knownwiki : wfWikiId();
// Generate wiki selector
$selector = new XmlSelect('wpKnownWiki', 'wpKnownWiki', $knownwiki);
foreach (CentralAuthUser::getWikiList() as $wiki) {
$selector->addOption($wiki);
}
$this->getOutput()->addModuleStyles('mediawiki.special');
$this->getOutput()->addHTML(Xml::openElement('form', array('method' => 'get', 'action' => $wgScript, 'name' => 'uluser', 'id' => 'mw-userrights-form1')) . Html::hidden('title', $this->getTitle()) . Xml::openElement('fieldset') . Xml::element('legend', array(), wfMsg('userrights-lookup-user')) . Xml::inputLabel(wfMsg('userrights-user-editname'), 'user', 'username', 30, $this->mTarget) . ' <br />' . Xml::label(wfMsg('centralauth-globalgrouppermissions-knownwiki'), 'wpKnownWiki') . ' ' . $selector->getHTML() . '<br />' . Xml::submitButton(wfMsg('editusergroup')) . Xml::closeElement('fieldset') . Xml::closeElement('form') . "\n");
}
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:16,代码来源:SpecialGlobalGroupMembership.php
示例11: constructCreateForm
function constructCreateForm()
{
global $wgOut, $wgScript;
global $wgUserProperties, $wgActivityModes;
$wgOut->addHTML(Xml::openElement('form', array('action' => $this->getTitle()->getLocalURL(), 'method' => 'post')));
$wgOut->addHTML(Xml::element('h2', null, wfMsg('nss-create-account-header')) . "\n");
$wgOut->addHTML("<table border=\"1\" id=\"newuser\">\n");
$props = array_merge(array('username', 'email'), $wgUserProperties);
foreach ($props as $i) {
$msg = 'am-' . $i;
$wgOut->addHTML("\t<tr><th>" . (wfEmptyMsg($msg, wfMsg($msg)) ? $i : wfMsgHtml($msg)) . "</th><td>" . Xml::input("am-" . str_replace(' ', '_', $i), 40) . "</td></tr>\n");
}
global $wgActivityModes;
$select = new XmlSelect("am-active");
$select->setDefault('active');
$select->setAttribute('width', '100%');
foreach ($wgActivityModes as $key) {
$select->addOption($key);
}
$wgOut->addHTML("\t<tr><th>" . wfMsgHtml('am-active') . "</th><td>" . $select->getHTML() . "</td></tr>\n");
$wgOut->addHTML("</table>\n");
$wgOut->addHTML("<div id=\"newaccount-submit\">\n" . Html::Hidden('action', 'create') . Xml::checkLabel(wfMsg('nss-no-mail'), 'nss-no-mail', 'nss-no-mail') . "<br />\n" . Xml::element('input', array('type' => 'submit', 'value' => wfMsg('nss-create-account'))) . "</div>\n</form>\n");
$wgOut->addHTML(Xml::openElement('form', array('action' => $this->getTitle()->getLocalURL(), 'method' => 'post')));
$wgOut->addHTML("<div id=\"newaccount-raw\">\n" . Xml::textarea('nss-create-account-raw', '') . "\n" . Html::Hidden('action', 'create-raw') . Xml::checkLabel(wfMsg('nss-no-mail'), 'nss-no-mail', 'nss-no-mail') . "<br />\n" . Xml::element('input', array('type' => 'submit', 'value' => wfMsg('nss-create-account'))) . "</div>\n</form>\n");
}
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:25,代码来源:SpecialAccountManager.php
示例12: execute
/**
* 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()));
}
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:52,代码来源:SpecialArticleFeedbackv5.php
示例13: languageSelector
/**
* JavsScript selector for language codes.
* @return JsSelectToInput
*/
protected static function languageSelector()
{
if (is_callable(array('LanguageNames', 'getNames'))) {
$lang = RequestContext::getMain()->getLanguage();
$languages = LanguageNames::getNames($lang->getCode(), LanguageNames::FALLBACK_NORMAL);
} else {
$languages = Language::fetchLanguageNames();
}
ksort($languages);
$selector = new XmlSelect('mw-language-selector', 'mw-language-selector');
foreach ($languages as $code => $name) {
$selector->addOption("{$code} - {$name}", $code);
}
$jsSelect = new JsSelectToInput($selector);
$jsSelect->setSourceId('mw-language-selector');
return $jsSelect;
}
开发者ID:HuijiWiki,项目名称:mediawiki-extensions-Translate,代码行数:21,代码来源:UserToggles.php
示例14: onRcForm
static function onRcForm( &$items, $opts ) {
global $wmincProjects, $wmincProjectSite, $wmincLangCodeLength;
list( $projectvalue, $codevalue ) = self::getValues();
$opts->consumeValue( 'rc-testwiki-project' );
$opts->consumeValue( 'rc-testwiki-code' );
$label = Xml::label( wfMsg( 'wminc-testwiki' ), 'rc-testwiki' );
$select = new XmlSelect( 'rc-testwiki-project', 'rc-testwiki-project', $projectvalue );
$select->addOption( wfMsg( 'wminc-testwiki-none' ), 'none' );
foreach( $wmincProjects as $prefix => $name ) {
$select->addOption( $name, $prefix );
}
$select->addOption( $wmincProjectSite['name'], $wmincProjectSite['short'] );
$langcode = Xml::input( 'rc-testwiki-code', (int)$wmincLangCodeLength, $codevalue,
array( 'id' => 'rc-testwiki-code', 'maxlength' => (int)$wmincLangCodeLength ) );
$items['testwiki'] = array( $label, $select->getHTML() . ' ' . $langcode );
return true;
}
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:18,代码来源:TestWikiRC.php
示例15: displayNavigation
private function displayNavigation()
{
global $wgOut;
$groupSelector = new XmlSelect('group', 'group-select');
// pull groups
$groups = MessageGroups::singleton()->getGroups();
foreach ($groups as $group) {
if (!$group->isMeta()) {
continue;
}
$groupSelector->addOption($group->getLabel(), $group->getId());
}
$fields = array();
$fields['transstats-choose-group'] = $groupSelector->getHTML();
$fields['transstats-breakdown'] = Xml::check('breakdown', false);
$out = Xml::openElement('form');
$out .= Xml::buildForm($fields);
$out .= Xml::submitButton(wfMsg('transstats-submit'));
$out .= Xml::closeElement('form');
$wgOut->addHTML($out);
}
开发者ID:Tjorriemorrie,项目名称:app,代码行数:21,代码来源:SpecialTranslationCount.body.php
示例16: namespaceMessageForm
/**
* Message input fieldset
*
* @param $title Title (default: null)
* @return \string HTML for fieldset.
*/
function namespaceMessageForm(Title $title = null)
{
global $wgScript;
$namespaces = new XmlSelect('namespace', 'namespace');
$namespaces->setDefault($title->getNamespace());
foreach ($this->getSortedNamespaces() as $text => $index) {
$namespaces->addOption($text, $index);
}
$out = Xml::openElement('div', array('class' => 'namespaceoptions'));
$out .= Xml::openElement('form', array('method' => 'get', 'action' => $wgScript));
$out .= Html::hidden('title', $this->getTitle()->getPrefixedText());
$out .= Xml::openElement('fieldset');
$out .= Xml::element('legend', null, wfMsg('translate-translations-fieldset-title'));
$out .= Xml::openElement('table', array('id' => 'nsselect', 'class' => 'allpages'));
$out .= "<tr>\n\t\t\t\t<td class='mw-label'>" . Xml::label(wfMsg('translate-translations-messagename'), 'message') . "</td>\n\t\t\t\t<td class='mw-input'>" . Xml::input('message', 30, $title->getText(), array('id' => 'message')) . "</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td class='mw-label'>" . Xml::label(wfMsg('translate-translations-project'), 'namespace') . "</td>\n\t\t\t\t<td class='mw-input'>" . $namespaces->getHTML() . ' ' . Xml::submitButton(wfMsg('allpagessubmit')) . "</td>\n\t\t\t\t</tr>";
$out .= Xml::closeElement('table');
$out .= Xml::closeElement('fieldset');
$out .= Xml::closeElement('form');
$out .= Xml::closeElement('div');
return $out;
}
开发者ID:schwarer2006,项目名称:wikia,代码行数:27,代码来源:SpecialTranslations.php
示例17: testGetAttributes
/**
* @covers XmlSelect::setAttribute
* @covers XmlSelect::getAttribute
*/
public function testGetAttributes()
{
# create some attributes
$this->select->setAttribute('dummy', 0x777);
$this->select->setAttribute('string', 'euro €');
$this->select->setAttribute(1911, 'razor');
# verify we can retrieve them
$this->assertEquals($this->select->getAttribute('dummy'), 0x777);
$this->assertEquals($this->select->getAttribute('string'), 'euro €');
$this->assertEquals($this->select->getAttribute(1911), 'razor');
# inexistant keys should give us 'null'
$this->assertEquals($this->select->getAttribute('I DO NOT EXIT'), null);
# verify string / integer
$this->assertEquals($this->select->getAttribute('1911'), 'razor');
$this->assertEquals($this->select->getAttribute('dummy'), 0x777);
}
开发者ID:biribogos,项目名称:wikihow-src,代码行数:20,代码来源:XmlSelectTest.php
示例18: getInputHTML
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();
}
开发者ID:biribogos,项目名称:wikihow-src,代码行数:15,代码来源:HTMLSelectField.php
示例19: translationFilterForm
/**
* Hooks SpecialRecentChangesPanel. See the hook documentation for
* documentation of the function parameters.
*
* Adds a HTMl selector into $items
* @param $items
* @param $opts
* @return bool true
*/
public static function translationFilterForm( &$items, $opts ) {
$opts->consumeValue( 'translations' );
$default = $opts->getValue( 'translations' );
$label = Xml::label( wfMsg( 'translate-rc-translation-filter' ), 'mw-translation-filter' );
$select = new XmlSelect( 'translations', 'mw-translation-filter', $default );
$select->addOption( wfMsg( 'translate-rc-translation-filter-no' ), 'noaction' );
$select->addOption( wfMsg( 'translate-rc-translation-filter-only' ), 'only' );
$select->addOption( wfMsg( 'translate-rc-translation-filter-filter' ), 'filter' );
$select->addOption( wfMsg( 'translate-rc-translation-filter-site' ), 'site' );
$items['translations'] = array( $label, $select->getHTML() );
return true;
}
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:24,代码来源:RcFilter.php
示例20: getInputHTML
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();
}
开发者ID:claudinec,项目名称:galan-wiki,代码行数:17,代码来源:HTMLSelectField.php
注:本文中的XmlSelect类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论