/**
* menu title
- * @var string
+ * @var string
*/
public $title = '';
/**
* Validates box position.
*
- * @throws UserInputException
+ * @throws UserInputException
*/
protected function validatePosition() {
if (!in_array($this->position, Box::$availablePositions)) {
/**
* list of page handlers by page id
- * @var \wcf\system\page\handler\IMenuPageHandler[]
+ * @var \wcf\system\page\handler\IMenuPageHandler[]
*/
public $pageHandlers = [];
/**
* page object id
- * @var integer
+ * @var integer
*/
public $pageObjectID = null;
/**
* nested list of page nodes
- * @var \RecursiveIteratorIterator
+ * @var \RecursiveIteratorIterator
*/
public $pageNodeList;
/**
* true if created page is multi-lingual
- * @var boolean
+ * @var boolean
*/
public $isMultilingual = 0;
/**
* parent page id
- * @var integer
+ * @var integer
*/
public $parentPageID = 0;
/**
* page name
- * @var string
+ * @var string
*/
public $name = '';
/**
* true if page is disabled
- * @var boolean
+ * @var boolean
*/
public $isDisabled = 0;
/**
* true if page is landing page
- * @var boolean
+ * @var boolean
*/
public $isLandingPage = 0;
/**
* package id of the page
- * @var integer
+ * @var integer
*/
public $packageID = 1;
/**
* list of available applications
- * @var Application[]
+ * @var Application[]
*/
public $availableApplications = [];
/**
* page custom URL
- * @var string[]
+ * @var string[]
*/
public $customURL = [];
/**
* page titles
- * @var string[]
+ * @var string[]
*/
public $title = [];
/**
* page contents
- * @var string[]
+ * @var string[]
*/
public $content = [];
/**
* page meta descriptions
- * @var string[]
+ * @var string[]
*/
public $metaDescription = [];
/**
* page meta keywords
- * @var string[]
+ * @var string[]
*/
public $metaKeywords = [];
/**
* page id
- * @var integer
+ * @var integer
*/
public $pageID = 0;
/**
* page object
- * @var Page
+ * @var Page
*/
public $page = null;
/**
* list of available applications
- * @var Application[]
+ * @var Application[]
*/
public $applications;
/**
* landing page id per application package id
- * @var integer[]
+ * @var integer[]
*/
public $landingPages = [];
/**
* list of available pages
- * @var Page[]
+ * @var Page[]
*/
public $pages = [];
*/
class RescueModeForm extends AbstractCaptchaForm {
/**
- * @var Application[]
+ * @var Application[]
*/
public $applications;
/**
- * @var string[]
+ * @var string[]
*/
public $applicationValues = [];
public $password = '';
/**
- * @var User
+ * @var User
*/
public $user;
class IndexPage extends AbstractPage {
/**
* server information
- * @var string[]
+ * @var string[]
*/
public $server = [];
/**
* log entry id
- * @var integer
+ * @var integer
*/
public $logID = 0;
class Application extends DatabaseObject {
/**
* related package object
- * @var Package
+ * @var Package
*/
protected $package;
/**
* Returns related package object.
*
- * @return Package related package object
+ * @return Package related package object
*/
public function getPackage() {
if ($this->package === null) {
/**
* menu object
- * @var Menu
+ * @var Menu
*/
protected $menu;
/**
* maximum depth considered when building the node tree.
*
- * @var integer
+ * @var integer
*/
protected $maxDepth = -1;
/**
* menu item node tree
- * @var MenuItemNodeTree
+ * @var MenuItemNodeTree
*/
protected $menuItemNodeTree;
/**
* box object
- * @var Box
+ * @var Box
*/
protected $box;
/**
* Returns the items of this menu.
*
- * @return \RecursiveIteratorIterator
+ * @return \RecursiveIteratorIterator
*/
public function getMenuItemNodeList() {
return $this->getMenuItemNodeTree()->getNodeList();
/**
* Returns the box of this menu.
*
- * @return Box
+ * @return Box
*/
public function getBox() {
if ($this->box === null) {
}
/**
- * @return MenuItemNodeTree
+ * Returns the menu item node tree with the menu's items.
+ *
+ * @return MenuItemNodeTree
*/
protected function getMenuItemNodeTree() {
if ($this->menuItemNodeTree === null) {
* @package com.woltlab.wcf
* @subpackage data.menu
* @category Community Framework
- * @since 2.2
+ * @since 2.2
*/
class MenuCache extends SingletonFactory {
/**
- * @var Menu[]
+ * @var Menu[]
*/
protected $cachedMenus;
/**
- * @var MenuItemList[]
+ * @var MenuItemList[]
*/
protected $cachedMenuItems;
/**
* Returns a menu by id.
*
- * @param integer $menuID menu id
- * @return Menu|null menu object or null if menu id is unknown
+ * @param integer $menuID menu id
+ * @return Menu|null menu object or null if menu id is unknown
*/
public function getMenuByID($menuID) {
if (isset($this->cachedMenus[$menuID])) {
/**
* Returns a menu item list by menu id.
*
- * @param integer $menuID menu id
- * @return MenuItemList|null menu item list object or null if menu id is unknown
+ * @param integer $menuID menu id
+ * @return MenuItemList|null menu item list object or null if menu id is unknown
*/
public function getMenuItemsByMenuID($menuID) {
if (isset($this->cachedMenuItems[$menuID])) {
if (is_array($title)) {
if (count($title) > 1) {
- $sql = "SELECT languageCategoryID
- FROM wcf".WCF_N."_language_category
- WHERE languageCategory = ?";
+ $sql = "SELECT languageCategoryID
+ FROM wcf".WCF_N."_language_category
+ WHERE languageCategory = ?";
$statement = WCF::getDB()->prepareStatement($sql, 1);
$statement->execute(['wcf.menu']);
$languageCategoryID = $statement->fetchSingleColumn();
- $sql = "INSERT INTO wcf".WCF_N."_language_item
+ $sql = "INSERT INTO wcf".WCF_N."_language_item
(languageID, languageItem, languageItemValue, languageItemOriginIsSystem, languageCategoryID, packageID)
- VALUES (?, ?, ?, ?, ?, ?)";
+ VALUES (?, ?, ?, ?, ?, ?)";
$statement = WCF::getDB()->prepareStatement($sql);
WCF::getDB()->beginTransaction();
class ViewableMenu extends DatabaseObjectDecorator {
/**
- * @var MenuItemNodeTree
+ * @var MenuItemNodeTree
*/
protected $menuItems;
protected static $databaseTableIndexName = 'itemID';
/**
- * @var IMenuPageHandler
+ * @var IMenuPageHandler
*/
protected $handler;
/**
* page object
- * @var Page
+ * @var Page
*/
protected $page;
/**
* Returns true if the active user can delete this menu item.
*
- * @return boolean
+ * @return boolean
*/
public function canDelete() {
if (WCF::getSession()->getPermission('admin.content.cms.canManageMenu') && !$this->originIsSystem) {
return true;
}
-
+
return false;
}
/**
* Returns true if the active user can disable this menu item.
*
- * @return boolean
+ * @return boolean
*/
public function canDisable() {
if (WCF::getSession()->getPermission('admin.content.cms.canManageMenu')) {
return true;
}
-
+
return false;
}
/**
* Returns the URL of this menu item.
*
- * @return string
+ * @return string
*/
public function getURL() {
if ($this->pageObjectID) {
/**
* Returns the page that is linked by this menu item.
*
- * @return Page|null
+ * @return Page|null
*/
public function getPage() {
if ($this->page === null && $this->pageID) {
/**
* Returns false if this item should be hidden from menu.
*
- * @return boolean
+ * @return boolean
*/
public function isVisible() {
if ($this->getPage() !== null && !$this->getPage()->isVisible()) {
/**
* Returns the number of outstanding items for this menu.
*
- * @return integer
+ * @return integer
*/
public function getOutstandingItems() {
if ($this->getMenuPageHandler() !== null) {
}
/**
- * @return IMenuPageHandler|null
+ * TODO: Comment
+ *
+ * @return IMenuPageHandler|null
*/
protected function getMenuPageHandler() {
$page = $this->getPage();
if (is_array($title)) {
if (count($title) > 1) {
- $sql = "SELECT languageCategoryID
- FROM wcf".WCF_N."_language_category
- WHERE languageCategory = ?";
+ $sql = "SELECT languageCategoryID
+ FROM wcf".WCF_N."_language_category
+ WHERE languageCategory = ?";
$statement = WCF::getDB()->prepareStatement($sql, 1);
$statement->execute(['wcf.menu']);
$languageCategoryID = $statement->fetchSingleColumn();
- $sql = "INSERT INTO wcf".WCF_N."_language_item
+ $sql = "INSERT INTO wcf".WCF_N."_language_item
(languageID, languageItem, languageItemValue, languageItemOriginIsSystem, languageCategoryID, packageID)
- VALUES (?, ?, ?, ?, ?, ?)";
+ VALUES (?, ?, ?, ?, ?, ?)";
$statement = WCF::getDB()->prepareStatement($sql);
WCF::getDB()->beginTransaction();
/**
* Sets the menu items used to improve menu cache performance.
*
- * @param MenuItem[] $menuItems list of menu item objects
+ * @param MenuItem[] $menuItems list of menu item objects
*/
public function setMenuItems(array $menuItems) {
$this->objects = $menuItems;
/**
* true if item or one of its children is active
- * @var boolean
+ * @var boolean
*/
protected $isActive = false;
/**
* Returns true if this item (or one of its children) is marked as active.
*
- * @return boolean
+ * @return boolean
*/
public function isActiveNode() {
return $this->isActive;
/**
* number of visible items
- * @var integer
+ * @var integer
*/
protected $visibleItemCount = 0;
/**
* Creates a new MenuItemNodeTree object.
*
- * @param integer $menuID menu id
- * @param MenuItemList $menuItemList optional object to be provided when building the tree from cache
+ * @param integer $menuID menu id
+ * @param MenuItemList $menuItemList optional object to be provided when building the tree from cache
*/
public function __construct($menuID, MenuItemList $menuItemList = null) {
$this->menuID = $menuID;
/**
* Generates the node tree recursively.
*
- * @param integer $parentID parent menu item id
- * @param MenuItemNode $parentNode parent menu item object
- * @return MenuItemNode[] nested menu item tree
+ * @param integer $parentID parent menu item id
+ * @param MenuItemNode $parentNode parent menu item object
+ * @return MenuItemNode[] nested menu item tree
*/
protected function generateNodeTree($parentID = null, MenuItemNode $parentNode = null) {
$nodes = array();
/**
* Returns the number of visible items.
*
- * @return integer
+ * @return integer
*/
public function getVisibleItemCount() {
return $this->visibleItemCount;
protected static $databaseTableIndexName = 'pageID';
/**
- * @var \wcf\system\page\handler\IMenuPageHandler
+ * @var \wcf\system\page\handler\IMenuPageHandler
*/
protected $pageHandler;
/**
* Returns true if the active user can delete this page.
*
- * @return boolean
+ * @return boolean
*/
public function canDelete() {
if (WCF::getSession()->getPermission('admin.content.cms.canManagePage') && !$this->originIsSystem && !$this->isLandingPage) {
return true;
}
-
+
return false;
}
/**
* Returns true if the active user can disable this page.
*
- * @return boolean
+ * @return boolean
*/
public function canDisable() {
if (WCF::getSession()->getPermission('admin.content.cms.canManagePage') && !$this->originIsSystem && !$this->isLandingPage) {
return true;
}
-
+
return false;
}
/**
* Returns the page content.
*
- * @return array content data
+ * @return array content data
*/
public function getPageContent() {
$content = [];
$sql = "SELECT *
FROM wcf".WCF_N."_page_content
- WHERE pageID = ?";
+ WHERE pageID = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute([$this->pageID]);
while ($row = $statement->fetchArray()) {
* Returns content for a single language, passing `null` for `$languageID` is undefined
* for multilingual pages.
*
- * @param integer $languageID language id or `null` if there are no localized versions
- * @return string[] page content data
- * @throws \wcf\system\database\DatabaseException
+ * @param integer $languageID language id or `null` if there are no localized versions
+ * @return string[] page content data
+ * @throws \wcf\system\database\DatabaseException
*/
public function getPageContentByLanguage($languageID = null) {
$conditions = new PreparedStatementConditionBuilder();
else $conditions->add("languageID IS NULL");
$sql = "SELECT *
- FROM wcf".WCF_N."_page_content
+ FROM wcf".WCF_N."_page_content
".$conditions;
$statement = WCF::getDB()->prepareStatement($sql, 1);
$statement->execute($conditions->getParameters());
/**
* Returns the page URL.
*
- * @return string
+ * @return string
*/
public function getLink() {
if ($this->controller) {
}
else {
return LinkHandler::getInstance()->getCmsLink($this->pageID);
- }
+ }
}
/**
* Returns shortened link for acp page list.
*
- * @return string
+ * @return string
*/
public function getDisplayLink() {
return str_replace($this->getApplication()->getPageURL(), '', $this->getLink());
/**
* Returns the application of this page.
*
- * @return \wcf\data\application\Application
+ * @return \wcf\data\application\Application
*/
public function getApplication() {
return ApplicationHandler::getInstance()->getApplicationByID($this->packageID);
/**
* Returns the associated page handler or null.
*
- * @return \wcf\system\page\handler\IMenuPageHandler|null
+ * @return \wcf\system\page\handler\IMenuPageHandler|null
*/
public function getHandler() {
if ($this->handler) {
* Returns false if this page should be hidden from menus, but does not control the accessibility
* of the page itself.
*
- * @return boolean false if the page should be hidden from menus
+ * @return boolean false if the page should be hidden from menus
*/
public function isVisible() {
if (!$this->validateOptions()) return false;
/**
* Returns the page's internal name.
*
- * @return string
+ * @return string
*/
public function __toString() {
return $this->name;
/**
* Returns the page with the given identifier.
*
- * @param string $identifier unique page identifier
- * @return Page
+ * @param string $identifier unique page identifier
+ * @return Page
*/
public static function getPageByIdentifier($identifier) {
$sql = "SELECT *
protected $className = PageEditor::class;
/**
- * @var PageEditor
+ * @var PageEditor
*/
protected $pageEditor;
class PageCache extends SingletonFactory {
/**
* page cache
- * @var array
+ * @var array
*/
protected $cache;
/**
* Returns a page by page id or null.
*
- * @param integer $pageID page id
- * @return Page|null
+ * @param integer $pageID page id
+ * @return Page|null
*/
public function getPage($pageID) {
if (isset($this->cache['pages'][$pageID])) {
/**
* Returns a page by controller or null.
*
- * @param string $controller controller class name
- * @return Page|null
+ * @param string $controller controller class name
+ * @return Page|null
*/
public function getPageByController($controller) {
if (isset($this->cache['controller'][$controller])) {
/**
* Returns a page by its internal identifier or null.
*
- * @param string $identifier internal identifier
- * @return Page|null
+ * @param string $identifier internal identifier
+ * @return Page|null
*/
public function getPageByIdentifier($identifier) {
if (isset($this->cache['identifier'][$identifier])) {
*/
class CmsPage extends AbstractPage {
/**
- * @var string[]
+ * @var string[]
*/
public $content;
/**
- * @var integer
+ * @var integer
*/
public $languageID;
/**
- * @var Page
+ * @var Page
*/
public $page;
/**
- * @var integer
+ * @var integer
*/
public $pageID;
/**
* @inheritDoc
- * @throws IllegalLinkException
+ * @throws IllegalLinkException
*/
public function readParameters() {
parent::readParameters();
abstract class SingletonFactory {
/**
* list of singletons
- * @var SingletonFactory[]
+ * @var SingletonFactory[]
*/
protected static $__singletonObjects = array();
class WCF {
/**
* list of currently loaded applications
- * @var Application[]
+ * @var Application[]
*/
protected static $applications = array();
class WCFACP extends WCF {
/**
* rescue mode
- * @var boolean
+ * @var boolean
*/
protected static $inRescueMode;
/**
* URL to WCF within rescue mode
- * @var string
+ * @var string
*/
protected static $rescueModePageURL;
/**
* Returns true if ACP is currently in rescue mode.
*
- * @return boolean
+ * @return boolean
*/
public static function inRescueMode() {
if (self::$inRescueMode === null) {
/**
* Returns URL for rescue mode page.
*
- * @return string
+ * @return string
*/
public static function getRescueModePageURL() {
if (self::inRescueMode()) {
/**
* installation directories
- * @var string[]
+ * @var string[]
*/
protected static $directories = [];
/**
* list of installed files
- * @var string[]
+ * @var string[]
*/
protected static $installedFiles = [];
self::$directories[$application] = $directory;
if ($application === 'wcf' && @file_exists(self::$directories['wcf'])) {
- define('RELATIVE_WCF_DIR', FileUtil::getRelativePath(INSTALL_SCRIPT_DIR, self::$directories['wcf']));
+ define('RELATIVE_WCF_DIR', FileUtil::getRelativePath(INSTALL_SCRIPT_DIR, self::$directories['wcf']));
}
}
}
*
* @param \wcf\system\database\Database $db
* @param integer $dbNumber
- * @return string[] list of already existing tables
+ * @return string[] list of already existing tables
*/
protected function getConflictedTables($db, $dbNumber) {
// get content of the sql structure file
* Returns an application based upon it's abbreviation. Will return the
* primary application if $abbreviation equals to 'wcf'
*
- * @param string $abbreviation package abbreviation, e.g. `wbb` for `com.woltlab.wbb`
+ * @param string $abbreviation package abbreviation, e.g. `wbb` for `com.woltlab.wbb`
* @return Application
*/
public function getApplication($abbreviation) {
/**
* Returns an application by package id.
*
- * @param integer $packageID package id
- * @return Application application object
+ * @param integer $packageID package id
+ * @return Application application object
* @since 2.2
*/
public function getApplicationByID($packageID) {
/**
* Returns abbreviation for a given package id or null if application is unknown.
*
- * @param int $packageID unique package id
+ * @param integer $packageID unique package id
* @return string
*/
public function getAbbreviation($packageID) {
class BoxHandler extends SingletonFactory {
/**
* boxes grouped by position
- * @var Box[][]
+ * @var Box[][]
*/
protected $boxes = [];
/**
* Returns boxes for the given position.
*
- * @param string $position
- * @return Box[]
+ * @param string $position
+ * @return Box[]
*/
public function getBoxes($position) {
if (isset($this->boxes[$position])) {
class Breadcrumbs extends SingletonFactory implements \Countable, \Iterator {
/**
* list of breadcrumbs
- * @var Breadcrumb[]
+ * @var Breadcrumb[]
*/
protected $items = [];
* @package com.woltlab.wcf
* @subpackage system.cache.builder
* @category Community Framework
- * @since 2.2
+ * @since 2.2
*/
class MenuCacheBuilder extends AbstractCacheBuilder {
/**
* and environment level to prevent any issues with controllers with the same name but
* correct spelling to be incorrectly handled.
*
- * @return array
+ * @return array
*/
protected function getCaseInsensitiveControllers() {
$data = [
* Builds up a lookup and a reverse lookup list per application in order to resolve
* custom page mappings.
*
- * @return array
+ * @return array
*/
protected function getCustomUrls() {
$data = [
}
// fetch pages with a controller and a custom url
- $sql = "SELECT controller, controllerCustomURL, packageID
- FROM wcf".WCF_N."_page
- WHERE controller <> ''
+ $sql = "SELECT controller, controllerCustomURL, packageID
+ FROM wcf".WCF_N."_page
+ WHERE controller <> ''
AND controllerCustomURL <> ''";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute();
}
// fetch content pages using the common page controller
- $sql = "SELECT page_content.customURL AS controllerCustomURL, page_content.pageID, page_content.languageID, page.packageID
- FROM wcf".WCF_N."_page_content page_content
- LEFT JOIN wcf".WCF_N."_page page
- ON (page.pageID = page_content.pageID)";
+ $sql = "SELECT page_content.customURL AS controllerCustomURL, page_content.pageID, page_content.languageID, page.packageID
+ FROM wcf".WCF_N."_page_content page_content
+ LEFT JOIN wcf".WCF_N."_page page
+ ON (page.pageID = page_content.pageID)";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute();
while ($row = $statement->fetchArray()) {
/**
* Returns the list of landing pages per application.
*
- * @return string[]
+ * @return string[]
*/
protected function getLandingPages() {
$data = [];
* @param string $className
* @param string $name
* @param array &$parameters
- * @throws SystemException
+ * @throws SystemException
*/
protected function executeInheritedActions($eventObj, $eventName, $className, $name, array &$parameters) {
// create objects of the actions
* @param mixed $eventObj
* @param string $eventName
* @param array &$parameters
- * @throws SystemException
+ * @throws SystemException
*/
public function fireAction($eventObj, $eventName, array &$parameters = array()) {
// get class name
*
* @param string $className
* @param string $eventName
- * @return string unique action name
+ * @return string unique action name
*/
public static function generateKey($className, $eventName) {
return $eventName.'@'.$className;
*/
class HtmlInputProcessor {
/**
- * @var IHtmlInputFilter
+ * @var IHtmlInputFilter
*/
protected $htmlInputFilter;
/**
- * @var HtmlInputNodeProcessor
+ * @var HtmlInputNodeProcessor
*/
protected $htmlInputNodeProcessor;
}
/**
- * @return IHtmlInputFilter|MessageHtmlInputFilter
+ * @return IHtmlInputFilter|MessageHtmlInputFilter
*/
public function getHtmlInputFilter() {
if ($this->htmlInputFilter === null) {
}
/**
- * @return HtmlInputNodeProcessor
+ * @return HtmlInputNodeProcessor
*/
public function getHtmlInputNodeProcessor() {
if ($this->htmlInputNodeProcessor === null) {
/**
* Applies filters on unsafe html.
*
- * @param string $html unsafe html
- * @return string filtered html
+ * @param string $html unsafe html
+ * @return string filtered html
*/
public function apply($html);
}
*/
class MessageHtmlInputFilter implements IHtmlInputFilter {
/**
- * @var \HTMLPurifier
+ * @var \HTMLPurifier
*/
protected static $purifier;
}
/**
- * @return \HTMLPurifier
+ * @return \HTMLPurifier
*/
protected function getPurifier() {
if (self::$purifier === null) {
*/
class HtmlNodeProcessor {
/**
- * @var \DOMDocument
+ * @var \DOMDocument
*/
protected $document;
*/
class HtmlOutputProcessor {
/**
- * @var HtmlOutputNodeProcessor
+ * @var HtmlOutputNodeProcessor
*/
protected $htmlOutputNodeProcessor;
*/
class HtmlOutputNodeWoltlabMention implements IHtmlOutputNode {
/**
- * @var UserProfile[]
+ * @var UserProfile[]
*/
protected $userProfiles;
$sql = "INSERT IGNORE INTO wcf".WCF_N."_acl_option_to_group
(optionID, objectID, groupID, optionValue)
- VALUES (?, ?, ?, ?)";
+ VALUES (?, ?, ?, ?)";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute(array($data['optionID'], $data['objectID'], $data['groupID'], $data['optionValue']));
$sql = "INSERT IGNORE INTO wcf".WCF_N."_acl_option_to_user
(optionID, objectID, userID, optionValue)
- VALUES (?, ?, ?, ?)";
+ VALUES (?, ?, ?, ?)";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute(array($data['optionID'], $data['objectID'], $data['userID'], $data['optionValue']));
class PageMenu extends TreeMenu {
/**
* @inheritDoc
- * @throws SystemException
+ * @throws SystemException
*/
protected function init() {
// get menu items from cache
/**
* Checks the options and permissions of given menu item.
*
- * @param UserProfileMenuItem $item
+ * @param UserProfileMenuItem $item
* @return boolean
*/
protected function checkMenuItem(UserProfileMenuItem $item) {
/**
* Installs current package.
*
- * @param mixed[] $nodeData
- * @return PackageInstallationStep
+ * @param mixed[] $nodeData
+ * @return PackageInstallationStep
*/
protected function installPackage(array $nodeData) {
$installationStep = new PackageInstallationStep();
/**
* Executes a package installation plugin.
*
- * @param mixed[] $nodeData
+ * @param mixed[] $nodeData
* @return boolean
*/
protected function executePIP(array $nodeData) {
* @inheritDoc
*/
protected function handleDelete(array $items) {
- $sql = "DELETE FROM wcf".WCF_N."_box
- WHERE identifier = ?
+ $sql = "DELETE FROM wcf".WCF_N."_box
+ WHERE identifier = ?
AND packageID = ?";
$statement = WCF::getDB()->prepareStatement($sql);
/**
* @inheritDoc
- * @throws SystemException
+ * @throws SystemException
*/
protected function getElement(\DOMXPath $xpath, array &$elements, \DOMElement $element) {
$nodeValue = $element->nodeValue;
/**
* @inheritDoc
- * @throws SystemException
+ * @throws SystemException
*/
protected function prepareImport(array $data) {
$boxType = $data['elements']['boxtype'];
* Returns the show order for a new item that will append it to the current
* menu or parent item.
*
- * @param string $position box position
- * @return integer
+ * @param string $position box position
+ * @return integer
*/
protected function getItemOrder($position) {
$sql = "SELECT MAX(showOrder) AS showOrder
- FROM wcf".WCF_N."_box
+ FROM wcf".WCF_N."_box
WHERE position = ?";
$statement = WCF::getDB()->prepareStatement($sql, 1);
$statement->execute([$position]);
* @inheritDoc
*/
protected function handleDelete(array $items) {
- $sql = "DELETE FROM wcf".WCF_N."_menu_item
- WHERE identifier = ?
+ $sql = "DELETE FROM wcf".WCF_N."_menu_item
+ WHERE identifier = ?
AND packageID = ?";
$statement = WCF::getDB()->prepareStatement($sql);
/**
* @inheritDoc
- * @throws SystemException
+ * @throws SystemException
*/
protected function getElement(\DOMXPath $xpath, array &$elements, \DOMElement $element) {
$nodeValue = $element->nodeValue;
/**
* @inheritDoc
- * @throws SystemException
+ * @throws SystemException
*/
protected function prepareImport(array $data) {
$menuID = null;
if (!empty($data['elements']['menu'])) {
- $sql = "SELECT menuID
- FROM wcf".WCF_N."_menu
- WHERE identifier = ?";
+ $sql = "SELECT menuID
+ FROM wcf".WCF_N."_menu
+ WHERE identifier = ?";
$statement = WCF::getDB()->prepareStatement($sql, 1);
$statement->execute([$data['elements']['menu']]);
$row = $statement->fetchSingleRow();
throw new SystemException("The menu item '" . $data['attributes']['identifier'] . "' can either have an associated menu or a parent menu item, but not both.");
}
- $sql = "SELECT *
- FROM wcf".WCF_N."_menu_item
- WHERE identifier = ?";
+ $sql = "SELECT *
+ FROM wcf".WCF_N."_menu_item
+ WHERE identifier = ?";
$statement = WCF::getDB()->prepareStatement($sql, 1);
$statement->execute([$data['elements']['parent']]);
$parent = $statement->fetchObject(MenuItem::class);
$pageID = null;
if (!empty($data['elements']['page'])) {
- $sql = "SELECT pageID
- FROM wcf".WCF_N."_page
- WHERE identifier = ?";
+ $sql = "SELECT pageID
+ FROM wcf".WCF_N."_page
+ WHERE identifier = ?";
$statement = WCF::getDB()->prepareStatement($sql, 1);
$statement->execute([$data['elements']['page']]);
$row = $statement->fetchSingleRow();
* Returns the show order for a new item that will append it to the current
* menu or parent item.
*
- * @param int $menuID
- * @param int $parentItemID
- * @return int
- * @throws \wcf\system\database\DatabaseException
+ * @param integer $menuID
+ * @param integer $parentItemID
+ * @return integer
+ * @throws \wcf\system\database\DatabaseException
*/
protected function getItemOrder($menuID, $parentItemID = null) {
- $sql = "SELECT MAX(showOrder) AS showOrder
- FROM wcf".WCF_N."_menu_item
- WHERE " . ($parentItemID === null ? 'menuID' : 'parentItemID') . " = ?";
+ $sql = "SELECT MAX(showOrder) AS showOrder
+ FROM wcf".WCF_N."_menu_item
+ WHERE " . ($parentItemID === null ? 'menuID' : 'parentItemID') . " = ?";
$statement = WCF::getDB()->prepareStatement($sql, 1);
$statement->execute([
($parentItemID === null ? $menuID : $parentItemID)
class MenuPackageInstallationPlugin extends AbstractXMLPackageInstallationPlugin {
/**
* box meta data per menu
- * @var string[]
+ * @var string[]
*/
public $boxData = [];
* @inheritDoc
*/
protected function handleDelete(array $items) {
- $sql = "DELETE FROM wcf".WCF_N."_menu
- WHERE identifier = ?
+ $sql = "DELETE FROM wcf".WCF_N."_menu
+ WHERE identifier = ?
AND packageID = ?";
$statement = WCF::getDB()->prepareStatement($sql);
/**
* @inheritDoc
- * @throws SystemException
+ * @throws SystemException
*/
protected function getElement(\DOMXPath $xpath, array &$elements, \DOMElement $element) {
$nodeValue = $element->nodeValue;
$conditions->add("identifier IN (?)", [array_keys($this->boxData)]);
$conditions->add("packageID = ?", [$this->installation->getPackageID()]);
- $sql = "SELECT *
- FROM wcf".WCF_N."_box
+ $sql = "SELECT *
+ FROM wcf".WCF_N."_box
".$conditions;
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditions->getParameters());
* @inheritDoc
*/
protected function handleDelete(array $items) {
- $sql = "DELETE FROM wcf".WCF_N."_page
- WHERE identifier = ?
+ $sql = "DELETE FROM wcf".WCF_N."_page
+ WHERE identifier = ?
AND packageID = ?";
$statement = WCF::getDB()->prepareStatement($sql);
/**
* @inheritDoc
- * @throws SystemException
+ * @throws SystemException
*/
protected function prepareImport(array $data) {
$isStatic = false;
$parentPageID = null;
if (!empty($data['elements']['parent'])) {
- $sql = "SELECT pageID
- FROM wcf".WCF_N."_".$this->tableName."
- WHERE identifier = ?";
+ $sql = "SELECT pageID
+ FROM wcf".WCF_N."_".$this->tableName."
+ WHERE identifier = ?";
$statement = WCF::getDB()->prepareStatement($sql, 1);
$statement->execute([$data['elements']['parent']]);
$row = $statement->fetchSingleRow();
*/
protected function postImport() {
if (!empty($this->content)) {
- $sql = "INSERT IGNORE INTO wcf".WCF_N."_page_content
+ $sql = "INSERT IGNORE INTO wcf".WCF_N."_page_content
(pageID, languageID, title, content, metaDescription, metaKeywords, customURL)
- VALUES (?, ?, ?, ?, ?, ?, ?)";
+ VALUES (?, ?, ?, ?, ?, ?, ?)";
$statement = WCF::getDB()->prepareStatement($sql);
WCF::getDB()->beginTransaction();
class PageLocationManager extends SingletonFactory {
/**
* list of locations with descending priority
- * @var array
+ * @var array
*/
protected $stack = [];
* Appends a parent location to the stack, the later it is added the lower
* is its assumed priority when matching suitable menu items.
*
- * @param string $identifier internal page identifier
- * @param integer $pageObjectID page object id
- * @throws SystemException
+ * @param string $identifier internal page identifier
+ * @param integer $pageObjectID page object id
+ * @throws SystemException
*/
public function addParentLocation($identifier, $pageObjectID = 0) {
$page = PageCache::getInstance()->getPageByIdentifier($identifier);
/**
* Returns the list of locations with descending priority.
*
- * @return array
+ * @return array
*/
public function getLocations() {
return $this->stack;
/**
* Returns the link for a page with an object id.
*
- * @param integer $objectID page object id
- * @return string page url
+ * @param integer $objectID page object id
+ * @return string page url
*/
public function getLink($objectID);
/**
* Returns true if provided object id exists and is valid.
*
- * @param integer $objectID page object id
- * @return boolean true if object id is valid
+ * @param integer $objectID page object id
+ * @return boolean true if object id is valid
*/
public function isValid($objectID);
* Performs a search for pages using a query string, returning an array containing
* an `objectID => title` relation.
*
- * @param string $searchString search string
- * @return string[]
+ * @param string $searchString search string
+ * @return string[]
*/
public function lookup($searchString);
}
interface IMenuPageHandler {
/**
* Returns the number of outstanding items for this page for display as a badge, optionally
- * specifing a corresponding object id to limit the scope.
+ * specifying a corresponding object id to limit the scope.
*
- * @param integer $objectID optional page object id
- * @return integer number of outstanding items
+ * @param integer $objectID optional page object id
+ * @return integer number of outstanding items
*/
public function getOutstandingItemCount($objectID = null);
* Returns false if this page should be hidden from menus, but does not control the accessibility
* of the page itself. The visibility can optionally be scoped to the given object id.
*
- * @param integer $objectID optional page object id
- * @return boolean false if the page should be hidden from menus
+ * @param integer $objectID optional page object id
+ * @return boolean false if the page should be hidden from menus
*/
public function isVisible($objectID = null);
}
*/
class ControllerMap extends SingletonFactory {
/**
- * @var string[][]
+ * @var string[][]
*/
protected $ciControllers;
/**
- * @var string[][]
+ * @var string[][]
*/
protected $customUrls;
/**
- * @var string[]
+ * @var string[]
*/
protected $landingPages;
/**
* list of <ControllerName> to <controller-name> mappings
- * @var array<string>
+ * @var string[]
*/
protected $lookupCache = [];
/**
* @inheritDoc
- * @throws SystemException
+ * @throws SystemException
*/
protected function init() {
$this->ciControllers = RoutingCacheBuilder::getInstance()->getData([], 'ciControllers');
*
* URL -> Controller
*
- * @param string $application application identifier
- * @param string $controller url controller
- * @param boolean $isAcpRequest true if this is an ACP request
- * @return mixed array containing className, controller and pageType or a string containing the controller name for aliased controllers
- * @throws SystemException
+ * @param string $application application identifier
+ * @param string $controller url controller
+ * @param boolean $isAcpRequest true if this is an ACP request
+ * @return mixed array containing className, controller and pageType or a string containing the controller name for aliased controllers
+ * @throws SystemException
*/
public function resolve($application, $controller, $isAcpRequest) {
// validate controller
*
* URL -> Controller
*
- * @param string $application application identifier
- * @param string $controller url controller
- * @return array empty array if there is no exact match
+ * @param string $application application identifier
+ * @param string $controller url controller
+ * @return array empty array if there is no exact match
*/
public function resolveCustomController($application, $controller) {
if (isset($this->customUrls['lookup'][$application]) && isset($this->customUrls['lookup'][$application][$controller])) {
*
* Controller -> URL
*
- * @param string $application application identifier
- * @param string $controller controller class, e.g. 'MembersList'
- * @return string url representation of controller, e.g. 'members-list'
+ * @param string $application application identifier
+ * @param string $controller controller class, e.g. 'MembersList'
+ * @return string url representation of controller, e.g. 'members-list'
*/
public function lookup($application, $controller) {
$lookupKey = $application . '-' . $controller;
* Looks up a cms page URL, returns an array containing the application identifier
* and url controller name or null if there was no match.
*
- * @param integer $pageID page id
- * @param integer $languageID content language id
- * @return string[]|null
+ * @param integer $pageID page id
+ * @param integer $languageID content language id
+ * @return string[]|null
*/
public function lookupCmsPage($pageID, $languageID) {
$key = '__WCF_CMS__' . $pageID . '-' . ($languageID ?: 0);
/**
* Lookups default controller for given application.
*
- * @param string $application application identifier
- * @return null|string[] default controller
+ * @param string $application application identifier
+ * @return null|string[] default controller
*/
public function lookupDefaultController($application) {
$controller = $this->landingPages[$application][1];
/**
* Returns true if given controller is the application's default.
*
- * @param string $application application identifier
- * @param string $controller url controller name
- * @return boolean true if controller is the application's default
+ * @param string $application application identifier
+ * @param string $controller url controller name
+ * @return boolean true if controller is the application's default
*/
public function isDefaultController($application, $controller) {
// lookup custom urls first
* Returns the class data for the active request or null if for the given
* configuration no proper class exist.
*
- * @param string $application application identifier
- * @param string $controller controller name
- * @param boolean $isAcpRequest true if this is an ACP request
- * @param string $pageType page type, e.g. 'form' or 'action'
- * @return string[] className, controller and pageType
+ * @param string $application application identifier
+ * @param string $controller controller name
+ * @param boolean $isAcpRequest true if this is an ACP request
+ * @param string $pageType page type, e.g. 'form' or 'action'
+ * @return string[] className, controller and pageType
*/
protected function getClassData($application, $controller, $isAcpRequest, $pageType) {
$className = $application . '\\' . ($isAcpRequest ? 'acp\\' : '') . $pageType . '\\' . $controller . ucfirst($pageType);
/**
* Transforms a controller into its URL representation.
*
- * @param string $controller controller, e.g. 'BoardList'
- * @return string url representation, e.g. 'board-list'
+ * @param string $controller controller, e.g. 'BoardList'
+ * @return string url representation, e.g. 'board-list'
*/
public static function transformController($controller) {
$parts = preg_split('~([A-Z][a-z0-9]+)~', $controller, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
/**
* request meta data
- * @var string[]
+ * @var string[]
*/
protected $metaData;
/**
* Creates a new request object.
*
- * @param string $className fully qualified name
- * @param string $pageName class name
- * @param string $pageType can be 'action', 'form' or 'page'
- * @param string[] $metaData additional meta data
+ * @param string $className fully qualified name
+ * @param string $pageName class name
+ * @param string $pageType can be 'action', 'form' or 'page'
+ * @param string[] $metaData additional meta data
*/
public function __construct($className, $pageName, $pageType, array $metaData) {
$this->className = $className;
*
* @param string $application
* @param boolean $isACPRequest
- * @throws AJAXException
- * @throws IllegalLinkException
- * @throws SystemException
+ * @throws AJAXException
+ * @throws IllegalLinkException
+ * @throws SystemException
*/
public function handle($application = 'wcf', $isACPRequest = false) {
try {
* Builds a new request.
*
* @param string $application
- * @throws IllegalLinkException
+ * @throws IllegalLinkException
*/
protected function buildRequest($application) {
try {
/**
* list of available routes
- * @var IRoute[]
+ * @var IRoute[]
*/
protected $routes = array();
* Builds a route based upon route components, this is nothing
* but a reverse lookup.
*
- * @param string $application application identifier
+ * @param string $application application identifier
* @param array $components
* @param boolean $isACP
* @return string
- * @throws SystemException
+ * @throws SystemException
*/
public function buildRoute($application, array $components, $isACP = null) {
if ($isACP === null) $isACP = RequestHandler::getInstance()->isACPRequest();
/**
* Default interface for route implementations.
*
- * @author Alexander Ebert
- * @copyright 2001-2015 WoltLab GmbH
- * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @package com.woltlab.wcf
- * @subpackage system.request
- * @category Community Framework
+ * @author Alexander Ebert
+ * @copyright 2001-2015 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package com.woltlab.wcf
+ * @subpackage system.request
+ * @category Community Framework
* @since 2.2
*/
interface IRequestRoute extends IRoute {
/**
* Configures this route to handle either ACP or frontend requests.
*
- * @param boolean $isACP true if route handles ACP requests
+ * @param boolean $isACP true if route handles ACP requests
*/
public function setIsACP($isACP);
}
class LookupRequestRoute implements IRequestRoute {
/**
* list of parsed route information
- * @var array
+ * @var array
*/
protected $routeData = [];
/**
* @inheritDoc
- * @throws SystemException
+ * @throws SystemException
*/
public function buildLink(array $components) {
throw new SystemException('LookupRequestRoute cannot build links, please verify capabilities by calling canHandle() first.');
* Returns the value of a session variable.
*
* @param string $key
- * @return mixed
+ * @return mixed
*/
public function getVar($key) {
if (isset($this->variables[$key])) {
* Checks if the active user has the given permissions and throws a
* PermissionDeniedException if that isn't the case.
*
- * @param array<string> $permissions list of permissions where each one must pass
- * @throws PermissionDeniedException
+ * @param string[] $permissions ist of permissions where each one must pass
+ * @throws PermissionDeniedException
*/
public function checkPermissions(array $permissions) {
foreach ($permissions as $permission) {
* Returns the relative date time identical to the relative time generated
* through JavaScript.
*
- * @param \DateTime $dateTimeObject target date object
- * @param integer $timestamp target timestamp
- * @param string $date localized date
- * @param string $time localized time
- * @param boolean $isFutureDate true if timestamp is in the future
- * @return string relative time
+ * @param \DateTime $dateTimeObject target date object
+ * @param integer $timestamp target timestamp
+ * @param string $date localized date
+ * @param string $time localized time
+ * @param boolean $isFutureDate true if timestamp is in the future
+ * @return string relative time
*/
protected function getRelativeTime(\DateTime $dateTimeObject, $timestamp, $date, $time, $isFutureDate) {
if ($isFutureDate) {
/**
* Returns the language item prefix for the notification texts.
*
- * @return string
+ * @return string
*/
public function getLanguageItemPrefix() {
if ($this->languageItemPrefix === null) {