/**
  * Fetches the information of the latest edit.
  * 
  * @see	\wcf\data\DatabaseObjectDecorator::__construct()
  */
 public function __construct(DatabaseObject $object)
 {
     parent::__construct($object);
     $objectTypeID = ObjectTypeCache::getInstance()->getObjectTypeIDByName('com.woltlab.wcf.modifiableContent', 'de.incendium.cms.news.entry');
     $sql = "SELECT\t*\n\t\t\tFROM\twcf" . WCF_N . "_modification_log\n\t\t\tWHERE\t\tobjectTypeID = ?\n\t\t\t\tAND\tobjectID = ?\n\t\t\t\tAND\taction = ?\n\t\t\tORDER BY time DESC";
     $statement = WCF::getDB()->prepareStatement($sql, 1);
     $statement->execute(array($objectTypeID, $this->getDecoratedObject()->entryID, 'edit'));
     $row = $statement->fetchArray();
     if ($row) {
         $this->userID = $row['userID'];
         $this->username = $row['username'];
         $this->time = $row['time'];
         $additionalData = @unserialize($row['additionalData']);
         if (isset($additionalData['reason'])) {
             $this->reason = $additionalData['reason'];
         } else {
             $this->reason = '';
         }
     } else {
         $this->userID = $this->getDecoratedObject()->getUserID();
         $this->username = $this->getDecoratedObject()->getUsername();
         $this->time = $this->getDecoratedObject()->getTime();
         $this->reason = '';
     }
 }
Пример #2
0
 /**
  * @see	wcf\data\DatabaseObjectDecorator::__construct()
  */
 public function __construct(DatabaseObject $object, $inludeDisabledCategories = false, array $excludedCategoryIDs = array())
 {
     parent::__construct($object);
     $this->inludeDisabledCategories = $inludeDisabledCategories;
     $this->excludedCategoryIDs = $excludedCategoryIDs;
     $className = get_called_class();
     foreach (CategoryHandler::getInstance()->getChildCategories($this->getDecoratedObject()) as $category) {
         if ($this->fulfillsConditions($category)) {
             $this->childCategories[] = new $className($category, $inludeDisabledCategories, $excludedCategoryIDs);
         }
     }
 }
Пример #3
0
 /**
  * Creates a new ActiveStyle object.
  * 
  * @param	Style	$object
  */
 public function __construct(Style $object)
 {
     parent::__construct($object);
     // calculate page logo path
     if (!empty($this->object->data['variables']['page.logo.image']) && !FileUtil::isURL($this->object->data['variables']['page.logo.image']) && StringUtil::substring($this->object->data['variables']['page.logo.image'], 0, 1) !== '/') {
         $this->object->data['variables']['page.logo.image'] = RELATIVE_WCF_DIR . $this->object->data['variables']['page.logo.image'];
     }
     // load icon cache
     $cacheName = 'icon-' . PACKAGE_ID . '-' . $this->styleID;
     CacheHandler::getInstance()->addResource($cacheName, WCF_DIR . 'cache/cache.' . $cacheName . '.php', 'wcf\\system\\cache\\builder\\IconCacheBuilder');
     $this->iconCache = CacheHandler::getInstance()->get($cacheName);
 }