当前位置: 首页>>代码示例>>PHP>>正文


PHP Xml::listDropDown方法代码示例

本文整理汇总了PHP中Xml::listDropDown方法的典型用法代码示例。如果您正苦于以下问题:PHP Xml::listDropDown方法的具体用法?PHP Xml::listDropDown怎么用?PHP Xml::listDropDown使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Xml的用法示例。


在下文中一共展示了Xml::listDropDown方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: formatRow

 /**
  * Generate the content of each table row (1 row = 1 ad)
  */
 function formatRow($row)
 {
     // Begin ad row
     $htmlOut = Xml::openElement('tr');
     if ($this->editable) {
         // Add box
         $htmlOut .= Xml::tags('td', array('valign' => 'top'), Xml::check('addAds[]', '', array('value' => $row->ad_name)));
         // Weight select
         $htmlOut .= Xml::tags('td', array('valign' => 'top', 'class' => 'pr-weight'), Xml::listDropDown("weight[{$row->ad_id}]", Promoter::dropDownList($this->msg('promoter-weight')->text(), range(0, 100, 5)), '', '25', '', ''));
     }
     // Link and Preview
     $ad = Ad::fromName($row->ad_name);
     $htmlOut .= Xml::tags('td', array('valign' => 'top'), $ad->linkToPreview());
     // End ad row
     $htmlOut .= Xml::closeElement('tr');
     return $htmlOut;
 }
开发者ID:kolzchut,项目名称:mediawiki-extensions-Promoter,代码行数:20,代码来源:PromoterPager.php

示例2: buildForm

 /**
  * Generate a "deletion nomination" form.
  * @param $article Article object to nominate.
  */
 public function buildForm($article, $queue)
 {
     global $wgOut, $wgScript, $wgUser, $wgRequest;
     // Check for submission
     if ($this->trySubmit($article, $queue)) {
         return;
     }
     $wgOut->setPageTitle(wfMsg("deletequeue-{$queue}-title", $article->mTitle->getPrefixedText()));
     $wgOut->addWikiMsg("deletequeue-{$queue}-text", $article->mTitle->getPrefixedText());
     // Build deletion form.
     $fields = array();
     $fields['deletequeue-delnom-reason'] = Xml::listDropDown('wpReason', DeleteQueueInterface::getReasonList($queue), wfMsg("deletequeue-delnom-otherreason"));
     $fields['deletequeue-delnom-extra'] = Xml::input('wpExtra', 45);
     $article_id = $article->getId();
     $title = $this->getTitle("nominate/{$article_id}/{$queue}");
     $form = Xml::buildForm($fields, "deletequeue-delnom-submit");
     $form .= Html::Hidden('title', $title->getPrefixedText());
     $form .= Html::Hidden('queue', $queue);
     $form .= Html::Hidden('wpEditToken', $wgUser->editToken());
     $form = Xml::tags('form', array('action' => $title->getLocalUrl(), 'method' => 'POST'), $form);
     $wgOut->addHTML($form);
 }
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:26,代码来源:DeleteQueueViewNominate.php

示例3: formatRow

 /**
  * Generate the content of each table row (1 row = 1 banner)
  */
 function formatRow($row)
 {
     // Begin banner row
     $htmlOut = Xml::openElement('tr');
     if ($this->editable) {
         // Add box
         $htmlOut .= Xml::tags('td', array('valign' => 'top'), Xml::check('addTemplates[]', '', array('value' => $row->tmp_name)));
         // Weight select
         $htmlOut .= Xml::tags('td', array('valign' => 'top'), Xml::listDropDown("weight[{$row->tmp_id}]", CentralNotice::dropDownList(wfMsg('centralnotice-weight'), range(0, 100, 5)), '', '25', '', ''));
     }
     // Link and Preview
     $render = new SpecialBannerLoader();
     $render->siteName = 'Wikipedia';
     $render->language = $this->mRequest->getVal('wpUserLanguage');
     try {
         $preview = $render->getHtmlNotice($row->tmp_name);
     } catch (SpecialBannerLoaderException $e) {
         $preview = wfMsg('centralnotice-nopreview');
     }
     $htmlOut .= Xml::tags('td', array('valign' => 'top'), $this->getSkin()->makeLinkObj($this->viewPage, htmlspecialchars($row->tmp_name), 'template=' . urlencode($row->tmp_name)) . Xml::fieldset(wfMsg('centralnotice-preview'), $preview, array('class' => 'cn-bannerpreview')));
     // End banner row
     $htmlOut .= Xml::closeElement('tr');
     return $htmlOut;
 }
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:27,代码来源:CentralNoticePager.php

示例4: buildForm

    /**
     * Build the input form
     *
     * @return string HTML form
     */
    function buildForm()
    {
        $context = $this->mContext;
        $user = $context->getUser();
        $output = $context->getOutput();
        $lang = $context->getLanguage();
        $cascadingRestrictionLevels = $context->getConfig()->get('CascadingRestrictionLevels');
        $out = '';
        if (!$this->disabled) {
            $output->addModules('mediawiki.legacy.protect');
            $output->addJsConfigVars('wgCascadeableLevels', $cascadingRestrictionLevels);
            $out .= Xml::openElement('form', ['method' => 'post', 'action' => $this->mTitle->getLocalURL('action=protect'), 'id' => 'mw-Protect-Form']);
        }
        $out .= Xml::openElement('fieldset') . Xml::element('legend', null, $context->msg('protect-legend')->text()) . Xml::openElement('table', ['id' => 'mwProtectSet']) . Xml::openElement('tbody');
        $scExpiryOptions = wfMessage('protect-expiry-options')->inContentLanguage()->text();
        $showProtectOptions = $scExpiryOptions !== '-' && !$this->disabled;
        // Not all languages have V_x <-> N_x relation
        foreach ($this->mRestrictions as $action => $selected) {
            // Messages:
            // restriction-edit, restriction-move, restriction-create, restriction-upload
            $msg = $context->msg('restriction-' . $action);
            $out .= "<tr><td>" . Xml::openElement('fieldset') . Xml::element('legend', null, $msg->exists() ? $msg->text() : $action) . Xml::openElement('table', ['id' => "mw-protect-table-{$action}"]) . "<tr><td>" . $this->buildSelector($action, $selected) . "</td></tr><tr><td>";
            $mProtectexpiry = Xml::label($context->msg('protectexpiry')->text(), "mwProtectExpirySelection-{$action}");
            $mProtectother = Xml::label($context->msg('protect-othertime')->text(), "mwProtect-{$action}-expires");
            $expiryFormOptions = new XmlSelect("wpProtectExpirySelection-{$action}", "mwProtectExpirySelection-{$action}", $this->mExpirySelection[$action]);
            $expiryFormOptions->setAttribute('tabindex', '2');
            if ($this->disabled) {
                $expiryFormOptions->setAttribute('disabled', 'disabled');
            }
            if ($this->mExistingExpiry[$action]) {
                if ($this->mExistingExpiry[$action] == 'infinity') {
                    $existingExpiryMessage = $context->msg('protect-existing-expiry-infinity');
                } else {
                    $timestamp = $lang->userTimeAndDate($this->mExistingExpiry[$action], $user);
                    $d = $lang->userDate($this->mExistingExpiry[$action], $user);
                    $t = $lang->userTime($this->mExistingExpiry[$action], $user);
                    $existingExpiryMessage = $context->msg('protect-existing-expiry', $timestamp, $d, $t);
                }
                $expiryFormOptions->addOption($existingExpiryMessage->text(), 'existing');
            }
            $expiryFormOptions->addOption($context->msg('protect-othertime-op')->text(), 'othertime');
            foreach (explode(',', $scExpiryOptions) as $option) {
                if (strpos($option, ":") === false) {
                    $show = $value = $option;
                } else {
                    list($show, $value) = explode(":", $option);
                }
                $expiryFormOptions->addOption($show, htmlspecialchars($value));
            }
            # Add expiry dropdown
            if ($showProtectOptions && !$this->disabled) {
                $out .= "\n\t\t\t\t\t<table><tr>\n\t\t\t\t\t\t<td class='mw-label'>\n\t\t\t\t\t\t\t{$mProtectexpiry}\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td class='mw-input'>" . $expiryFormOptions->getHTML() . "</td>\n\t\t\t\t\t</tr></table>";
            }
            # Add custom expiry field
            $attribs = ['id' => "mwProtect-{$action}-expires"] + $this->disabledAttrib;
            $out .= "<table><tr>\n\t\t\t\t\t<td class='mw-label'>" . $mProtectother . '</td>
					<td class="mw-input">' . Xml::input("mwProtect-expiry-{$action}", 50, $this->mExpiry[$action], $attribs) . '</td>
				</tr></table>';
            $out .= "</td></tr>" . Xml::closeElement('table') . Xml::closeElement('fieldset') . "</td></tr>";
        }
        # Give extensions a chance to add items to the form
        Hooks::run('ProtectionForm::buildForm', [$this->mArticle, &$out]);
        $out .= Xml::closeElement('tbody') . Xml::closeElement('table');
        // JavaScript will add another row with a value-chaining checkbox
        if ($this->mTitle->exists()) {
            $out .= Xml::openElement('table', ['id' => 'mw-protect-table2']) . Xml::openElement('tbody');
            $out .= '<tr>
					<td></td>
					<td class="mw-input">' . Xml::checkLabel($context->msg('protect-cascade')->text(), 'mwProtect-cascade', 'mwProtect-cascade', $this->mCascade, $this->disabledAttrib) . "</td>\n\t\t\t\t</tr>\n";
            $out .= Xml::closeElement('tbody') . Xml::closeElement('table');
        }
        # Add manual and custom reason field/selects as well as submit
        if (!$this->disabled) {
            $mProtectreasonother = Xml::label($context->msg('protectcomment')->text(), 'wpProtectReasonSelection');
            $mProtectreason = Xml::label($context->msg('protect-otherreason')->text(), 'mwProtect-reason');
            $reasonDropDown = Xml::listDropDown('wpProtectReasonSelection', wfMessage('protect-dropdown')->inContentLanguage()->text(), wfMessage('protect-otherreason-op')->inContentLanguage()->text(), $this->mReasonSelection, 'mwProtect-reason', 4);
            $out .= Xml::openElement('table', ['id' => 'mw-protect-table3']) . Xml::openElement('tbody');
            $out .= "\n\t\t\t\t<tr>\n\t\t\t\t\t<td class='mw-label'>\n\t\t\t\t\t\t{$mProtectreasonother}\n\t\t\t\t\t</td>\n\t\t\t\t\t<td class='mw-input'>\n\t\t\t\t\t\t{$reasonDropDown}\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td class='mw-label'>\n\t\t\t\t\t\t{$mProtectreason}\n\t\t\t\t\t</td>\n\t\t\t\t\t<td class='mw-input'>" . Xml::input('mwProtect-reason', 60, $this->mReason, ['type' => 'text', 'id' => 'mwProtect-reason', 'maxlength' => 180]) . "</td>\n\t\t\t\t</tr>";
            # Disallow watching is user is not logged in
            if ($user->isLoggedIn()) {
                $out .= "\n\t\t\t\t<tr>\n\t\t\t\t\t<td></td>\n\t\t\t\t\t<td class='mw-input'>" . Xml::checkLabel($context->msg('watchthis')->text(), 'mwProtectWatch', 'mwProtectWatch', $user->isWatched($this->mTitle) || $user->getOption('watchdefault')) . "</td>\n\t\t\t\t</tr>";
            }
            $out .= "\n\t\t\t\t<tr>\n\t\t\t\t\t<td></td>\n\t\t\t\t\t<td class='mw-submit'>" . Xml::submitButton($context->msg('confirm')->text(), ['id' => 'mw-Protect-submit']) . "</td>\n\t\t\t\t</tr>\n";
            $out .= Xml::closeElement('tbody') . Xml::closeElement('table');
        }
        $out .= Xml::closeElement('fieldset');
        if ($user->isAllowed('editinterface')) {
            $link = Linker::linkKnown($context->msg('protect-dropdown')->inContentLanguage()->getTitle(), $context->msg('protect-edit-reasonlist')->escaped(), [], ['action' => 'edit']);
            $out .= '<p class="mw-protect-editreasons">' . $link . '</p>';
        }
        if (!$this->disabled) {
            $out .= Html::hidden('wpEditToken', $user->getEditToken(['protect', $this->mTitle->getPrefixedDBkey()]));
            $out .= Xml::closeElement('form');
        }
        return $out;
//.........这里部分代码省略.........
开发者ID:claudinec,项目名称:galan-wiki,代码行数:101,代码来源:ProtectionForm.php

示例5: showForm

 /**
  * Show the confirmation form
  */
 private function showForm()
 {
     global $wgOut, $wgUser, $wgRequest;
     if ($wgUser->isAllowed('suppressrevision')) {
         $suppress = "<tr id=\"wpDeleteSuppressRow\">\n\t\t\t\t\t<td></td>\n\t\t\t\t\t<td class='mw-input'><strong>" . Xml::checkLabel(wfMessage('revdelete-suppress')->text(), 'wpSuppress', 'wpSuppress', false, array('tabindex' => '3')) . "</strong></td>\n\t\t\t\t</tr>";
     } else {
         $suppress = '';
     }
     $checkWatch = $wgUser->getBoolOption('watchdeletion') || $wgUser->isWatched($this->title);
     $form = Xml::openElement('form', array('method' => 'post', 'action' => $this->getAction(), 'id' => 'mw-img-deleteconfirm')) . Xml::openElement('fieldset') . Xml::element('legend', null, wfMessage('filedelete-legend')->text()) . Html::hidden('wpEditToken', $wgUser->getEditToken($this->oldimage)) . $this->prepareMessage('filedelete-intro') . Xml::openElement('table', array('id' => 'mw-img-deleteconfirm-table')) . "<tr>\n\t\t\t\t<td class='mw-label'>" . Xml::label(wfMessage('filedelete-comment')->text(), 'wpDeleteReasonList') . "</td>\n\t\t\t\t<td class='mw-input'>" . Xml::listDropDown('wpDeleteReasonList', wfMessage('filedelete-reason-dropdown')->inContentLanguage()->text(), wfMessage('filedelete-reason-otherlist')->inContentLanguage()->text(), '', 'wpReasonDropDown', 1) . "</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td class='mw-label'>" . Xml::label(wfMessage('filedelete-otherreason')->text(), 'wpReason') . "</td>\n\t\t\t\t<td class='mw-input'>" . Xml::input('wpReason', 60, $wgRequest->getText('wpReason'), array('type' => 'text', 'maxlength' => '255', 'tabindex' => '2', 'id' => 'wpReason')) . "</td>\n\t\t\t</tr>\n\t\t\t{$suppress}";
     if ($wgUser->isLoggedIn()) {
         $form .= "\n\t\t\t<tr>\n\t\t\t\t<td></td>\n\t\t\t\t<td class='mw-input'>" . Xml::checkLabel(wfMessage('watchthis')->text(), 'wpWatch', 'wpWatch', $checkWatch, array('tabindex' => '3')) . "</td>\n\t\t\t</tr>";
     }
     $form .= "\n\t\t\t<tr>\n\t\t\t\t<td></td>\n\t\t\t\t<td class='mw-submit'>" . Xml::submitButton(wfMessage('filedelete-submit')->text(), array('name' => 'mw-filedelete-submit', 'id' => 'mw-filedelete-submit', 'tabindex' => '4')) . "</td>\n\t\t\t</tr>" . Xml::closeElement('table') . Xml::closeElement('fieldset') . Xml::closeElement('form');
     if ($wgUser->isAllowed('editinterface')) {
         $title = Title::makeTitle(NS_MEDIAWIKI, 'Filedelete-reason-dropdown');
         $link = Linker::link($title, wfMessage('filedelete-edit-reasonlist')->escaped(), array(), array('action' => 'edit'));
         $form .= '<p class="mw-filedelete-editreasons">' . $link . '</p>';
     }
     $wgOut->addHTML($form);
 }
开发者ID:biribogos,项目名称:wikihow-src,代码行数:24,代码来源:FileDeleteForm.php

示例6: weightDropDown

 function weightDropDown($name, $selected)
 {
     if ($this->editable) {
         return Xml::listDropDown($name, $this->dropDownList(wfMsg('centralnotice-weight'), range(0, 100, 5)), '', $selected, '', 1);
     } else {
         return htmlspecialchars($selected);
     }
 }
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:8,代码来源:SpecialCentralNotice.php

示例7: confirmDelete

 /**
  * Output deletion confirmation dialog
  * @todo FIXME: Move to another file?
  * @param string $reason Prefilled reason
  */
 public function confirmDelete($reason)
 {
     wfDebug("Article::confirmDelete\n");
     $title = $this->getTitle();
     $ctx = $this->getContext();
     $outputPage = $ctx->getOutput();
     $useMediaWikiUIEverywhere = $ctx->getConfig()->get('UseMediaWikiUIEverywhere');
     $outputPage->setPageTitle(wfMessage('delete-confirm', $title->getPrefixedText()));
     $outputPage->addBacklinkSubtitle($title);
     $outputPage->setRobotPolicy('noindex,nofollow');
     $backlinkCache = $title->getBacklinkCache();
     if ($backlinkCache->hasLinks('pagelinks') || $backlinkCache->hasLinks('templatelinks')) {
         $outputPage->wrapWikiMsg("<div class='mw-warning plainlinks'>\n\$1\n</div>\n", 'deleting-backlinks-warning');
     }
     $outputPage->addWikiMsg('confirmdeletetext');
     Hooks::run('ArticleConfirmDelete', array($this, $outputPage, &$reason));
     $user = $this->getContext()->getUser();
     if ($user->isAllowed('suppressrevision')) {
         $suppress = Html::openElement('div', array('id' => 'wpDeleteSuppressRow')) . Xml::checkLabel(wfMessage('revdelete-suppress')->text(), 'wpSuppress', 'wpSuppress', false, array('tabindex' => '4')) . Html::closeElement('div');
     } else {
         $suppress = '';
     }
     $checkWatch = $user->getBoolOption('watchdeletion') || $user->isWatched($title);
     $form = Html::openElement('form', array('method' => 'post', 'action' => $title->getLocalURL('action=delete'), 'id' => 'deleteconfirm')) . Html::openElement('fieldset', array('id' => 'mw-delete-table')) . Html::element('legend', null, wfMessage('delete-legend')->text()) . Html::openElement('div', array('id' => 'mw-deleteconfirm-table')) . Html::openElement('div', array('id' => 'wpDeleteReasonListRow')) . Html::label(wfMessage('deletecomment')->text(), 'wpDeleteReasonList') . '&nbsp;' . Xml::listDropDown('wpDeleteReasonList', wfMessage('deletereason-dropdown')->inContentLanguage()->text(), wfMessage('deletereasonotherlist')->inContentLanguage()->text(), '', 'wpReasonDropDown', 1) . Html::closeElement('div') . Html::openElement('div', array('id' => 'wpDeleteReasonRow')) . Html::label(wfMessage('deleteotherreason')->text(), 'wpReason') . '&nbsp;' . Html::input('wpReason', $reason, 'text', array('size' => '60', 'maxlength' => '255', 'tabindex' => '2', 'id' => 'wpReason', 'class' => 'mw-ui-input-inline', 'autofocus')) . Html::closeElement('div');
     # Disallow watching if user is not logged in
     if ($user->isLoggedIn()) {
         $form .= Xml::checkLabel(wfMessage('watchthis')->text(), 'wpWatch', 'wpWatch', $checkWatch, array('tabindex' => '3'));
     }
     $form .= Html::openElement('div') . $suppress . Xml::submitButton(wfMessage('deletepage')->text(), array('name' => 'wpConfirmB', 'id' => 'wpConfirmB', 'tabindex' => '5', 'class' => $useMediaWikiUIEverywhere ? 'mw-ui-button mw-ui-destructive' : '')) . Html::closeElement('div') . Html::closeElement('div') . Xml::closeElement('fieldset') . Html::hidden('wpEditToken', $user->getEditToken(array('delete', $title->getPrefixedText()))) . Xml::closeElement('form');
     if ($user->isAllowed('editinterface')) {
         $link = Linker::linkKnown($ctx->msg('deletereason-dropdown')->inContentLanguage()->getTitle(), wfMessage('delete-edit-reasonlist')->escaped(), array(), array('action' => 'edit'));
         $form .= '<p class="mw-delete-editreasons">' . $link . '</p>';
     }
     $outputPage->addHTML($form);
     $deleteLogPage = new LogPage('delete');
     $outputPage->addHTML(Xml::element('h2', null, $deleteLogPage->getName()->text()));
     LogEventsList::showLogExtract($outputPage, 'delete', $title);
 }
开发者ID:ngertrudiz,项目名称:mediawiki,代码行数:43,代码来源:Article.php

示例8: showForm

 /**
  * Show a list of items that we will operate on, and show a form with checkboxes
  * which will allow the user to choose new visibility settings.
  */
 protected function showForm()
 {
     $UserAllowed = true;
     if ($this->typeName == 'logging') {
         $this->getOutput()->addWikiMsg('logdelete-selected', $this->getLanguage()->formatNum(count($this->ids)));
     } else {
         $this->getOutput()->addWikiMsg('revdelete-selected', $this->targetObj->getPrefixedText(), count($this->ids));
     }
     $this->getOutput()->addHTML("<ul>");
     $numRevisions = 0;
     // Live revisions...
     $list = $this->getList();
     for ($list->reset(); $list->current(); $list->next()) {
         $item = $list->current();
         if (!$item->canView()) {
             if (!$this->submitClicked) {
                 throw new PermissionsError('suppressrevision');
             }
             $UserAllowed = false;
         }
         $numRevisions++;
         $this->getOutput()->addHTML($item->getHTML());
     }
     if (!$numRevisions) {
         throw new ErrorPageError('revdelete-nooldid-title', 'revdelete-nooldid-text');
     }
     $this->getOutput()->addHTML("</ul>");
     // Explanation text
     $this->addUsageText();
     // Normal sysops can always see what they did, but can't always change it
     if (!$UserAllowed) {
         return;
     }
     // Show form if the user can submit
     if ($this->mIsAllowed) {
         $out = Xml::openElement('form', array('method' => 'post', 'action' => $this->getPageTitle()->getLocalURL(array('action' => 'submit')), 'id' => 'mw-revdel-form-revisions')) . Xml::fieldset($this->msg('revdelete-legend')->text()) . $this->buildCheckBoxes() . Xml::openElement('table') . "<tr>\n" . '<td class="mw-label">' . Xml::label($this->msg('revdelete-log')->text(), 'wpRevDeleteReasonList') . '</td>' . '<td class="mw-input">' . Xml::listDropDown('wpRevDeleteReasonList', $this->msg('revdelete-reason-dropdown')->inContentLanguage()->text(), $this->msg('revdelete-reasonotherlist')->inContentLanguage()->text(), $this->getRequest()->getText('wpRevDeleteReasonList', 'other'), 'wpReasonDropDown', 1) . '</td>' . "</tr><tr>\n" . '<td class="mw-label">' . Xml::label($this->msg('revdelete-otherreason')->text(), 'wpReason') . '</td>' . '<td class="mw-input">' . Xml::input('wpReason', 60, $this->otherReason, array('id' => 'wpReason', 'maxlength' => 100)) . '</td>' . "</tr><tr>\n" . '<td></td>' . '<td class="mw-submit">' . Xml::submitButton($this->msg('revdelete-submit', $numRevisions)->text(), array('name' => 'wpSubmit')) . '</td>' . "</tr>\n" . Xml::closeElement('table') . Html::hidden('wpEditToken', $this->getUser()->getEditToken()) . Html::hidden('target', $this->targetObj->getPrefixedText()) . Html::hidden('type', $this->typeName) . Html::hidden('ids', implode(',', $this->ids)) . Xml::closeElement('fieldset') . "\n";
     } else {
         $out = '';
     }
     if ($this->mIsAllowed) {
         $out .= Xml::closeElement('form') . "\n";
         // Show link to edit the dropdown reasons
         if ($this->getUser()->isAllowed('editinterface')) {
             $title = Title::makeTitle(NS_MEDIAWIKI, 'Revdelete-reason-dropdown');
             $link = Linker::link($title, $this->msg('revdelete-edit-reasonlist')->escaped(), array(), array('action' => 'edit'));
             $out .= Xml::tags('p', array('class' => 'mw-revdel-editreasons'), $link) . "\n";
         }
     }
     $this->getOutput()->addHTML($out);
 }
开发者ID:biribogos,项目名称:wikihow-src,代码行数:54,代码来源:SpecialRevisiondelete.php

示例9: show

 /**
  * Process the "Review Speedy" action
  * @param $article Article object being reviewed
  */
 public function show($params)
 {
     global $wgOut, $wgScript, $wgUser, $wgRequest;
     list($action, $case_id) = $params;
     $dqi = DeleteQueueItem::newFromId($case_id);
     $article = $this->mArticle = $dqi->getArticle();
     $queue = $dqi->getQueue();
     if (!$queue) {
         // ...
         $wgOut->addWikiMsg('deletequeue-notqueued');
         return;
     }
     // Check permissions
     $editErrors = $article->mTitle->getUserPermissionsErrors('edit', $wgUser);
     $nomErrors = $article->mTitle->getUserPermissionsErrors("{$queue}-review", $wgUser);
     if (count(array_merge($editErrors, $nomErrors))) {
         // Permissions errors.
         if (count($editErrors)) {
             $editError = $wgOut->formatPermissionsErrorMessage($editErrors, 'edit');
             $nomErrors[] = array('deletequeue-permissions-noedit', $editError);
         }
         $wgOut->showPermissionsErrorPage($nomErrors, "{$queue}-review");
         return;
     }
     list($enabledActions, $disabledActions) = $this->availableActions();
     $haveRequeueOption = false;
     $shownActions = array_merge(array_keys($disabledActions), $enabledActions);
     foreach ($shownActions as $val) {
         if (strpos($val, 'requeue') == 0) {
             $haveRequeueOption = true;
         }
     }
     if (($error = $this->submit($article)) === true) {
         $wgOut->setPageTitle(wfMsg("deletequeue-review-success-title"));
         $wgOut->addWikiMsg("deletequeue-review-success");
         return;
     }
     $wgOut->setPageTitle(wfMsg("deletequeue-review{$queue}-title", $article->mTitle->getPrefixedText()));
     $discussionPage = $queue == 'deletediscuss' ? $dqi->getDiscussionPage()->mTitle->getPrefixedText() : null;
     $wgOut->addWikiMsg("deletequeue-review{$queue}-text", $article->mTitle->getPrefixedText(), $discussionPage);
     // Cautions if there's an objection
     if (count($dqi->mVotesObject) > 0) {
         $wgOut->addWikiMsg("deletequeue-review-objections", count($dqi->mVotesObject));
     }
     if ($error) {
         $wgOut->addHTML('<p>' . $error . '</p>');
     }
     // Details of nomination
     $wgOut->addHTML(Xml::openElement('fieldset') . Xml::element('legend', array(), wfMsg('deletequeue-review-original')));
     $wgOut->addWikitext($dqi->getReason());
     $wgOut->addHTML(Xml::closeElement('fieldset'));
     $output = '';
     // Give the user options
     $option_selection = '';
     // // Action radio buttons
     // Accept the nomination as-is
     $accept = Xml::radioLabel(wfMsg('deletequeue-review-delete'), 'wpSpeedyAction', 'delete', 'mw-review-accept');
     $option_selection .= $this->getActionOrError('delete', $accept, null, Xml::tags('li', array(), '$1'));
     // Accept nomination, but with a different reasoning.
     $change_option = Xml::radioLabel(wfMsg('deletequeue-review-change'), 'wpSpeedyAction', 'change', 'mw-review-change');
     $change_fields = array();
     $change_fields['deletequeue-review-newreason'] = Xml::listDropDown('wpSpeedyNewReason', DeleteQueueInterface::getReasonList($queue), wfMsg('deletequeue-delnom-otherreason'));
     $change_fields['deletequeue-review-newextra'] = Xml::input('wpSpeedyNewExtra', 45, '');
     $change_option .= Xml::buildForm($change_fields);
     $option_selection .= $this->getActionOrError('delete', $change_option, wfMsgExt('deletequeue-review-change', array('parseinline')), Xml::tags('li', array(), '$1'));
     // Reject nomination, queue into a different deletion queue.
     if ($haveRequeueOption) {
         $requeue_option = Xml::radioLabel(wfMsg('deletequeue-review-requeue'), 'wpSpeedyAction', 'requeue', 'mw-review-requeue');
         $new_queues = array('prod', 'deletediscuss');
         $requeue_queues = '';
         foreach ($new_queues as $option) {
             $this_queue = Xml::radioLabel(wfMsg("deletequeue-queue-{$option}"), 'wpSpeedyRequeue', $option, "mw-review-requeue-{$option}");
             $disabledMsg = wfMsgExt("deletequeue-requeuedisabled", array('parseinline'), array(wfMsgNoTrans("deletequeue-queue-{$option}")));
             $requeue_queues .= $this->getActionOrError("requeue-{$option}", $this_queue, $disabledMsg, Xml::tags('li', array(), '$1'));
         }
         $requeue_option .= Xml::tags('ul', array(), $requeue_queues);
         $requeue_fields = array();
         $requeue_fields['deletequeue-review-newreason'] = Xml::listDropDown('wpSpeedyNewReason', DeleteQueueInterface::getReasonList('generic'), wfMsg("deletequeue-delnom-otherreason"));
         $requeue_fields['deletequeue-review-newextra'] = Xml::input('wpSpeedyNewExtra', 45, '');
         $requeue_option .= Xml::buildForm($requeue_fields);
         $option_selection .= Xml::tags('li', array(), $requeue_option);
     }
     // Reject nomination outright.
     $dq = Xml::radioLabel(wfMsg('deletequeue-review-dequeue'), 'wpSpeedyAction', 'dequeue', 'mw-review-dequeue');
     $option_selection .= $this->getActionOrError('dequeue', $dq, null, Xml::tags('li', array(), '$1'));
     // // Convert to a list.
     $option_selection = Xml::tags('ul', array(), $option_selection);
     $option_selection = Xml::fieldset(wfMsg('deletequeue-review-action'), $option_selection);
     $output .= $option_selection;
     // Reason etc.
     $fields = array('deletequeue-review-reason' => Xml::input('wpReason', 45, null));
     $output .= Xml::buildForm($fields, 'deletequeue-review-submit');
     // Form stuff
     $output .= Html::Hidden('title', $this->getTitle("case/" . $dqi->getCaseID() . "/review"));
     $output .= Html::Hidden('wpEditToken', $wgUser->editToken());
     $output = Xml::tags('form', array('action' => $article->mTitle->getLocalURL(), 'method' => 'POST'), $output);
//.........这里部分代码省略.........
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:101,代码来源:DeleteQueueViewReview.php

示例10: showForm

    public function showForm($err = null)
    {
        $out = $this->getOutput();
        $form = $this->form;
        // convenience
        $title = $this->form->getPage();
        $oldConfig = $form->getOldConfig();
        $s = '';
        // form HTML string
        # Add any error messages
        if ("" != $err) {
            $out->setSubtitle(wfMsgHtml('formerror'));
            $out->addHTML("<p class='error'>{$err}</p>\n");
        }
        # Add header text
        if (!$form->isAllowed()) {
            $s .= wfMsgExt('stabilization-perm', 'parse', $title->getPrefixedText());
        } else {
            $s .= wfMsgExt('stabilization-text', 'parse', $title->getPrefixedText());
        }
        # Borrow some protection messages for dropdowns
        $reasonDropDown = Xml::listDropDown('wpReasonSelection', wfMsgForContent('protect-dropdown'), wfMsgForContent('protect-otherreason-op'), $form->getReasonSelection(), 'mwStabilize-reason', 4);
        $scExpiryOptions = wfMsgForContent('protect-expiry-options');
        $showProtectOptions = $scExpiryOptions !== '-' && $form->isAllowed();
        $dropdownOptions = array();
        // array of <label,value>
        # Add the current expiry as a dropdown option
        if ($oldConfig['expiry'] && $oldConfig['expiry'] != Block::infinity()) {
            $timestamp = $this->getLang()->timeanddate($oldConfig['expiry']);
            $d = $this->getLang()->date($oldConfig['expiry']);
            $t = $this->getLang()->time($oldConfig['expiry']);
            $dropdownOptions[] = array(wfMsg('protect-existing-expiry', $timestamp, $d, $t), 'existing');
        }
        # Add "other time" expiry dropdown option
        $dropdownOptions[] = array(wfMsg('protect-othertime-op'), 'othertime');
        # Add custom expiry dropdown options (from MediaWiki message)
        foreach (explode(',', $scExpiryOptions) as $option) {
            if (strpos($option, ":") === false) {
                $show = $value = $option;
            } else {
                list($show, $value) = explode(":", $option);
            }
            $dropdownOptions[] = array($show, $value);
        }
        # Actually build the options HTML...
        $expiryFormOptions = '';
        foreach ($dropdownOptions as $option) {
            $show = htmlspecialchars($option[0]);
            $value = htmlspecialchars($option[1]);
            $expiryFormOptions .= Xml::option($show, $value, $form->getExpirySelection() === $value) . "\n";
        }
        # Build up the form...
        $s .= Xml::openElement('form', array('name' => 'stabilization', 'action' => $this->getTitle()->getLocalUrl(), 'method' => 'post'));
        # Add stable version override and selection options
        $s .= Xml::fieldset(wfMsg('stabilization-def'), false) . "\n" . Xml::radioLabel(wfMsg('stabilization-def1'), 'wpStableconfig-override', 1, 'default-stable', 1 == $form->getOverride(), $this->disabledAttr()) . '<br />' . "\n" . Xml::radioLabel(wfMsg('stabilization-def2'), 'wpStableconfig-override', 0, 'default-current', 0 == $form->getOverride(), $this->disabledAttr()) . "\n" . Xml::closeElement('fieldset');
        # Add autoreview restriction select
        $s .= Xml::fieldset(wfMsg('stabilization-restrict'), false) . $this->buildSelector($form->getAutoreview()) . Xml::closeElement('fieldset') . Xml::fieldset(wfMsg('stabilization-leg'), false) . Xml::openElement('table');
        # Add expiry dropdown to form...
        if ($showProtectOptions && $form->isAllowed()) {
            $s .= "\n\t\t\t\t<tr>\n\t\t\t\t\t<td class='mw-label'>" . Xml::label(wfMsg('stabilization-expiry'), 'mwStabilizeExpirySelection') . "</td>\n\t\t\t\t\t<td class='mw-input'>" . Xml::tags('select', array('id' => 'mwStabilizeExpirySelection', 'name' => 'wpExpirySelection', 'onchange' => 'onFRChangeExpiryDropdown()') + $this->disabledAttr(), $expiryFormOptions) . "</td>\n\t\t\t\t</tr>";
        }
        # Add custom expiry field to form...
        $attribs = array('id' => "mwStabilizeExpiryOther", 'onkeyup' => 'onFRChangeExpiryField()') + $this->disabledAttr();
        $s .= "\n\t\t\t<tr>\n\t\t\t\t<td class='mw-label'>" . Xml::label(wfMsg('stabilization-othertime'), 'mwStabilizeExpiryOther') . '</td>
				<td class="mw-input">' . Xml::input("mwStabilize-expiry", 50, $form->getExpiryCustom(), $attribs) . '</td>
			</tr>';
        # Add comment input and submit button
        if ($form->isAllowed()) {
            $watchLabel = wfMsgExt('watchthis', 'parseinline');
            $watchAttribs = array('accesskey' => wfMsg('accesskey-watch'), 'id' => 'wpWatchthis');
            $watchChecked = $this->getUser()->getOption('watchdefault') || $title->userIsWatching();
            $reviewLabel = wfMsgExt('stabilization-review', 'parseinline');
            $s .= ' <tr>
					<td class="mw-label">' . xml::label(wfMsg('stabilization-comment'), 'wpReasonSelection') . '</td>
					<td class="mw-input">' . $reasonDropDown . '</td>
				</tr>
				<tr>
					<td class="mw-label">' . Xml::label(wfMsg('stabilization-otherreason'), 'wpReason') . '</td>
					<td class="mw-input">' . Xml::input('wpReason', 70, $form->getReasonExtra(), array('id' => 'wpReason', 'maxlength' => 255)) . '</td>
				</tr>
				<tr>
					<td></td>
					<td class="mw-input">' . Xml::check('wpReviewthis', $form->getReviewThis(), array('id' => 'wpReviewthis')) . "<label for='wpReviewthis'>{$reviewLabel}</label>" . '&#160;&#160;&#160;&#160;&#160;' . Xml::check('wpWatchthis', $watchChecked, $watchAttribs) . "&#160;<label for='wpWatchthis' " . Xml::expandAttributes(array('title' => Linker::titleAttrib('watch', 'withaccess'))) . ">{$watchLabel}</label>" . '</td>
				</tr>
				<tr>
					<td></td>
					<td class="mw-submit">' . Xml::submitButton(wfMsg('stabilization-submit')) . '</td>
				</tr>' . Xml::closeElement('table') . Html::hidden('title', $this->getTitle()->getPrefixedDBKey()) . Html::hidden('page', $title->getPrefixedText()) . Html::hidden('wpEditToken', $this->getUser()->editToken());
        } else {
            $s .= Xml::closeElement('table');
        }
        $s .= Xml::closeElement('fieldset') . Xml::closeElement('form');
        $out->addHTML($s);
        $out->addHTML(Xml::element('h2', null, htmlspecialchars(LogPage::logName('stable'))));
        LogEventsList::showLogExtract($out, 'stable', $title->getPrefixedText(), '', array('lim' => 25));
        # Add some javascript for expiry dropdowns
        $out->addScript("<script type=\"text/javascript\">\n\t\t\t\tfunction onFRChangeExpiryDropdown() {\n\t\t\t\t\tdocument.getElementById('mwStabilizeExpiryOther').value = '';\n\t\t\t\t}\n\t\t\t\tfunction onFRChangeExpiryField() {\n\t\t\t\t\tdocument.getElementById('mwStabilizeExpirySelection').value = 'othertime';\n\t\t\t\t}\n\t\t\t</script>");
    }
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:98,代码来源:Stabilization_body.php

示例11: confirmDelete

 /**
  * Output deletion confirmation dialog
  * @todo FIXME: Move to another file?
  * @param string $reason prefilled reason
  */
 public function confirmDelete($reason)
 {
     wfDebug("Article::confirmDelete\n");
     $outputPage = $this->getContext()->getOutput();
     $outputPage->setPageTitle(wfMessage('delete-confirm', $this->getTitle()->getPrefixedText()));
     $outputPage->addBacklinkSubtitle($this->getTitle());
     $outputPage->setRobotPolicy('noindex,nofollow');
     $backlinkCache = $this->getTitle()->getBacklinkCache();
     if ($backlinkCache->hasLinks('pagelinks') || $backlinkCache->hasLinks('templatelinks')) {
         $outputPage->wrapWikiMsg("<div class='mw-warning plainlinks'>\n\$1\n</div>\n", 'deleting-backlinks-warning');
     }
     $outputPage->addWikiMsg('confirmdeletetext');
     wfRunHooks('ArticleConfirmDelete', array($this, $outputPage, &$reason));
     $user = $this->getContext()->getUser();
     if ($user->isAllowed('suppressrevision')) {
         $suppress = "<tr id=\"wpDeleteSuppressRow\">\n\t\t\t\t\t<td></td>\n\t\t\t\t\t<td class='mw-input'><strong>" . Xml::checkLabel(wfMessage('revdelete-suppress')->text(), 'wpSuppress', 'wpSuppress', false, array('tabindex' => '4')) . "</strong></td>\n\t\t\t\t</tr>";
     } else {
         $suppress = '';
     }
     $checkWatch = $user->getBoolOption('watchdeletion') || $user->isWatched($this->getTitle());
     $form = Xml::openElement('form', array('method' => 'post', 'action' => $this->getTitle()->getLocalURL('action=delete'), 'id' => 'deleteconfirm')) . Xml::openElement('fieldset', array('id' => 'mw-delete-table')) . Xml::tags('legend', null, wfMessage('delete-legend')->escaped()) . Xml::openElement('table', array('id' => 'mw-deleteconfirm-table')) . "<tr id=\"wpDeleteReasonListRow\">\n\t\t\t\t<td class='mw-label'>" . Xml::label(wfMessage('deletecomment')->text(), 'wpDeleteReasonList') . "</td>\n\t\t\t\t<td class='mw-input'>" . Xml::listDropDown('wpDeleteReasonList', wfMessage('deletereason-dropdown')->inContentLanguage()->text(), wfMessage('deletereasonotherlist')->inContentLanguage()->text(), '', 'wpReasonDropDown', 1) . "</td>\n\t\t\t</tr>\n\t\t\t<tr id=\"wpDeleteReasonRow\">\n\t\t\t\t<td class='mw-label'>" . Xml::label(wfMessage('deleteotherreason')->text(), 'wpReason') . "</td>\n\t\t\t\t<td class='mw-input'>" . Html::input('wpReason', $reason, 'text', array('size' => '60', 'maxlength' => '255', 'tabindex' => '2', 'id' => 'wpReason', 'autofocus', 'class' => 'input_med')) . "</td>\n\t\t\t</tr>";
     # Disallow watching if user is not logged in
     if ($user->isLoggedIn()) {
         $form .= "\n\t\t\t<tr>\n\t\t\t\t<td></td>\n\t\t\t\t<td class='mw-input'>" . Xml::checkLabel(wfMessage('watchthis')->text(), 'wpWatch', 'wpWatch', $checkWatch, array('tabindex' => '3')) . "</td>\n\t\t\t</tr>";
     }
     $form .= "\n\t\t\t{$suppress}\n\t\t\t<tr>\n\t\t\t\t<td></td>\n\t\t\t\t<td class='mw-submit'>" . Xml::submitButton(wfMessage('deletepage')->text(), array('name' => 'wpConfirmB', 'id' => 'wpConfirmB', 'tabindex' => '5', 'class' => 'button primary')) . "</td>\n\t\t\t</tr>" . Xml::closeElement('table') . Xml::closeElement('fieldset') . Html::hidden('wpEditToken', $user->getEditToken(array('delete', $this->getTitle()->getPrefixedText()))) . Xml::closeElement('form');
     if ($user->isAllowed('editinterface')) {
         $title = Title::makeTitle(NS_MEDIAWIKI, 'Deletereason-dropdown');
         $link = Linker::link($title, wfMessage('delete-edit-reasonlist')->escaped(), array(), array('action' => 'edit'));
         $form .= '<p class="mw-delete-editreasons">' . $link . '</p>';
     }
     $outputPage->addHTML($form);
     $deleteLogPage = new LogPage('delete');
     $outputPage->addHTML(Xml::element('h2', null, $deleteLogPage->getName()->text()));
     LogEventsList::showLogExtract($outputPage, 'delete', $this->getTitle());
 }
开发者ID:biribogos,项目名称:wikihow-src,代码行数:41,代码来源:Article.php

示例12: confirmDelete

 /**
  * Output deletion confirmation dialog
  * @param $par string FIXME: do we need this parameter? One Call from Article::delete with '' only.
  * @param $reason string Prefilled reason
  */
 function confirmDelete($par, $reason)
 {
     global $wgOut, $wgUser, $wgContLang;
     $align = $wgContLang->isRtl() ? 'left' : 'right';
     // Try to choose the right dropdown if possible
     $defaultReason = "";
     wfRunHooks('ArticleConfirmDelete', array($this, &$defaultReason));
     wfDebug("Article::confirmDelete\n");
     $wgOut->setSubtitle(wfMsg('delete-backlink', $wgUser->getSkin()->makeKnownLinkObj($this->mTitle)));
     $wgOut->setRobotpolicy('noindex,nofollow');
     $wgOut->addWikiMsg('confirmdeletetext');
     $form = Xml::openElement('form', array('method' => 'post', 'action' => $this->mTitle->getLocalURL('action=delete' . $par), 'id' => 'deleteconfirm')) . Xml::openElement('table') . "<tr id=\"wpDeleteReasonListRow\">\n\t\t\t\t<td align='{$align}'>" . Xml::label(wfMsg('deletecomment'), 'wpDeleteReasonList') . "</td>\n\t\t\t\t<td>" . Xml::listDropDown('wpDeleteReasonList', wfMsgForContent('deletereason-dropdown'), wfMsgForContent('deletereasonotherlist'), $defaultReason, 'wpReasonDropDown input_med', 1) . "</td>\n\t\t\t</tr>\n\t\t\t<tr id=\"wpDeleteReasonRow\">\n\t\t\t\t<td align='{$align}'>" . Xml::label(wfMsg('deleteotherreason'), 'wpReason') . "</td>\n\t\t\t\t<td>" . Xml::input('wpReason', 60, $reason, array('type' => 'text', 'maxlength' => '255', 'tabindex' => '2', 'id' => 'wpReason', 'class' => 'input_med')) . "</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td></td>\n\t\t\t\t<td>" . Xml::checkLabel(wfMsg('watchthis'), 'wpWatch', 'wpWatch', $wgUser->getBoolOption('watchdeletion') || $this->mTitle->userIsWatching(), array('tabindex' => '3')) . "</td>\n\t\t\t</tr>\n\t\t\t{$r_confirm}\n\t\t\t<tr>\n\t\t\t\t<td></td>\n\t\t\t\t<td>" . Xml::submitButton(wfMsg('deletepage'), array('name' => 'wpConfirmB', 'id' => 'wpConfirmB', 'tabindex' => '4', 'class' => 'button primary')) . "</td>\n\t\t\t</tr>" . Xml::closeElement('table') . Xml::hidden('wpEditToken', $wgUser->editToken()) . Xml::closeElement('form');
     $wgOut->addHTML($form);
     $this->showLogExtract($wgOut);
 }
开发者ID:ErdemA,项目名称:wikihow,代码行数:20,代码来源:Article.php

示例13: form

 /**
  * Constructs the form which can be used to generate custom graphs.
  * @param $opts FormOptions
  */
 protected function form(FormOptions $opts)
 {
     global $wgOut, $wgScript;
     $this->setHeaders();
     $wgOut->addWikiMsg('translate-statsf-intro');
     $wgOut->addHTML(Xml::fieldset(wfMsg('translate-statsf-options')) . Html::openElement('form', array('action' => $wgScript)) . Html::hidden('title', $this->getTitle()->getPrefixedText()) . Html::hidden('preview', 1) . '<table>');
     $submit = Xml::submitButton(wfMsg('translate-statsf-submit'));
     $days = '';
     for ($i = 1; $i <= 31; $i++) {
         $days .= "{$i}\n";
     }
     $years = '';
     $currentYear = date('Y');
     for ($i = 0; $i < 10; $i++) {
         $years .= $currentYear - $i . "\n";
     }
     $wgOut->addHTML($this->eInput('width', $opts) . $this->eInput('height', $opts) . '<tr><td colspan="2"><hr /></td></tr>' . '<tr>' . '<td>' . wfMsg('label-for-date') . '</td>' . '<td>' . wfMsg('translationstats-from') . Xml::listDropDown('startday', $days, null, $opts->getValue('startday')) . $this->monthSelector($opts->getValue('startmonth'), null, 'startmonth', 'startmonth') . Xml::listDropDown('startyear', $years, null, $opts->getValue('startyear')) . wfMsg('translationstats-to') . Xml::listDropDown('endday', $days, null, $opts->getValue('endday')) . $this->monthSelector($opts->getValue('endmonth'), null, 'endmonth', 'endmonth') . Xml::listDropDown('endyear', $years, null, $opts->getValue('endyear')) . '</td>' . '</tr>' . $this->eRadio('scale', $opts, array('months', 'weeks', 'days', 'hours')) . $this->eRadio('count', $opts, array('edits', 'users', 'registrations')) . '<tr><td colspan="2"><hr /></td></tr>' . $this->eLanguage('language', $opts) . $this->eGroup('group', $opts) . '<tr><td colspan="2"><hr /></td></tr>' . '<tr><td colspan="2">' . $submit . '</td></tr>');
     $wgOut->addHTML('</table>' . '</form>' . '</fieldset>');
     if (!$opts['preview']) {
         return;
     }
     $spiParams = '';
     foreach ($opts->getChangedValues() as $key => $v) {
         if ($key === 'preview') {
             continue;
         }
         if ($spiParams !== '') {
             $spiParams .= ';';
         }
         $spiParams .= wfEscapeWikiText("{$key}={$v}");
     }
     if ($spiParams !== '') {
         $spiParams = '/' . $spiParams;
     }
     $titleText = $this->getTitle()->getPrefixedText();
     $wgOut->addHTML(Html::element('hr') . Html::rawElement('div', array('style' => 'margin: 1em auto; text-align: center;'), $this->image($opts)));
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:41,代码来源:SpecialTranslationStats.php

示例14: dateSelector

 private function dateSelector($prefix, $year = 0, $month = 0, $day = 0)
 {
     $dateRanges = CentralNotice::getDateRanges();
     $fields = array(array($prefix . "_month", "centralnotice-month", $dateRanges['months'], $month), array($prefix . "_day", "centralnotice-day", $dateRanges['days'], $day), array($prefix . "_year", "centralnotice-year", $dateRanges['years'], $year));
     $out = '';
     foreach ($fields as $data) {
         list($field, $label, $set, $current) = $data;
         $out .= Xml::listDropDown($field, CentralNotice::dropDownList(wfMsg($label), $set), '', $current);
     }
     return $out;
 }
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:11,代码来源:SpecialCentralNoticeLogs.php

示例15: showForm

 function showForm($err)
 {
     global $wgOut, $wgUser, $wgSysopUserBans;
     $wgOut->setPagetitle(wfMsg('blockip'));
     $wgOut->addWikiMsg('blockiptext');
     if ($wgSysopUserBans) {
         $mIpaddress = Xml::label(wfMsg('ipadressorusername'), 'mw-bi-target');
     } else {
         $mIpaddress = Xml::label(wfMsg('ipaddress'), 'mw-bi-target');
     }
     $mIpbexpiry = Xml::label(wfMsg('ipbexpiry'), 'wpBlockExpiry');
     $mIpbother = Xml::label(wfMsg('ipbother'), 'mw-bi-other');
     $mIpbreasonother = Xml::label(wfMsg('ipbreason'), 'wpBlockReasonList');
     $mIpbreason = Xml::label(wfMsg('ipbotherreason'), 'mw-bi-reason');
     $titleObj = SpecialPage::getTitleFor('Blockip');
     $user = User::newFromName($this->BlockAddress);
     $alreadyBlocked = false;
     if ($err && $err[0] != 'ipb_already_blocked') {
         $key = array_shift($err);
         $msg = wfMsgReal($key, $err);
         $wgOut->setSubtitle(wfMsgHtml('formerror'));
         $wgOut->addHTML(Xml::tags('p', array('class' => 'error'), $msg));
     } elseif ($this->BlockAddress) {
         $userId = 0;
         if (is_object($user)) {
             $userId = $user->getId();
         }
         $currentBlock = Block::newFromDB($this->BlockAddress, $userId);
         if (!is_null($currentBlock) && !$currentBlock->mAuto && ($currentBlock->mRangeStart == $currentBlock->mRangeEnd || $currentBlock->mAddress == $this->BlockAddress)) {
             $wgOut->addWikiMsg('ipb-needreblock', $this->BlockAddress);
             $alreadyBlocked = true;
         }
     }
     $scBlockExpiryOptions = wfMsgForContent('ipboptions');
     $showblockoptions = $scBlockExpiryOptions != '-';
     if (!$showblockoptions) {
         $mIpbother = $mIpbexpiry;
     }
     $blockExpiryFormOptions = Xml::option(wfMsg('ipbotheroption'), 'other');
     foreach (explode(',', $scBlockExpiryOptions) as $option) {
         if (strpos($option, ":") === false) {
             $option = "{$option}:{$option}";
         }
         list($show, $value) = explode(":", $option);
         $show = htmlspecialchars($show);
         $value = htmlspecialchars($value);
         $blockExpiryFormOptions .= Xml::option($show, $value, $this->BlockExpiry === $value ? true : false) . "\n";
     }
     $reasonDropDown = Xml::listDropDown('wpBlockReasonList', wfMsgForContent('ipbreason-dropdown'), wfMsgForContent('ipbreasonotherlist'), $this->BlockReasonList, 'wpBlockDropDown', 4);
     global $wgStylePath, $wgStyleVersion;
     $wgOut->addHTML(Xml::tags('script', array('type' => 'text/javascript', 'src' => "{$wgStylePath}/common/block.js?{$wgStyleVersion}"), '') . Xml::openElement('form', array('method' => 'post', 'action' => $titleObj->getLocalURL("action=submit"), 'id' => 'blockip')) . Xml::openElement('fieldset') . Xml::element('legend', null, wfMsg('blockip-legend')) . Xml::openElement('table', array('border' => '0', 'id' => 'mw-blockip-table')) . "<tr>\n\t\t\t\t<td class='mw-label'>\n\t\t\t\t\t{$mIpaddress}\n\t\t\t\t</td>\n\t\t\t\t<td class='mw-input'>" . Xml::input('wpBlockAddress', 45, $this->BlockAddress, array('tabindex' => '1', 'id' => 'mw-bi-target', 'onchange' => 'updateBlockOptions()')) . "\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>");
     if ($showblockoptions) {
         $wgOut->addHTML("\n\t\t\t\t<td class='mw-label'>\n\t\t\t\t\t{$mIpbexpiry}\n\t\t\t\t</td>\n\t\t\t\t<td class='mw-input'>" . Xml::tags('select', array('id' => 'wpBlockExpiry', 'name' => 'wpBlockExpiry', 'onchange' => 'considerChangingExpiryFocus()', 'tabindex' => '2'), $blockExpiryFormOptions) . "</td>");
     }
     $wgOut->addHTML("\n\t\t\t</tr>\n\t\t\t<tr id='wpBlockOther'>\n\t\t\t\t<td class='mw-label'>\n\t\t\t\t\t{$mIpbother}\n\t\t\t\t</td>\n\t\t\t\t<td class='mw-input'>" . Xml::input('wpBlockOther', 45, $this->BlockOther, array('tabindex' => '3', 'id' => 'mw-bi-other')) . "\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td class='mw-label'>\n\t\t\t\t\t{$mIpbreasonother}\n\t\t\t\t</td>\n\t\t\t\t<td class='mw-input'>\n\t\t\t\t\t{$reasonDropDown}\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr id=\"wpBlockReason\">\n\t\t\t\t<td class='mw-label'>\n\t\t\t\t\t{$mIpbreason}\n\t\t\t\t</td>\n\t\t\t\t<td class='mw-input'>" . Xml::input('wpBlockReason', 45, $this->BlockReason, array('tabindex' => '5', 'id' => 'mw-bi-reason', 'maxlength' => '200')) . "\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr id='wpAnonOnlyRow'>\n\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t<td class='mw-input'>" . Xml::checkLabel(wfMsg('ipbanononly'), 'wpAnonOnly', 'wpAnonOnly', $this->BlockAnonOnly, array('tabindex' => '6')) . "\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr id='wpCreateAccountRow'>\n\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t<td class='mw-input'>" . Xml::checkLabel(wfMsg('ipbcreateaccount'), 'wpCreateAccount', 'wpCreateAccount', $this->BlockCreateAccount, array('tabindex' => '7')) . "\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr id='wpEnableAutoblockRow'>\n\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t<td class='mw-input'>" . Xml::checkLabel(wfMsg('ipbenableautoblock'), 'wpEnableAutoblock', 'wpEnableAutoblock', $this->BlockEnableAutoblock, array('tabindex' => '8')) . "\n\t\t\t\t</td>\n\t\t\t</tr>");
     global $wgSysopEmailBans, $wgBlockAllowsUTEdit;
     if ($wgSysopEmailBans && $wgUser->isAllowed('blockemail')) {
         $wgOut->addHTML("\n\t\t\t\t<tr id='wpEnableEmailBan'>\n\t\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t\t<td class='mw-input'>" . Xml::checkLabel(wfMsg('ipbemailban'), 'wpEmailBan', 'wpEmailBan', $this->BlockEmail, array('tabindex' => '9')) . "\n\t\t\t\t\t</td>\n\t\t\t\t</tr>");
     }
     // Allow some users to hide name from block log, blocklist and listusers
     if ($wgUser->isAllowed('hideuser')) {
         $wgOut->addHTML("\n\t\t\t\t<tr id='wpEnableHideUser'>\n\t\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t\t<td class='mw-input'>" . Xml::checkLabel(wfMsg('ipbhidename'), 'wpHideName', 'wpHideName', $this->BlockHideName, array('tabindex' => '10')) . "\n\t\t\t\t\t</td>\n\t\t\t\t</tr>");
     }
     # Watchlist their user page?
     $wgOut->addHTML("\n\t\t\t<tr id='wpEnableWatchUser'>\n\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t<td class='mw-input'>" . Xml::checkLabel(wfMsg('ipbwatchuser'), 'wpWatchUser', 'wpWatchUser', $this->BlockWatchUser, array('tabindex' => '11')) . "\n\t\t\t\t</td>\n\t\t\t</tr>");
     if ($wgBlockAllowsUTEdit) {
         $wgOut->addHTML("\n\t\t\t\t<tr id='wpAllowUsertalkRow'>\n\t\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t\t<td class='mw-input'>" . Xml::checkLabel(wfMsg('ipballowusertalk'), 'wpAllowUsertalk', 'wpAllowUsertalk', $this->BlockAllowUsertalk, array('tabindex' => '12')) . "\n\t\t\t\t\t</td>\n\t\t\t\t</tr>");
     }
     $wgOut->addHTML("\n\t\t\t<tr>\n\t\t\t\t<td style='padding-top: 1em'>&nbsp;</td>\n\t\t\t\t<td  class='mw-submit' style='padding-top: 1em'>" . Xml::submitButton(wfMsg($alreadyBlocked ? 'ipb-change-block' : 'ipbsubmit'), array('name' => 'wpBlock', 'tabindex' => '13', 'accesskey' => 's')) . "\n\t\t\t\t</td>\n\t\t\t</tr>" . Xml::closeElement('table') . Xml::hidden('wpEditToken', $wgUser->editToken()) . ($alreadyBlocked ? Xml::hidden('wpChangeBlock', 1) : "") . Xml::closeElement('fieldset') . Xml::closeElement('form') . Xml::tags('script', array('type' => 'text/javascript'), 'updateBlockOptions()') . "\n");
     $wgOut->addHTML($this->getConvenienceLinks());
     if (is_object($user)) {
         $this->showLogFragment($wgOut, $user->getUserPage());
     } elseif (preg_match('/^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}/', $this->BlockAddress)) {
         $this->showLogFragment($wgOut, Title::makeTitle(NS_USER, $this->BlockAddress));
     } elseif (preg_match('/^\\w{1,4}:\\w{1,4}:\\w{1,4}:\\w{1,4}:\\w{1,4}:\\w{1,4}:\\w{1,4}:\\w{1,4}/', $this->BlockAddress)) {
         $this->showLogFragment($wgOut, Title::makeTitle(NS_USER, $this->BlockAddress));
     }
 }
开发者ID:amjadtbssm,项目名称:website,代码行数:78,代码来源:SpecialBlockip.php


注:本文中的Xml::listDropDown方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。