本文整理汇总了PHP中HTMLForm::getContext方法的典型用法代码示例。如果您正苦于以下问题:PHP HTMLForm::getContext方法的具体用法?PHP HTMLForm::getContext怎么用?PHP HTMLForm::getContext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTMLForm
的用法示例。
在下文中一共展示了HTMLForm::getContext方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showDiff
public static function showDiff($data, HTMLForm $form)
{
$rev1 = self::revOrTitle($data['Revision1'], $data['Page1']);
$rev2 = self::revOrTitle($data['Revision2'], $data['Page2']);
if ($rev1 && $rev2) {
$de = new DifferenceEngine($form->getContext(), $rev1, $rev2, null, $data['Action'] == 'purge', $data['Unhide'] == '1');
$de->showDiffPage(true);
}
}
示例2: showDiff
public static function showDiff($data, HTMLForm $form)
{
$rev1 = self::revOrTitle($data['Revision1'], $data['Page1']);
$rev2 = self::revOrTitle($data['Revision2'], $data['Page2']);
if ($rev1 && $rev2) {
$revision = Revision::newFromId($rev1);
if ($revision) {
// NOTE: $rev1 was already checked, should exist.
$contentHandler = $revision->getContentHandler();
$de = $contentHandler->createDifferenceEngine($form->getContext(), $rev1, $rev2, null, $data['Action'] == 'purge', $data['Unhide'] == '1');
$de->showDiffPage(true);
}
}
}
示例3: uiSubmit
/**
* Submit callback for an HTMLForm object, will simply call submit().
*
* @since 1.20
* @param array $data
* @param HTMLForm $form
* @return Status|string|bool
*/
public static function uiSubmit(array $data, HTMLForm $form)
{
return self::submit($data, $form->getContext());
}
示例4: processUIUnblock
/**
* Submit callback for an HTMLForm object
* @param array $data
* @param HTMLForm $form
* @return Array( Array(message key, parameters)
*/
public static function processUIUnblock(array $data, HTMLForm $form)
{
return self::processUnblock($data, $form->getContext());
}
示例5: processTagForm
public function processTagForm(array $data, HTMLForm $form)
{
$context = $form->getContext();
$out = $context->getOutput();
$tag = $data['HiddenTag'];
$status = call_user_func(['ChangeTags', "{$form->tagAction}TagWithChecks"], $tag, $data['Reason'], $context->getUser(), true);
if ($status->isGood()) {
$out->redirect($this->getPageTitle()->getLocalURL());
return true;
} elseif ($status->isOK() && $form->tagAction === 'delete') {
// deletion succeeded, but hooks raised a warning
$out->addWikiText($this->msg('tags-delete-warnings-after-delete', $tag, count($status->getWarningsArray()))->text() . "\n" . $status->getWikitext());
$out->addReturnTo($this->getPageTitle());
return true;
} else {
$out->addWikiText("<div class=\"error\">\n" . $status->getWikitext() . "\n</div>");
return false;
}
}
示例6: onSubmit
/**
* Process the form on POST submission.
* @param array $data
* @param HTMLForm $form
* @return bool|array True for success, false for didn't-try, array of errors on failure
*/
public function onSubmit(array $data, HTMLForm $form = null)
{
return self::processForm($data, $form->getContext());
}