Ejemplo n.º 1
0
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     I18nHandler::getInstance()->register('description');
     I18nHandler::getInstance()->register('name');
     parent::readData();
     $this->typeList = new \wcf\data\jcoins\shop\item\type\JCoinsShopItemTypeList();
 }
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     $this->objectTypes = ObjectTypeCache::getInstance()->getObjectTypes('com.woltlab.wcf.user.activityPointEvent');
     if (empty($_POST)) {
         foreach ($this->objectTypes as $objectType) {
             $this->points[$objectType->objectTypeID] = $objectType->points;
         }
     }
     parent::readData();
 }
Ejemplo n.º 3
0
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     if (!WCF::getUser()->userID && $this->useCaptcha && $this->captchaObjectTypeName) {
         $this->captchaObjectType = CaptchaHandler::getInstance()->getObjectTypeByName($this->captchaObjectTypeName);
         if ($this->captchaObjectType === null) {
             throw new SystemException("Unknown captcha object type with name '" . $this->captchaObjectTypeName . "'");
         }
         if (!$this->captchaObjectType->getProcessor()->isAvailable()) {
             $this->captchaObjectType = null;
         }
     }
     parent::readData();
 }
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     $this->userGroups = UserGroup::getGroupsByType(array(), array(UserGroup::EVERYONE, UserGroup::GUESTS, UserGroup::USERS));
     foreach ($this->userGroups as $key => $userGroup) {
         if (!$userGroup->isAccessible()) {
             unset($this->userGroups[$key]);
         }
     }
     uasort($this->userGroups, function (UserGroup $groupA, UserGroup $groupB) {
         return strcmp($groupA->getName(), $groupB->getName());
     });
     $this->conditions = UserGroupAssignmentHandler::getInstance()->getGroupedObjectTypes('com.woltlab.wcf.condition.userGroupAssignment');
     parent::readData();
 }
Ejemplo n.º 5
0
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     // set default values
     if (empty($_POST)) {
         $dateTime = DateUtil::getDateTimeByTimestamp(TIME_NOW);
         $dateTime->setTimezone(WCF::getUser()->getTimeZone());
         $this->deactivationDate = $this->publicationDate = $dateTime->format('c');
     }
     $pageNodeTree = new PageNodeTree();
     $this->pageList = $pageNodeTree->getIterator();
     $this->stylesheetList = new StylesheetList();
     $this->stylesheetList->readObjects();
     // load menu items
     $menuItemList = new PageMenuItemList();
     $menuItemList->getConditionBuilder()->add('page_menu_item.menuPosition = ?', array('header'));
     $menuItemList->sqlOrderBy = 'page_menu_item.parentMenuItem ASC, page_menu_item.showOrder ASC';
     $menuItemList->readObjects();
     foreach ($menuItemList as $menuItem) {
         if ($menuItem->parentMenuItem) {
             if (isset($this->menuItems[$menuItem->parentMenuItem])) {
                 $this->menuItems[$menuItem->parentMenuItem]->addChild($menuItem);
             }
         } else {
             $this->menuItems[$menuItem->menuItem] = new ViewablePageMenuItem($menuItem);
         }
     }
 }
Ejemplo n.º 6
0
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     if (empty($_POST) && $this->languageID) {
         $language = LanguageFactory::getInstance()->getLanguage($this->languageID);
         if ($language === null) {
             throw new IllegalLinkException();
         }
         $this->language = new LanguageEditor($language);
     }
     $this->readPackages();
 }
Ejemplo n.º 7
0
	/**
	 * @see	wcf\page\IPage::readData()
	 */
	public function readData() {
		parent::readData();
		
		// get preferred username
		if (empty($_POST)) {
			if (isset($_COOKIE[COOKIE_PREFIX.'userID'])) {
				$user = new User(intval($_COOKIE[COOKIE_PREFIX.'userID']));
				if ($user->userID) $this->username = $user->username;
			}
		}
	}
Ejemplo n.º 8
0
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     // read page list
     $pageNodeTree = new PageNodeTree();
     $this->pageList = $pageNodeTree->getIterator();
     // read content list
     $contentNodeTree = new ContentNodeTree(null, 0, 1);
     $this->contentList = $contentNodeTree->getIterator();
 }
Ejemplo n.º 9
0
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     if (!isset($_POST['fileSystemPath'])) {
         $this->fileSystemPath = !empty($_SERVER['DOCUMENT_ROOT']) ? $_SERVER['DOCUMENT_ROOT'] : WCF_DIR;
     }
     if (empty($_POST)) {
         if (!$this->exporterName) {
             $sql = "SELECT\tCOUNT(*) AS count\n\t\t\t\t\tFROM\twcf" . WCF_N . "_import_mapping";
             $statement = WCF::getDB()->prepareStatement($sql);
             $statement->execute();
             $row = $statement->fetchArray();
             if ($row['count']) {
                 $this->showMappingNotice = true;
             }
         }
     }
     $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;
     }
 }
Ejemplo n.º 10
0
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     $objectTypes = ObjectTypeCache::getInstance()->getObjectTypes('com.woltlab.wcf.condition.ad');
     foreach ($objectTypes as $objectType) {
         if (!$objectType->conditionobject) {
             continue;
         }
         if (!isset($this->groupedConditionObjectTypes[$objectType->conditionobject])) {
             $this->groupedConditionObjectTypes[$objectType->conditionobject] = array();
         }
         if ($objectType->conditiongroup) {
             if (!isset($this->groupedConditionObjectTypes[$objectType->conditionobject][$objectType->conditiongroup])) {
                 $this->groupedConditionObjectTypes[$objectType->conditionobject][$objectType->conditiongroup] = array();
             }
             $this->groupedConditionObjectTypes[$objectType->conditionobject][$objectType->conditiongroup][$objectType->objectTypeID] = $objectType;
         } else {
             $this->groupedConditionObjectTypes[$objectType->conditionobject][$objectType->objectTypeID] = $objectType;
         }
     }
     $this->locations = AdHandler::getInstance()->getLocationSelection();
     foreach (AdHandler::getInstance()->getLocationObjectTypes() as $objectType) {
         $this->locationObjectTypes[$objectType->objectTypeID] = $objectType;
     }
     parent::readData();
 }
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     if (empty($_POST)) {
         // default values
         $contentLanguages = 0;
         foreach ($this->languages as $languageID => $language) {
             if ($language->hasContent) {
                 $contentLanguages++;
                 $this->languageIDs[] = $languageID;
             }
         }
         // add default language
         if (!in_array(LanguageFactory::getInstance()->getDefaultLanguageID(), $this->languageIDs)) {
             $this->languageIDs[] = LanguageFactory::getInstance()->getDefaultLanguageID();
         }
         if ($contentLanguages > 1) {
             $this->enable = 1;
         }
     }
 }
Ejemplo n.º 12
0
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     $this->labelGroupList = new LabelGroupList();
     $this->labelGroupList->sqlOrderBy = 'label_group.groupName';
     $this->labelGroupList->readObjects();
     parent::readData();
 }
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     $categoryTree = new NewsPictureCategoryNodeTree('de.voolia.news.picture.category');
     $this->categoryList = $categoryTree->getIterator();
     $this->categoryList->setMaxDepth(0);
 }
Ejemplo n.º 14
0
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     if (empty($_POST)) {
         // read values of accessible user groups
         $conditions = new PreparedStatementConditionBuilder();
         $conditions->add("groupID IN (?)", array(array_keys($this->groups)));
         $conditions->add("optionID = ?", array($this->userGroupOption->optionID));
         $sql = "SELECT\tgroupID, optionValue\n\t\t\t\tFROM\twcf" . WCF_N . "_user_group_option_value\n\t\t\t\t" . $conditions;
         $statement = WCF::getDB()->prepareStatement($sql);
         $statement->execute($conditions->getParameters());
         while ($row = $statement->fetchArray()) {
             $this->values[$row['groupID']] = $row['optionValue'];
         }
     }
     // create form elements for each group
     foreach ($this->groups as $group) {
         $optionValue = isset($this->values[$group->groupID]) ? $this->values[$group->groupID] : '';
         $this->formElements[$group->groupID] = $this->optionType->getFormElement($this->userGroupOption, $optionValue);
     }
 }
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     if (empty($_POST)) {
         if ($this->subscription->subscriptionLength) {
             $d = DateUtil::getDateTimeByTimestamp(TIME_NOW);
             $d->add($this->subscription->getDateInterval());
             $this->endDate = $d->format('Y-m-d');
         }
     }
 }
Ejemplo n.º 16
0
	/**
	 * @see	wcf\page\IPage::readData()
	 */
	public function readData() {
		parent::readData();
		
		if (empty($_POST)) {
			$this->optionHandler->readData();
		}
	}
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     if (empty($_POST)) {
         $this->assignedUserID = $this->queue->assignedUserID;
     }
     WCF::getBreadcrumbs()->add(new Breadcrumb(WCF::getLanguage()->get('wcf.moderation.moderation'), LinkHandler::getInstance()->getLink('ModerationList')));
     $this->commentObjectTypeID = CommentHandler::getInstance()->getObjectTypeID('com.woltlab.wcf.moderation.queue');
     $this->commentManager = CommentHandler::getInstance()->getObjectType($this->commentObjectTypeID)->getProcessor();
     $this->commentList = CommentHandler::getInstance()->getCommentList($this->commentManager, $this->commentObjectTypeID, $this->queueID);
     // update queue visit
     if ($this->queue->isNew()) {
         $action = new ModerationQueueAction(array($this->queue->getDecoratedObject()), 'markAsRead', array('visitTime' => TIME_NOW));
         $action->executeAction();
     }
 }
Ejemplo n.º 18
0
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     // default values
     if (empty($_POST)) {
         // static options
         if ($this->category == 'general') {
             $this->contentLanguageIDs = WCF::getUser()->getLanguageIDs();
             if (isset($this->availableLanguages[WCF::getUser()->languageID])) {
                 $this->languageID = WCF::getUser()->languageID;
             }
             $this->styleID = WCF::getUser()->styleID;
         }
     }
 }
Ejemplo n.º 19
0
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     // default values
     if (empty($_POST)) {
         $this->username = WCF::getUser()->username;
         $this->email = $this->confirmEmail = WCF::getUser()->email;
     }
 }
Ejemplo n.º 20
0
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     $this->availableTemplateGroups = TemplateGroup::getSelectList(array(), 1);
     parent::readData();
 }
Ejemplo n.º 21
0
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     $this->languages = LanguageFactory::getInstance()->getLanguages();
 }
Ejemplo n.º 22
0
	/**
	 * @see	wcf\page\IPage::readData()
	 */
	public function readData() {
		parent::readData();
		
		// get installation stack
		if ($this->packageInstallationStack !== null && $this->packageUpdate !== null) {
			$this->packageInstallationStack = $this->packageUpdate->getPackageInstallationStack();
		}
	}
Ejemplo n.º 23
0
	/**
	 * @see	wcf\page\IPage::readData()
	 */
	public function readData() {
		parent::readData();
		
		if (empty($_POST)) {
			// read values for accessible user groups
			$groupIDs = array_merge(array_keys($this->groups), array($this->groupEveryone->groupID));
			
			$conditions = new PreparedStatementConditionBuilder();
			$conditions->add("groupID IN (?)", array($groupIDs));
			$conditions->add("optionID = ?", array($this->userGroupOption->optionID));
			
			$sql = "SELECT	groupID, optionValue
				FROM	wcf".WCF_N."_user_group_option_value
				".$conditions;
			$statement = WCF::getDB()->prepareStatement($sql);
			$statement->execute($conditions->getParameters());
			while ($row = $statement->fetchArray()) {
				// exclude default value from $values
				if ($row['groupID'] == $this->groupEveryone->groupID) {
					$this->defaultValue = $row['optionValue'];
					continue;
				}
				
				$this->values[$row['groupID']] = $row['optionValue'];
			}
		}
		
		// create form element for default group
		$this->defaultFormElement = $this->optionType->getFormElement($this->userGroupOption, $this->defaultValue);
		
		// create form elements for each group
		foreach ($this->groups as $group) {
			$optionValue = (isset($this->values[$group->groupID])) ? $this->values[$group->groupID] : $this->defaultValue;
			$this->formElements[$group->groupID] = $this->optionType->getFormElement($this->userGroupOption, $optionValue);
		}
	}
Ejemplo n.º 24
0
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     if (empty($_POST)) {
         // load settings
         $sql = "SELECT\t\tboxID\n\t\t\t\tFROM\t\twcf" . WCF_N . "_dashboard_option\n\t\t\t\tWHERE\t\tobjectTypeID = ?\n\t\t\t\tORDER BY\tshowOrder ASC";
         $statement = WCF::getDB()->prepareStatement($sql);
         $statement->execute(array($this->objectTypeID));
         while ($row = $statement->fetchArray()) {
             $this->enabledBoxes[] = $row['boxID'];
         }
     }
 }
Ejemplo n.º 25
0
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     if (empty($_POST)) {
         if (WCF::getUser()->avatarID) {
             $this->avatarType = 'custom';
         } else {
             if (MODULE_GRAVATAR && WCF::getUser()->enableGravatar) {
                 $this->avatarType = 'gravatar';
             }
         }
     }
 }
 /**
  * @see \wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
 }
Ejemplo n.º 27
0
 /**
  * @see	\wcf\page\IPage::assignVariables()
  */
 public function readData()
 {
     parent::readData();
     if (empty($_POST)) {
         // get marked user ids
         if (empty($this->action)) {
             // get type id
             $objectTypeID = ClipboardHandler::getInstance()->getObjectTypeID('com.woltlab.wcf.user');
             if ($objectTypeID === null) {
                 throw new SystemException("Unknown clipboard item type 'com.woltlab.wcf.user'");
             }
             // get user ids
             $users = ClipboardHandler::getInstance()->getMarkedItems($objectTypeID);
             if (empty($users)) {
                 throw new IllegalLinkException();
             }
             // load users
             $this->userIDs = array_keys($users);
         }
         if (MAIL_USE_FORMATTED_ADDRESS) {
             $this->from = MAIL_FROM_NAME . ' <' . MAIL_FROM_ADDRESS . '>';
         } else {
             $this->from = MAIL_FROM_ADDRESS;
         }
     }
     if (!empty($this->userIDs)) {
         $this->userList = new UserList();
         $this->userList->getConditionBuilder()->add("user_table.userID IN (?)", array($this->userIDs));
         $this->userList->sqlOrderBy = "user_table.username ASC";
         $this->userList->readObjects();
     }
     $this->groups = UserGroup::getAccessibleGroups(array(), array(UserGroup::GUESTS, UserGroup::EVERYONE));
 }
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     // default values
     if (empty($_POST)) {
         // get user settings
         $eventIDs = array();
         foreach ($this->events as $events) {
             foreach ($events as $event) {
                 $eventIDs[] = $event->eventID;
                 $this->settings[$event->eventID] = array('enabled' => false, 'mailNotificationType' => 'none');
             }
         }
         // get activation state
         $sql = "SELECT\teventID, mailNotificationType\n\t\t\t\tFROM\twcf" . WCF_N . "_user_notification_event_to_user\n\t\t\t\tWHERE\tuserID = ?";
         $statement = WCF::getDB()->prepareStatement($sql);
         $statement->execute(array(WCF::getUser()->userID));
         while ($row = $statement->fetchArray()) {
             $this->settings[$row['eventID']]['enabled'] = true;
             $this->settings[$row['eventID']]['mailNotificationType'] = $row['mailNotificationType'];
         }
     }
 }
Ejemplo n.º 29
0
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     // parse global (unit) variables
     foreach ($this->globals as $variableName) {
         $unit = '';
         $value = $this->variables[$variableName];
         $i = strlen($value) - 1;
         while ($i >= 0) {
             $unit = $value[$i] . $unit;
             if (in_array($unit, $this->availableUnits)) {
                 $this->variables[$variableName] = str_replace($unit, '', $value);
                 $this->variables[$variableName . '_unit'] = $unit;
                 break;
             }
             $i--;
         }
     }
     if (empty($_POST)) {
         $this->authorName = WCF::getUser()->username;
         $this->styleDate = gmdate('Y-m-d', TIME_NOW);
         $this->styleVersion = '1.0.0';
     }
 }
Ejemplo n.º 30
0
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     if (empty($_POST) && mb_strpos(WCF::getSession()->requestURI, 'MasterPassword') === false) {
         $this->url = WCF::getSession()->requestURI;
     }
 }