本文整理汇总了PHP中Parser::cleanSigInSig方法的典型用法代码示例。如果您正苦于以下问题:PHP Parser::cleanSigInSig方法的具体用法?PHP Parser::cleanSigInSig怎么用?PHP Parser::cleanSigInSig使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Parser
的用法示例。
在下文中一共展示了Parser::cleanSigInSig方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
public function execute()
{
global $wgRequest, $wgUser;
if ($wgUser->isAnon()) {
$this->dieUsage("You don't have permission to do that", 'permission-denied');
}
if ($wgUser->isBlocked(false)) {
$this->dieUsageMsg(array('blockedtext'));
}
$params = $this->extractRequestParams();
//Response Object
$item = MBFeedbackResponseItem::create(array());
$setParams = array();
foreach ($params as $key => $value) {
if ($item->isValidKey($key)) {
$setParams[$key] = $value;
}
}
$item->setProperties($setParams);
$item->save();
$commenter = $item->getProperty('feedbackitem')->getProperty('user');
if ($commenter !== null && $commenter->isAnon() == false) {
$talkPage = $commenter->getTalkPage();
$response = Parser::cleanSigInSig($params['response']);
$feedback_link = wfMessage('moodbar-feedback-response-title')->inContentLanguage()->params(SpecialPage::getTitleFor('FeedbackDashboard', $item->getProperty('feedback'))->getPrefixedText())->escaped();
$summary = wfMessage('moodbar-feedback-edit-summary')->inContentLanguage()->rawParams($item->getProperty('feedback'), $response)->escaped();
$this->disableUserTalkEmailNotification();
$id = intval($item->getProperty('id'));
$api = new ApiMain(new FauxRequest(array('action' => 'edit', 'title' => $talkPage->getFullText(), 'appendtext' => ($talkPage->exists() ? "\n\n" : '') . $feedback_link . "\n" . '<span id="feedback-dashboard-response-' . $id . '"></span>' . "\n\n" . $response . "\n\n~~~~\n\n" . '<span class="markashelpful-mbresponse-' . $id . '"> </span>', 'token' => $params['token'], 'summary' => $summary, 'notminor' => true), true, array('wsEditToken' => $wgRequest->getSessionData('wsEditToken'))), true);
$api->execute();
$this->restoreUserTalkEmailNotification();
global $wgLang;
$EMailNotif = new MoodBarHTMLEmailNotification();
$EMailNotif->notifyOnRespond($wgUser, $talkPage, wfTimestampNow(), $item->getProperty('feedback'), $wgLang->truncate($response, 250), $item->getProperty('feedbackitem')->getProperty('type'), $id);
}
$result = array('result' => 'success');
$this->getResult()->addValue(null, $this->getModuleName(), $result);
}
示例2: cleanSignature
/**
* @param $signature string
* @param $alldata array
* @param $form HTMLForm
* @return string
*/
static function cleanSignature( $signature, $alldata, $form ) {
if ( isset( $alldata['fancysig'] ) && $alldata['fancysig'] ) {
global $wgParser;
$signature = $wgParser->cleanSig( $signature );
} else {
// When no fancy sig used, make sure ~{3,5} get removed.
$signature = Parser::cleanSigInSig( $signature );
}
return $signature;
}
示例3: testCleanSigInSig
/**
* cleanSigInSig() just removes tildes
* @dataProvider provideStringsForCleanSigInSig
*/
function testCleanSigInSig($in, $out)
{
$this->assertEquals(Parser::cleanSigInSig($in), $out);
}
示例4: setMessage
/**
* Determines the contents of the welcome message.
*
* @since MediaWiki 1.19.4
* @internal
*/
public function setMessage()
{
$welcomeMessageKey = 'welcome-message-';
// Determine the proper key
//
// Is Message Wall enabled?
$welcomeMessageKey .= $this->getMessageWallExtensionEnabled() ? 'wall-' : '';
// Is recipient a registered user?
$welcomeMessageKey .= $this->recipientId ? 'user' : 'anon';
// Is sender a staff member and not a local admin?
$senderGroups = $this->senderObject->getEffectiveGroups();
if ((in_array('staff', $senderGroups) || in_array('helper', $senderGroups)) && !in_array('sysop', $senderGroups)) {
$welcomeMessageKey .= '-staff';
}
$sPrefixedText = $this->title->getPrefixedText();
// Article Comments and Message Wall hook up to this event.
wfRunHooks('HAWelcomeGetPrefixText', array(&$sPrefixedText, $this->title));
// Determine the key for the signature.
$sSignatureKey = in_array('staff', $senderGroups) && !in_array('sysop', $senderGroups) ? 'staffsig-text' : 'signature';
// Determine the full signature.
$sFullSignature = $this->getTextVersionOfMessage($sSignatureKey, [$this->senderObject->getName(), Parser::cleanSigInSig($this->senderObject->getName())]);
// Append the timestamp to the signature.
$sFullSignature .= ' ~~~~~';
// Put the contents of the welcome message together.
// Messages that can be used here:
// * welcome-message-user
// * welcome-message-user-staff
// * welcome-message-anon
// * welcome-message-anon-staff
// * welcome-message-wall-user
// * welcome-message-wall-user-staff
// * welcome-message-wall-anon
// * welcome-message-wall-anon-staff
$this->welcomeMessage = $this->getPlainVersionOfMessage($welcomeMessageKey, [$sPrefixedText, $this->senderObject->getUserPage()->getTalkPage()->getPrefixedText(), $sFullSignature, wfEscapeWikiText($this->recipientName)]);
}