本文整理汇总了PHP中EditPage::submit方法的典型用法代码示例。如果您正苦于以下问题:PHP EditPage::submit方法的具体用法?PHP EditPage::submit怎么用?PHP EditPage::submit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EditPage
的用法示例。
在下文中一共展示了EditPage::submit方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: hAlternateEdit
function hAlternateEdit(&$eobj)
{
if ($this->inproc) {
return true;
}
# allow other extensions a chance to execute.
# first off, disable AlternateEdit hook
# or else some serious reentrance issue!
$this->inproc = true;
# Substitute the standard EditPage Object
# normally created by MW by a slightly modified
# processing flow.
$ne = new EditPage($eobj->mArticle);
# let the new object follow the normal processing course
$ne->submit();
# run our hook
wfRunHooks('AfterEdit', array(&$ne));
# Stop MW from performing normal processing on our
# way to the standard work flow.
# If this extension was loaded first against the
# 'AlternateEdit' hook, then other extensions on this hook
# won't be called twice.
return false;
}
示例2: performAction
/**
* Perform one of the "standard" actions
*/
function performAction(&$output, &$article, &$title, &$user, &$request)
{
wfProfileIn('MediaWiki::performAction');
$action = $this->getVal('Action');
if (in_array($action, $this->getVal('DisabledActions', array()))) {
/* No such action; this will switch to the default case */
$action = 'nosuchaction';
}
switch ($action) {
case 'view':
$output->setSquidMaxage($this->getVal('SquidMaxage'));
$article->view();
break;
case 'watch':
case 'unwatch':
case 'delete':
case 'revert':
case 'rollback':
case 'protect':
case 'unprotect':
case 'info':
case 'markpatrolled':
case 'render':
case 'deletetrackback':
case 'purge':
$article->{$action}();
break;
case 'print':
$article->view();
break;
case 'dublincore':
if (!$this->getVal('EnableDublinCoreRdf')) {
wfHttpError(403, 'Forbidden', wfMsg('nodublincore'));
} else {
require_once 'includes/Metadata.php';
wfDublinCoreRdf($article);
}
break;
case 'creativecommons':
if (!$this->getVal('EnableCreativeCommonsRdf')) {
wfHttpError(403, 'Forbidden', wfMsg('nocreativecommons'));
} else {
require_once 'includes/Metadata.php';
wfCreativeCommonsRdf($article);
}
break;
case 'credits':
require_once 'includes/Credits.php';
showCreditsPage($article);
break;
case 'submit':
if (!$this->getVal('CommandLineMode') && !$request->checkSessionCookie()) {
/* Send a cookie so anons get talk message notifications */
User::SetupSession();
}
/* Continue... */
/* Continue... */
case 'edit':
$internal = $request->getVal('internaledit');
$external = $request->getVal('externaledit');
$section = $request->getVal('section');
$oldid = $request->getVal('oldid');
if (!$this->getVal('UseExternalEditor') || $action == 'submit' || $internal || $section || $oldid || !$user->getOption('externaleditor') && !$external) {
$editor = new EditPage($article);
$editor->submit();
} elseif ($this->getVal('UseExternalEditor') && ($external || $user->getOption('externaleditor'))) {
$mode = $request->getVal('mode');
$extedit = new ExternalEdit($article, $mode);
$extedit->edit();
}
break;
case 'history':
if ($_SERVER['REQUEST_URI'] == $title->getInternalURL('action=history')) {
$output->setSquidMaxage($this->getVal('SquidMaxage'));
}
$history = new PageHistory($article);
$history->history();
break;
case 'raw':
$raw = new RawPage($article);
$raw->view();
break;
default:
if (wfRunHooks('UnknownAction', array($action, $article))) {
$output->showErrorPage('nosuchaction', 'nosuchactiontext');
}
}
wfProfileOut('MediaWiki::performAction');
}
示例3: performAction
/**
* Perform one of the "standard" actions
*
* @param $output OutputPage
* @param $article Article
* @param $title Title
* @param $user User
* @param $request WebRequest
*/
function performAction(&$output, &$article, &$title, &$user, &$request)
{
wfProfileIn(__METHOD__);
if (!wfRunHooks('MediaWikiPerformAction', array($output, $article, $title, $user, $request, $this))) {
wfProfileOut(__METHOD__);
return;
}
$action = $this->getVal('Action');
if (in_array($action, $this->getVal('DisabledActions', array()))) {
/* No such action; this will switch to the default case */
$action = 'nosuchaction';
}
// Workaround for bug #20966: inability of IE to provide an action dependent
// on which submit button is clicked.
if ($action === 'historysubmit') {
if ($request->getBool('revisiondelete')) {
$action = 'revisiondelete';
} else {
$action = 'view';
}
}
switch ($action) {
case 'view':
$output->setSquidMaxage($this->getVal('SquidMaxage'));
$article->view();
break;
case 'raw':
// includes JS/CSS
wfProfileIn(__METHOD__ . '-raw');
$raw = new RawPage($article);
$raw->view();
wfProfileOut(__METHOD__ . '-raw');
break;
case 'watch':
case 'unwatch':
case 'delete':
case 'revert':
case 'rollback':
case 'protect':
case 'unprotect':
case 'info':
case 'markpatrolled':
case 'render':
case 'deletetrackback':
case 'purge':
$article->{$action}();
break;
case 'print':
$article->view();
break;
case 'dublincore':
if (!$this->getVal('EnableDublinCoreRdf')) {
wfHttpError(403, 'Forbidden', wfMsg('nodublincore'));
} else {
$rdf = new DublinCoreRdf($article);
$rdf->show();
}
break;
case 'creativecommons':
if (!$this->getVal('EnableCreativeCommonsRdf')) {
wfHttpError(403, 'Forbidden', wfMsg('nocreativecommons'));
} else {
$rdf = new CreativeCommonsRdf($article);
$rdf->show();
}
break;
case 'credits':
Credits::showPage($article);
break;
case 'submit':
if (session_id() == '') {
/* Send a cookie so anons get talk message notifications */
wfSetupSession();
}
/* Continue... */
/* Continue... */
case 'edit':
case 'editredlink':
if (wfRunHooks('CustomEditor', array($article, $user))) {
$internal = $request->getVal('internaledit');
$external = $request->getVal('externaledit');
$section = $request->getVal('section');
$oldid = $request->getVal('oldid');
if (!$this->getVal('UseExternalEditor') || $action == 'submit' || $internal || $section || $oldid || !$user->getOption('externaleditor') && !$external) {
$editor = new EditPage($article);
$editor->submit();
} elseif ($this->getVal('UseExternalEditor') && ($external || $user->getOption('externaleditor'))) {
$mode = $request->getVal('mode');
$extedit = new ExternalEdit($article, $mode);
$extedit->edit();
}
//.........这里部分代码省略.........
示例4: EditPage
case 'submit':
if (!$wgCommandLineMode && !$wgRequest->checkSessionCookie()) {
# Send a cookie so anons get talk message notifications
User::SetupSession();
}
# Continue...
# Continue...
case 'edit':
$internal = $wgRequest->getVal('internaledit');
$external = $wgRequest->getVal('externaledit');
$section = $wgRequest->getVal('section');
$oldid = $wgRequest->getVal('oldid');
if (!$wgUseExternalEditor || $action == 'submit' || $internal || $section || $oldid || !$wgUser->getOption('externaleditor') && !$external) {
require_once 'includes/EditPage.php';
$editor = new EditPage($wgArticle);
$editor->submit();
} elseif ($wgUseExternalEditor && ($external || $wgUser->getOption('externaleditor'))) {
require_once 'includes/ExternalEdit.php';
$mode = $wgRequest->getVal('mode');
$extedit = new ExternalEdit($wgArticle, $mode);
$extedit->edit();
}
break;
case 'history':
if ($_SERVER['REQUEST_URI'] == $wgTitle->getInternalURL('action=history')) {
$wgOut->setSquidMaxage($wgSquidMaxage);
}
require_once 'includes/PageHistory.php';
$history = new PageHistory($wgArticle);
$history->history();
break;
示例5: performAction
/**
* Perform one of the "standard" actions
*/
function performAction(&$output, &$article, &$title, &$user, &$request)
{
wfProfileIn('MediaWiki::performAction');
if (!wfRunHooks('MediaWikiPerformAction', array($output, $article, $title, $user, $request))) {
wfProfileOut('MediaWiki::performAction');
return;
}
$action = $this->getVal('Action');
if (in_array($action, $this->getVal('DisabledActions', array()))) {
/* No such action; this will switch to the default case */
$action = 'nosuchaction';
}
switch ($action) {
case 'view':
$output->setSquidMaxage($this->getVal('SquidMaxage'));
$article->view();
break;
case 'watch':
case 'unwatch':
case 'delete':
case 'revert':
case 'rollback':
case 'protect':
case 'unprotect':
case 'info':
case 'markpatrolled':
case 'render':
case 'deletetrackback':
case 'purge':
$article->{$action}();
break;
case 'print':
$article->view();
break;
case 'dublincore':
if (!$this->getVal('EnableDublinCoreRdf')) {
wfHttpError(403, 'Forbidden', wfMsg('nodublincore'));
} else {
require_once 'includes/Metadata.php';
wfDublinCoreRdf($article);
}
break;
case 'creativecommons':
if (!$this->getVal('EnableCreativeCommonsRdf')) {
wfHttpError(403, 'Forbidden', wfMsg('nocreativecommons'));
} else {
require_once 'includes/Metadata.php';
wfCreativeCommonsRdf($article);
}
break;
case 'credits':
require_once 'includes/Credits.php';
showCreditsPage($article);
break;
case 'submit':
case 'submit2':
if (session_id() == '') {
/* Send a cookie so anons get talk message notifications */
wfSetupSession();
}
/* Continue... */
/* Continue... */
case 'edit':
if (wfRunHooks('CustomEditor', array($article, $user))) {
$internal = $request->getVal('internaledit');
$external = $request->getVal('externaledit');
$section = $request->getVal('section');
$oldid = $request->getVal('oldid');
///-------------------------------------------
// XXADDED
// do we have a title? if not, it's a new article, use the wrapper.
if ($request->getVal('advanced') != 'true') {
$newArticle = false;
// if it's not new, is it already a wikiHow?
$validWikiHow = false;
if ($title->getNamespace() == NS_MAIN && $request->getVal('section', null) == null) {
if ($request->getVal("title") == "") {
$newArticle = true;
} else {
if ($title->getArticleID() == 0) {
$newArticle = true;
}
}
if (!$newArticle) {
$validWikiHow = WikihowArticleEditor::useWrapperForEdit($article);
}
}
// use the wrapper if it's a new article or
// if it's an existing wikiHow article
$t = $request->getVal('title', null);
$editor = $user->getOption('defaulteditor', '');
if (empty($editor)) {
$editor = $user->getOption('useadvanced', false) ? 'advanced' : 'visual';
}
if ($t != null && $t != wfMsg('mainpage') && $editor == 'advanced' && !$request->getVal('override', null)) {
// use advanced if they have already set a title
// and have the default preference setting
//.........这里部分代码省略.........
示例6: performAction
/**
* Perform one of the "standard" actions
*
* @param $article Article
*/
private function performAction(Page $article)
{
global $wgSquidMaxage, $wgUseExternalEditor;
wfProfileIn(__METHOD__);
$request = $this->context->getRequest();
$output = $this->context->getOutput();
$title = $this->context->getTitle();
$user = $this->context->getUser();
if (!wfRunHooks('MediaWikiPerformAction', array($output, $article, $title, $user, $request, $this))) {
wfProfileOut(__METHOD__);
return;
}
$act = $this->getAction();
$action = Action::factory($act, $article);
if ($action instanceof Action) {
$action->show();
wfProfileOut(__METHOD__);
return;
}
switch ($act) {
case 'view':
$output->setSquidMaxage($wgSquidMaxage);
$article->view();
break;
case 'raw':
// includes JS/CSS
wfProfileIn(__METHOD__ . '-raw');
$raw = new RawPage($article);
$raw->view();
wfProfileOut(__METHOD__ . '-raw');
break;
case 'delete':
case 'protect':
case 'unprotect':
case 'render':
$article->{$act}();
break;
case 'submit':
if (session_id() == '') {
// Send a cookie so anons get talk message notifications
wfSetupSession();
}
// Continue...
// Continue...
case 'edit':
if (wfRunHooks('CustomEditor', array($article, $user))) {
$internal = $request->getVal('internaledit');
$external = $request->getVal('externaledit');
$section = $request->getVal('section');
$oldid = $request->getVal('oldid');
if (!$wgUseExternalEditor || $act == 'submit' || $internal || $section || $oldid || !$user->getOption('externaleditor') && !$external) {
$editor = new EditPage($article);
$editor->submit();
} elseif ($wgUseExternalEditor && ($external || $user->getOption('externaleditor'))) {
$mode = $request->getVal('mode');
$extedit = new ExternalEdit($article->getTitle(), $mode);
$extedit->edit();
}
}
break;
case 'history':
if ($request->getFullRequestURL() == $title->getInternalURL('action=history')) {
$output->setSquidMaxage($wgSquidMaxage);
}
$history = new HistoryPage($article);
$history->history();
break;
default:
if (wfRunHooks('UnknownAction', array($act, $article))) {
$output->showErrorPage('nosuchaction', 'nosuchactiontext');
}
}
wfProfileOut(__METHOD__);
}