本文整理汇总了PHP中wfOpenElement函数的典型用法代码示例。如果您正苦于以下问题:PHP wfOpenElement函数的具体用法?PHP wfOpenElement怎么用?PHP wfOpenElement使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wfOpenElement函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: 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
示例2: 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
示例3: 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
示例4: PoemExtension
function PoemExtension($in, $param = array(), $parser = null)
{
/* using newlines in the text will cause the parser to add <p> tags,
* which may not be desired in some cases
*/
$nl = $param['compact'] ? '' : "\n";
if (method_exists($parser, 'recursiveTagParse')) {
//new methods in 1.8 allow nesting <nowiki> in <poem>.
$tag = $parser->insertStripItem("<br />", $parser->mStripState);
$text = preg_replace(array("/^\n/", "/\n\$/D", "/\n/", "/^( +)/me"), array("", "", "{$tag}{$nl}", "str_replace(' ',' ','\\1')"), $in);
$text = $parser->recursiveTagParse($text);
} else {
$text = preg_replace(array("/^\n/", "/\n\$/D", "/\n/", "/^( +)/me"), array("", "", "<br />{$nl}", "str_replace(' ',' ','\\1')"), $in);
$ret = $parser->parse($text, $parser->getTitle(), $parser->getOptions(), true, false);
$text = $ret->getText();
}
global $wgVersion;
if (version_compare($wgVersion, "1.7alpha") >= 0) {
// Pass HTML attributes through to the output.
$attribs = Sanitizer::validateTagAttributes($param, 'div');
} else {
// Can't guarantee safety on 1.6 or older.
$attribs = array();
}
// Wrap output in a <div> with "poem" class.
if (isset($attribs['class'])) {
$attribs['class'] = 'poem ' . $attribs['class'];
} else {
$attribs['class'] = 'poem';
}
return wfOpenElement('div', $attribs) . $nl . trim($text) . "{$nl}</div>";
}
开发者ID:BackupTheBerlios,项目名称:shoutwiki-svn,代码行数:32,代码来源:Poem.php
示例5: 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
示例6: 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
示例7: 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
示例8: 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
示例9: renderPreTag
/**
* Tag hook handler for 'pre'.
*/
function renderPreTag($text, $attribs)
{
// Backwards-compatibility hack
$content = StringUtils::delimiterReplace('<nowiki>', '</nowiki>', '$1', $text, 'i');
$attribs = Sanitizer::validateTagAttributes($attribs, 'pre');
return wfOpenElement('pre', $attribs) . Xml::escapeTagsOnly($content) . '</pre>';
}
开发者ID:renemilk,项目名称:spring-website,代码行数:10,代码来源:Parser.php
示例10: getPageHeader
/**
* Show a form for filtering namespace and username
*
* @return string
*/
function getPageHeader()
{
$self = Title::makeTitle(NS_SPECIAL, $this->getName());
$form = wfOpenElement('form', array('method' => 'post', 'action' => $self->getLocalUrl()));
$form .= '<table><tr><td align="right">' . wfMsgHtml('namespace') . '</td>';
$form .= '<td>' . HtmlNamespaceSelector($this->namespace) . '</td><tr>';
$form .= '<tr><td align="right">' . wfMsgHtml('newpages-username') . '</td>';
$form .= '<td>' . wfInput('username', 30, $this->username) . '</td></tr>';
$form .= '<tr><td></td><td>' . wfSubmitButton(wfMsg('allpagessubmit')) . '</td></tr></table>';
$form .= wfHidden('offset', $this->offset) . wfHidden('limit', $this->limit) . '</form>';
return $form;
}
开发者ID:puring0815,项目名称:OpenKore,代码行数:17,代码来源:SpecialNewpages.php
示例11: 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
示例12: 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
示例13: showHistory
function showHistory()
{
global $wgLang, $wgUser, $wgOut;
$sk = $wgUser->getSkin();
if ($this->mAllowed) {
$wgOut->setPagetitle(wfMsg("undeletepage"));
} else {
$wgOut->setPagetitle(wfMsg('viewdeletedpage'));
}
$archive = new PageArchive($this->mTargetObj);
$text = $archive->getLastRevisionText();
/*
if( is_null( $text ) ) {
$wgOut->addWikiText( wfMsg( "nohistory" ) );
return;
}
*/
if ($this->mAllowed) {
$wgOut->addWikiText(wfMsg("undeletehistory"));
} else {
$wgOut->addWikiText(wfMsg("undeletehistorynoadmin"));
}
# List all stored revisions
$revisions = $archive->listRevisions();
$files = $archive->listFiles();
$haveRevisions = $revisions && $revisions->numRows() > 0;
$haveFiles = $files && $files->numRows() > 0;
# Batch existence check on user and talk pages
if ($haveRevisions) {
$batch = new LinkBatch();
while ($row = $revisions->fetchObject()) {
$batch->addObj(Title::makeTitleSafe(NS_USER, $row->ar_user_text));
$batch->addObj(Title::makeTitleSafe(NS_USER_TALK, $row->ar_user_text));
}
$batch->execute();
$revisions->seek(0);
}
if ($haveFiles) {
$batch = new LinkBatch();
while ($row = $files->fetchObject()) {
$batch->addObj(Title::makeTitleSafe(NS_USER, $row->fa_user_text));
$batch->addObj(Title::makeTitleSafe(NS_USER_TALK, $row->fa_user_text));
}
$batch->execute();
$files->seek(0);
}
if ($this->mAllowed) {
$titleObj = Title::makeTitle(NS_SPECIAL, "Undelete");
$action = $titleObj->getLocalURL("action=submit");
# Start the form here
$top = wfOpenElement('form', array('method' => 'post', 'action' => $action, 'id' => 'undelete'));
$wgOut->addHtml($top);
}
# Show relevant lines from the deletion log:
$wgOut->addHTML("<h2>" . htmlspecialchars(LogPage::logName('delete')) . "</h2>\n");
$logViewer = new LogViewer(new LogReader(new FauxRequest(array('page' => $this->mTargetObj->getPrefixedText(), 'type' => 'delete'))));
$logViewer->showList($wgOut);
if ($this->mAllowed && ($haveRevisions || $haveFiles)) {
# Format the user-visible controls (comment field, submission button)
# in a nice little table
$table = '<fieldset><table><tr>';
$table .= '<td colspan="2">' . wfMsgWikiHtml('undeleteextrahelp') . '</td></tr><tr>';
$table .= '<td align="right"><strong>' . wfMsgHtml('undeletecomment') . '</strong></td>';
$table .= '<td>' . wfInput('wpComment', 50, $this->mComment) . '</td>';
$table .= '</tr><tr><td> </td><td>';
$table .= wfSubmitButton(wfMsg('undeletebtn'), array('name' => 'restore'));
$table .= wfElement('input', array('type' => 'reset', 'value' => wfMsg('undeletereset')));
$table .= '</td></tr></table></fieldset>';
$wgOut->addHtml($table);
}
$wgOut->addHTML("<h2>" . htmlspecialchars(wfMsg("history")) . "</h2>\n");
if ($haveRevisions) {
# The page's stored (deleted) history:
$wgOut->addHTML("<ul>");
$target = urlencode($this->mTarget);
while ($row = $revisions->fetchObject()) {
$ts = wfTimestamp(TS_MW, $row->ar_timestamp);
if ($this->mAllowed) {
$checkBox = wfCheck("ts{$ts}");
$pageLink = $sk->makeKnownLinkObj($titleObj, $wgLang->timeanddate($ts, true), "target={$target}×tamp={$ts}");
} else {
$checkBox = '';
$pageLink = $wgLang->timeanddate($ts, true);
}
$userLink = $sk->userLink($row->ar_user, $row->ar_user_text) . $sk->userToolLinks($row->ar_user, $row->ar_user_text);
$comment = $sk->commentBlock($row->ar_comment);
$wgOut->addHTML("<li>{$checkBox} {$pageLink} . . {$userLink} {$comment}</li>\n");
}
$revisions->free();
$wgOut->addHTML("</ul>");
} else {
$wgOut->addWikiText(wfMsg("nohistory"));
}
if ($haveFiles) {
$wgOut->addHtml("<h2>" . wfMsgHtml('imghistory') . "</h2>\n");
$wgOut->addHtml("<ul>");
while ($row = $files->fetchObject()) {
$ts = wfTimestamp(TS_MW, $row->fa_timestamp);
if ($this->mAllowed && $row->fa_storage_key) {
$checkBox = wfCheck("fileid" . $row->fa_id);
//.........这里部分代码省略.........
开发者ID:puring0815,项目名称:OpenKore,代码行数:101,代码来源:SpecialUndelete.php
示例14: 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($right, 'true', true) . wfCloseElement('td');
} else {
$form .= $this->makeRadio($right, 'true') . wfCloseElement('td');
}
$form .= wfOpenElement('td') . wfElement('label', array('for' => "{$right}-false"), wfMsg('grouppermissions-false')) . ' ';
if ($value == 0 && $bool) {
//right is set to false
$form .= $this->makeRadio($right, 'false', true) . wfCloseElement('td');
} else {
$form .= $this->makeRadio($right, 'false') . wfCloseElement('td');
}
$form .= wfOpenElement('td') . wfElement('label', array('for' => "{$right}-inherit"), wfMsg('grouppermissions-inherit')) . ' ';
if (!$bool) {
//right isn't set, which means that it is inherited from other groups
$form .= $this->makeRadio($right, 'inherit', true) . wfCloseElement('td');
} else {
$form .= $this->makeRadio($right, 'inherit') . wfCloseElement('td');
}
$form .= wfCloseElement('tr');
break;
}
}
} else {
//just set it at inherit
$form .= wfOpenElement('tr') . wfOpenElement('td') . "{$right}: " . wfCloseElement('td');
$form .= wfOpenElement('td') . wfElement('label', array('for' => "{$right}-true"), wfMsg('grouppermissions-true')) . ' ';
$form .= $this->makeRadio($right, 'true') . wfCloseElement('td');
$form .= wfOpenElement('td') . wfElement('label', array('for' => "{$right}-false"), wfMsg('grouppermissions-false')) . ' ';
$form .= $this->makeRadio($right, 'false') . wfCloseElement('td');
$form .= wfOpenElement('td') . wfElement('label', array('for' => "{$right}-inherit"), wfMsg('grouppermissions-inherit')) . ' ';
$form .= $this->makeRadio($right, 'inherit', true);
$form .= wfCloseElement('td') . wfCloseElement('tr');
}
}
}
开发者ID:BackupTheBerlios,项目名称:shoutwiki-svn,代码行数:61,代码来源:GPManager.page.php
示例15: makeNamespaceForm
function makeNamespaceForm()
{
$self = Title::makeTitle(NS_SPECIAL, $this->getName());
$form = wfOpenElement('form', array('method' => 'post', 'action' => $self->getLocalUrl()));
$form .= wfLabel(wfMsg('newestpages-namespace'), 'namespace') . ' ';
$form .= htmlNamespaceSelector($this->namespace, 'all');
$form .= wfHidden('limit', $this->limit);
$form .= wfHidden('redirects', $this->redirects);
$form .= wfSubmitButton(wfMsg('newestpages-submit')) . '</form>';
return $form;
}
开发者ID:BackupTheBerlios,项目名称:shoutwiki-svn,代码行数:11,代码来源:NewestPages.page.php
示例16: 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
示例17: 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
示例18: wgHooks
/**
* @return string
*/
function wgHooks()
{
global $wgHooks;
if (count($wgHooks)) {
$myWgHooks = $wgHooks;
ksort($myWgHooks);
$ret = "<h2>Hooks</h2>\n" . wfOpenElement('table', array('id' => 'sv-hooks')) . "<tr><th>Hook name</th><th>Subscribed by</th></tr>\n";
foreach ($myWgHooks as $hook => $hooks) {
$ret .= "<tr><td>{$hook}</td><td>" . $this->listToText($hooks) . "</td></tr>\n";
}
$ret .= '</table>';
return $ret;
} else {
return '';
}
}
开发者ID:negabaro,项目名称:alfresco,代码行数:19,代码来源:SpecialVersion.php
示例19: 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
示例20: 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
注:本文中的wfOpenElement函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论