Made CSS class htmlContent configurable by activity events
authorMarcel Werk <burntime@woltlab.com>
Tue, 14 Mar 2017 17:42:11 +0000 (18:42 +0100)
committerMarcel Werk <burntime@woltlab.com>
Tue, 14 Mar 2017 17:42:11 +0000 (18:42 +0100)
see #2234

com.woltlab.wcf/templates/recentActivityListItem.tpl
wcfsetup/install/files/lib/data/user/activity/event/ViewableUserActivityEvent.class.php

index 25193542bb668c80a316ee9a2b9f35dc493e6473..f70decf5ac4a42d945fee68f867d0e8f47aceb1b 100644 (file)
@@ -13,7 +13,7 @@
                                        <small class="containerContentType">{lang}wcf.user.recentActivity.{@$event->getObjectTypeName()}{/lang}</small>
                                </div>
                                
-                               <div class="containerContent htmlContent">{@$event->getDescription()}</div>
+                               <div class="containerContent{if !$event->isRawHtml()} htmlContent{/if}">{@$event->getDescription()}</div>
                        </div>
                </div>
        </li>
index 0ff6818e5a5c43d2fced42a862ceecfe80fd40ff..04322e480fc9ac75a67ec923fe184ed774f5de1e 100644 (file)
@@ -52,6 +52,12 @@ class ViewableUserActivityEvent extends DatabaseObjectDecorator {
         */
        protected $userProfile = null;
        
+       /**
+        * true if event description contains raw html
+        * @var boolean
+        */
+       protected $isRawHtml = false;
+       
        /**
         * Marks this event as accessible for current user.
         */
@@ -111,9 +117,11 @@ class ViewableUserActivityEvent extends DatabaseObjectDecorator {
         * Sets event text.
         * 
         * @param       string          $description
+        * @param       boolean         $isRawHtml
         */
-       public function setDescription($description) {
+       public function setDescription($description, $isRawHtml = false) {
                $this->description = $description;
+               $this->isRawHtml = $isRawHtml;
        }
        
        /**
@@ -151,4 +159,14 @@ class ViewableUserActivityEvent extends DatabaseObjectDecorator {
        public function getObjectTypeName() {
                return UserActivityEventHandler::getInstance()->getObjectType($this->objectTypeID)->objectType;
        }
+       
+       /**
+        * Returns true if event description contains raw html.
+        * 
+        * @return      boolean
+        * @since       3.1
+        */
+       public function isRawHtml() {
+               return $this->isRawHtml;
+       }
 }