/**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     // read out template groups
     $templateGroupList = new TemplateGroupList();
     $templateGroupList->readObjects();
     // build template group hierarchy (template groups that are parents of the template group of the selected template)
     $this->templateGroupHierarchy = array();
     $templateGroup = $templateGroupList->search($this->template->templateGroupID);
     while ($templateGroup !== null) {
         $this->templateGroupHierarchy[$templateGroup->templateGroupID] = array('group' => $templateGroup, 'hasTemplate' => false);
         $templateGroup = $templateGroupList->search($templateGroup->parentTemplateGroupID);
     }
     $this->templateGroupHierarchy[0] = array('group' => array(), 'hasTemplate' => false);
     // find matching templates in the hierarchy
     $templateList = new TemplateList();
     $templateList->getConditionBuilder()->add('templateName = ?', array($this->template->templateName));
     $templateList->getConditionBuilder()->add('application = ?', array($this->template->application));
     $templateList->getConditionBuilder()->add('(template.templateGroupID IN(?) OR template.templateGroupID IS NULL)', array(array_keys($this->templateGroupHierarchy)));
     $templateList->readObjects();
     foreach ($templateList as $template) {
         $this->templateGroupHierarchy[$template->templateGroupID ?: 0]['hasTemplate'] = $template->templateID;
     }
     // a valid parent template was given, calculate diff
     if ($this->parent->templateID) {
         $a = explode("\n", StringUtil::unifyNewlines($this->parent->getSource()));
         $b = explode("\n", StringUtil::unifyNewlines($this->template->getSource()));
         $this->diff = new Diff($a, $b);
     }
 }
	/**
	 * @see	wcf\page\IPage::readData()
	 */
	public function readData() {
		parent::readData();
		
		$menuItemList = new PageMenuItemList();
		$menuItemList->sqlOrderBy = "page_menu_item.parentMenuItem ASC, page_menu_item.showOrder ASC";
		$menuItemList->readObjects();
		
		foreach ($menuItemList as $menuItem) {
			if ($menuItem->menuPosition == 'footer') {
				if ($menuItem->parentMenuItem) {
					$this->footerItems[$menuItem->parentMenuItem]->addChild($menuItem);
				}
				else {
					$this->footerItems[$menuItem->menuItem] = $menuItem;
				}
			}
			else {
				if ($menuItem->parentMenuItem) {
					$this->headerItems[$menuItem->parentMenuItem]->addChild($menuItem);
				}
				else {
					$this->headerItems[$menuItem->menuItem] = new ViewablePageMenuItem($menuItem);
				}
			}
		}
	}
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     // get object types
     $this->objectTypes = ObjectTypeCache::getInstance()->getObjectTypes('com.woltlab.wcf.rebuildData');
     // sort object types
     uasort($this->objectTypes, function ($a, $b) {
         $niceValueA = $a->nicevalue ?: 0;
         $niceValueB = $b->nicevalue ?: 0;
         if ($niceValueA < $niceValueB) {
             return -1;
         } else {
             if ($niceValueA > $niceValueB) {
                 return 1;
             }
         }
         return 0;
     });
     $sql = "SHOW VARIABLES LIKE 'innodb_flush_log_at_trx_commit'";
     $statement = WCF::getDB()->prepareStatement($sql);
     $statement->execute();
     $row = $statement->fetchArray();
     if ($row && $row['Value'] == 1) {
         $this->showInnoDBWarning = true;
     }
 }
	/**
	 * @see	wcf\page\IPage::readData()
	 */
	public function readData() {
		parent::readData();
		
		$this->packageInstallationDispatcher = new PackageInstallationDispatcher($this->queue);
		
		// get requirements
		$this->requirements = $this->packageInstallationDispatcher->getArchive()->getRequirements();
		$this->openRequirements = $this->packageInstallationDispatcher->getArchive()->getOpenRequirements();
		
		foreach ($this->requirements as &$requirement) {
			if (isset($this->openRequirements[$requirement['name']])) {
				$requirement['status'] = 'missing';
				$requirement['action'] = $this->openRequirements[$requirement['name']]['action'];
				
				if (!isset($requirement['file'])) {
					if ($this->openRequirements[$requirement['name']]['action'] === 'update') {
						$requirement['status'] = 'missingVersion';
						$requirement['existingVersion'] = $this->openRequirements[$requirement['name']]['existingVersion'];
					}
					$this->missingPackages++;
				}
				else {
					$requirement['status'] = 'delivered';
				}
			}
			else {
				$requirement['status'] = 'installed';
			}
		}
		unset($requirement);
	}
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     $serverList = new PackageUpdateServerList();
     $serverList->readObjects();
     foreach ($serverList as $server) {
         if (preg_match('~https?://store.woltlab.com/(?P<wcfMajorRelease>[a-z]+)/~', $server->serverURL, $matches)) {
             $this->updateServers[$matches['wcfMajorRelease']] = $server;
         }
     }
     foreach ($this->products as $packageUpdateID => $product) {
         $wcfMajorRelease = $product['wcfMajorRelease'];
         if (!isset($this->productData[$wcfMajorRelease])) {
             $this->productData[$wcfMajorRelease] = array();
         }
         $languageCode = WCF::getLanguage()->languageCode;
         $packageName = isset($product['packageName'][$languageCode]) ? $product['packageName'][$languageCode] : $product['packageName']['en'];
         $this->productData[$wcfMajorRelease][$packageUpdateID] = array('author' => $product['author'], 'authorURL' => $product['authorURL'], 'package' => $product['package'], 'packageName' => $packageName, 'pluginStoreURL' => $product['pluginStoreURL'], 'version' => array('available' => $product['lastVersion'], 'installed' => ''), 'status' => isset($this->updateServers[$wcfMajorRelease]) ? 'install' : 'unavailable');
         $package = PackageCache::getInstance()->getPackageByIdentifier($product['package']);
         if ($package !== null) {
             $this->productData[$wcfMajorRelease][$packageUpdateID]['version']['installed'] = $package->packageVersion;
             if (Package::compareVersion($product['lastVersion'], $package->packageVersion, '>')) {
                 $this->productData[$wcfMajorRelease][$packageUpdateID]['status'] = 'update';
             } else {
                 if (Package::compareVersion($product['lastVersion'], $package->packageVersion, '=')) {
                     $this->productData[$wcfMajorRelease][$packageUpdateID]['status'] = 'upToDate';
                 }
             }
         }
         if (isset($this->updateServers[$wcfMajorRelease]) && $this->updateServers[$wcfMajorRelease]->lastUpdateTime == 0) {
             $this->productData[$wcfMajorRelease][$packageUpdateID]['status'] = 'requireUpdate';
         }
     }
 }
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     // stats
     if (LINKLIST_ENABLE_STATISTICS) {
         $this->stats = array_merge(StatsCacheBuilder::getInstance()->getData(), UserStatsCacheBuilder::getInstance()->getData());
     }
     // get categories
     $categoryTree = new LinklistCategoryNodeTree('de.incendium.linklist.category');
     $this->categoryList = $categoryTree->getIterator();
     $this->categoryList->setMaxDepth(0);
     // get featured entries
     $this->featuredEntryList = new AccessibleEntryList();
     $this->featuredEntryList->getConditionBuilder()->add('entry.isFeatured = ?', array(1));
     $this->featuredEntryList->sqlLimit = 10;
     $this->featuredEntryList->sqlOrderBy = 'RAND()';
     $this->featuredEntryList->readObjects();
     // remove default breadcrumb entry and set current page as 'website'
     if (WCF::isLandingPage()) {
         MetaTagHandler::getInstance()->addTag('og:url', 'og:url', LinkHandler::getInstance()->getLink('Linklist', array('application' => 'linklist')), true);
         MetaTagHandler::getInstance()->addTag('og:type', 'og:type', 'website', true);
         MetaTagHandler::getInstance()->addTag('og:title', 'og:title', WCF::getLanguage()->get(PAGE_TITLE), true);
         MetaTagHandler::getInstance()->addTag('og:description', 'og:description', WCF::getLanguage()->get(PAGE_DESCRIPTION), true);
     }
 }
 /**
  * @see	\wcf\page\AbstractPage::readData()
  */
 public function readData()
 {
     parent::readData();
     // get available subscriptions
     $this->subscriptions = PaidSubscriptionCacheBuilder::getInstance()->getData();
     // get user subscriptions
     $this->userSubscriptionList = new PaidSubscriptionUserList();
     $this->userSubscriptionList->getConditionBuilder()->add('userID = ?', array(WCF::getUser()->userID));
     $this->userSubscriptionList->getConditionBuilder()->add('isActive = ?', array(1));
     $this->userSubscriptionList->readObjects();
     foreach ($this->userSubscriptionList as $userSubscription) {
         if (isset($this->subscriptions[$userSubscription->subscriptionID])) {
             $userSubscription->setSubscription($this->subscriptions[$userSubscription->subscriptionID]);
             unset($this->subscriptions[$userSubscription->subscriptionID]);
         }
     }
     foreach ($this->userSubscriptionList as $userSubscription) {
         if ($userSubscription->getSubscription()->excludedSubscriptionIDs) {
             foreach (explode(',', $userSubscription->getSubscription()->excludedSubscriptionIDs) as $subscriptionID) {
                 if (isset($this->subscriptions[$subscriptionID])) {
                     unset($this->subscriptions[$subscriptionID]);
                 }
             }
         }
     }
 }
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     $this->packageInstallationDispatcher = new PackageInstallationDispatcher($this->queue);
     // validate the package and all it's requirements
     $this->validationPassed = PackageValidationManager::getInstance()->validate($this->queue->archive, true);
 }
Beispiel #9
0
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     $this->objectTypeList = ObjectTypeCache::getInstance()->getObjectTypes('de.codequake.cms.content.type');
     // read pages
     $pageNodeTree = new PageNodeTree();
     $this->pageList = $pageNodeTree->getIterator();
 }
Beispiel #10
0
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     // remove default breadcrumb entry
     if (PageMenu::getInstance()->getLandingPage()->menuItem == 'wcf.user.dashboard') {
         WCF::getBreadcrumbs()->remove(0);
     }
 }
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     VisitCountHandler::getInstance()->count();
     $this->fileReader = new FileReader($this->file->getLocation(), array('filename' => $this->file->getTitle(), 'mimeType' => $this->file->fileType, 'filesize' => $this->file->filesize, 'showInline' => in_array($this->file->fileType, self::$inlineMimeTypes), 'enableRangeSupport' => false, 'lastModificationTime' => $this->file->uploadTime, 'expirationDate' => TIME_NOW + 31536000, 'maxAge' => 31536000));
     // count downloads
     $fileEditor = new FileEditor($this->file);
     $fileEditor->updateCounters(array('downloads' => 1));
 }
Beispiel #12
0
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     $pageNodeTree = new PageNodeTree();
     $this->pageList = $pageNodeTree->getIterator();
     $this->contentListBody = new DrainedPositionContentNodeTree(null, $this->pageID, null, 'body', 1);
     $this->contentListSidebar = new DrainedPositionContentNodeTree(null, $this->pageID, null, 'sidebar', 1);
     $this->objectTypeList = ObjectTypeCache::getInstance()->getObjectTypes('de.codequake.cms.content.type');
 }
 /**
  * @see	\wcf\page\IPage::assignVariables()
  */
 public function readData()
 {
     parent::readData();
     foreach (static::$providerLocales as $locale) {
         $languageCode = substr($locale, 0, 2);
         if (\wcf\system\language\LanguageFactory::getInstance()->getLanguageByCode($languageCode)) {
             $this->availableLocales[$locale] = \wcf\system\WCF::getLanguage()->get('wcf.acp.faker.locale.' . $locale);
         }
     }
 }
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     $this->eventList = new ViewableUserActivityEventList();
     $this->eventList->readObjects();
     // add breadcrumbs
     if (MODULE_MEMBERS_LIST) {
         WCF::getBreadcrumbs()->add(new Breadcrumb(WCF::getLanguage()->get('wcf.user.members'), LinkHandler::getInstance()->getLink('MembersList')));
     }
 }
Beispiel #15
0
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     $this->server = array('os' => PHP_OS, 'webserver' => isset($_SERVER['SERVER_SOFTWARE']) ? $_SERVER['SERVER_SOFTWARE'] : '', 'mySQLVersion' => WCF::getDB()->getVersion(), 'load' => '');
     // get load
     if (function_exists('sys_getloadavg')) {
         $load = sys_getloadavg();
         if (is_array($load) && count($load) == 3) {
             $this->server['load'] = implode(', ', $load);
         }
     }
 }
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     // remove default breadcrumb entry and set current page as 'website'
     if (PageMenu::getInstance()->getLandingPage()->menuItem == 'ict.header.menu.tracker') {
         WCF::getBreadcrumbs()->remove(0);
         MetaTagHandler::getInstance()->addTag('og:url', 'og:url', LinkHandler::getInstance()->getLink('ProjectList', array('application' => 'ict')), true);
         MetaTagHandler::getInstance()->addTag('og:type', 'og:type', 'website', true);
         MetaTagHandler::getInstance()->addTag('og:title', 'og:title', WCF::getLanguage()->get(PAGE_TITLE), true);
         MetaTagHandler::getInstance()->addTag('og:description', 'og:description', WCF::getLanguage()->get(PAGE_DESCRIPTION), true);
     }
 }
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     // get file data
     $mimeType = $this->file->fileType;
     $filesize = $this->file->filesize;
     $location = $this->file->getLocation();
     // init file reader
     $this->fileReader = new FileReader($location, array('filename' => $this->file->filename, 'mimeType' => $mimeType, 'filesize' => $filesize, 'showInline' => in_array($mimeType, self::$inlineMimeTypes), 'enableRangeSupport' => true, 'lastModificationTime' => $this->file->uploadTime, 'expirationDate' => TIME_NOW + 31536000, 'maxAge' => 31536000));
     // add etag
     $this->fileReader->addHeader('ETag', '"' . $this->fileID . "'");
 }
Beispiel #18
0
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     // set dates
     if (isset($_POST['startDate'])) {
         $this->startDate = strtotime($_POST['startDate']);
     }
     if (isset($_POST['endDate'])) {
         $this->endDate = strtotime($_POST['endDate']);
     }
     if ($this->startDate == 0) {
         $this->startDate = TIME_NOW - 604800;
     }
     if ($this->endDate == 0) {
         $this->endDate = TIME_NOW;
     }
     // get stats
     $this->visits = VisitCountHandler::getInstance()->getVisitors($this->startDate, $this->endDate);
     foreach ($this->visits as $visit) {
         $browsers = @unserialize($visit['visitors']['browsers']);
         if (empty($browsers)) {
             $browsers = array();
         }
         foreach ($browsers as $key => $value) {
             $this->browsers[$key] = array('visits' => isset($this->browsers[$key]['visits']) ? $this->browsers[$key]['visits'] + $value : $value);
         }
         $platforms = @unserialize($visit['visitors']['platforms']);
         if (empty($platforms)) {
             $platforms = array();
         }
         foreach ($platforms as $key => $value) {
             $this->platforms[$key] = array('visits' => isset($this->platforms[$key]['visits']) ? $this->platforms[$key]['visits'] + $value : $value);
         }
         $devices = @unserialize($visit['visitors']['devices']);
         if (empty($devices)) {
             $devices = array();
         }
         foreach ($devices as $key => $value) {
             $this->devices[$key] = array('visits' => isset($this->devices[$key]['visits']) ? $this->devices[$key]['visits'] + $value : $value);
         }
     }
     // read pages
     $list = new PageList();
     $list->sqlOrderBy = 'page.clicks DESC';
     $list->sqlLimit = '8';
     $list->readObjects();
     $this->pages = $list->getObjects();
     // user online list
     $this->usersOnlineList = new UsersOnlineList();
     $this->usersOnlineList->readStats();
     $this->usersOnlineList->readObjects();
 }
 public function readData()
 {
     parent::readData();
     // update entry visit
     if ($this->entry->isNew()) {
         $entryAction = new EntryAction(array($this->entry->getDecoratedObject()), 'markAsRead', array('viewableEntry' => $this->entry));
         $entryAction->executeAction();
     }
     // get author's user profile
     $this->userProfile = $this->entry->getUserProfile();
     // get comments
     $this->commentObjectTypeID = CommentHandler::getInstance()->getObjectTypeID('de.incendium.linklist.entryComment');
     $this->commentManager = CommentHandler::getInstance()->getObjectType($this->commentObjectTypeID)->getProcessor();
     $this->commentList = CommentHandler::getInstance()->getCommentList($this->commentManager, $this->commentObjectTypeID, $this->entryID);
     // get other entries by this author
     $this->userEntryList = new AccessibleEntryList();
     $this->userEntryList->enableCategoryLoading(false);
     $this->userEntryList->getConditionBuilder()->add('entry.userID = ?', array($this->entry->userID));
     $this->userEntryList->getConditionBuilder()->add('entry.entryID <> ?', array($this->entry->entryID));
     $this->userEntryList->sqlLimit = 5;
     $this->userEntryList->readObjects();
     // get tags
     if (MODULE_TAGGING) {
         $this->tags = TagEngine::getInstance()->getObjectTags('de.incendium.linklist.entry', $this->entry->entryID, array($this->entry->languageID === null ? LanguageFactory::getInstance()->getDefaultLanguageID() : ""));
     }
     // fetch likes
     if (MODULE_LIKE) {
         $objectType = LikeHandler::getInstance()->getObjectType('de.incendium.linklist.likeableEntry');
         LikeHandler::getInstance()->loadLikeObjects($objectType, array($this->entryID));
         $this->entryLikeData = LikeHandler::getInstance()->getLikeObjects($objectType);
     }
     // add breadcrumbs
     $leafCategories = $this->entry->getLeafCategories();
     $category = reset($leafCategories);
     LINKLISTCore::getInstance()->setLocation($category->getParentCategories(), $category);
     MetaTagHandler::getInstance()->addTag('og:title', 'og:title', $this->entry->subject . ' - ' . WCF::getLanguage()->get(PAGE_TITLE), true);
     MetaTagHandler::getInstance()->addTag('og:url', 'og:url', LinkHandler::getInstance()->getLink('Entry', array('application' => 'linklist', 'object' => $this->entry)), true);
     MetaTagHandler::getInstance()->addTag('og:type', 'og:type', 'article', true);
     MetaTagHandler::getInstance()->addTag('og:description', 'og:description', $this->entry->teaser, true);
     // add tags as keywords
     if (!empty($this->tags)) {
         $keywords = '';
         foreach ($this->tags as $tag) {
             if (!empty($keywords)) {
                 $keywords .= ', ';
             }
             $keywords .= $tag->name;
         }
         MetaTagHandler::getInstance()->addTag('keywords', 'keywords', $keywords);
     }
 }
 /**
  * @see	wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     // read applications
     $this->applicationList = new PackageList();
     $this->applicationList->getConditionBuilder()->add("package.isApplication = ?", array(1));
     $this->applicationList->getConditionBuilder()->add("package.packageID <> ?", array(1));
     $this->applicationList->sqlLimit = 0;
     $this->applicationList->readObjects();
     // read plugins
     $this->pluginList = Package::getPluginList();
     // count total plugins
     $this->pluginCount = $this->pluginList->countObjects();
     // read plugins
     $this->pluginList->sqlLimit = 20;
     $this->pluginList->readObjects();
 }
Beispiel #21
0
 public function readData()
 {
     parent::readData();
     VisitCountHandler::getInstance()->count();
     WCF::getBreadcrumbs()->add(new Breadcrumb(WCF::getLanguage()->get('cms.page.news'), LinkHandler::getInstance()->getLink('NewsCategoryList', array('application' => 'cms'))));
     $this->commentObjectTypeID = CommentHandler::getInstance()->getObjectTypeID('de.codequake.cms.news.comment');
     $this->commentManager = CommentHandler::getInstance()->getObjectType($this->commentObjectTypeID)->getProcessor();
     $this->commentList = CommentHandler::getInstance()->getCommentList($this->commentManager, $this->commentObjectTypeID, $this->newsID);
     $newsEditor = new NewsEditor($this->news->getDecoratedObject());
     $newsEditor->update(array('clicks' => $this->news->clicks + 1));
     // get Tags
     if (MODULE_TAGGING) {
         $this->tags = $this->news->getTags();
     }
     if ($this->news->teaser != '') {
         MetaTagHandler::getInstance()->addTag('description', 'description', $this->news->teaser);
     } else {
         MetaTagHandler::getInstance()->addTag('description', 'description', StringUtil::decodeHTML(StringUtil::stripHTML($this->news->getExcerpt())));
     }
     if (!empty($this->tags)) {
         MetaTagHandler::getInstance()->addTag('keywords', 'keywords', implode(',', $this->tags));
     }
     MetaTagHandler::getInstance()->addTag('og:title', 'og:title', $this->news->subject . ' - ' . WCF::getLanguage()->get(PAGE_TITLE), true);
     MetaTagHandler::getInstance()->addTag('og:url', 'og:url', LinkHandler::getInstance()->getLink('News', array('application' => 'cms', 'object' => $this->news->getDecoratedObject())), true);
     MetaTagHandler::getInstance()->addTag('og:type', 'og:type', 'article', true);
     if ($this->news->getImage() != null) {
         MetaTagHandler::getInstance()->addTag('og:image', 'og:image', $this->news->getImage()->getLink(), true);
     }
     if ($this->news->getUserProfile()->facebook != '') {
         MetaTagHandler::getInstance()->addTag('article:author', 'article:author', 'https://facebook.com/' . $this->news->getUserProfile()->facebook, true);
     }
     if (FACEBOOK_PUBLIC_KEY != '') {
         MetaTagHandler::getInstance()->addTag('fb:app_id', 'fb:app_id', FACEBOOK_PUBLIC_KEY, true);
     }
     MetaTagHandler::getInstance()->addTag('og:description', 'og:description', StringUtil::decodeHTML(StringUtil::stripHTML($this->news->getExcerpt())), true);
     if ($this->news->isNew()) {
         $newsAction = new NewsAction(array($this->news->getDecoratedObject()), 'markAsRead', array('viewableNews' => $this->news));
         $newsAction->executeAction();
     }
     // fetch likes
     if (MODULE_LIKE) {
         $objectType = LikeHandler::getInstance()->getObjectType('de.codequake.cms.likeableNews');
         LikeHandler::getInstance()->loadLikeObjects($objectType, array($this->newsID));
         $this->likeData = LikeHandler::getInstance()->getLikeObjects($objectType);
     }
 }
Beispiel #22
0
 /**
  * @see	\wcf\page\AbstractPage::readData()
  */
 public function readData()
 {
     parent::readData();
     // set default values
     $d = DateUtil::getDateTimeByTimestamp(TIME_NOW - 86400);
     $d->setTimezone(WCF::getUser()->getTimeZone());
     $this->endDate = $d->format('Y-m-d');
     $d->sub(new \DateInterval('P1M'));
     $this->startDate = $d->format('Y-m-d');
     // get object types
     $objectTypes = ObjectTypeCache::getInstance()->getObjectTypes('com.woltlab.wcf.statDailyHandler');
     foreach ($objectTypes as $objectType) {
         if (!isset($this->availableObjectTypes[$objectType->categoryname])) {
             $this->availableObjectTypes[$objectType->categoryname] = array();
         }
         $this->availableObjectTypes[$objectType->categoryname][] = $objectType;
     }
 }
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     if (!$this->categoryID) {
         return;
     }
     // categories
     $categoryTree = new NewsPictureCategoryNodeTree('de.voolia.news.picture.category');
     $this->categoryList = $categoryTree->getIterator();
     $this->categoryList->setMaxDepth(0);
     // pictures
     $categoryIDs = array($this->categoryID);
     foreach ($this->category->getChildCategories() as $childCategory) {
         $categoryIDs[] = $childCategory->categoryID;
     }
     $this->pictureList = new GroupedNewsPictureList();
     $this->pictureList->getConditionBuilder()->add('news_picture.categoryID IN (?)', array($categoryIDs));
     $this->pictureList->readObjects();
 }
Beispiel #24
0
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     // init cache data
     $this->cacheData = array('source' => get_class(CacheHandler::getInstance()->getCacheSource()), 'version' => '', 'size' => 0, 'files' => 0);
     switch ($this->cacheData['source']) {
         case 'wcf\\system\\cache\\source\\DiskCacheSource':
             // set version
             $this->cacheData['version'] = WCF_VERSION;
             $this->readCacheFiles('data', WCF_DIR . 'cache');
             break;
         case 'wcf\\system\\cache\\source\\MemcachedCacheSource':
             // set version
             $this->cacheData['version'] = WCF_VERSION;
             break;
     }
     $this->readCacheFiles('language', FileUtil::unifyDirSeparator(WCF_DIR . 'language'));
     $this->readCacheFiles('template', FileUtil::unifyDirSeparator(WCF_DIR . 'templates/compiled'), new Regex('\\.meta\\.php$'));
     $this->readCacheFiles('template', FileUtil::unifyDirSeparator(WCF_DIR . 'acp/templates/compiled'), new Regex('\\.meta\\.php$'));
     $this->readCacheFiles('style', FileUtil::unifyDirSeparator(WCF_DIR . 'style'), null, 'css');
     $this->readCacheFiles('style', FileUtil::unifyDirSeparator(WCF_DIR . 'acp/style'), new Regex('WCFSetup.css$'), 'css');
 }
Beispiel #25
0
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     // add breadcrumbs
     if (MODULE_MEMBERS_LIST) {
         WCF::getBreadcrumbs()->add(new Breadcrumb(WCF::getLanguage()->get('wcf.user.members'), LinkHandler::getInstance()->getLink('MembersList')));
     }
     // get profile content
     if ($this->editOnInit) {
         // force 'about' tab as primary if editing profile
         UserProfileMenu::getInstance()->setActiveMenuItem('about');
     }
     $activeMenuItem = UserProfileMenu::getInstance()->getActiveMenuItem();
     $contentManager = $activeMenuItem->getContentManager();
     $this->profileContent = $contentManager->getContent($this->user->userID);
     $this->objectType = ObjectTypeCache::getInstance()->getObjectTypeByName('com.woltlab.wcf.user.profileEditableContent', 'com.woltlab.wcf.user.profileAbout');
     // get followers
     $this->followerList = new UserFollowerList();
     $this->followerList->getConditionBuilder()->add('user_follow.followUserID = ?', array($this->userID));
     $this->followerList->sqlLimit = 10;
     $this->followerList->readObjects();
     // get following
     $this->followingList = new UserFollowingList();
     $this->followingList->getConditionBuilder()->add('user_follow.userID = ?', array($this->userID));
     $this->followingList->sqlLimit = 10;
     $this->followingList->readObjects();
     // get visitors
     if (PROFILE_ENABLE_VISITORS) {
         $this->visitorList = new UserProfileVisitorList();
         $this->visitorList->getConditionBuilder()->add('user_profile_visitor.ownerID = ?', array($this->userID));
         $this->visitorList->sqlLimit = 10;
         $this->visitorList->readObjects();
     }
     MetaTagHandler::getInstance()->addTag('og:url', 'og:url', LinkHandler::getInstance()->getLink('User', array('object' => $this->user->getDecoratedObject(), 'appendSession' => false)), true);
     MetaTagHandler::getInstance()->addTag('og:type', 'og:type', 'profile', true);
     MetaTagHandler::getInstance()->addTag('profile:username', 'profile:username', $this->user->username, true);
     MetaTagHandler::getInstance()->addTag('og:title', 'og:title', $this->user->username . ' - ' . WCF::getLanguage()->get('wcf.user.members') . ' - ' . WCF::getLanguage()->get(PAGE_TITLE), true);
     MetaTagHandler::getInstance()->addTag('og:image', 'og:image', $this->user->getAvatar()->getURL(), true);
 }
 /**
  * @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'))));
     }
     $categories = array();
     $leafCategories = $this->entry->getLeafCategories();
     $category = reset($leafCategories);
     while ($category !== null) {
         $categories[] = $category;
         $category = $category->getParentCategory();
     }
     foreach (array_reverse($categories) as $parentCategory) {
         WCF::getBreadcrumbs()->add($parentCategory->getBreadcrumb());
     }
     // update news view count
     $this->entry->updateVisits();
     // update news visit
     if ($this->entry->isNew()) {
         $entryAction = new EntryAction(array($this->entry->getDecoratedObject()), 'markAsRead', array('viewableEntry' => $this->entry));
         $entryAction->executeAction();
     }
     // fetch news likes
     if (MODULE_LIKE) {
         $objectType = LikeHandler::getInstance()->getObjectType('de.incendium.cms.like.likeableNews');
         LikeHandler::getInstance()->loadLikeObjects($objectType, array($this->entryID));
         $this->entryLikeData = LikeHandler::getInstance()->getLikeObjects($objectType);
     }
     // get news tags
     if (MODULE_TAGGING) {
         $this->tags = TagEngine::getInstance()->getObjectTags('de.incendium.cms.news.entry', $this->entry->entryID, array($this->entry->languageID === null ? LanguageFactory::getInstance()->getDefaultLanguageID() : ""));
     }
     // get news comments
     if ($this->commentManager === null) {
         $this->objectTypeID = CommentHandler::getInstance()->getObjectTypeID('de.incendium.cms.news.comment');
         $objectType = CommentHandler::getInstance()->getObjectType($this->objectTypeID);
         $this->commentManager = $objectType->getProcessor();
     }
     $this->commentList = CommentHandler::getInstance()->getCommentList($this->commentManager, $this->objectTypeID, $this->entryID);
     // more news from this category
     $this->moreEntryList = new AccessibleEntryList();
     $this->moreEntryList->getConditionBuilder()->add("news_entry.entryID IN (SELECT entryID FROM cms" . WCF_N . "_news_entry_to_category WHERE entryID != ? AND categoryID IN (?))", array($this->entryID, $this->entry->getCategoryIDs()));
     $this->moreEntryList->sqlLimit = CMS_DASHBOARD_SIDEBAR_NEWSENTRIES;
     $this->moreEntryList->readObjects();
     // meta tags
     MetaTagHandler::getInstance()->addTag('og:title', 'og:title', $this->entry->subject . ' - ' . WCF::getLanguage()->get(PAGE_TITLE), true);
     MetaTagHandler::getInstance()->addTag('og:url', 'og:url', LinkHandler::getInstance()->getLink('NewsEntry', array('application' => 'cms', 'object' => $this->entry)), true);
     MetaTagHandler::getInstance()->addTag('og:type', 'og:type', 'article', true);
     MetaTagHandler::getInstance()->addTag('og:description', 'og:description', StringUtil::decodeHTML(StringUtil::stripHTML($this->entry->getExcerpt())), true);
     // add tags as keywords
     if (!empty($this->tags)) {
         $keywords = '';
         foreach ($this->tags as $tag) {
             if (!empty($keywords)) {
                 $keywords .= ', ';
             }
             $keywords .= $tag->name;
         }
         MetaTagHandler::getInstance()->addTag('keywords', 'keywords', $keywords);
     }
     // quotes
     MessageQuoteManager::getInstance()->initObjects('de.incendium.cms.news.entry', array($this->entry->entryID));
 }
Beispiel #27
0
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     if (!empty($_POST) || !empty($_FILES)) {
         $this->submit();
     }
     parent::readData();
 }
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     // get file data
     if ($this->tiny) {
         $mimeType = $this->attachment->tinyThumbnailType;
         $filesize = $this->attachment->tinyThumbnailSize;
         $location = $this->attachment->getTinyThumbnailLocation();
     } else {
         if ($this->thumbnail) {
             $mimeType = $this->attachment->thumbnailType;
             $filesize = $this->attachment->thumbnailSize;
             $location = $this->attachment->getThumbnailLocation();
         } else {
             $mimeType = $this->attachment->fileType;
             $filesize = $this->attachment->filesize;
             $location = $this->attachment->getLocation();
         }
     }
     // init file reader
     $this->fileReader = new FileReader($location, array('filename' => $this->attachment->filename, 'mimeType' => $mimeType, 'filesize' => $filesize, 'showInline' => in_array($mimeType, self::$inlineMimeTypes), 'enableRangeSupport' => !$this->tiny && !$this->thumbnail, 'lastModificationTime' => $this->attachment->uploadTime, 'expirationDate' => TIME_NOW + 31536000, 'maxAge' => 31536000));
     // add etag for non-thumbnail
     if (!$this->thumbnail && !$this->tiny) {
         $this->fileReader->addHeader('ETag', '"' . $this->attachmentID . '"');
     }
 }
	/**
	 * @see	wcf\page\IPage::readData()
	 */
	public function readData() {
		$this->objectType = CategoryHandler::getInstance()->getObjectTypeByName($this->objectTypeName);
		if ($this->objectType === null) {
			throw new SystemException("Unknown category object type with name '".$this->objectTypeName."'");
		}
		
		// check permissions
		$this->checkCategoryPermissions();
		
		$this->readCategories();
		
		// note that the implementation of wcf\system\category\ICategoryType
		// needs to support a object type of the pseudo definition
		// 'com.woltlab.wcf.collapsibleContent.acp' which has to be registered
		// during package installation as a 'com.woltlab.wcf.collapsibleContent'
		// object type if you want to support collapsible categories in the
		// acp; the pseudo object type is used to distinguish between
		// collapsible categories in the frontend and the acp
		$collapsibleObjectTypeName = $this->objectType->getProcessor()->getObjectTypeName('com.woltlab.wcf.collapsibleContent.acp');
		if ($collapsibleObjectTypeName) {
			$this->collapsibleObjectTypeID = UserCollapsibleContentHandler::getInstance()->getObjectTypeID($collapsibleObjectTypeName);
			// get ids of collapsed category
			if ($this->collapsibleObjectTypeID !== null) {
				$this->collapsedCategoryIDs = UserCollapsibleContentHandler::getInstance()->getCollapsedContent($this->collapsibleObjectTypeID);
				$this->collapsedCategoryIDs = array_flip($this->collapsedCategoryIDs);
			}
		}
		
		parent::readData();
	}
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     // initialize database object list
     $this->initObjectList();
     // calculates page number
     $this->calculateNumberOfPages();
     // read objects
     if ($this->items) {
         $this->sqlLimit = $this->itemsPerPage;
         $this->sqlOffset = ($this->pageNo - 1) * $this->itemsPerPage;
         if ($this->sortField && $this->sortOrder) {
             $this->sqlOrderBy = $this->sortField . " " . $this->sortOrder;
         }
         $this->readObjects();
     }
 }