本文整理汇总了PHP中AbstractForm::readData方法的典型用法代码示例。如果您正苦于以下问题:PHP AbstractForm::readData方法的具体用法?PHP AbstractForm::readData怎么用?PHP AbstractForm::readData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AbstractForm
的用法示例。
在下文中一共展示了AbstractForm::readData方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: readData
/**
* @see Page::readData()
*/
public function readData()
{
AbstractForm::readData();
if (!count($_POST)) {
if (isset($_GET['values']) && is_array($_GET['values'])) {
$this->values = $_GET['values'];
$this->submit();
}
}
// get path to category icons
foreach ($this->cachedCategories as $key => $category) {
// add icon path
if (!empty($category['categoryIconM'])) {
// get relative path
$path = '';
if (empty($category['packageDir'])) {
$path = RELATIVE_WCF_DIR;
} else {
$path = FileUtil::getRealPath(RELATIVE_WCF_DIR . $category['packageDir']);
}
$this->cachedCategories[$key]['categoryIconM'] = $path . $category['categoryIconM'];
}
}
// get categories
$this->categories = $this->getOptionTree('profile');
if (count($this->categories) == 0) {
$this->options = $this->getCategoryOptions('profile');
}
// insert default values
foreach ($this->activeOptions as $name => $option) {
if (isset($this->values[$name])) {
$this->activeOptions[$name]['optionValue'] = $this->values[$name];
}
}
}
示例2: readData
/**
* @see Form::readData()
*/
public function readData()
{
parent::readData();
// avoid problems when submit() is not called
if ($this->source === null) {
throw new IllegalLinkException();
}
// get available packages
$this->cachedPackages = $this->getCache('packages-' . $this->source->sourceID, 'Packages');
// get all dependent packages
$this->packageDependencies = $this->getCache('package-dependency-' . $this->source->sourceID, 'PackageDependency');
// get all available wcf setup resources
$setupResources = $this->getCache('wcfsetup-resources', 'WcfSetupResource');
foreach ($this->sources as $source) {
$directory = FileUtil::getRelativePath($this->source->sourceDirectory, $source->sourceDirectory);
// packages
$packages = $this->getCache('packages-' . $source->sourceID, 'Packages');
foreach ($packages['packages'] as $key => $val) {
$packages['packages'][$key]['directory'] = $directory . $packages['packages'][$key]['directory'];
$packages['packages'][$key]['source'] = $source;
}
$this->cachedPackages = array('hashes' => array_merge($this->cachedPackages['hashes'], $packages['hashes']), 'packages' => array_merge($this->cachedPackages['packages'], $packages['packages']));
// dependencies
$this->packageDependencies = array_merge($this->packageDependencies, $this->getCache('package-dependency-' . $source->sourceID, 'PackageDependency'));
}
// get package information
$this->getRequestedPackage();
// fetch all required packages
$this->fetchDependencies($this->requestedPackageHash);
// read previously selected packages
$this->readSelectedPackages();
}
示例3: readData
/**
* @see Page::readData()
*/
public function readData()
{
// alliance
$this->alliance = Alliance::getByUserID(WCF::getUser()->userID, true);
$this->interrelations = $this->alliance->getInterrelation();
$this->interrelations[$this->alliance->allianceID] = $this->alliance;
parent::readData();
}
示例4: readData
/**
* @see Page::readData()
*/
public function readData()
{
parent::readData();
$this->alliance = new Alliance($this->allianceID);
if (!$this->alliance->allianceID || WCF::getUser()->ally_request || WCF::getUser()->ally_id) {
require_once WCF_DIR . 'lib/system/exception/IllegalLinkException.class.php';
throw new IllegalLinkException();
}
}
示例5: readData
/**
* @see Page::readData()
*/
public function readData()
{
$this->fleetQueue = new FleetQueue(2);
parent::readData();
$this->getTargetPlanet();
$this->fleetQueue->speedPercent = $this->speed;
$this->missions = $this->fleetQueue->getMissions();
$this->capacity = $this->fleetQueue->getCapacity() - $this->fleetQueue->getConsumption();
}
示例6: readData
/**
* @see Page::readData()
*/
public function readData()
{
// alliance
$this->alliance = Alliance::getByUserID(WCF::getUser()->userID, true);
// user
if (empty($this->userID)) {
require_once WCF_DIR . 'lib/system/exception/IllegalLinkException.class.php';
throw new IllegalLinkException();
}
$this->user = new LWUser($this->userID);
parent::readData();
}
示例7: readData
/**
* @see Page::readData()
*/
public function readData()
{
if ($this->messageID) {
$message = new NMessage($this->messageID);
$sender = $message->getSender();
if ($sender instanceof UserMessageSender) {
$this->user = $sender->getUser();
$this->username = $this->user->username;
$this->subject = 'Re: ' . $message->subject;
}
} else {
if ($this->userID) {
$this->user = new LWUser($this->userID);
$this->username = $this->user->username;
}
}
parent::readData();
}
示例8: readData
/**
* @see Page::readData()
*/
public function readData()
{
$this->fleetQueue = new FleetQueue(1);
parent::readData();
}
示例9: readData
/**
* @see Page::readData()
*/
public function readData()
{
$this->alliance = new Alliance($this->allianceID);
$this->alliance2 = new AllianceEditor($this->allianceID2);
if ($this->alliance2->getInterrelation($this->allianceID, $this->interrelationType) !== null) {
require_once WCF_DIR . 'lib/system/exception/IllegalLinkException.class.php';
throw new IllegalLinkException();
}
if (!$this->alliance2->getRank(true, 6)) {
require_once WCF_DIR . 'lib/system/exception/PermissionDeniedException.class.php';
throw new PermissionDeniedException();
}
AbstractForm::readData();
}
示例10: readData
/**
* @see Page::readData()
*/
public function readData()
{
$this->alliance = new AllianceEditor($this->allianceID);
parent::readData();
}
示例11: readData
/**
* @see Page::readData()
*/
public function readData()
{
parent::readData();
}
示例12: readData
/**
* @see Page::readData()
*/
public function readData()
{
parent::readData();
$this->loadPlanetData();
}
示例13: readData
/**
* @see Page::readData()
*/
public function readData()
{
$this->alliance = new AllianceEditor($this->allianceID);
$this->ranks = $this->alliance->getRank();
parent::readData();
}
示例14: readData
/**
* @see Page::readData()
*/
public function readData()
{
parent::readData();
// get preferred username
if (!count($_POST)) {
if (isset($_COOKIE[COOKIE_PREFIX . 'userID'])) {
require_once WCF_DIR . 'lib/data/user/User.class.php';
$user = new User(intval($_COOKIE[COOKIE_PREFIX . 'userID']));
if ($user->userID) {
$this->username = $user->username;
}
}
}
}
示例15: readData
/**
* @see Page::readData()
*/
public function readData()
{
parent::readData();
$this->renderBoards();
// default values
if (!count($_POST)) {
$ignoredBoardIDArray = array();
$sql = "SELECT\tboardID\n\t\t\t\tFROM\twbb" . WBB_N . "_board_ignored_by_user\n\t\t\t\tWHERE\tuserID = " . WCF::getUser()->userID;
$result = WCF::getDB()->sendQuery($sql);
while ($row = WCF::getDB()->fetchArray($result)) {
$ignoredBoardIDArray[] = $row['boardID'];
}
foreach ($this->boards as $board) {
if (!in_array($board->boardID, $ignoredBoardIDArray) && $board->getPermission('canViewBoard')) {
$this->unignoredBoardIDArray[] = $board->boardID;
}
}
}
}