Esempio n. 1
0
 public function readData()
 {
     parent::readData();
     WCF::getBreadcrumbs()->add(new Breadcrumb(WCF::getLanguage()->get('cms.page.news'), LinkHandler::getInstance()->getLink('NewsCategoryList', array('application' => 'cms'))));
     $excludedCategoryIDs = array_diff(NewsCategory::getAccessibleCategoryIDs(), NewsCategory::getAccessibleCategoryIDs(array('canAddNews')));
     $categoryTree = new NewsCategoryNodeTree('de.codequake.cms.category.news', 0, false, $excludedCategoryIDs);
     $this->categoryList = $categoryTree->getIterator();
     $this->categoryList->setMaxDepth(0);
     if (empty($_POST)) {
         $dateTime = DateUtil::getDateTimeByTimestamp(TIME_NOW);
         $dateTime->setTimezone(WCF::getUser()->getTimeZone());
         $this->time = $dateTime->format('c');
     } else {
         $dateTime = DateUtil::getDateTimeByTimestamp(@strtotime($this->time));
         $dateTime->setTimezone(WCF::getUser()->getTimeZone());
         $this->time = $dateTime->format('c');
     }
     // default values
     if (empty($_POST)) {
         $this->username = WCF::getSession()->getVar('username');
         // multilingualism
         if (!empty($this->availableContentLanguages)) {
             if ($this->languageID) {
                 $language = LanguageFactory::getInstance()->getUserLanguage();
                 $this->languageID = $language->languageID;
             }
             if (!isset($this->availableContentLanguages[$this->languageID])) {
                 $languageIDs = array_keys($this->availableContentLanguages);
                 $this->languageID = array_shift($languageIDs);
             }
         }
     }
 }
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     //add breadcrump
     $leafCategories = $this->entry->getLeafCategories();
     $category = reset($leafCategories);
     FILEBASECore::getInstance()->setLocation($category->getParentCategories(), $category, $this->entry);
 }
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     // get the accessible news categories
     $categoryTree = new NewsCategoryNodeTree('de.voolia.news.category');
     $this->categoryList = $categoryTree->getIterator();
     $this->categoryList->setMaxDepth(0);
     if (empty($_POST)) {
         // multilingualism
         if (!empty($this->availableContentLanguages)) {
             if (!$this->languageID) {
                 $language = LanguageFactory::getInstance()->getUserLanguage();
                 $this->languageID = $language->languageID;
             }
             if (!isset($this->availableContentLanguages[$this->languageID])) {
                 $languageIDs = array_keys($this->availableContentLanguages);
                 $this->languageID = array_shift($languageIDs);
             }
         }
         // set default publication and archivation date
         $dateTime = DateUtil::getDateTimeByTimestamp(TIME_NOW);
         $dateTime->setTimezone(WCF::getUser()->getTimeZone());
         $this->publicationDate = $this->archivingDate = $dateTime->format('c');
     }
     // add breadcrumbs
     NEWSCore::getInstance()->setBreadcrumbs();
 }
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     if (empty($_POST)) {
         // check for quick reply message
         $this->text = QuickReplyManager::getInstance()->getMessage('conversation', $this->conversation->conversationID);
         if (empty($this->text)) {
             if (MessageQuoteManager::getInstance()->getQuoteMessageID()) {
                 $message = new ConversationMessage(MessageQuoteManager::getInstance()->getQuoteMessageID());
                 if (!$message->messageID) {
                     throw new IllegalLinkException();
                 }
                 if ($message->conversationID == $this->conversation->conversationID) {
                     $message->setConversation($this->conversation);
                     $this->text = MessageQuoteManager::getInstance()->renderQuote($message, $message->message);
                 }
             }
             if (empty($this->text)) {
                 // get all message ids from current conversation
                 $sql = "SELECT\tmessageID\n\t\t\t\t\t\tFROM\twcf" . WCF_N . "_conversation_message\n\t\t\t\t\t\tWHERE\tconversationID = ?";
                 $statement = WCF::getDB()->prepareStatement($sql);
                 $statement->execute(array($this->conversation->conversationID));
                 $messageIDs = array();
                 while ($row = $statement->fetchArray()) {
                     $messageIDs[] = $row['messageID'];
                 }
                 $renderedQuotes = MessageQuoteManager::getInstance()->getQuotesByObjectIDs('com.woltlab.wcf.conversation.message', $messageIDs);
                 if (!empty($renderedQuotes)) {
                     $this->text = implode("\n", $renderedQuotes);
                 }
             }
         }
     }
     // add breadcrumbs
     WCF::getBreadcrumbs()->add(new Breadcrumb(WCF::getLanguage()->get('wcf.conversation.conversations'), LinkHandler::getInstance()->getLink('ConversationList')));
     WCF::getBreadcrumbs()->add($this->conversation->getBreadcrumb());
     // get message list
     $this->messageList = new ViewableConversationMessageList();
     $this->messageList->setConversation($this->conversation);
     $this->messageList->sqlLimit = CONVERSATION_REPLY_SHOW_MESSAGES_MAX;
     $this->messageList->sqlOrderBy = 'conversation_message.time DESC';
     $this->messageList->getConditionBuilder()->add('conversation_message.conversationID = ?', array($this->conversation->conversationID));
     $this->messageList->readObjects();
 }
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     MessageForm::readData();
     if (empty($_POST)) {
         $this->text = $this->message->message;
         if ($this->isFirstMessage) {
             $this->participantCanInvite = $this->conversation->participantCanInvite;
             $this->subject = $this->conversation->subject;
             if ($this->conversation->isDraft && $this->conversation->draftData) {
                 $draftData = @unserialize($this->conversation->draftData);
                 if (!empty($draftData['participants'])) {
                     foreach (UserProfile::getUserProfiles($draftData['participants']) as $user) {
                         if (!empty($this->participants)) {
                             $this->participants .= ', ';
                         }
                         $this->participants .= $user->username;
                     }
                 }
                 if (!empty($draftData['invisibleParticipants'])) {
                     foreach (UserProfile::getUserProfiles($draftData['invisibleParticipants']) as $user) {
                         if (!empty($this->invisibleParticipants)) {
                             $this->invisibleParticipants .= ', ';
                         }
                         $this->invisibleParticipants .= $user->username;
                     }
                 }
             }
         }
     }
     // add breadcrumbs
     WCF::getBreadcrumbs()->add(new Breadcrumb(WCF::getLanguage()->get('wcf.conversation.conversations'), LinkHandler::getInstance()->getLink('ConversationList')));
     WCF::getBreadcrumbs()->add($this->conversation->getBreadcrumb());
     // get message list
     $this->messageList = new ViewableConversationMessageList();
     $this->messageList->setConversation($this->conversation);
     $this->messageList->sqlLimit = CONVERSATION_REPLY_SHOW_MESSAGES_MAX;
     $this->messageList->sqlOrderBy = 'conversation_message.time DESC';
     $this->messageList->getConditionBuilder()->add('conversation_message.conversationID = ?', array($this->message->conversationID));
     $this->messageList->getConditionBuilder()->add("conversation_message.messageID <> ?", array($this->message->messageID));
     $this->messageList->readObjects();
 }
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     // get categories
     $excludedCategoryIDs = array_diff(FilebaseCategory::getAccessibleCategoryIDs(), FilebaseCategory::getAccessibleCategoryIDs(array('canUseCategory')));
     $categoryTree = new FilebaseCategoryNodeTree('de.incendium.filebase.category', 0, false, $excludedCategoryIDs);
     $this->categoryList = $categoryTree->getIterator();
     $this->categoryList->setMaxDepth(0);
     if (empty($_POST)) {
         // multilingualism
         if (!empty($this->availableContentLanguages)) {
             if (!$this->languageID) {
                 $language = LanguageFactory::getInstance()->getUserLanguage();
                 $this->languageID = $language->languageID;
             }
             if (!isset($this->availableContentLanguages[$this->languageID])) {
                 $languageIDs = array_keys($this->availableContentLanguages);
                 $this->languageID = array_shift($languageIDs);
             }
         }
     }
 }
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     // default values
     if (empty($_POST)) {
         $this->enableBBCodes = WCF::getUser()->signatureEnableBBCodes;
         $this->enableHtml = WCF::getUser()->signatureEnableHtml;
         $this->enableSmilies = WCF::getUser()->signatureEnableSmilies;
         $this->text = WCF::getUser()->signature;
         $this->preParse = true;
     }
     $this->signatureCache = SignatureCache::getInstance()->getSignature(WCF::getUser());
 }
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     // add breadcrumbs
     WCF::getBreadcrumbs()->add(new Breadcrumb(WCF::getLanguage()->get('wcf.conversation.conversations'), LinkHandler::getInstance()->getLink('ConversationList')));
 }
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     // add breadcrumbs
     NEWSCore::getInstance()->setBreadcrumbs(array(), null, $this->news->getDecoratedObject());
 }
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     // add breadcrumbs
     WCF::getBreadcrumbs()->add(new Breadcrumb(WCF::getLanguage()->get('cms.header.menu.news'), LinkHandler::getInstance()->getLink('NewsOverview', array('application' => 'cms'))));
     if ($this->entry->isArchived) {
         WCF::getBreadcrumbs()->add(new Breadcrumb(WCF::getLanguage()->get('cms.header.menu.news.archive'), LinkHandler::getInstance()->getLink('NewsArchive', array('application' => 'cms'))));
     }
     WCF::getBreadcrumbs()->add($this->entry->getBreadcrumb());
 }