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


PHP Parser::cleanSigInSig方法代码示例

本文整理汇总了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 . '">&#160;</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);
 }
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:38,代码来源:ApiFeedbackDashboardResponse.php

示例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;
	}
开发者ID:nahoj,项目名称:mediawiki_ynh,代码行数:17,代码来源:Preferences.php

示例3: testCleanSigInSig

 /**
  * cleanSigInSig() just removes tildes
  * @dataProvider provideStringsForCleanSigInSig
  */
 function testCleanSigInSig($in, $out)
 {
     $this->assertEquals(Parser::cleanSigInSig($in), $out);
 }
开发者ID:nischayn22,项目名称:mediawiki-core,代码行数:8,代码来源:ExtraParserTest.php

示例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)]);
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:41,代码来源:HAWelcomeTask.php


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