本文整理汇总了PHP中wfMsgWikiHtml函数的典型用法代码示例。如果您正苦于以下问题:PHP wfMsgWikiHtml函数的具体用法?PHP wfMsgWikiHtml怎么用?PHP wfMsgWikiHtml使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wfMsgWikiHtml函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: wfSpecialIpblocklist
/**
* @todo document
*/
function wfSpecialIpblocklist()
{
global $wgUser, $wgOut, $wgRequest;
$ip = $wgRequest->getVal('wpUnblockAddress', $wgRequest->getVal('ip'));
$reason = $wgRequest->getText('wpUnblockReason');
$action = $wgRequest->getText('action');
$ipu = new IPUnblockForm($ip, $reason);
if ("success" == $action) {
$ipu->showList(wfMsgWikiHtml('unblocked', htmlspecialchars($ip)));
} else {
if ("submit" == $action && $wgRequest->wasPosted() && $wgUser->matchEditToken($wgRequest->getVal('wpEditToken'))) {
if (!$wgUser->isAllowed('block')) {
$wgOut->sysopRequired();
return;
}
$ipu->doSubmit();
} else {
if ("unblock" == $action) {
$ipu->showForm("");
} else {
$ipu->showList("");
}
}
}
}
示例2: wfSpecialCheckmylinks
function wfSpecialCheckmylinks($par)
{
global $wgRequest, $wgSitename, $wgLanguageCode;
global $wgDeferredUpdateList, $wgOut, $wgUser, $wgServer, $wgParser, $wgTitle;
$fname = "wfCheckmylinks";
$wgOut->addHTML(wfMsgWikiHtml('checkmylinks_summary'));
if ($wgUser->getID() > 0) {
$t = Title::makeTitle(NS_USER, $wgUser->getName() . "/Mylinks");
if ($t->getArticleID() > 0) {
$r = Revision::newFromTitle($t);
$text = $r->getText();
if ($text != "") {
$ret = "<h3>" . wfMsg('mylinks') . "</h3>";
$options = new ParserOptions();
$output = $wgParser->parse($text, $wgTitle, $options);
$ret .= $output->getText();
}
$size = strlen($ret);
if ($size > 3000) {
$wgOut->addHTML(wfMsgWikiHtml('checkmylinks_size_bad', number_format($size, 0, "", ",")));
} else {
$wgOut->addHTML(wfMsgWikiHtml('checkmylinks_size_good', number_format($size, 0, "", ",")));
}
} else {
$wgOut->addHTML(wfMsgWikiHtml('checkmylinks_error'));
}
} else {
$wgOut->addHTML(wfMsgWikiHtml('checkmylinks_notloggedin'));
}
}
示例3: wfIFI_uploadWarning
function wfIFI_uploadWarning($u, $warning)
{
global $wgOut;
global $wgUseCopyrightUpload;
$u->mSessionKey = $u->stashSession();
if (!$u->mSessionKey) {
# Couldn't save file; an error has been displayed so let's go.
return;
}
$wgOut->addHTML("<h2>" . wfMsgHtml('uploadwarning') . "</h2>\n");
$wgOut->addHTML("<ul class='warning'>{$warning}</ul><br />\n");
$save = wfMsgHtml('savefile');
$reupload = wfMsgHtml('reupload');
$iw = wfMsgWikiHtml('ignorewarning');
$reup = wfMsgWikiHtml('reuploaddesc');
$titleObj = Title::makeTitle(NS_SPECIAL, 'Upload');
$action = $titleObj->escapeLocalURL('action=submit');
if ($wgUseCopyrightUpload) {
$copyright = "\n <input type='hidden' name='wpUploadCopyStatus' value=\"" . htmlspecialchars($u->mUploadCopyStatus) . "\" />\n <input type='hidden' name='wpUploadSource' value=\"" . htmlspecialchars($u->mUploadSource) . "\" />\n ";
} else {
$copyright = "";
}
$wgOut->addHTML("\n <form id='uploadwarning' method='post' enctype='multipart/form-data' action='{$action}'>\n <input type='hidden' name='wpIgnoreWarning' value='1' />\n <input type='hidden' name='wpSessionKey' value=\"" . htmlspecialchars($u->mSessionKey) . "\" />\n <input type='hidden' name='wpUploadDescription' value=\"" . htmlspecialchars($u->mUploadDescription) . "\" />\n <input type='hidden' name='wpLicense' value=\"" . htmlspecialchars($u->mLicense) . "\" />\n <input type='hidden' name='wpDestFile' value=\"" . htmlspecialchars($u->mDestFile) . "\" />\n <input type='hidden' name='wpWatchu' value=\"" . htmlspecialchars(intval($u->mWatchu)) . "\" />\n {$copyright}\n <table border='0'>\n <tr>\n <tr>\n <td align='right'>\n <input tabindex='2' type='submit' name='wpUpload' value=\"{$save}\" />\n </td>\n <td align='left'>{$iw}</td>\n </tr>\n </tr>\n </table></form>\n" . wfMsg('importfreeimages_returntoform', $_SERVER["HTTP_REFERER"]));
// $_SERVER["HTTP_REFERER"]; -- javascript.back wasn't working for some reason... hmph.
}
示例4: execute
public function execute($mode = false)
{
global $wgOut, $wgUser;
$this->setHeaders();
$this->user =& $wgUser;
if (strtolower($mode) == 'results') {
if ($wgUser->isAllowed('voteadmin')) {
$this->showResults();
}
} else {
if ($wgUser->isAnon()) {
$skin =& $wgUser->getSkin();
$self = SpecialPage::getTitleFor('Vote');
$login = SpecialPage::getTitleFor('Userlogin');
$link = $skin->makeKnownLinkObj($login, wfMsgHtml('vote-login-link'), 'returnto=' . $self->getPrefixedUrl());
$wgOut->addHtml(wfMsgWikiHtml('vote-login', $link));
return;
} elseif (!$wgUser->mEmailAuthenticated) {
$wgOut->addWikiText("'''Email authentication is required to vote.'''\n\t\t\t\t\nPlease edit/add your e-mail using [[Special:Preferences]] and a confirmation e-mail will be sent to your e-mail address.\n\nFollow the instructions in the e-mail, to confirm that the account is actually yours.");
return;
} elseif (!$wgUser->isAllowed('vote')) {
$wgOut->permissionRequired('vote');
return;
} else {
$this->showNormal();
}
}
}
示例5: view
/**
* Called on every video page view.
*/
public function view()
{
$this->video = new Video($this->getTitle(), $this->getContext());
$out = $this->getContext()->getOutput();
$videoLinksHTML = '<br />' . Xml::element('h2', array('id' => 'filelinks'), wfMsg('video-links')) . "\n";
$sk = $this->getContext()->getSkin();
// No need to display noarticletext, we use our own message
if ($this->getID()) {
parent::view();
} else {
// Just need to set the right headers
$out->setArticleFlag(true);
$out->setRobotPolicy('index,follow');
$out->setPageTitle($this->mTitle->getPrefixedText());
}
if ($this->video->exists()) {
// Display flash video
$out->addHTML($this->video->getEmbedCode());
// Force embed this code to have width of 300
$this->video->setWidth(300);
$out->addHTML($this->getEmbedThisTag());
$this->videoHistory();
//$wgOut->addHTML( $videoLinksHTML );
//$this->videoLinks();
} else {
// Video doesn't exist, so give a link allowing user to add one with this name
$title = SpecialPage::getTitleFor('AddVideo');
$link = $sk->linkKnown($title, wfMsgHtml('video-novideo-linktext'), array(), array('wpTitle' => $this->video->getName()));
$out->addHTML(wfMsgWikiHtml('video-novideo', $link));
//$wgOut->addHTML( $videoLinksHTML );
//$this->videoLinks();
$this->viewUpdates();
}
}
示例6: execute
/**
* Main execution point
*
* @param $code Confirmation code passed to the page
*/
function execute($code)
{
global $wgUser, $wgOut;
$this->setHeaders();
if (wfReadOnly()) {
$wgOut->readOnlyPage();
return;
}
if (empty($code)) {
if ($wgUser->isLoggedIn()) {
if (User::isValidEmailAddr($wgUser->getEmail())) {
$this->showRequestForm();
} else {
$wgOut->addWikiMsg('confirmemail_noemail');
}
} else {
$title = SpecialPage::getTitleFor('Userlogin');
$skin = $wgUser->getSkin();
$llink = $skin->linkKnown($title, wfMsgHtml('loginreqlink'), array(), array('returnto' => $this->getTitle()->getPrefixedText()));
$wgOut->addHTML(wfMsgWikiHtml('confirmemail_needlogin', $llink));
}
} else {
$this->attemptConfirm($code);
}
}
示例7: showChunk
/**
* @param integer $namespace (Default NS_MAIN)
* @param string $from list all pages from this name (default FALSE)
*/
function showChunk($namespace = NS_MAIN, $prefix, $including = false, $from = null)
{
global $wgOut, $wgUser, $wgContLang;
$fname = 'indexShowChunk';
$sk = $wgUser->getSkin();
if (!isset($from)) {
$from = $prefix;
}
$fromList = $this->getNamespaceKeyAndText($namespace, $from);
$prefixList = $this->getNamespaceKeyAndText($namespace, $prefix);
if (!$prefixList || !$fromList) {
$out = wfMsgWikiHtml('allpagesbadtitle');
} else {
list($namespace, $prefixKey, $prefix) = $prefixList;
list($fromNs, $fromKey, $from) = $fromList;
### FIXME: should complain if $fromNs != $namespace
$dbr =& wfGetDB(DB_SLAVE);
$res = $dbr->select('page', array('page_namespace', 'page_title', 'page_is_redirect'), array('page_namespace' => $namespace, 'page_title LIKE \'' . $dbr->escapeLike($prefixKey) . '%\'', 'page_title >= ' . $dbr->addQuotes($fromKey)), $fname, array('ORDER BY' => 'page_title', 'LIMIT' => $this->maxPerPage + 1, 'USE INDEX' => 'name_title'));
### FIXME: side link to previous
$n = 0;
$out = '<table style="background: inherit;" border="0" width="100%">';
$namespaces = $wgContLang->getFormattedNamespaces();
while ($n < $this->maxPerPage && ($s = $dbr->fetchObject($res))) {
$t = Title::makeTitle($s->page_namespace, $s->page_title);
if ($t) {
$link = ($s->page_is_redirect ? '<div class="allpagesredirect">' : '') . $sk->makeKnownLinkObj($t, htmlspecialchars($t->getText()), false, false) . ($s->page_is_redirect ? '</div>' : '');
} else {
$link = '[[' . htmlspecialchars($s->page_title) . ']]';
}
if ($n % 3 == 0) {
$out .= '<tr>';
}
$out .= "<td>{$link}</td>";
$n++;
if ($n % 3 == 0) {
$out .= '</tr>';
}
}
if ($n % 3 != 0) {
$out .= '</tr>';
}
$out .= '</table>';
}
if ($including) {
$out2 = '';
} else {
$nsForm = $this->namespaceForm($namespace, $prefix);
$out2 = '<table style="background: inherit;" width="100%" cellpadding="0" cellspacing="0" border="0">';
$out2 .= '<tr valign="top"><td align="left">' . $nsForm;
$out2 .= '</td><td align="right" style="font-size: smaller; margin-bottom: 1em;">' . $sk->makeKnownLink($wgContLang->specialPage($this->name), wfMsg('allpages'));
if (isset($dbr) && $dbr && $n == $this->maxPerPage && ($s = $dbr->fetchObject($res))) {
$namespaceparam = $namespace ? "&namespace={$namespace}" : "";
$out2 .= " | " . $sk->makeKnownLink($wgContLang->specialPage($this->name), wfMsg('nextpage', $s->page_title), "from=" . wfUrlEncode($s->page_title) . "&prefix=" . wfUrlEncode($prefix) . $namespaceparam);
}
$out2 .= "</td></tr></table><hr />";
}
$wgOut->addHtml($out2 . $out);
}
示例8: getBadge
function getBadge($badgeName)
{
$html = "<div class='ab-box'>";
$html .= "<div class='ab-badge ab-" . $badgeName . "'></div>";
$html .= "<h3>" . wfMsg("ab-" . $badgeName . "-title") . "</h3>";
$html .= wfMsgWikiHtml("ab-" . $badgeName . "-description");
$html .= "</div>";
return $html;
}
示例9: execute
function execute($par)
{
global $wgRequest, $wgOut, $wgUser, $wgLang;
$target = isset($par) ? $par : $wgRequest->getVal('target');
$sk = $wgUser->getSkin();
$dbr =& wfGetDB(DB_SLAVE);
$wgOut->setHTMLTitle('Edits Patrol Count - wikiHow');
$wgOut->addHTML(' <style type="text/css" media="all">/*<![CDATA[*/ @import "/extensions/wikihow/Patrolcount.css"; /*]]>*/</style>');
$me = Title::makeTitle(NS_SPECIAL, "Patrolcount");
// allow the user to grab the local patrol count relative to their own timezone
if ($wgRequest->getVal('patrolcountview', null)) {
$wgUser->setOption('patrolcountlocal', $wgRequest->getVal('patrolcountview'));
$wgUser->saveSettings();
}
if ($wgUser->getOption('patrolcountlocal', "GMT") != "GMT") {
$links = "[" . $sk->makeLinkObj($me, wfMsg('patrolcount_viewGMT'), "patrolcountview=GMT") . "] [" . wfMsg('patrolcount_viewlocal') . "]";
$result = Patrolcount::getPatrolcountWindow();
$date1 = $result[0];
$date2 = $result[1];
//echo "$date1 , $date2";
} else {
$links = "[" . wfMsg('patrolcount_viewGMT') . "] [" . $sk->makeLinkObj($me, wfMsg('patrolcount_viewlocal'), "patrolcountview=local") . "]";
$now = wfTimestamp(TS_UNIX);
$date1 = substr(wfTimestamp(TS_MW), 0, 8) . "000000";
$date2 = substr(wfTimestamp(TS_MW, $now + 24 * 3600), 0, 8) . "000000";
}
//echo "<h3>date1 $date1 to $date2</h3>";
//grab the total
$total = $dbr->selectField('logging', 'count(*)', array('log_type' => 'patrol', "log_timestamp>'{$date1}'", "log_timestamp<'{$date2}'"));
$wgOut->addHTML("<div id='Patrolcount'>");
$wgOut->addHTML(wfMsg('patrolcount_summary') . "<br/><br/>" . wfMsg('patrolcount_total', number_format($total, 0, '', ',')) . "<br/><br/><center>");
$wgOut->addHTML($links);
$wgOut->addHTML("<br/><br/><table width='500px' align='center' class='status'>");
$sql = "select log_user, count(*) as C from logging where log_type='patrol' and log_timestamp > '{$date1}' and log_timestamp < '{$date2}' group by log_user order by C desc limit 20;";
$res = $dbr->query($sql);
$index = 1;
$wgOut->addHTML("<tr>\n\t <td></td>\n\t <td>User</td>\n\t <td align='right'>" . wfMsg('patrolcount_numberofeditspatrolled') . "</td>\n\t <td align='right'>" . wfMsg('patrolcount_percentangeheader') . "</td>\n\t </tr>\n\t ");
while (($row = $dbr->fetchObject($res)) != null) {
$u = User::newFromID($row->log_user);
$percent = $total == 0 ? "0" : number_format($row->C / $total * 100, 2);
$count = number_format($row->C, 0, "", ',');
$class = "";
if ($index % 2 == 1) {
$class = 'class="odd"';
}
$log = $sk->makeLinkObj(Title::makeTitle(NS_SPECIAL, 'Log'), $count, 'type=patrol&user=' . $u->getName());
$wgOut->addHTML("<tr {$class}>\n\t\t\t\t<td>{$index}</td>\n\t\t\t\t<td>" . $sk->makeLinkObj($u->getUserPage(), $u->getName()) . "</td>\n\t\t\t\t<td align='right'>{$log}</td>\n\t\t\t\t<td align='right'> {$percent} % </td>\n\t\t\t\t</tr>\n\t\t\t");
$index++;
}
$wgOut->addHTML("</table></center>");
if ($wgUser->getOption('patrolcountlocal', "GMT") != "GMT") {
$wgOut->addHTML("<br/><br/><i><font size='-2'>" . wfMsgWikiHtml('patrolcount_viewlocal_info') . "</font></i>");
}
$wgOut->addHTML("</div>");
}
示例10: acceptNewUserName
/**
* Check whether a user name is acceptable,
* and set a message if unacceptable.
*
* Used by abortNewAccount and centralAuthAutoCreate
*
* @return bool Acceptable
*/
private static function acceptNewUserName($userName, $permissionsUser, &$err, $override = true)
{
$title = Title::makeTitleSafe(NS_USER, $userName);
$blacklisted = TitleBlacklist::singleton()->userCannot($title, $permissionsUser, 'new-account', $override);
if ($blacklisted instanceof TitleBlacklistEntry) {
$message = $blacklisted->getErrorMessage('new-account');
$err = wfMsgWikiHtml($message, $blacklisted->getRaw(), $userName);
return false;
}
return true;
}
示例11: onSpecialListusersHeader
/**
* Show a message that you are viewing a list of users of a certain test wiki
* @param $pager
* @param $out
* @return bool
*/
static function onSpecialListusersHeader( $pager, &$out ) {
$project = self::getProjectInput();
if( $project ) {
$out .= wfMsgWikiHtml( 'wminc-listusers-testwiki', '"' . $project['name'] . '"' );
} else {
$testwiki = IncubatorTest::getUrlParam();
if ( $testwiki ) {
$link = Linker::linkKnown( Title::newFromText( $testwiki['prefix'] ) );
$out .= wfMsgWikiHtml( 'wminc-listusers-testwiki', $link );
}
}
return true;
}
示例12: execute
/**
* Main execution point
*
* @param $code Confirmation code passed to the page
*/
function execute($code)
{
global $wgUser, $wgOut;
if (empty($code)) {
if ($wgUser->isLoggedIn()) {
$this->showRequestForm();
} else {
$title = Title::makeTitle(NS_SPECIAL, 'Userlogin');
$self = Title::makeTitle(NS_SPECIAL, 'Confirmemail');
$skin = $wgUser->getSkin();
$llink = $skin->makeKnownLinkObj($title, wfMsgHtml('loginreqlink'), 'returnto=' . $self->getPrefixedUrl());
$wgOut->addHtml(wfMsgWikiHtml('confirmemail_needlogin', $llink));
}
} else {
$this->attemptConfirm($code);
}
}
示例13: recent_images
function recent_images($rsargs)
{
global $wgUploadPath, $wgDBprefix;
$u = User::newFromSession();
$dbw =& wfGetDB(DB_MASTER);
$res = $dbw->query('select img_name from ' . $wgDBprefix . 'image where img_user=' . $u->getId() . ';');
$return_text = '';
$return_empty = true;
for ($i = 0; $i < $res->numRows(); $i++) {
$ret = $res->fetchRow();
$return_text = $return_text . '<tr><td><img src="' . $wgUploadPath . '/' . $ret['img_name'] . '" height="100px" width="100px" onclick="n=document.getElementById(\'image_name\'); n.value=\'' . $ret['img_name'] . '\';" /></td></tr><tr><td>' . $ret['img_name'] . '</td></tr>';
$return_empty = false;
}
if ($return_empty) {
return '<tr><td colspan="2"><strong>' . wfMsgWikiHtml('no_recent_images') . '</strong>' . ($u->isLoggedIn() ? '' : wfMsgWikiHtml('try_login')) . '</td></tr>';
} else {
return $return_text;
}
}
示例14: showList
function showList()
{
global $wgOut, $wgContLang;
$fname = "BookSourceList::showList()";
# First, see if we have a custom list setup in
# [[Wikipedia:Book sources]] or equivalent.
$bstitle = Title::makeTitleSafe(NS_PROJECT, wfMsg("booksources"));
if ($bstitle) {
$revision = Revision::newFromTitle($bstitle);
if ($revision) {
$bstext = $revision->getText();
if ($bstext) {
$bstext = str_replace("MAGICNUMBER", $this->mIsbn, $bstext);
$wgOut->addWikiText($bstext);
return;
}
}
}
# Otherwise, use the list of links in the default Language.php file.
$s = wfMsgWikiHtml('booksourcetext') . "<ul>\n";
$bs = $wgContLang->getBookstoreList();
$bsn = array_keys($bs);
foreach ($bsn as $name) {
$adr = $bs[$name];
if (!$this->mIsbn) {
$adr = explode(":", $adr, 2);
$adr = explode("/", $adr[1]);
$a = "";
while ($a == "") {
$a = array_shift($adr);
}
$adr = "http://" . $a;
} else {
$adr = str_replace("\$1", $this->mIsbn, $adr);
}
$name = htmlspecialchars($name);
$adr = htmlspecialchars($adr);
$s .= "<li><a href=\"{$adr}\" class=\"external\">{$name}</a></li>\n";
}
$s .= "</ul>\n";
$wgOut->addHTML($s);
}
示例15: wfSpecialCompare
/**
* Called to display the Special:Compare page
*
* @param unknown_type $par
* @param unknown_type $specialPage
*/
function wfSpecialCompare($par = NULL, $specialPage)
{
global $wgOut, $wgScriptPath, $wgUser, $wrSidebarHtml;
$compareForm = new CompareForm();
$wgOut->setPageTitle('Compare pages');
// read query parameters into variables
if (!$compareForm->readQueryParms($par)) {
$sideText = '';
$results = $compareForm->getCompareForm();
} else {
$wgOut->addScript("<script type=\"text/javascript\" src=\"{$wgScriptPath}/compare.7.js\"></script>");
$isGedcom = $compareForm->isGedcom();
$sideText = '<p>' . ($isGedcom ? 'Matching GEDCOM families' : 'Merge') . ' is a two-step process. In this compare step, check the boxes above the matching pages.</p>' . ($compareForm->getNamespace() == 'Family' ? '<p>To match children, choose the child number to match with.</p>' : '') . ($isGedcom ? '<p>Then scroll to the bottom of the page and click "Match" to match this family.</p>' . '<p>In the next step you\'ll be given a chance to update the matched pages with information from your GEDCOM</p>' : '<p>Then click "Prepare to merge" at the bottom of the page.</p>' . '<p>In the next step you\\ll be given a chance to decide what information to keep on the merged page.</p>') . '<p><font color="green">Green</font> boxes mean the information is specific and matches exactly.</p>' . '<p><font color="yellow">Yellow</font> boxes mean the information is non-specific (missing some pieces) or is a partial match.</p>' . '<p><font color="red">Red</font> boxes mean the information differs.</p>' . '<p>(<a href="/wiki/Help:Merging_pages">more help</a>)</p>';
$results = $compareForm->getCompareResults();
}
$skin = $wgUser->getSkin();
//$wrSidebarHtml = $skin->makeKnownLink('Help:Merging pages', "Help", '', '', '', 'class="popup"');
$wrSidebarHtml = wfMsgWikiHtml('CompareHelp');
$wgOut->addHTML($results);
}