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


PHP Preferences::getFormObject方法代码示例

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


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

示例1: execute

 public function execute($par)
 {
     $this->setHeaders();
     $this->outputHeader();
     $out = $this->getOutput();
     $out->disallowUserJs();
     # Prevent hijacked user scripts from sniffing passwords etc.
     $user = $this->getUser();
     if ($user->isAnon()) {
         $out->showErrorPage('prefsnologin', 'prefsnologintext', array($this->getTitle()->getPrefixedDBkey()));
         return;
     }
     $this->checkReadOnly();
     if ($par == 'reset') {
         $this->showResetForm();
         return;
     }
     $out->addModules('mediawiki.special.preferences');
     /* Wikia change begin - @author: macbre */
     /* Enable custom notifications handling */
     wfRunHooks('SpecialPreferencesOnRender', array(&$this));
     /* Wikia change end */
     if ($this->getRequest()->getCheck('success')) {
         $out->wrapWikiMsg("<div class=\"successbox\"><strong>\n\$1\n</strong></div><div id=\"mw-pref-clear\"></div>", 'savedprefs');
     }
     if ($this->getRequest()->getCheck('eauth')) {
         $out->wrapWikiMsg("<div class='error' style='clear: both;'>\n\$1</div>", 'eauthentsent', $user->getName());
     }
     $htmlForm = Preferences::getFormObject($user, $this->getContext());
     $htmlForm->setSubmitCallback(array('Preferences', 'tryUISubmit'));
     $htmlForm->show();
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:32,代码来源:SpecialPreferences.php

示例2: execute

 public function execute($par)
 {
     $this->setHeaders();
     $this->outputHeader();
     $out = $this->getOutput();
     $out->disallowUserJs();
     # Prevent hijacked user scripts from sniffing passwords etc.
     $this->requireLogin('prefsnologintext2');
     $this->checkReadOnly();
     if ($par == 'reset') {
         $this->showResetForm();
         return;
     }
     $out->addModules('mediawiki.special.preferences');
     $out->addModuleStyles('mediawiki.special.preferences.styles');
     if ($this->getRequest()->getCheck('success')) {
         $out->wrapWikiMsg(Html::rawElement('div', array('class' => 'mw-preferences-messagebox successbox', 'id' => 'mw-preferences-success'), Html::element('p', array(), '$1')), 'savedprefs');
     }
     $this->addHelpLink('Help:Preferences');
     // Load the user from the master to reduce CAS errors on double post (T95839)
     $user = $this->getUser()->getInstanceForUpdate() ?: $this->getUser();
     $htmlForm = Preferences::getFormObject($user, $this->getContext());
     $htmlForm->setSubmitCallback(array('Preferences', 'tryUISubmit'));
     $sectionTitles = $htmlForm->getPreferenceSections();
     $prefTabs = '';
     foreach ($sectionTitles as $key) {
         $prefTabs .= Html::rawElement('li', array('role' => 'presentation', 'class' => $key === 'personal' ? 'selected' : null), Html::rawElement('a', array('id' => 'preftab-' . $key, 'role' => 'tab', 'href' => '#mw-prefsection-' . $key, 'aria-controls' => 'mw-prefsection-' . $key, 'aria-selected' => $key === 'personal' ? 'true' : 'false', 'tabIndex' => $key === 'personal' ? 0 : -1), $htmlForm->getLegend($key)));
     }
     $out->addHTML(Html::rawElement('ul', array('id' => 'preftoc', 'role' => 'tablist'), $prefTabs));
     $htmlForm->show();
 }
开发者ID:Acidburn0zzz,项目名称:mediawiki,代码行数:31,代码来源:SpecialPreferences.php

示例3: execute

 function execute($par)
 {
     global $wgOut, $wgUser, $wgRequest;
     $this->setHeaders();
     $this->outputHeader();
     $wgOut->disallowUserJs();
     # Prevent hijacked user scripts from sniffing passwords etc.
     if ($wgUser->isAnon()) {
         $wgOut->showErrorPage('prefsnologin', 'prefsnologintext', array($this->getTitle()->getPrefixedDBkey()));
         return;
     }
     if (wfReadOnly()) {
         $wgOut->readOnlyPage();
         return;
     }
     if ($par == 'reset') {
         $this->showResetForm();
         return;
     }
     $wgOut->addModules('mediawiki.legacy.prefs');
     $wgOut->addModules('mediawiki.special.preferences');
     if ($wgRequest->getCheck('success')) {
         $wgOut->wrapWikiMsg("<div class=\"successbox\"><strong>\n\$1\n</strong></div><div id=\"mw-pref-clear\"></div>", 'savedprefs');
     }
     if ($wgRequest->getCheck('eauth')) {
         $wgOut->wrapWikiMsg("<div class='error' style='clear: both;'>\n\$1\n</div>", 'eauthentsent', $wgUser->getName());
     }
     $htmlForm = Preferences::getFormObject($wgUser);
     $htmlForm->setSubmitCallback(array('Preferences', 'tryUISubmit'));
     $htmlForm->show();
 }
开发者ID:GodelDesign,项目名称:Godel,代码行数:31,代码来源:SpecialPreferences.php

示例4: execute

 public function execute($par)
 {
     $this->setHeaders();
     $this->outputHeader();
     $out = $this->getOutput();
     $out->disallowUserJs();
     # Prevent hijacked user scripts from sniffing passwords etc.
     $user = $this->getUser();
     if ($user->isAnon()) {
         $out->showErrorPage('prefsnologin', 'prefsnologintext', array($this->getTitle()->getPrefixedDBkey()));
         return;
     }
     $this->checkReadOnly();
     if ($par == 'reset') {
         $this->showResetForm();
         return;
     }
     $out->addModules('mediawiki.special.preferences');
     if ($this->getRequest()->getCheck('success')) {
         $out->wrapWikiMsg("<div class=\"successbox\"><strong>\n\$1\n</strong></div><div id=\"mw-pref-clear\"></div>", 'savedprefs');
     }
     $htmlForm = Preferences::getFormObject($user, $this->getContext());
     $htmlForm->setSubmitCallback(array('Preferences', 'tryUISubmit'));
     $htmlForm->show();
 }
开发者ID:laiello,项目名称:media-wiki-law,代码行数:25,代码来源:SpecialPreferences.php

示例5: execute

 function execute($par)
 {
     $user = $this->getUser();
     $out = $this->getOutput();
     if (!$user->isAllowed('edituser')) {
         $out->permissionRequired('edituser');
         return false;
     }
     $this->setHeaders();
     $request = $this->getRequest();
     $this->target = isset($par) ? $par : $request->getText('username', '');
     if ($this->target === '') {
         $out->addHtml($this->makeSearchForm());
         return;
     }
     $targetuser = User::NewFromName($this->target);
     if ($targetuser->getID() == 0) {
         $out->addWikiMsg('edituser-nouser', htmlspecialchars($this->target));
         return;
     }
     $this->targetuser = $targetuser;
     #Allow editing self via this interface
     if ($targetuser->isAllowed('edituser-exempt') && $targetuser->getName() != $user->getName()) {
         $out->addWikiMsg('edituser-exempt', $targetuser->getName());
         return;
     }
     $this->setHeaders();
     $this->outputHeader();
     $out->disallowUserJs();
     # Prevent hijacked user scripts from sniffing passwords etc.
     if (wfReadOnly()) {
         $out->readOnlyPage();
         return;
     }
     if ($request->getCheck('reset')) {
         $this->showResetForm();
         return;
     }
     $out->addModules('mediawiki.special.preferences');
     //$this->loadGlobals( $this->target );
     $out->addHtml($this->makeSearchForm() . '<br />');
     #End EditUser additions
     if ($request->getCheck('success')) {
         $out->wrapWikiMsg("<div class=\"successbox\"><strong>\n\$1\n</strong></div><div id=\"mw-pref-clear\"></div>", 'savedprefs');
     }
     if ($request->getCheck('eauth')) {
         $out->wrapWikiMsg("<div class='error' style='clear: both;'>\n\$1\n</div>", 'eauthentsent', $this->target);
     }
     $htmlForm = Preferences::getFormObject($targetuser, $this->getContext(), 'EditUserPreferencesForm', array('password'));
     $htmlForm->setSubmitCallback('Preferences::tryUISubmit');
     $htmlForm->addHiddenField('username', $this->target);
     $htmlForm->show();
 }
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:53,代码来源:EditUser_body.php

示例6: execute

 public function execute($par)
 {
     $this->setHeaders();
     $this->outputHeader();
     $out = $this->getOutput();
     $out->disallowUserJs();
     # Prevent hijacked user scripts from sniffing passwords etc.
     $this->requireLogin('prefsnologintext2');
     $this->checkReadOnly();
     if ($par == 'reset') {
         $this->showResetForm();
         return;
     }
     $out->addModules('mediawiki.special.preferences');
     if ($this->getRequest()->getCheck('success')) {
         $out->wrapWikiMsg("<div class=\"successbox\">\n\$1\n</div>", 'savedprefs');
     }
     $htmlForm = Preferences::getFormObject($this->getUser(), $this->getContext());
     $htmlForm->setSubmitCallback(array('Preferences', 'tryUISubmit'));
     $htmlForm->show();
 }
开发者ID:Tarendai,项目名称:spring-website,代码行数:21,代码来源:SpecialPreferences.php

示例7: execute

 public function execute($par)
 {
     $this->setHeaders();
     $this->outputHeader();
     $out = $this->getOutput();
     $out->disallowUserJs();
     # Prevent hijacked user scripts from sniffing passwords etc.
     $this->requireLogin('prefsnologintext2');
     $this->checkReadOnly();
     if ($par == 'reset') {
         $this->showResetForm();
         return;
     }
     $out->addModules('mediawiki.special.preferences');
     if ($this->getRequest()->getCheck('success')) {
         $out->wrapWikiMsg(Html::rawElement('div', array('class' => 'mw-preferences-messagebox successbox', 'id' => 'mw-preferences-success'), Html::element('p', array(), '$1')), 'savedprefs');
     }
     $this->addHelpLink('Help:Preferences');
     $htmlForm = Preferences::getFormObject($this->getUser(), $this->getContext());
     $htmlForm->setSubmitCallback(array('Preferences', 'tryUISubmit'));
     $htmlForm->show();
 }
开发者ID:MediaWiki-stable,项目名称:1.26.1,代码行数:22,代码来源:SpecialPreferences.php

示例8: execute

 public function execute($par)
 {
     $this->setHeaders();
     $this->outputHeader();
     $out = $this->getOutput();
     $out->disallowUserJs();
     # Prevent hijacked user scripts from sniffing passwords etc.
     $this->requireLogin('prefsnologintext2');
     $this->checkReadOnly();
     if ($par == 'reset') {
         $this->showResetForm();
         return;
     }
     $out->addModules('mediawiki.special.preferences');
     $out->addModuleStyles('mediawiki.special.preferences.styles');
     $session = $this->getRequest()->getSession();
     if ($session->get('specialPreferencesSaveSuccess')) {
         // Remove session data for the success message
         $session->remove('specialPreferencesSaveSuccess');
         $out->addModuleStyles('mediawiki.notification.convertmessagebox.styles');
         $out->addHTML(Html::rawElement('div', ['class' => 'mw-preferences-messagebox mw-notify-success successbox', 'id' => 'mw-preferences-success', 'data-mw-autohide' => 'false'], Html::element('p', [], $this->msg('savedprefs')->text())));
     }
     $this->addHelpLink('Help:Preferences');
     // Load the user from the master to reduce CAS errors on double post (T95839)
     if ($this->getRequest()->wasPosted()) {
         $user = $this->getUser()->getInstanceForUpdate() ?: $this->getUser();
     } else {
         $user = $this->getUser();
     }
     $htmlForm = Preferences::getFormObject($user, $this->getContext());
     $htmlForm->setSubmitCallback(['Preferences', 'tryUISubmit']);
     $sectionTitles = $htmlForm->getPreferenceSections();
     $prefTabs = '';
     foreach ($sectionTitles as $key) {
         $prefTabs .= Html::rawElement('li', ['role' => 'presentation', 'class' => $key === 'personal' ? 'selected' : null], Html::rawElement('a', ['id' => 'preftab-' . $key, 'role' => 'tab', 'href' => '#mw-prefsection-' . $key, 'aria-controls' => 'mw-prefsection-' . $key, 'aria-selected' => $key === 'personal' ? 'true' : 'false', 'tabIndex' => $key === 'personal' ? 0 : -1], $htmlForm->getLegend($key)));
     }
     $out->addHTML(Html::rawElement('ul', ['id' => 'preftoc', 'role' => 'tablist'], $prefTabs));
     $htmlForm->show();
 }
开发者ID:paladox,项目名称:mediawiki,代码行数:39,代码来源:SpecialPreferences.php


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