• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP wfCloseElement函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中wfCloseElement函数的典型用法代码示例。如果您正苦于以下问题:PHP wfCloseElement函数的具体用法?PHP wfCloseElement怎么用?PHP wfCloseElement使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: showForm

 function showForm()
 {
     global $wgOut, $wgUser, $wgLang, $wgRequest;
     $self = SpecialPage::getTitleFor('Resetpass');
     $form = '<div id="userloginForm">' . wfOpenElement('form', array('method' => 'post', 'action' => $self->getLocalUrl())) . '<h2>' . wfMsgHtml('resetpass_header') . '</h2>' . '<div id="userloginprompt">' . wfMsgExt('resetpass_text', array('parse')) . '</div>' . '<table>' . wfHidden('token', $wgUser->editToken()) . wfHidden('wpName', $this->mName) . wfHidden('wpPassword', $this->mTemporaryPassword) . wfHidden('returnto', $wgRequest->getVal('returnto')) . $this->pretty(array(array('wpName', 'username', 'text', $this->mName), array('wpNewPassword', 'newpassword', 'password', ''), array('wpRetype', 'yourpasswordagain', 'password', ''))) . '<tr>' . '<td></td>' . '<td>' . Xml::checkLabel(wfMsg('remembermypassword'), 'wpRemember', 'wpRemember', $wgRequest->getCheck('wpRemember')) . '</td>' . '</tr>' . '<tr>' . '<td></td>' . '<td>' . wfSubmitButton(wfMsgHtml('resetpass_submit')) . '</td>' . '</tr>' . '</table>' . wfCloseElement('form') . '</div>';
     $wgOut->addHtml($form);
 }
开发者ID:negabaro,项目名称:alfresco,代码行数:7,代码来源:SpecialResetpass.php


示例2: showRequestForm

 /**
  * Show a nice form for the user to request a confirmation mail
  */
 function showRequestForm()
 {
     global $wgOut, $wgUser, $wgLang, $wgRequest;
     if ($wgRequest->wasPosted() && $wgUser->matchEditToken($wgRequest->getText('token'))) {
         $ok = $wgUser->sendConfirmationMail();
         if (WikiError::isError($ok)) {
             $wgOut->addWikiMsg('confirmemail_sendfailed', $ok->toString());
         } else {
             $wgOut->addWikiMsg('confirmemail_sent');
         }
     } else {
         if ($wgUser->isEmailConfirmed()) {
             $time = $wgLang->timeAndDate($wgUser->mEmailAuthenticated, true);
             $wgOut->addWikiMsg('emailauthenticated', $time);
         }
         if ($wgUser->isEmailConfirmationPending()) {
             $wgOut->addWikiMsg('confirmemail_pending');
         }
         $wgOut->addWikiMsg('confirmemail_text');
         $self = SpecialPage::getTitleFor('Confirmemail');
         $form = wfOpenElement('form', array('method' => 'post', 'action' => $self->getLocalUrl()));
         $form .= wfHidden('token', $wgUser->editToken());
         $form .= wfSubmitButton(wfMsgHtml('confirmemail_send'));
         $form .= wfCloseElement('form');
         $wgOut->addHtml($form);
     }
 }
开发者ID:BackupTheBerlios,项目名称:shoutwiki-svn,代码行数:30,代码来源:SpecialConfirmemail.php


示例3: wfSpecialMIMEsearch

/**
 * constructor
 */
function wfSpecialMIMEsearch($par = null)
{
    global $wgRequest, $wgTitle, $wgOut;
    $mime = isset($par) ? $par : $wgRequest->getText('mime');
    $wgOut->addHTML(wfElement('form', array('id' => 'specialmimesearch', 'method' => 'get', 'action' => $wgTitle->escapeLocalUrl()), null) . wfOpenElement('label') . wfMsgHtml('mimetype') . wfElement('input', array('type' => 'text', 'size' => 20, 'name' => 'mime', 'value' => $mime), '') . ' ' . wfElement('input', array('type' => 'submit', 'value' => wfMsg('ilsubmit')), '') . wfCloseElement('label') . wfCloseElement('form'));
    list($major, $minor) = wfSpecialMIMEsearchParse($mime);
    if ($major == '' or $minor == '' or !wfSpecialMIMEsearchValidType($major)) {
        return;
    }
    $wpp = new MIMEsearchPage($major, $minor);
    list($limit, $offset) = wfCheckLimits();
    $wpp->doQuery($offset, $limit);
}
开发者ID:negabaro,项目名称:alfresco,代码行数:16,代码来源:SpecialMIMEsearch.php


示例4: showRequestForm

 /**
  * Show a nice form for the user to request a confirmation mail
  */
 function showRequestForm()
 {
     global $wgOut, $wgUser, $wgLang, $wgRequest;
     if ($wgRequest->wasPosted() && $wgUser->matchEditToken($wgRequest->getText('token'))) {
         $ok = $wgUser->sendConfirmationMail();
         $message = WikiError::isError($ok) ? 'confirmemail_sendfailed' : 'confirmemail_sent';
         $wgOut->addWikiText(wfMsg($message));
     } else {
         if ($wgUser->isEmailConfirmed()) {
             $time = $wgLang->timeAndDate($wgUser->mEmailAuthenticated, true);
             $wgOut->addWikiText(wfMsg('emailauthenticated', $time));
         }
         $wgOut->addWikiText(wfMsg('confirmemail_text'));
         $self = Title::makeTitle(NS_SPECIAL, 'Confirmemail');
         $form = wfOpenElement('form', array('method' => 'post', 'action' => $self->getLocalUrl()));
         $form .= wfHidden('token', $wgUser->editToken());
         $form .= wfSubmitButton(wfMsgHtml('confirmemail_send'));
         $form .= wfCloseElement('form');
         $wgOut->addHtml($form);
     }
 }
开发者ID:k-hasan-19,项目名称:wiki,代码行数:24,代码来源:SpecialConfirmemail.php


示例5: blockedPage

 /**
  * Call the stock "user is blocked" page
  */
 function blockedPage()
 {
     global $wgOut, $wgUser;
     $wgOut->blockedPage(false);
     # Standard block notice on the top, don't 'return'
     # If the user made changes, preserve them when showing the markup
     # (This happens when a user is blocked during edit, for instance)
     $first = $this->firsttime || !$this->save && $this->textbox1 == '';
     if ($first) {
         $source = $this->mTitle->exists() ? $this->getContent() : false;
     } else {
         $source = $this->textbox1;
     }
     # Spit out the source or the user's modified version
     if ($source !== false) {
         $rows = $wgUser->getOption('rows');
         $cols = $wgUser->getOption('cols');
         $attribs = array('id' => 'wpTextbox1', 'name' => 'wpTextbox1', 'cols' => $cols, 'rows' => $rows, 'readonly' => 'readonly');
         $wgOut->addHtml('<hr />');
         $wgOut->addWikiText(wfMsg($first ? 'blockedoriginalsource' : 'blockededitsource', $this->mTitle->getPrefixedText()));
         $wgOut->addHtml(wfOpenElement('textarea', $attribs) . htmlspecialchars($source) . wfCloseElement('textarea'));
     }
 }
开发者ID:puring0815,项目名称:OpenKore,代码行数:26,代码来源:EditPage.php


示例6: renderNode

 /**
  * Returns a string with a HTML represenation of the given page.
  * $title must be a Title object
  */
 function renderNode(&$title, $mode = NULL, $children = false, $loadchildren = false, $depth = 1)
 {
     global $wgCategoryTreeOmitNamespace, $wgCategoryTreeDefaultMode;
     static $uniq = 0;
     if ($mode === NULL) {
         $wgCategoryTreeDefaultMode;
     }
     $load = false;
     if ($children && $loadchildren) {
         $uniq += 1;
         $load = 'ct-' . $uniq . '-' . mt_rand(1, 100000);
         $children = false;
     }
     $ns = $title->getNamespace();
     $key = $title->getDBkey();
     #$trans = $title->getLocalizedText();
     $trans = '';
     #place holder for when translated titles are available
     #when showing only categories, omit namespace in label unless we explicitely defined the configuration setting
     #patch contributed by Manuel Schneider <[email protected]>, Bug 8011
     if ($wgCategoryTreeOmitNamespace || $mode == CT_MODE_CATEGORIES) {
         $label = htmlspecialchars($title->getText());
     } else {
         $label = htmlspecialchars($title->getPrefixedText());
     }
     if ($trans && $trans != $label) {
         $label .= ' ' . wfElement('i', array('class' => 'translation'), $trans);
     }
     $wikiLink = $title->getLocalURL();
     $labelClass = 'CategoryTreeLabel ' . ' CategoryTreeLabelNs' . $ns;
     if ($ns == NS_CATEGORY) {
         $labelClass .= ' CategoryTreeLabelCategory';
     } else {
         $labelClass .= ' CategoryTreeLabelPage';
     }
     if ($ns % 2 > 0) {
         $labelClass .= ' CategoryTreeLabelTalk';
     }
     $linkattr = array('href' => '#');
     if ($load) {
         $linkattr['id'] = $load;
     }
     if (!$children) {
         $txt = '+';
         $linkattr['onclick'] = "this.href='javascript:void(0)'; categoryTreeExpandNode('" . Xml::escapeJsString($key) . "','" . $mode . "',this);";
         # Don't load this message for ajax requests, so that we don't have to initialise $wgLang
         $linkattr['title'] = $this->mIsAjaxRequest ? '##LOAD##' : self::msg('expand');
     } else {
         $txt = '–';
         #NOTE: that's not a minus but a unicode ndash!
         $linkattr['onclick'] = "this.href='javascript:void(0)'; categoryTreeCollapseNode('" . Xml::escapeJsString($key) . "','" . $mode . "',this);";
         $linkattr['title'] = self::msg('collapse');
         $linkattr['class'] = 'CategoryTreeLoaded';
     }
     $s = '';
     #NOTE: things in CategoryTree.js rely on the exact order of tags!
     #      Specifically, the CategoryTreeChildren div must be the first
     #      sibling with nodeName = DIV of the grandparent of the expland link.
     $s .= wfOpenElement('div', array('class' => 'CategoryTreeSection'));
     $s .= wfOpenElement('div', array('class' => 'CategoryTreeItem'));
     if ($ns == NS_CATEGORY) {
         $s .= wfOpenElement('span', array('class' => 'CategoryTreeBullet'));
         $s .= '[' . wfElement('a', $linkattr, $txt) . '] ';
         $s .= wfCloseElement('span');
     } else {
         $s .= ' ';
     }
     $s .= wfOpenElement('a', array('class' => $labelClass, 'href' => $wikiLink)) . $label . wfCloseElement('a');
     $s .= wfCloseElement('div');
     $s .= "\n\t\t";
     $s .= wfOpenElement('div', array('class' => 'CategoryTreeChildren', 'style' => $children ? "display:block" : "display:none"));
     //HACK here?
     if ($children) {
         $s .= $this->renderChildren($title, $mode, $depth);
     }
     $s .= wfCloseElement('div');
     $s .= wfCloseElement('div');
     if ($load) {
         $s .= "\n\t\t";
         $s .= wfOpenElement('script', array('type' => 'text/javascript'));
         $s .= 'categoryTreeExpandNode("' . Xml::escapeJsString($key) . '", "' . $mode . '", document.getElementById("' . $load . '") );';
         $s .= wfCloseElement('script');
     }
     $s .= "\n\t\t";
     return $s;
 }
开发者ID:BackupTheBerlios,项目名称:shoutwiki-svn,代码行数:90,代码来源:CategoryTreeFunctions.php


示例7: getPageHeader

 /**
  * Show a drop down list to select a group as well as a user name
  * search box.
  * @todo localize
  */
 function getPageHeader()
 {
     $self = $this->getTitle();
     # Form tag
     $out = wfOpenElement('form', array('method' => 'post', 'action' => $self->getLocalUrl()));
     # Group drop-down list
     $out .= wfElement('label', array('for' => 'group'), wfMsg('group')) . ' ';
     $out .= wfOpenElement('select', array('name' => 'group'));
     $out .= wfElement('option', array('value' => ''), wfMsg('group-all'));
     # Item for "all groups"
     $groups = User::getAllGroups();
     foreach ($groups as $group) {
         $attribs = array('value' => $group);
         if ($group == $this->requestedGroup) {
             $attribs['selected'] = 'selected';
         }
         $out .= wfElement('option', $attribs, User::getGroupName($group));
     }
     $out .= wfCloseElement('select') . ' ';
     # . wfElement( 'br' );
     # Username field
     $out .= wfElement('label', array('for' => 'username'), wfMsg('specialloguserlabel')) . ' ';
     $out .= wfElement('input', array('type' => 'text', 'id' => 'username', 'name' => 'username', 'value' => $this->requestedUser)) . ' ';
     # Preserve offset and limit
     if ($this->offset) {
         $out .= wfElement('input', array('type' => 'hidden', 'name' => 'offset', 'value' => $this->offset));
     }
     if ($this->limit) {
         $out .= wfElement('input', array('type' => 'hidden', 'name' => 'limit', 'value' => $this->limit));
     }
     # Submit button and form bottom
     $out .= wfElement('input', array('type' => 'submit', 'value' => wfMsg('allpagessubmit')));
     $out .= wfCloseElement('form');
     return $out;
 }
开发者ID:k-hasan-19,项目名称:wiki,代码行数:40,代码来源:SpecialListusers.php


示例8: wlHandleClear

/**
 * Allow the user to clear their watchlist
 *
 * @param $out Output object
 * @param $request Request object
 * @param $par Parameters passed to the watchlist page
 * @return bool True if it's been taken care of; false indicates the watchlist
 * 				code needs to do something further
 */
function wlHandleClear(&$out, &$request, $par)
{
    # Check this function has something to do
    if ($request->getText('action') == 'clear' || $par == 'clear') {
        global $wgUser;
        $out->setPageTitle(wfMsgHtml('clearwatchlist'));
        $count = wlCountItems($wgUser);
        if ($count > 0) {
            # See if we're clearing or confirming
            if ($request->wasPosted() && $wgUser->matchEditToken($request->getText('token'), 'clearwatchlist')) {
                # Clearing, so do it and report the result
                $dbw =& wfGetDB(DB_MASTER);
                // WERELATE - don't remove pages in your trees; call WatchedItem::removeWatch
                // $dbw->delete( 'watchlist', array( 'wl_user' => $wgUser->mId ), 'wlHandleClear' );
                $sql = 'SELECT wl_namespace, wl_title FROM watchlist where wl_user=' . $dbw->addQuotes($wgUser->mId) . ' AND NOT EXISTS (SELECT fp_tree_id FROM familytree_page WHERE fp_namespace=(wl_namespace & ~1) AND fp_title=wl_title AND fp_user_id=wl_user)';
                $rows = $dbw->query($sql, 'wlHandleClear');
                while ($row = $dbw->fetchObject($rows)) {
                    $title = Title::makeTitle($row->wl_namespace, $row->wl_title);
                    if ($title) {
                        $wl = WatchedItem::fromUserTitle($wgUser, $title);
                        $wl->removeWatch();
                    }
                }
                $dbw->freeResult($rows);
                $out->addWikiText(wfMsg('watchlistcleardone', $count));
                $out->returnToMain();
            } else {
                # Confirming, so show a form
                $wlTitle = Title::makeTitle(NS_SPECIAL, 'Watchlist');
                $out->addHTML(wfElement('form', array('method' => 'post', 'action' => $wlTitle->getLocalUrl('action=clear')), NULL));
                $out->addWikiText(wfMsg('watchlistcount', $count));
                $out->addWikiText(wfMsg('watchlistcleartext'));
                $out->addHTML(wfElement('input', array('type' => 'hidden', 'name' => 'token', 'value' => $wgUser->editToken('clearwatchlist')), ''));
                $out->addHTML(wfElement('input', array('type' => 'submit', 'name' => 'submit', 'value' => wfMsgHtml('watchlistclearbutton')), ''));
                $out->addHTML(wfCloseElement('form'));
            }
            return true;
        } else {
            # Nothing on the watchlist; nothing to do here
            $out->addWikiText(wfMsg('nowatchlist'));
            $out->returnToMain();
            return true;
        }
    } else {
        return false;
    }
}
开发者ID:k-hasan-19,项目名称:wiki,代码行数:56,代码来源:SpecialWatchlist.php


示例9: recXmlPrint

 /**
  * This method takes an array and converts it into an xml.
  * There are several noteworthy cases:
  *
  *  If array contains a key '_element', then the code assumes that ALL other keys are not important and replaces them with the value['_element'].
  *	Example:	name='root',  value = array( '_element'=>'page', 'x', 'y', 'z') creates <root>  <page>x</page>  <page>y</page>  <page>z</page> </root>
  *
  *  If any of the array's element key is '*', then the code treats all other key->value pairs as attributes, and the value['*'] as the element's content.
  *	Example:	name='root',  value = array( '*'=>'text', 'lang'=>'en', 'id'=>10)   creates  <root lang='en' id='10'>text</root>
  *
  * If neither key is found, all keys become element names, and values become element content.
  * The method is recursive, so the same rules apply to any sub-arrays.
  */
 function recXmlPrint($elemName, $elemValue, $indent)
 {
     if (!is_null($indent)) {
         $indent += 2;
         $indstr = "\n" . str_repeat(" ", $indent);
     } else {
         $indstr = '';
     }
     switch (gettype($elemValue)) {
         case 'array':
             if (isset($elemValue['*'])) {
                 $subElemContent = $elemValue['*'];
                 unset($elemValue['*']);
             } else {
                 $subElemContent = null;
             }
             if (isset($elemValue['_element'])) {
                 $subElemIndName = $elemValue['_element'];
                 unset($elemValue['_element']);
             } else {
                 $subElemIndName = null;
             }
             $indElements = array();
             $subElements = array();
             foreach ($elemValue as $subElemId => &$subElemValue) {
                 if (gettype($subElemId) === 'integer') {
                     $indElements[] = $subElemValue;
                     unset($elemValue[$subElemId]);
                 } elseif (is_array($subElemValue)) {
                     $subElements[$subElemId] = $subElemValue;
                     unset($elemValue[$subElemId]);
                 }
             }
             if (is_null($subElemIndName) && !empty($indElements)) {
                 ApiBase::dieDebug(__METHOD__, "({$elemName}, ...) has integer keys without _element value. Use ApiResult::setIndexedTagName().");
             }
             if (!empty($subElements) && !empty($indElements) && !is_null($subElemContent)) {
                 ApiBase::dieDebug(__METHOD__, "({$elemName}, ...) has content and subelements");
             }
             if (!is_null($subElemContent)) {
                 $this->printText($indstr . wfElement($elemName, $elemValue, $subElemContent));
             } elseif (empty($indElements) && empty($subElements)) {
                 $this->printText($indstr . wfElement($elemName, $elemValue));
             } else {
                 $this->printText($indstr . wfElement($elemName, $elemValue, null));
                 foreach ($subElements as $subElemId => &$subElemValue) {
                     $this->recXmlPrint($subElemId, $subElemValue, $indent);
                 }
                 foreach ($indElements as $subElemId => &$subElemValue) {
                     $this->recXmlPrint($subElemIndName, $subElemValue, $indent);
                 }
                 $this->printText($indstr . wfCloseElement($elemName));
             }
             break;
         case 'object':
             // ignore
             break;
         default:
             $this->printText($indstr . wfElement($elemName, null, $elemValue));
             break;
     }
 }
开发者ID:mediawiki-extensions,项目名称:bizzwiki,代码行数:75,代码来源:ApiFormatXml.php


示例10: getPageHeader

 /**
  * Show a namespace selection form for filtering
  *
  * @return string
  */
 function getPageHeader()
 {
     $thisTitle = Title::makeTitle(NS_SPECIAL, $this->getName());
     $form = wfOpenElement('form', array('method' => 'post', 'action' => $thisTitle->getLocalUrl()));
     $form .= wfElement('label', array('for' => 'namespace'), wfMsg('namespace')) . ' ';
     $form .= HtmlNamespaceSelector($this->namespace);
     # Preserve the offset and limit
     $form .= wfElement('input', array('type' => 'hidden', 'name' => 'offset', 'value' => $this->offset));
     $form .= wfElement('input', array('type' => 'hidden', 'name' => 'limit', 'value' => $this->limit));
     $form .= wfElement('input', array('type' => 'submit', 'name' => 'submit', 'id' => 'submit', 'value' => wfMsg('allpagessubmit')));
     $form .= wfCloseElement('form');
     return $form;
 }
开发者ID:k-hasan-19,项目名称:wiki,代码行数:18,代码来源:SpecialNewpages.php


示例11: showRevision

 function showRevision($timestamp)
 {
     global $wgLang, $wgUser, $wgOut;
     $self = SpecialPage::getTitleFor('Undelete');
     $skin = $wgUser->getSkin();
     if (!preg_match("/[0-9]{14}/", $timestamp)) {
         return 0;
     }
     $archive = new PageArchive($this->mTargetObj);
     $rev = $archive->getRevision($timestamp);
     if (!$rev) {
         $wgOut->addWikiMsg('undeleterevision-missing');
         return;
     }
     $wgOut->setPageTitle(wfMsg('undeletepage'));
     $link = $skin->makeKnownLinkObj(SpecialPage::getTitleFor('Undelete', $this->mTargetObj->getPrefixedDBkey()), htmlspecialchars($this->mTargetObj->getPrefixedText()));
     $time = htmlspecialchars($wgLang->timeAndDate($timestamp, true));
     $user = $skin->userLink($rev->getUser(), $rev->getUserText()) . $skin->userToolLinks($rev->getUser(), $rev->getUserText());
     if ($this->mDiff) {
         $previousRev = $archive->getPreviousRevision($timestamp);
         if ($previousRev) {
             $this->showDiff($previousRev, $rev);
             if ($wgUser->getOption('diffonly')) {
                 return;
             } else {
                 $wgOut->addHtml('<hr />');
             }
         } else {
             $wgOut->addHtml(wfMsgHtml('undelete-nodiff'));
         }
     }
     $wgOut->addHtml('<p>' . wfMsgHtml('undelete-revision', $link, $time, $user) . '</p>');
     wfRunHooks('UndeleteShowRevision', array($this->mTargetObj, $rev));
     if ($this->mPreview) {
         $wgOut->addHtml("<hr />\n");
         $wgOut->addWikiTextTitleTidy($rev->getText(), $this->mTargetObj, false);
     }
     $wgOut->addHtml(wfElement('textarea', array('readonly' => 'readonly', 'cols' => intval($wgUser->getOption('cols')), 'rows' => intval($wgUser->getOption('rows'))), $rev->getText() . "\n") . wfOpenElement('div') . wfOpenElement('form', array('method' => 'post', 'action' => $self->getLocalURL("action=submit"))) . wfElement('input', array('type' => 'hidden', 'name' => 'target', 'value' => $this->mTargetObj->getPrefixedDbKey())) . wfElement('input', array('type' => 'hidden', 'name' => 'timestamp', 'value' => $timestamp)) . wfElement('input', array('type' => 'hidden', 'name' => 'wpEditToken', 'value' => $wgUser->editToken())) . wfElement('input', array('type' => 'submit', 'name' => 'preview', 'value' => wfMsg('showpreview'))) . wfElement('input', array('name' => 'diff', 'type' => 'submit', 'value' => wfMsg('showdiff'))) . wfCloseElement('form') . wfCloseElement('div'));
 }
开发者ID:BackupTheBerlios,项目名称:shoutwiki-svn,代码行数:39,代码来源:SpecialUndelete.php


示例12: execute

 function execute()
 {
     global $wgOut, $wgTitle;
     $wgOut->addHTML(wfElement('form', array('id' => 'specialcite', 'method' => 'get', 'action' => $wgTitle->escapeLocalUrl()), null) . wfOpenElement('label') . wfMsgHtml('cite_page') . ' ' . wfElement('input', array('type' => 'text', 'size' => 20, 'name' => 'page', 'value' => is_object($this->mTitle) ? $this->mTitle->getPrefixedText() : ''), '') . ' ' . wfElement('input', array('type' => 'submit', 'value' => wfMsgHtml('cite_submit')), '') . wfCloseElement('label') . wfCloseElement('form'));
 }
开发者ID:BackupTheBerlios,项目名称:shoutwiki-svn,代码行数:5,代码来源:SpecialCite_body.php


示例13: makeInputForm

 /**
  * Input form for entering a category
  */
 function makeInputForm()
 {
     global $wgScript;
     $thisTitle = Title::makeTitle(NS_SPECIAL, $this->getName());
     $form = '';
     $form .= wfOpenElement('form', array('name' => 'categorytree', 'method' => 'get', 'action' => $wgScript));
     $form .= wfElement('input', array('type' => 'hidden', 'name' => 'title', 'value' => $thisTitle->getPrefixedDbKey()));
     $form .= wfElement('label', array('for' => 'target'), wfMsg('categorytree-category')) . ' ';
     $form .= wfElement('input', array('type' => 'text', 'name' => 'target', 'id' => 'target', 'value' => $this->target)) . ' ';
     $form .= wfOpenElement('select', array('name' => 'mode'));
     $form .= wfElement('option', array('value' => 'categories') + ($this->mode == CT_MODE_CATEGORIES ? array('selected' => 'selected') : array()), wfMsg('categorytree-mode-categories'));
     $form .= wfElement('option', array('value' => 'pages') + ($this->mode == CT_MODE_PAGES ? array('selected' => 'selected') : array()), wfMsg('categorytree-mode-pages'));
     $form .= wfElement('option', array('value' => 'all') + ($this->mode == CT_MODE_ALL ? array('selected' => 'selected') : array()), wfMsg('categorytree-mode-all'));
     $form .= wfCloseElement('select');
     $form .= wfElement('input', array('type' => 'submit', 'name' => 'dotree', 'value' => wfMsg('categorytree-go')));
     $form .= wfCloseElement('form');
     return $form;
 }
开发者ID:BackupTheBerlios,项目名称:shoutwiki-svn,代码行数:21,代码来源:CategoryTreePage.php


示例14: getPageHeader

 /**
  * Show a namespace selection form for filtering
  *
  * @return string
  */
 function getPageHeader()
 {
     $thisTitle = Title::makeTitle(NS_SPECIAL, $this->getName());
     $form = wfOpenElement('form', array('method' => 'get', 'action' => $thisTitle->getLocalUrl()));
     $form .= wfElement('label', array('for' => 'status'), 'Status') . ' ';
     $form .= StructuredData::addSelectToHtml(0, 'status', self::$STATUS_OPTIONS, $this->status, '', false);
     # Preserve the offset and limit
     $form .= wfElement('input', array('type' => 'hidden', 'name' => 'offset', 'value' => $this->offset));
     $form .= wfElement('input', array('type' => 'hidden', 'name' => 'limit', 'value' => $this->limit));
     $form .= wfElement('input', array('type' => 'submit', 'name' => 'submit', 'id' => 'submit', 'value' => wfMsg('allpagessubmit')));
     $form .= wfCloseElement('form');
     return $form;
 }
开发者ID:k-hasan-19,项目名称:wiki,代码行数:18,代码来源:SpecialGedcoms.php


示例15: showRevision

 function showRevision($timestamp)
 {
     global $wgLang, $wgUser, $wgOut;
     if (!preg_match("/[0-9]{14}/", $timestamp)) {
         return 0;
     }
     $archive = new PageArchive($this->mTargetObj);
     $rev = $archive->getRevision($timestamp);
     $wgOut->setPagetitle(wfMsg("undeletepage"));
     $wgOut->addWikiText("(" . wfMsg("undeleterevision", $wgLang->timeAndDate($timestamp)) . ")\n");
     if (!$rev) {
         $wgOut->addWikiText(wfMsg('undeleterevision-missing'));
         return;
     }
     wfRunHooks('UndeleteShowRevision', array($this->mTargetObj, $rev));
     if ($this->mPreview) {
         $wgOut->addHtml("<hr />\n");
         $article = new Article($archive->title);
         # OutputPage wants an Article obj
         $wgOut->addPrimaryWikiText($rev->getText(), $article, false);
     }
     $self = SpecialPage::getTitleFor("Undelete");
     $wgOut->addHtml(wfElement('textarea', array('readonly' => true, 'cols' => intval($wgUser->getOption('cols')), 'rows' => intval($wgUser->getOption('rows'))), $rev->getText() . "\n") . wfOpenElement('div') . wfOpenElement('form', array('method' => 'post', 'action' => $self->getLocalURL("action=submit"))) . wfElement('input', array('type' => 'hidden', 'name' => 'target', 'value' => $this->mTargetObj->getPrefixedDbKey())) . wfElement('input', array('type' => 'hidden', 'name' => 'timestamp', 'value' => $timestamp)) . wfElement('input', array('type' => 'hidden', 'name' => 'wpEditToken', 'value' => $wgUser->editToken())) . wfElement('input', array('type' => 'hidden', 'name' => 'preview', 'value' => '1')) . wfElement('input', array('type' => 'submit', 'value' => wfMsg('showpreview'))) . wfCloseElement('form') . wfCloseElement('div'));
 }
开发者ID:negabaro,项目名称:alfresco,代码行数:24,代码来源:SpecialUndelete.php


示例16: extensionCredits

 /** Generate wikitext showing extensions name, URL, author and description */
 function extensionCredits()
 {
     global $wgExtensionCredits, $wgExtensionFunctions, $wgParser, $wgSkinExtensionFunction;
     if (!count($wgExtensionCredits) && !count($wgExtensionFunctions) && !count($wgSkinExtensionFunction)) {
         return '';
     }
     $extensionTypes = array('specialpage' => 'Special pages', 'parserhook' => 'Parser hooks', 'variable' => 'Variables', 'other' => 'Other');
     wfRunHooks('SpecialVersionExtensionTypes', array(&$this, &$extensionTypes));
     $out = "<h2>Extensions</h2>\n";
     $out .= wfOpenElement('table', array('id' => 'sv-ext'));
     foreach ($extensionTypes as $type => $text) {
         if (count(@$wgExtensionCredits[$type])) {
             $out .= $this->openExtType($text);
             usort($wgExtensionCredits[$type], array($this, 'compare'));
             foreach ($wgExtensionCredits[$type] as $extension) {
                 wfSuppressWarnings();
                 $out .= $this->formatCredits($extension['name'], $extension['version'], $extension['author'], $extension['url'], $extension['description']);
                 wfRestoreWarnings();
             }
         }
     }
     if (count($wgExtensionFunctions)) {
         $out .= $this->openExtType('Extension functions');
         $out .= '<tr><td colspan="3">' . $this->listToText($wgExtensionFunctions) . "</td></tr>\n";
     }
     if ($cnt = count($tags = $wgParser->getTags())) {
         for ($i = 0; $i < $cnt; ++$i) {
             $tags[$i] = "&lt;{$tags[$i]}&gt;";
         }
         $out .= $this->openExtType('Parser extension tags');
         $out .= '<tr><td colspan="3">' . $this->listToText($tags) . "</td></tr>\n";
     }
     if ($cnt = count($fhooks = $wgParser->getFunctionHooks())) {
         $out .= $this->openExtType('Parser function hooks');
         $out .= '<tr><td colspan="3">' . $this->listToText($fhooks) . "</td></tr>\n";
     }
     if (count($wgSkinExtensionFunction)) {
         $out .= $this->openExtType('Skin extension functions');
         $out .= '<tr><td colspan="3">' . $this->listToText($wgSkinExtensionFunction) . "</td></tr>\n";
     }
     $out .= wfCloseElement('table');
     return $out;
 }
开发者ID:negabaro,项目名称:alfresco,代码行数:44,代码来源:SpecialVersion.php


示例17: execute

 function execute()
 {
     global $wgOut, $wgTitle, $wgScript;
     $wgOut->addHTML(wfElement('form', array('id' => 'specialfilepath', 'method' => 'get', 'action' => $wgScript), null) . wfHidden('title', $wgTitle->getPrefixedText()) . wfOpenElement('label') . wfMsgHtml('filepath-page') . ' ' . wfElement('input', array('type' => 'text', 'size' => 25, 'name' => 'file', 'value' => is_object($this->mTitle) ? $this->mTitle->getText() : ''), '') . ' ' . wfElement('input', array('type' => 'submit', 'value' => wfMsgHtml('filepath-submit')), '') . wfCloseElement('label') . wfCloseElement('form'));
 }
开发者ID:BackupTheBerlios,项目名称:shoutwiki-svn,代码行数:5,代码来源:SpecialFilepath.php


示例18: readOnlyPage

 /**
  * Display a page stating that the Wiki is in read-only mode,
  * and optionally show the source of the page that the user
  * was trying to edit.  Should only be called (for this
  * purpose) after wfReadOnly() has returned true.
  *
  * For historical reasons, this function is _also_ used to
  * show the error message when a user tries to edit a page
  * they are not allowed to edit.  (Unless it's because they're
  * blocked, then we show blockedPage() instead.)  In this
  * case, the second parameter should be set to true and a list
  * of reasons supplied as the third parameter.
  *
  * @todo Needs to be split into multiple functions.
  *
  * @param string $source    Source code to show (or null).
  * @param bool   $protected Is this a permissions error?
  * @param array  $reasons   List of reasons for this error, as returned by Title::getUserPermissionsErrors().
  */
 public function readOnlyPage($source = null, $protected = false, $reasons = array())
 {
     global $wgUser, $wgReadOnlyFile, $wgReadOnly, $wgTitle;
     $skin = $wgUser->getSkin();
     $this->setRobotpolicy('noindex,nofollow');
     $this->setArticleRelated(false);
     // If no reason is given, just supply a default "I can't let you do
     // that, Dave" message.  Should only occur if called by legacy code.
     if ($protected && empty($reasons)) {
         $reasons[] = array('badaccess-group0');
     }
     if (!empty($reasons)) {
         // Permissions error
         if ($source) {
             $this->setPageTitle(wfMsg('viewsource'));
             $this->setSubtitle(wfMsg('viewsourcefor', $skin->makeKnownLinkObj($wgTitle)));
         } else {
             $this->setPageTitle(wfMsg('badaccess'));
         }
         $this->addWikiText($this->formatPermissionsErrorMessage($reasons));
     } else {
         // Wiki is read only
         $this->setPageTitle(wfMsg('readonly'));
         if ($wgReadOnly) {
             $reason = $wgReadOnly;
         } else {
             // Should not happen, user should have called wfReadOnly() first
             $reason = file_get_contents($wgReadOnlyFile);
         }
         $this->addWikiMsg('readonlytext', $reason);
     }
     // Show source, if supplied
     if (is_string($source)) {
         $this->addWikiMsg('viewsourcetext');
         $text = wfOpenElement('textarea', array('id' => 'wpTextbox1', 'name' => 'wpTextbox1', 'cols' => $wgUser->getOption('cols'), 'rows' => $wgUser->getOption('rows'), 'readonly' => 'readonly'));
         $text .= htmlspecialchars($source);
         $text .= wfCloseElement('textarea');
         $this->addHTML($text);
         // Show templates used by this article
         $skin = $wgUser->getSkin();
         $article = new Article($wgTitle);
         $this->addHTML($skin->formatTemplates($article->getUsedTemplates()));
     }
     # If the title doesn't exist, it's fairly pointless to print a return
     # link to it.  After all, you just tried editing it and couldn't, so
     # what's there to do there?
     if ($wgTitle->exists()) {
         $this->returnToMain(false, $wgTitle);
     }
 }
开发者ID:BackupTheBerlios,项目名称:shoutwiki-svn,代码行数:69,代码来源:OutputPage.php


示例19: showRevision

 function showRevision($timestamp)
 {
     global $wgLang, $wgUser, $wgOut;
     if (!preg_match("/[0-9]{14}/", $timestamp)) {
         return 0;
     }
     $archive = new PageArchive($this->mTargetObj);
     $text = $archive->getRevisionText($timestamp);
     $wgOut->setPagetitle(wfMsg("undeletepage"));
     $wgOut->addWikiText("(" . wfMsg("undeleterevision", $wgLang->date($timestamp)) . ")\n");
     if ($this->mPreview) {
         $wgOut->addHtml("<hr />\n");
         $wgOut->addWikiText($text);
     }
     $self = Title::makeTitle(NS_SPECIAL, "Undelete");
     $wgOut->addHtml(wfElement('textarea', array('readonly' => true, 'cols' => intval($wgUser->getOption('cols')), 'rows' => intval($wgUser->getOption('rows'))), $text . "\n") . wfOpenElement('div') . wfOpenElement('form', array('method' => 'post', 'action' => $self->getLocalURL("action=submit"))) . wfElement('input', array('type' => 'hidden', 'name' => 'target', 'value' => $this->mTargetObj->getPrefixedDbKey())) . wfElement('input', array('type' => 'hidden', 'name' => 'timestamp', 'value' => $timestamp)) . wfElement('input', array('type' => 'hidden', 'name' => 'wpEditToken', 'value' => $wgUser->editToken())) . wfElement('input', array('type' => 'hidden', 'name' => 'preview', 'value' => '1')) . wfElement('input', array('type' => 'submit', 'value' => wfMsg('showpreview'))) . wfCloseElement('form') . wfCloseElement('div'));
 }
开发者ID:puring0815,项目名称:OpenKore,代码行数:17,代码来源:SpecialUndelete.php


示例20: createCheckboxes

 /**
  * Make the big table of radio buttons and permissions
  * @param form the form that it is adding the radio buttons to.
  * @param getcurrentvalues is used for determining if it should set the radio buttons at the current permissions
  */
 function createCheckboxes(&$form, $getcurrentvalues)
 {
     global $wgGroupPermissions;
     if ($getcurrentvalues) {
         //let's extract the appropriate array of values from GroupPermissions once so we don't have to put it in the foreach
         foreach ($wgGroupPermissions as $group => $permissions) {
             if ($group == $this->target) {
                 $evGroupPermissions = $permissions;
                 break;
             }
         }
     }
     foreach ($this->permissionslist as $right) {
         if ($getcurrentvalues) {
             foreach ($evGroupPermissions as $permission => $value) {
                 $bool = in_array($right, array_keys($evGroupPermissions));
                 if ($right == $permission || !$bool) {
                     $form .= wfOpenElement('tr') . wfOpenElement('td') . "{$right}: " . wfCloseElement('td');
                     $form .= wfOpenElement('td') . wfElement('label', array('for' => "{$right}-true"), wfMsg('grouppermissions-true')) . ' ';
                     if ($value == 1 && $bool) {
                         //right is set to true
                         $form .= $this->makeRadio( 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP wfCountDown函数代码示例发布时间:2022-05-23
下一篇:
PHP wfClientAcceptsGzip函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap