<name>com.woltlab.wcf.comment</name>
<definitionname>com.woltlab.wcf.message</definitionname>
</type>
+ <type>
+ <name>com.woltlab.wcf.paidSubscription</name>
+ <definitionname>com.woltlab.wcf.message</definitionname>
+ </type>
<type>
<name>com.woltlab.wcf.bbcode.smiley</name>
<li>
<div class="containerHeadline">
<h3>{$subscription->title|language} <span class="badge label">{lang}wcf.paidSubscription.formattedCost{/lang}</span></h3>
- <p>{@$subscription->description|language|newlineToBreak}</p>
+ <p>{@$subscription->getFormattedDescription()}</p>
</div>
<div class="containerContent">
<dl{if $errorField == 'description'} class="formError"{/if}>
<dt><label for="description">{lang}wcf.global.description{/lang}</label></dt>
<dd>
- <textarea id="description" name="description" cols="40" rows="10">{$i18nPlainValues[description]}</textarea>
+ <textarea id="description" name="description" class="wysiwygTextarea"
+ data-disable-attachments="true"
+ data-disable-media="true"
+ >{$i18nPlainValues[description]}</textarea>
+ {include file='wysiwyg' wysiwygSelector='description'}
{if $errorField == 'description'}
<small class="innerError">
{if $errorType == 'empty'}
namespace wcf\data\paid\subscription;
use wcf\data\object\type\ObjectTypeCache;
use wcf\data\DatabaseObject;
+use wcf\system\html\output\HtmlOutputProcessor;
use wcf\system\payment\method\PaymentMethodHandler;
use wcf\system\request\LinkHandler;
use wcf\system\WCF;
public function getDateInterval() {
return new \DateInterval('P' . $this->subscriptionLength . $this->subscriptionLengthUnit);
}
+
+ /**
+ * Returns the formatted description, with support for legacy descriptions without HTML.
+ *
+ * @return string
+ */
+ public function getFormattedDescription() {
+ $description = $this->getDescription();
+ if (preg_match('~^<[a-z]+~', $description)) {
+ $processor = new HtmlOutputProcessor();
+ $processor->process($description, 'com.woltlab.wcf.paidSubscription', $this->subscriptionID);
+
+ return $processor->getHtml();
+ }
+
+ return nl2br($description, false);
+ }
+
+ /**
+ * Returns the description with transparent handling of phrases.
+ *
+ * @return string
+ */
+ protected function getDescription() {
+ if (preg_match('~^wcf.paidSubscription.subscription\d+.description$~', $this->description)) {
+ return WCF::getLanguage()->get($this->description);
+ }
+
+ return $this->description;
+ }
}