本文整理汇总了PHP中Xml::closeElement方法的典型用法代码示例。如果您正苦于以下问题:PHP Xml::closeElement方法的具体用法?PHP Xml::closeElement怎么用?PHP Xml::closeElement使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Xml
的用法示例。
在下文中一共展示了Xml::closeElement方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showForm
function showForm($err = '')
{
global $wgOut, $wgUser, $wgLang;
$wgOut->setPagetitle(wfMsg("makesysoptitle"));
$wgOut->addWikiText(wfMsg("makesysoptext"));
$titleObj = Title::makeTitle(NS_SPECIAL, "Makesysop");
$action = $titleObj->getLocalUrl("action=submit");
if ($wgUser->isAllowed('userrights')) {
$wgOut->addWikiText(wfMsg('makesysop-see-userrights'));
}
if ("" != $err) {
$wgOut->setSubtitle(wfMsg("formerror"));
$wgOut->addHTML("<p class='error'>{$err}</p>\n");
}
$namedesc = wfMsg("makesysopname");
if (!is_null($this->mUser)) {
$encUser = htmlspecialchars($this->mUser);
} else {
$encUser = "";
}
$reason = htmlspecialchars(wfMsg("userrights-reason"));
$makebureaucrat = wfMsg("setbureaucratflag");
$mss = wfMsg("set_user_rights");
$wgOut->addHTML(Xml::openElement('form', array('method' => 'post', 'action' => $action, 'id' => 'makesysop')) . Xml::openElement('fieldset') . Xml::element('legend', array(), wfMsg('makesysoptitle')) . "<table border='0'>\n\t\t\t<tr>\n\t\t\t\t<td align='right'>{$namedesc}</td>\n\t\t\t\t<td align='left'>" . Xml::input('wpMakesysopUser', 40, $encUser) . "</td>\n\t\t\t</tr><tr>\n\t\t\t\t<td align='right'>{$reason}</td>\n\t\t\t\t<td align='left'>" . Xml::input('wpMakesysopReason', 40, $this->mReason, array('maxlength' => 255)) . "</td>\n\t\t\t</tr><tr>\n\t\t\t\t<td> </td>\n\t\t\t\t<td align='left'>" . Xml::checkLabel($makebureaucrat, 'wpSetBureaucrat', 'wpSetBureaucrat', $this->mSetBureaucrat) . "</td>\n\t\t\t</tr><tr>\n\t\t\t\t<td> </td>\n\t\t\t\t<td align='left'>" . Xml::submitButton($mss, array('name' => 'wpMakesysopSubmit')) . "</td>\n\t\t\t</tr>\n\t\t\t</table>" . Xml::hidden('wpEditToken', $wgUser->editToken()) . Xml::closeElement('fieldset') . Xml::closeElement('form') . "\n");
}
示例2: switchForm
/**
* Output a form to allow searching for a user
*/
function switchForm()
{
global $wgScript;
$this->getOutput()->addModules('ext.centralauth.globaluserautocomplete');
$this->getOutput()->addModuleStyles('mediawiki.special');
$this->getOutput()->addHTML(Xml::openElement('form', array('method' => 'get', 'action' => $wgScript, 'name' => 'uluser', 'id' => 'mw-userrights-form1')) . Html::hidden('title', $this->getPageTitle()) . Xml::openElement('fieldset') . Xml::element('legend', array(), $this->msg('userrights-lookup-user')->text()) . Xml::inputLabel($this->msg('userrights-user-editname')->text(), 'user', 'username', 30, $this->mTarget, array('class' => 'mw-autocomplete-global-user')) . ' <br />' . Xml::submitButton($this->msg('editusergroup')->text()) . Xml::closeElement('fieldset') . Xml::closeElement('form') . "\n");
}
示例3: makeForm
function makeForm() {
$self = $this->getTitle();
$form = Xml::openElement( 'form', array( 'method' => 'post', 'action' => $self->getLocalUrl() ) );
$form .= Xml::element( 'input', array( 'type' => 'submit', 'name' => 'purge', 'value' => wfMsg( 'purgecache-button' ) ) );
$form .= Xml::closeElement( 'form' );
return $form;
}
示例4: addRequestWikiForm
function addRequestWikiForm()
{
$localpage = $this->getPageTitle()->getLocalUrl();
$form = Xml::openElement('form', array('action' => $localpage, 'method' => 'post'));
$form .= '<fieldset><legend>' . $this->msg('requestwiki')->escaped() . '</legend>';
$form .= Xml::openElement('table');
$form .= '<tr><td>' . $this->msg('requestwiki-label-siteurl')->escaped() . '</td>';
$form .= '<td>' . Xml::input('subdomain', 20, '') . '.miraheze.org' . '</td></tr>';
$form .= '<tr><td>' . $this->msg('requestwiki-label-sitename')->escaped() . '</td>';
$form .= '<td>' . Xml::input('sitename', 20, '', array('required' => '')) . '</td></tr>';
$form .= '<tr><td>' . $this->msg('requestwiki-label-customdomain')->escaped() . '</td>';
$form .= '<td>' . Xml::input('customdomain', 20, '') . '</td></tr>';
$form .= '<tr><td>' . $this->msg('requestwiki-label-language')->escaped() . '</td>';
$form .= '<td>' . Xml::languageSelector('en', true, null, array('name' => 'language'))[1] . '</td></tr>';
$form .= '<tr><td>' . $this->msg('requestwiki-label-private')->escaped() . '</td>';
$form .= '<td>' . Xml::check('private', false, array('value' => 0)) . '</td></tr>';
$form .= '<tr><td>' . $this->msg('requestwiki-label-comments')->escaped() . '</td>';
$form .= '<td>' . Xml::textarea('comments', '', 40, 5, array('required' => '')) . '</td></tr>';
$form .= '<tr><td>' . Xml::submitButton($this->msg('requestwiki-submit')->plain()) . '</td></tr>';
$form .= Xml::closeElement('table');
$form .= '</fieldset>';
$form .= Html::hidden('token', $this->getUser()->getEditToken());
$form .= Xml::closeElement('form');
$this->getOutput()->addHTML($form);
}
示例5: execute
public function execute($subpage)
{
global $wgOut, $wgRequest, $wgUser, $wgCacheEpoch, $wgCityId;
wfProfileIn(__METHOD__);
$this->setHeaders();
$this->mTitle = SpecialPage::getTitleFor('UserData');
if ($this->isRestricted() && !$this->userCanExecute($wgUser)) {
$this->displayRestrictionError();
wfProfileOut(__METHOD__);
return;
}
$result = '';
$userId = $wgRequest->getInt('userId');
if ($userId) {
$user = User::newFromId($userId);
if (!empty($user)) {
//todo: add nicer result - right now only name and link to user page
$result = Xml::element('a', array('href' => $user->getUserPage()->getLocalURL()), $user->getName(), false);
}
}
$wgOut->addHTML(Xml::openElement('form', array('action' => $this->mTitle->getFullURL(), 'method' => 'get')));
$wgOut->addHTML(Xml::inputLabel(wfMsg('userdata-userid-label'), 'userId', 'user-id', false, $userId));
$wgOut->addHTML('<br>' . Xml::submitButton(wfMsg('userdata-submit')));
$wgOut->addHTML(Xml::closeElement('form'));
if ($result) {
$wgOut->addHTML('<hr>' . $result);
}
wfProfileOut(__METHOD__);
}
示例6: getTag
public function getTag()
{
$this->wf->profileIn(__METHOD__);
$imageHTML = $this->request->getVal('imageHTML');
$align = $this->request->getVal('align');
$width = $this->request->getVal('width');
$showCaption = $this->request->getVal('showCaption', false);
$caption = $this->request->getVal('caption', '');
$zoomIcon = $this->request->getVal('zoomIcon', '');
$showPictureAttribution = $this->request->getVal('showPictureAttribution', false);
$attributeTo = $this->request->getVal('$attributeTo', null);
$html = "<figure class=\"thumb" . (!empty($align) ? " t{$align}" : '') . " thumbinner\" style=\"width:{$width}px;\">{$imageHTML}{$zoomIcon}";
if (!empty($showCaption)) {
$html .= "<figcaption class=\"thumbcaption\">{$caption}";
}
//picture attribution
if (!empty($showPictureAttribution) && !empty($attributeTo)) {
$this->wf->profileIn(__METHOD__ . '::PictureAttribution');
// render avatar and link to user page
$avatar = AvatarService::renderAvatar($attributeTo, 16);
$link = AvatarService::renderLink($attributeTo);
$html .= Xml::openElement('div', array('class' => 'picture-attribution')) . $avatar . $this->wf->MsgExt('oasis-content-picture-added-by', array('parsemag'), $link, $attributeTo) . Xml::closeElement('div');
$this->wf->profileOut(__METHOD__ . '::PictureAttribution');
}
if (!empty($showCaption)) {
$html .= '</figcaption>';
}
$html .= '</figure>';
$this->setVal('tag', $html);
$this->wf->profileOut(__METHOD__);
}
示例7: execute
public function execute($sub)
{
global $wgLastModifiedRange;
$this->setHeaders();
$this->outputHeader();
$out = $this->getOutput();
$out->addHTML(Xml::openElement('h2'));
$out->addHTML(wfMsg('lastmodified-options'));
$out->addHTML(Xml::closeElement('h2'));
$out->addHTML(Xml::openElement('p'));
$out->addHTML(wfMsg('lastmodified-display-range-value') . ' ' . $wgLastModifiedRange);
$out->addHTML(Xml::closeElement('p'));
$rangeMessage = wfMsg('lastmodified-display') . ' ';
$rangeMessageDatetime = '';
$displayRange = array(0 => 'years', 1 => 'months', 2 => 'days', 3 => 'hours', 4 => 'minutes', 5 => 'seconds');
// Display seconds
foreach ($displayRange as $key => $value) {
// Check to see which values to display.
if ($wgLastModifiedRange == 0 || $key >= $wgLastModifiedRange) {
// append a comma if necessary
$rangeMessageDatetime .= empty($rangeMessageDatetime) ? '' : ', ';
// append message
$rangeMessageDatetime .= wfMsg('lastmodified-label-' . $value);
}
}
$rangeMessage .= $rangeMessageDatetime;
$out->addHTML(Xml::openElement('p'));
$out->addHTML($rangeMessage);
$out->addHTML(Xml::closeElement('p'));
}
示例8: display_captcha
/**
* Display the submission form with the captcha injected into it
*/
public function display_captcha()
{
global $wgOut;
$publicKey = $this->gateway_adapter->getGlobal('RecaptchaPublicKey');
$useSSL = $this->gateway_adapter->getGlobal('RecaptchaUseSSL');
// log that a captcha's been triggered
$this->log($this->gateway_adapter->getData_Unstaged_Escaped('contribution_tracking_id'), 'Captcha triggered');
// construct the HTML used to display the captcha
$captcha_html = Xml::openElement('div', array('id' => 'mw-donate-captcha'));
$captcha_html .= recaptcha_get_html($publicKey, $this->recap_err, $useSSL);
$captcha_html .= '<span class="creditcard-error-msg">' . wfMsg($this->gateway_adapter->getIdentifier() . '_gateway-error-msg-captcha-please') . '</span>';
$captcha_html .= Xml::closeElement('div');
// close div#mw-donate-captcha
// load up the form class
$form_class = $this->gateway_adapter->getFormClass();
//TODO: use setValidationErrors and getValidationErrors everywhere, and
//refactor all the form constructors one more time. Eventually.
$data = $this->gateway_adapter->getData_Unstaged_Escaped();
$errors = $this->gateway_adapter->getValidationErrors();
$form_obj = new $form_class($this->gateway_adapter, $errors);
// set the captcha HTML to use in the form
$form_obj->setCaptchaHTML($captcha_html);
// output the form
$wgOut->addHTML($form_obj->getForm());
}
示例9: getDiv
public function getDiv($value)
{
global $wgOut, $wgPromoterAdPreview;
if (array_key_exists('language', $this->mParams)) {
$language = $this->mParams['language'];
} else {
$language = $wgOut->getContext()->getLanguage()->getCode();
}
$html = Xml::openElement('div', array('id' => Sanitizer::escapeId("pr-ad-list-element-{$this->mParams['ad']}"), 'class' => "pr-ad-list-element"));
// Make the label; this consists of a text link to the ad editor, and a series of status icons
if (array_key_exists('withlabel', $this->mParams)) {
$adName = $this->mParams['ad'];
$html .= Xml::openElement('div', array('class' => 'pr-ad-list-element-label'));
$html .= Linker::link(SpecialPage::getTitleFor('PromoterAds', "edit/{$adName}"), htmlspecialchars($adName), array('class' => 'pr-ad-list-element-label-text'));
$html .= ' (' . Linker::link(SpecialPage::getTitleFor('Randompage'), $this->msg('promoter-live-preview'), array('class' => 'pr-ad-list-element-label-text'), array('ad' => $adName, 'uselang' => $language, 'force' => '1')) . ')';
// TODO: Output status icons
$html .= Xml::tags('div', array('class' => 'pr-ad-list-element-label-icons'), '');
$html .= Xml::closeElement('div');
}
// Add the ad preview
if ($wgPromoterAdPreview) {
$html .= $this->getInputHTML(null);
}
$html .= Xml::closeElement('div');
return $html;
}
示例10: renderPersonalUrl
/**
* Render personal URLs item as HTML link
*/
private function renderPersonalUrl($id)
{
wfProfileIn(__METHOD__);
$personalUrl = $this->personal_urls[$id];
$attributes = array('data-id' => $id, 'href' => $personalUrl['href']);
if (in_array($id, array('login', 'register'))) {
$attributes['rel'] = 'nofollow';
}
// add class attribute
if (isset($personalUrl['class'])) {
$attributes['class'] = $personalUrl['class'];
}
// add accesskey attribute
switch ($id) {
case 'mytalk':
$attributes['accesskey'] = 'n';
break;
case 'login':
$attributes['accesskey'] = 'o';
break;
}
$ret = Xml::openElement('a', $attributes);
$ret .= $personalUrl['text'];
if (array_key_exists('afterText', $personalUrl)) {
$ret .= $personalUrl['afterText'];
}
$ret .= Xml::closeElement('a');
wfProfileOut(__METHOD__);
return $ret;
}
示例11: WidgetCategoryCloud
function WidgetCategoryCloud($id, $params)
{
$output = "";
wfProfileIn(__METHOD__);
global $wgMemc;
$key = wfMemcKey("WidgetCategoryCloud", "data");
$data = $wgMemc->get($key);
if (is_null($data)) {
$data = WidgetCategoryCloudCloudizeData(WidgetCategoryCloudGetData());
$wgMemc->set($key, $data, 3600);
}
if (empty($data)) {
wfProfileOut(__METHOD__);
return wfMsgForContent("widget-categorycloud-empty");
}
foreach ($data as $name => $value) {
$category = Title::newFromText($name, NS_CATEGORY);
if (is_object($category)) {
$class = "cloud" . $value;
$output .= Xml::openElement("li", array("class" => $class));
// FIXME fix Wikia:link and use it here
$output .= Xml::element("a", array("class" => $class, "href" => $category->getLocalURL(), "title" => $category->getFullText()), $category->getBaseText());
$output .= Xml::closeElement("li");
$output .= "\n";
}
}
if (empty($output)) {
wfProfileOut(__METHOD__);
return wfMsgForContent("widget-categorycloud-empty");
}
$output = Xml::openElement("ul") . $output . Xml::closeElement("ul");
wfProfileOut(__METHOD__);
return $output;
}
示例12: 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()) {
// date and time are separate parameters to facilitate localisation.
// $time is kept for backward compat reasons.
// 'emailauthenticated' is also used in SpecialPreferences.php
$time = $wgLang->timeAndDate($wgUser->mEmailAuthenticated, true);
$d = $wgLang->date($wgUser->mEmailAuthenticated, true);
$t = $wgLang->time($wgUser->mEmailAuthenticated, true);
$wgOut->addWikiMsg('emailauthenticated', $time, $d, $t);
}
if ($wgUser->isEmailConfirmationPending()) {
$wgOut->wrapWikiMsg("<div class=\"error mw-confirmemail-pending\">\n\$1</div>", 'confirmemail_pending');
}
$wgOut->addWikiMsg('confirmemail_text');
$form = Xml::openElement('form', array('method' => 'post', 'action' => $this->getTitle()->getLocalUrl()));
$form .= Xml::hidden('token', $wgUser->editToken());
$form .= Xml::submitButton(wfMsg('confirmemail_send'));
$form .= Xml::closeElement('form');
$wgOut->addHTML($form);
}
}
示例13: getHTML
public static function getHTML( $file ){
global $wgUser, $wgOut;
// Add transcode table css and javascript:
$wgOut->addModules( array( 'ext.tmh.transcodetable' ) );
$o = '<h2>' . wfMsgHtml( 'timedmedia-status-header' ) . '</h2>';
// Give the user a purge page link
$o.= self::$linker->link( $file->getTitle(), wfMsg('timedmedia-update-status'), array(), array( 'action'=> 'purge' ) );
$o.= Xml::openElement( 'table', array( 'class' => 'wikitable transcodestatus' ) ) . "\n"
. '<tr>'
. '<th>'.wfMsgHtml( 'timedmedia-status' ) .'</th>'
. '<th>' . wfMsgHtml( 'timedmedia-transcodeinfo' ) . '</th>'
. '<th>'.wfMsgHtml( 'timedmedia-direct-link' ) .'</th>';
if( $wgUser->isAllowed( 'transcode-reset' ) ){
$o.= '<th>' . wfMsgHtml( 'timedmedia-actions' ) . '</th>';
}
$o.= "</tr>\n";
$o.= self::getTranscodeRows( $file );
$o.= Xml::closeElement( 'table' );
return $o;
}
示例14: wfQuickCreateButton
function wfQuickCreateButton($input, $argv, $parser)
{
$title = Title::makeTitle(NS_SPECIAL, "CreatePage");
$link = $title->getFullUrl();
$output = Xml::openElement('a', array('class' => 'wikia-button', 'id' => 'mr-submit', 'href' => $link)) . wfMsg('quickcreate') . Xml::closeElement('a');
return $parser->replaceVariables($output);
}
示例15: execute
function execute($par)
{
global $wgOut, $wgUser;
global $wgFreenodeChatChannel, $wgFreenodeChatExtraParameters;
// Preperation.
$this->setHeaders();
// Introduction message, explaining to users what this is etc.
$wgOut->addWikiMsg('freenodechat-header');
// Prepare query string to pass to widget.
$queryAssoc = array('channels' => $wgFreenodeChatChannel);
if ($wgUser->IsLoggedIn()) {
$queryAssoc['nick'] = str_replace(' ', '_', $wgUser->getName());
}
if ($wgFreenodeChatExtraParameters) {
$queryAssoc = array_merge($queryAssoc, $wgFreenodeChatExtraParameters);
}
foreach ($queryAssoc as $parameter => $value) {
$query[] = $parameter . '=' . urlencode($value);
}
$queryString = implode('&', $query);
// Output widget.
$wgOut->addHTML(Xml::openElement('iframe', array('width' => '1000', 'height' => '500', 'scrolling' => 'no', 'border' => '0', 'onLoad' => 'freenodeChatExpand( this )', 'src' => 'http://webchat.freenode.net/?' . $queryString)) . Xml::closeElement('iframe'));
// Hack to make the chat area a reasonable size.
$wgOut->addHTML(Xml::tags('script', array('type' => 'text/javascript'), '/* <![CDATA[ */
function freenodeChatExpand( elem ) {
height = elem.height;
width = elem.width;
elem.height = screen.height - 500;
elem.width = screen.width - 250;
}
/* ]]> */'));
}