+++ /dev/null
-<?xml version="1.0"?>
-<!-- This file is used for xml files which install, update or delete user group options. -->
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.woltlab.com" targetNamespace="http://www.woltlab.com" elementFormDefault="qualified">
- <!-- include types -->
- <xs:include schemaLocation="types.xsd" />
-
- <!-- data element -->
- <xs:element name="data">
- <xs:complexType>
- <xs:all>
- <xs:element name="import" type="import" minOccurs="0" />
- <xs:element name="delete" type="delete" minOccurs="0" />
- </xs:all>
- </xs:complexType>
- </xs:element>
-
- <!-- import element -->
- <xs:complexType name="import">
- <xs:sequence>
- <xs:element name="dashboardbox" type="dashboardbox" minOccurs="0" maxOccurs="unbounded" />
- </xs:sequence>
- </xs:complexType>
-
- <!-- delete element type -->
- <xs:complexType name="delete">
- <xs:choice maxOccurs="unbounded">
- <xs:element name="dashboardbox" type="dashboardbox" minOccurs="0" />
- </xs:choice>
- </xs:complexType>
-
- <!-- dashboardbox import element type -->
- <xs:complexType name="dashboardbox">
- <xs:complexContent>
- <xs:extension base="dashboardbox_basic">
- <xs:all>
- <xs:element name="classname" type="woltlab_varchar" minOccurs="1" />
- <xs:element name="boxtype" type="woltlab_boxtype" minOccurs="1" />
- </xs:all>
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
-
- <xs:simpleType name="woltlab_boxtype">
- <xs:restriction base="xs:string">
- <xs:enumeration value="sidebar" />
- <xs:enumeration value="content" />
- </xs:restriction>
- </xs:simpleType>
-
- <xs:complexType name="dashboardbox_basic">
- <xs:attribute name="name" type="woltlab_varchar" />
- </xs:complexType>
-</xs:schema>
\ No newline at end of file
<options>module_members_list</options>
<categoryname>com.woltlab.wcf.other</categoryname>
</type>
- <type>
- <name>com.woltlab.wcf.DashboardPage</name>
- <definitionname>com.woltlab.wcf.page</definitionname>
- <classname><![CDATA[wcf\page\DashboardPage]]></classname>
- <options>module_dashboard_page</options>
- <categoryname>com.woltlab.wcf.other</categoryname>
- </type>
<type>
<name>com.woltlab.wcf.DeletedContentListPage</name>
<definitionname>com.woltlab.wcf.page</definitionname>
<interfacename><![CDATA[wcf\system\user\notification\object\type\IUserNotificationObjectType]]></interfacename>
</definition>
- <definition>
- <name>com.woltlab.wcf.user.dashboardContainer</name>
- </definition>
-
<definition>
<name>com.woltlab.wcf.user.objectWatch</name>
<interfacename><![CDATA[wcf\system\user\object\watch\IUserObjectWatch]]></interfacename>
<optiontype>boolean</optiontype>
<defaultvalue>1</defaultvalue>
</option>
- <option name="module_dashboard_page">
- <categoryname>module.display</categoryname>
- <optiontype>boolean</optiontype>
- <defaultvalue>1</defaultvalue>
- </option>
<option name="module_like">
<categoryname>module.community</categoryname>
</option>
<!-- /user.cleanup -->
- <!-- dashboard -->
+ <!-- dashboard TODO -->
<option name="recent_activity_items">
<categoryname>dashboard.content.recentActivities</categoryname>
<optiontype>integer</optiontype>
<pip name="userProfileMenu">wcf\system\package\plugin\UserProfileMenuPackageInstallationPlugin</pip>
<pip name="userMenu">wcf\system\package\plugin\UserMenuPackageInstallationPlugin</pip>
<pip name="userNotificationEvent">wcf\system\package\plugin\UserNotificationEventPackageInstallationPlugin</pip>
- <pip name="dashboardBox">wcf\system\package\plugin\DashboardBoxPackageInstallationPlugin</pip>
<pip name="box">wcf\system\package\plugin\BoxPackageInstallationPlugin</pip>
<pip name="menu">wcf\system\package\plugin\MenuPackageInstallationPlugin</pip>
<pip name="menuItem">wcf\system\package\plugin\MenuItemPackageInstallationPlugin</pip>
<pageType>text</pageType>
<name language="de"><![CDATA[Dashboard]]></name>
<name language="en"><![CDATA[Dashboard]]></name>
- <options>module_dashboard_page</options>
<content>
<title>Dashboard</title>
+++ /dev/null
-{include file='documentHeader'}
-
-<head>
- <title>{if !$__wcf->isLandingPage()}{lang}wcf.user.dashboard{/lang} - {/if}{PAGE_TITLE|language}</title>
-
- {include file='headInclude'}
-
- <link rel="canonical" href="{link controller='Dashboard'}{/link}" />
-</head>
-
-<body id="tpl{$templateName|ucfirst}" data-template="{$templateName}" data-application="{$templateNameApplication}">
-
-{if $__boxSidebar|isset && $__boxSidebar}
- {capture assign='sidebarRight'}
- {@$__boxSidebar}
- {/capture}
-{/if}
-
-{include file='header'}
-
-{if $__wcf->isLandingPage()}
- <header class="contentHeader">
- <div class="contentHeaderTitle">
- <h1 class="contentTitle">{PAGE_TITLE|language}</h1>
- {hascontent}<p class="contentHeaderDescription">{content}{PAGE_DESCRIPTION|language}{/content}</p>{/hascontent}
- </div>
-
- {hascontent}
- <nav class="contentHeaderNavigation">
- <ul>
- {content}{event name='contentHeaderNavigation'}{/content}
- </ul>
- </nav>
- {/hascontent}
- </header>
-{else}
- <header class="contentHeader">
- <div class="contentHeaderTitle">
- <h1 class="contentTitle">{lang}wcf.user.dashboard{/lang}</h1>
- </div>
-
- {hascontent}
- <nav class="contentHeaderNavigation">
- <ul>
- {content}{event name='contentHeaderNavigation'}{/content}
- </ul>
- </nav>
- {/hascontent}
- </header>
-{/if}
-
-{include file='userNotice'}
-
-<section id="dashboard">
- {if $__boxContent|isset}{@$__boxContent}{/if}
-</section>
-
-<footer class="contentFooter">
- {hascontent}
- <nav class="contentFooterNavigation">
- <ul>
- {content}{event name='contentFooterNavigation'}{/content}
- </ul>
- </nav>
- {/hascontent}
-</footer>
-
-{include file='footer'}
-
-</body>
-</html>
+++ /dev/null
-<section class="dashboardBox" data-box-name="{$box->boxName}">
- {@$template}
-</section>
+++ /dev/null
-<section class="dashboardBox" data-box-name="{$box->boxName}">
- <h1>{if $titleLink}<a href="{$titleLink}">{lang}wcf.dashboard.box.{$box->boxName}{/lang}</a>{else}{lang}wcf.dashboard.box.{$box->boxName}{/lang}{/if}</h1>
-
- <div>
- {@$template}
- </div>
-</section>
\ No newline at end of file
</div>
</form>
</section>
-
- {@$__boxSidebar}
{/capture}
{include file='header'}
<body id="tpl{$templateName|ucfirst}" data-template="{$templateName}" data-application="{$templateNameApplication}">
-{capture assign='sidebarRight'}
- {@$__boxSidebar}
-{/capture}
-
{include file='header'}
<header class="contentHeader">
<body id="tpl{$templateName|ucfirst}" data-template="{$templateName}" data-application="{$templateNameApplication}">
-{capture assign='sidebarRight'}
- {@$__boxSidebar}
-{/capture}
-
{include file='header'}
<header class="contentHeader">
<body id="tpl{$templateName|ucfirst}" data-template="{$templateName}" data-application="{$templateNameApplication}">
-{capture assign='sidebarRight'}
- {@$__boxSidebar}
-{/capture}
-
{include file='header'}
<header class="contentHeader">
</div>
{/if}
</section>
-
- {@$__boxSidebar}
{/capture}
{include file='header'}
define('MODULE_USER_SIGNATURE', 1);
define('MODULE_MEMBERS_LIST', 1);
define('MODULE_TEAM_PAGE', 1);
-define('MODULE_DASHBOARD_PAGE', 1);
define('MODULE_LIKE', 1);
define('MODULE_USER_PROFILE_WALL', 1);
define('MODULE_TAGGING', 1);
+++ /dev/null
-{include file='header' pageTitle='wcf.acp.dashboard.list'}
-
-<header class="contentHeader">
- <div class="contentHeaderTitle">
- <h1 class="contentTitle">{lang}wcf.acp.dashboard.list{/lang}</h1>
- </div>
-
- {hascontent}
- <nav class="contentHeaderNavigation">
- <ul>
- {content}{event name='contentHeaderNavigation'}{/content}
- </ul>
- </nav>
- {/hascontent}
-</header>
-
-<div class="section tabularBox">
- <table class="table">
- <thead>
- <tr>
- <th colspan="2" class="columnID">{lang}wcf.global.objectID{/lang}</th>
- <th class="columnText">{lang}wcf.dashboard.objectType{/lang}</th>
-
- {event name='columnHeads'}
- </tr>
- </thead>
-
- <tbody>
- {foreach from=$objectTypes item=$objectType}
- <tr>
- <td class="columnIcon">
- <a href="{link controller='DashboardOption' id=$objectType->objectTypeID}{/link}" title="{lang}wcf.global.button.edit{/lang}" class="jsTooltip"><span class="icon icon16 fa-pencil"></span></a>
-
- {event name='rowButtons'}
- </td>
- <td class="columnID">{#$objectType->objectTypeID}</td>
- <td class="columnText"><a href="{link controller='DashboardOption' id=$objectType->objectTypeID}{/link}">{lang}wcf.dashboard.objectType.{$objectType->objectType}{/lang}</a></td>
-
- {event name='columns'}
- </tr>
- {/foreach}
- </tbody>
- </table>
-</div>
-
-<footer class="contentFooter">
- {hascontent}
- <nav class="contentFooterNavigation">
- <ul>
- {content}{event name='contentFooterNavigation'}{/content}
- </ul>
- </nav>
- {/hascontent}
-</footer>
-
-{include file='footer'}
\ No newline at end of file
+++ /dev/null
-{include file='header' pageTitle='wcf.acp.dashboard.option'}
-
-<script data-relocate="true">
- //<![CDATA[
- $(function() {
- WCF.TabMenu.init();
- });
- //]]>
-</script>
-
-<header class="contentHeader">
- <div class="contentHeaderTitle">
- <h1 class="contentTitle">{lang}wcf.acp.dashboard.option{/lang}</h1>
- <p class="contentHeaderDescription">{lang}wcf.dashboard.objectType.{$objectType->objectType}{/lang}</p>
- </div>
-
- <nav class="contentHeaderNavigation">
- <ul>
- <li><a href="{link controller='DashboardList'}{/link}" class="button"><span class="icon icon16 fa-list"></span> <span>{lang}wcf.acp.menu.link.dashboard.list{/lang}</span></a></li>
-
- {event name='contentHeaderNavigation'}
- </ul>
- </nav>
-</header>
-
-<p class="info">{lang}wcf.acp.dashboard.box.sort{/lang}</p>
-
-<div class="section tabMenuContainer">
- <nav class="tabMenu">
- <ul>
- {if $objectType->allowcontent}
- <li><a href="{@$__wcf->getAnchor('dashboard-content')}">{lang}wcf.dashboard.boxType.content{/lang}</a></li>
- {/if}
- {if $objectType->allowsidebar}
- <li><a href="{@$__wcf->getAnchor('dashboard-sidebar')}">{lang}wcf.dashboard.boxType.sidebar{/lang}</a></li>
- {/if}
-
- {event name='tabMenuTabs'}
- </ul>
- </nav>
-
- {if $objectType->allowcontent}
- <div id="dashboard-content" class="tabMenuContent hidden">
- <section class="section">
- <h2 class="sectionTitle">{lang}wcf.dashboard.box.enabledBoxes{/lang}</h2>
-
- <div class="sortableListContainer">
- <ol class="sortableList simpleSortableList" data-object-id="0">
- {foreach from=$enabledBoxes item=boxID}
- {if $boxes[$boxID]->boxType == 'content'}
- <li class="sortableNode" data-object-id="{@$boxID}">
- <span class="sortableNodeLabel">{lang}wcf.dashboard.box.{$boxes[$boxID]->boxName}{/lang}{if $boxes[$boxID]->packageID != 1} ({lang}{$boxes[$boxID]->getPackage()->packageName}{/lang}){/if}</span>
- </li>
- {/if}
- {/foreach}
- </ol>
- </div>
- </section>
-
- <section class="section">
- <h2 class="sectionTitle">{lang}wcf.dashboard.box.availableBoxes{/lang}</h2>
-
- <div class="sortableListContainer">
- <ol class="sortableList simpleSortableList">
- {foreach from=$boxes item=box}
- {if $box->boxType == 'content' && !$box->boxID|in_array:$enabledBoxes}
- <li class="sortableNode" data-object-id="{@$box->boxID}">
- <span class="sortableNodeLabel">{lang}wcf.dashboard.box.{$box->boxName}{/lang}{if $box->packageID != 1} ({lang}{$box->getPackage()->packageName}{/lang}){/if}</span>
- </li>
- {/if}
- {/foreach}
- </ol>
- </div>
- </section>
-
- <div class="formSubmit">
- <button data-type="submit">{lang}wcf.global.button.saveSorting{/lang}</button>
- </div>
-
- <script data-relocate="true">
- //<![CDATA[
- $(function() {
- new WCF.Sortable.List('dashboard-content', 'wcf\\data\\dashboard\\box\\DashboardBoxAction', 0, { }, true, { boxType: 'content', objectTypeID: {@$objectTypeID} });
- });
- //]]>
- </script>
- </div>
- {/if}
-
- {if $objectType->allowsidebar}
- <div id="dashboard-sidebar" class="tabMenuContent hidden">
- <section class="section">
- <h2 class="sectionTitle">{lang}wcf.dashboard.box.enabledBoxes{/lang}</h2>
-
- <div class="sortableListContainer">
- <ol class="sortableList simpleSortableList" data-object-id="0">
- {foreach from=$enabledBoxes item=boxID}
- {if $boxes[$boxID]->boxType == 'sidebar'}
- <li class="sortableNode" data-object-id="{@$boxID}">
- <span class="sortableNodeLabel">{lang}wcf.dashboard.box.{$boxes[$boxID]->boxName}{/lang}{if $boxes[$boxID]->packageID != 1} ({lang}{$boxes[$boxID]->getPackage()->packageName}{/lang}){/if}</span>
- </li>
- {/if}
- {/foreach}
- </ol>
- </div>
- </section>
-
- <section class="section">
- <h2 class="sectionTitle">{lang}wcf.dashboard.box.availableBoxes{/lang}</h2>
-
- <div id="dashboard-sidebar-enabled" class="sortableListContainer">
- <ol class="sortableList simpleSortableList">
- {foreach from=$boxes item=box}
- {if $box->boxType == 'sidebar' && !$box->boxID|in_array:$enabledBoxes}
- <li class="sortableNode" data-object-id="{@$box->boxID}">
- <span class="sortableNodeLabel">{lang}wcf.dashboard.box.{$box->boxName}{/lang}{if $box->packageID != 1} ({lang}{$box->getPackage()->packageName}{/lang}){/if}</span>
- </li>
- {/if}
- {/foreach}
- </ol>
- </div>
- </section>
-
- <div class="formSubmit">
- <button data-type="submit">{lang}wcf.global.button.saveSorting{/lang}</button>
- </div>
-
- <script data-relocate="true">
- //<![CDATA[
- $(function() {
- new WCF.Sortable.List('dashboard-sidebar', 'wcf\\data\\dashboard\\box\\DashboardBoxAction', 0, { }, true, { boxType: 'sidebar', objectTypeID: {@$objectTypeID} });
- });
- //]]>
- </script>
- </div>
- {/if}
-
- {event name='tabMenuContents'}
-</div>
-
-{include file='footer'}
\ No newline at end of file
+++ /dev/null
-<?php
-namespace wcf\acp\form;
-use wcf\data\dashboard\box\DashboardBox;
-use wcf\data\dashboard\box\DashboardBoxList;
-use wcf\data\object\type\ObjectTypeCache;
-use wcf\form\AbstractForm;
-use wcf\system\exception\IllegalLinkException;
-use wcf\system\WCF;
-use wcf\util\ArrayUtil;
-
-/**
- * Provides the dashboard option form.
- *
- * @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 acp.form
- * @category Community Framework
- */
-class DashboardOptionForm extends AbstractForm {
- /**
- * @see \wcf\page\AbstractPage::$activeMenuItem
- */
- public $activeMenuItem = 'wcf.acp.menu.link.dashboard';
-
- /**
- * @see \wcf\page\AbstractPage::$neededPermissions
- */
- public $neededPermissions = array('admin.content.dashboard.canEditDashboard');
-
- /**
- * list of available dashboard boxes
- * @var DashboardBox[]
- */
- public $boxes = array();
-
- /**
- * list of enabled box ids
- * @var integer[]
- */
- public $enabledBoxes = array();
-
- /**
- * object type object
- * @var \wcf\data\object\type\ObjectType
- */
- public $objectType = null;
-
- /**
- * object type id
- * @var integer
- */
- public $objectTypeID = 0;
-
- /**
- * @see \wcf\page\IPage::readParameters()
- */
- public function readParameters() {
- parent::readParameters();
-
- if (isset($_REQUEST['id'])) $this->objectTypeID = intval($_REQUEST['id']);
-
- // load object type
- $objectTypeDefinition = ObjectTypeCache::getInstance()->getDefinitionByName('com.woltlab.wcf.user.dashboardContainer');
- $this->objectType = ObjectTypeCache::getInstance()->getObjectType($this->objectTypeID);
- if ($this->objectType === null || $this->objectType->definitionID != $objectTypeDefinition->definitionID) {
- throw new IllegalLinkException();
- }
-
- // load available boxes
- $allowedBoxTypes = array();
- if ($this->objectType->allowcontent) $allowedBoxTypes[] = 'content';
- if ($this->objectType->allowsidebar) $allowedBoxTypes[] = 'sidebar';
- if (empty($allowedBoxTypes)) {
- // this should not happen unless you go full retard
- throw new IllegalLinkException();
- }
-
- $boxList = new DashboardBoxList();
- $boxList->getConditionBuilder()->add("dashboard_box.boxType IN (?)", array($allowedBoxTypes));
- $boxList->readObjects();
- $this->boxes = $boxList->getObjects();
- }
-
- /**
- * @see \wcf\form\IForm::readFormParameters()
- */
- public function readFormParameters() {
- parent::readFormParameters();
-
- if (isset($_POST['enabledBoxes']) && is_array($_POST['enabledBoxes'])) $this->enabledBoxes = ArrayUtil::toIntegerArray($_POST['enabledBoxes']);
- }
-
- /**
- * @see \wcf\form\IForm::validate()
- */
- public function validate() {
- parent::validate();
-
- $this->validateEnabledBoxes();
- }
-
- /**
- * Validates dashboard options.
- */
- protected function validateEnabledBoxes() {
- foreach ($this->enabledBoxes as $boxID) {
- if (!isset($this->boxes[$boxID])) {
- throw new IllegalLinkException();
- }
- }
- }
-
- /**
- * @see \wcf\page\IPage::readData()
- */
- public function readData() {
- parent::readData();
-
- if (empty($_POST)) {
- // load settings
- $sql = "SELECT boxID
- FROM wcf".WCF_N."_dashboard_option
- WHERE objectTypeID = ?
- ORDER BY showOrder ASC";
- $statement = WCF::getDB()->prepareStatement($sql);
- $statement->execute(array(
- $this->objectTypeID
- ));
- while ($row = $statement->fetchArray()) {
- $this->enabledBoxes[] = $row['boxID'];
- }
- }
- }
-
- /**
- * @see \wcf\form\IForm::save()
- */
- public function save() {
- parent::save();
-
- // remove previous settings
- $sql = "DELETE FROM wcf".WCF_N."_dashboard_option
- WHERE objectTypeID = ?";
- $statement = WCF::getDB()->prepareStatement($sql);
- $statement->execute(array(
- $this->objectTypeID
- ));
-
- // insert new settings
- if (!empty($this->enabledBoxes)) {
- $sql = "INSERT INTO wcf".WCF_N."_dashboard_option
- (objectTypeID, boxID, showOrder)
- VALUES (?, ?, ?)";
- $statement = WCF::getDB()->prepareStatement($sql);
-
- WCF::getDB()->beginTransaction();
- $showOrder = 1;
- foreach ($this->enabledBoxes as $boxID) {
- $statement->execute(array(
- $this->objectTypeID,
- $boxID,
- $showOrder
- ));
-
- $showOrder++;
- }
- WCF::getDB()->commitTransaction();
- }
-
- $this->saved();
-
- WCF::getTPL()->assign('success', true);
- }
-
- /**
- * @see \wcf\page\IPage::assignVariables()
- */
- public function assignVariables() {
- parent::assignVariables();
-
- WCF::getTPL()->assign(array(
- 'boxes' => $this->boxes,
- 'enabledBoxes' => $this->enabledBoxes,
- 'objectType' => $this->objectType,
- 'objectTypeID' => $this->objectTypeID
- ));
- }
-}
+++ /dev/null
-<?php
-namespace wcf\acp\page;
-use wcf\data\object\type\ObjectType;
-use wcf\data\object\type\ObjectTypeCache;
-use wcf\page\AbstractPage;
-use wcf\system\WCF;
-
-/**
- * Provides a list of registered dashboard pages.
- *
- * @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 acp.page
- * @category Community Framework
- */
-class DashboardListPage extends AbstractPage {
- /**
- * @see \wcf\page\AbstractPage::$activeMenuItem
- */
- public $activeMenuItem = 'wcf.acp.menu.link.dashboard.list';
-
- /**
- * @see \wcf\page\AbstractPage::$neededPermissions
- */
- public $neededPermissions = array('admin.content.dashboard.canEditDashboard');
-
- /**
- * list of object types per package id
- * @var ObjectType[]
- */
- public $objectTypes = array();
-
- /**
- * @see \wcf\page\IPage::readData()
- */
- public function readData() {
- parent::readData();
-
- // load object types
- $this->objectTypes = ObjectTypeCache::getInstance()->getObjectTypes('com.woltlab.wcf.user.dashboardContainer');
- }
-
- /**
- * @see \wcf\page\IPage::assignVariables()
- */
- public function assignVariables() {
- parent::assignVariables();
-
- WCF::getTPL()->assign(array(
- 'objectTypes' => $this->objectTypes
- ));
- }
-}
+++ /dev/null
-<?php
-namespace wcf\data\dashboard\box;
-use wcf\data\package\PackageCache;
-use wcf\data\DatabaseObject;
-
-/**
- * Represents a dashboard box.
- *
- * @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 data.dashboard.box
- * @category Community Framework
- *
- * @property-read integer $boxID
- * @property-read integer $packageID
- * @property-read string $boxName
- * @property-read string $boxType
- * @property-read string $className
- */
-class DashboardBox extends DatabaseObject {
- /**
- * @see \wcf\data\DatabaseObject::$databaseTableName
- */
- protected static $databaseTableName = 'dashboard_box';
-
- /**
- * @see \wcf\data\DatabaseObject::$databaseTableIndexName
- */
- protected static $databaseTableIndexName = 'boxID';
-
- /**
- * Returns the owner of this dashboard box.
- *
- * @return \wcf\data\package\Package
- */
- public function getPackage() {
- return PackageCache::getInstance()->getPackage($this->packageID);
- }
-}
+++ /dev/null
-<?php
-namespace wcf\data\dashboard\box;
-use wcf\data\object\type\ObjectTypeCache;
-use wcf\data\AbstractDatabaseObjectAction;
-use wcf\data\ISortableAction;
-use wcf\system\dashboard\DashboardHandler;
-use wcf\system\database\util\PreparedStatementConditionBuilder;
-use wcf\system\exception\UserInputException;
-use wcf\system\WCF;
-use wcf\util\ArrayUtil;
-
-/**
- * Executes dashboard box-related actions.
- *
- * @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 data.dashboard.box
- * @category Community Framework
- */
-class DashboardBoxAction extends AbstractDatabaseObjectAction implements ISortableAction {
- /**
- * list of available dashboard boxes
- * @var DashboardBox[]
- */
- public $boxes = array();
-
- /**
- * box structure
- * @var integer[]
- */
- public $boxStructure = array();
-
- /**
- * object type object
- * @var \wcf\data\object\type\ObjectType
- */
- public $objectType = null;
-
- /**
- * @see \wcf\data\AbstractDatabaseObjectAction::$requireACP
- */
- protected $requireACP = array('updatePosition');
-
- /**
- * @see \wcf\data\ISortableAction::validateUpdatePosition()
- */
- public function validateUpdatePosition() {
- // validate permissions
- WCF::getSession()->checkPermissions(array('admin.content.dashboard.canEditDashboard'));
-
- $this->readString('boxType');
- $this->readInteger('objectTypeID');
-
- // validate box type
- if (!in_array($this->parameters['boxType'], array('content', 'sidebar'))) {
- throw new UserInputException('boxType');
- }
-
- // validate object type
- $objectType = ObjectTypeCache::getInstance()->getObjectType($this->parameters['objectTypeID']);
- if ($objectType !== null) {
- $objectTypeDefinition = ObjectTypeCache::getInstance()->getDefinitionByName('com.woltlab.wcf.user.dashboardContainer');
- if ($objectTypeDefinition !== null) {
- if ($objectType->definitionID == $objectTypeDefinition->definitionID) {
- $this->objectType = $objectType;
- }
- }
- }
-
- if ($this->objectType === null) {
- throw new UserInputException('objectTypeID');
- }
-
- // read all dashboard boxes of the relevant box type
- $boxList = new DashboardBoxList();
- $boxList->getConditionBuilder()->add("dashboard_box.boxType = ?", array($this->parameters['boxType']));
- $boxList->readObjects();
- $this->boxes = $boxList->getObjects();
-
- // parse structure
- if (isset($this->parameters['data']) & isset($this->parameters['data']['structure']) && isset($this->parameters['data']['structure'][0])) {
- $this->boxStructure = ArrayUtil::toIntegerArray($this->parameters['data']['structure'][0]);
-
- // validate box ids
- if (!empty($this->boxStructure)) {
- foreach ($this->boxStructure as $boxID) {
- if (!isset($this->boxes[$boxID])) {
- throw new UserInputException('boxID');
- }
- }
- }
- }
- }
-
- /**
- * @see \wcf\data\ISortableAction::updatePosition()
- */
- public function updatePosition() {
- // remove previous settings
- $conditions = new PreparedStatementConditionBuilder();
- $conditions->add("objectTypeID = ?", array($this->objectType->objectTypeID));
- if (!empty($this->boxes)) {
- $conditions->add("boxID IN (?)", array(array_keys($this->boxes)));
- }
-
- $sql = "DELETE FROM wcf".WCF_N."_dashboard_option
- ".$conditions;
- $statement = WCF::getDB()->prepareStatement($sql);
- $statement->execute($conditions->getParameters());
-
- // update settings
- if (!empty($this->boxStructure)) {
- $sql = "INSERT INTO wcf".WCF_N."_dashboard_option
- (objectTypeID, boxID, showOrder)
- VALUES (?, ?, ?)";
- $statement = WCF::getDB()->prepareStatement($sql);
-
- WCF::getDB()->beginTransaction();
- foreach ($this->boxStructure as $index => $boxID) {
- $showOrder = $index + 1;
-
- $statement->execute(array(
- $this->objectType->objectTypeID,
- $boxID,
- $showOrder
- ));
- }
- WCF::getDB()->commitTransaction();
- }
-
- // reset cache
- DashboardHandler::clearCache();
- }
-}
+++ /dev/null
-<?php
-namespace wcf\data\dashboard\box;
-use wcf\data\DatabaseObjectEditor;
-
-/**
- * Provides functions to edit dashboard boxes.
- *
- * @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 data.dashboard.box
- * @category Community Framework
- */
-class DashboardBoxEditor extends DatabaseObjectEditor {
- /**
- * @see \wcf\data\DatabaseObjectDecorator::$baseClass
- */
- protected static $baseClass = 'wcf\data\dashboard\box\DashboardBox';
-}
+++ /dev/null
-<?php
-namespace wcf\data\dashboard\box;
-use wcf\data\DatabaseObjectList;
-
-/**
- * Represents a list of dashboard boxes.
- *
- * @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 data.dashboard.box
- * @category Community Framework
- */
-class DashboardBoxList extends DatabaseObjectList { }
use wcf\system\exception\IllegalLinkException;
use wcf\system\exception\PermissionDeniedException;
use wcf\system\request\LinkHandler;
-use wcf\system\user\collapsible\content\UserCollapsibleContentHandler;
use wcf\system\WCF;
/**
'commentCanAdd' => true,
'commentList' => $this->commentList,
'commentObjectTypeID' => $this->commentObjectTypeID,
- 'lastCommentTime' => ($this->commentList ? $this->commentList->getMinCommentTime() : 0),
- 'sidebarCollapsed' => UserCollapsibleContentHandler::getInstance()->isCollapsed('com.woltlab.wcf.collapsibleSidebar', 'com.woltlab.wcf.ModerationForm'),
- 'sidebarName' => 'com.woltlab.wcf.ModerationForm'
+ 'lastCommentTime' => ($this->commentList ? $this->commentList->getMinCommentTime() : 0)
]);
}
use wcf\acp\form\UserOptionListForm;
use wcf\data\search\SearchEditor;
use wcf\system\breadcrumb\Breadcrumb;
-use wcf\system\dashboard\DashboardHandler;
use wcf\system\database\util\PreparedStatementConditionBuilder;
use wcf\system\exception\UserInputException;
use wcf\system\request\LinkHandler;
-use wcf\system\user\collapsible\content\UserCollapsibleContentHandler;
use wcf\system\WCF;
use wcf\util\HeaderUtil;
use wcf\util\StringUtil;
public function assignVariables() {
parent::assignVariables();
- DashboardHandler::getInstance()->loadBoxes('com.woltlab.wcf.user.MembersListPage', $this);
-
WCF::getTPL()->assign([
'username' => $this->username,
- 'optionTree' => $this->optionTree,
- 'sidebarCollapsed' => UserCollapsibleContentHandler::getInstance()->isCollapsed('com.woltlab.wcf.collapsibleSidebar', 'com.woltlab.wcf.user.MembersListPage'),
- 'sidebarName' => 'com.woltlab.wcf.user.MembersListPage'
+ 'optionTree' => $this->optionTree
]);
}
+++ /dev/null
-<?php
-namespace wcf\page;
-use wcf\system\dashboard\DashboardHandler;
-use wcf\system\user\collapsible\content\UserCollapsibleContentHandler;
-use wcf\system\WCF;
-
-/**
- * Shows the dashboard page.
- *
- * @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 page
- * @category Community Framework
- */
-class DashboardPage extends AbstractPage {
- /**
- * @see \wcf\page\AbstractPage::$neededModules
- */
- public $neededModules = array('MODULE_DASHBOARD_PAGE');
-
- /**
- * @see \wcf\page\AbstractPage::$enableTracking
- */
- public $enableTracking = true;
-
- /**
- * @see \wcf\page\AbstractPage::assignVariables()
- */
- public function assignVariables() {
- parent::assignVariables();
-
- DashboardHandler::getInstance()->loadBoxes('com.woltlab.wcf.user.DashboardPage', $this);
-
- WCF::getTPL()->assign(array(
- 'sidebarCollapsed' => UserCollapsibleContentHandler::getInstance()->isCollapsed('com.woltlab.wcf.collapsibleSidebar', 'com.woltlab.wcf.user.DashboardPage'),
- 'sidebarName' => 'com.woltlab.wcf.user.DashboardPage',
- 'allowSpidersToIndexThisPage' => true
- ));
- }
-}
<?php
namespace wcf\page;
use wcf\data\search\Search;
-use wcf\system\dashboard\DashboardHandler;
use wcf\system\database\PostgreSQLDatabase;
use wcf\system\exception\IllegalLinkException;
use wcf\system\request\LinkHandler;
-use wcf\system\user\collapsible\content\UserCollapsibleContentHandler;
use wcf\system\WCF;
use wcf\util\HeaderUtil;
public function assignVariables() {
parent::assignVariables();
- DashboardHandler::getInstance()->loadBoxes('com.woltlab.wcf.user.MembersListPage', $this);
-
WCF::getTPL()->assign(array(
'letters' => str_split(self::$availableLetters),
'letter' => $this->letter,
'searchID' => $this->searchID,
- 'sidebarCollapsed' => UserCollapsibleContentHandler::getInstance()->isCollapsed('com.woltlab.wcf.collapsibleSidebar', 'com.woltlab.wcf.user.MembersListPage'),
- 'sidebarName' => 'com.woltlab.wcf.user.MembersListPage',
'allowSpidersToIndexThisPage' => true
));
<?php
namespace wcf\page;
use wcf\data\user\activity\event\ViewableUserActivityEventList;
-use wcf\system\user\collapsible\content\UserCollapsibleContentHandler;
use wcf\system\breadcrumb\Breadcrumb;
-use wcf\system\dashboard\DashboardHandler;
use wcf\system\request\LinkHandler;
use wcf\system\user\activity\event\UserActivityEventHandler;
use wcf\system\WCF;
// removes orphaned and non-accessable events
UserActivityEventHandler::validateEvents($this->eventList);
- DashboardHandler::getInstance()->loadBoxes('com.woltlab.wcf.user.MembersListPage', $this);
-
WCF::getTPL()->assign(array(
'eventList' => $this->eventList,
'lastEventTime' => $lastEventTime,
- 'sidebarCollapsed' => UserCollapsibleContentHandler::getInstance()->isCollapsed('com.woltlab.wcf.collapsibleSidebar', 'com.woltlab.wcf.user.MembersListPage'),
- 'sidebarName' => 'com.woltlab.wcf.user.MembersListPage',
'allowSpidersToIndexThisPage' => true
));
}
<?php
namespace wcf\page;
use wcf\system\breadcrumb\Breadcrumb;
-use wcf\system\dashboard\DashboardHandler;
use wcf\system\request\LinkHandler;
-use wcf\system\user\collapsible\content\UserCollapsibleContentHandler;
use wcf\system\WCF;
/**
public function assignVariables() {
parent::assignVariables();
- DashboardHandler::getInstance()->loadBoxes('com.woltlab.wcf.user.MembersListPage', $this);
-
WCF::getTPL()->assign(array(
- 'sidebarCollapsed' => UserCollapsibleContentHandler::getInstance()->isCollapsed('com.woltlab.wcf.collapsibleSidebar', 'com.woltlab.wcf.user.MembersListPage'),
- 'sidebarName' => 'com.woltlab.wcf.user.MembersListPage',
'allowSpidersToIndexThisPage' => true
));
}
use wcf\data\user\online\UserOnline;
use wcf\data\user\online\UsersOnlineList;
use wcf\system\breadcrumb\Breadcrumb;
-use wcf\system\dashboard\DashboardHandler;
use wcf\system\page\handler\IOnlineLocationPageHandler;
use wcf\system\request\LinkHandler;
-use wcf\system\user\collapsible\content\UserCollapsibleContentHandler;
use wcf\system\WCF;
use wcf\util\HeaderUtil;
public function assignVariables() {
parent::assignVariables();
- DashboardHandler::getInstance()->loadBoxes('com.woltlab.wcf.user.MembersListPage', $this);
-
WCF::getTPL()->assign([
- 'sidebarCollapsed' => UserCollapsibleContentHandler::getInstance()->isCollapsed('com.woltlab.wcf.collapsibleSidebar', 'com.woltlab.wcf.user.MembersListPage'),
- 'sidebarName' => 'com.woltlab.wcf.user.MembersListPage',
'allowSpidersToIndexThisPage' => true
]);
}
+++ /dev/null
-<?php
-namespace wcf\system\cache\builder;
-use wcf\data\dashboard\box\DashboardBoxList;
-use wcf\data\object\type\ObjectTypeCache;
-use wcf\system\database\util\PreparedStatementConditionBuilder;
-use wcf\system\WCF;
-
-/**
- * Caches user dashboard boxes.
- *
- * @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.cache.builder
- * @category Community Framework
- */
-class DashboardBoxCacheBuilder extends AbstractCacheBuilder {
- /**
- * @see \wcf\system\cache\builder\AbstractCacheBuilder::rebuild()
- */
- protected function rebuild(array $parameters) {
- $data = array(
- 'boxes' => array(),
- 'pages' => array()
- );
-
- // load boxes
- $boxList = new DashboardBoxList();
- $boxList->readObjects();
-
- foreach ($boxList as $box) {
- $data['boxes'][$box->boxID] = $box;
- }
-
- // load settings
- $objectTypes = ObjectTypeCache::getInstance()->getObjectTypes('com.woltlab.wcf.user.dashboardContainer');
- $objectTypeIDs = array();
- foreach ($objectTypes as $objectType) {
- $objectTypeIDs[] = $objectType->objectTypeID;
- }
-
- $conditions = new PreparedStatementConditionBuilder();
- $conditions->add("objectTypeID IN (?)", array($objectTypeIDs));
-
- $sql = "SELECT *
- FROM wcf".WCF_N."_dashboard_option
- ".$conditions."
- ORDER BY showOrder ASC";
- $statement = WCF::getDB()->prepareStatement($sql);
- $statement->execute($conditions->getParameters());
- while ($row = $statement->fetchArray()) {
- if (!isset($data['pages'][$row['objectTypeID']])) {
- $data['pages'][$row['objectTypeID']] = array();
- }
-
- $data['pages'][$row['objectTypeID']][] = $row['boxID'];
- }
-
- return $data;
- }
-}
+++ /dev/null
-<?php
-namespace wcf\system\dashboard;
-use wcf\data\dashboard\box\DashboardBox;
-use wcf\data\object\type\ObjectTypeCache;
-use wcf\page\IPage;
-use wcf\system\cache\builder\DashboardBoxCacheBuilder;
-use wcf\system\database\util\PreparedStatementConditionBuilder;
-use wcf\system\exception\SystemException;
-use wcf\system\SingletonFactory;
-use wcf\system\WCF;
-
-/**
- * Handles dashboard boxes.
- *
- * @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.dashboard
- * @category Community Framework
- */
-class DashboardHandler extends SingletonFactory {
- /**
- * list of cached dashboard boxes
- * @var DashboardBox[]
- */
- protected $boxCache = null;
-
- /**
- * configuration options for pages
- * @var integer[][]
- */
- protected $pageCache = null;
-
- /**
- * @see \wcf\system\SingletonFactory::init()
- */
- protected function init() {
- $this->boxCache = DashboardBoxCacheBuilder::getInstance()->getData(array(), 'boxes');
- $this->pageCache = DashboardBoxCacheBuilder::getInstance()->getData(array(), 'pages');
- }
-
- /**
- * Loads the active dashboard boxes for the given object type and page.
- *
- * @param string $objectType
- * @param IPage $page
- * @throws SystemException
- */
- public function loadBoxes($objectType, IPage $page) {
- $objectTypeObj = ObjectTypeCache::getInstance()->getObjectTypeByName('com.woltlab.wcf.user.dashboardContainer', $objectType);
- if ($objectTypeObj === null) {
- throw new SystemException("Unable to find object type '".$objectType."' for definition 'com.woltlab.wcf.user.dashboardContainer'");
- }
-
- $boxIDs = array();
- if (isset($this->pageCache[$objectTypeObj->objectTypeID]) && is_array($this->pageCache[$objectTypeObj->objectTypeID])) {
- foreach ($this->pageCache[$objectTypeObj->objectTypeID] as $boxID) {
- $boxIDs[] = $boxID;
- }
- }
-
- // 1. initialize all boxes first
- $boxObjects = array(
- 'content' => array(),
- 'sidebar' => array()
- );
- foreach ($boxIDs as $boxID) {
- $className = $this->boxCache[$boxID]->className;
- if (!is_subclass_of($className, 'wcf\system\dashboard\box\IDashboardBox')) {
- throw new SystemException("'".$className."' does not implement 'wcf\system\dashboard\box\IDashboardBox'");
- }
-
- $boxObject = new $className();
- $boxObject->init($this->boxCache[$boxID], $page);
-
- $boxObjects[$this->boxCache[$boxID]->boxType][] = $boxObject;
- }
-
- // 2. fetch all templates
- $contentTemplate = $sidebarTemplate = '';
- foreach ($boxObjects['content'] as $box) {
- $contentTemplate .= $box->getTemplate();
- }
- foreach ($boxObjects['sidebar'] as $box) {
- $sidebarTemplate .= $box->getTemplate();
- }
-
- WCF::getTPL()->assign(array(
- '__boxContent' => $contentTemplate,
- '__boxSidebar' => $sidebarTemplate
- ));
- }
-
- /**
- * Sets default values upon installation, you should not call this method
- * under any other circumstances. If you do not specify a list of box names,
- * all boxes will be assigned as disabled for given object type.
- *
- * @param string $objectType
- * @param string[] $enableBoxNames
- * @throws SystemException
- */
- public static function setDefaultValues($objectType, array $enableBoxNames = array()) {
- $objectTypeID = 0;
-
- // no boxes given, aborting
- if (empty($enableBoxNames)) {
- return;
- }
-
- // get object type id (cache might be outdated)
- if (PACKAGE_ID && PACKAGE_ID != 1) {
- // reset object type cache
- ObjectTypeCache::getInstance()->resetCache();
-
- // get object type
- $objectTypeObj = ObjectTypeCache::getInstance()->getObjectTypeByName('com.woltlab.wcf.user.dashboardContainer', $objectType);
- if ($objectTypeObj === null) {
- throw new SystemException("Object type '".$objectType."' is not valid for definition 'com.woltlab.wcf.user.dashboardContainer'");
- }
-
- $objectTypeID = $objectTypeObj->objectTypeID;
-
- // select available box ids
- $conditions = new PreparedStatementConditionBuilder();
- $conditions->add("boxName IN (?)", array(array_keys($enableBoxNames)));
-
- $sql = "SELECT boxID, boxName, boxType
- FROM wcf".WCF_N."_dashboard_box
- ".$conditions;
- $statement = WCF::getDB()->prepareStatement($sql);
- $statement->execute($conditions->getParameters());
- }
- else {
- // work-around during WCFSetup
- $conditions = new PreparedStatementConditionBuilder();
- $conditions->add("object_type.objectType = ?", array($objectType));
- $conditions->add("object_type_definition.definitionName = ?", array('com.woltlab.wcf.user.dashboardContainer'));
-
- $sql = "SELECT object_type.objectTypeID
- FROM wcf".WCF_N."_object_type object_type
- LEFT JOIN wcf".WCF_N."_object_type_definition object_type_definition
- ON (object_type_definition.definitionID = object_type.definitionID)
- ".$conditions;
- $statement = WCF::getDB()->prepareStatement($sql);
- $statement->execute($conditions->getParameters());
- $row = $statement->fetchArray();
- if ($row) {
- $objectTypeID = $row['objectTypeID'];
- }
-
- if (!$objectTypeID) {
- throw new SystemException("Object type '".$objectType."' is not valid for definition 'com.woltlab.wcf.user.dashboardContainer'");
- }
-
- // select available box ids
- $conditions = new PreparedStatementConditionBuilder();
- $conditions->add("boxName IN (?)", array(array_keys($enableBoxNames)));
-
- $sql = "SELECT boxID, boxName, boxType
- FROM wcf".WCF_N."_dashboard_box
- ".$conditions;
- $statement = WCF::getDB()->prepareStatement($sql);
- $statement->execute($conditions->getParameters());
- }
-
- $boxes = array();
- while ($row = $statement->fetchArray()) {
- $boxes[$row['boxID']] = new DashboardBox(null, $row);
- }
-
- if (!empty($boxes)) {
- $sql = "UPDATE wcf".WCF_N."_dashboard_option
- SET showOrder = showOrder + 1
- WHERE objectTypeID = ?
- AND boxID IN (SELECT boxID FROM wcf".WCF_N."_dashboard_box WHERE boxType = ?)
- AND showOrder >= ?";
- $updateStatement = WCF::getDB()->prepareStatement($sql);
- $sql = "INSERT INTO wcf".WCF_N."_dashboard_option
- (objectTypeID, boxID, showOrder)
- VALUES (?, ?, ?)";
- $insertStatement = WCF::getDB()->prepareStatement($sql);
-
- WCF::getDB()->beginTransaction();
- foreach ($boxes as $boxID => $box) {
- // move other boxes
- $updateStatement->execute(array(
- $objectTypeID,
- $box->boxType,
- $enableBoxNames[$box->boxName]
- ));
-
- // insert associations
- $insertStatement->execute(array(
- $objectTypeID,
- $boxID,
- $enableBoxNames[$box->boxName]
- ));
- }
- WCF::getDB()->commitTransaction();
- }
- }
-
- /**
- * Clears dashboard box cache.
- */
- public static function clearCache() {
- DashboardBoxCacheBuilder::getInstance()->reset();
- }
-}
+++ /dev/null
-<?php
-namespace wcf\system\dashboard\box;
-use wcf\data\dashboard\box\DashboardBox;
-use wcf\page\IPage;
-use wcf\system\event\EventHandler;
-use wcf\system\WCF;
-
-/**
- * Default implementation for dashboard boxes displayed within content container.
- *
- * @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.dashboard.box
- * @category Community Framework
- */
-abstract class AbstractContentDashboardBox implements IDashboardBox {
- /**
- * dashboard box object
- * @var \wcf\data\dashboard\box\DashboardBox
- */
- public $box = null;
-
- /**
- * IPage object
- * @var \wcf\page\IPage
- */
- public $page = null;
-
- /**
- * template name
- * @var string
- */
- public $templateName = 'dashboardBoxContent';
-
- /**
- * @see \wcf\system\dashboard\box\IDashboardBox::init()
- */
- public function init(DashboardBox $box, IPage $page) {
- $this->box = $box;
- $this->page = $page;
-
- // fire event
- EventHandler::getInstance()->fireAction($this, 'init');
- }
-
- /**
- * @see \wcf\system\dashboard\box\IDashboardBox::getTemplate()
- */
- public function getTemplate() {
- $template = $this->render();
- if (empty($template)) {
- return '';
- }
-
- WCF::getTPL()->assign(array(
- 'box' => $this->box,
- 'template' => $template
- ));
-
- return WCF::getTPL()->fetch($this->templateName);
- }
-
- /**
- * Calls the 'fetched' event after the successful call of the init method.
- * This functions won't called automatically. You must do this manually, if you inherit AbstractContentDashboardBox.
- */
- protected function fetched() {
- // fire event
- EventHandler::getInstance()->fireAction($this, 'fetched');
- }
-
- /**
- * Renders box view.
- *
- * @return string
- */
- abstract protected function render();
-}
+++ /dev/null
-<?php
-namespace wcf\system\dashboard\box;
-use wcf\system\WCF;
-
-/**
- * Default implementation for dashboard boxes displayed within the sidebar container.
- *
- * @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.dashboard.box
- * @category Community Framework
- */
-abstract class AbstractSidebarDashboardBox extends AbstractContentDashboardBox {
- /**
- * @see \wcf\system\dashboard\box\AbstractDashboardBoxContent::$templateName
- */
- public $templateName = 'dashboardBoxSidebar';
-
- /**
- * title link
- * @var string
- */
- public $titleLink = '';
-
- /**
- * @see \wcf\system\dashboard\box\IDashboardBox::getTemplate()
- */
- public function getTemplate() {
- $template = $this->render();
- if (empty($template)) {
- return '';
- }
-
- WCF::getTPL()->assign(array(
- 'box' => $this->box,
- 'template' => $template,
- 'titleLink' => $this->titleLink
- ));
-
- return WCF::getTPL()->fetch($this->templateName);
- }
-}
+++ /dev/null
-<?php
-namespace wcf\system\dashboard\box;
-use wcf\data\dashboard\box\DashboardBox;
-use wcf\page\IPage;
-
-/**
- * Default interface for dashboard boxes.
- *
- * @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.dashboard.box
- * @category Community Framework
- */
-interface IDashboardBox {
- /**
- * Initializes this box.
- *
- * @param \wcf\data\dashboard\box\DashboardBox $box
- * @param \wcf\page\IPage $page
- */
- public function init(DashboardBox $box, IPage $page);
-
- /**
- * Returns parsed box template.
- *
- * @return string
- */
- public function getTemplate();
-}
+++ /dev/null
-<?php
-namespace wcf\system\package\plugin;
-use wcf\system\cache\builder\DashboardBoxCacheBuilder;
-use wcf\system\WCF;
-
-/**
- * Installs, updates and deletes dashboard boxes.
- *
- * @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.package.plugin
- * @category Community Framework
- */
-class DashboardBoxPackageInstallationPlugin extends AbstractXMLPackageInstallationPlugin {
- /**
- * @see \wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::$className
- */
- public $className = 'wcf\data\dashboard\box\DashboardBoxEditor';
-
- /**
- * @see \wcf\system\package\plugin\AbstractPackageInstallationPlugin::$tableName
- */
- public $tableName = 'dashboard_box';
-
- /**
- * @see \wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::$tagName
- */
- public $tagName = 'dashboardbox';
-
- /**
- * @see \wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::handleDelete()
- */
- protected function handleDelete(array $items) {
- $sql = "DELETE FROM wcf".WCF_N."_".$this->tableName."
- WHERE boxName = ?
- AND packageID = ?";
- $statement = WCF::getDB()->prepareStatement($sql);
- foreach ($items as $item) {
- $statement->execute(array(
- $item['attributes']['name'],
- $this->installation->getPackageID()
- ));
- }
- }
-
- /**
- * @see \wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::prepareImport()
- */
- protected function prepareImport(array $data) {
- return array(
- 'boxName' => $data['attributes']['name'],
- 'boxType' => ($data['elements']['boxtype'] == 'content') ? 'content' : 'sidebar',
- 'className' => $data['elements']['classname']
- );
- }
-
- /**
- * @see \wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::findExistingItem()
- */
- protected function findExistingItem(array $data) {
- $sql = "SELECT *
- FROM wcf".WCF_N."_".$this->tableName."
- WHERE boxName = ?
- AND packageID = ?";
- $parameters = array(
- $data['boxName'],
- $this->installation->getPackageID()
- );
-
- return array(
- 'sql' => $sql,
- 'parameters' => $parameters
- );
- }
-
- /**
- * @see \wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::cleanup()
- */
- protected function cleanup() {
- DashboardBoxCacheBuilder::getInstance()->reset();
- }
-}
<item name="wcf.acp.cronjob.log.error.details"><![CDATA[Fehlermeldung]]></item>
<item name="wcf.acp.cronjob.log.noEntries"><![CDATA[Derzeit sind keine Einträge vorhanden.]]></item>
</category>
-
- <category name="wcf.acp.dashboard">
- <item name="wcf.acp.dashboard.list"><![CDATA[Dashboard-Seiten konfigurieren]]></item>
- <item name="wcf.acp.dashboard.option"><![CDATA[Dashboard-Boxen konfigurieren]]></item>
- <item name="wcf.acp.dashboard.box.sort"><![CDATA[Sie können die Boxen durch Ziehen und Loslassen mit der Maus sortieren. Boxen können aktiviert bzw. deaktiviert werden, indem Sie die gewünschte Box in „Aktive Boxen“ bzw. „Deaktivierte Boxen“ verschieben.]]></item>
- </category>
-
+
<category name="wcf.acp.dataImport">
<item name="wcf.acp.dataImport"><![CDATA[Datenimport]]></item>
<item name="wcf.acp.dataImport.cli.configure.data.alreadySelected"><![CDATA[Diese Daten werden bereits importiert.]]></item>
<item name="wcf.acp.group.option.user.message.canUseBBCodes"><![CDATA[Kann BBCodes benutzen]]></item>
<item name="wcf.acp.group.option.user.message.allowedBBCodes"><![CDATA[Erlaubte BBCodes]]></item>
<item name="wcf.acp.group.option.user.message.allowedBBCodes.description"><![CDATA[Die hier ausgewählten BBCodes dürfen von Mitgliedern dieser Benutzergruppe verwendet werden.]]></item>
- <item name="wcf.acp.group.option.admin.content.dashboard.canEditDashboard"><![CDATA[Kann Dashboards konfigurieren]]></item>
<item name="wcf.acp.group.option.admin.user.rank.canManageRank"><![CDATA[Kann Benutzerränge verwalten]]></item>
<item name="wcf.acp.group.option.admin.user.canEditActivityPoints"><![CDATA[Kann Aktivitätspunkte bearbeiten]]></item>
<item name="wcf.acp.group.option.admin.user.canViewInvisible"><![CDATA[Kann unsichtbare Benutzer sehen]]></item>
<item name="wcf.acp.group.option.admin.user.canViewIpAddress"><![CDATA[Kann die IP-Adressen der Benutzer sehen]]></item>
- <item name="wcf.acp.group.option.category.admin.content.dashboard"><![CDATA[Dashboard]]></item>
<item name="wcf.acp.group.option.category.user.profile"><![CDATA[Benutzerprofile]]></item>
<item name="wcf.acp.group.option.category.user.profile.avatar"><![CDATA[Avatare]]></item>
<item name="wcf.acp.group.option.category.admin.user.rank"><![CDATA[Benutzerränge]]></item>
<item name="wcf.acp.menu.link.smiley.list"><![CDATA[Smileys]]></item>
<item name="wcf.acp.menu.link.smiley.category.add"><![CDATA[Smiley-Kategorie hinzufügen]]></item>
<item name="wcf.acp.menu.link.smiley.category.list"><![CDATA[Smiley-Kategorien]]></item>
- <item name="wcf.acp.menu.link.dashboard"><![CDATA[Dashboard]]></item>
- <item name="wcf.acp.menu.link.dashboard.list"><![CDATA[Seiten konfigurieren]]></item>
<item name="wcf.acp.menu.link.activityPoint"><![CDATA[Aktivitätspunkte]]></item>
<item name="wcf.acp.menu.link.user.rank"><![CDATA[Benutzerränge]]></item>
<item name="wcf.acp.menu.link.user.rank.list"><![CDATA[Benutzerränge]]></item>
<item name="wcf.acp.option.module_user_rank"><![CDATA[Benutzerränge]]></item>
<item name="wcf.acp.option.module_user_signature"><![CDATA[Signaturen]]></item>
<item name="wcf.acp.option.module_team_page"><![CDATA[Team-Seite]]></item>
- <item name="wcf.acp.option.module_dashboard_page"><![CDATA[Dashboard]]></item>
- <item name="wcf.acp.option.module_dashboard_page.description"><![CDATA[Hinweis: Falls das Dashboard als Startseite definiert ist, muss bei Deaktivierung dieser Option zusätzlich eine neue Startseite in der <a href="{link controller='PageMenuItemList'}{/link}">Hauptmenüverwaltung</a> ausgewählt werden.]]></item>
<item name="wcf.acp.option.register_enable_password_security_check"><![CDATA[Sicherheitsüberprüfung aktivieren]]></item>
<item name="wcf.acp.option.register_enable_password_security_check.description"><![CDATA[Kennwörter werden auf ihre Sicherheit geprüft. Unsichere Kennwörter werden abgelehnt.]]></item>
<item name="wcf.acp.option.register_password_min_length"><![CDATA[Minimale Kennwortlänge]]></item>
<item name="wcf.page.com.woltlab.wcf.SettingsForm"><![CDATA[Einstellungen]]></item>
<item name="wcf.page.com.woltlab.wcf.SignatureEditForm"><![CDATA[Signatur-Verwaltung]]></item>
<item name="wcf.page.com.woltlab.wcf.UserSearchForm"><![CDATA[Mitgliedersuche]]></item>
- <item name="wcf.page.com.woltlab.wcf.DashboardPage"><![CDATA[Dashboard]]></item>
<item name="wcf.page.com.woltlab.wcf.DeletedContentListPage"><![CDATA[Gelöschte Inhalte]]></item>
<item name="wcf.page.com.woltlab.wcf.FollowingPage"><![CDATA[Benutzer, denen Sie folgen]]></item>
<item name="wcf.page.com.woltlab.wcf.IgnoredUsersPage"><![CDATA[Blockierte Benutzer]]></item>
<item name="wcf.page.onlineLocation.com.woltlab.wcf.UsersOnlineList"><![CDATA[Benutzer-Online-Liste]]></item>
<item name="wcf.page.onlineLocation.com.woltlab.wcf.MembersList"><![CDATA[Mitgliederliste]]></item>
<item name="wcf.page.onlineLocation.com.woltlab.wcf.Team"><![CDATA[Liste der Team-Mitglieder]]></item>
- <item name="wcf.page.onlineLocation.com.woltlab.wcf.Dashboard"><![CDATA[Dashboard]]></item>
<item name="wcf.page.onlineLocation.com.woltlab.wcf.Register"><![CDATA[Registrierung]]></item>
<item name="wcf.page.onlineLocation.com.woltlab.wcf.LostPassword"><![CDATA[Kennwort vergessen]]></item>
<item name="wcf.page.onlineLocation.com.woltlab.wcf.Login"><![CDATA[Anmeldung]]></item>
<item name="wcf.user.birthday.age.to"><![CDATA[bis]]></item>
<item name="wcf.user.search"><![CDATA[Mitgliedersuche]]></item>
<item name="wcf.user.search.error.noMatches"><![CDATA[Zu den angegebenen Kriterien wurde kein Mitglied gefunden.]]></item>
- <item name="wcf.user.dashboard"><![CDATA[Dashboard]]></item>
<item name="wcf.user.newestMember"><![CDATA[Neuestes Mitglied]]></item>
<item name="wcf.user.login.3rdParty"><![CDATA[Anmeldung über Drittanbieter]]></item>
<item name="wcf.user.search.results"><![CDATA[Suchergebnisse]]></item>
<item name="wcf.acp.cronjob.log.noEntries"><![CDATA[There are no entries yet.]]></item>
</category>
- <category name="wcf.acp.dashboard">
- <item name="wcf.acp.dashboard.list"><![CDATA[Configure Dashboard Pages]]></item>
- <item name="wcf.acp.dashboard.option"><![CDATA[Configure Dashboard Boxes]]></item>
- <item name="wcf.acp.dashboard.box.sort"><![CDATA[Sort boxes to determine show order. You can enable or disable boxes by moving them between the boxes “Active Boxes” and “Disabled Boxes”.]]></item>
- </category>
-
<category name="wcf.acp.dataImport">
<item name="wcf.acp.dataImport"><![CDATA[Data Import]]></item>
<item name="wcf.acp.dataImport.cli.configure.data.alreadySelected"><![CDATA[This data will already be imported.]]></item>
<item name="wcf.acp.group.option.user.message.canUseBBCodes"><![CDATA[Can use BBCodes]]></item>
<item name="wcf.acp.group.option.user.message.allowedBBCodes"><![CDATA[Allowed BBCodes]]></item>
<item name="wcf.acp.group.option.user.message.allowedBBCodes.description"><![CDATA[Selected BBCodes may be used by members of this group.]]></item>
- <item name="wcf.acp.group.option.admin.content.dashboard.canEditDashboard"><![CDATA[Can manage dashboard boxes]]></item>
<item name="wcf.acp.group.option.admin.user.rank.canManageRank"><![CDATA[Can manage user ranks]]></item>
<item name="wcf.acp.group.option.admin.user.canEditActivityPoints"><![CDATA[Can manage activity points]]></item>
<item name="wcf.acp.group.option.admin.user.canViewInvisible"><![CDATA[Can see invisible users]]></item>
<item name="wcf.acp.group.option.admin.user.canViewIpAddress"><![CDATA[Can see IP addresses]]></item>
- <item name="wcf.acp.group.option.category.admin.content.dashboard"><![CDATA[Dashboard]]></item>
<item name="wcf.acp.group.option.category.user.profile"><![CDATA[User Profiles]]></item>
<item name="wcf.acp.group.option.category.user.profile.avatar"><![CDATA[Avatars]]></item>
<item name="wcf.acp.group.option.category.admin.user.rank"><![CDATA[User Ranks]]></item>
<item name="wcf.acp.menu.link.smiley.list"><![CDATA[Smilies]]></item>
<item name="wcf.acp.menu.link.smiley.category.add"><![CDATA[Add Smiley Category]]></item>
<item name="wcf.acp.menu.link.smiley.category.list"><![CDATA[Smiley Categories]]></item>
- <item name="wcf.acp.menu.link.dashboard"><![CDATA[Dashboard]]></item>
- <item name="wcf.acp.menu.link.dashboard.list"><![CDATA[Configure Dashboard Pages]]></item>
<item name="wcf.acp.menu.link.activityPoint"><![CDATA[Activity Points]]></item>
<item name="wcf.acp.menu.link.user.rank"><![CDATA[User Ranks]]></item>
<item name="wcf.acp.menu.link.user.rank.list"><![CDATA[User Ranks]]></item>
<item name="wcf.acp.option.module_user_rank"><![CDATA[User ranks]]></item>
<item name="wcf.acp.option.module_user_signature"><![CDATA[Signatures]]></item>
<item name="wcf.acp.option.module_team_page"><![CDATA[Staff list]]></item>
- <item name="wcf.acp.option.module_dashboard_page"><![CDATA[Dashboard]]></item>
- <item name="wcf.acp.option.module_dashboard_page.description"><![CDATA[Notice: In case the Dashboard is currently defined as landing page, you must set a different landing page through the <a href="{link controller='PageMenuItemList'}{/link}">Page Menu</a> management afterwards.]]></item>
<item name="wcf.acp.option.register_enable_password_security_check"><![CDATA[Enable password validation]]></item>
<item name="wcf.acp.option.register_enable_password_security_check.description"><![CDATA[Password complexity will be validated, unsafe passwords will be rejected.]]></item>
<item name="wcf.acp.option.register_password_min_length"><![CDATA[Minimum Password Length]]></item>
<item name="wcf.page.com.woltlab.wcf.SettingsForm"><![CDATA[Settings]]></item>
<item name="wcf.page.com.woltlab.wcf.SignatureEditForm"><![CDATA[Signature Management]]></item>
<item name="wcf.page.com.woltlab.wcf.UserSearchForm"><![CDATA[Members Search]]></item>
- <item name="wcf.page.com.woltlab.wcf.DashboardPage"><![CDATA[Dashboard]]></item>
<item name="wcf.page.com.woltlab.wcf.DeletedContentListPage"><![CDATA[Deleted Content]]></item>
<item name="wcf.page.com.woltlab.wcf.FollowingPage"><![CDATA[Followed Users]]></item>
<item name="wcf.page.com.woltlab.wcf.IgnoredUsersPage"><![CDATA[Blocked Users]]></item>
<item name="wcf.page.onlineLocation.com.woltlab.wcf.UsersOnlineList"><![CDATA[List of Users Online]]></item>
<item name="wcf.page.onlineLocation.com.woltlab.wcf.MembersList"><![CDATA[Members List]]></item>
<item name="wcf.page.onlineLocation.com.woltlab.wcf.Team"><![CDATA[List of Staff Members]]></item>
- <item name="wcf.page.onlineLocation.com.woltlab.wcf.Dashboard"><![CDATA[Dashboard]]></item>
<item name="wcf.page.onlineLocation.com.woltlab.wcf.Register"><![CDATA[Registration]]></item>
<item name="wcf.page.onlineLocation.com.woltlab.wcf.LostPassword"><![CDATA[Lost Password]]></item>
<item name="wcf.page.onlineLocation.com.woltlab.wcf.Login"><![CDATA[Login]]></item>
<item name="wcf.user.birthday.age.to"><![CDATA[to]]></item>
<item name="wcf.user.search"><![CDATA[Search Members]]></item>
<item name="wcf.user.search.error.noMatches"><![CDATA[Your criteria did not match any member.]]></item>
- <item name="wcf.user.dashboard"><![CDATA[Dashboard]]></item>
<item name="wcf.user.newestMember"><![CDATA[Newest Member]]></item>
<item name="wcf.user.login.3rdParty"><![CDATA[Third-Party Login]]></item>
<item name="wcf.user.search.results"><![CDATA[Search Results]]></item>
error TEXT
);
-DROP TABLE IF EXISTS wcf1_dashboard_box;
-CREATE TABLE wcf1_dashboard_box (
- boxID INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY,
- packageID INT(10) NOT NULL,
- boxName VARCHAR(255) NOT NULL DEFAULT '',
- boxType VARCHAR(30) NOT NULL DEFAULT 'sidebar', -- can be 'content' or 'sidebar'
- className VARCHAR(255) NOT NULL DEFAULT ''
-);
-
-DROP TABLE IF EXISTS wcf1_dashboard_option;
-CREATE TABLE wcf1_dashboard_option (
- objectTypeID INT(10) NOT NULL,
- boxID INT(10) NOT NULL,
- showOrder INT(10) NOT NULL,
- UNIQUE KEY dashboardOption (objectTypeID, boxID)
-);
-
DROP TABLE IF EXISTS wcf1_edit_history_entry;
CREATE TABLE wcf1_edit_history_entry (
entryID INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY,
ALTER TABLE wcf1_user_to_language ADD FOREIGN KEY (userID) REFERENCES wcf1_user (userID) ON DELETE CASCADE;
ALTER TABLE wcf1_user_to_language ADD FOREIGN KEY (languageID) REFERENCES wcf1_language (languageID) ON DELETE CASCADE;
-ALTER TABLE wcf1_dashboard_box ADD FOREIGN KEY (packageID) REFERENCES wcf1_package (packageID) ON DELETE CASCADE;
-
-ALTER TABLE wcf1_dashboard_option ADD FOREIGN KEY (objectTypeID) REFERENCES wcf1_object_type (objectTypeID) ON DELETE CASCADE;
-ALTER TABLE wcf1_dashboard_option ADD FOREIGN KEY (boxID) REFERENCES wcf1_dashboard_box (boxID) ON DELETE CASCADE;
-
ALTER TABLE wcf1_import_mapping ADD FOREIGN KEY (objectTypeID) REFERENCES wcf1_object_type (objectTypeID) ON DELETE CASCADE;
ALTER TABLE wcf1_tracked_visit ADD FOREIGN KEY (objectTypeID) REFERENCES wcf1_object_type (objectTypeID) ON DELETE CASCADE;