Fixes whitespaces and indentation, also updates and adds comments and adds to missing `var`s in JavaScript code.
/**
* Handles ACPMenu.
- *
+ *
* @param array activeMenuItems
*/
WCF.ACP.Menu = function(activeMenuItems) { this.init(activeMenuItems); };
WCF.ACP.Menu.prototype = {
/**
* Initializes ACPMenu.
- *
+ *
* @param array activeMenuItems
*/
init: function(activeMenuItems) {
/**
* Handles clicks on main menu.
- *
+ *
* @param object event
*/
_toggleSidebar: function(event) {
/**
* Renders sidebar including highlighting of currently active menu items.
- *
+ *
* @param string menuItem
* @param array activeMenuItems
*/
* @var object
*/
_pages: {},
-
+
/**
* plugin list references
* @var object
*/
_pluginLists: [],
-
+
/**
* action proxy
* @var WCF.Action.Proxy
*/
_proxy: null,
-
+
/**
* target container
* @var jQuery
WCF.ACP.Package.Installation.prototype = {
/**
* package installation type
- *
* @var string
*/
_actionName: '',
-
+
/**
* dialog api
* @var $.ui.wcfDialog
*/
_api: null,
-
+
/**
* package installation dialog
- *
* @var object
*/
_dialog: null,
* @var WCF.Action.Proxy
*/
_proxy: null,
-
+
/**
* queue id
* @var integer
*/
_queueID: 0,
-
+
/**
* render dialog
* @var boolean
success: $.proxy(this._handleResponse, this),
url: 'index.php/' + this._actionName + '/?t=' + SECURITY_TOKEN + SID_ARG_2ND
});
-
+
if (initialize) {
$('#submitButton').click($.proxy(function(event) {
this.prepareInstallation();
$('#packageInstallationProgress').attr('value', data.progress).text(data.progress + '%');
$('#packageInstallationProgressLabel').text(data.progress + '%');
}
-
+
// update action
if (data.currentAction) {
$('#packageInstallationAction').html(data.currentAction);
queueID: this._queueID,
step: step
}, additionalData);
-
+
this._proxy.setOption('data', $data);
this._proxy.sendRequest();
}
WCF.ACP.Package.Uninstallation.prototype = {
/**
* WCF.ACP.Package.Installation object
- *
* @var WCF.ACP.Package.Installation
*/
_installation: null,
this._super(className);
},
-
+
/**
* @see WCF.Collapsible.Remote._getAdditionalParameters()
*/
_getButtonContainer: function(containerID) {
return $('#' + containerID + ' > .buttons');
},
-
+
/**
* @see WCF.Collapsible.Remote._getContainers()
*/
_getContainers: function() {
return $('.jsCategory').has('ol').has('li');
},
-
+
/**
* @see WCF.Collapsible.Remote._getTarget()
*/
{/content}
</tbody>
</table>
-
</div>
-
+
<div class="contentNavigation">
{@$pagesLinks}
</div>
<td class="columnDate columnTime"><p>{@$sessionLog->time|time}</p></td>
<td class="columnDate columnLastActivityTime"><p>{@$sessionLog->lastActivityTime|time}</p></td>
<td class="columnDigits columnAccesses"><p>{#$sessionLog->accesses}</p></td>
-
+
{event name='columns'}
</tr>
{/foreach}
{/content}
</tbody>
</table>
-
</div>
<div class="contentNavigation">
{event name='dataFields'}
</fieldset>
</div>
-
+
<div class="contentNavigation">
<nav>
<ul>
{/foreach}
</tbody>
</table>
-
</div>
{/if}
{/foreach}
<div class="formSubmit">
<input type="submit" value="{lang}wcf.global.button.submit{/lang}" accesskey="s" />
- {if $cronjobID|isset}<input type="hidden" name="id" value="{@$cronjobID}" />{/if}
+ {if $cronjobID|isset}<input type="hidden" name="id" value="{@$cronjobID}" />{/if}
</div>
</form>
}, {
success: function(data, statusText, jqXHR) {
$('.jsCronjobRow').each(function(index, row) {
- $button = $(row).find('.jsExecuteButton');
+ var $button = $(row).find('.jsExecuteButton');
if (WCF.inArray($($button).data('objectID'), data.objectIDs)) {
// insert feedback here
{else}
<img src="{@$__wcf->getPath()}icon/play.svg" alt="" title="{lang}wcf.acp.cronjob.execute{/lang}" class="icon16 disabled" />
{/if}
-
+
{if $cronjob->canBeDisabled()}
<img src="{@$__wcf->getPath()}icon/{if $cronjob->active}enabled{else}disabled{/if}.svg" alt="" title="{lang}wcf.global.button.{if $cronjob->active}disable{else}enable{/if}{/lang}" class="icon16 jsToggleButton jsTooltip" data-object-id="{@$cronjob->cronjobID}" data-disable-message="{lang}wcf.global.button.disable{/lang}" data-enable-message="{lang}wcf.global.button.enable{/lang}" />
{else}
<img src="{@$__wcf->getPath()}icon/disabled.svg" alt="" title="{lang}wcf.global.button.enable{/lang}" class="icon16 disabled" />
{/if}
{/if}
-
+
{if $cronjob->isEditable()}
<a href="{link controller='CronjobEdit' id=$cronjob->cronjobID}{/link}"><img src="{@$__wcf->getPath()}icon/edit.svg" alt="" title="{lang}wcf.global.button.edit{/lang}" class="icon16 jsTooltip" /></a>
{else}
<p>{@$cronjob->nextExec|plainTime}</p>
{/if}
</td>
-
+
{event name='columns'}
</tr>
{/foreach}
{/content}
</tbody>
</table>
-
</div>
<div class="formSubmit">
{include file='header'}
+
<script type="text/javascript">
//<![CDATA[
$(function() {
});
//]]>
</script>
+
<style type="text/css">
-#health ul {
- list-style: disc;
- padding-left: 16px;
-}
+ #health ul {
+ list-style: disc;
+ padding-left: 16px;
+ }
</style>
-{if $didYouKnow !== ''}<p class="info">{lang}wcf.acp.index.didYouKnow{/lang}: {@$didYouKnow|language}</p>{/if}
+
+{if $didYouKnow !== ''}
+ <p class="info">{lang}wcf.acp.index.didYouKnow{/lang}: {@$didYouKnow|language}</p>
+{/if}
+
<p class="{@$health}">{lang}wcf.acp.index.health.summary.{@$health}{/lang}</p>
+
{event name='boxes'}
<div class="tabMenuContainer" data-active="{if $health !== 'success'}health{else}news{/if}" data-store="activeTabMenuItem">
{event name='tabs'}
</ul>
</nav>
+
{if $health !== 'success'}
<div id="health" class="container containerPadding shadow hidden tabMenuContent">
{foreach from=$healthDetails item='issues' key='healthType'}
{hascontent}
- <fieldset><legend><img src="{$__wcf->getPath()}icon/{$healthType}.svg" class="icon24" /> {lang}wcf.acp.index.health.detail.{@$healthType}{/lang}</legend>
- <ul>
- {content}
- {foreach from=$issues item='issue'}
- <li>{@$issue}</li>
- {/foreach}
- {/content}
- </ul>
- </fieldset>
+ <fieldset>
+ <legend><img src="{$__wcf->getPath()}icon/{$healthType}.svg" class="icon24" /> {lang}wcf.acp.index.health.detail.{@$healthType}{/lang}</legend>
+
+ <ul>
+ {content}
+ {foreach from=$issues item='issue'}
+ <li>{@$issue}</li>
+ {/foreach}
+ {/content}
+ </ul>
+ </fieldset>
{/hascontent}
{/foreach}
</div>
{/if}
+
<div id="news" class="container containerPadding shadow hidden tabMenuContent">
WoltLab Community Framework is twice as cool now, as the version number is twice as high.
</div>
+
<fieldset id="credits" class="container containerPadding shadow hidden tabMenuContent">
<dl>
<dt>{lang}wcf.acp.index.credits.developedBy{/lang}</dt>
<form method="post" action="{link controller='MasterPassword'}{/link}">
<div class="container containerPadding marginTop shadow">
-
<fieldset>
<legend>{lang}wcf.acp.masterPassword.enter{/lang}</legend>
-
+
<dl{if $errorField == 'masterPassword'} class="formError"{/if}>
<dt><label for="masterPassword">{lang}wcf.acp.masterPassword{/lang}</label></dt>
<dd>
{event name='fieldsets'}
</div>
-
+
<div class="formSubmit">
<input type="submit" name="submitButton" value="{lang}wcf.global.button.submit{/lang}" accesskey="s" />
<input type="hidden" name="url" value="{$url}" />
<form method="post" action="{link controller='MasterPasswordInit'}{/link}">
<div class="container containerPadding marginTop shadow">
-
<fieldset>
<legend>{lang}wcf.acp.masterPassword.init{/lang}</legend>
-
+
<dl{if $errorField == 'masterPassword'} class="formError"{/if}>
<dt><label for="masterPassword">{lang}wcf.acp.masterPassword{/lang}</label></dt>
<dd>
{event name='fieldsets'}
</div>
-
+
<div class="formSubmit">
<input type="submit" name="submitButton" value="{lang}wcf.global.button.submit{/lang}" accesskey="s" />
<input type="hidden" name="url" value="{$url}" />
<select id="{$option->optionName}" name="values[{$option->optionName}][]" multiple="multiple" size="{if $selectOptions|count > 10}10{else}{@$selectOptions|count}{/if}">
-{foreach from=$selectOptions key=key item=selectOption}
- <option value="{$key}"{if $key|in_array:$value} selected="selected"{/if}>{lang}{@$selectOption}{/lang}</option>
-{/foreach}
+ {foreach from=$selectOptions key=key item=selectOption}
+ <option value="{$key}"{if $key|in_array:$value} selected="selected"{/if}>{lang}{@$selectOption}{/lang}</option>
+ {/foreach}
</select>
<div class="container containerPadding marginTop shadow">
<fieldset>
<legend>{lang}wcf.acp.option.import{/lang}</legend>
-
+
<dl{if $errorField == 'optionImport'} class="formError"{/if}>
<dt><label for="optionImport">{lang}wcf.acp.option.import.upload{/lang}</label></dt>
<dd>
</div>
<hr />
</div>
- </article>
+ </article>
{/foreach}
<div class="formSubmit">
<input type="reset" value="{lang}wcf.global.button.reset{/lang}" accesskey="r" />
<input type="submit" value="{lang}wcf.global.button.submit{/lang}" accesskey="s" />
- </div>
+ </div>
{/if}
</form>
<fieldset class="marginTop">
<legend>{lang}wcf.acp.package.information.properties{/lang}</legend>
-
+
<dl>
<dt>{lang}wcf.acp.package.identifier{/lang}</dt>
<dd>{$archive->getPackageInfo('name')}</dd>
<dt>{lang}wcf.acp.package.version{/lang}</dt>
<dd>{$archive->getPackageInfo('version')}</dd>
</dl>
-
+
<dl>
<dt>{lang}wcf.acp.package.packageDate{/lang}</dt>
<dd>{@$archive->getPackageInfo('date')|date}</dd>
</dl>
-
+
{if $archive->getPackageInfo('packageURL') != ''}
<dl>
<dt>{lang}wcf.acp.package.url{/lang}</dt>
<div class="contentNavigation">
{pages print=true assign=pagesLinks controller='PackageListDetailed' link="pageNo=%d&sortField=$sortField&sortOrder=$sortOrder"}
-
+
{hascontent}
<nav>
<ul>
{if $__wcf->session->getPermission('admin.system.package.canInstallPackage')}
<li><a href="{link controller='PackageStartInstall'}action=install{/link}" title="{lang}wcf.acp.package.startInstall{/lang}" class="button"><img src="{@$__wcf->getPath()}icon/add.svg" alt="" class="icon24" /> <span>{lang}wcf.acp.package.startInstall{/lang}</span></a></li>
{/if}
-
+
{event name='largeButtons'}
{/content}
</ul>
<div class="container containerPadding marginTop shadow">
<fieldset>
<legend>{lang}wcf.acp.package.source{/lang}</legend>
-
+
<dl{if $errorField == 'uploadPackage'} class="formError"{/if}>
<dt><label for="uploadPackage">{lang}wcf.acp.package.source.upload{/lang}</label></dt>
<dd>
<div class="formSubmit">
{if !$errorField}<input type="submit" value="{lang}wcf.global.button.submit{/lang}" accesskey="s" />{/if}
{@SID_INPUT_TAG}
- <input type="hidden" name="send" value="1" />
- {foreach from=$updates key=package item=version}
- <input type="hidden" name="updates[{$package}]" value="{$version}" />
- {/foreach}
+ <input type="hidden" name="send" value="1" />
+ {foreach from=$updates key=package item=version}
+ <input type="hidden" name="updates[{$package}]" value="{$version}" />
+ {/foreach}
</div>
</form>
{/if}
<form method="{$requestMethod}" action="index.php{if $getParameters}?{@$getParameters}{/if}">
<div class="container containerPadding marginTop shadow">
-
<fieldset>
<legend>{lang}wcf.acp.packageUpdate.auth.data{/lang}</legend>
<dd><small>{lang}wcf.acp.packageUpdate.auth.save.description{/lang}</small></dd>
</dl>
</fieldset>
-
</div>
<div class="formSubmit">
<div class="formSubmit">
<input type="reset" value="{lang}wcf.global.button.reset{/lang}" accesskey="r" />
<input type="submit" value="{lang}wcf.global.button.submit{/lang}" accesskey="s" />
- </div>
+ </div>
</form>
{/if}
</hgroup>
</header>
-<div class="wcf-contentHeader">
+<div class="contentNavigation">
{pages print=true assign=pagesLinks controller="PackageUpdateSearchResult" id=$searchID link="pageNo=%d&sortField=$sortField&sortOrder=$sortOrder"}
</div>
<form method="post" action="{link controller='PackageUpdate'}{/link}">
{foreach from=$packages item=package}
- <article class="wcf-message wcf-messageDecor"><!-- ToDo! -->
+ <article class="message"><!-- ToDo! -->
<div>
- <hgroup class="wcf-subHeading">
+ <hgroup class="messageHeader">
<h1>
{if $package[isApplication] == 1}
<img src="{@$__wcf->getPath()}icon/window.svg" alt="" title="{lang}wcf.acp.package.list.isApplication{/lang}" class="jsTooltip" />
{$package[packageName]}
</h1>
<hgroup>
-
- <div class="wcf-messageBody">
+
+ <div class="messageBody">
<dl>
<dt><label for="packageVersion-{$package[package]}">{lang}wcf.acp.package.list.version{/lang}</label></dt>
<dd>
<fieldset>
<legend>{lang}wcf.acp.packageUpdate.options{/lang}</legend>
-
+
<dl>
{* new installation *}
{if $package[isUnique] && !$package[updatableInstances]|count}
{/foreach}
</dl>
</fieldset>
-
</div>
<hr />
</div>
- </article>
+ </article>
{/foreach}
<div class="formSubmit">
</div>
</form>
-<div class="wcf-contentFooter">
+<div class="contentNavigation">
{@$pagesLinks}
</div>
{/if}
</ul>
</nav>
-
+
<div id="information" class="container containerPadding shadow hidden tabMenuContent">
<fieldset>
<legend>{lang}wcf.acp.package.information.properties{/lang}</legend>
-
+
<dl>
<dt>{lang}wcf.acp.package.identifier{/lang}</dt>
<dd>{$package->package}</dd>
<dt>{lang}wcf.acp.package.author{/lang}</dt>
<dd>{if $package->authorURL}<a href="{@$__wcf->getPath()}acp/dereferrer.php?url={$package->authorURL|rawurlencode}" class="wcf-externalURL">{$package->author}</a>{else}{$package->author}{/if}</dd>
</dl>
-
+
{event name='propertyFields'}
</fieldset>
</fieldset>
{/if}
</div>
-
+
{if $package->getRequiredPackages()|count || $package->getDependentPackages()|count}
<div id="dependencies" class="container containerPadding tabMenuContainer tabMenuContent">
<nav class="menu">
{/if}
</ul>
</nav>
-
+
{hascontent}
<div id="dependencies-required" class="tabularBox tabularBoxTitle hidden">
<hgroup>
<h1>{lang}wcf.acp.package.dependencies.required{/lang}</h1>
<h2>{lang}wcf.acp.package.dependencies.required.description{/lang}</h2>
</hgroup>
-
+
<table class="table">
<thead>
<tr>
{event name='requirementHeadColumns'}
</tr>
</thead>
-
+
<tbody>
{content}
{foreach from=$package->getRequiredPackages() item=requiredPackage}
</table>
</div>
{/hascontent}
-
+
{hascontent}
<div id="dependencies-dependent" class="tabularBox tabularBoxTitle hidden">
<hgroup>
<h1>{lang}wcf.acp.package.dependencies.dependent{/lang}</h1>
<h2>{lang}wcf.acp.package.dependencies.dependent.description{/lang}</h2>
</hgroup>
-
+
<table class="table">
<thead>
<tr>
{event name='dependencyHeadColumns'}
</tr>
</thead>
-
+
<tbody>
{content}
{foreach from=$package->getDependentPackages() item=dependentPackage}
{foreach from=$selectOptions key=key item=selectOption}
<label><input type="radio" name="values[{$option->optionName}]" value="{$key}" {if $value == $key} checked="checked"{/if} {if $disableOptions[$key]|isset || $enableOptions[$key]|isset}class="jsEnablesOptions" data-disable-options="[ {@$disableOptions[$key]}]" data-enable-options="[ {@$enableOptions[$key]}]"{/if} /> {lang}{@$selectOption}{/lang}</label>
{/foreach}
-
\ No newline at end of file
<select id="{$option->optionName}" name="values[{$option->optionName}]">
-{foreach from=$selectOptions key=key item=selectOption}
- <option value="{$key}"{if $value == $key} selected="selected"{/if}>{lang}{@$selectOption}{/lang}</option>
-{/foreach}
+ {foreach from=$selectOptions key=key item=selectOption}
+ <option value="{$key}"{if $value == $key} selected="selected"{/if}>{lang}{@$selectOption}{/lang}</option>
+ {/foreach}
</select>
\ No newline at end of file
{include file='header' templateName='success'}
-<p class="wcf-success">{lang}{@$message}{/lang}</p>
+<p class="success">{lang}{@$message}{/lang}</p>
{include file='footer'}
{/if}
{if $packageUpdateServer|isset && $packageUpdateServer->errorMessage}
- <p class="warning">{lang}wcf.acp.updateServer.lastErrorMessage{/lang}<br />{$packageUpdateServer->errorMessage}</p>
+ <p class="warning">{lang}wcf.acp.updateServer.lastErrorMessage{/lang}<br />{$packageUpdateServer->errorMessage}</p>
{/if}
{if $success|isset}
<div class="container containerPadding marginTop shadow">
<fieldset>
<legend>{lang}wcf.acp.user.general{/lang}</legend>
-
+
<dl{if $errorType.username|isset} class="formError"{/if}>
<dt><label for="username">{lang}wcf.user.username{/lang}</label></dt>
<dd>
{/if}
</dd>
</dl>
-
+
{if $availableGroups|count}
<dl>
<dt>
</dl>
</fieldset>
{/if}
-
+
{event name='fieldsets'}
{if $optionTree|count || $additionalTabs|isset}
{event name='tabMenuTabs'}
</ul>
</nav>
-
+
{foreach from=$optionTree item=categoryLevel1}
<div id="{@$categoryLevel1[object]->categoryName}" class="container containerPadding tabMenuContent hidden">
{foreach from=$categoryLevel1[categories] item=categoryLevel2}
{/foreach}
</div>
{/foreach}
-
+
{event name='tabMenuContent'}
</div>
{/if}
{/if}
<dd>
</dl>
-
</fieldset>
-
</div>
<div class="formSubmit">
<label><input type="radio" class="jsEnablesOptions" name="fileType" value="xml" {if $fileType == 'xml'}checked="checked" {/if}data-disable-options="[ 'separatorDiv', 'textSeparatorDiv' ]" data-enable-options="[ ]" /> {lang}wcf.acp.user.exportEmailAddress.fileType.xml{/lang}</label>
</dd>
</dl>
-
+
<dl id="separatorDiv">
<dt><label for="separator">{lang}wcf.acp.user.exportEmailAddress.separator{/lang}</label></dt>
<dd>
{/if}
{if $warningSelfEdit|isset}
- <p class="warning">{lang}wcf.acp.group.edit.warning.selfIsMember{/lang}</p>
+ <p class="warning">{lang}wcf.acp.group.edit.warning.selfIsMember{/lang}</p>
{/if}
{if $success|isset}
<td class="columnID columnGroupID"><p>{@$group->groupID}</p></td>
<td class="columnTitle columnGroupName">{if $group->isEditable()}<p><a title="{lang}wcf.acp.group.edit{/lang}" href="{link controller='UserGroupEdit' id=$group->groupID}{/link}">{lang}{$group->groupName}{/lang}</a>{else}{lang}{$group->groupName}{/lang}</p>{/if}</td>
<td class="columnDigits columnMembers"><p><a title="{lang}wcf.acp.group.showMembers{/lang}" href="{link controller='UserSearch'}groupID={@$group->groupID}{/link}">{#$group->members}</p></a></td>
-
+
{event name='columns'}
</tr>
{/foreach}
{/content}
</tbody>
</table>
-
</div>
<div class="contentNavigation">
var actionObjects = { };
actionObjects['com.woltlab.wcf.user'] = { };
actionObjects['com.woltlab.wcf.user']['delete'] = new WCF.Action.Delete('wcf\\data\\user\\UserAction', $('.jsUserRow'), $('#userTableContainer .wcf-menu li:first-child .wcf-badge'));
-
+
WCF.Clipboard.init('wcf\\acp\\page\\UserListPage', {@$hasMarkedItems}, actionObjects);
var options = { };
{else}
<img src="{@$__wcf->getPath()}icon/delete.svg" alt="" title="{lang}wcf.acp.user.delete{/lang}" class="icon16 disabled" />
{/if}
-
+
{event name='buttons'}
</td>
<td class="columnID columnUserID"><p>{@$user->userID}</p></td>
<td class="columnTitle columnUsername"><p>{if $user->editable}<a title="{lang}wcf.acp.user.edit{/lang}" href="{link controller='UserEdit' id=$user->userID}{/link}">{$user->username}</a>{else}{$user->username}{/if}</p></td>
-
+
{foreach from=$columnHeads key=column item=columnLanguageVariable}
<td class="column{$column|ucfirst}"><p>{if $columnValues[$user->userID][$column]|isset}{@$columnValues[$user->userID][$column]}{/if}</p></td>
{/foreach}
-
+
{event name='columns'}
</tr>
{/foreach}
{/content}
</tbody>
</table>
-
</div>
<div class="contentNavigation">
<div>
{implode from=$userList item=$user}<a href="{link controller='UserEdit' id=$user->userID}{/link}">{$user}</a>{/implode}
</div>
- </fieldset>
+ </fieldset>
{/if}
{if $action == 'group'}
<dl>
<dt><label for="userID">{lang}wcf.user.userID{/lang}</label></dt>
- <dd>
+ <dd>
<input type="text" id="userID" name="userID" value="{$userID}" class="short" />
</dd>
</dl>
{/foreach}
</div>
{/if}
-
+
{event name='tabMenuContent'}
-
+
<div id="resultOptions" class="container containerPadding tabMenuContent hidden">
<fieldset>
<legend>{lang}wcf.acp.user.search.display.general{/lang}</legend>
-
+
<dl>
<dt><label for="sortField">{lang}wcf.acp.user.search.display.sort{/lang}</label></dt>
<dd>
</select>
</dd>
</dl>
-
+
<dl>
<dt><label for="itemsPerPage">{lang}wcf.acp.user.search.display.itemsPerPage{/lang}</label></dt>
<dd>
</dd>
</dl>
</fieldset>
-
+
<fieldset>
<legend>{lang}wcf.acp.user.search.display.columns{/lang}</legend>
</dd>
</dl>
{/if*}
-
+
<dl>
<dt><label>{lang}wcf.acp.user.search.display.columns.other{/lang}</label></dt>
<dd>
<label><input type="checkbox" name="columns[]" value="registrationDate" {if "registrationDate"|in_array:$columns}checked="checked"{/if}/> {lang}wcf.user.registrationDate{/lang}</label>
</dd>
</dl>
-
+
</fieldset>
-
</div>
</div>
</div>
</dl>
{/if}
</fieldset>
-
+
{event name='fieldsets'}
{hascontent}
{if $options|count}
<li><a href="#profile">{lang}wcf.acp.user.search.conditions.profile{/lang}</a></li>
{/if}
-
+
{event name='tabMenuTabs'}
{/content}
</ul>
<label><input type="radio" name="fileType" value="xml" {if $fileType == 'xml'}checked="checked" {/if}/> {lang}wcf.acp.user.exportEmailAddress.fileType.xml{/lang}</label>
</dd>
</dl>
-
+
<dl id="separatorDiv">
<dt><label for="separator">{lang}wcf.acp.user.exportEmailAddress.separator{/lang}</label></dt>
<dd>
* ImageViewer for WCF.
* Based upon "Slimbox 2" by Christophe Beyls 2007-20120, http://www.digitalia.be/software/slimbox2, MIT-style license.
*
- *
* @author Alexander Ebert
* @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
(function() {
// store original implementation
var $jQueryData = jQuery.fn.data;
-
+
/**
* Override jQuery.fn.data() to support custom 'ID' suffix which will
* be translated to '-id' at runtime.
if (key && key.match(/ID$/)) {
arguments[0] = key.replace(/ID$/, '-id');
}
-
+
// call jQuery's own data method
var $data = $jQueryData.apply(this, arguments);
};
})();
- /* Simple JavaScript Inheritance
+/**
+ * Simple JavaScript Inheritance
* By John Resig http://ejohn.org/
* MIT Licensed.
*/
wcfIsset: function(id) {
return !!$('#' + $.wcfEscapeID(id)).length;
},
-
+
/**
* Returns the length of an object.
*
*/
getLength: function(targetObject) {
var $length = 0;
-
+
for (var $key in targetObject) {
if (targetObject.hasOwnProperty($key)) {
$length++;
enable: function() {
return this.removeAttr('disabled');
},
-
+
/**
* Returns the element's id. If none is set, a random unique
* ID will be assigned.
if (!this.attr('id')) {
this.attr('id', WCF.getRandomID());
}
-
+
return this.attr('id');
},
wcfHighlight: function(options, callback) {
return this.effect('highlight', options, 600, callback);
},
-
+
/**
* Shows an element by fading it in.
*
return this.show(WCF.getEffect(this.getTagName(), 'fade'), { }, duration, callback);
},
-
+
/**
* Hides an element by fading it out.
*
* @var integer
*/
_idCounter: 0,
-
+
/**
* Shows a modal dialog with a built-in AJAX-loader.
*
// we cannot work with a non-existant dialog, if you wish to
// load content via AJAX, see showAJAXDialog() instead
if (!$.wcfIsset(dialogID)) return;
-
+
var $dialog = $('#' + $.wcfEscapeID(dialogID));
var dialogOptions = arguments[1] || {};
// bind event
$listItem.click($.proxy(this._executeAction, this));
}
-
+
// block click event
$container.click(function(event) {
event.stopPropagation();
});
-
+
// register event handler
var $containerID = $container.wcfIdentify();
WCF.CloseOverlayHandler.addCallback($containerID, $.proxy(this._closeLists, this));
/**
* interval id
- * @var integer
+ * @var integer
*/
_intervalID: null,
* @var integer
*/
_activeRequests: 0,
-
+
/**
* loading overlay
* @var jQuery
*/
_loadingOverlay: null,
-
+
/**
* loading overlay state
* @var boolean
*/
_loadingOverlayVisible: false,
-
+
/**
* timer for overlay activity
* @var integer
* @var boolean
*/
_suppressErrors: false,
-
+
/**
* Initializes AJAXProxy.
*
this._showLoadingOverlay();
}
},
-
+
/**
* Displays the loading overlay if not already visible due to an active request.
*/
if (this._loadingOverlay === null) {
this._loadingOverlay = $('<div class="spinner"><img src="' + WCF.Icon.get('wcf.icon.loading') + '" alt="" class="icon48" /> <span>' + WCF.Language.get('wcf.global.loading') + '</span></div>').hide().appendTo($('body'));
}
-
+
// fade in overlay
if (!this._loadingOverlayVisible) {
this._loadingOverlayVisible = true;
}, this));
}
},
-
+
/**
* Hides loading overlay if no requests are active and the timer reached at least 1 second.
*
this._loadingOverlayVisible = false;
this._loadingOverlayVisibleTimer = 0;
pe.stop();
-
+
this._loadingOverlay.fadeOut(100);
}
},
setOption: function(optionName, optionData) {
this.options[optionName] = optionData;
},
-
+
/**
* Displays a spinner image for given element.
*
*/
showSpinner: function(element) {
element = $(element);
-
+
if (element.getTagName() !== 'img') {
console.debug('The given element is not an image, aborting.');
return;
}
-
+
// force element dimensions
element.attr('width', element.attr('width'));
element.attr('height', element.attr('height'));
-
+
// replace image
element.attr('src', WCF.Icon.get('wcf.global.loading'));
}
// re-calculate relative datetime every minute
new WCF.PeriodicalExecuter($.proxy(this._refresh, this), 60000);
-
+
// bind dom node inserted listener
WCF.DOMNodeInsertedHandler.addCallback('WCF.Date.Time', $.proxy(this._domNodeInserted, this));
},
-
+
/**
* Updates element collection once a DOM node was inserted.
*/
else if (this.timestamp < ($timestamp + 604800)) {
var $days = Math.round((this.timestamp - $timestamp) / 86400);
var $string = eval(WCF.Language.get('wcf.date.relative.pastDays'));
-
+
// get day of week
var $dateObj = WCF.Date.Util.getTimezoneDate(($timestamp * 1000), $offset);
var $dow = $dateObj.getDay();
* @var object
*/
_availableLanguages: {},
-
+
/**
* initialization state
* @var boolean
*/
_didInit: false,
-
+
/**
* target input element
* @var jQuery
* @var boolean
*/
_insertedDataAfterInit: false,
-
+
/**
* enables multiple language ability
* @var boolean
*/
_isEnabled: false,
-
+
/**
* enforce multiple language ability
* @var boolean
*/
_forceSelection: false,
-
+
/**
* currently active language id
* @var integer
*/
_languageID: 0,
-
+
/**
* language selection list
* @var jQuery
*/
_list: null,
-
+
/**
* list of language values on init
* @var object
*/
_values: null,
-
+
/**
* Initializes multiple language ability for given element id.
*
// listen for submit event
this._element.parents('form').submit($.proxy(this._submit, this));
-
+
this._didInit = true;
},
-
+
/**
* Builds language handler.
*
for (var $languageID in this._availableLanguages) {
$('<li><span>' + this._availableLanguages[$languageID] + '</span></li>').data('languageID', $languageID).click($.proxy(this._changeLanguage, this)).appendTo(this._list);
}
-
+
// disable language input
if (!this._forceSelection) {
$('<li class="dropdownDivider" />').appendTo(this._list);
if (enableOnInit || this._forceSelection) {
$button.trigger('click');
-
+
// pre-select current language
this._list.children('li').each($.proxy(function(index, listItem) {
var $listItem = $(listItem);
this._closeSelection();
}
},
-
+
/**
* Enables the language selection or shows the selection if already enabled.
*
else {
this._showSelection();
}
-
+
// discard event
event.stopPropagation();
},
-
+
/**
* Shows the language selection.
*/
this._list.children('li').each($.proxy(function(index, listItem) {
var $listItem = $(listItem);
var $languageID = $listItem.data('languageID');
-
+
if ($languageID) {
if (this._values[$languageID] && this._values[$languageID] != '') {
$listItem.removeClass('missingValue');
}, this));
}
},
-
+
/**
* Closes the language selection.
*/
this._disable();
}
},
-
+
/**
* Changes the currently active language.
*
this._closeSelection();
this._element.blur().focus();
},
-
+
/**
* Disables language selection for current element.
*/
// remove active marking
this._list.prev('.dropdownToggle').children('span').removeClass('active').text(WCF.Language.get('wcf.global.button.disabledI18n'));
this._closeSelection();
-
+
// update element value
if (this._values[LANGUAGE_ID]) {
this._element.val(this._values[LANGUAGE_ID]);
this._element.blur();
this._isEnabled = false;
},
-
+
/**
* Prepares language variables on before submit.
*/
if (!this._isEnabled) {
return 0xDEADBEAF;
}
-
+
// fetch active value
if (this._languageID) {
this._values[this._languageID] = this._element.val();
}
-
+
var $form = $(this._element.parents('form')[0]);
var $elementID = this._element.wcfIdentify();
-
+
for (var $languageID in this._values) {
$('<input type="hidden" name="' + $elementID + '_i18n[' + $languageID + ']" value="' + this._values[$languageID] + '" />').appendTo($form);
}
-
+
// remove name attribute to prevent conflict with i18n values
this._element.removeAttr('name');
}
* @var WCF.Dictionary
*/
_icons: new WCF.Dictionary(),
-
+
/**
* @see WCF.Dictionary.add()
*/
add: function(name, path) {
this._icons.add(name, path);
},
-
+
/**
* @see WCF.Dictionary.addObject()
*/
addObject: function(object) {
this._icons.addObject(object);
},
-
+
/**
* @see WCF.Dictionary.get()
*/
addThousandsSeparator: function(number) {
var $numberString = String(number);
var parts = $numberString.split(/[^0-9]+/);
-
+
var $decimalPoint = $numberString.match(/[^0-9]+/);
$numberString = parts[0];
};
/**
- * Templates that may be fetched more than once with different variables. Based upon ideas from Prototype's template
+ * Templates that may be fetched more than once with different variables.
+ * Based upon ideas from Prototype's template.
*
* Usage:
* var myTemplate = new WCF.Template('{$hello} World');
*
* my2ndTemplate = new WCF.Template('{@$html}{$html}');
* my2ndTemplate.fetch({ html: '<b>Test</b>' }); // <b>Test</b><b>Test</b>
- *
+ *
* var my3rdTemplate = new WCF.Template('You can use {literal}{$variable}{/literal}-Tags here');
* my3rdTemplate.fetch({ variable: 'Not shown' }); // You can use {$variable}-Tags here
*
- *
* @param template template-content
* @see https://github.com/sstephenson/prototype/blob/master/src/prototype/lang/template.js
*/
WCF.Template = function(template) { this.init(template); };
WCF.Template.prototype = {
/**
- * Template-content
- *
+ * template content
* @var string
*/
_template: '',
/**
- * Saved literal-tags
- *
+ * saved literal tags
* @var WCF.Dictionary
*/
_literals: new WCF.Dictionary(),
/**
* Basic implementation for collapsible containers with AJAX support. Results for open
* and closed state will be cached.
- *
+ *
* @param string className
*/
WCF.Collapsible.Remote = Class.extend({
* @var string
*/
_className: '',
-
+
/**
* list of active containers
* @var object
*/
_containers: {},
-
+
/**
* container meta data
* @var object
*/
_containerData: {},
-
+
/**
* action proxy
* @var WCF.Action.Proxy
*/
_proxy: null,
-
+
/**
* Initializes the controller for collapsible containers with AJAX support.
*
var $isOpen = this._containers[containerID].data('isOpen');
var $button = $('<a class="collapsibleButton jsTooltip" title="'+WCF.Language.get('wcf.global.button.collapsible')+'"><img src="' + WCF.Icon.get('wcf.icon.' + ($isOpen ? 'opened' : 'closed')) + '" alt="" class="icon16" /></a>').prependTo(buttonContainer);
$button.data('containerID', containerID).click($.proxy(this._toggleContainer, this));
-
+
return $button;
},
}, this._getAdditionalParameters($containerID))
});
this._proxy.sendRequest();
-
+
// set spinner for current button
this._exchangeIcon($button);
},
*/
WCF.User = {
/**
- * UserID of the user
- *
+ * id of the actuve user
* @var integer
*/
userID: 0,
/**
- * Username of the user
- *
+ * name of the active user
* @var string
*/
username: '',
* @var boolean
*/
_didInit: false,
-
+
/**
* tooltip element
* @var jQuery
*/
_tooltip: null,
-
+
/**
* cache viewport dimensions
* @var object
*/
_viewportDimensions: { },
-
+
/**
* Initializes tooltips.
*/
if (!this._didInit) {
// create empty div
this._tooltip = $('<div id="balloonTooltip" class="balloonTooltip"><span id="balloonTooltipText"></span><span class="pointer"><span></span></span></div>').appendTo($('body')).hide();
-
+
// get viewport dimensions
this._updateViewportDimensions();
-
+
// update viewport dimensions on resize
$(window).resize($.proxy(this._updateViewportDimensions, this));
-
+
// observe DOM changes
WCF.DOMNodeInsertedHandler.addCallback('WCF.Effect.BalloonTooltip', $.proxy(this.init, this));
-
+
this._didInit = true;
}
// init elements
$('.jsTooltip').each($.proxy(this._initTooltip, this));
},
-
+
/**
* Updates cached viewport dimensions.
*/
if ($element.hasClass('jsTooltip')) {
$element.removeClass('jsTooltip');
var $title = $element.attr('title');
-
+
// ignore empty elements
if ($title !== '') {
$element.data('tooltip', $title);
$element.removeAttr('title');
-
+
$element.hover(
$.proxy(this._mouseEnterHandler, this),
$.proxy(this._mouseLeaveHandler, this)
// update text
this._tooltip.children('span:eq(0)').text($element.data('tooltip'));
-
+
// get arrow
var $arrow = this._tooltip.find('.pointer');
-
+
// get arrow width
this._tooltip.show();
var $arrowWidth = $arrow.outerWidth();
var $elementDimensions = $element.getDimensions('outer');
var $tooltipDimensions = this._tooltip.getDimensions('outer');
var $tooltipDimensionsInner = this._tooltip.getDimensions('inner');
-
+
var $elementCenter = $elementOffsets.left + Math.ceil($elementDimensions.width / 2);
var $tooltipHalfWidth = Math.ceil($tooltipDimensions.width / 2);
// determine alignment
- $alignment = 'center';
+ var $alignment = 'center';
if (($elementCenter - $tooltipHalfWidth) < 5) {
$alignment = 'left';
}
else if ((this._viewportDimensions.width - 5) < ($elementCenter + $tooltipHalfWidth)) {
$alignment = 'right';
}
-
+
// calculate top offset
var $top = $elementOffsets.top + $elementDimensions.height + 7;
-
+
// calculate left offset
switch ($alignment) {
case 'center':
var $left = Math.round($elementOffsets.left - $tooltipHalfWidth + ($elementDimensions.width / 2));
-
+
$arrow.css({
left: ($tooltipDimensionsInner.width / 2 - $arrowWidth / 2) + "px"
});
break;
-
+
case 'left':
var $left = $elementOffsets.left;
-
+
$arrow.css({
left: "5px"
});
break;
-
+
case 'right':
var $left = $elementOffsets.left + $elementDimensions.width - $tooltipDimensions.width;
-
+
$arrow.css({
left: ($tooltipDimensionsInner.width - $arrowWidth - 5) + "px"
});
break;
}
-
+
// move tooltip
this._tooltip.css({
top: $top + "px",
* @var WCF.Dictionary
*/
_callbacks: new WCF.Dictionary(),
-
+
/**
* indicates that overlay handler is listening to click events on body-tag
* @var boolean
*/
_isListening: false,
-
+
/**
* Adds a new callback.
*
console.debug("[WCF.CloseOverlayHandler] identifier '" + identifier + "' is already bound to a callback");
return false;
}
-
+
this._callbacks.add(identifier, callback);
},
-
+
/**
* Removes a callback from list.
*
this._callbacks.remove(identifier);
}
},
-
+
/**
* Binds click event handler.
*/
_bindListener: function() {
if (this._isListening) return;
-
+
$('body').click($.proxy(this._executeCallbacks, this));
-
+
this._isListening = true;
},
-
+
/**
* Executes callbacks on click.
*/
* @var WCF.Dictionary
*/
_callbacks: new WCF.Dictionary(),
-
+
/**
* prevent infinite loop if a callback manipulates DOM
* @var boolean
*/
_isExecuting: false,
-
+
/**
* indicates that overlay handler is listening to DOMNodeRemoved events on body-tag
* @var boolean
*/
_isListening: false,
-
+
/**
* Adds a new callback.
*
*/
addCallback: function(identifier, callback) {
this._bindListener();
-
+
if (this._callbacks.isset(identifier)) {
console.debug("[WCF.DOMNodeRemovedHandler] identifier '" + identifier + "' is already bound to a callback");
return false;
}
-
+
this._callbacks.add(identifier, callback);
},
-
+
/**
* Removes a callback from list.
*
this._callbacks.remove(identifier);
}
},
-
+
/**
* Binds click event handler.
*/
_bindListener: function() {
if (this._isListening) return;
-
+
$(document).bind('DOMNodeRemoved', $.proxy(this._executeCallbacks, this));
-
+
this._isListening = true;
},
-
+
/**
* Executes callbacks if a DOM node is removed.
*/
_executeCallbacks: function(event) {
if (this._isExecuting) return;
-
+
// do not track events while executing callbacks
this._isExecuting = true;
_getParameters: function(parameters) {
return parameters;
},
-
+
/**
* Evalutes search results.
*
for (var $i in data.returnValues) {
var $item = data.returnValues[$i];
-
+
this._createListItem($item);
}
return $listItem;
},
-
+
/**
* Executes callback upon result click.
*
$clearSearchInput = (this._callback($listItem.data()) === true) ? true : false;
}
}
-
+
// close list and revert input
this._clearList($clearSearchInput);
},
-
+
/**
* Closes the suggestion list and clears search input on demand.
*
if (clearSearchInput && !this._commaSeperated) {
this._searchInput.val('');
}
-
+
this._list.parent().removeClass('dropdownOpen').end().empty();
WCF.CloseOverlayHandler.removeCallback('WCF.Search.Base');
WCF.Upload = Class.extend({
/**
* name of the upload field
- * @var string
+ * @var string
*/
_name: '__files[]',
/**
* button selector
- * @var jquery
+ * @var jQuery
*/
_buttonSelector: null,
/**
* file list selector
- * @var jquery
+ * @var jQuery
*/
_fileListSelector: null,
/**
* upload file
- * @var jquery
+ * @var jQuery
*/
_fileUpload: null,
/**
* class name
- * @var string
+ * @var string
*/
_className: '',
/**
* additional options
- * @var jquery
+ * @var jQuery
*/
_options: {},
/**
* upload matrix
- * @var array
+ * @var array
*/
_uploadMatrix: [],
/**
- * True, if your browser supports ajax file uploads. False, if your browser sucks.
- * @var boolean
+ * true, if the active user's browser supports ajax file uploads
+ * @var boolean
*/
_supportsAJAXUpload: true,
/**
* fallback overlay for stupid browsers
- * @var jquery
+ * @var jquery
*/
_overlay: null,
* @var jQuery
*/
_button: null,
-
+
+ /**
+ * sidebar containder
+ * @var jQuery
+ */
_container: null,
-
+
/**
* sidebar visibility
* @var boolean
*/
_visible: true,
-
+
/**
* Creates a new toggleable sidebar.
*/
_create: function() {
- this.element.wrap('<div class="wcf-collapsibleSidebar"></div>');
+ this.element.wrap('<div class="collapsibleSidebar"></div>');
this._container = this.element.parents('aside:eq(0)');
// create toggle button
- this._button = $('<span class="wcf-collapsibleSidebarButton" title="' + WCF.Language.get('wcf.global.button.collapsible') + '"><span></span></span>').appendTo(this._container);
-
+ this._button = $('<span class="collapsibleSidebarButton" title="' + WCF.Language.get('wcf.global.button.collapsible') + '"><span></span></span>').appendTo(this._container);
+
// bind event
this._button.click($.proxy(this._toggle, this));
},
-
+
/**
* Toggles visibility on button click.
*/
this.show();
}
},
-
+
/**
* Shows sidebar content.
*/
if (this._visible) {
return;
}
-
+
this._visible = true;
this._container.removeClass('collapsed');
},
-
+
/**
* Hides the sidebar content.
*/
WCF.Sitemap = Class.extend({
/**
* sitemap name cache
+ * @var array
*/
_cache: [ ],
collapsed: false,
objectTypeID: 0
},
-
+
/**
* action proxy
* @var WCF.Action.Proxy
*/
_proxy: null,
-
+
/**
* Creates a new toggleable sidebar.
*/
}
$.ui.wcfSidebar.prototype._init.apply(this, arguments);
-
+
// collapse on init
if (this.options.collapsed) {
this.element.hide();
this._visible = false;
}
-
+
// init proxy
this._proxy = new WCF.Action.Proxy();
},
-
+
/**
* Shows sidebar content.
*/
if (this._visible) {
return;
}
-
+
$.ui.wcfSidebar.prototype._init.apply(this, arguments);
-
+
// save state
this._save();
},
-
+
/**
* Hides the sidebar content.
*/
if (!this._visible) {
return;
}
-
+
$.ui.wcfSidebar.prototype._init.apply(this, arguments);
-
+
// save state
this._save();
},
-
+
/**
* Save collapsible state
*/
* @var jQuery
*/
_closeButton: null,
-
+
/**
* dialog container
* @var jQuery
*/
_container: null,
-
+
/**
* dialog content
* @var jQuery
*/
_content: null,
-
+
/**
* dialog content dimensions
* @var object
*/
_contentDimensions: null,
-
+
/**
* rendering state
* @var boolean
*/
_isRendering: false,
-
+
/**
* modal overlay
* @var jQuery
*/
_overlay: null,
-
+
/**
* plain html for title
* @var string
*/
_title: null,
-
+
/**
* title bar
* @var jQuery
*/
_titlebar: null,
-
+
/**
* dialog visibility state
* @var boolean
*/
_isOpen: false,
-
+
/**
* option list
* @var object
modal: true,
title: '',
zIndex: 400,
-
+
// AJAX support
ajax: false,
data: { },
onClose: null,
onShow: null
},
-
+
/**
* Initializes a new dialog.
*/
type: this.options.type,
url: this.options.url
});
-
+
// force open if using AJAX
this.options.autoOpen = true;
-
+
// apply loading overlay
this._content.addClass('overlayLoading');
}
-
+
if (this.options.autoOpen) {
this.open();
}
-
+
// act on resize
$(window).resize($.proxy(this._resize, this));
},
-
+
/**
* Creates a new dialog instance.
*/
this._titlebar = $('<header class="dialogTitlebar"></header>').appendTo(this._container);
this._title = $('<span class="dialogTitle"></div>').html(this.options.title).appendTo(this._titlebar);
}
-
+
// create close button
if (this.options.closable) {
this._closeButton = $('<a class="dialogCloseButton" title="' + this.options.closeButtonLabel + '"><span>' + this.options.closeButtonLabel + '</span></a>').click($.proxy(this.close, this));
-
+
if (!this.options.hideTitle && this.options.title != '') {
this._closeButton.appendTo(this._titlebar);
}
// create content container
this._content = $('<div class="dialogContent"></div>').appendTo(this._container);
-
+
// move target element into content
var $content = this.element.detach();
this._content.html($content);
-
+
// create modal view
if (this.options.modal) {
this._overlay = $('#jsWcfDialogOverlay');
_success: function(data, textStatus, jqXHR) {
// initialize dialog content
this._initDialog(data);
-
+
// remove loading overlay
this._content.removeClass('overlayLoading');
this.render();
}
},
-
+
/**
* Returns a response value, taking care of different object
* structure returned by AJAXProxy.
else if (data[key]) {
return data[key];
}
-
+
return null;
},
-
+
/**
* Opens this dialog.
*/
if (this.isOpen()) {
return;
}
-
+
if (this._overlay !== null) {
WCF.activeDialogs++;
this._overlay.show();
}
}
-
+
this.render();
this._isOpen = true;
},
-
+
/**
* Returns true, if dialog is visible.
*
if (!this.isOpen()) {
return;
}
-
+
this._isOpen = false;
this._container.wcfFadeOut();
-
+
if (this._overlay !== null) {
WCF.activeDialogs--;
width: 'auto'
});
}
-
+
// force content to be visible
this._content.children().each(function() {
$(this).show();
});
-
+
// handle multiple rendering requests
if (this._isRendering) {
// stop current process
// set dialog to be fully opaque, should prevent weird bugs in WebKit
this._container.show().css('opacity', 1.0);
}
-
+
// calculate dimensions
var $windowDimensions = $(window).getDimensions();
var $containerDimensions = this._container.getDimensions('outer');
var $contentDimensions = this._content.getDimensions();
-
+
// calculate maximum content height
var $heightDifference = $containerDimensions.height - $contentDimensions.height;
var $maximumHeight = $windowDimensions.height - $heightDifference;
if ($maximumHeight < $contentDimensions.height) {
$containerDimensions = this._container.getDimensions('outer');
}
-
+
// handle multiple rendering requests
if (this._isRendering) {
// use current dimensions as previous ones
this._contentDimensions = this._getContentDimensions($maximumHeight);
}
-
+
// calculate new dimensions
$contentDimensions = this._getContentDimensions($maximumHeight);
-
+
// move container
var $leftOffset = Math.round(($windowDimensions.width - $containerDimensions.width) / 2);
var $topOffset = Math.round(($windowDimensions.height - $containerDimensions.height) / 2);
-
+
// place container at 20% height if possible
var $desiredTopOffset = Math.round(($windowDimensions.height / 100) * 20);
if ($desiredTopOffset < $topOffset) {
$topOffset = $desiredTopOffset;
}
-
+
if (!this.isOpen()) {
// hide container again
this._container.hide();
-
+
// apply offset
this._container.css({
left: $leftOffset + 'px',
top: $topOffset + 'px'
});
-
+
// save current dimensions
this._contentDimensions = $contentDimensions;
-
+
// force dimensions
this._content.css({
height: this._contentDimensions.height + 'px',
width: this._contentDimensions.width + 'px'
});
-
+
// fade in container
this._container.wcfFadeIn($.proxy(function() {
this._isRendering = false;
height: this._contentDimensions.height + 'px',
width: this._contentDimensions.width + 'px'
});
-
+
// apply new dimensions
$content.animate({
height: ($contentDimensions.height) + 'px',
// store new dimensions
this._contentDimensions = $contentDimensions;
-
+
// move container
this._container.animate({
left: $leftOffset + 'px',
if (this.options.onShow !== null) {
this.options.onShow();
}
-
+
this._isRendering = true;
},
-
+
/**
* Returns calculated content dimensions.
*
*/
_getContentDimensions: function(maximumHeight) {
var $contentDimensions = this._content.getDimensions();
-
+
// set height to maximum height if exceeded
if ($contentDimensions.height > maximumHeight) {
$contentDimensions.height = maximumHeight;
}
-
+
return $contentDimensions;
}
});
$.ui.tabs.prototype.select.apply(this, arguments);
},
-
+
/**
* Returns the currently selected tab index.
*
},
/**
- * Renders a page link
+ * Renders a page link.
*
* @parameter integer page
- *
- * @return $(element)
+ * @return jQuery
*/
_renderLink: function(page, lineBreak) {
var $pageElement = $('<li class="button"></li>');
* Copy of the default implementation for object-actions using the AJAX-API.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage acp.action
- * @category Community Framework
+ * @category Community Framework
*/
class AJAXProxyAction extends \wcf\action\AJAXProxyAction { }
* Copy of the default implementation for the clipboard-API.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage acp.action
- * @category Community Framework
+ * @category Community Framework
*/
class ClipboardAction extends \wcf\action\ClipboardAction { }
* Copy of the default implementation for loading marked items from clipboard API.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage acp.action
- * @category Community Framework
+ * @category Community Framework
*/
class ClipboardLoadMarkedItemsAction extends \wcf\action\ClipboardLoadMarkedItemsAction { }
* Copy of the default implementation for the clipboard proxy API.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage acp.action
- * @category Community Framework
+ * @category Community Framework
*/
class ClipboardProxyAction extends \wcf\action\ClipboardProxyAction { }
/**
* Handles an AJAX-based package installation.
- *
+ *
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage acp.action
- * @category Community Framework
+ * @category Community Framework
*/
class InstallPackageAction extends AbstractDialogAction {
/**
/**
* Does the user logout in the admin control panel.
- *
+ *
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage acp.action
- * @category Community Framework
+ * @category Community Framework
*/
class LogoutAction extends AbstractSecureAction {
/**
* Exports the options to an XML.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage acp.action
- * @category Community Framework
+ * @category Community Framework
*/
class OptionExportAction extends AbstractAction {
/**
* Handles an AJAX-based package uninstallation.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage acp.action
- * @category Community Framework
+ * @category Community Framework
*/
class UninstallPackageAction extends InstallPackageAction {
/**
* Handles worker actions.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage acp.action
- * @category Community Framework
+ * @category Community Framework
*/
class WorkerProxyAction extends AbstractSecureAction {
/**
* Provides a default implementation for the show method in acp forms.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class ACPForm extends AbstractForm {
/**
* active acp menu item
- * @var string
+ * @var string
*/
public $activeMenuItem = '';
/**
- * @see wcf\page\IPage::show()
+ * @see wcf\page\IPage::show()
*/
public function show() {
// set active acp menu item
/**
* This class provides default implementations for a list of options.
- *
+ *
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
abstract class AbstractOptionListForm extends AbstractForm {
/**
/**
* cache class name
- * @var string
+ * @var string
*/
public $cacheClass = 'wcf\system\cache\builder\OptionCacheBuilder';
/**
* Shows the cronjob add form.
- *
+ *
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class CronjobAddForm extends ACPForm {
/**
- * @see wcf\acp\form\ACPForm::$activeMenuItem
+ * @see wcf\acp\form\ACPForm::$activeMenuItem
*/
public $activeMenuItem = 'wcf.acp.menu.link.cronjob.add';
/**
- * @see wcf\page\AbstractPage::$neededPermissions
+ * @see wcf\page\AbstractPage::$neededPermissions
*/
public $neededPermissions = array('admin.system.cronjob.canAddCronjob');
/**
* cronjob class name
- * @var string
+ * @var string
*/
public $className = '';
/**
* cronjob package id
- * @var integer
+ * @var integer
*/
public $packageID = PACKAGE_ID;
/**
* cronjob description
- * @var string
+ * @var string
*/
public $description = '';
/**
* execution time (min)
- * @var string
+ * @var string
*/
public $startMinute = '*';
/**
* execution time (hour)
- * @var string
+ * @var string
*/
public $startHour = '*';
/**
* execution time (day of month)
- * @var string
+ * @var string
*/
public $startDom = '*';
/**
* execution time (month)
- * @var string
+ * @var string
*/
public $startMonth = '*';
/**
* execution time (day of week)
- * @var string
+ * @var string
*/
public $startDow = '*';
/**
- * @see wcf\form\IForm::readFormParameters()
+ * @see wcf\form\IForm::readFormParameters()
*/
public function readFormParameters() {
parent::readFormParameters();
}
/**
- * @see wcf\form\IForm::validate()
+ * @see wcf\form\IForm::validate()
*/
public function validate() {
parent::validate();
}
/**
- * @see wcf\form\IForm::save()
+ * @see wcf\form\IForm::save()
*/
public function save() {
parent::save();
}
/**
- * @see wcf\page\IPage::assignVariables()
+ * @see wcf\page\IPage::assignVariables()
*/
public function assignVariables() {
parent::assignVariables();
* Shows the cronjob edit form.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class CronjobEditForm extends CronjobAddForm {
/**
- * @see wcf\acp\form\ACPForm::$activeMenuItem
+ * @see wcf\acp\form\ACPForm::$activeMenuItem
*/
public $activeMenuItem = 'wcf.acp.menu.link.cronjob';
/**
- * @see wcf\page\AbstractPage::$neededPermissions
+ * @see wcf\page\AbstractPage::$neededPermissions
*/
public $neededPermissions = array('admin.system.cronjob.canEditCronjob');
/**
* cronjob object
- * @var wcf\data\cronjob\Cronjob
+ * @var wcf\data\cronjob\Cronjob
*/
public $cronjob = null;
/**
- * @see wcf\page\IPage::readParameters()
+ * @see wcf\page\IPage::readParameters()
*/
public function readParameters() {
parent::readParameters();
}
/**
- * @see wcf\form\IForm::save()
+ * @see wcf\form\IForm::save()
*/
public function save() {
ACPForm::save();
}
/**
- * @see wcf\page\IPage::readData()
+ * @see wcf\page\IPage::readData()
*/
public function readData() {
parent::readData();
}
/**
- * @see wcf\page\IPage::assignVariables()
+ * @see wcf\page\IPage::assignVariables()
*/
public function assignVariables() {
parent::assignVariables();
* Shows the acp login form.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class LoginForm extends AbstractForm {
/**
* given login username
- * @var string
+ * @var string
*/
public $username = '';
/**
* given login password
- * @var string
+ * @var string
*/
public $password = '';
/**
* user object
- * @var wcf\data\user\User
+ * @var wcf\data\user\User
*/
public $user;
/**
* given forward url
- * @var string
+ * @var string
*/
public $url = null;
}
/**
- * @see wcf\page\IPage::readParameters()
+ * @see wcf\page\IPage::readParameters()
*/
public function readParameters() {
parent::readParameters();
}
/**
- * @see wcf\form\IForm::readFormParameters()
+ * @see wcf\form\IForm::readFormParameters()
*/
public function readFormParameters() {
parent::readFormParameters();
}
/**
- * @see wcf\form\IForm::validate()
+ * @see wcf\form\IForm::validate()
*/
public function validate() {
parent::validate();
}
/**
- * @see wcf\form\IForm::save()
+ * @see wcf\form\IForm::save()
*/
public function save() {
parent::save();
}
/**
- * @see wcf\page\IPage::readData()
+ * @see wcf\page\IPage::readData()
*/
public function readData() {
parent::readData();
-
+
// get preferred username
if (!count($_POST)) {
if (isset($_COOKIE[COOKIE_PREFIX.'userID'])) {
}
/**
- * @see wcf\page\IPage::assignVariables()
+ * @see wcf\page\IPage::assignVariables()
*/
public function assignVariables() {
parent::assignVariables();
/**
* Shows the master password form.
- *
+ *
* @author Marcel Werk
* @copyright 2001-2011 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
+ * @category Community Framework
*/
class MasterPasswordForm extends ACPForm {
/**
* master password
- * @var string
+ * @var string
*/
public $masterPassword = '';
/**
* forward url
- * @var string
+ * @var string
*/
public $url = '';
require_once(WCF_DIR.'acp/masterPassword.inc.php');
}
}
-
+
/**
- * @see wcf\form\IForm::readFormParameters()
+ * @see wcf\form\IForm::readFormParameters()
*/
public function readFormParameters() {
parent::readFormParameters();
}
/**
- * @see wcf\form\IForm::validate()
+ * @see wcf\form\IForm::validate()
*/
public function validate() {
parent::validate();
}
/**
- * @see wcf\form\IForm::save()
+ * @see wcf\form\IForm::save()
*/
public function save() {
parent::save();
}
/**
- * @see wcf\page\IPage::readData()
+ * @see wcf\page\IPage::readData()
*/
public function readData() {
parent::readData();
}
/**
- * @see wcf\page\IPage::assignVariables()
+ * @see wcf\page\IPage::assignVariables()
*/
public function assignVariables() {
parent::assignVariables();
* Shows the master password init form.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class MasterPasswordInitForm extends MasterPasswordForm {
/**
public $confirmMasterPassword = '';
/**
- * @see wcf\page\IPage::readParameters()
+ * @see wcf\page\IPage::readParameters()
*/
public function readParameters() {
parent::readParameters();
}
/**
- * @see wcf\form\IForm::readFormParameters()
+ * @see wcf\form\IForm::readFormParameters()
*/
public function readFormParameters() {
parent::readFormParameters();
}
/**
- * @see wcf\form\IForm::validate()
+ * @see wcf\form\IForm::validate()
*/
public function validate() {
ACPForm::validate();
}
/**
- * @see wcf\form\IForm::save()
+ * @see wcf\form\IForm::save()
*/
public function save() {
// generate salt
$salt = StringUtil::getRandomID();
-
+
// write master password file
$file = new File(WCF_DIR.'acp/masterPassword.inc.php');
$file->write("<?php
* Shows the option edit form.
*
* @author Marcel Werk
- * @copyright 2001-2009 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class OptionForm extends AbstractOptionListForm {
/**
* category option
- * @var OptionCategory
+ * @var wcf\data\option\category\OptionCategory
*/
public $category = null;
/**
* category id
- * @var integer
+ * @var integer
*/
public $categoryID = 0;
/**
* active tab menu item name
- * @var string
+ * @var string
*/
public $activeTabMenuItem = '';
/**
* the option tree
- * @var array
+ * @var array
*/
public $optionTree = array();
protected $languageItemPattern = 'wcf.acp.option.option\d+';
/**
- * @see wcf\page\IPage::readParameters()
+ * @see wcf\page\IPage::readParameters()
*/
public function readParameters() {
if (isset($_REQUEST['id'])) $this->categoryID = intval($_REQUEST['id']);
}
/**
- * @see wcf\form\IForm::readFormParameters()
+ * @see wcf\form\IForm::readFormParameters()
*/
public function readFormParameters() {
parent::readFormParameters();
}
/**
- * @see wcf\form\IForm::save()
+ * @see wcf\form\IForm::save()
*/
public function save() {
parent::save();
}
/**
- * @see wcf\page\IPage::readData()
+ * @see wcf\page\IPage::readData()
*/
public function readData() {
parent::readData();
}
/**
- * @see wcf\page\IPage::assignVariables()
+ * @see wcf\page\IPage::assignVariables()
*/
public function assignVariables() {
parent::assignVariables();
}
/**
- * @see wcf\form\IForm::show()
+ * @see wcf\form\IForm::show()
*/
public function show() {
// set active menu item
// check permission
WCF::getSession()->checkPermissions(array('admin.system.canEditOption'));
-
+
if ($this->category->categoryName == 'module') {
// check master password
WCFACP::checkMasterPassword();
/**
* Shows the option import form.
- *
+ *
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class OptionImportForm extends ACPForm {
/**
- * @see wcf\page\AbstractPage::$neededPermissions
+ * @see wcf\page\AbstractPage::$neededPermissions
*/
public $neededPermissions = array('admin.system.canEditOption');
/**
- * @see wcf\acp\form\ACPForm::$activeMenuItem
+ * @see wcf\acp\form\ACPForm::$activeMenuItem
*/
public $activeMenuItem = 'wcf.acp.menu.link.option.importAndExport';
/**
* upload file data
- * @var array
+ * @var array
*/
public $optionImport = null;
/**
* list of options
- * @var array
+ * @var array
*/
public $options = array();
}
/**
- * @see wcf\form\IForm::validate()
+ * @see wcf\form\IForm::validate()
*/
public function validate() {
parent::validate();
}
/**
- * @see wcf\form\IForm::save()
+ * @see wcf\form\IForm::save()
*/
public function save() {
parent::save();
}
/**
- * @see wcf\page\IPage::show()
+ * @see wcf\page\IPage::show()
*/
public function show() {
// check master password
* Shows the package install and update form.
*
* @author Marcel Werk
- * @copyright 2001-2009 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class PackageStartInstallForm extends ACPForm {
/**
- * @see wcf\acp\form\ACPForm::$activeMenuItem
+ * @see wcf\acp\form\ACPForm::$activeMenuItem
*/
public $activeMenuItem = 'wcf.acp.menu.link.package.install';
public $queue = null;
/**
- * @see wcf\form\IForm::readParameters()
+ * @see wcf\form\IForm::readParameters()
*/
public function readParameters() {
parent::readParameters();
}
/**
- * @see wcf\form\IForm::readFormParameters()
+ * @see wcf\form\IForm::readFormParameters()
*/
public function readFormParameters() {
parent::readFormParameters();
}
/**
- * @see wcf\form\IForm::validate()
+ * @see wcf\form\IForm::validate()
*/
public function validate() {
parent::validate();
}
/**
- * @see wcf\form\IForm::save()
+ * @see wcf\form\IForm::save()
*/
public function save() {
parent::save();
}
/**
- * @see wcf\page\IPage::assignVariables()
+ * @see wcf\page\IPage::assignVariables()
*/
public function assignVariables() {
parent::assignVariables();
}
/**
- * @see wcf\page\IPage::show()
+ * @see wcf\page\IPage::show()
*/
public function show() {
if ($this->action == 'install') WCF::getSession()->checkPermissions(array('admin.system.package.canInstallPackage'));
* Shows the package update authentification form.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class PackageUpdateAuthForm extends ACPForm {
/**
- * @see wcf\page\AbstractPage::$neededPermissions
+ * @see wcf\page\AbstractPage::$neededPermissions
*/
public $neededPermissions = array('admin.system.package.canUpdatePackage', 'admin.system.package.canInstallPackage');
/**
- * @see wcf\acp\form\ACPForm::$activeMenuItem
+ * @see wcf\acp\form\ACPForm::$activeMenuItem
*/
public $activeMenuItem = 'wcf.acp.menu.link.package';
/**
* Creates a new PackageUpdateAuthForm object.
*
- * @param PackageUpdateAuthorizationRequiredException $exception
+ * @param wcf\system\package\PackageUpdateAuthorizationRequiredException $exception
*/
public function __construct(PackageUpdateAuthorizationRequiredException $exception = null) {
$this->exception = $exception;
/**
* @todo This whole page is carzy, it's manipulating the requested page, but RequestHandler does not work this way
- * @see wcf\page\IPage::readParameters()
+ * @see wcf\page\IPage::readParameters()
*/
public function readParameters() {
parent::readParameters();
}
/**
- * @see wcf\page\IPage::readData()
+ * @see wcf\page\IPage::readData()
*/
public function readData() {
parent::readData();
}
/**
- * @see wcf\page\IPage::assignVariables()
+ * @see wcf\page\IPage::assignVariables()
*/
public function assignVariables() {
parent::assignVariables();
/**
* Shows the package update confirmation form.
- *
+ *
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class PackageUpdateForm extends ACPForm {
/**
- * @see wcf\page\AbstractPage::$neededPermissions
+ * @see wcf\page\AbstractPage::$neededPermissions
*/
public $neededPermissions = array('admin.system.package.canUpdatePackage', 'admin.system.package.canInstallPackage');
/**
- * @see wcf\acp\form\ACPForm::$activeMenuItem
+ * @see wcf\acp\form\ACPForm::$activeMenuItem
*/
public $activeMenuItem = 'wcf.acp.menu.link.package';
public $packageUpdate = null;
/**
- * @see wcf\page\IPage::readParameters()
+ * @see wcf\page\IPage::readParameters()
*/
public function readParameters() {
parent::readParameters();
}
/**
- * @see wcf\form\IForm::validate()
+ * @see wcf\form\IForm::validate()
*/
public function validate() {
parent::validate();
}
/**
- * @see wcf\form\IForm::save()
+ * @see wcf\form\IForm::save()
*/
public function save() {
if (isset($_POST['send'])) {
}
/**
- * @see wcf\page\IPage::readData()
+ * @see wcf\page\IPage::readData()
*/
public function readData() {
parent::readData();
}
/**
- * @see wcf\page\IPage::assignVariables()
+ * @see wcf\page\IPage::assignVariables()
*/
public function assignVariables() {
parent::assignVariables();
}
/**
- * @see wcf\page\IPage::assignVariables()
+ * @see wcf\page\IPage::assignVariables()
*/
public function show() {
// check master password
/**
* Shows the package update search form.
- *
+ *
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class PackageUpdateSearchForm extends ACPForm {
/**
- * @see wcf\page\AbstractPage::$neededPermissions
+ * @see wcf\page\AbstractPage::$neededPermissions
*/
public $neededPermissions = array('admin.system.package.canUpdatePackage', 'admin.system.package.canInstallPackage');
/**
- * @see wcf\acp\form\ACPForm::$activeMenuItem
+ * @see wcf\acp\form\ACPForm::$activeMenuItem
*/
public $activeMenuItem = 'wcf.acp.menu.link.package.database';
public $packageUpdateIDs = '';
/**
- * @see wcf\form\IForm::readFormParameters()
+ * @see wcf\form\IForm::readFormParameters()
*/
public function readFormParameters() {
parent::readFormParameters();
}
/**
- * @see wcf\form\IForm::validate()
+ * @see wcf\form\IForm::validate()
*/
public function validate() {
parent::validate();
$conditions->add('('.$condition.')', $parameters);
}
+
// author
if (!empty($this->author)) $conditions->add("author LIKE ?", array($this->author));
+
// ignore already installed uniques
if ($this->ignoreUniques == 1) $conditions->add("package NOT IN (SELECT package FROM wcf".WCF_N."_package WHERE isUnique = 1)");
+
// package type
if (($this->plugin == 0 || $this->isApplication == 0 || $this->other == 0) && ($this->plugin == 1 || $this->isApplication == 1 || $this->other == 1)) {
if ($this->isApplication == 1) {
}
/**
- * @see wcf\form\IForm::save()
+ * @see wcf\form\IForm::save()
*/
public function save() {
parent::save();
}
/**
- * @see wcf\page\IPage::readData()
+ * @see wcf\page\IPage::readData()
*/
public function readData() {
parent::readData();
}
/**
- * @see wcf\page\IPage::assignVariables()
+ * @see wcf\page\IPage::assignVariables()
*/
public function assignVariables() {
parent::assignVariables();
}
/**
- * @see wcf\page\IPage::assignVariables()
+ * @see wcf\page\IPage::assignVariables()
*/
public function show() {
// check master password
* Shows the server add form.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class UpdateServerAddForm extends ACPForm {
/**
- * @see wcf\acp\form\ACPForm::$activeMenuItem
+ * @see wcf\acp\form\ACPForm::$activeMenuItem
*/
public $activeMenuItem = 'wcf.acp.menu.link.package.server.add';
/**
- * @see wcf\page\AbstractPage::$neededPermissions
+ * @see wcf\page\AbstractPage::$neededPermissions
*/
public $neededPermissions = array('admin.system.package.canEditServer');
/**
* server url
- * @var string
+ * @var string
*/
public $serverURL = '';
/**
* server login username
- * @var string
+ * @var string
*/
public $loginUsername = '';
/**
* server login password
- * @var string
+ * @var string
*/
public $loginPassword = '';
/**
- * @see wcf\form\IForm::readFormParameters()
+ * @see wcf\form\IForm::readFormParameters()
*/
public function readFormParameters() {
parent::readFormParameters();
}
/**
- * @see wcf\form\IForm::validate()
+ * @see wcf\form\IForm::validate()
*/
public function validate() {
parent::validate();
}
/**
- * @see wcf\form\IForm::save()
+ * @see wcf\form\IForm::save()
*/
public function save() {
parent::save();
}
/**
- * @see wcf\page\IPage::assignVariables()
+ * @see wcf\page\IPage::assignVariables()
*/
public function assignVariables() {
parent::assignVariables();
}
/**
- * @see wcf\page\IPage::assignVariables()
+ * @see wcf\page\IPage::assignVariables()
*/
public function show() {
// check master password
/**
* Shows the server edit form.
- *
+ *
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class UpdateServerEditForm extends UpdateServerAddForm {
/**
- * @see wcf\acp\form\ACPForm::$activeMenuItem
+ * @see wcf\acp\form\ACPForm::$activeMenuItem
*/
public $activeMenuItem = 'wcf.acp.menu.link.package.server';
/**
* update server id
- * @var integer
+ * @var integer
*/
public $packageUpdateServerID = 0;
/**
* active package update server
- * @var PackageUpdateServer
+ * @var wcf\data\package\update\server\PackageUpdateServer
*/
public $updateServer = null;
/**
- * @see wcf\page\IPage::readParameters()
+ * @see wcf\page\IPage::readParameters()
*/
public function readParameters() {
parent::readParameters();
}
/**
- * @see wcf\form\IForm::save()
+ * @see wcf\form\IForm::save()
*/
public function save() {
AbstractForm::save();
}
/**
- * @see wcf\page\IPage::readData()
+ * @see wcf\page\IPage::readData()
*/
public function readData() {
parent::readData();
}
/**
- * @see wcf\page\IPage::assignVariables()
+ * @see wcf\page\IPage::assignVariables()
*/
public function assignVariables() {
parent::assignVariables();
* Shows the user add form.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class UserAddForm extends UserOptionListForm {
/**
- * @see wcf\page\AbstractPage::$neededPermissions
+ * @see wcf\page\AbstractPage::$neededPermissions
*/
public $neededPermissions = array('admin.user.canAddUser');
/**
* username
- * @var string
+ * @var string
*/
public $username = '';
/**
* email address
- * @var string
+ * @var string
*/
public $email = '';
/**
* confirmed email address
- * @var string
+ * @var string
*/
public $confirmEmail = '';
/**
* user password
- * @var string
+ * @var string
*/
public $password = '';
/**
* confirmed user password
- * @var string
+ * @var string
*/
public $confirmPassword = '';
/**
* user group ids
- * @var array<integer>
+ * @var array<integer>
*/
public $groupIDs = array();
/**
* language id
- * @var integer
+ * @var integer
*/
public $languageID = 0;
/**
* visible languages
- * @var array<integer>
+ * @var array<integer>
*/
public $visibleLanguages = array();
/**
* additional fields
- * @var array<mixed>
+ * @var array<mixed>
*/
public $additionalFields = array();
}
/**
- * @see wcf\form\IForm::readFormParameters()
+ * @see wcf\form\IForm::readFormParameters()
*/
public function readFormParameters() {
parent::readFormParameters();
}
/**
- * @see wcf\form\IForm::validate()
+ * @see wcf\form\IForm::validate()
*/
public function validate() {
// validate static user options
}
/**
- * @see wcf\form\IForm::save()
+ * @see wcf\form\IForm::save()
*/
public function save() {
AbstractForm::save();
}
/**
- * @see wcf\page\IPage::readData()
+ * @see wcf\page\IPage::readData()
*/
public function readData() {
parent::readData();
}
/**
- * @see wcf\page\IPage::assignVariables()
+ * @see wcf\page\IPage::assignVariables()
*/
public function assignVariables() {
parent::assignVariables();
}
/**
- * @see wcf\page\IPage::show()
+ * @see wcf\page\IPage::show()
*/
public function show() {
// set active menu item
* Shows the assign user to group form.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class UserAssignToGroupForm extends ACPForm {
/**
*/
public $activeMenuItem = 'wcf.acp.menu.link.user.management';
+ /**
+ * ids of the relevant users
+ * @var array<integer>
+ */
public $userIDs = array();
+
+ /**
+ * ids of the assigned user groups
+ * @var array<integer>
+ */
public $groupIDs = array();
+
+ /**
+ * relevant users
+ * @var array<wcf\data\user\User>
+ */
public $users = array();
+
+ /**
+ * assigned user groups
+ * @var array<wcf\data\user\group\UserGroup>
+ */
public $groups = array();
/**
}
/**
- * @see wcf\form\IForm::readFormParameters()
+ * @see wcf\form\IForm::readFormParameters()
*/
public function readFormParameters() {
parent::readFormParameters();
}
/**
- * @see wcf\form\IForm::validate()
+ * @see wcf\form\IForm::validate()
*/
public function validate() {
parent::validate();
}
/**
- * @see wcf\form\IForm::save()
+ * @see wcf\form\IForm::save()
*/
public function save() {
parent::save();
}
/**
- * @see wcf\page\IPage::readData()
+ * @see wcf\page\IPage::readData()
*/
public function readData() {
parent::readData();
}
/**
- * @see wcf\page\IPage::assignVariables()
+ * @see wcf\page\IPage::assignVariables()
*/
public function assignVariables() {
parent::assignVariables();
* Shows the user edit form.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class UserEditForm extends UserAddForm {
/**
- * @see wcf\acp\form\UserAddForm::$menuItemName
+ * @see wcf\acp\form\UserAddForm::$menuItemName
*/
public $menuItemName = 'wcf.acp.menu.link.user.management';
/**
- * @see wcf\page\AbstractPage::$neededPermissions
+ * @see wcf\page\AbstractPage::$neededPermissions
*/
public $neededPermissions = array('admin.user.canEditUser');
/**
* user id
- * @var integer
+ * @var integer
*/
public $userID = 0;
/**
* user editor object
- * @var UserEditor
+ * @var wcf\data\user\UserEditor
*/
public $user = null;
public $loadActiveOptions = false;
/**
- * @see wcf\page\IPage::readParameters()
+ * @see wcf\page\IPage::readParameters()
*/
public function readParameters() {
parent::readParameters();
}
/**
- * @see wcf\page\IPage::readFormParameters()
+ * @see wcf\page\IPage::readFormParameters()
*/
public function readFormParameters() {
parent::readFormParameters();
}
/**
- * @see wcf\page\IPage::readData()
+ * @see wcf\page\IPage::readData()
*/
public function readData() {
if (!count($_POST)) {
}
/**
- * @see wcf\page\IPage::assignVariables()
+ * @see wcf\page\IPage::assignVariables()
*/
public function assignVariables() {
parent::assignVariables();
}
/**
- * @see wcf\form\IForm::save()
+ * @see wcf\form\IForm::save()
*/
public function save() {
AbstractForm::save();
// reset password
$this->password = $this->confirmPassword = '';
-
+
// show success message
WCF::getTPL()->assign('success', true);
}
/**
- * @see wcf\acp\form\UserAddForm::validateUsername()
+ * @see wcf\acp\form\UserAddForm::validateUsername()
*/
protected function validateUsername($username) {
if (StringUtil::toLowerCase($this->user->username) != StringUtil::toLowerCase($username)) {
}
/**
- * @see wcf\acp\form\UserAddForm::validateEmail()
+ * @see wcf\acp\form\UserAddForm::validateEmail()
*/
protected function validateEmail($email, $confirmEmail) {
if (StringUtil::toLowerCase($this->user->email) != StringUtil::toLowerCase($email)) {
}
/**
- * @see wcf\acp\form\UserAddForm::validatePassword()
+ * @see wcf\acp\form\UserAddForm::validatePassword()
*/
protected function validatePassword($password, $confirmPassword) {
if (!empty($password) || !empty($confirmPassword)) {
/**
* Shows the export user mail addresses form.
- *
+ *
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class UserEmailAddressExportForm extends ACPForm {
+ /**
+ * @see wcf\page\AbstractPage::$activeMenuItem
+ */
public $activeMenuItem = 'wcf.acp.menu.link.user.management';
+
+ /**
+ * @see wcf\page\AbstractPage::$neededPermissions
+ */
public $neededPermissions = array('admin.user.canMailUser');
+ /**
+ * type of the file containg the exported email addresses
+ * @var string
+ */
public $fileType = 'csv';
+
+ /**
+ * ids of the users whose email addresses are exported
+ * @var array<integer>
+ */
public $userIDs = array();
+
+ /**
+ * string used to separate email adresses
+ * @var string
+ */
public $separator = ',';
+
+ /**
+ * string used to wrap email adresses
+ * @var string
+ */
public $textSeparator = '"';
+
+ /**
+ * users whose email addresses are exported
+ * @var array<wcf\data\user\User>
+ */
public $users = array();
/**
}
/**
- * @see wcf\form\IForm::readFormParameters()
+ * @see wcf\form\IForm::readFormParameters()
*/
public function readFormParameters() {
parent::readFormParameters();
}
/**
- * @see wcf\form\IForm::save()
+ * @see wcf\form\IForm::save()
*/
public function save() {
parent::save();
$i = 0;
while ($row = $statement->fetchArray()) {
- if ($this->fileType == 'xml') echo "<address><![CDATA[".StringUtil::escapeCDATA($row['email'])."]]></address>\n";
- else echo $this->textSeparator . $row['email'] . $this->textSeparator . ($i < $count['count'] ? $this->separator : '');
+ if ($this->fileType == 'xml') {
+ echo "<address><![CDATA[".StringUtil::escapeCDATA($row['email'])."]]></address>\n";
+ }
+ else {
+ echo $this->textSeparator . $row['email'] . $this->textSeparator . ($i < $count['count'] ? $this->separator : '');
+ }
$i++;
}
}
/**
- * @see wcf\page\IPage::assignVariables()
+ * @see wcf\page\IPage::assignVariables()
*/
public function assignVariables() {
parent::assignVariables();
* Shows the group add form.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class UserGroupAddForm extends AbstractOptionListForm {
/**
- * @see wcf\page\AbstractPage::$neededPermissions
+ * @see wcf\page\AbstractPage::$neededPermissions
*/
public $neededPermissions = array('admin.user.canAddGroup');
/**
* name of the active acp menu item
- * @var string
+ * @var string
*/
public $menuItemName = 'wcf.acp.menu.link.group.add';
/**
- * @see wcf\acp\form\AbstractOptionListForm::$cacheName
+ * @see wcf\acp\form\AbstractOptionListForm::$cacheName
*/
public $cacheName = 'userGroup-option';
/**
* active tab menu item name
- * @var string
+ * @var string
*/
public $activeTabMenuItem = '';
/**
* active sub tab menu item name
- * @var string
+ * @var string
*/
public $activeMenuItem = '';
/**
- * the option tree
- * @var array
+ * option tree
+ * @var array
*/
public $optionTree = array();
/**
* group name
- * @var string
+ * @var string
*/
public $groupName = '';
/**
* additional fields
- * @var array
+ * @var array
*/
public $additionalFields = array();
}
/**
- * @see wcf\form\IForm::readFormParameters()
+ * @see wcf\form\IForm::readFormParameters()
*/
public function readFormParameters() {
parent::readFormParameters();
}
/**
- * @see wcf\form\IForm::validate()
+ * @see wcf\form\IForm::validate()
*/
public function validate() {
// validate dynamic options
catch (UserInputException $e) {
$this->errorType[$e->getField()] = $e->getType();
}
-
+
if (count($this->errorType) > 0) {
throw new UserInputException('groupName', $this->errorType);
}
}
/**
- * @see wcf\form\IForm::save()
+ * @see wcf\form\IForm::save()
*/
public function save() {
parent::save();
}
/**
- * @see wcf\page\IPage::readData()
+ * @see wcf\page\IPage::readData()
*/
public function readData() {
parent::readData();
'activeMenuItem' => $this->activeMenuItem
));
}
-
+
/**
* @see wcf\form\IForm::show()
*/
* Shows the group edit form.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class UserGroupEditForm extends UserGroupAddForm {
/**
- * @see wcf\acp\form\UserGroupAddForm::$menuItemName
+ * @see wcf\acp\form\UserGroupAddForm::$menuItemName
*/
public $menuItemName = 'wcf.acp.menu.link.group';
/**
- * @see wcf\page\AbstractPage::$neededPermissions
+ * @see wcf\page\AbstractPage::$neededPermissions
*/
public $neededPermissions = array('admin.user.canEditGroup');
/**
- * group id
- * @var integer
+ * id of the edited user group
+ * @var integer
*/
public $groupID = 0;
/**
- * group editor object
- * @var GroupEditor
+ * user group editor object
+ * @var wcf\data\user\group\UserGroupEditor
*/
public $group = null;
/**
- * @see wcf\page\IPage::readParameters()
+ * @see wcf\page\IPage::readParameters()
*/
public function readParameters() {
parent::readParameters();
}
/**
- * @see wcf\page\IPage::readData()
+ * @see wcf\page\IPage::readData()
*/
public function readData() {
if (!count($_POST)) {
}
/**
- * @see wcf\page\IPage::assignVariables()
+ * @see wcf\page\IPage::assignVariables()
*/
public function assignVariables() {
parent::assignVariables();
}
/**
- * @see wcf\form\IForm::save()
+ * @see wcf\form\IForm::save()
*/
public function save() {
AbstractForm::save();
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage acp.form
- * @category Community Framework
+ * @category Community Framework
*/
class UserGroupOptionForm extends ACPForm {
/**
}
}
if (!$hasEnabledOption) return false;
-
+
// check the permission of this item for the active user
$hasPermission = true;
if ($object->permissions) {
}
}
if (!$hasPermission) return false;
-
+
return true;
}
}
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage acp.form
- * @category Community Framework
+ * @category Community Framework
*/
class UserMailForm extends ACPForm {
/**
public $userList = null;
/**
- * @see wcf\page\IPage::readParameters()
+ * @see wcf\page\IPage::readParameters()
*/
public function readParameters() {
parent::readParameters();
}
/**
- * @see wcf\form\IForm::readFormParameters()
+ * @see wcf\form\IForm::readFormParameters()
*/
public function readFormParameters() {
parent::readFormParameters();
}
/**
- * @see wcf\form\IForm::validate()
+ * @see wcf\form\IForm::validate()
*/
public function validate() {
parent::validate();
}
/**
- * @see wcf\form\IForm::save()
+ * @see wcf\form\IForm::save()
*/
public function save() {
parent::save();
}
/**
- * @see wcf\page\IPage::assignVariables()
+ * @see wcf\page\IPage::assignVariables()
*/
public function readData() {
parent::readData();
}
/**
- * @see wcf\page\IPage::assignVariables()
+ * @see wcf\page\IPage::assignVariables()
*/
public function assignVariables() {
parent::assignVariables();
* This class provides default implementations for a list of dynamic user options.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
abstract class UserOptionListForm extends AbstractOptionListForm {
/**
/**
* Shows the user search form.
- *
+ *
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class UserSearchForm extends UserOptionListForm {
/**
* active menu item name
- * @var string
+ * @var string
*/
public $menuItemName = 'wcf.acp.menu.link.user.search';
/**
- * @see wcf\page\AbstractPage::$neededPermissions
+ * @see wcf\page\AbstractPage::$neededPermissions
*/
public $neededPermissions = array('admin.user.canSearchUser');
/**
* username
- * @var string
+ * @var string
*/
public $username = '';
/**
* email address
- * @var string
+ * @var string
*/
public $email = '';
/**
* user id
- * @var integer
+ * @var integer
*/
public $userID = 0;
-
+
/**
* group ids
- * @var array<integer>
+ * @var array<integer>
*/
public $groupIDs = array();
/**
* true to invert the given group ids
- * @var boolean
+ * @var boolean
*/
public $invertGroupIDs = 0;
/**
* language ids
- * @var array<integer>
+ * @var array<integer>
*/
public $languageIDs = array();
/**
* matches
- * @var array<integer>
+ * @var array<integer>
*/
public $matches = array();
/**
* condtion builder object
- * @var wcf\system\database\condition\PreparedStatementConditionBuilder
+ * @var wcf\system\database\condition\PreparedStatementConditionBuilder
*/
public $conditions = null;
/**
* search id
- * @var integer
+ * @var integer
*/
public $searchID = 0;
/**
* sort field
- * @var string
+ * @var string
*/
public $sortField = 'username';
/**
* sort order
- * @var string
+ * @var string
*/
public $sortOrder = 'ASC';
/**
* results per page
- * @var integer
+ * @var integer
*/
public $itemsPerPage = 50;
/**
* shown columns
- * @var array<string>
+ * @var array<string>
*/
public $columns = array('email', 'registrationDate');
/**
* number of results
- * @var integer
+ * @var integer
*/
public $maxResults = 0;
public $values = array();
/**
- * @see wcf\form\IForm::readFormParameters()
+ * @see wcf\form\IForm::readFormParameters()
*/
public function readFormParameters() {
parent::readFormParameters();
}
/**
- * @see wcf\page\IPage::readData()
+ * @see wcf\page\IPage::readData()
*/
public function readData() {
$this->readOptionTree();
-
+
parent::readData();
}
}
/**
- * @see wcf\page\IPage::assignVariables()
+ * @see wcf\page\IPage::assignVariables()
*/
public function assignVariables() {
parent::assignVariables();
}
/**
- * @see wcf\form\IForm::show()
+ * @see wcf\form\IForm::show()
*/
public function show() {
// set active menu item
}
/**
- * @see wcf\form\IForm::save()
- */
+ * @see wcf\form\IForm::save()
+ */
public function save() {
parent::save();
// call buildConditions event
EventHandler::getInstance()->fireAction($this, 'buildConditions');
-
+
// do search
$statement = WCF::getDB()->prepareStatement($sql.$this->conditions, $this->maxResults);
$statement->execute($this->conditions->getParameters());
use wcf\system\WCFACP;
use wcf\util\ArrayUtil;
use wcf\util\StringUtil;
-
+
/**
* Shows the users mass processing form.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class UsersMassProcessingForm extends UserOptionListForm {
- // system
+ /**
+ * @see wcf\page\AbstractPage::$neededPermissions
+ */
public $neededPermissions = array('admin.user.canEditUser', 'admin.user.canDeleteUser', 'admin.user.canMailUser');
- // parameters
+ /**
+ * searched username
+ * @var string
+ */
public $username = '';
+
+ /**
+ * searched email adress
+ * @var string
+ */
public $email = '';
+
+ /**
+ * ids of the searched user group ids
+ * @var array<integer>
+ */
public $groupIDArray = array();
+
+ /**
+ * ids of the users' languages
+ * @var array<integer>
+ */
public $languageIDArray = array();
+
+ /**
+ * indicates if the user may not be in the user groups with the selected
+ * ids
+ * @var integer
+ */
public $invertGroupIDs = 0;
// assign to group
public $affectedUsers = 0;
/**
- * conditions builder object.
- *
+ * conditions builder object
* @var wcf\system\database\condition\PreparedStatementConditionBuilder
*/
public $conditions = null;
/**
- * Options of the active category.
- *
+ * options of the active category
* @var array
*/
public $activeOptions = array();
/**
- * @see wcf\form\IForm::readFormParameters()
+ * @see wcf\form\IForm::readFormParameters()
*/
public function readFormParameters() {
parent::readFormParameters();
}
/**
- * @see wcf\form\IForm::validate()
+ * @see wcf\form\IForm::validate()
*/
public function validate() {
AbstractForm::validate();
-
+
// action
if (!in_array($this->action, $this->availableActions)) {
throw new UserInputException('action');
}
/**
- * @see wcf\form\IForm::save()
+ * @see wcf\form\IForm::save()
*/
public function save() {
parent::save();
$value = isset($this->values[$option['optionName']]) ? $this->values[$option['optionName']] : null;
$this->getTypeObject($option['optionType'])->getCondition($this->conditions, $option, $value);
}
-
+
// call buildConditions event
EventHandler::getInstance()->fireAction($this, 'buildConditions');
$userIDArray[] = $row['userID'];
$this->affectedUsers++;
}
-
+
// save config in session
$userMailData = WCF::getSession()->getVar('userMailData');
if ($userMailData === null) $userMailData = array();
));
WCF::getTPL()->display('worker');
exit;
- break;
-
+ break;
+
case 'exportMailAddress':
WCF::getSession()->checkPermissions(array('admin.user.canMailUser'));
// send content type
}
$this->saved();
exit;
- break;
-
+ break;
+
case 'assignToGroup':
WCF::getSession()->checkPermissions(array('admin.user.canEditUser'));
});
UserStorageHandler::getInstance()->reset($userIDArray, 'groupIDs', 1);
- break;
-
+ break;
+
case 'delete':
WCF::getSession()->checkPermissions(array('admin.user.canDeleteUser'));
$userIDArray = $this->fetchUsers();
UserEditor::deleteUsers($userIDArray);
- break;
+ break;
}
$this->saved();
protected function fetchUsers($loopFunction = null) {
// select users
- $sql = "SELECT user.*
- FROM wcf".WCF_N."_user user
+ $sql = "SELECT user.*
+ FROM wcf".WCF_N."_user user
LEFT JOIN wcf".WCF_N."_user_option_value option_value
ON (option_value.userID = user.userID)
".$this->conditions;
* Shows a list of log sessions.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class ACPSessionLogListPage extends SortablePage {
/**
- * @see wcf\page\AbstractPage::$templateName
+ * @see wcf\page\AbstractPage::$templateName
*/
public $templateName = 'acpSessionLogList';
/**
- * @see wcf\page\AbstractPage::$neededPermissions
+ * @see wcf\page\AbstractPage::$neededPermissions
*/
public $neededPermissions = array('admin.system.canViewLog');
/**
- * @see wcf\page\SortablePage::$defaultSortField
+ * @see wcf\page\SortablePage::$defaultSortField
*/
public $defaultSortField = 'lastActivityTime';
/**
- * @see wcf\page\SortablePage::$defaultSortOrder
+ * @see wcf\page\SortablePage::$defaultSortOrder
*/
public $defaultSortOrder = 'DESC';
/**
- * @see wcf\page\SortablePage::$validSortFields
+ * @see wcf\page\SortablePage::$validSortFields
*/
public $validSortFields = array('sessionLogID', 'username', 'ipAddress', 'userAgent', 'time', 'lastActivityTime', 'accesses');
}
/**
- * @see wcf\page\IPage::show()
+ * @see wcf\page\IPage::show()
*/
public function show() {
// enable menu item
* Shows the details of a logged sessions.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class ACPSessionLogPage extends SortablePage {
/**
- * @see wcf\page\AbstractPage::$templateName
+ * @see wcf\page\AbstractPage::$templateName
*/
public $templateName = 'acpSessionLog';
/**
- * @see wcf\page\AbstractPage::$neededPermissions
+ * @see wcf\page\AbstractPage::$neededPermissions
*/
public $neededPermissions = array('admin.system.canViewLog');
/**
- * @see wcf\page\SortablePage::$defaultSortField
+ * @see wcf\page\SortablePage::$defaultSortField
*/
public $defaultSortField = 'time';
/**
* session log id
- * @var integer
+ * @var integer
*/
public $sessionLogID = 0;
/**
* session log object
- * @var wcf\data\acp\session\log\ACPSessionLog
+ * @var wcf\data\acp\session\log\ACPSessionLog
*/
public $sessionLog = null;
}
/**
- * @see wcf\page\IPage::assignVariables()
+ * @see wcf\page\IPage::assignVariables()
*/
public function assignVariables() {
parent::assignVariables();
}
/**
- * @see wcf\page\IPage::show()
+ * @see wcf\page\IPage::show()
*/
public function show() {
// enable menu item
* Shows a list of all cache resources.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class CacheListPage extends AbstractPage {
/**
- * @see wcf\page\AbstractPage::$neededPermissions
+ * @see wcf\page\AbstractPage::$neededPermissions
*/
public $neededPermissions = array('admin.system.canViewLog');
/**
* contains general cache information
- * @var array
+ * @var array
*/
public $cacheData = array();
/**
- * @see wcf\page\IPage::readParameters()
+ * @see wcf\page\IPage::readParameters()
*/
public function readParameters() {
parent::readParameters();
}
/**
- * @see wcf\page\IPage::readData()
+ * @see wcf\page\IPage::readData()
*/
public function readData() {
parent::readData();
".$conditions;
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditions->getParameters());
-
+
$packageNames = array();
while ($row = $statement->fetchArray()) {
$packagePath = FileUtil::getRealPath(WCF_DIR.$row['packageDir']).'cache/';
}
/**
- * @see wcf\page\IPage::assignVariables()
+ * @see wcf\page\IPage::assignVariables()
*/
public function assignVariables() {
parent::assignVariables();
}
/**
- * @see wcf\page\IPage::show()
+ * @see wcf\page\IPage::show()
*/
public function show() {
// enable menu item
* Shows information about configured cron jobs.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class CronjobListPage extends SortablePage {
/**
- * @see wcf\page\AbstractPage::$neededPermissions
+ * @see wcf\page\AbstractPage::$neededPermissions
*/
public $neededPermissions = array('admin.system.cronjob.canEditCronjob', 'admin.system.cronjob.canDeleteCronjob', 'admin.system.cronjob.canEnableDisableCronjob');
/**
- * @see wcf\page\SortablePage::$defaultSortField
+ * @see wcf\page\SortablePage::$defaultSortField
*/
public $defaultSortField = 'description';
/**
- * @see wcf\page\SortablePage::$validSortFields
+ * @see wcf\page\SortablePage::$validSortFields
*/
public $validSortFields = array('description', 'cronjobID', 'nextExec', 'startMinute', 'startHour', 'startDom', 'startMonth', 'startDow');
}
/**
- * @see wcf\page\IPage::show()
+ * @see wcf\page\IPage::show()
*/
public function show() {
// set active menu item.
* Shows cronjob log information.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class CronjobLogListPage extends SortablePage {
/**
- * @see wcf\page\AbstractPage::$neededPermissions
+ * @see wcf\page\AbstractPage::$neededPermissions
*/
public $neededPermissions = array('admin.system.cronjob.canEditCronjob');
/**
- * @see wcf\page\MultipleLinkPage::$itemsPerPage
+ * @see wcf\page\MultipleLinkPage::$itemsPerPage
*/
public $itemsPerPage = 100;
/**
- * @see wcf\page\SortablePage::$defaultSortField
+ * @see wcf\page\SortablePage::$defaultSortField
*/
public $defaultSortField = 'execTime';
/**
- * @see wcf\page\SortablePage::$defaultSortOrder
+ * @see wcf\page\SortablePage::$defaultSortOrder
*/
public $defaultSortOrder = 'DESC';
-
+
/**
- * @see wcf\page\SortablePage::$validSortFields
+ * @see wcf\page\SortablePage::$validSortFields
*/
public $validSortFields = array('cronjobID', 'className', 'description', 'execTime', 'success');
/**
* Shows the welcome page in admin control panel.
- *
+ *
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class IndexPage extends AbstractPage {
/**
- * Did you know language item.
- *
- * @var string
+ * did you know language item
+ * @var string
*/
public $didYouKnow = '';
/**
- * Detailed Health-Status
- *
+ * health status data
* @var array
*/
public $healthDetails = array('error' => array(), 'warning' => array(), 'info' => array());
/**
- * @see wcf\page\IPage::assignVariables()
+ * @see wcf\page\IPage::assignVariables()
*/
public function assignVariables() {
parent::assignVariables();
}
/**
- * @see wcf\page\IPage::readData()
+ * @see wcf\page\IPage::readData()
*/
public function readData() {
parent::readData();
}
/**
- * @see wcf\page\IPage::show()
+ * @see wcf\page\IPage::show()
*/
public function show() {
$wcfPackageID = WCFACP::getWcfPackageID();
* Shows the list of available updates for installed packages.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class PackageAutoUpdateListPage extends AbstractPage {
/**
- * @see wcf\page\AbstractPage::$neededPermissions
+ * @see wcf\page\AbstractPage::$neededPermissions
*/
public $neededPermissions = array('admin.system.package.canUpdatePackage');
public $availableUpdates = array();
/**
- * @see wcf\page\IPage::assignVariables()
+ * @see wcf\page\IPage::assignVariables()
*/
public function readParameters() {
parent::readParameters();
}
/**
- * @see wcf\page\IPage::assignVariables()
+ * @see wcf\page\IPage::assignVariables()
*/
public function assignVariables() {
parent::assignVariables();
}
/**
- * @see wcf\page\IPage::show()
+ * @see wcf\page\IPage::show()
*/
public function show() {
// set active menu item
* Shows a list of all installed packages.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class PackageListDetailedPage extends SortablePage {
/**
- * @see wcf\page\AbstractPage::$neededPermissions
+ * @see wcf\page\AbstractPage::$neededPermissions
*/
public $neededPermissions = array('admin.system.package.canUpdatePackage', 'admin.system.package.canUninstallPackage');
/**
- * @see wcf\page\MultipleLinkPage::$itemsPerPage
+ * @see wcf\page\MultipleLinkPage::$itemsPerPage
*/
public $itemsPerPage = 50;
/**
- * @see wcf\page\SortablePage::$defaultSortField
+ * @see wcf\page\SortablePage::$defaultSortField
*/
public $defaultSortField = 'packageType';
/**
- * @see wcf\page\SortablePage::$defaultSortOrder
+ * @see wcf\page\SortablePage::$defaultSortOrder
*/
public $defaultSortOrder = 'DESC';
/**
- * @see wcf\page\SortablePage::$validSortFields
+ * @see wcf\page\SortablePage::$validSortFields
*/
public $validSortFields = array('packageID', 'package', 'packageDir', 'packageName', 'instanceNo', 'packageDescription', 'packageDate', 'packageURL', 'parentPackageID', 'isUnique', 'isApplication', 'author', 'authorURL', 'installDate', 'updateDate');
/**
* @see wcf\page\MultipleLinkPage::$objectListClassName
- */
+ */
public $objectListClassName = 'wcf\data\package\PackageList';
/**
* @see wcf\page\MultipleLinkPage::readObjects()
- */
+ */
protected function readObjects() {
$this->sqlOrderBy = 'package.'.($this->sortField == 'packageType' ? 'isApplication '.$this->sortOrder.', package.parentPackageID '.$this->sortOrder : $this->sortField.' '.$this->sortOrder).($this->sortField != 'packageName' ? ', package.packageName ASC' : '');
}
/**
- * @see wcf\page\IPage::show()
+ * @see wcf\page\IPage::show()
*/
public function show() {
// enable menu item
* Shows a list of installed packages and plugins.
*
* @author Alexander Ebert
- * @copyright 2001-2009 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class PackageListPage extends AbstractPage {
/**
}
/**
- * @see wcf\page\IPage::show()
+ * @see wcf\page\IPage::show()
*/
public function show() {
// use detailed view if accessing WCF ACP directly
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage acp.page
- * @category Community Framework
+ * @category Community Framework
*/
class PackagePage extends AbstractPage {
/**
public $queueID = 0;
/**
- * @see wcf\page\IPage::readParameters()
+ * @see wcf\page\IPage::readParameters()
*/
public function readParameters() {
parent::readParameters();
}
/**
- * @see wcf\page\IPage::show()
+ * @see wcf\page\IPage::show()
*/
public function show() {
parent::show();
-
+
// check master password
WCFACP::checkMasterPassword();
* Shows the list of package update search results.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class PackageUpdateSearchResultPage extends SortablePage {
/**
- * @see wcf\page\AbstractPage::$neededPermissions
+ * @see wcf\page\AbstractPage::$neededPermissions
*/
public $neededPermissions = array('admin.system.package.canUpdatePackage', 'admin.system.package.canInstallPackage');
/**
- * @see wcf\page\SortablePage::$defaultSortField
+ * @see wcf\page\SortablePage::$defaultSortField
*/
public $defaultSortField = 'packageName';
/**
- * @see wcf\page\SortablePage::$validSortFields
+ * @see wcf\page\SortablePage::$validSortFields
*/
public $validSortFields = array('package', 'packageName', 'author');
* @var wcf\data\search\Search
*/
public $search = null;
-
+
/**
* list with data of package updates
* @var array
public $packages = array();
/**
- * @see wcf\page\IPage::readParameters()
+ * @see wcf\page\IPage::readParameters()
*/
public function readParameters() {
parent::readParameters();
}
/**
- * @see wcf\page\IPage::readData()
+ * @see wcf\page\IPage::readData()
*/
public function readData() {
parent::readData();
}
/**
- * @see wcf\page\MultipleLinkPage::countItems()
+ * @see wcf\page\MultipleLinkPage::countItems()
*/
public function countItems() {
$conditions = new PreparedStatementConditionBuilder();
* Shows all information about an installed package.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class PackageViewPage extends AbstractPage {
/**
- * @see wcf\page\AbstractPage::$neededPermissions
+ * @see wcf\page\AbstractPage::$neededPermissions
*/
public $neededPermissions = array('admin.system.package.canUpdatePackage', 'admin.system.package.canUninstallPackage');
/**
* package object
- * @var Package
+ * @var wcf\data\package\Package
*/
public $package = null;
/**
- * @see wcf\page\IPage::readParameters()
+ * @see wcf\page\IPage::readParameters()
*/
public function readParameters() {
parent::readParameters();
}
/**
- * @see wcf\page\IPage::assignVariables()
+ * @see wcf\page\IPage::assignVariables()
*/
public function assignVariables() {
parent::assignVariables();
}
/**
- * @see wcf\page\IPage::show()
+ * @see wcf\page\IPage::show()
*/
public function show() {
// enable menu item
* Shows information about available update package servers.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class UpdateServerListPage extends SortablePage {
/**
- * @see wcf\page\AbstractPage::$neededPermissions
+ * @see wcf\page\AbstractPage::$neededPermissions
*/
public $neededPermissions = array('admin.system.package.canEditServer');
/**
- * @see wcf\page\SortablePage::$defaultSortField
+ * @see wcf\page\SortablePage::$defaultSortField
*/
public $defaultSortField = 'serverURL';
/**
- * @see wcf\page\SortablePage::$validSortFields
+ * @see wcf\page\SortablePage::$validSortFields
*/
public $validSortFields = array('packageUpdateServerID', 'serverURL', 'status', 'errorMessage', 'lastUpdateTime', 'packages');
public $deletedPackageUpdateServerID = 0;
/**
- * @see wcf\page\IPage::readParameters()
+ * @see wcf\page\IPage::readParameters()
*/
public function readParameters() {
parent::readParameters();
}
/**
- * @see wcf\page\IPage::assignVariables()
+ * @see wcf\page\IPage::assignVariables()
*/
public function assignVariables() {
parent::assignVariables();
}
/**
- * @see wcf\page\IPage::show()
+ * @see wcf\page\IPage::show()
*/
public function show() {
// enable menu item
* Shows a list of all user groups.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class UserGroupListPage extends SortablePage {
/**
- * @see wcf\page\AbstractPage::$neededPermissions
+ * @see wcf\page\AbstractPage::$neededPermissions
*/
public $neededPermissions = array('admin.user.canEditGroup', 'admin.user.canDeleteGroup');
/**
- * @see wcf\page\SortablePage::$defaultSortField
+ * @see wcf\page\SortablePage::$defaultSortField
*/
public $defaultSortField = 'groupName';
/**
- * @see wcf\page\SortablePage::$validSortFields
+ * @see wcf\page\SortablePage::$validSortFields
*/
public $validSortFields = array('groupID', 'groupName', 'groupType', 'members');
public $deletedGroups = 0;
/**
- * @see wcf\page\IPage::readParameters()
+ * @see wcf\page\IPage::readParameters()
*/
public function readParameters() {
parent::readParameters();
}
/**
- * @see wcf\page\IPage::assignVariables()
+ * @see wcf\page\IPage::assignVariables()
*/
public function assignVariables() {
parent::assignVariables();
}
/**
- * @see wcf\page\IPage::show()
+ * @see wcf\page\IPage::show()
*/
public function show() {
// enable menu item
* Shows the result of a user search.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class UserListPage extends SortablePage {
/**
- * @see wcf\page\AbstractPage::$neededPermissions
+ * @see wcf\page\AbstractPage::$neededPermissions
*/
public $neededPermissions = array('admin.user.canSearchUser');
/**
- * @see wcf\page\MultipleLinkPage::$itemsPerPage
+ * @see wcf\page\MultipleLinkPage::$itemsPerPage
*/
public $itemsPerPage = 50;
/**
- * @see wcf\page\SortablePage::$defaultSortField
+ * @see wcf\page\SortablePage::$defaultSortField
*/
public $defaultSortField = 'username';
/**
- * @see wcf\page\SortablePage::$validSortFields
+ * @see wcf\page\SortablePage::$validSortFields
*/
public $validSortFields = array('email', 'userID', 'registrationDate', 'username');
public $searchID = 0;
// data
+ // @todo: comment properties
public $userIDs = array();
public $markedUsers = array();
public $users = array();
protected $optionHandler = null;
/**
- * @see wcf\page\IPage::readParameters()
+ * @see wcf\page\IPage::readParameters()
*/
public function readParameters() {
parent::readParameters();
}
/**
- * @see wcf\page\SortablePage::validateSortField()
+ * @see wcf\page\SortablePage::validateSortField()
*/
public function validateSortField() {
// add options to valid sort fields
}
/**
- * @see wcf\page\IPage::readData()
+ * @see wcf\page\IPage::readData()
*/
public function readData() {
parent::readData();
}
/**
- * @see wcf\page\IPage::assignVariables()
+ * @see wcf\page\IPage::assignVariables()
*/
public function assignVariables() {
parent::assignVariables();
}
/**
- * @see wcf\page\IPage::show()
+ * @see wcf\page\IPage::show()
*/
public function show() {
// set active menu item
}
/**
- * @see wcf\page\MultipleLinkPage::countItems()
+ * @see wcf\page\MultipleLinkPage::countItems()
*/
public function countItems() {
// call countItems event
EventHandler::getInstance()->fireAction($this, 'countItems');
-
+
$sql = "SELECT COUNT(*) AS count
FROM wcf".WCF_N."_user user_table
".$this->conditions;
* Default implementation for object-actions using the AJAX-API.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage action
- * @category Community Framework
+ * @category Community Framework
*/
class AJAXProxyAction extends AbstractSecureAction {
/**
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage action
- * @category Community Framework
+ * @category Community Framework
*/
class AJAXUploadAction extends AJAXProxyAction {
/**
* This includes the call of the default event listeners for an action: readParameters and execute.
*
* @author Marcel Werk
- * @copyright 2001-2009 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage action
- * @category Community Framework
+ * @category Community Framework
*/
abstract class AbstractAction implements IAction {
/**
}
/**
- * @see wcf\action\IAction::readParameters()
+ * @see wcf\action\IAction::readParameters()
*/
public function readParameters() {
// call readParameters event
}
/**
- * @see wcf\action\IAction::execute()
+ * @see wcf\action\IAction::execute()
*/
public function execute() {
// check if active user is logged in
* Provides method to send JSON-encoded responses.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage action
- * @category Community Framework
+ * @category Community Framework
*/
class AbstractAjaxAction extends AbstractAction {
/**
* Abstract implementation of an action that displays a dialog and that is executed
* in multiple steps.
*
+ * @todo add class author
+ *
* @author
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage action
- * @category Community Framework
+ * @category Community Framework
*/
abstract class AbstractDialogAction extends AbstractSecureAction {
/**
/**
* Validates current dialog step.
*/
- protected abstract function validateStep();
+ abstract protected function validateStep();
}
* A missing or invalid token will be result in a throw of a IllegalLinkException.
*
* @author Marcel Werk
- * @copyright 2001-2009 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage action
- * @category Community Framework
+ * @category Community Framework
*/
abstract class AbstractSecureAction extends AbstractAction {
/**
- * @see wcf\action\IAction::readParameters()
+ * @see wcf\action\IAction::readParameters()
*/
public function readParameters() {
parent::readParameters();
* Handles clipboard items.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage action
- * @category Community Framework
+ * @category Community Framework
*/
class ClipboardAction extends AbstractSecureAction {
/**
* Handles marked clipboard items once DOM is loaded.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage action
- * @category Community Framework
+ * @category Community Framework
*/
class ClipboardLoadMarkedItemsAction extends ClipboardAction {
/**
* Clipboard proxy implementation.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage action
- * @category Community Framework
+ * @category Community Framework
*/
class ClipboardProxyAction extends AbstractSecureAction {
/**
* An action executes a user input without showing a result page or a form.
*
* @author Marcel Werk
- * @copyright 2001-2009 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage action
- * @category Community Framework
+ * @category Community Framework
*/
interface IAction {
/**
/**
* Default implementation for DatabaseObject-related actions.
- *
+ *
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data
- * @category Community Framework
+ * @category Community Framework
*/
abstract class AbstractDatabaseObjectAction implements IDatabaseObjectAction {
/**
protected $returnValues = null;
/**
- * allows guest access for all specified methods, by default
- * guest access is completely disabled
+ * allows guest access for all specified methods, by default guest access
+ * is completely disabled
* @var array<string>
*/
protected $allowGuestAccess = array();
/**
* Initialize a new DatabaseObject-related action.
- *
+ *
* @param array<mixed> $objects
* @param string $action
* @param array $parameters
* Abstract class for all data holder classes.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data
- * @category Community Framework
+ * @category Community Framework
*/
abstract class DatabaseObject implements IStorableObject {
/**
/**
* Creates a new instance of the DatabaseObject class.
- *
+ *
* @param mixed $id
* @param array $row
* @param wcf\data\DatabaseObject $object
if (!empty(static::$databaseTableName)) {
static::$databaseTableName .= '_';
}
-
+
static::$databaseTableName .= strtolower($part);
}
}
/**
* @see wcf\data\IStorableObject::getDatabaseTableIndexIsIdentity()
- */
+ */
public static function getDatabaseTableIndexIsIdentity() {
return static::$databaseTableIndexIsIdentity;
}
public static function getDatabaseTableIndexName() {
return static::$databaseTableIndexName;
}
-
+
/**
* Sorts a list of database objects.
- *
+ *
* @param array<wcf\data\DatabaseObject> $objects
* @param mixed $sortBy
* @param string $sortOrder
$objects2[$idx.'x'] = $obj;
}
}
-
+
if ($maintainIndexAssociation) {
$objects = array();
array_multisort($sortArray, $sortOrder == 'ASC' ? SORT_ASC : SORT_DESC, $objects2);
-
+
$objects = array();
foreach ($objects2 as $idx => $obj) {
$objects[substr($idx, 0, -1)] = $obj;
}
- } else {
+ }
+ else {
array_multisort($sortArray, $sortOrder == 'ASC' ? SORT_ASC : SORT_DESC, $objects);
}
}
* Basic implementation for object decorators.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data
- * @category Community Framework
+ * @category Community Framework
*/
abstract class DatabaseObjectDecorator extends DatabaseObject {
/**
/**
* Basic implementation for object editors following the decorator pattern.
- *
+ *
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data
- * @category Community Framework
+ * @category Community Framework
*/
abstract class DatabaseObjectEditor extends DatabaseObjectDecorator implements IEditableObject {
/**
- * @see wcf\data\IEditableObject::create()
+ * @see wcf\data\IEditableObject::create()
*/
public static function create(array $parameters = array()) {
$keys = $values = '';
}
/**
- * @see wcf\data\IEditableObject::update()
+ * @see wcf\data\IEditableObject::update()
*/
public function update(array $parameters = array()) {
if (!count($parameters)) return;
}
/**
- * @see wcf\data\IEditableObject::updateCounters()
+ * @see wcf\data\IEditableObject::updateCounters()
*/
public function updateCounters(array $counters = array()) {
if (!count($counters)) return;
}
/**
- * @see wcf\data\IEditableObject::delete()
+ * @see wcf\data\IEditableObject::delete()
*/
public function delete() {
static::deleteAll(array($this->__get(static::getDatabaseTableIndexName())));
}
/**
- * @see wcf\data\IEditableObject::deleteAll()
+ * @see wcf\data\IEditableObject::deleteAll()
*/
public static function deleteAll(array $objectIDs = array()) {
$sql = "DELETE FROM ".static::getDatabaseTableName()."
/**
* Abstract class for a list of database objects.
- *
+ *
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data
- * @category Community Framework
+ * @category Community Framework
*/
abstract class DatabaseObjectList implements \Countable, ITraversableObject {
/**
/**
* enables the automatic usage of the qualified shorthand
- * @var boolean
+ * @var boolean
*/
public $useQualifiedShorthand = true;
$this->objects = $statement->fetchObjects(($this->objectClassName ?: $this->className));
}
else {
- //if (!empty($this->sqlSelects)) die("x".$this->sqlSelects);
$sql = "SELECT ".(!empty($this->sqlSelects) ? $this->sqlSelects.($this->useQualifiedShorthand ? ',' : '') : '')."
".($this->useQualifiedShorthand ? $this->getDatabaseTableAlias().'.*' : '')."
FROM ".$this->getDatabaseTableName()." ".$this->getDatabaseTableAlias()."
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data
- * @category Community Framework
+ * @category Community Framework
*/
interface ICategorizedObject {
/**
* Default interface for DatabaseObject-related actions.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data
- * @category Community Framework
+ * @category Community Framework
*/
interface IDatabaseObjectAction {
/**
/**
* Default interface for DatabaseObject processors.
- *
+ *
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data
- * @category Community Framework
+ * @category Community Framework
*/
interface IDatabaseObjectProcessor {
/**
/**
* Abstract class for all cached data holder objects.
- *
+ *
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data
- * @category Community Framework
+ * @category Community Framework
*/
interface IEditableCachedObject extends IEditableObject {
/**
/**
* Abstract class for all data holder classes.
- *
+ *
* @author Marcel Werk
- * @copyright 2001-2010 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data
- * @category Community Framework
+ * @category Community Framework
*/
interface IEditableObject extends IStorableObject {
/**
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data
- * @category Community Framework
+ * @category Community Framework
*/
interface ILinkableDatabaseObject {
/**
/**
* Abstract class for all data holder classes.
- *
+ *
* @author Marcel Werk
- * @copyright 2001-2010 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data
- * @category Community Framework
+ * @category Community Framework
*/
interface IStorableObject {
/**
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data
- * @category Community Framework
+ * @category Community Framework
*/
interface ITitledDatabaseObject {
/**
/**
* Interface for enhanced iteration support.
- *
+ *
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data
- * @category Community Framework
+ * @category Community Framework
*/
interface ITraversableObject extends \SeekableIterator {
/**
/**
* Abstract class for all processible data holder classes.
- *
+ *
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data
- * @category Community Framework
+ * @category Community Framework
*/
class ProcessibleDatabaseObject extends DatabaseObject {
/**
* Represents an ACP menu item.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.acp.menu.item
- * @category Community Framework
+ * @category Community Framework
*/
class ACPMenuItem extends DatabaseObject implements ITreeMenuItem {
/**
protected static $databaseTableIndexName = 'menuItemID';
/**
- * @see wcf\system\menu\ITreeMenuItem::getLink()
+ * @see wcf\system\menu\ITreeMenuItem::getLink()
*/
public function getLink() {
return LinkHandler::getInstance()->getLink(null, array(), $this->menuItemLink);
* Executes ACP menu item-related actions.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.acp.menu.item
- * @category Community Framework
+ * @category Community Framework
*/
class ACPMenuItemAction extends AbstractDatabaseObjectAction {
/**
- * @see wcf\data\AbstractDatabaseObjectAction::$className
+ * @see wcf\data\AbstractDatabaseObjectAction::$className
*/
protected $className = 'wcf\data\acp\menu\item\ACPMenuItemEditor';
}
* Provides functions to edit ACP menu items.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.acp.menu.item
- * @category Community Framework
+ * @category Community Framework
*/
class ACPMenuItemEditor extends DatabaseObjectEditor {
/**
/**
* Represents a list of ACP menu items.
*
- * @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Alexander Ebert
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.acp.menu.item
- * @category Community Framework
+ * @category Community Framework
*/
class ACPMenuItemList extends DatabaseObjectList {
/**
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.acp.search.provider
- * @category Community Framework
+ * @category Community Framework
*/
class ACPSearchProvider extends DatabaseObject {
/**
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.acp.search.provider
- * @category Community Framework
+ * @category Community Framework
*/
class ACPSearchProviderAction extends AbstractDatabaseObjectAction {
+ /**
+ * Validates the 'getList' action.
+ */
public function validateGetList() {
$this->parameters['data']['searchString'] = (isset($this->parameters['data']['searchString'])) ? StringUtil::trim($this->parameters['data']['searchString']) : '';
if (empty($this->parameters['data']['searchString'])) {
}
}
+ /**
+ * Returns the data of the searched acp elements.
+ *
+ * @return array
+ */
public function getList() {
$data = array();
$results = ACPSearchHandler::getInstance()->search($this->parameters['data']['searchString']);
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.acp.search.provider
- * @category Community Framework
+ * @category Community Framework
*/
class ACPSearchProviderEditor extends DatabaseObjectEditor {
/**
/**
* Represents a list of ACP search providers.
*
- * @author Alexander Ebert
+ * @author Alexander Ebert
* @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.acp.search.provider
- * @category Community Framework
+ * @category Community Framework
*/
class ACPSearchProviderList extends DatabaseObjectList { }
* Represents an ACP session.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.acp.session
- * @category Community Framework
+ * @category Community Framework
*/
class ACPSession extends DatabaseObject {
/**
* Executes ACP session-related actions.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.acp.session
- * @category Community Framework
+ * @category Community Framework
*/
class ACPSessionAction extends AbstractDatabaseObjectAction {
/**
- * @see wcf\data\AbstractDatabaseObjectAction::$className
+ * @see wcf\data\AbstractDatabaseObjectAction::$className
*/
protected $className = 'wcf\data\acp\session\ACPSessionEditor';
}
* Provides functions to edit ACP sessions.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.acp.session
- * @category Community Framework
+ * @category Community Framework
*/
class ACPSessionEditor extends DatabaseObjectEditor {
/**
/**
* Represents a list of ACP sessions.
*
- * @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Alexander Ebert
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.acp.session
- * @category Community Framework
+ * @category Community Framework
*/
class ACPSessionList extends DatabaseObjectList {
/**
* Represents a session access log entry.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.acp.session.access.log
- * @category Community Framework
+ * @category Community Framework
*/
class ACPSessionAccessLog extends DatabaseObject {
/**
/**
* Returns true, if the URI of this log entry is protected.
*
- * @return boolean
+ * @return boolean
*/
public function hasProtectedURI() {
if ($this->requestMethod != 'GET' || !preg_match('/(\?|&)(page|form)=/', $this->requestURI)) {
* Executes ACP session access log-related actions.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.acp.session.access.log
- * @category Community Framework
+ * @category Community Framework
*/
class ACPSessionAccessLogAction extends AbstractDatabaseObjectAction {
/**
- * @see wcf\data\AbstractDatabaseObjectAction::$className
+ * @see wcf\data\AbstractDatabaseObjectAction::$className
*/
protected $className = 'wcf\data\acp\session\access\log\ACPSessionAccessLogEditor';
}
* Provides functions to edit ACP session access logs.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.acp.session.access.log
- * @category Community Framework
+ * @category Community Framework
*/
class ACPSessionAccessLogEditor extends DatabaseObjectEditor {
/**
* Represents a list of access logs.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.acp.session.access.log
- * @category Community Framework
+ * @category Community Framework
*/
class ACPSessionAccessLogList extends DatabaseObjectList {
/**
public $className = 'wcf\data\acp\session\access\log\ACPSessionAccessLog';
/**
- * @see wcf\data\DatabaseObjectList::readObjects()
+ * @see wcf\data\DatabaseObjectList::readObjects()
*/
public function readObjects() {
if (!empty($this->sqlSelects)) $this->sqlSelects .= ',';
* Represents a session log entry.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.log
- * @category Community Framework
+ * @category Community Framework
*/
class ACPSessionLog extends DatabaseObject {
/**
* Executes ACP session log-related actions.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.acp.session.log
- * @category Community Framework
+ * @category Community Framework
*/
class ACPSessionLogAction extends AbstractDatabaseObjectAction {
/**
- * @see wcf\data\AbstractDatabaseObjectAction::$className
+ * @see wcf\data\AbstractDatabaseObjectAction::$className
*/
protected $className = 'wcf\data\acp\session\log\ACPSessionLogEditor';
}
* Provides functions to edit ACP session logs.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.acp.session.log
- * @category Community Framework
+ * @category Community Framework
*/
class ACPSessionLogEditor extends DatabaseObjectEditor {
/**
* Represents a list of session log entries.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.acp.session.log
- * @category Community Framework
+ * @category Community Framework
*/
class ACPSessionLogList extends DatabaseObjectList {
/**
public $className = 'wcf\data\acp\session\log\ACPSessionLog';
/**
- * @see wcf\data\DatabaseObjectList::readObjects()
+ * @see wcf\data\DatabaseObjectList::readObjects()
*/
public function readObjects() {
if (!empty($this->sqlSelects)) $this->sqlSelects .= ',';
* Represents an ACP template.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.acp.template
- * @category Community Framework
+ * @category Community Framework
*/
class ACPTemplate extends DatabaseObject {
/**
* Executes ACP templates-related actions.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.acp.template
- * @category Community Framework
+ * @category Community Framework
*/
class ACPTemplateAction extends AbstractDatabaseObjectAction {
/**
- * @see wcf\data\AbstractDatabaseObjectAction::$className
+ * @see wcf\data\AbstractDatabaseObjectAction::$className
*/
protected $className = 'wcf\data\acp\template\ACPTemplateEditor';
* Provides functions to edit ACP templates.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.acp.template
- * @category Community Framework
+ * @category Community Framework
*/
class ACPTemplateEditor extends DatabaseObjectEditor {
/**
/**
* Represents a list of ACP templates.
*
- * @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Alexander Ebert
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.acp.template
- * @category Community Framework
+ * @category Community Framework
*/
class ACPTemplateList extends DatabaseObjectList {
/**
* Represents an application.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.application
- * @category Community Framework
+ * @category Community Framework
*/
class Application extends DatabaseObject {
/**
* Executes application-related actions.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.application
- * @category Community Framework
+ * @category Community Framework
*/
class ApplicationAction extends AbstractDatabaseObjectAction {
/**
* Provides functions to edit applications.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.application
- * @category Community Framework
+ * @category Community Framework
*/
class ApplicationEditor extends DatabaseObjectEditor {
/**
/**
* Represents a list of applications.
*
- * @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Alexander Ebert
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.application
- * @category Community Framework
+ * @category Community Framework
*/
class ApplicationList extends DatabaseObjectList {
/**
* Represents an application group.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.application.group
- * @category Community Framework
+ * @category Community Framework
*/
class ApplicationGroup extends DatabaseObject {
/**
* Executes application group-related actions.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.application.group
- * @category Community Framework
+ * @category Community Framework
*/
class ApplicationGroupAction extends AbstractDatabaseObjectAction {
/**
- * @see wcf\data\AbstractDatabaseObjectAction::$className
+ * @see wcf\data\AbstractDatabaseObjectAction::$className
*/
protected $className = 'wcf\data\application\group\ApplicationGroupEditor';
}
* Provides functions to edit application groups.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.application.group
- * @category Community Framework
+ * @category Community Framework
*/
class ApplicationGroupEditor extends DatabaseObjectEditor {
/**
/**
* Represents a list of application groups.
*
- * @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Alexander Ebert
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.application.group
- * @category Community Framework
+ * @category Community Framework
*/
class ApplicationGroupList extends DatabaseObjectList {
/**
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.category
- * @category Community Framework
+ * @category Community Framework
*/
class Category extends DatabaseObject implements IRouteController {
/**
while ($parentCaregory = $parentCaregory->getParentCategory()) {
$this->parentCategories[] = $parentCaregory;
}
-
+
$this->parentCategories = array_reverse($this->parentCategories);
}
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.category
- * @category Community Framework
+ * @category Community Framework
*/
class CategoryAction extends AbstractDatabaseObjectAction {
/**
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.category
- * @category Community Framework
+ * @category Community Framework
*/
class CategoryEditor extends DatabaseObjectEditor implements IEditableCachedObject {
/**
protected static $baseClass = 'wcf\data\category\Category';
/**
- * @see wcf\data\IEditableObject::update()
+ * @see wcf\data\IEditableObject::update()
*/
public function update(array $parameters = array()) {
// update show order
if ($showOrder > $maxShowOrder) {
$showOrder = $maxShowOrder;
}
-
+
$sql = "UPDATE ".static::getDatabaseTableName()."
SET showOrder = showOrder - 1
WHERE showOrder <= ?
}
/**
- * @see wcf\data\IEditableObject::create()
+ * @see wcf\data\IEditableObject::create()
*/
public static function create(array $parameters = array()) {
// handle time
}
/**
- * @see wcf\data\IEditableObject::deleteAll()
+ * @see wcf\data\IEditableObject::deleteAll()
*/
public static function deleteAll(array $objectIDs = array()) {
// update positions
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.category
- * @category Community Framework
+ * @category Community Framework
*/
class CategoryList extends DatabaseObjectList { }
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.category
- * @category Community Framework
+ * @category Community Framework
*/
class CategoryNode extends DatabaseObjectDecorator implements \RecursiveIterator, \Countable {
/**
/**
* Represents a category node list.
- *
+ *
* @author Matthias Schmidt
* @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.category
- * @category Community Framework
+ * @category Community Framework
*/
class CategoryNodeList extends \RecursiveIteratorIterator implements \Countable {
/**
* Represents a cleanup listener.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.cleanup.listener
- * @category Community Framework
+ * @category Community Framework
*/
class CleanupListener extends DatabaseObject {
/**
* Executes cleanup listener-related actions.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.cleanup.listener
- * @category Community Framework
+ * @category Community Framework
*/
class CleanupListenerAction extends AbstractDatabaseObjectAction {
/**
* Provides functions to edit cleanup listeners.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.cleanup.listener
- * @category Community Framework
+ * @category Community Framework
*/
class CleanupListenerEditor extends DatabaseObjectEditor {
/**
/**
* Represents a list of cleanup listener.
*
- * @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Alexander Ebert
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.cleanup.listener
- * @category Community Framework
+ * @category Community Framework
*/
class CleanupListenerList extends DatabaseObjectList {
/**
* Represents a clipboard action.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.clipboard.action
- * @category Community Framework
+ * @category Community Framework
*/
class ClipboardAction extends DatabaseObject {
/**
* Executes clipboard action-related actions.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.clipboard.action
- * @category Community Framework
+ * @category Community Framework
*/
class ClipboardActionAction extends AbstractDatabaseObjectAction {
/**
* Provides functions to edit clipboard actions.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.clipboard.action
- * @category Community Framework
+ * @category Community Framework
*/
class ClipboardActionEditor extends DatabaseObjectEditor {
/**
/**
* Represents a list of clipboard actions.
*
- * @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Alexander Ebert
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.clipboard.action
- * @category Community Framework
+ * @category Community Framework
*/
class ClipboardActionList extends DatabaseObjectList {
/**
* Represents a core object.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.core.object
- * @category Community Framework
+ * @category Community Framework
*/
class CoreObject extends DatabaseObject {
/**
* Executes core object-related actions.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.core.object
- * @category Community Framework
+ * @category Community Framework
*/
class CoreObjectAction extends AbstractDatabaseObjectAction {
/**
* Provides functions to edit core objects.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.core.object
- * @category Community Framework
+ * @category Community Framework
*/
class CoreObjectEditor extends DatabaseObjectEditor {
/**
/**
* Represents a list of core objects.
*
- * @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Alexander Ebert
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.event
- * @category Community Framework
+ * @category Community Framework
*/
class CoreObjectList extends DatabaseObjectList {
/**
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.cronjob
- * @category Community Framework
+ * @category Community Framework
*/
class Cronjob extends DatabaseObject {
/**
* Executes cronjob-related actions.
*
* @author Tim Düsterhus, Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.cronjob
- * @category Community Framework
+ * @category Community Framework
*/
class CronjobAction extends AbstractDatabaseObjectAction {
/**
- * @see wcf\data\AbstractDatabaseObjectAction::$className
+ * @see wcf\data\AbstractDatabaseObjectAction::$className
*/
protected $className = 'wcf\data\cronjob\CronjobEditor';
* Provides functions to edit cronjobs.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.cronjob
- * @category Community Framework
+ * @category Community Framework
*/
class CronjobEditor extends DatabaseObjectEditor implements IEditableCachedObject {
/**
protected static $baseClass = 'wcf\data\cronjob\Cronjob';
/**
- * @see wcf\data\IEditableCachedObject::resetCache()
+ * @see wcf\data\IEditableCachedObject::resetCache()
*/
public static function resetCache() {
CacheHandler::getInstance()->clear(WCF_DIR.'cache', 'cache.cronjobs-*');
/**
* Represents a list of cronjobs.
*
- * @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Alexander Ebert
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.cronjob
- * @category Community Framework
+ * @category Community Framework
*/
class CronjobList extends DatabaseObjectList {
/**
* Represents a croniob log.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.cronjob.log
- * @category Community Framework
+ * @category Community Framework
*/
class CronjobLog extends DatabaseObject {
/**
* Executes cronjob log-related actions.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.acp.menu.item
- * @category Community Framework
+ * @category Community Framework
*/
class CronjobLogAction extends AbstractDatabaseObjectAction {
/**
- * @see wcf\data\AbstractDatabaseObjectAction::$className
+ * @see wcf\data\AbstractDatabaseObjectAction::$className
*/
protected $className = 'wcf\data\cronjob\log\CronjobLogEditor';
}
* Provides functions to edit cronjob logs.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.language.item
- * @category Community Framework
+ * @category Community Framework
*/
class CronjobLogEditor extends DatabaseObjectEditor {
/**
/**
* Represents a list of cronjob log entries.
*
- * @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Alexander Ebert
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.acp.menu.item
- * @category Community Framework
+ * @category Community Framework
*/
class CronjobLogList extends DatabaseObjectList {
/**
* Represents an event listener.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.event.listener
- * @category Community Framework
+ * @category Community Framework
*/
class EventListener extends DatabaseObject {
/**
* Executes event listener-related actions.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.event.listener
- * @category Community Framework
+ * @category Community Framework
*/
class EventListenerAction extends AbstractDatabaseObjectAction {
/**
- * @see wcf\data\AbstractDatabaseObjectAction::$className
+ * @see wcf\data\AbstractDatabaseObjectAction::$className
*/
protected $className = 'wcf\data\event\listener\EventListenerEditor';
}
/**
* Represents a list of event listener.
*
- * @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Alexander Ebert
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.event.listener
- * @category Community Framework
+ * @category Community Framework
*/
class EventListenerList extends DatabaseObjectList {
/**
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.language
- * @category Community Framework
+ * @category Community Framework
*/
class Language extends DatabaseObject {
/**
/**
* Executes template scripting in a language variable.
*
- * @param string $item
- * @param array $variables
+ * @param string $item
+ * @param array $variables
* @param boolean $optional
- * @return string result
+ * @return string result
*/
public function getDynamicVariable($item, array $variables = array(), $optional = false) {
$staticItem = $this->get($item, $optional);
/**
* Loads category files.
- *
+ *
* @param string $category
* @return boolean
*/
/**
* Sets the local language.
* Recall this function after language changed.
- *
+ *
* @param integer $languageID
*/
public function setLocale() {
return LanguageFactory::getInstance()->getLanguages();
}
+ /**
+ * Sets the package id when a language object is unserialized.
+ */
public function __wakeup() {
$this->packageID = PACKAGE_ID;
}
* Executes language-related actions.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.language
- * @category Community Framework
+ * @category Community Framework
*/
class LanguageAction extends AbstractDatabaseObjectAction {
/**
- * @see wcf\data\AbstractDatabaseObjectAction::$className
+ * @see wcf\data\AbstractDatabaseObjectAction::$className
*/
protected $className = 'wcf\data\language\LanguageEditor';
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.language
- * @category Community Framework
+ * @category Community Framework
*/
class LanguageEditor extends DatabaseObjectEditor {
/**
* Updates the language files for the given category.
*
* @param array $categoryIDs
- * @param array $packageIDs
+ * @param array $packageIDs
*/
public function updateCategory(array $categoryIDs = array(), array $packageIDs = array()) {
if (!count($categoryIDs)) {
/**
* Represents a list of languages.
*
- * @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Alexander Ebert
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.language
- * @category Community Framework
+ * @category Community Framework
*/
class LanguageList extends DatabaseObjectList {
/**
* SetupLanguage is a modification of Language only for the setup process.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.language
- * @category Community Framework
+ * @category Community Framework
*/
class SetupLanguage extends Language {
/**
$file->write("\$this->dynamicItems['".$name['name']."'] = '".str_replace("'", "\'", $compiledString['template'])."';\n");
}
}
-
+
$file->write("?>");
$file->close();
}
}
-
+
include_once($filename);
$this->setLocale();
}
* Represents a language category.
*
* @author Alexander Ebert
- * @copyright 2001-2010 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.language.category
- * @category Community Framework
+ * @category Community Framework
*/
class LanguageCategory extends DatabaseObject {
/**
* Executes language category-related actions.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.language.category
- * @category Community Framework
+ * @category Community Framework
*/
class LanguageCategoryAction extends AbstractDatabaseObjectAction {
/**
- * @see wcf\data\AbstractDatabaseObjectAction::$className
+ * @see wcf\data\AbstractDatabaseObjectAction::$className
*/
protected $className = 'wcf\data\language\category\LanguageCategoryEditor';
* Provides functions to edit language categories.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.language.category
- * @category Community Framework
+ * @category Community Framework
*/
class LanguageCategoryEditor extends DatabaseObjectEditor {
/**
/**
* Represents a list of language categories.
*
- * @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Alexander Ebert
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.language.category
- * @category Community Framework
+ * @category Community Framework
*/
class LanguageCategoryList extends DatabaseObjectList {
/**
* Represents a language item.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.language.item
- * @category Community Framework
+ * @category Community Framework
*/
class LanguageItem extends DatabaseObject {
/**
* Executes language item-related actions.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.language.item
- * @category Community Framework
+ * @category Community Framework
*/
class LanguageItemAction extends AbstractDatabaseObjectAction {
/**
- * @see wcf\data\AbstractDatabaseObjectAction::$className
+ * @see wcf\data\AbstractDatabaseObjectAction::$className
*/
protected $className = 'wcf\data\language\item\LanguageItemEditor';
* Provides functions to edit language items.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.language.item
- * @category Community Framework
+ * @category Community Framework
*/
class LanguageItemEditor extends DatabaseObjectEditor {
/**
/**
* Represents a list of language items.
*
- * @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Alexander Ebert
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.language.item
- * @category Community Framework
+ * @category Community Framework
*/
class LanguageItemList extends DatabaseObjectList {
/**
* Represents a language server.
*
* @author Alexander Ebert
- * @copyright 2001-2010 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.language.server
- * @category Community Framework
+ * @category Community Framework
*/
class LanguageServer extends DatabaseObject {
/**
* Executes language server-related actions.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.language.server
- * @category Community Framework
+ * @category Community Framework
*/
class LanguageServerAction extends AbstractDatabaseObjectAction {
/**
- * @see wcf\data\AbstractDatabaseObjectAction::$className
+ * @see wcf\data\AbstractDatabaseObjectAction::$className
*/
protected $className = 'wcf\data\language\server\LanguageServerEditor';
* Provides functions to edit language servers.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.language.server
- * @category Community Framework
+ * @category Community Framework
*/
class LanguageServerEditor extends DatabaseObjectEditor {
/**
/**
* Represents a list of language servers.
*
- * @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Alexander Ebert
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.language.server
- * @category Community Framework
+ * @category Community Framework
*/
class LanguageServerList extends DatabaseObjectList {
/**
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.modification.log
- * @category Community Framework
+ * @category Community Framework
*/
class ModificationLog extends DatabaseObject {
/**
*/
public function __get($name) {
$value = parent::__get($name);
-
+
// treat additional data as data variables if it is an array
if ($value === null) {
if (is_array($this->data['additionalData']) && isset($this->data['additionalData'][$name])) {
$value = $this->data['additionalData'][$name];
}
}
-
+
return $value;
}
*/
protected function handleData($data) {
parent::handleData($data);
-
+
$this->data['additionalData'] = @unserialize($this->data['additionalData']);
if (!is_array($this->data['additionalData'])) {
$this->data['additionalData'] = array();
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.modification.log
- * @category Community Framework
+ * @category Community Framework
*/
class ModificationLogAction extends AbstractDatabaseObjectAction { }
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.modification.log
- * @category Community Framework
+ * @category Community Framework
*/
class ModificationLogEditor extends DatabaseObjectEditor {
/**
/**
* Represents a list of modification logs.
*
- * @author Alexander Ebert
+ * @author Alexander Ebert
* @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.modification.log
- * @category Community Framework
+ * @category Community Framework
*/
class ModificationLogList extends DatabaseObjectList {
/**
* Provides default a implementation for object type processors.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.object.type
- * @category Community Framework
+ * @category Community Framework
*/
abstract class AbstractObjectTypeProcessor extends DatabaseObjectDecorator implements IDatabaseObjectProcessor {
/**
- * @see wcf\data\DatabaseObjectDecorator::$baseClass
+ * @see wcf\data\DatabaseObjectDecorator::$baseClass
*/
protected static $baseClass = 'wcf\data\object\type\ObjectType';
}
* Basic implementation for object type providers.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.object.type
- * @category Community Framework
+ * @category Community Framework
*/
abstract class AbstractObjectTypeProvider implements IObjectTypeProvider {
/**
/**
* Any object type provider should implement this interface.
- *
+ *
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.object.type
- * @category Community Framework
+ * @category Community Framework
*/
interface IObjectTypeProvider {
/**
* Gets an object by its ID.
- *
+ *
* @param integer $objectID
* @return wcf\data\DatabaseObject
*/
/**
* Gets like objects by their IDs.
- *
+ *
* @param array<integer> $objectIDs
* @return array<wcf\data\DatabaseObject>
*/
* Represents an object type.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.object.type
- * @category Community Framework
+ * @category Community Framework
*/
class ObjectType extends ProcessibleDatabaseObject {
/**
* Executes object type-related actions.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.object.type
- * @category Community Framework
+ * @category Community Framework
*/
class ObjectTypeAction extends AbstractDatabaseObjectAction {
/**
- * @see wcf\data\AbstractDatabaseObjectAction::$className
+ * @see wcf\data\AbstractDatabaseObjectAction::$className
*/
protected $className = 'wcf\data\object\type\ObjectTypeEditor';
}
* Manages the object type cache.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.object.type
- * @category Community Framework
+ * @category Community Framework
*/
class ObjectTypeCache extends SingletonFactory {
/**
* object type definitions
- * @var array<wcf\data\object\type\definition\ObjectTypeDefinition>
+ * @var array<wcf\data\object\type\definition\ObjectTypeDefinition>
*/
protected $definitions = array();
/**
* object type definitions sorted by name
- * @var array<wcf\data\object\type\definition\ObjectTypeDefinition>
+ * @var array<wcf\data\object\type\definition\ObjectTypeDefinition>
*/
protected $definitionsByName = array();
/**
* object types
- * @var array<wcf\data\object\type\ObjectType>
+ * @var array<wcf\data\object\type\ObjectType>
*/
protected $objectTypes = array();
/**
* object types grouped by definition
- * @var array
+ * @var array
*/
protected $groupedObjectTypes = array();
/**
- * @see wcf\system\SingletonFactory::init()
+ * @see wcf\system\SingletonFactory::init()
*/
protected function init() {
// get definition cache
<?php
namespace wcf\data\object\type;
-use wcf\system\cache\CacheHandler;
use wcf\data\DatabaseObjectEditor;
use wcf\data\IEditableCachedObject;
* Provides functions to edit object types.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.object.type
- * @category Community Framework
+ * @category Community Framework
*/
class ObjectTypeEditor extends DatabaseObjectEditor implements IEditableCachedObject {
/**
protected static $baseClass = 'wcf\data\object\type\ObjectType';
/**
- * @see wcf\data\IEditableCachedObject::resetCache()
+ * @see wcf\data\IEditableCachedObject::resetCache()
*/
public static function resetCache() {
ObjectTypeCache::getInstance()->resetCache();
/**
* Represents a list of object types.
*
- * @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Alexander Ebert
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.object.type.definition
- * @category Community Framework
+ * @category Community Framework
*/
class ObjectTypeList extends DatabaseObjectList {
/**
* Represents an object type definition.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.object.type.definition
- * @category Community Framework
+ * @category Community Framework
*/
class ObjectTypeDefinition extends DatabaseObject {
/**
* Executes object type definition-related actions.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.object.type.definition
- * @category Community Framework
+ * @category Community Framework
*/
class ObjectTypeDefinitionAction extends AbstractDatabaseObjectAction {
/**
- * @see wcf\data\AbstractDatabaseObjectAction::$className
+ * @see wcf\data\AbstractDatabaseObjectAction::$className
*/
protected $className = 'wcf\data\object\type\definition\ObjectTypeDefinitionEditor';
}
/**
* Provides functions to edit object type definitions.
- *
+ *
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.object.type.definition
- * @category Community Framework
+ * @category Community Framework
*/
class ObjectTypeDefinitionEditor extends DatabaseObjectEditor {
/**
/**
* Represents a list of object type definitions.
*
- * @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Alexander Ebert
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.object.type.definition
- * @category Community Framework
+ * @category Community Framework
*/
class ObjectTypeDefinitionList extends DatabaseObjectList {
/**
* Represents an option.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.option
- * @category Community Framework
+ * @category Community Framework
*/
class Option extends DatabaseObject {
/**
const VISIBILITY_ALL = 15;
/**
- * @see wcf\data\DatabaseObject::handleData()
+ * @see wcf\data\DatabaseObject::handleData()
*/
protected function handleData($data) {
parent::handleData($data);
/**
* Returns a list of options.
- *
+ *
* @param integer $packageID
* @return array<wcf\data\option\Option>
*/
/**
* Parses enableOptions.
- *
+ *
* @param string $optionData
* @return array
*/
/**
* Returns a list of the available options.
- *
+ *
* @return array
*/
public function parseSelectOptions() {
/**
* Returns a list of the enable options.
- *
+ *
* @return array
*/
public function parseMultipleEnableOptions() {
* Executes option-related actions.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.
- * @category Community Framework
+ * @category Community Framework
*/
class OptionAction extends AbstractDatabaseObjectAction {
/**
- * @see wcf\data\AbstractDatabaseObjectAction::$className
+ * @see wcf\data\AbstractDatabaseObjectAction::$className
*/
protected $className = 'wcf\data\option\OptionEditor';
* Provides functions to edit options.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.option
- * @category Community Framework
+ * @category Community Framework
*/
class OptionEditor extends DatabaseObjectEditor implements IEditableCachedObject {
/**
* options cache file name
- * @var string
+ * @var string
*/
const FILENAME = 'options.inc.php';
/**
* Imports the given options.
*
- * @param array $options name to value
+ * @param array $options name to value
*/
public static function import(array $options) {
// get option ids
}
/**
- * @see wcf\data\IEditableCachedObject::resetCache()
+ * @see wcf\data\IEditableCachedObject::resetCache()
*/
public static function resetCache() {
// reset cache
/**
* Rebuilds cached options
*
- * @param string filename
+ * @param string $filename
* @param integer $packageID
*/
public static function rebuildFile($filename, $packageID = PACKAGE_ID) {
/**
* Represents a list of options.
*
- * @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Alexander Ebert
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.option
- * @category Community Framework
+ * @category Community Framework
*/
class OptionList extends DatabaseObjectList {
/**
* Represents an option category.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.option.category
- * @category Community Framework
+ * @category Community Framework
*/
class OptionCategory extends DatabaseObject {
/**
* Executes option categories-related actions.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.option.category
- * @category Community Framework
+ * @category Community Framework
*/
class OptionCategoryAction extends AbstractDatabaseObjectAction {
/**
- * @see wcf\data\AbstractDatabaseObjectAction::$className
+ * @see wcf\data\AbstractDatabaseObjectAction::$className
*/
protected $className = 'wcf\data\option\category\OptionCategoryEditor';
* Provides functions to edit option categories.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.option.category
- * @category Community Framework
+ * @category Community Framework
*/
class OptionCategoryEditor extends DatabaseObjectEditor {
/**
/**
* Represents a list of option categories.
*
- * @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Alexander Ebert
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.option.category
- * @category Community Framework
+ * @category Community Framework
*/
class OptionCategoryList extends DatabaseObjectList {
/**
* Represents a package.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.package
- * @category Community Framework
+ * @category Community Framework
*/
class Package extends DatabaseObject {
/**
/**
* Returns true, if this package is required by other packages.
- *
+ *
* @return boolean
*/
public function isRequired() {
/**
* Returns true if package is a plugin.
- *
+ *
* @return boolean
*/
public function isPlugin() {
/**
* Returns the name of this package.
- *
+ *
* @return string
*/
public function getName() {
/**
* Returns the abbreviation of the package name.
- *
+ *
* @param string $package
* @return string
*/
* Returns package object for parent package.
*
* @return Package
- */
+ */
public function getParentPackage() {
if (!$this->parentPackageID) {
throw new SystemException("Package ".$this->package." does not have a parent package.");
/**
* Returns a list of all by this package required packages.
* Contains required packages and the requirements of the required packages.
- *
+ *
* @return array
*/
public function getDependencies() {
/**
* Returns a list of all packages that require this package.
* Returns packages that require this package and packages that require these packages.
- *
+ *
* @return array
*/
public function getDependentPackages() {
/**
* Returns a list of the requirements of this package.
* Contains the content of the <requiredPackages> tag in the package.xml of this package.
- *
+ *
* @return array
*/
public function getRequiredPackages() {
* official WCF packet naming scheme in the future).
* Reminder: The '$packageName' variable being examined here contains the 'name' attribute
* of the 'package' tag noted in the 'packages.xml' file delivered inside the respective package.
- *
+ *
* @param string $packageName
* @return boolean isValid
*/
/**
* Compares two version number strings.
- *
+ *
* @param string $version1
* @param string $version2
* @param string $operator
/**
* Formats a package version string for comparing.
- *
+ *
* @param string $version
* @return string formatted version
* @see http://www.php.net/manual/en/function.version-compare.php
/**
* Rebuilds the requirement map for the given package id.
- *
+ *
* @param integer $packageID
*/
public static function rebuildPackageRequirementMap($packageID) {
/**
* Rebuilds the dependencies list for the given package id.
- *
+ *
* @param integer $packageID
*/
public static function rebuildPackageDependencies($packageID) {
/**
* Writes the config.inc.php for an application.
- *
+ *
* @param integer $packageID
*/
public static function writeConfigFile($packageID) {
/**
* Searches all dependent packages for the given package id
* and rebuild their package dependencies list.
- *
+ *
* @param integer $packageID
*/
public static function rebuildParentPackageDependencies($packageID) {
* Executes package-related actions.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.package
- * @category Community Framework
+ * @category Community Framework
*/
class PackageAction extends AbstractDatabaseObjectAction {
/**
- * @see wcf\data\AbstractDatabaseObjectAction::$className
+ * @see wcf\data\AbstractDatabaseObjectAction::$className
*/
protected $className = 'wcf\data\package\PackageEditor';
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.package
- * @category Community Framework
+ * @category Community Framework
*/
class PackageCache extends SingletonFactory {
/**
* list of cached packages
- * @var array<wcf\data\package\Package>
+ * @var array<wcf\data\package\Package>
*/
protected $packages = array();
/**
- * @see wcf\system\SingletonFactory::init()
+ * @see wcf\system\SingletonFactory::init()
*/
protected function init() {
CacheHandler::getInstance()->addResource(
* Provides functions to edit packages.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.package
- * @category Community Framework
+ * @category Community Framework
*/
class PackageEditor extends DatabaseObjectEditor {
/**
/**
* Represents a list of packages.
*
- * @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Alexander Ebert
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.package
- * @category Community Framework
+ * @category Community Framework
*/
class PackageList extends DatabaseObjectList {
/**
* Represents a package installation plugin.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.package.installation.plugin
- * @category Community Framework
+ * @category Community Framework
*/
class PackageInstallationPlugin extends DatabaseObject {
/**
* Executes package installation plugin-related actions.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.package.installation.plugin
- * @category Community Framework
+ * @category Community Framework
*/
class PackageInstallationPluginAction extends AbstractDatabaseObjectAction {
/**
- * @see wcf\data\AbstractDatabaseObjectAction::$className
+ * @see wcf\data\AbstractDatabaseObjectAction::$className
*/
protected $className = 'wcf\data\package\installation\plugin\PackageInstallationPluginEditor';
}
* Provides functions to edit package installation plugins.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.package.installation.plugin
- * @category Community Framework
+ * @category Community Framework
*/
class PackageInstallationPluginEditor extends DatabaseObjectEditor {
/**
/**
* Represents a list of package installation plugins.
*
- * @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Alexander Ebert
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.package.installation.plugin
- * @category Community Framework
+ * @category Community Framework
*/
class PackageInstallationPluginList extends DatabaseObjectList {
/**
* Represents a package installation queue.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.package.installation.queue
- * @category Community Framework
+ * @category Community Framework
*/
class PackageInstallationQueue extends DatabaseObject {
/**
/**
* Executes package installation queue-related actions.
- *
+ *
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.package.installation.queue
- * @category Community Framework
+ * @category Community Framework
*/
class PackageInstallationQueueAction extends AbstractDatabaseObjectAction {
+ /**
+ * package the prepared queue belongs to
+ * @var wcf\data\package\Package
+ */
protected $package = null;
+
+ /**
+ * id of the package the prepared queue belongs to
+ * @var integer
+ */
protected $packageID = 0;
/**
*/
protected $className = 'wcf\data\package\installation\queue\PackageInstallationQueueEditor';
+ /**
+ * Validates the 'prepareQueue' action:
+ */
public function validatePrepareQueue() {
if (isset($this->parameters['packageID'])) $this->packageID = intval($this->parameters['packageID']);
}
}
+ /**
+ * Prepares a new package installation queue.
+ *
+ * @return array<integer>
+ */
public function prepareQueue() {
$processNo = PackageInstallationQueue::getNewProcessNo();
* Provides functions to edit package installation queues.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.package.installation.queue
- * @category Community Framework
+ * @category Community Framework
*/
class PackageInstallationQueueEditor extends DatabaseObjectEditor {
/**
/**
* Represents a list of package installation queues.
*
- * @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Alexander Ebert
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.package.installation.queue
- * @category Community Framework
+ * @category Community Framework
*/
class PackageInstallationQueueList extends DatabaseObjectList {
/**
* Represents a package update.
*
* @author Alexander Ebert
- * @copyright 2001-2010 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.package.update
- * @category Community Framework
+ * @category Community Framework
*/
class PackageUpdate extends DatabaseObject {
/**
* Executes package update-related actions.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.package.update
- * @category Community Framework
+ * @category Community Framework
*/
class PackageUpdateAction extends AbstractDatabaseObjectAction {
/**
* Provides functions to edit package updates.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.package.update
- * @category Community Framework
+ * @category Community Framework
*/
class PackageUpdateEditor extends DatabaseObjectEditor {
/**
/**
* Represents a list of package updates.
*
- * @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Alexander Ebert
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.package.update
- * @category Community Framework
+ * @category Community Framework
*/
class PackageUpdateList extends DatabaseObjectList {
/**
* Contains business logic related to handling of package update servers.
*
* @author Siegfried Schweizer
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.package.update.server
- * @category Community Framework
+ * @category Community Framework
*/
class PackageUpdateServer extends DatabaseObject {
/**
/**
* Validates a server url.
- *
+ *
* @param string $serverURL
* @return boolean validates
*/
/**
* Gets stored auth data of this update server.
- *
+ *
* @return array $authData
*/
public function getAuthData() {
* Executes package update server-related actions.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.package.update.server
- * @category Community Framework
+ * @category Community Framework
*/
class PackageUpdateServerAction extends AbstractDatabaseObjectAction {
/**
- * @see wcf\data\AbstractDatabaseObjectAction::$className
+ * @see wcf\data\AbstractDatabaseObjectAction::$className
*/
protected $className = 'wcf\data\package\update\server\PackageUpdateServerEditor';
* Contains business logic related to handling of package update servers.
*
* @author Siegfried Schweizer
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.package.update.server
- * @category Community Framework
+ * @category Community Framework
*/
class PackageUpdateServerEditor extends DatabaseObjectEditor {
/**
/**
* Represents a list of package update servers.
*
- * @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Alexander Ebert
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.package.update.server
- * @category Community Framework
+ * @category Community Framework
*/
class PackageUpdateServerList extends DatabaseObjectList {
/**
* Represents a package update version.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.package.update.version
- * @category Community Framework
+ * @category Community Framework
*/
class PackageUpdateVersion extends DatabaseObject {
/**
* Executes package update version-related actions.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.package.update.version
- * @category Community Framework
+ * @category Community Framework
*/
class PackageUpdateVersionAction extends AbstractDatabaseObjectAction {
/**
- * @see wcf\data\AbstractDatabaseObjectAction::$className
+ * @see wcf\data\AbstractDatabaseObjectAction::$className
*/
protected $className = 'wcf\data\package\update\version\PackageUpdateVersionEditor';
}
* Provides functions to edit package update versions.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.package.update.version
- * @category Community Framework
+ * @categor Community Framework
*/
class PackageUpdateVersionEditor extends DatabaseObjectEditor {
/**
/**
* Represents a list of package update versions.
*
- * @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Alexander Ebert
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.package.update.version
- * @category Community Framework
+ * @category Community Framework
*/
class PackageUpdateVersionList extends DatabaseObjectList {
/**
* Represents an page menu item.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.page.menu.item
- * @category Community Framework
+ * @category Community Framework
*/
class PageMenuItem extends ProcessibleDatabaseObject implements ITreeMenuItem {
/**
protected static $processorInterface = 'wcf\system\menu\page\IPageMenuItemProvider';
/**
- * @see wcf\data\ProcessibleDatabaseObject::getProcessor()
+ * @see wcf\data\ProcessibleDatabaseObject::getProcessor()
*/
public function getProcessor() {
if (parent::getProcessor() === null) {
}
/**
- * @see wcf\system\menu\ITreeMenuItem::getLink()
+ * @see wcf\system\menu\ITreeMenuItem::getLink()
*/
public function getLink() {
$abbreviation = ApplicationHandler::getInstance()->getAbbreviation($this->packageID);
* Executes page menu item-related actions.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.page.menu.item
- * @category Community Framework
+ * @category Community Framework
*/
class PageMenuItemAction extends AbstractDatabaseObjectAction {
/**
- * @see wcf\data\AbstractDatabaseObjectAction::$className
+ * @see wcf\data\AbstractDatabaseObjectAction::$className
*/
protected $className = 'wcf\data\page\menu\item\PageMenuItemEditor';
}
* Provides functions to edit page menu items.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.page.menu.item
- * @category Community Framework
+ * @category Community Framework
*/
class PageMenuItemEditor extends DatabaseObjectEditor implements IEditableCachedObject {
/**
/**
* Updates the positions of a page menu item directly.
- *
+ *
* @param integer $menuItemID
* @param string $menuPosition
* @param integer $showOrder
/**
* Represents a list of page menu items.
*
- * @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Alexander Ebert
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.page.menu.item
- * @category Community Framework
+ * @category Community Framework
*/
class PageMenuItemList extends DatabaseObjectList {
/**
* Represents a search.
*
* @author Alexander Ebert
- * @copyright 2001-2010 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.search
- * @category Community Framework
+ * @category Community Framework
*/
class Search extends DatabaseObject {
/**
* Executes search-related actions.
*
* @author Alexander Ebert
- * @copyright 2001-2010 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.search
- * @category Community Framework
+ * @category Community Framework
*/
class SearchAction extends AbstractDatabaseObjectAction {
/**
* Provides functions to edit searches.
*
* @author Alexander Ebert
- * @copyright 2001-2010 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.search
- * @category Community Framework
+ * @category Community Framework
*/
class SearchEditor extends DatabaseObjectEditor {
/**
/**
* Represents a list of searches.
*
- * @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Alexander Ebert
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.search
- * @category Community Framework
+ * @category Community Framework
*/
class SearchList extends DatabaseObjectList {
/**
* Represents a session.
*
* @author Alexander Ebert
- * @copyright 2001-2010 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.session
- * @category Community Framework
+ * @category Community Framework
*/
class Session extends ACPSession {
/**
protected static $databaseTableIndexName = 'sessionID';
/**
- * @see wcf\data\acp\session\ACPSession::supportsPersistentLogins()
+ * @see wcf\data\acp\session\ACPSession::supportsPersistentLogins()
*/
public static function supportsPersistentLogins() {
return true;
* Executes session-related actions.
*
* @author Alexander Ebert
- * @copyright 2001-2010 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.session
- * @category Community Framework
+ * @category Community Framework
*/
class SessionAction extends AbstractDatabaseObjectAction {
/**
* Provides functions to edit sessions.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.session
- * @category Community Framework
+ * @category Community Framework
*/
class SessionEditor extends ACPSessionEditor {
/**
/**
* Represents a list of sessions.
*
- * @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Alexander Ebert
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.session
- * @category Community Framework
+ * @category Community Framework
*/
class SessionList extends DatabaseObjectList {
/**
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.sitemap
- * @category Community Framework
+ * @category Community Framework
*/
class Sitemap extends DatabaseObject {
/**
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.sitemap
- * @category Community Framework
+ * @category Community Framework
*/
class SitemapAction extends AbstractDatabaseObjectAction {
/**
protected $allowGuestAccess = array('getSitemap');
/**
- * Does nothing.
+ * Validates the 'getSitemap' action.
*/
public function validateGetSitemap() {
if (isset($this->parameters['sitemapName'])) {
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.sitemap
- * @category Community Framework
+ * @category Community Framework
*/
class SitemapEditor extends DatabaseObjectEditor {
/**
/**
* Represents a list of sitemap entries.
*
- * @author Alexander Ebert
+ * @author Alexander Ebert
* @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.sitemap
- * @category Community Framework
+ * @category Community Framework
*/
class SitemapList extends DatabaseObjectList { }
* Represents a spider.
*
* @author Alexander Ebert
- * @copyright 2001-2010 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.spider
- * @category Community Framework
+ * @category Community Framework
*/
class Spider extends DatabaseObject {
/**
* Executes spider-related actions.
*
* @author Alexander Ebert
- * @copyright 2001-2010 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.spider
- * @category Community Framework
+ * @category Community Framework
*/
class SpiderAction extends AbstractDatabaseObjectAction {
/**
- * @see wcf\data\AbstractDatabaseObjectAction::$className
+ * @see wcf\data\AbstractDatabaseObjectAction::$className
*/
protected $className = 'wcf\data\spider\SpiderEditor';
}
* Provides functions to edit spiders.
*
* @author Alexander Ebert
- * @copyright 2001-2010 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.spider
- * @category Community Framework
+ * @category Community Framework
*/
class SpiderEditor extends DatabaseObjectEditor {
/**
/**
* Represents a list of spiders.
*
- * @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Alexander Ebert
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.spider
- * @category Community Framework
+ * @category Community Framework
*/
class SpiderList extends DatabaseObjectList {
/**
* Represents the active user style.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.style
- * @category Community Framework
+ * @category Community Framework
*/
class ActiveStyle extends DatabaseObjectDecorator {
/**
- * @see wcf\data\DatabaseObjectDecorator::$baseClass
+ * @see wcf\data\DatabaseObjectDecorator::$baseClass
*/
protected static $baseClass = 'wcf\data\style\Style';
/**
* Creates a new ActiveStyle object.
*
- * @param Style $object
+ * @param wcf\data\style\Style $object
*/
public function __construct(Style $object) {
parent::__construct($object);
* Represents a style.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.style
- * @category Community Framework
+ * @category Community Framework
*/
class Style extends DatabaseObject {
/**
* Executes style-related actions.
*
* @author Alexander Ebert
- * @copyright 2001-2010 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.style
- * @category Community Framework
+ * @category Community Framework
*/
class StyleAction extends AbstractDatabaseObjectAction {
/**
- * @see wcf\data\AbstractDatabaseObjectAction::$className
+ * @see wcf\data\AbstractDatabaseObjectAction::$className
*/
protected $className = 'wcf\data\style\StyleEditor';
}
* @todo Thumbnail class has been removed
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.style
- * @category Community Framework
+ * @category Community Framework
*/
class StyleEditor extends DatabaseObjectEditor implements IEditableCachedObject {
const INFO_FILE = 'style.xml';
protected static $baseClass = 'wcf\data\style\Style';
/**
- * @see wcf\data\IEditableObject::update()
+ * @see wcf\data\IEditableObject::update()
*/
public function update(array $parameters = array()) {
$variables = null;
$variables = $parameters['variables'];
unset($parameters['variables']);
}
-
+
// update style data
parent::update($parameters);
}
/**
- * @see wcf\data\IEditableObject::delete()
+ * @see wcf\data\IEditableObject::delete()
*/
public function delete() {
parent::delete();
case 'image': case 'copyright': case 'license': $data[$general['name']] = $general['cdata']; break;
}
}
- break;
+ break;
case 'author':
foreach ($child['children'] as $author) {
case 'authorurl': $data['authorURL'] = $author['cdata']; break;
}
}
- break;
+ break;
case 'files':
foreach ($child['children'] as $files) {
case 'templates': case 'images': case 'variables': case 'icons': $data[$files['name']] = $files['cdata']; break;
}
}
- break;
+ break;
}
}
@unlink($destination);
}
}
-
+
$tar->close();
return $style;
$styleTar->add($templatesTarName, 'templates.tar', $templatesTarName);
@unlink($templatesTarName);
}
-
+
if ($images) {
// create images tar
$imagesTarName = FileUtil::getTemporaryFilename('images_', '.tar');
// write attribute
if (!empty($attributeName)) $file->write($attributeName .":");
-
+
// write value
$file->write($variables[$variableName]);
// write attribute
if (!empty($attributeName)) $file->write($attributeName .":");
-
+
// write value
$file->write($variables[$variableName]);
}
/**
- * @see wcf\data\IEditableObject::create()
+ * @see wcf\data\IEditableObject::create()
*/
public static function create(array $parameters = array()) {
$variables = null;
if (!isset($parameters['styleDate'])) $parameters['styleDate'] = gmdate('Y-m-d', TIME_NOW);
// save style
- $style = parent::create($parameters);
+ $style = parent::create($parameters);
$styleEditor = new StyleEditor($style);
// save variables
}
/**
- * @see wcf\data\IEditableCachedObject::resetCache()
+ * @see wcf\data\IEditableCachedObject::resetCache()
*/
public static function resetCache() {
CacheHandler::getInstance()->clear(WCF_DIR.'cache', 'cache.icon-*-*.php');
/**
* Represents a list of styles.
*
- * @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Alexander Ebert
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.style
- * @category Community Framework
+ * @category Community Framework
*/
class StyleList extends DatabaseObjectList {
/**
* Represents a template.
*
* @author Alexander Ebert
- * @copyright 2001-2010 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.template
- * @category Community Framework
+ * @category Community Framework
*/
class Template extends DatabaseObject {
/**
* Executes template-related actions.
*
* @author Alexander Ebert
- * @copyright 2001-2010 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.template
- * @category Community Framework
+ * @category Community Framework
*/
class TemplateAction extends AbstractDatabaseObjectAction {
/**
- * @see wcf\data\AbstractDatabaseObjectAction::$className
+ * @see wcf\data\AbstractDatabaseObjectAction::$className
*/
protected $className = 'wcf\data\template\TemplateEditor';
* TemplateEditor provides functions to create, edit or delete templates.
*
* @author Marcel Werk
- * @copyright 2001-2010 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.template
/**
* Represents a list of templates.
*
- * @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Alexander Ebert
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.template
- * @category Community Framework
+ * @category Community Framework
*/
class TemplateList extends DatabaseObjectList {
/**
use wcf\util\StringUtil;
/**
- * TemplateGroup represents a template group.
+ * Represents a template group.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.template.group
- * @category Community Framework
+ * @category Community Framework
*/
class TemplateGroup extends DatabaseObject {
/**
* Executes template group-related actions.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.template.group
- * @category Community Framework
+ * @category Community Framework
*/
class TemplateGroupAction extends AbstractDatabaseObjectAction {
/**
- * @see wcf\data\AbstractDatabaseObjectAction::$className
+ * @see wcf\data\AbstractDatabaseObjectAction::$className
*/
protected $className = 'wcf\data\template\group\TemplateGroupEditor';
* TemplateGroupEditor provides functions to create, edit or delete template group.
*
* @author Marcel Werk
- * @copyright 2001-2009 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.template.group
}
/**
- * Deletes this template group.
+ * @see wcf\data\IEditableObject::delete()
*/
public function delete() {
// update children
/**
* Represents a list of template groups.
*
- * @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Alexander Ebert
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.template.group
- * @category Community Framework
+ * @category Community Framework
*/
class TemplateGroupList extends DatabaseObjectList {
/**
* Represents a template listener.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.template.listener
- * @category Community Framework
+ * @category Community Framework
*/
class TemplateListener extends DatabaseObject {
/**
* Executes template listener-related actions.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.template.listener
- * @category Community Framework
+ * @category Community Framework
*/
class TemplateListenerAction extends AbstractDatabaseObjectAction {
/**
- * @see wcf\data\AbstractDatabaseObjectAction::$className
+ * @see wcf\data\AbstractDatabaseObjectAction::$className
*/
protected $className = 'wcf\data\template\listener\TemplateListenerEditor';
}
* Provides functions to edit template listener.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.template.listener
- * @category Community Framework
+ * @category Community Framework
*/
class TemplateListenerEditor extends DatabaseObjectEditor {
/**
/**
* Represents a list of template listener.
*
- * @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Alexander Ebert
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.template.listener
- * @category Community Framework
+ * @category Community Framework
*/
class TemplateListenerList extends DatabaseObjectList {
/**
/**
* Represents a user.
- *
+ *
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.user
- * @category Community Framework
+ * @category Community Framework
*/
final class User extends DatabaseObject implements IRouteController {
/**
/**
* list of group ids
- *
* @var array<integer>
*/
protected $groupIDs = null;
/**
* list of language ids
- *
* @var array<integer>
*/
protected $languageIDs = null;
protected $timezoneObj = null;
/**
- * list of user options.
- *
+ * list of user options
* @var array<string>
*/
protected static $userOptions = null;
/**
* Returns true, if the given password is the correct password for this user.
- *
+ *
* @param string $password
* @return boolean password correct
*/
/**
* Returns true, if the given password hash from a cookie is the correct password for this user.
- *
+ *
* @param string $passwordHash
* @return boolean password correct
*/
/**
* Returns the value of the user option with the given name.
- *
+ *
* @param string $name user option name
* @return mixed user option value
*/
/**
* Returns the id of a user option.
- *
+ *
* @param string $name
* @return integer id
*/
}
/**
- * @see wcf\data\DatabaseObject::__get()
+ * @see wcf\data\DatabaseObject::__get()
*/
public function __get($name) {
$value = parent::__get($name);
}
/**
- * Returns User-object by username.
- *
+ * Returns the user with the given username.
+ *
* @param string $username
- * @return User
+ * @return wcf\data\user\User
*/
public static function getUserByUsername($username) {
$sql = "SELECT *
}
/**
- * Returns User-object by email.
- *
+ * Returns the user with the given email.
+ *
* @param string $email
- * @return User
+ * @return wcf\data\user\User
*/
public static function getUserByEmail($email) {
$sql = "SELECT *
/**
* Returns true, if this user is marked.
- *
+ *
* @return boolean
*/
public function isMarked() {
/**
* Returns the time zone of this user.
- *
+ *
* @return DateTimeZone
*/
public function getTimeZone() {
* Returns a list of users.
*
* @param array $userIDs
- * @return array<User>
+ * @return array<wcf\data\user\User>
*/
public static function getUsers(array $userIDs) {
$userList = new UserList();
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.user
- * @category Community Framework
+ * @category Community Framework
*/
class UserAction extends AbstractDatabaseObjectAction {
/**
$excludedSearchValues = $this->parameters['data']['excludedSearchValues'];
}
$list = array();
-
+
if ($this->parameters['data']['includeUserGroups']) {
$accessibleGroups = UserGroup::getAccessibleGroups();
foreach ($accessibleGroups as $group) {
if (count($excludedSearchValues)) {
$conditionBuilder->add("username NOT IN (?)", array($excludedSearchValues));
}
-
+
// find users
$sql = "SELECT userID, username
FROM wcf".WCF_N."_user
'type' => 'user'
);
}
-
+
return $list;
}
}
* Provides functions to edit users.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.user
- * @category Community Framework
+ * @category Community Framework
*/
class UserEditor extends DatabaseObjectEditor implements IEditableCachedObject {
/**
/**
* Inserts default options.
- *
+ *
* @param integer $userID
*/
protected static function createUserOptions($userID) {
/**
* Updates user options.
- *
+ *
* @param array $userOptions
*/
public function updateUserOptions(array $userOptions = array()) {
/**
* Adds a user to the groups he should be in.
- *
+ *
* @param array $groups
* @param boolean $deleteOldGroups
* @param boolean $addDefaultGroups
/**
* Adds a user to a user group.
- *
+ *
* @param integer $groupID
*/
public function addToGroup($groupID) {
/**
* Removes a user from a user group.
- *
+ *
* @param integer $groupID
*/
public function removeFromGroup($groupID) {
/**
* Saves the visible languages of a user.
- *
+ *
* @param array $languageIDs
*/
public function addToLanguages(array $languageIDs) {
/**
* Represents a list of users.
*
- * @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Alexander Ebert
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.user
- * @category Community Framework
+ * @category Community Framework
*/
class UserList extends DatabaseObjectList {
/**
public $className = 'wcf\data\user\User';
/**
- * Creates a new UserList object.
+ * @see wcf\data\DatabaseObjectList::__construct()
*/
public function __construct() {
parent::__construct();
* Represents a user group.
*
* @author Alexander Ebert
- * @copyright 2001-2010 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.user.group
- * @category Community Framework
+ * @category Community Framework
*/
class UserGroup extends DatabaseObject {
/**
* group type everyone user group
- * @var integer
+ * @var integer
*/
const EVERYONE = 1;
/**
* group type guests user group
- * @var integer
+ * @var integer
*/
const GUESTS = 2;
/**
* group type registered users user group
- * @var integer
+ * @var integer
*/
const USERS = 3;
/**
* group type of other user groups
- * @var integer
+ * @var integer
*/
const OTHER = 4;
protected static $databaseTableIndexName = 'groupID';
/**
- * Caches groups.
- *
- * @var array<UserGroup>
+ * group cache
+ * @var array<wcf\data\user\group\UserGroup>
*/
protected static $cache = null;
/**
- * list of accessible groups for active user.
- *
- * @param array<integer>
+ * list of accessible groups for active user
+ * @var array<integer>
*/
protected static $accessibleGroups = null;
/**
- * Cached group options of this group.
- *
+ * group options of this group
* @var array<array>
*/
protected $groupOptions = null;
*/
public static function getGroupsByType(array $types = array()) {
self::getCache();
+
// get all groups
if (!count($types)) return self::$cache['groups'];
}
/**
- * Returns true, if the given user is member of the group.
+ * Returns true, if the given user is member of the group. If no user is
+ * given, the active user is used.
*
- * @param wcf\data\user\User $user WCF::getUser() is omitted
+ * @param wcf\data\user\User $user
* @return boolean
*/
public function isMember(User $user = null) {
* Executes user group-related actions.
*
* @author Alexander Ebert
- * @copyright 2001-2010 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.user.group
- * @category Community Framework
+ * @category Community Framework
*/
class UserGroupAction extends AbstractDatabaseObjectAction {
/**
protected $permissionsUpdate = array('admin.user.canEditGroup');
/**
- * Creates a new group.
- *
- * @return UserGroup
+ * @see wcf\data\AbstractDatabaseObjectAction::create()
*/
public function create() {
$group = parent::create();
}
/**
- * Updates groups.
+ * @see wcf\data\AbstractDatabaseObjectAction::update()
*/
public function update() {
if (!count($this->objects)) {
* Provides functions to edit user groups.
*
* @author Alexander Ebert
- * @copyright 2001-2010 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.user.group
- * @category Community Framework
+ * @category Community Framework
*/
class UserGroupEditor extends DatabaseObjectEditor implements IEditableCachedObject {
/**
}
/**
- * @see wcf\data\IEditableCachedObject::resetCache()
+ * @see wcf\data\IEditableCachedObject::resetCache()
*/
public static function resetCache() {
// clear cache
/**
* Represents a list of user groups.
*
- * @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Alexander Ebert
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.user.group
- * @category Community Framework
+ * @category Community Framework
*/
class UserGroupList extends DatabaseObjectList {
/**
* Represents a usergroup option.
*
* @author Alexander Ebert
- * @copyright 2001-2010 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.user.group.option
- * @category Community Framework
+ * @category Community Framework
*/
class UserGroupOption extends Option {
/**
* Executes user group option-related actions.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.user.group.option
- * @category Community Framework
+ * @category Community Framework
*/
class UserGroupOptionAction extends AbstractDatabaseObjectAction {
/**
* Provides functions to edit usergroup options.
*
* @author Alexander Ebert
- * @copyright 2001-2010 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.user.group.option
- * @category Community Framework
+ * @category Community Framework
*/
class UserGroupOptionEditor extends DatabaseObjectEditor {
/**
/**
* Represents a list of user group options.
*
- * @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Alexander Ebert
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.user.group.option
- * @category Community Framework
+ * @category Community Framework
*/
class UserGroupOptionList extends DatabaseObjectList {
/**
use wcf\data\DatabaseObject;
/**
- * Represents a usergroup options category.
+ * Represents a user group options category.
*
* @author Alexander Ebert
- * @copyright 2001-2010 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.user.group.option.category
- * @category Community Framework
+ * @category Community Framework
*/
class UserGroupOptionCategory extends DatabaseObject {
/**
* Executes user group option category-related actions.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.user.group.option.category
- * @category Community Framework
+ * @category Community Framework
*/
class UserGroupOptionCategoryAction extends AbstractDatabaseObjectAction {
/**
* Provides functions to edit usergroup option categories.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.user.group.option.category
- * @category Community Framework
+ * @category Community Framework
*/
class UserGroupOptionCategoryEditor extends DatabaseObjectEditor {
/**
/**
* Represents a list of user group option categories.
*
- * @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Alexander Ebert
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.user.group.option.category
- * @category Community Framework
+ * @category Community Framework
*/
class UserGroupOptionCategoryList extends DatabaseObjectList {
/**
namespace wcf\data\user\option;
use wcf\data\option\Option;
use wcf\data\user\User;
-use wcf\system\option\user\IUserOptionOutput;
use wcf\system\WCF;
/**
* Represents a user option.
*
* @author Marcel Werk
- * @copyright 2001-2010 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.user.option
- * @category Community Framework
+ * @category Community Framework
*/
class UserOption extends Option {
/**
* Executes user option-related actions.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.user.option
- * @category Community Framework
+ * @category Community Framework
*/
class UserOptionAction extends AbstractDatabaseObjectAction {
/**
* Provides functions to edit user options.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.user.option
- * @category Community Framework
+ * @category Community Framework
*/
class UserOptionEditor extends DatabaseObjectEditor {
/**
// alter the table "wcf".WCF_N."_user_option_value" with this new option
WCF::getDB()->getEditor()->addColumn('wcf'.WCF_N.'_user_option_value', 'userOption'.$userOption->optionID, self::getColumnDefinition($parameters['optionType']));
- // add the default value to this column
+ // add the default value to this column
if (isset($parameters['defaultValue'])) {
$sql = "UPDATE wcf".WCF_N."_user_option_value
SET userOption".$userOption->optionID." = ?";
/**
* Represents a list of user options.
*
- * @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Alexander Ebert
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.user.option
- * @category Community Framework
+ * @category Community Framework
*/
class UserOptionList extends DatabaseObjectList {
/**
use wcf\util\ClassUtil;
use wcf\util\StringUtil;
+/**
+ * Represents a viewable user option.
+ *
+ * @author Alexander Ebert
+ * @copyright 2001-2012 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package com.woltlab.wcf
+ * @subpackage data.user.option
+ * @category Community Framework
+ */
class ViewableUserOption extends DatabaseObjectDecorator {
/**
* @see wcf\data\DatabaseObjectDecorator::$baseClass
* Represents a user option category.
*
* @author Marcel Werk
- * @copyright 2001-2010 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.user.option.category
- * @category Community Framework
+ * @category Community Framework
*/
class UserOptionCategory extends DatabaseObject {
/**
* Executes user option category-related actions.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.user.option.category
- * @category Community Framework
+ * @category Community Framework
*/
class UserOptionCategoryAction extends AbstractDatabaseObjectAction {
/**
* Provides functions to add, edit and delete user option categories.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.user.option.category
- * @category Community Framework
+ * @category Community Framework
*/
class UserOptionCategoryEditor extends DatabaseObjectEditor {
/**
<?php
namespace wcf\data\user\option\category;
use wcf\data\DatabaseObjectList;
-use wcf\system\database\util\ConditionBuilder;
-use wcf\system\WCF;
/**
* Represents an list of user option categories.
*
* @author Marcel Werk
- * @copyright 2001-2009 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.user.option.category
- * @category Community Framework
+ * @category Community Framework
*/
class UserOptionCategoryList extends DatabaseObjectList {
/**
abstract class AbstractForm extends AbstractPage implements IForm {
/**
* name of error field
- * @var string
+ * @var string
*/
public $errorField = '';
/**
* error type
- * @var string
+ * @var string
*/
public $errorType = '';
public $objectAction = null;
/**
- * @see wcf\form\IForm::submit()
+ * @see wcf\form\IForm::submit()
*/
public function submit() {
// call submit event
}
/**
- * @see wcf\form\IForm::readFormParameters()
+ * @see wcf\form\IForm::readFormParameters()
*/
public function readFormParameters() {
// call readFormParameters event
}
/**
- * @see wcf\form\IForm::validate()
+ * @see wcf\form\IForm::validate()
*/
public function validate() {
// call validate event
}
/**
- * @see wcf\form\IForm::save()
+ * @see wcf\form\IForm::save()
*/
public function save() {
// call save event
}
/**
- * @see wcf\page\IPage::readData()
+ * @see wcf\page\IPage::readData()
*/
public function readData() {
if (count($_POST) || count($_FILES)) {
}
/**
- * @see wcf\page\IPage::assignVariables()
+ * @see wcf\page\IPage::assignVariables()
*/
public function assignVariables() {
parent::assignVariables();
* A missing or invalid token will be result in a throw of a IllegalLinkException.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage form
- * @category Community Framework
+ * @category Community Framework
*/
abstract class AbstractSecureForm extends AbstractForm {
/**
- * @see wcf\form\IForm::readFormParameters()
+ * @see wcf\form\IForm::readFormParameters()
*/
public function readFormParameters() {
parent::readFormParameters();
* All form classes should implement this interface.
*
* @author Marcel Werk
- * @copyright 2001-2009 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage form
- * @category Community Framework
+ * @category Community Framework
*/
interface IForm extends IPage {
/**
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage page
- * @category Community Framework
+ * @category Community Framework
*/
abstract class AbstractAuthedPage extends AbstractPage {
/**
- * @see wcf\page\IPage::readParameters()
+ * @see wcf\page\IPage::readParameters()
*/
public function readParameters() {
parent::readParameters();
abstract class AbstractPage implements IPage, ITrackablePage {
/**
* name of the template for the called page
- * @var string
+ * @var string
*/
public $templateName = '';
/**
* value of the given action parameter
- * @var string
+ * @var string
*/
public $action = '';
/**
* needed permissions to view this page
- * @var array<string>
+ * @var array<string>
*/
public $neededPermissions = array();
/**
* enables the tracking of this page
- * @var boolean
+ * @var boolean
*/
public $enableTracking = false;
}
/**
- * @see wcf\page\IPage::readParameters()
+ * @see wcf\page\IPage::readParameters()
*/
public function readParameters() {
// call readParameters event
}
/**
- * @see wcf\page\IPage::readData()
+ * @see wcf\page\IPage::readData()
*/
public function readData() {
// call readData event
}
/**
- * @see wcf\page\IPage::assignVariables()
+ * @see wcf\page\IPage::assignVariables()
*/
public function assignVariables() {
// call assignVariables event
}
/**
- * @see wcf\page\IPage::checkModules()
+ * @see wcf\page\IPage::checkModules()
*/
public function checkModules() {
// call checkModules event
}
/**
- * @see wcf\page\IPage::checkPermissions()
+ * @see wcf\page\IPage::checkPermissions()
*/
public function checkPermissions() {
// call checkPermissions event
}
/**
- * @see wcf\page\IPage::show()
+ * @see wcf\page\IPage::show()
*/
public function show() {
// check if active user is logged in
// read data
$this->readData();
-
+
// try to guess template name
if (empty($this->templateName)) {
$classParts = explode('\\', get_class($this));
}
// assign variables
- $this->assignVariables();
+ $this->assignVariables();
// call show event
EventHandler::getInstance()->fireAction($this, 'show');
}
/**
- * @see wcf\page\ITrackablePage::isTracked()
+ * @see wcf\page\ITrackablePage::isTracked()
*/
public function isTracked() {
return $this->enableTracking;
}
/**
- * @see wcf\page\ITrackablePage::getController()
+ * @see wcf\page\ITrackablePage::getController()
*/
public function getController() {
return get_class($this);
}
/**
- * @see wcf\page\ITrackablePage::getParentObjectType()
+ * @see wcf\page\ITrackablePage::getParentObjectType()
*/
public function getParentObjectType() {
return '';
}
/**
- * @see wcf\page\ITrackablePage::getParentObjectID()
+ * @see wcf\page\ITrackablePage::getParentObjectID()
*/
public function getParentObjectID() {
return 0;
}
/**
- * @see wcf\page\ITrackablePage::getObjectType()
+ * @see wcf\page\ITrackablePage::getObjectType()
*/
public function getObjectType() {
return '';
}
/**
- * @see wcf\page\ITrackablePage::getObjectID()
+ * @see wcf\page\ITrackablePage::getObjectID()
*/
public function getObjectID() {
return 0;
* A missing or invalid token will be result in a throw of a IllegalLinkException.
*
* @author Marcel Werk
- * @copyright 2001-2009 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage page
- * @category Community Framework
+ * @category Community Framework
*/
abstract class AbstractSecurePage extends AbstractPage {
/**
- * @see wcf\page\IPage::readParameters()
+ * @see wcf\page\IPage::readParameters()
*/
public function readParameters() {
parent::readParameters();
* All page classes should implement this interface.
*
* @author Marcel Werk
- * @copyright 2001-2009 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage page
- * @category Community Framework
+ * @category Community Framework
*/
interface IPage {
/**
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage page
- * @category Community Framework
+ * @category Community Framework
*/
interface ITrackablePage {
/**
* Returns true if this page should be tracked.
*
- * @return boolean
+ * @return boolean
*/
public function isTracked();
/**
* Returns the controller name.
*
- * @return string
+ * @return string
*/
public function getController();
/**
* Returns the parent object type.
*
- * @return string
+ * @return string
*/
public function getParentObjectType();
/**
* Returns the parent object id.
*
- * @return integer
+ * @return integer
*/
public function getParentObjectID();
/**
* Returns the object type.
*
- * @return string
+ * @return string
*/
public function getObjectType();
/**
* Returns the object id.
*
- * @return integer
+ * @return integer
*/
public function getObjectID();
}
* Handles the page number parameter automatically.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage page
- * @category Community Framework
+ * @category Community Framework
*/
abstract class MultipleLinkPage extends AbstractPage {
/**
* current page number
- * @var integer
+ * @var integer
*/
public $pageNo = 0;
/**
* number of all pages
- * @var integer
+ * @var integer
*/
public $pages = 0;
/**
* number of items shown per page
- * @var integer
+ * @var integer
*/
public $itemsPerPage = 20;
/**
* number of all items
- * @var integer
+ * @var integer
*/
public $items = 0;
/**
* indicates the range of the listed items
- * @var integer
+ * @var integer
*/
public $startIndex = 0;
/**
* indicates the range of the listed items.
- * @var integer
+ * @var integer
*/
public $endIndex = 0;
/**
* selected sort field
- * @var string
+ * @var string
*/
public $sortField = '';
/**
* selected sort order
- * @var string
+ * @var string
*/
public $sortOrder = '';
public $sqlOrderBy = '';
/**
- * @see wcf\page\IPage::readParameters()
+ * @see wcf\page\IPage::readParameters()
*/
public function readParameters() {
parent::readParameters();
}
/**
- * @see wcf\page\IPage::readData()
+ * @see wcf\page\IPage::readData()
*/
public function readData() {
parent::readData();
/**
* Initializes DatabaseObjectList instance.
- */
+ */
protected function initObjectList() {
if (empty($this->objectListClassName)) {
throw new SystemException('DatabaseObjectList class name not specified.');
/**
* Reads object list.
- */
+ */
protected function readObjects() {
$this->objectList->sqlLimit = $this->sqlLimit;
$this->objectList->sqlOffset = $this->sqlOffset;
* Handles the sorting parameters automatically.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage page
- * @category Community Framework
+ * @category Community Framework
*/
abstract class SortablePage extends MultipleLinkPage {
/**
* default sort field
- * @var string
+ * @var string
*/
public $defaultSortField = '';
/**
* default sort order
- * @var string
+ * @var string
*/
public $defaultSortOrder = 'ASC';
public $validSortFields = array();
/**
- * @see wcf\page\IPage::readParameters()
+ * @see wcf\page\IPage::readParameters()
*/
public function readParameters() {
parent::readParameters();
}
/**
- * @see wcf\page\IPage::readData()
+ * @see wcf\page\IPage::readData()
*/
public function readData() {
$this->validateSortOrder();
switch ($this->sortOrder) {
case 'ASC':
- case 'DESC': break;
- default: $this->sortOrder = $this->defaultSortOrder;
+ case 'DESC':
+ break;
+
+ default:
+ $this->sortOrder = $this->defaultSortOrder;
}
}
/**
* Assigns default variables for the usage of the inline (javascript) calendar.
*
+ * @todo uses non-existing methods and properties
+ *
* @author Marcel Werk
- * @copyright 2001-2009 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage page.util
- * @category Community Framework
+ * @category Community Framework
*/
class InlineCalendar {
/**
* Represents a regex.
*
* @author Tim Düsterhus
- * @copyright 2011 - 2012 Tim Düsterhus
+ * @copyright 2011-2012 Tim Düsterhus
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system
*/
final class Regex {
/**
- * The delimiter that is used internally.
- *
+ * delimiter used internally
* @var string
*/
const REGEX_DELIMITER = '/';
/**
- * Do not apply any modifiers.
- *
+ * inidicates that no modifier is applied
* @var integer
*/
const MODIFIER_NONE = 0;
/**
- * Case insensitive matching.
- *
+ * indicates case insensitive matching
* @var integer
*/
const CASE_INSENSITIVE = 1;
/**
- * Ungreedy matching.
- *
+ * indicates ungreedy matching
* @var integer
*/
const UNGREEDY = 2;
/**
- * eval() replacement of Regex::replace()
- *
+ * indicates eval() replacement of Regex::replace()
* @var integer
*/
const EVAL_REPLACEMENT = 4;
/**
- * Do not spend extra time on analysing.
- *
+ * indicates that no extra time is spent on analysing
* @var integer
*/
const NO_ANALYSE = 8;
/**
- * Ignore whitepsace in regex.
- *
+ * indicates that whitespaces are igored in regex
* @var integer
*/
const IGNORE_WHITESPACE = 16;
/**
- * A dot matches every char.
- *
+ * indicates that a dot matches every char
* @var integer
*/
const DOT_ALL = 32;
/**
- * The compiled regex (:D)
- *
+ * compiled regex
* @var string
*/
private $regex = '';
/**
- * The last matches
- *
+ * last matches
* @var array
*/
private $matches = array();
/**
* Creates a regex.
- *
- * @param string $regex
- * @param integer $modifier
+ *
+ * @param string $regex
+ * @param integer $modifier
*/
public function __construct($regex, $modifier = self::MODIFIER_NONE) {
// escape delimiter
/**
* Checks whether the regex is syntactically correct.
- *
+ *
* @return boolean
*/
public function isValid() {
/**
* Checks whether the regex matches the given string.
*
- * @param string $string String to match.
- * @param boolean $all Find all matches.
- * @return integer Return value of preg_match(_all)
+ * @param string $string string to match
+ * @param boolean $all indicates if all matches are collected
+ * @return integer return value of preg_match(_all)
*/
public function match($string, $all = false) {
if ($all) {
/**
* Replaces part of the string with the regex.
- *
- * @param string $string String to work on.
- * @param mixed $replacement Either replacement-string or instance of \wcf\system\Callback
+ *
+ * @param string $string
+ * @param mixed $replacement replacement-string or instance of wcf\system\Callback
* @return string
*/
public function replace($string, $replacement) {
/**
* Splits the string with the regex.
- *
- * @param string $string String to split.
+ *
+ * @param string $string
* @return array<string>
*/
public function split($string) {
/**
* Checks whether there was success.
- *
- * @param mixed $result
+ *
+ * @param mixed $result
+ * @param string $method
*/
private function checkResult($result, $method = '') {
if ($result === false || $result === null) {
/**
* Returns the matches of the last string.
- *
+ *
* @return array
*/
public function getMatches() {
/**
* Returns the compiled regex.
- *
+ *
* @return string
*/
public function getRegex() {
* Basis class for singleton classes.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system
- * @category Community Framework
+ * @category Community Framework
*/
abstract class SingletonFactory {
/**
/**
* WCF is the central class for the community framework.
* It holds the database connection, access to template and language engine.
- *
- * @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ *
+ * @author Marcel Werk
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system
- * @category Community Framework
+ * @category Community Framework
*/
class WCF {
/**
/**
* list of autoload directories
- * @var array
+ * @var array
*/
protected static $autoloadDirectories = array();
/**
* database object
- * @var wcf\system\database\Database
+ * @var wcf\system\database\Database
*/
protected static $dbObj = null;
/**
* language object
- * @var wcf\system\language\Language
+ * @var wcf\system\language\Language
*/
protected static $languageObj = null;
/**
* session object
- * @var wcf\system\session\SessionHandler
+ * @var wcf\system\session\SessionHandler
*/
protected static $sessionObj = null;
/**
* template object
- * @var wcf\system\template\TemplateEngine
+ * @var wcf\system\template\TemplateEngine
*/
protected static $tplObj = null;
}
}
}
-
+
if (function_exists('set_magic_quotes_runtime')) {
@set_magic_quotes_runtime(0);
}
/**
* Returns the database object.
- *
+ *
* @return wcf\system\database\Database
*/
public static final function getDB() {
/**
* Returns the session object.
- *
+ *
* @return wcf\system\session\SessionHandler
*/
public static final function getSession() {
/**
* Returns the user object.
- *
+ *
* @return wcf\data\user\User
*/
public static final function getUser() {
/**
* Returns the language object.
- *
- * @return wcf\data\language\Language
+ *
+ * @return wcf\data\language\Language
*/
public static final function getLanguage() {
return self::$languageObj;
/**
* Returns the template object.
- *
+ *
* @return wcf\system\template\TemplateEngine
*/
public static final function getTPL() {
/**
* Calls the show method on the given exception.
- *
+ *
* @param \Exception $e
*/
public static final function handleException(\Exception $e) {
/**
* Catches php errors and throws instead a system exception.
- *
+ *
* @param integer $errorNo
* @param string $message
* @param string $filename
/**
* Loads an application.
- *
+ *
* @param wcf\data\application\Application $application
* @param boolean $isDependentApplication
- */
+ */
protected function loadApplication(Application $application, $isDependentApplication = false) {
$package = PackageCache::getInstance()->getPackage($application->packageID);
/**
* Wrapper for the getter methods of this class.
- *
+ *
* @param string $name
* @return mixed value
*/
/**
* Changes the active language.
- *
+ *
* @param integer $languageID
*/
public static final function setLanguage($languageID) {
/**
* Returns dynamically loaded core objects.
- *
+ *
* @param string $name
* @param array $arguments
*/
/**
* Searches for cached core object definition.
- *
+ *
* @param string $className
* @return string
*/
/**
* Returns true if the debug mode is enabled, otherwise false.
*
- * @return boolean
+ * @return boolean
*/
public static function debugModeIsEnabled() {
if (defined('ENABLE_DEBUG_MODE') && ENABLE_DEBUG_MODE) return true;
/**
* Returns true if benchmarking is enabled, otherwise false.
*
- * @return boolean
+ * @return boolean
*/
public static function benchmarkIsEnabled() {
// benchmarking is enabled by default
/**
* Extends WCF class with functions for the admin control panel.
*
- * @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Marcel Werk
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system
- * @category Community Framework
+ * @category Community Framework
*/
class WCFACP extends WCF {
/**
}
/**
- * @see wcf\system\WCF::assignDefaultTemplateVariables()
+ * @see wcf\system\WCF::assignDefaultTemplateVariables()
*/
protected function assignDefaultTemplateVariables() {
parent::assignDefaultTemplateVariables();
self::getTPL()->assign(array(
'baseHref' => $host . $path,
'quickAccessPackages' => $this->getQuickAccessPackages(),
- //'timezone' => util\DateUtil::getTimezone()
+ // todo: 'timezone' => util\DateUtil::getTimezone()
));
}
/**
- * @see WCF::loadDefaultCacheResources()
+ * @see WCF::loadDefaultCacheResources()
*/
protected function loadDefaultCacheResources() {
parent::loadDefaultCacheResources();
define('PACKAGE_ID', $packageID);
}
- /*
+ /* todo
$packageID = 0;
$packages = CacheHandler::getInstance()->get('packages');
if (isset($_REQUEST['packageID'])) $packageID = intval($_REQUEST['packageID']);
/**
* WCFSetup executes the installation of the basic wcf systems.
*
- * @author Marcel Werk
+ * @author Marcel Werk
* @copyright 2001-2011 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system
- * @category Community Framework
+ * @category Community Framework
*/
class WCFSetup extends WCF {
+ /**
+ * list of available languages
+ * @var array
+ */
protected static $availableLanguages = array();
+
+ /**
+ * language code of selected installation language
+ * @var string
+ */
protected static $selectedLanguageCode = 'en';
+
+ /**
+ * selected languages to be installed
+ * @var array
+ */
protected static $selectedLanguages = array();
+
+ /**
+ * directory of the framework
+ * @var string
+ */
protected static $wcfDir = '';
+
+ /**
+ * list of installed files
+ * @var array
+ */
protected static $installedFiles = array();
+
+ /**
+ * name of installed primary application
+ * @var string
+ */
protected static $setupPackageName = 'WoltLab Community Framework';
+
+ /**
+ * indicates if developer mode is used to install
+ * @var boolean
+ */
protected static $developerMode = 0;
+
+ /**
+ * supported databases
+ * @var array<array>
+ */
protected static $dbClasses = array(
- 'MySQLDatabase' => array('class' => 'wcf\system\database\MySQLDatabase', 'minversion' => '5.1.17'), // MySQL 5.0.0+
+ 'MySQLDatabase' => array('class' => 'wcf\system\database\MySQLDatabase', 'minversion' => '5.1.17'), // MySQL 5.1.17+
'PostgreSQLDatabase' => array('class' => 'wcf\system\database\PostgreSQLDatabase', 'minversion' => '8.2.0') // PostgreSQL 8.2.0+
);
/**
* Gets the available database classes.
- *
+ *
* @return array
*/
protected static function getAvailableDBClasses() {
return $availableDBClasses;
}
-
+
/**
* Gets the selected wcf dir from request.
*/
define('WCF_DIR', self::$wcfDir);
}
-
+
/**
* Initialises the language engine.
*/
/**
* Returns all languages from WCFSetup.tar.gz.
- *
+ *
* @return array
*/
protected static function getAvailableLanguages() {
}
}
$tar->close();
-
+
// sort languages by language name
asort($languages);
-
+
return $languages;
}
/**
* Calculates the current state of the progress bar.
- *
+ *
* @param integer $currentStep
*/
protected function calcProgress($currentStep) {
// get current step
if (isset($_REQUEST['step'])) $step = $_REQUEST['step'];
else $step = 'selectSetupLanguage';
-
+
// execute current step
switch ($step) {
case 'selectSetupLanguage':
$this->selectSetupLanguage();
break;
}
-
+
case 'showLicense':
if (!self::$developerMode) {
$this->calcProgress(1);
$this->showLicense();
break;
}
-
+
case 'showSystemRequirements':
if (!self::$developerMode) {
$this->calcProgress(2);
$this->showSystemRequirements();
break;
}
-
+
case 'searchWcfDir':
$this->calcProgress(3);
$this->searchWcfDir();
- break;
-
+ break;
+
case 'unzipFiles':
$this->calcProgress(4);
$this->unzipFiles();
- break;
-
+ break;
+
case 'selectLanguages':
$this->calcProgress(5);
$this->selectLanguages();
- break;
-
+ break;
+
case 'configureDB':
$this->calcProgress(6);
$this->configureDB();
- break;
-
+ break;
+
case 'createDB':
$this->calcProgress(7);
$this->createDB();
- break;
-
+ break;
+
case 'logFiles':
$this->calcProgress(8);
$this->logFiles();
- break;
-
+ break;
+
case 'installLanguage':
$this->calcProgress(9);
$this->installLanguage();
- break;
-
+ break;
+
case 'createUser':
$this->calcProgress(10);
$this->createUser();
- break;
-
+ break;
+
case 'installPackages':
$this->calcProgress(11);
$this->installPackages();
- break;
+ break;
}
}
/**
* Checks if in the chosen database are tables in conflict with the wcf tables
* which will be created in the next step.
- *
- * @param Database $db
- * @param integer $dbNumber
+ *
+ * @param wcf\system\database\Database $db
+ * @param integer $dbNumber
*/
protected function getConflictedTables($db, $dbNumber) {
// get content of the sql structure file
/**
* Scans the given dir for installed files.
- *
- * @param string $dir
+ *
+ * @param string $dir
*/
protected function getInstalledFiles($dir) {
if ($files = glob($dir.'*')) {
/**
* Goes to the next step.
- *
+ *
* @param string $nextStep
*/
protected function gotoNextStep($nextStep) {
/**
* Default implementation for all applications for community framework.
*
- * @author Alexander Ebert
+ * @author Alexander Ebert
* @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.application
- * @category Community Framework
+ * @category Community Framework
*/
abstract class AbstractApplication extends SingletonFactory implements IApplication {
/**
* Handles multi-application environments.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-20121 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.application
- * @category Community Framework
+ * @category Community Framework
*/
class ApplicationHandler extends SingletonFactory {
/**
/**
* Default interface for all applications for the community framework.
*
- * @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Alexander Ebert
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.application
- * @category Community Framework
+ * @category Community Framework
*/
interface IApplication {
/**
* Provides functions to do a benchmark.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.benchmark
- * @category Community Framework
+ * @category Community Framework
*/
class Benchmark extends SingletonFactory {
const TYPE_SQL_QUERY = 1;
/**
* general benchmark start time
- * @var float
+ * @var float
*/
protected $startTime = 0;
/**
* benchmark items
- * @var array
+ * @var array
*/
protected $items = array();
/**
* number of executed sql queries
- * @var integer
+ * @var integer
*/
protected $queryCount = 0;
/**
* total sql query execution time
- * @var float
+ * @var float
*/
protected $queryTime = 0;
-
+
/**
* Creates a new Benchmark object.
*/
protected function init() {
$this->startTime = self::getMicrotime();
}
-
+
/**
* Starts a benchmark.
*
$this->items[$newIndex]['start'] = self::compareMicrotimes($this->startTime, $this->items[$newIndex]['before']);
return $newIndex;
}
-
+
/**
* Stops an active benchmark.
*
if ($index === null) {
$index = count($this->items) - 1;
}
-
+
$this->items[$index]['after'] = self::getMicrotime();
$this->items[$index]['use'] = self::compareMicrotimes($this->items[$index]['before'], $this->items[$index]['after']);
$this->items[$index]['end'] = self::compareMicrotimes($this->startTime, $this->items[$index]['after']);
$this->queryCount++;
$this->queryTime += $this->items[$index]['use'];
}
-
-
}
-
+
/**
* Returns the execution time.
*
- * @return float
+ * @return float
*/
public function getExecutionTime() {
return $this->compareMicrotimes($this->startTime, self::getMicrotime());
/**
* Returns the sql query execution time
*
- * @return float
+ * @return float
*/
public function getQueryExecutionTime() {
return $this->queryTime;
/**
* Returns the number of executed sql queries.
*
- * @return integer
+ * @return integer
*/
public function getQueryCount() {
return $this->queryCount;
/**
* Returns the logged items.
*
- * @return array
+ * @return array
*/
public function getItems() {
return $this->items;
protected static function getMicrotime() {
return microtime(true);
}
-
+
/**
* Calculates the difference of two unix timestamps.
*
* Represents a breadcrumb.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.breadcrumb
- * @category Community Framework
+ * @category Community Framework
*/
class Breadcrumb {
/**
* Sets the displayed label.
*
* @param string $label
- */
+ */
public function setLabel($label) {
$this->label = $label;
}
*
* @param string $url
* @param boolean $appendSession
- */
+ */
public function setURL($url, $appendSession = false) {
// append session id
if ($appendSession) {
* Manages breadcrumbs.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.breadcrumb
- * @category Community Framework
+ * @category Community Framework
*/
class Breadcrumbs extends SingletonFactory implements \Countable, \Iterator {
/**
* list of breadcrumbs
* @var array<wcf\system\breadcrumb\Breadcrumb>
- */
+ */
protected $items = array();
/**
* Adds a breadcrumb (insertion order is crucial!).
*
* @param wcf\system\breadcrumb\Breadcrumb $item
- */
+ */
public function add(Breadcrumb $item) {
$this->items[] = $item;
}
* Returns the list of breadcrumbs.
*
* @return array<wcf\system\breadcrumb\Breadcrumb>
- */
+ */
public function get() {
return $this->items;
}
}
/**
- * @see \Countable::count()
+ * @see \Countable::count()
*/
public function count() {
return count($this->items);
}
/**
- * @see \Iterator::current()
+ * @see \Iterator::current()
*/
public function current() {
return $this->items[$this->index];
}
/**
- * @see \Iterator::key()
+ * @see \Iterator::key()
*/
public function key() {
return $this->index;
}
/**
- * @see \Iterator::valid()
+ * @see \Iterator::valid()
*/
public function valid() {
return isset($this->items[$this->index]);
}
/**
- * @see \Iterator::rewind()
+ * @see \Iterator::rewind()
*/
public function rewind() {
$this->index = 0;
}
/**
- * @see \Iterator::next()
+ * @see \Iterator::next()
*/
public function next() {
$this->index++;
/**
* Interface for breadcrumb provider.
- *
+ *
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.breadcrumb
- * @category Community Framework
+ * @category Community Framework
*/
interface IBreadcrumbProvider {
/**
* CacheHandler holds all registered cache resources.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.cache
- * @category Community Framework
+ * @category Community Framework
*/
class CacheHandler extends SingletonFactory {
/**
* registered cache resources
- * @var array
+ * @var array
*/
protected $cacheResources = array();
/**
* Marks cached files as obsolete.
- *
+ *
* @param string $directory
* @param string $filepattern
*/
/**
* Returns a cached variable.
- *
+ *
* @param string $cache
* @param string $variable
* @return mixed $value
/**
* Returns the cache source object.
- *
+ *
* @return wcf\system\cache\source\ICacheSource
*/
public function getCacheSource() {
* Caches the acp menu items tree.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class ACPMenuCacheBuilder implements ICacheBuilder {
protected $optionCategoryStructure = array();
-
+
/**
* @see wcf\system\cache\ICacheBuilder::getData()
*/
public function getData(array $cacheResource) {
list($cache, $packageID) = explode('-', $cacheResource['cache']);
$data = array();
-
+
// get all menu items and filter menu items with low priority
$sql = "SELECT menuItem, menuItemID
FROM wcf".WCF_N."_acp_menu_item menu_item
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.cache.builder
- * @category Community Framework
+ * @category Community Framework
*/
class ACPSearchProviderCacheBuilder implements ICacheBuilder {
/**
- * @see wcf\system\cache\ICacheBuilder::getData()
+ * @see wcf\system\cache\ICacheBuilder::getData()
*/
public function getData(array $cacheResource) {
$providerList = new ACPSearchProviderList();
* Caches applications.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class ApplicationCacheBuilder implements ICacheBuilder {
/**
- * @see wcf\system\cache\ICacheBuilder::getData()
+ * @see wcf\system\cache\ICacheBuilder::getData()
*/
public function getData(array $cacheResource) {
list($cache, $packageID) = explode('-', $cacheResource['cache']);
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.cache.builder
- * @category Community Framework
+ * @category Community Framework
*/
class CategoryCacheBuilder implements ICacheBuilder {
/**
- * @see wcf\system\cache\ICacheBuilder::getData()
+ * @see wcf\system\cache\ICacheBuilder::getData()
*/
public function getData(array $cacheResource) {
$list = new CategoryList();
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.cache.builder
- * @category Community Framework
+ * @category Community Framework
*/
class CleanupAdapterCacheBuilder implements ICacheBuilder {
/**
- * @see wcf\system\cache\ICacheBuilder::getData()
+ * @see wcf\system\cache\ICacheBuilder::getData()
*/
public function getData(array $cacheResource) {
list($cache, $packageID) = explode('-', $cacheResource['cache']);
* Caches clipboard actions.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class ClipboardActionCacheBuilder implements ICacheBuilder {
/**
- * @see wcf\system\cache\ICacheBuilder::getData()
+ * @see wcf\system\cache\ICacheBuilder::getData()
*/
public function getData(array $cacheResource) {
$actionList = new ClipboardActionList();
* Caches clipboard pages.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class ClipboardPageCacheBuilder implements ICacheBuilder {
/**
- * @see wcf\system\cache\ICacheBuilder::getData()
+ * @see wcf\system\cache\ICacheBuilder::getData()
*/
public function getData(array $cacheResource) {
$conditions = new PreparedStatementConditionBuilder();
* Caches the core objects.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class CoreObjectCacheBuilder implements ICacheBuilder {
/**
* Caches cronjob information.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class CronjobCacheBuilder implements ICacheBuilder {
/**
- * @see wcf\system\cache\ICacheBuilder::getData()
+ * @see wcf\system\cache\ICacheBuilder::getData()
*/
public function getData(array $cacheResource) {
// get next execution time
* Caches the event listeners.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class EventListenerCacheBuilder implements ICacheBuilder {
/**
- * @see wcf\system\cache\ICacheBuilder::getData()
+ * @see wcf\system\cache\ICacheBuilder::getData()
*/
public function getData(array $cacheResource) {
list($cache, $packageID) = explode('-', $cacheResource['cache']);
* A CacheBuilder provides data to the CacheHandler that ought to be cached.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.cache
- * @category Community Framework
+ * @category Community Framework
*/
interface ICacheBuilder {
/**
* Returns the data that ought to be cached.
- *
- * @param array $cacheResource
- * @return array
+ *
+ * @param array $cacheResource
+ * @return array
*/
public function getData(array $cacheResource);
}
* Caches the paths of icons.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class IconCacheBuilder implements ICacheBuilder {
/**
public function getData(array $cacheResource) {
list($cache, $packageID, $styleID) = explode('-', $cacheResource['cache']);
$data = array();
-
+
// get active package
$activePackage = new Package($packageID);
$activePackageDir = FileUtil::getRealPath(WCF_DIR.$activePackage->packageDir);
* and the id of the default language.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class LanguageCacheBuilder implements ICacheBuilder {
/**
- * @see wcf\system\cache\ICacheBuilder::getData()
+ * @see wcf\system\cache\ICacheBuilder::getData()
*/
public function getData(array $cacheResource) {
$data = array(
* Caches object types and object type definitions.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class ObjectTypeCacheBuilder implements ICacheBuilder {
/**
'definitions' => array(),
'objectTypes' => array()
);
-
+
// get definitions
$sql = "SELECT object_type_definition.*
FROM wcf".WCF_N."_package_dependency package_dependency,
$data['categories'][$row['categoryName']][] = $row['definitionID'];
}
}
-
+
// get object types
$sql = "SELECT object_type.*
FROM wcf".WCF_N."_package_dependency package_dependency,
* Caches the options and option categories
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class OptionCacheBuilder implements ICacheBuilder {
/**
- * @see wcf\system\cache\ICacheBuilder::getData()
+ * @see wcf\system\cache\ICacheBuilder::getData()
*/
public function getData(array $cacheResource) {
$information = explode('-', $cacheResource['cache']);
* Caches all registered packages.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class PackageCacheBuilder implements ICacheBuilder {
/**
- * @see wcf\system\cache\ICacheBuilder::getData()
+ * @see wcf\system\cache\ICacheBuilder::getData()
*/
public function getData(array $cacheResource) {
$packageList = new PackageList();
* Caches the dependencies of a package.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class PackageDependencyCacheBuilder implements ICacheBuilder {
/**
- * @see wcf\system\cache\ICacheBuilder::getData()
+ * @see wcf\system\cache\ICacheBuilder::getData()
*/
public function getData(array $cacheResource) {
list($cache, $packageID) = explode('-', $cacheResource['cache']);
* Caches the page menu items.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class PageMenuCacheBuilder implements ICacheBuilder {
/**
- * @see wcf\system\cache\ICacheBuilder::getData()
+ * @see wcf\system\cache\ICacheBuilder::getData()
*/
public function getData(array $cacheResource) {
list($cache, $packageID) = explode('-', $cacheResource['cache']);
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.cache.builder
- * @category Community Framework
+ * @category Community Framework
*/
class SitemapCacheBuilder implements ICacheBuilder {
/**
- * @see wcf\system\cache\ICacheBuilder::getData()
+ * @see wcf\system\cache\ICacheBuilder::getData()
*/
public function getData(array $cacheResource) {
$sitemapList = new SitemapList();
* Caches the list of search engine spiders.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class SpiderCacheBuilder implements ICacheBuilder {
/**
- * @see wcf\system\cache\ICacheBuilder::getData()
+ * @see wcf\system\cache\ICacheBuilder::getData()
*/
public function getData(array $cacheResource) {
$spiderList = new SpiderList();
* Caches the styles and style variables.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class StyleCacheBuilder implements ICacheBuilder {
/**
- * @see wcf\system\cache\ICacheBuilder::getData()
+ * @see wcf\system\cache\ICacheBuilder::getData()
*/
public function getData(array $cacheResource) {
$data = array(
* Caches the structure of templates.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class TemplateCacheBuilder implements ICacheBuilder {
/**
- * @see wcf\system\cache\ICacheBuilder::getData()
+ * @see wcf\system\cache\ICacheBuilder::getData()
*/
public function getData(array $cacheResource) {
$information = explode('-', $cacheResource['cache']);
* Caches template groups.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class TemplateGroupCacheBuilder implements ICacheBuilder {
/**
- * @see wcf\system\cache\ICacheBuilder::getData()
+ * @see wcf\system\cache\ICacheBuilder::getData()
*/
public function getData(array $cacheResource) {
$templateGroupList = new TemplateGroupList();
* Caches template listener information.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class TemplateListenerCacheBuilder implements ICacheBuilder {
/**
* Caches template listener code.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.cache.builder
*/
class TemplateListenerCodeCacheBuilder implements ICacheBuilder {
/**
- * @see wcf\system\cache\ICacheBuilder::getData()
+ * @see wcf\system\cache\ICacheBuilder::getData()
*/
public function getData(array $cacheResource) {
list($packageID, $environment, $templateName) = explode('-', $cacheResource['cache']);
* Caches all user groups.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class UserGroupCacheBuilder implements ICacheBuilder {
/**
- * @see wcf\system\cache\ICacheBuilder::getData()
+ * @see wcf\system\cache\ICacheBuilder::getData()
*/
public function getData(array $cacheResource) {
- $data = array('types' => array(), 'groups' => array());
-
+ $data = array(
+ 'types' => array(),
+ 'groups' => array()
+ );
+
// get all user groups
$groupList = new UserGroupList();
$groupList->sqlLimit = 0;
* Caches the merged group options of a group combination.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class UserGroupPermissionCacheBuilder implements ICacheBuilder {
/**
protected $typeObjects = array();
/**
- * @see wcf\system\cache\ICacheBuilder::getData()
+ * @see wcf\system\cache\ICacheBuilder::getData()
*/
public function getData(array $cacheResource) {
list($cache, $packageID, $groupIDs) = explode('-', $cacheResource['cache']);
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.cache.source
- * @category Community Framework
+ * @category Community Framework
*/
class ApcCacheSource implements ICacheSource {
/**
* DiskCacheSource is an implementation of CacheSource that stores the cache as simple files in the file system.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.cache.source
- * @category Community Framework
+ * @category Community Framework
*/
class DiskCacheSource implements ICacheSource {
/**
- * Loaded cache
- *
+ * loaded cache
* @var array
*/
protected $cache = null;
/**
- * List of loaded resources
- *
+ * list of loaded resources
* @var array
*/
protected $loaded = array();
if (!@touch($cacheResource['file'], 1)) {
@unlink($cacheResource['file']);
}
-
+
// reset open cache
if (isset($this->cache[$cacheResource['cache']])) {
unset($this->cache[$cacheResource['cache']]);
}
/**
- * @see wcf\system\cache\source\ICacheSource::clear()
+ * @see wcf\system\cache\source\ICacheSource::clear()
*/
public function clear($directory, $filepattern) {
// unify parameters
if (substr($directory, -1) != '/') {
$directory .= '/';
}
-
+
DirectoryUtil::getInstance($directory)->executeCallback(new Callback(function ($filename) {
if (!@touch($filename, 1)) {
@unlink($filename);
/**
* Determines wheater the cache needs to be rebuild or not.
- *
- * @param array $cacheResource
- * @return boolean $needRebuilt
+ *
+ * @param array $cacheResource
+ * @return boolean
*/
protected function needRebuild(array $cacheResource) {
// cache does not exist
/**
* Loads a cached resource.
*
- * @param array $cacheResource
+ * @param array $cacheResource
*/
public function load(array $cacheResource) {
if (!isset($this->loaded[$cacheResource['file']])) {
/**
* Loads the file of a cached resource.
*
- * @param array $cacheResource
+ * @param array $cacheResource
*/
protected function loadCacheFile(array $cacheResource) {
// get file contents
}
/**
- * @see wcf\system\cache\source\ICacheSource::close()
+ * @see wcf\system\cache\source\ICacheSource::close()
*/
public function close() {
// does nothing
}
/**
- * @see wcf\system\cache\source\ICacheSource::flush()
+ * @see wcf\system\cache\source\ICacheSource::flush()
*/
public function flush() {
$sql = "SELECT package.packageDir
* Any cache sources should implement this interface.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.cache.source
- * @category Community Framework
+ * @category Community Framework
*/
interface ICacheSource {
/**
* Returns a cached variable.
- *
+ *
* @param array $cacheResource
* @return mixed
*/
/**
* Stores a variable in the cache.
- *
+ *
* @param array $cacheResource
* @param mixed $value
*/
/**
* Deletes a variable in the cache.
- *
+ *
* @param array $cacheResource
*/
public function delete(array $cacheResource);
/**
* Marks cached files as obsolete.
- *
+ *
* @param string $directory
* @param string $filepattern
*/
* Provides a global adapter for accessing the memcache server.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.cache.source
- * @category Community Framework
+ * @category Community Framework
*/
class MemcacheAdapter extends SingletonFactory {
/**
* memcache object
- *
* @var Memcache
*/
private $memcache = null;
if (!class_exists('Memcache')) {
throw new SystemException('memcache support is not enabled.');
}
-
+
// init memcache
$this->memcache = new \Memcache();
/**
* Returns the memcache object.
*
- * @return Memcache
+ * @return Memcache
*/
public function getMemcache() {
return $this->memcache;
* MemcacheCacheSource is an implementation of CacheSource that uses a Memcache server to store cached variables.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.cache.source
- * @category Community Framework
+ * @category Community Framework
*/
class MemcacheCacheSource implements ICacheSource {
/**
* MemcacheAdapter object
- *
- * @var MemcacheAdapter
+ * @var wcf\system\cache\source\MemcacheAdapter
*/
protected $adapter = null;
/**
* list of cache resources
- *
* @var array<string>
*/
protected $cacheResources = null;
/**
* list of new cache resources
- *
* @var array<string>
*/
protected $newLogEntries = array();
/**
* list of obsolete resources
- *
* @var array<string>
*/
protected $obsoleteLogEntries = array();
/**
* Returns the memcache adapter.
- *
+ *
* @return MemcacheAdapter
*/
public function getAdapter() {
/**
* Adds a cache resource to cache log.
- *
+ *
* @param string $cacheResource
*/
protected function addToLog($cacheResource) {
/**
* Removes an obsolete cache resource from cache log.
- *
+ *
* @param string $cacheResource
*/
protected function removeFromLog($cacheResource) {
}
/**
- * @see wcf\system\cache\source\ICacheSource::clear()
+ * @see wcf\system\cache\source\ICacheSource::clear()
*/
public function clear($directory, $filepattern) {
$this->loadLog();
}
/**
- * @see wcf\system\cache\source\ICacheSource::flush()
+ * @see wcf\system\cache\source\ICacheSource::flush()
*/
public function flush() {
// clear cache
public function close() {
// update log
$this->updateLog();
+
// close connection
+ // @todo
// if ($this->getAdapter() !== null && $this->getAdapter()->getMemcache() !== null) $this->getAdapter()->getMemcache()->close();
}
}
*/
public function get(array $cacheResource) {
if (!isset($this->cache[$cacheResource['cache']])) return null;
-
+
return $this->cache[$cacheResource['cache']];
}
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.category
- * @category Community Framework
+ * @category Community Framework
*/
abstract class AbstractCategoryType extends SingletonFactory implements ICategoryType {
/**
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.category
- * @category Community Framework
+ * @category Community Framework
*/
class CategoryHandler extends SingletonFactory {
/**
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.category
- * @category Community Framework
+ * @category Community Framework
*/
interface ICategoryType {
/**
* Handles cleanup related actions.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.cleanup
- * @category Community Framework
+ * @category Community Framework
*/
class CleanupHandler {
/**
* Default interface for cleanup adapters.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.cleanup
- * @category Community Framework
+ * @category Community Framework
*/
interface ICleanupAdapter {
/**
/**
* Represents a clipboard item for inline editing.
- *
- * @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ *
+ * @author Alexander Ebert
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.clipboard
- * @category Community Framework
+ * @category Community Framework
*/
final class ClipboardEditorItem {
/**
* Handles clipboard-related actions.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.clipboard
- * @category Community Framework
+ * @category Community Framework
*/
class ClipboardHandler extends SingletonFactory {
/**
* Basic interface for all clipboard editor actions.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.clipboard.action
- * @category Community Framework
+ * @category Community Framework
*/
interface IClipboardAction {
/**
* Prepares clipboard editor items for user objects.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.clipboard.action
- * @category Community Framework
+ * @category Community Framework
*/
class UserClipboardAction implements IClipboardAction {
/**
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.cronjob
- * @category Community Framework
+ * @category Community Framework
*/
abstract class AbstractCronjob implements ICronjob {
/**
* Executes cleanup adapters.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.cronjob
- * @category Community Framework
+ * @category Community Framework
*/
class CleanupListenerCronjob implements ICronjob {
/**
* Provides functions to execute cronjobs.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.cronjob
- * @category Community Framework
+ * @category Community Framework
*/
class CronjobScheduler extends SingletonFactory {
/**
'success' => 0,
'error' => $errString
));
- }
+ }
else {
$logEditor->update(array(
'success' => 1
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.cronjob
- * @category Community Framework
+ * @category Community Framework
*/
class DailyCleanUpCronjob extends AbstractCronjob {
/**
- * @see wcf\system\cronjob\ICronjob::execute()
+ * @see wcf\system\cronjob\ICronjob::execute()
*/
public function execute(Cronjob $cronjob) {
parent::execute($cronjob);
<?php
namespace wcf\system\cronjob;
use wcf\data\cronjob\Cronjob;
-use wcf\data\package\update\PackageUpdate;
/**
* Gets update package information.
*
* @author Siegfried Schweizer
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.cronjob
- * @category Community Framework
+ * @category Community Framework
*/
class GetUpdateInfoCronjob implements ICronjob {
/**
* @see wcf\system\ICronjob::execute()
- * @TODO Change path and move method to lib/system/package
*/
public function execute(Cronjob $cronjob) {
- //PackageUpdate::refreshPackageDatabaseAutomatically();
+ // TODO
}
}
<?php
namespace wcf\system\cronjob;
use wcf\data\cronjob\Cronjob;
-use wcf\system\WCF;
/**
* Cronjob for a hourly system cleanup.
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.cronjob
- * @category Community Framework
+ * @category Community Framework
*/
class HourlyCleanUpCronjob extends AbstractCronjob {
/**
use wcf\data\cronjob\Cronjob;
/**
- * Any Cronjob should implement this interface.
+ * Any cronjob should implement this interface.
*
* @author Siegfried Schweizer
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.cronjob
- * @category Community Framework
+ * @category Community Framework
*/
interface ICronjob {
/**
* @todo Add xsd to spiderlist on server
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.cronjob
- * @category Community Framework
+ * @category Community Framework
*/
class RefreshSearchRobotsCronjob implements ICronjob {
/**
- * @see wcf\system\ICronjob::execute()
+ * @see wcf\system\ICronjob::execute()
*/
public function execute(Cronjob $cronjob) {
$filename = FileUtil::downloadFileFromHttp('http://www.woltlab.com/spiderlist/spiderlist.xml', 'spiders');
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.cronjob
- * @category Community Framework
+ * @category Community Framework
*/
class SessionCleanUpCronjob extends AbstractCronjob {
/**
- * @see wcf\system\cronjob\ICronjob::execute()
+ * @see wcf\system\cronjob\ICronjob::execute()
*/
public function execute(Cronjob $cronjob) {
parent::execute($cronjob);
* This is an abstract implementation of a database access class using PDO.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.database
- * @category Community Framework
+ * @category Community Framework
*/
abstract class Database {
/**
- * Name of the class used for prepared statements.
+ * name of the class used for prepared statements
* @var string
*/
protected $preparedStatementClassName = 'wcf\system\database\statement\PreparedStatement';
-
+
/**
- * Name of the database editor class
+ * name of the database editor class
* @var string
*/
protected $editorClassName = 'wcf\system\database\editor\DatabaseEditor';
/**
* sql server hostname
- * @var string
+ * @var string
*/
protected $host = '';
/**
* sql server post
- * @var integer
+ * @var integer
*/
protected $port = 0;
/**
* sql server login name
- * @var string
+ * @var string
*/
protected $user = '';
/**
* sql server login password
- * @var string
+ * @var string
*/
protected $password = '';
/**
* database name
- * @var string
+ * @var string
*/
protected $database = '';
/**
* number of executed queries
- * @var integer
+ * @var integer
*/
protected $queryCount = 0;
/**
* database editor object
- * @var wcf\system\database\editor\DatabaseEditor
+ * @var wcf\system\database\editor\DatabaseEditor
*/
protected $editor = null;
/**
* Returns ID from last insert.
- *
- * @param string $table
+ *
+ * @param string $table
* @param string $field
- * @return integer last insert ID
+ * @return integer last insert ID
*/
public function getInsertID($table, $field) {
try {
/**
* Initiates a transaction.
- *
+ *
* @return boolean true on success
*/
public function beginTransaction() {
/**
* Commits a transaction.
- *
- * @return boolean true on success
+ *
+ * @return boolean true on success
*/
public function commitTransaction() {
try {
/**
* Rolls back a transaction.
- *
- * @return boolean true on success
+ *
+ * @return boolean true on success
*/
public function rollBackTransaction() {
try {
/**
* Prepares a statement for execution and returns a statement object.
- *
+ *
* @param string $statement
* @param integer $limit
- * @param integer $offset
+ * @param integer $offset
* @return wcf\system\database\statement\PreparedStatement
*/
public function prepareStatement($statement, $limit = 0, $offset = 0) {
* @param string $query
* @param integer $limit
* @param integer $offset
- * @return string $query
+ * @return string
*/
public function handleLimitParameter($query, $limit = 0, $offset = 0) {
if ($limit != 0) {
$query .= " LIMIT " . $limit . " OFFSET " . $offset;
}
-
+
return $query;
}
/**
* Returns the number of the last error.
*
- * @return integer
+ * @return integer
*/
public function getErrorNumber() {
if ($this->pdo !== null) return $this->pdo->errorCode();
return 0;
}
-
+
/**
* Returns the description of the last error.
*
- * @return string
+ * @return string
*/
public function getErrorDesc() {
if ($this->pdo !== null) {
}
return '';
}
-
+
/**
* Gets the current database type.
- *
- * @return string
+ *
+ * @return string
*/
public function getDBType() {
return get_class($this);
}
-
+
/**
* Escapes a string for use in sql query.
*
/**
* Gets the sql version.
- *
+ *
* @return string
*/
public function getVersion() {
}
}
catch (\PDOException $e) {}
-
+
return 'unknown';
}
/**
* Gets the database name.
- *
+ *
* @return string
*/
public function getDatabaseName() {
/**
* Returns the name of the database user.
- *
+ *
* @param string user name
*/
public function getUser() {
/**
* Returns the amount of executed sql queries.
- *
+ *
* @return integer
*/
public function getQueryCount() {
* DatabaseException is a specific SystemException for database errors.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.database
- * @category Community Framework
+ * @category Community Framework
*/
class DatabaseException extends SystemException {
/**
* error number
- * @var integer
+ * @var integer
*/
protected $errorNumber = null;
/**
* error description
- * @var string
+ * @var string
*/
protected $errorDesc = null;
/**
* sql version number
- * @var string
+ * @var string
*/
protected $sqlVersion = null;
/**
* sql type
- * @var string
+ * @var string
*/
protected $DBType = null;
/**
- * Database object
- * @var Database
+ * database object
+ * @var wcf\system\database\Database
*/
protected $db = null;
/**
- * PreparedStatement object
- * @var PreparedStatement
+ * prepared statement object
+ * @var wcf\system\database\statement\PreparedStatement
*/
protected $preparedStatement = null;
/**
* Creates a new DatabaseException.
*
- * @param string $message error message
- * @param Database $db affected db object
- * @param PreparedStatement $preparedStatement affected prepared statement
+ * @param string $message error message
+ * @param wcf\system\database\Database $db affected db object
+ * @param wcf\system\database\statement\PreparedStatement $preparedStatement affected prepared statement
*/
public function __construct($message, Database $db, PreparedStatement $preparedStatement = null) {
$this->db = $db;
* This is the database implementation for MySQL4.1 or higher using PDO.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.database
- * @category Community Framework
+ * @category Community Framework
*/
class MySQLDatabase extends Database {
/**
- * @see wcf\system\database\Database::$editorClassName
+ * @see wcf\system\database\Database::$editorClassName
*/
protected $editorClassName = 'wcf\system\database\editor\MySQLDatabaseEditor';
/**
- * @see wcf\system\database\Database::connect()
+ * @see wcf\system\database\Database::connect()
*/
public function connect() {
if (!$this->port) $this->port = 3306; // mysql default port
}
/**
- * @see wcf\system\database\Database::isSupported()
+ * @see wcf\system\database\Database::isSupported()
*/
public static function isSupported() {
return (extension_loaded('PDO') && extension_loaded('pdo_mysql'));
}
/**
- * @see wcf\system\database\Database::handleLimitParameter()
+ * @see wcf\system\database\Database::handleLimitParameter()
*/
public function handleLimitParameter($query, $limit = 0, $offset = 0) {
if ($limit != 0) {
}
/**
- * @see wcf\system\database\PDODatabase::setAttributes()
+ * @see wcf\system\database\PDODatabase::setAttributes()
*/
protected function setAttributes() {
parent::setAttributes();
* This is the database implementation for PostgreSQL.
*
* @author Marcel Werk
- * @copyright 2001-2009 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.database
- * @category Community Framework
+ * @category Community Framework
*/
class PostgreSQLDatabase extends Database {
/**
- * @see wcf\system\database\Database::$editorClassName
+ * @see wcf\system\database\Database::$editorClassName
*/
protected $editorClassName = 'wcf\system\database\editor\PostgreSQLDatabaseEditor';
/**
- * @see wcf\system\database\Database::connect()
+ * @see wcf\system\database\Database::connect()
*/
public function connect() {
if (!$this->port) $this->port = 5432; // postgresql default port
}
/**
- * @see wcf\system\database\Database::isSupported()
+ * @see wcf\system\database\Database::isSupported()
*/
public static function isSupported() {
return (extension_loaded('PDO') && extension_loaded('pdo_pgsql'));
}
/**
- * @see wcf\system\database\Database::getInsertID()
+ * @see wcf\system\database\Database::getInsertID()
*/
public function getInsertID($table, $field) {
try {
}
/**
- * @see wcf\system\database\Database::escapeString()
+ * @see wcf\system\database\Database::escapeString()
*/
public function escapeString($string) {
$string = str_replace("\x00", "\\x00", $string); // escape nul bytes
/**
* This is an abstract implementation of a database editor class.
- *
+ *
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.database.editor
- * @category Community Framework
+ * @category Community Framework
*/
abstract class DatabaseEditor {
/**
* database object
- *
- * @var Database
+ * @var wcf\system\database\Database
*/
protected $dbObj = null;
/**
* Creates a new DatabaseEditor object.
*
- * @param Database $dbObj
+ * @param wcf\system\database\Database $dbObj
*/
public function __construct(Database $dbObj) {
$this->dbObj = $dbObj;
*
* @return array $existingTables
*/
- public abstract function getTableNames();
+ abstract public function getTableNames();
/**
* Returns the columns of a table.
* @param string $tableName
* @return array $columns
*/
- public abstract function getColumns($tableName);
+ abstract public function getColumns($tableName);
/**
* Returns the indices of a table.
* @param string $tableName
* @return array $indices
*/
- public abstract function getIndices($tableName);
+ abstract public function getIndices($tableName);
/**
* Creates a new database table.
* @param array $columns
* @param array $indices
*/
- public abstract function createTable($tableName, $columns, $indices = array());
+ abstract public function createTable($tableName, $columns, $indices = array());
/**
* Drops a database table.
*
* @param string $tableName
*/
- public abstract function dropTable($tableName);
+ abstract public function dropTable($tableName);
/**
* Adds a new column to an existing database table.
* @param string $columnName
* @param array $columnData
*/
- public abstract function addColumn($tableName, $columnName, $columnData);
+ abstract public function addColumn($tableName, $columnName, $columnData);
/**
* Alters an existing column.
- *
+ *
* @param string $tableName
* @param string $oldColumnName
* @param string $newColumnName
* @param array $newColumnData
*/
- public abstract function alterColumn($tableName, $oldColumnName, $newColumnName, $newColumnData);
+ abstract public function alterColumn($tableName, $oldColumnName, $newColumnName, $newColumnData);
/**
* Drops an existing column.
* @param string $tableName
* @param string $columnName
*/
- public abstract function dropColumn($tableName, $columnName);
+ abstract public function dropColumn($tableName, $columnName);
/**
* Adds a new index to an existing database table.
* @param string $indexName
* @param array $indexData
*/
- public abstract function addIndex($tableName, $indexName, $indexData);
+ abstract public function addIndex($tableName, $indexName, $indexData);
/**
* Adds a new foreign key to an existing database table.
* @param string $indexName
* @param array $indexData
*/
- public abstract function addForeignKey($tableName, $indexName, $indexData);
+ abstract public function addForeignKey($tableName, $indexName, $indexData);
/**
* Drops an existing index.
* @param string $tableName
* @param string $indexName
*/
- public abstract function dropIndex($tableName, $indexName);
+ abstract public function dropIndex($tableName, $indexName);
/**
* Drops an existing foreign key.
* @param string $tableName
* @param string $indexName
*/
- public abstract function dropForeignKey($tableName, $indexName);
+ abstract public function dropForeignKey($tableName, $indexName);
/**
* Drops all given databases.
*
* @param array $conflictedTables
*/
- public abstract function dropConflictedTables(array $conflictedTables);
+ abstract public function dropConflictedTables(array $conflictedTables);
}
* This is the database editor implementation for MySQL4.1 or higher.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.database.editor
- * @category Community Framework
+ * @category Community Framework
*/
class MySQLDatabaseEditor extends DatabaseEditor {
/**
- * @see wcf\system\database\editor\DatabaseEditor::getTableNames()
+ * @see wcf\system\database\editor\DatabaseEditor::getTableNames()
*/
public function getTableNames() {
$existingTables = array();
}
/**
- * @see wcf\system\database\editor\DatabaseEditor::getColumns()
+ * @see wcf\system\database\editor\DatabaseEditor::getColumns()
*/
public function getColumns($tableName) {
$columns = array();
$statement = $this->dbObj->prepareStatement($sql);
$statement->execute();
while ($row = $statement->fetchArray()) {
- $columns[] = $row['Field'];
- }
- return $columns;
+ $columns[] = $row['Field'];
+ }
+ return $columns;
}
/**
- * @see wcf\system\database\editor\DatabaseEditor::getIndices()
+ * @see wcf\system\database\editor\DatabaseEditor::getIndices()
*/
public function getIndices($tableName) {
$indices = array();
$statement = $this->dbObj->prepareStatement($sql);
$statement->execute();
while ($row = $statement->fetchArray()) {
- $indices[] = $row['Key_name'];
- }
-
- return $indices;
+ $indices[] = $row['Key_name'];
+ }
+
+ return $indices;
}
/**
- * @see wcf\system\database\editor\DatabaseEditor::createTable()
+ * @see wcf\system\database\editor\DatabaseEditor::createTable()
*/
public function createTable($tableName, $columns, $indices = array()) {
$columnDefinition = $indexDefinition = '';
}
/**
- * @see wcf\system\database\editor\DatabaseEditor::dropTable()
+ * @see wcf\system\database\editor\DatabaseEditor::dropTable()
*/
public function dropTable($tableName) {
$sql = "DROP TABLE IF EXISTS ".$tableName;
}
/**
- * @see wcf\system\database\editor\DatabaseEditor::addColumn()
+ * @see wcf\system\database\editor\DatabaseEditor::addColumn()
*/
public function addColumn($tableName, $columnName, $columnData) {
$sql = "ALTER TABLE ".$tableName." ADD COLUMN ".$this->buildColumnDefinition($columnName, $columnData);
}
/**
- * @see wcf\system\database\editor\DatabaseEditor::alterColumn()
+ * @see wcf\system\database\editor\DatabaseEditor::alterColumn()
*/
public function alterColumn($tableName, $oldColumnName, $newColumnName, $newColumnData) {
$sql = "ALTER TABLE ".$tableName." CHANGE COLUMN ".$oldColumnName." ".$this->buildColumnDefinition($newColumnName, $newColumnData);
}
/**
- * @see wcf\system\database\editor\DatabaseEditor::dropColumn()
+ * @see wcf\system\database\editor\DatabaseEditor::dropColumn()
*/
public function dropColumn($tableName, $columnName) {
$sql = "ALTER TABLE ".$tableName." DROP COLUMN ".$columnName;
}
/**
- * @see wcf\system\database\editor\DatabaseEditor::addIndex()
+ * @see wcf\system\database\editor\DatabaseEditor::addIndex()
*/
public function addIndex($tableName, $indexName, $indexData) {
$sql = "ALTER TABLE ".$tableName." ADD ".$this->buildIndexDefinition($indexName, $indexData);
}
/**
- * @see wcf\system\database\editor\DatabaseEditor::addIndex()
+ * @see wcf\system\database\editor\DatabaseEditor::addIndex()
*/
public function addForeignKey($tableName, $indexName, $indexData) {
$sql = "ALTER TABLE ".$tableName." ADD";
}
/**
- * @see wcf\system\database\editor\DatabaseEditor::dropIndex()
+ * @see wcf\system\database\editor\DatabaseEditor::dropIndex()
*/
public function dropIndex($tableName, $indexName) {
$sql = "ALTER TABLE ".$tableName." DROP INDEX ".$indexName;
}
/**
- * @see wcf\system\database\editor\DatabaseEditor::dropForeignKey()
+ * @see wcf\system\database\editor\DatabaseEditor::dropForeignKey()
*/
public function dropForeignKey($tableName, $indexName) {
$sql = "ALTER TABLE ".$tableName." DROP FOREIGN KEY `".$indexName."`";
/**
* This is the database editor implementation for PostgreSQL 8.0 or higher.
- *
+ *
* @author Marcel Werk
- * @copyright 2001-2010 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.database.editor
- * @category Community Framework
+ * @category Community Framework
*/
class PostgreSQLDatabaseEditor extends DatabaseEditor {
/**
- * @see wcf\system\database\editor\DatabaseEditor::getTableNames()
+ * @see wcf\system\database\editor\DatabaseEditor::getTableNames()
*/
public function getTableNames() {
$existingTables = array();
}
/**
- * @see wcf\system\database\editor\DatabaseEditor::getColumns()
+ * @see wcf\system\database\editor\DatabaseEditor::getColumns()
*/
public function getColumns($tableName) {
$columns = array();
$statement = $this->dbObj->prepareStatement($sql);
$statement->execute(array($tableName));
while ($row = $statement->fetchArray()) {
- $columns[] = $row['attname'];
- }
-
- return $columns;
+ $columns[] = $row['attname'];
+ }
+
+ return $columns;
}
/**
- * @see wcf\system\database\editor\DatabaseEditor::getIndices()
+ * @see wcf\system\database\editor\DatabaseEditor::getIndices()
*/
public function getIndices($tableName) {
$indices = array();
$statement = $this->dbObj->prepareStatement($sql);
$statement->execute(array($tableName));
while ($row = $statement->fetchArray()) {
- $indices[] = $row['indexname'];
- }
-
- return $indices;
+ $indices[] = $row['indexname'];
+ }
+
+ return $indices;
}
/**
}
/**
- * @see wcf\system\database\editor\DatabaseEditor::createTable()
+ * @see wcf\system\database\editor\DatabaseEditor::createTable()
*/
public function createTable($tableName, $columns, $indices = array()) {
$columnDefinition = $indexDefinition = '';
}
/**
- * @see wcf\system\database\editor\DatabaseEditor::dropTable()
+ * @see wcf\system\database\editor\DatabaseEditor::dropTable()
*/
public function dropTable($tableName) {
$sql = "DROP TABLE IF EXISTS ".$tableName." CASCADE";
}
/**
- * @see wcf\system\database\editor\DatabaseEditor::addColumn()
+ * @see wcf\system\database\editor\DatabaseEditor::addColumn()
*/
public function addColumn($tableName, $columnName, $columnData) {
$sql = "ALTER TABLE ".$tableName." ADD COLUMN ".$this->buildColumnDefinition($columnName, $columnData);
}
/**
- * @see wcf\system\database\editor\DatabaseEditor::alterColumn()
+ * @see wcf\system\database\editor\DatabaseEditor::alterColumn()
*/
public function alterColumn($tableName, $oldColumnName, $newColumnName, $newColumnData) {
// change column name if necessary
$statement = $this->dbObj->prepareStatement($sql);
$statement->execute();
}
-
+
// get column information
$columnData = $this->getColumnData($tableName, $newColumnName);
if (!empty($alterStatements)) $alterStatements .= ',';
$alterStatements .= "ALTER COLUMN ".$newColumnName." TYPE ".$this->buildColumnType($newColumnData);
}
-
+
// change not null status
if (empty($columnData['notNull']) && !empty($newColumnData['notNull'])) {
if (!empty($alterStatements)) $alterStatements .= ',';
if (!empty($alterStatements)) $alterStatements .= ',';
$alterStatements .= "ALTER COLUMN ".$newColumnName." DROP NOT NULL";
}
-
+
// change default value
if ((isset($columnData['default']) && $columnData['default'] !== '') && (!isset($newColumnData['default']) || $newColumnData['default'] === '')) {
if (!empty($alterStatements)) $alterStatements .= ',';
}
/**
- * @see wcf\system\database\editor\DatabaseEditor::dropColumn()
+ * @see wcf\system\database\editor\DatabaseEditor::dropColumn()
*/
public function dropColumn($tableName, $columnName) {
$sql = "ALTER TABLE ".$tableName." DROP COLUMN ".$columnName." CASCADE";
}
/**
- * @see wcf\system\database\editor\DatabaseEditor::addIndex()
+ * @see wcf\system\database\editor\DatabaseEditor::addIndex()
*/
public function addIndex($tableName, $indexName, $indexData) {
$columns = ArrayUtil::trim(explode(',', $indexData['columns']));
}
/**
- * @see wcf\system\database\editor\DatabaseEditor::addIndex()
+ * @see wcf\system\database\editor\DatabaseEditor::addIndex()
*/
public function addForeignKey($tableName, $indexName, $indexData) {
$sql = "ALTER TABLE ".$tableName." ADD";
}
/**
- * @see wcf\system\database\editor\DatabaseEditor::dropIndex()
+ * @see wcf\system\database\editor\DatabaseEditor::dropIndex()
*/
public function dropIndex($tableName, $indexName) {
$sql = "DROP INDEX IF EXISTS ".$tableName."_".$indexName."_key CASCADE";
}
/**
- * @see wcf\system\database\editor\DatabaseEditor::dropForeignKey()
+ * @see wcf\system\database\editor\DatabaseEditor::dropForeignKey()
*/
public function dropForeignKey($tableName, $indexName) {
// TODO: Could it be, that this method is not required because Postgre is clever enough to delete references anyway?
switch ($mySQLType) {
// numeric types
case 'tinyint':
- case 'smallint': return 'smallint';
+ case 'smallint':
+ return 'smallint';
+
case 'mediumint':
- case 'int': return 'integer';
- case 'bigint': return 'bigint';
- case 'float': return 'real';
- case 'double': return 'double precision';
- case 'decimal':
- case 'numeric': return 'numeric';
+ case 'int':
+ return 'integer';
+
+ case 'bigint':
+ return 'bigint';
+
+ case 'float':
+ return 'real';
+
+ case 'double':
+ return 'double precision';
+
+ case 'decimal':
+ case 'numeric':
+ return 'numeric';
// string types
- case 'char': return 'character';
- case 'varchar': return 'character varying';
- case 'tinytext':
+ case 'char':
+ return 'character';
+
+ case 'varchar':
+ return 'character varying';
+
+ case 'tinytext':
case 'text':
case 'mediumtext':
- case 'longtext': return 'text';
+ case 'longtext':
+ return 'text';
// blobs
- case 'binary':
+ case 'binary':
case 'varbinary':
case 'tinyblob':
case 'blob':
case 'mediumblob':
- case 'longblob': return 'bytea';
+ case 'longblob':
+ return 'bytea';
// enum
- case 'enum': return 'character varying';
+ case 'enum':
+ return 'character varying';
}
throw new DatabaseException("Unknown / unsupported data type '".$mySQLType."'", $this->dbObj);
* This is an implementation of prepared statements based upon pdo statements.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.database.statement
- * @category Community Framework
+ * @category Community Framework
*/
class PreparedStatement {
/**
* database object
- *
* @var wcf\system\database\Database
*/
protected $database = null;
/**
* pdo statement object
- *
* @var \PDOStatement
*/
protected $pdoStatement = null;
/**
* SQL query
- * @var string
+ * @var string
*/
protected $query = '';
/**
* Delegates inaccessible methods calls to the decorated object.
- *
+ *
* @param string $name
* @param array $arguments
* @return mixed
/**
* Executes a prepared statement within a transaction.
* CAUTION: Transactions disabled for now, use manual transaction if you like
- *
+ *
* @param array $parameters
*/
public function execute(array $parameters = array()) {
/**
* Executes a prepared statement.
- *
+ *
* @param array $parameters
*/
public function executeUnbuffered(array $parameters = array()) {
/**
* Fetches the next row from a result set in an array.
- *
- * @param integer $type fetch type
- * @return mixed
+ *
+ * @param integer $type fetch type
+ * @return mixed
*/
public function fetchArray($type = null) {
// get fetch style
/**
* Fetches the next row from a result set in a database object.
- *
+ *
* @param string $className
- * @return wcf\data\DatabaseObject
+ * @return wcf\data\DatabaseObject
*/
public function fetchObject($className) {
$row = $this->fetchArray();
/**
* Fetches the all rows from a result set into database objects.
- *
+ *
* @param string $className
- * @return array<wcf\data\DatabaseObject>
+ * @return array<wcf\data\DatabaseObject>
*/
public function fetchObjects($className) {
$objects = array();
/**
* Counts number of affected rows by the last sql statement (INSERT, UPDATE or DELETE).
- *
- * @return integer number of affected rows
+ *
+ * @return integer number of affected rows
*/
public function getAffectedRows() {
try {
/**
* Returns the number of the last error.
*
- * @return integer
+ * @return integer
*/
public function getErrorNumber() {
if ($this->pdoStatement !== null) return $this->pdoStatement->errorCode();
+
return 0;
}
-
+
/**
* Returns the description of the last error.
*
- * @return string
+ * @return string
*/
public function getErrorDesc() {
if ($this->pdoStatement !== null) {
$errorInfoArray = $this->pdoStatement->errorInfo();
if (isset($errorInfoArray[2])) return $errorInfoArray[2];
}
+
return '';
}
/**
* Returns the SQL query of this statement.
*
- * @return string
+ * @return string
*/
public function getSQLQuery() {
return $this->query;
/**
* Builds a sql query 'where' condition.
- *
+ *
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.database.util
- * @category Community Framework
+ * @category Community Framework
*/
class ConditionBuilder {
/**
* conditions string
- * @var string
+ * @var string
*/
protected $conditions = '';
/**
* must be true to add the 'WHERE' keyword automatically
- * @var boolean
+ * @var boolean
*/
protected $addWhereKeyword = true;
* Builds a sql query 'where' condition for prepared statements.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.database.util
- * @category Community Framework
+ * @category Community Framework
*/
class PreparedStatementConditionBuilder extends ConditionBuilder {
/**
* input parameters
- * @var array
+ * @var array
*/
protected $parameters = array();
* Given queries will be parsed, converted and executed in the active database.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.database.util
- * @category Community Framework
+ * @category Community Framework
*/
class SQLParser {
/**
* list of sql queries
- *
- * @var array
+ * @var array<string>
*/
protected $queryArray = array();
else {
throw new SystemException("Unsupported SQL statement '".$query."'");
}
-
+
// find indices
if (preg_match_all('~(?:\(|,)\s*(?:(?:(?:(UNIQUE|FULLTEXT)(?:\s+(?:INDEX|KEY))?|(?:INDEX|KEY))(?:\s+(\w+))?)|(PRIMARY) KEY)\s+\((\s*\w+\s*(?:,\s*\w+\s*)*)\)~is', $query, $matches)) {
for ($i = 0, $j = count($matches[0]); $i < $j; $i++) {
$this->executeCreateTableStatement($tableName, $columns, $indices);
}
-
- break;
+ break;
case 'ALTER TABLE':
// add index
else {
throw new SystemException("Unsupported SQL statement '".$query."'");
}
- break;
+ break;
case 'CREATE INDEX':
if (preg_match('~^CREATE\s+(?:(UNIQUE|FULLTEXT)\s+)?INDEX\s+(\w+)\s+ON\s+(\w+)\s+\((\s*\w+\s*(?:,\s*\w+\s*)*)\)~is', $query, $match)) {
else {
throw new SystemException("Unsupported SQL statement '".$query."'");
}
- break;
-
+ break;
+
case 'DROP INDEX':
if (preg_match('~^DROP\s+INDEX\s+(\w+)\s+ON\s+(\w+)~i', $query, $match)) {
$this->executeDropIndexStatement($match[2], $match[1]);
else {
throw new SystemException("Unsupported SQL statement '".$query."'");
}
- break;
+ break;
case 'DROP TABLE':
if (preg_match('~^DROP\s+TABLE\s+(?:IF\s+EXISTS\s+)?(\w+)~i', $query, $match)) {
else {
throw new SystemException("Unsupported SQL statement '".$query."'");
}
- break;
+ break;
// standard sql; execute directly
case 'INSERT':
case 'UPDATE':
case 'DELETE':
$this->executeStandardStatement($query);
- break;
+ break;
}
}
* EventHandler executes all registered actions for a specific event.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.event
- * @category Community Framework
+ * @category Community Framework
*/
class EventHandler extends SingletonFactory {
/**
* registered actions
- * @var array
+ * @var array
*/
protected $actions = null;
/**
* registered inherit actions
- * @var array
+ * @var array
*/
protected $inheritedActions = null;
/**
* instances of registerd actions
- * @var array
+ * @var array
*/
protected $actionsObjects = array();
/**
* instances of registered inherit actions
- * @var array
+ * @var array
*/
protected $inheritedActionsObjects = array();
/**
* instances of listener objects
- * @var array<wcf\system\event\IEventListener>
+ * @var array<wcf\system\event\IEventListener>
*/
protected $listenerObjects = array();
/**
* Executes all inherited listeners for the given event.
- *
+ *
* @param mixed $eventObj
* @param string $eventName
* @param string $className
// create objects of the actions
if (!isset($this->inheritedActionsObjects[$name]) || !is_array($this->inheritedActionsObjects[$name])) {
$this->inheritedActionsObjects[$name] = array();
-
+
// get parent classes
$familyTree = array();
$member = (is_object($eventObj) ? get_class($eventObj) : $eventObj);
$familyTree[] = $member;
$member = get_parent_class($member);
}
-
+
foreach ($familyTree as $member) {
if (isset($this->inheritedActions[$member])) {
$actions = $this->inheritedActions[$member];
if (isset($actions[$eventName]) && count($actions[$eventName]) > 0) {
foreach ($actions[$eventName] as $action) {
if (isset($this->inheritedActionsObjects[$name][$action['listenerClassName']])) continue;
-
+
// get class object
if (isset($this->listenerObjects[$action['listenerClassName']])) {
$object = $this->listenerObjects[$action['listenerClassName']];
if (!ClassUtil::isInstanceOf($action['listenerClassName'], 'wcf\system\event\IEventListener')) {
throw new SystemException("'".$action['listenerClassName']."' should implement interface wcf\system\event\IEventListener");
}
-
+
$object = new $action['listenerClassName'];
$this->listenerObjects[$action['listenerClassName']] = $object;
}
/**
* Executes all registered listeners for the given event.
- *
+ *
* @param mixed $eventObj
* @param string $eventName
*/
// generate action name
$name = self::generateKey($className, $eventName);
-
+
// execute inherited actions first
if (count($this->inheritedActions) > 0) {
$this->executeInheritedActions($eventObj, $eventName, $className, $name);
// no action registered
return false;
}
-
+
$this->actionsObjects[$name] = array();
foreach ($this->actions[$name] as $action) {
if (isset($this->actionsObjects[$name][$action['listenerClassName']])) continue;
-
+
// get class object
if (isset($this->listenerObjects[$action['listenerClassName']])) {
$object = $this->listenerObjects[$action['listenerClassName']];
if (!ClassUtil::isInstanceOf($action['listenerClassName'], 'wcf\system\event\IEventListener')) {
throw new SystemException("'".$action['listenerClassName']."' should implement interface wcf\system\event\IEventListener");
}
-
+
$object = new $action['listenerClassName'];
$this->listenerObjects[$action['listenerClassName']] = $object;
}
/**
* Generates an unique name for an action.
- *
+ *
* @param string $className
* @param string $eventName
*/
* EventListeners can be registered for a specific event in many controller objects.
*
* @author Marcel Werk
- * @copyright 2001-2009 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.event
- * @category Community Framework
+ * @category Community Framework
*/
interface IEventListener {
/**
* Creates the session access log.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.event.listener
- * @category Community Framework
+ * @category Community Framework
*/
class SessionAccessLogListener implements IEventListener {
/**
- * @see wcf\system\event\IEventListener::execute()
+ * @see wcf\system\event\IEventListener::execute()
*/
public function execute($eventObj, $className, $eventName) {
if (WCF::getUser()->userID && WCF::getSession()->getPermission('admin.general.canUseAcp') && !defined(get_class($eventObj).'::DO_NOT_LOG')) {
* AJAXException provides JSON-encoded exceptions.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.exception
- * @category Community Framework
+ * @category Community Framework
*/
class AJAXException extends LoggedException {
/**
* WCF::handleException() calls the show method on exceptions that implement this interface.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.exception
- * @category Community Framework
+ * @category Community Framework
*/
interface IPrintableException {
/**
* IllegalLinkException shows the unknown link error page.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.exception
- * @category Community Framework
+ * @category Community Framework
*/
class IllegalLinkException extends NamedUserException {
/**
/**
* A logged exceptions prevents information disclosures and provides an easy
* way to log errors.
- *
+ *
* @author Tim Düsterhus, Alexander Ebert
* @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.exception
- * @category Community Framework
+ * @category Community Framework
*/
class LoggedException extends \Exception {
-
/**
- * Suppresses the original error message.
- *
- * @see \Exception::getMessage()
+ * @see \Exception::getMessage()
*/
public function _getMessage() {
+ // suppresses the original error message
if (!WCF::debugModeIsEnabled()) {
return 'An error occured. Sorry.';
}
* NamedUserException shows a (well) styled page with the given error message.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.exception
- * @category Community Framework
+ * @category Community Framework
*/
class NamedUserException extends UserException {
/**
* A PermissionDeniedException is thrown when a user has no permission to access to a specific area.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.exception
- * @category Community Framework
+ * @category Community Framework
*/
class PermissionDeniedException extends UserException {
/**
public function __construct() {
parent::__construct(WCF::getLanguage()->get('wcf.global.error.permissionDenied'));
}
-
+
/**
* Prints a permission denied exception.
*/
/**
* A SystemException is thrown when an unexpected error occurs.
- *
+ *
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.exception
- * @category Community Framework
+ * @category Community Framework
*/
class SystemException extends LoggedException implements IPrintableException {
/**
* error description
- * @var string
+ * @var string
*/
protected $description = null;
/**
* additional information
- * @var string
+ * @var string
*/
protected $information = '';
/**
* additional information
- * @var string
+ * @var string
*/
protected $functions = '';
/**
* Creates a new SystemException.
- *
+ *
* @param string $message error message
* @param integer $code error code
* @param string $description description of the error
/**
* Returns the description of this exception.
- *
+ *
* @return string
*/
public function getDescription() {
}
/**
- * @see wcf\system\exception\IPrintableException::show()
+ * @see wcf\system\exception\IPrintableException::show()
*/
public function show() {
// log error
</div>
</body>
</html>
-
+
<?php
}
}
* A UserException is thrown when a user gives invalid input data.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.exception
- * @category Community Framework
+ * @category Community Framework
*/
abstract class UserException extends LoggedException implements IPrintableException {
/**
- * @see wcf\system\exception\IPrintableException::show()
+ * @see wcf\system\exception\IPrintableException::show()
*/
public function show() {
if (WCF::debugModeIsEnabled()) {
* UserInputException handles all formular input errors.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.exception
- * @category Community Framework
+ * @category Community Framework
*/
class UserInputException extends UserException {
/**
- * Name of error field.
- *
+ * name of error field
* @var string
*/
protected $field = null;
/**
- * Error type.
- *
- * @var string
+ * error type
+ * @var string
*/
protected $type = null;
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.exception
- * @category Community Framework
+ * @category Community Framework
*/
class ValidateActionException extends \Exception {
/**
/**
* FormDocument holds the page structure based upon form element containers.
- *
+ *
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.form
- * @category Community Framework
+ * @category Community Framework
*/
class FormDocument {
/**
/**
* Creates a new instance of FormDocument.
- *
+ *
* @param string $name
*/
public function __construct($name) {
/**
* Returns form document name.
- *
+ *
* @return string
*/
public function getName() {
/**
* Appends a FormElementContainer object.
- *
+ *
* @param wcf\system\form\IFormElementContainer $container
*/
public function appendContainer(IFormElementContainer $container) {
/**
* Prepends a FormElementContainer object.
- *
+ *
* @param wcf\system\form\IFormElementContainer $container
*/
public function prependContainer(IFormElementContainer $container) {
/**
* Returns assigned FormElementContainer objects.
- *
+ *
* @return array<wcf\system\form\IFormElementContainer>
*/
public function getContainers() {
/**
* Returns the value of container's child element with given name.
- *
+ *
* @param string $key
* @return mixed
*/
/**
* Returns HTML-representation of current document.
- *
+ *
* @return string
*/
public function getHTML() {
/**
* Interface for form elements.
- *
+ *
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.form
- * @category Community Framework
+ * @category Community Framework
*/
interface IFormElement {
/**
* Creates a new object of type FormElement.
- *
+ *
* @param wcf\system\form\IFormElementContainer $parent
*/
public function __construct(IFormElementContainer $parent);
/**
* Returns help message.
- *
+ *
* @return string
*/
public function getDescription();
/**
* Sets help message.
- *
+ *
* @param string $description
*/
public function setDescription($description);
/**
* Returns label.
- *
+ *
* @return string
*/
public function getLabel();
/**
* Sets label.
- *
+ *
* @param string $label
*/
public function setLabel($label);
/**
* Returns element's parent container element.
- *
+ *
* @return wcf\system\form\IFormElementContainer
*/
public function getParent();
/**
* Returns HTML-representation of current form element.
- *
+ *
* @param string $formName
* @return string
*/
/**
* Interface for form element containers.
- *
+ *
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.form
- * @category Community Framework
+ * @category Community Framework
*/
interface IFormElementContainer {
/**
* Returns help message.
- *
+ *
* @return string
*/
public function getDescription();
/**
* Sets help message.
- *
+ *
* @param string $description
*/
public function setDescription($description);
/**
* Returns label.
- *
+ *
* @return string
*/
public function getLabel();
/**
* Sets label.
- *
+ *
* @param string $label
*/
public function setLabel($label);
/**
* Returns the value of child element with given name.
- *
+ *
* @param string $key
* @return mixed
*/
/**
* Returns a list of child elements.
- *
+ *
* @return array<wcf\system\form\IFormElement>
*/
public function getChildren();
/**
* Appends a new child to stack.
- *
+ *
* @param wcf\system\form\IFormElement $element
*/
public function appendChild(IFormElement $element);
/**
* Preprens a new child to stack.
- *
+ *
* @param wcf\system\form\IFormElement $element
*/
public function prependChild(IFormElement $element);
/**
* Handles a POST or GET request.
- *
+ *
* @param array $variables
*/
public function handleRequest(array $variables);
/**
* Returns HTML-representation of current form element container.
- *
+ *
* @param string $formName
* @return string
*/
/**
* Basic implementation for form element containers.
- *
+ *
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.form.container
- * @category Community Framework
+ * @category Community Framework
*/
abstract class AbstractFormElementContainer implements IFormElementContainer {
/**
}
/**
- * @see wcf\system\form\IFormElementContainer::setError()
+ * @see wcf\system\form\IFormElementContainer::setError()
*/
public function setError($name, $error) {
foreach ($this->children as $element) {
/**
* Provides a group form element container.
- *
+ *
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.form
- * @category Community Framework
+ * @category Community Framework
*/
class GroupFormElementContainer extends AbstractFormElementContainer {
/**
/**
* Provides a multiple selection form element container.
- *
+ *
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.form.container
- * @category Community Framework
+ * @category Community Framework
*/
class MultipleSelectionFormElementContainer extends SelectionFormElementContainer {
/**
/**
* Sets container value.
- *
+ *
* @param array $value
*/
public function setValue(array $value) {
/**
* Basic implementation for form selection element containers.
- *
+ *
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.form.container
- * @category Community Framework
+ * @category Community Framework
*/
abstract class SelectionFormElementContainer extends AbstractFormElementContainer {
/**
/**
* Sets container name.
- *
+ *
* @param string $name
*/
public function setName($name) {
/**
* Returns container name
- *
+ *
* @return string
*/
public function getName() {
/**
* Provides a single selection form element container.
- *
+ *
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.form.container
- * @category Community Framework
+ * @category Community Framework
*/
class SingleSelectionFormElementContainer extends SelectionFormElementContainer {
/**
/**
* Sets container value.
- *
+ *
* @param string $value
*/
public function setValue($value) {
/**
* Returns container value.
- *
+ *
* @return string
*/
public function getValue() {
/**
* Basic implementation for form elements.
- *
+ *
* @author Alexander Ebert
* @copyright 2001-2011 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.form.element
- * @category Community Framework
+ * @category Community Framework
*/
abstract class AbstractFormElement implements IFormElement {
/**
/**
* Basic implementation for named form elements.
- *
+ *
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.form.element
- * @category Community Framework
+ * @category Community Framework
*/
abstract class AbstractNamedFormElement extends AbstractFormElement {
/**
/**
* Sets element name.
- *
+ *
* @param string $name
*/
public function setName($name) {
/**
* Returns element name
- *
+ *
* @return string
*/
public function getName() {
/**
* Sets element value.
- *
+ *
* @param string $value
*/
public function setValue($value) {
/**
* Returns element value.
- *
+ *
* @return string
*/
public function getValue() {
/**
* Provides a label form element.
- *
+ *
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.form.element
- * @category Community Framework
+ * @category Community Framework
*/
class LabelFormElement extends AbstractFormElement {
/**
/**
* Sets element text.
- *
+ *
* @param string $text
*/
public function setText($text) {
/**
* Returns element text.
- *
+ *
* @return string
*/
public function getText() {
/**
* Provides a checkbox form element.
- *
+ *
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.form.element
- * @category Community Framework
+ * @category Community Framework
*/
class MultipleSelectionFormElement extends AbstractNamedFormElement {
/**
/**
* Provides a password input form element.
- *
+ *
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.form.element
- * @category Community Framework
+ * @category Community Framework
*/
class PasswordInputFormElement extends AbstractNamedFormElement {
/**
/**
* Provides a radio form element.
- *
+ *
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.form.element
- * @category Community Framework
+ * @category Community Framework
*/
class SingleSelectionFormElement extends AbstractNamedFormElement {
/**
* Provides a text input form element.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.form.element
- * @category Community Framework
+ * @category Community Framework
*/
class TextInputFormElement extends AbstractNamedFormElement {
/**
/**
* Handler for all available image adapters.
*
- * @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Alexander Ebert
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.image
- * @category Community Framework
+ * @category Community Framework
*/
class ImageHandler extends SingletonFactory {
/**
* Returns a new ImageAdapter instance.
*
* @return wcf\system\image\adapter\ImageAdapter;
- */
+ */
public function getAdapter() {
return new ImageAdapter($this->adapterClassName);
}
/**
* Image adapter for bundled GD imaging library.
*
- * @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Alexander Ebert
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.image.adapter
- * @category Community Framework
+ * @category Community Framework
*/
class GDImageAdapter implements IImageAdapter {
/**
* active color
- */
+ * @var integer
+ */
protected $color = null;
/**
}
/**
- * @see wcf\system\image\adapter\IImageAdapter::createEmptyImage()
+ * @see wcf\system\image\adapter\IImageAdapter::createEmptyImage()
*/
public function createEmptyImage($width, $height) {
$this->image = imageCreate($width, $height);
/**
* Basic interface for all image adapters.
*
- * @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Alexander Ebert
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.image.adapter
- * @category Community Framework
+ * @category Community Framework
*/
interface IImageAdapter {
/**
/**
* Wrapper for image adapters.
*
- * @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Alexander Ebert
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.image.adapter
- * @category Community Framework
+ * @category Community Framework
*/
class ImageAdapter implements IImageAdapter {
/**
/**
* Image adapter for ImageMagick imaging library.
*
- * @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Alexander Ebert
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.image.adapter
- * @category Community Framework
+ * @category Community Framework
*/
class ImagickImageAdapter implements IImageAdapter {
/**
/**
* The FTP class handles all ftp operations.
- *
+ *
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.io
- * @category Community Framework
+ * @category Community Framework
*/
class FTP {
/**
* file pointer resource
- * @var resource
+ * @var resource
*/
protected $resource = null;
-
+
/**
* Opens a new ftp connection to given host.
*
- * @param string $host
- * @param string $port
- * @param integer $timeout
+ * @param string $host
+ * @param string $port
+ * @param integer $timeout
*/
public function __construct($host = 'localhost', $port = 21, $timeout = 30) {
$this->resource = ftp_connect($host, $port, $timeout);
throw new SystemException('Can not connect to ' . $host);
}
}
-
+
/**
* Calls the specified function on the open ftp connection.
*
- * @param string $function
- * @param array $arguments
+ * @param string $function
+ * @param array $arguments
*/
public function __call($function, $arguments) {
array_unshift($arguments, $this->resource);
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.io
- * @category Community Framework
+ * @category Community Framework
*/
class File {
/**
* file pointer resource
- * @var resource
+ * @var resource
*/
protected $resource = null;
/**
* filename
- * @var string
+ * @var string
*/
protected $filename = '';
/**
* Opens a new file.
*
- * @param string $filename
- * @param string $mode
+ * @param string $filename
+ * @param string $mode
* @param array $options
*/
public function __construct($filename, $mode = 'wb', $options = array()) {
* Calls the specified function on the open file.
* Do not call this function directly. Use $file->write('') instead.
*
- * @param string $function
- * @param array $arguments
+ * @param string $function
+ * @param array $arguments
*/
public function __call($function, $arguments) {
if (function_exists('f' . $function)) {
/**
* The File class handles all file operations on a gzip file.
- *
+ *
* @author Marcel Werk
- * @copyright 2001-2009 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.io
- * @category Community Framework
+ * @category Community Framework
*/
class GZipFile extends File {
/**
* Opens a gzip file.
*
- * @param string $filename
- * @param string $mode
+ * @param string $filename
+ * @param string $mode
*/
public function __construct($filename, $mode = 'wb') {
$this->filename = $filename;
/**
* Calls the specified function on the open file.
*
- * @param string $function
- * @param array $arguments
+ * @param string $function
+ * @param array $arguments
*/
public function __call($function, $arguments) {
if (function_exists('gz' . $function)) {
array_unshift($arguments, $this->resource);
- return call_user_func_array('gz' . $function, $arguments);
+ return call_user_func_array('gz' . $function, $arguments);
}
else if (function_exists($function)) {
array_unshift($arguments, $this->filename);
- return call_user_func_array($function, $arguments);
+ return call_user_func_array($function, $arguments);
}
else {
throw new SystemException('Can not call method ' . $function);
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.io
- * @category Community Framework
+ * @category Community Framework
*/
interface IArchive {
/**
* Returns the table of contents (TOC) list for this archive.
*
- * @return array list of content
+ * @return array list of content
*/
public function getContentList();
* Returns an associative array with information about a specific file
* in the archive.
*
- * @param mixed $index index or name of the requested file
+ * @param mixed $index index or name of the requested file
* @return array
*/
public function getFileInfo($index);
* Extracts a specific file and returns the content as string. Returns
* false if extraction failed.
*
- * @param mixed $index index or name of the requested file
- * @return string content of the requested file
+ * @param mixed $index index or name of the requested file
+ * @return string content of the requested file
*/
public function extractToString($index);
* Extracts a specific file and writes its content to the file specified
* with $destination.
*
- * @param mixed $index index or name of the requested file
- * @param string $destination
- * @return boolean $success
+ * @param mixed $index index or name of the requested file
+ * @param string $destination
+ * @return boolean $success
*/
public function extract($index, $destination);
* Searchs a file in the archive and returns the numeric file index.
* Returns false if not found.
*
- * @param string $filename
- * @return integer index of the requested file
+ * @param string $filename
+ * @return integer index of the requested file
*/
public function getIndexByFilename($filename);
}
* The RemoteFile class opens a connection to a remote host as a file.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.io
- * @category Community Framework
+ * @category Community Framework
*/
class RemoteFile extends File {
/**
* host address
- * @var string
+ * @var string
*/
protected $host = '';
/**
* port
- * @var integer
+ * @var integer
*/
protected $port = 0;
/**
* error number
- * @var integer
+ * @var integer
*/
protected $errorNumber = 0;
/**
* error description
- * @var string
+ * @var string
*/
protected $errorDesc = '';
/**
* Returns the error number of the last error.
*
- * @return integer
+ * @return integer
*/
public function getErrorNumber() {
return $this->errorNumber;
* }
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.io
- * @category Community Framework
+ * @category Community Framework
*/
class Tar implements IArchive {
/**
* Creates a new Tar object.
* archiveName must be tarball or gzipped tarball
*
- * @param string $archiveName
+ * @param string $archiveName
*/
public function __construct($archiveName) {
if (!is_file($archiveName)) {
$this->opened = true;
}
}
-
+
/**
* Closes the opened file.
*/
}
}
- /**
+ /**
* @see wcf\system\io\IArchive::getContentList()
*/
public function getContentList() {
return $this->contentList;
}
- /**
+ /**
* @see wcf\system\io\IArchive::getFileInfo()
*/
public function getFileInfo($fileIndex) {
return $this->contentList[$fileIndex];
}
- /**
+ /**
* @see wcf\system\io\IArchive::getIndexByFilename()
*/
public function getIndexByFilename($filename) {
return false;
}
- /**
+ /**
* @see wcf\system\io\IArchive::extractToString()
*/
public function extractToString($index) {
return $content;
}
- /**
+ /**
* @see wcf\system\io\IArchive::extract()
*/
public function extract($index, $destination) {
}
return true;
- }
+ }
/**
* Reads table of contents (TOC) from tar archive.
/**
* Unpacks file header for one file entry.
- *
- * @param string $binaryData
- * @return array $fileheader
+ *
+ * @param string $binaryData
+ * @return array $fileheader
*/
protected function readHeader($binaryData) {
if (strlen($binaryData) != 512) {
/**
* Returns true, if this tar is (g)zipped.
*
- * @return boolean
+ * @return boolean
*/
public function isZipped() {
return $this->isZipped;
* $tar->create();
*
* @author Marcel Werk
- * @copyright 2001-2009 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.io
- * @category Community Framework
+ * @category Community Framework
*/
class TarWriter extends Tar {
/**
if (empty($filename)) return false;
$filename = FileUtil::unifyDirSeperator($filename);
-
+
if (!$this->writeHeaderBlock($filename, strlen($string), TIME_NOW, 33279)) {
return false;
}
-
+
$i = 0;
while (($buffer = substr($string, (($i++) * 512), 512)) != '') {
$this->file->write(pack("a512", $buffer));
}
-
+
return true;
}
// unify dir seperator
$addDir = FileUtil::unifyDirSeperator($addDir);
$removeDir = FileUtil::unifyDirSeperator($removeDir);
-
+
foreach ($files as $filename) {
if (!$result) {
break;
}
-
+
if (!$filename || $filename == $this->archiveName) {
- continue;
+ continue;
}
-
+
if (!file_exists($filename)) {
throw new SystemException("Unable to find file '".$filename."'", 11002);
}
-
+
// add file
if (!$this->addFile($filename, $addDir, $removeDir)) {
return false;
}
-
+
// handle directories
if (@is_dir($filename)) {
$handle = opendir($filename);
-
+
while (($dirFile = readdir($handle)) !== false) {
if (($dirFile != '.') && ($dirFile != '..')) {
if ($filename != ".") $dirFile = $filename.'/'.$dirFile;
closedir($handle);
}
}
-
+
return $result;
}
-
+
/**
* Adds a file to the tar archive.
*
return false;
}
}
-
+
if ($typeFlag == "5") {
$size = sprintf("%11s ", decOct(0));
}
else {
$size = sprintf("%11s ", decOct($size));
}
-
+
$uid = sprintf("%6s ", decOct($uid));
$gid = sprintf("%6s ", decOct($gid));
$permissions = sprintf("%6s ", decOct($permissions));
$mtime = sprintf("%11s", decOct($mtime));
-
+
$binaryDataFirst = pack('a100a8a8a8a12A12', $filename, $permissions, $uid, $gid, $size, $mtime);
$binaryDataLast = pack('a1a100a6a2a32a32a8a8a155a12', $typeFlag, '', '', '', '', '', '', '', '', '');
-
+
// calculate the checksum
$checksum = 0;
for ($i = 0; $i < 148; $i++) $checksum += ord(substr($binaryDataFirst, $i, 1));
for ($i = 148; $i < 156; $i++) $checksum += ord(' ');
- for ($i = 156, $j = 0; $i < 512; $i++, $j++) $checksum += ord(substr($binaryDataLast, $j, 1));
-
- $this->file->write($binaryDataFirst, 148);
+ for ($i = 156, $j = 0; $i < 512; $i++, $j++) $checksum += ord(substr($binaryDataLast, $j, 1));
+
+ $this->file->write($binaryDataFirst, 148);
$this->file->write(pack("a8", sprintf("%6s ", decOct($checksum))), 8); // write the checksum
$this->file->write($binaryDataLast, 356);
-
+
return true;
}
$typeFlag = 'L';
$binaryDataFirst = pack("a100a8a8a8a12A12", '././@LongLink', 0, 0, 0, $size, 0);
$binaryDataLast = pack("a1a100a6a2a32a32a8a8a155a12", $typeFlag, '', '', '', '', '', '', '', '', '');
-
+
// calculate the checksum
- $checksum = 0;
+ $checksum = 0;
for ($i = 0; $i < 148; $i++) $checksum += ord(substr($binaryDataFirst, $i, 1));
for ($i = 148; $i < 156; $i++) $checksum += ord(' ');
for ($i = 156, $j = 0; $i < 512; $i++, $j++) $checksum += ord(substr($binaryDataLast, $j, 1));
-
+
$this->file->write($binaryDataFirst, 148);
$this->file->write(pack("a8", sprintf("%6s ", decOct($checksum))), 8); // write the checksum
$this->file->write($binaryDataLast, 356);
-
+
$i = 0;
while (($buffer = substr($filename, (($i++) * 512), 512)) != '') {
$this->file->write(pack("a512", $buffer));
}
-
+
return true;
}
}
use wcf\util\FileUtil;
/**
- * Reads .zip-Files
+ * Reads zip files.
*
* @author Tim Düsterhus
* @copyright 2012 Tim Düsterhus
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.io
- * @category Community Framework
+ * @category Community Framework
*/
class Zip extends File implements IArchive {
const LOCAL_FILE_SIGNATURE = "\x50\x4b\x03\x04";
const EOF_SIGNATURE = "\x50\x4b\x05\x06";
/**
- * @see \wcf\system\io\File
+ * @see wcf\system\io\File::__construct()
*/
public function __construct($filename) {
parent::__construct($filename, 'rb');
}
/**
- * @see wcf\system\io\IArchive::getIndexByFilename()
+ * @see wcf\system\io\IArchive::getIndexByFilename()
*/
public function getIndexByFilename($filename) {
$this->jumpToCentralDirectory();
}
/**
- * @see wcf\system\io\IArchive::getContentList()
+ * @see wcf\system\io\IArchive::getContentList()
*/
public function getContentList() {
$this->jumpToCentralDirectory();
}
/**
- * @see wcf\system\io\IArchive::getFileInfo()
+ * @see wcf\system\io\IArchive::getFileInfo()
*/
public function getFileInfo($offset) {
if (!is_int($offset)) $offset = $this->getIndexByFilename($offset);
}
/**
- * @see wcf\system\io\IArchive::extractToString()
+ * @see wcf\system\io\IArchive::extractToString()
*/
public function extractToString($offset) {
if (!is_int($offset)) $offset = $this->getIndexByFilename($offset);
}
/**
- * @see wcf\system\io\IArchive::extract()
+ * @see wcf\system\io\IArchive::extract()
*/
public function extract($offset, $destination) {
if (!is_int($offset)) $offset = $this->getIndexByFilename($offset);
}
/**
- * Reads the Central Directory and returns it.
+ * Reads the central directory and returns it.
*
* @param integer $offset where to start reading
* @return array
/**
* Reads a file and returns it.
- *
+ *
* @param integer $offset where to start reading
* @return array
*/
* Creates a Zip file archive.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.io
- * @category Community Framework
+ * @category Community Framework
*/
class ZipWriter {
protected $headers = array();
protected $data = array();
protected $endOfData = "\x50\x4b\x05\x06\x00\x00\x00\x00";
protected $lastOffset = 0;
-
+
/**
* Adds a folder to the Zip archive.
*
public function addDir($name) {
// replace backward slashes with forward slashes in the dirname
$name = StringUtil::replace("\\", "/", $name);
-
+
// construct the general header information for the directory
$header = "\x50\x4b\x03\x04";
$header .= "\x0a\x00\x00\x00";
$header .= "\x00\x00\x00\x00";
$header .= "\x00\x00";
-
+
// construct the directory header specific information
$header .= pack("V", 0);
$header .= pack("V", 0);
$header .= pack("V", 0);
$header .= pack("V", 0);
$header .= pack("V", 0);
-
+
// store the complete header information into the $headers array
$this->headers[] = $header;
-
+
// calculate the new offset that will be used the next time a segment is added
$newOffset = strlen(implode('', $this->headers));
-
+
// construct the general header for the central index record
$record = "\x50\x4b\x01\x02";
$record .= "\x00\x00\x0a\x00";
$record .= pack("V", 16 );
$record .= pack("V", $this->lastOffset);
$record .= $name;
-
+
// save the central index record in the array $data
$this->data[] = $record;
$this->lastOffset = $newOffset;
}
-
+
/**
* Adds a file to the Zip archive.
*
// calculate the size of the file being compressed
$compressedData = substr($compressedData, 2, - 4);
$sizeCompressed = strlen($compressedData);
-
+
// construct the general header for the file record complete with checksum information, etc.
$header = "\x50\x4b\x03\x04";
$header .= "\x14\x00\x00\x00";
//$header .= pack("V", $crc);
//$header .= pack("V", $sizeCompressed);
//$header .= pack("V", $sizeUncompressed);
-
+
// store the completed file record in the $headers array
$this->headers[] = $header;
-
+
// calculate the new offset for the central index record
$newOffset = strlen(implode('', $this->headers));
$record .= pack("v", 0);
$record .= pack("V", 32);
$record .= pack("V", $this->lastOffset);
-
+
// update the offset for the next record to be stored
$this->lastOffset = $newOffset;
-
+
$record .= $name;
-
+
// store the record in the $data array
$this->data[] = $record;
}
-
+
/**
* Constructs the final Zip file structure and return it.
*
// implode the $data array into a single string
$data = implode('', $this->data);
-
+
// construct the final Zip file structure and return it
return
$headers.
/**
* Provides internationalization support for input fields.
- *
+ *
* @author Alexander Ebert
* @copyright 2001-2011 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.language
- * @category Community Framework
+ * @category Community Framework
*/
class I18nHandler extends SingletonFactory {
/**
protected $elementOptions = array();
/**
- * @see wcf\system\SingletonFactory::init()
+ * @see wcf\system\SingletonFactory::init()
*/
protected function init() {
$this->availableLanguages = LanguageFactory::getInstance()->getLanguages();
}
-
+
/**
* Registers a new element id, returns false if element id is already set.
*
/**
* Handles language related functions.
- *
+ *
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.language
- * @category Community Framework
+ * @category Community Framework
*/
class LanguageFactory extends SingletonFactory {
/**
/**
* Returns a Language object for the language with the given id.
- *
+ *
* @param integer $languageID
* @return wcf\data\language\Language
*/
/**
* Gets the preferred language of the current user.
- *
+ *
* @param integer $languageID
* @return wcf\data\language\Language
*/
}
/**
- * Returns an instance of Language or NULL for a given language code.
- *
+ * Returns the language with the given language code or null if no such
+ * language exists.
+ *
* @param string $languageCode
* @return wcf\data\language\Language
*/
/**
* Returns true if the language category with the given name exists.
- *
+ *
* @param string $categoryName
* @return boolean
*/
/**
* Returns the language category with the given name.
- *
+ *
* @param string $categoryName
* @return wcf\data\language\category\LanguageCategory
*/
/**
* Determines the preferred language of the current user.
- *
+ *
* @param array $availableLanguageCodes
* @param string $defaultLanguageCode
* @return string
/**
* Returns the active scripting compiler object.
- *
+ *
* @return wcf\system\template\TemplateScriptingCompiler
*/
public function getScriptingCompiler() {
/**
* Removes additional language identifier from given language code.
* Converts e.g. 'de-informal' to 'de'.
- *
+ *
* @param string $languageCode
* @return string $languageCode
*/
/**
* Returns the default language id
- *
+ *
* @return integer
*/
public function getDefaultLanguageID() {
/**
* Returns all available languages for package with the given id.
- *
+ *
* @param integer $packageID
* @return array<wcf\data\language\Language>
*/
/**
* Returns all available content languages for given package.
- *
+ *
* @param integer $packageID
* @return array<wcf\data\language\Language>
*/
/**
* Makes given language the default language.
- *
+ *
* @param integer $languageID
*/
public function makeDefault($languageID) {
* Processes language item import from language servers.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.language
- * @category Community Framework
+ * @category Community Framework
*/
class LanguageServerProcessor extends SingletonFactory {
/**
* language object
* @var wcf\data\language\Language
- */
+ */
protected $language = null;
/**
* Imports language variables for a language from given language servers.
*
- * @param wcf\data\language\Language $language
+ * @param wcf\data\language\Language $language
* @param array<wcf\data\language\server\LanguageServer> $languageServers
*/
public function import(Language $language, array $languageServers) {
*
* @param string $location
* @param array<string> $packageList
- */
+ */
protected function importLanguageFile($location, array $packageList) {
// get proxy
$options = array();
// send content type and length
$request .= "Content-Type: application/x-www-form-urlencoded\r\n";
- $request .= "Content-Length: ".strlen($postString)."\r\n";
- // if it is a POST request, there MUST be a blank line before the POST data, but there MUST NOT be
- // another blank line before, and of course there must be another blank line at the end of the request!
- $request .= "\r\n";
- if (!empty($postString)) $request .= $postString."\r\n";
+ $request .= "Content-Length: ".strlen($postString)."\r\n";
+ // if it is a POST request, there MUST be a blank line before the POST data, but there MUST NOT be
+ // another blank line before, and of course there must be another blank line at the end of the request!
+ $request .= "\r\n";
+ if (!empty($postString)) $request .= $postString."\r\n";
// send close
- $request .= "Connection: Close\r\n\r\n";
-
- // send request
- $remoteFile->puts($request);
+ $request .= "Connection: Close\r\n\r\n";
+
+ // send request
+ $remoteFile->puts($request);
// define response vars
- $header = $content = '';
+ $header = $content = '';
// fetch the response.
while (!$remoteFile->eof()) {
*
* @param array $variables
* @return array
- */
+ */
protected function importCategories(array $variables) {
// get categories
$categoryNames = array();
/**
* Handles modification logs.
- *
+ *
* @author Alexander Ebert
* @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.log.modification
- * @category Community Framework
+ * @category Community Framework
*/
class ModificationLogHandler extends SingletonFactory {
/**
use wcf\system\io\File;
/**
- * DebugMailSender is a debug implementation of mailsender.
- * It writes e-mails in a log file.
+ * DebugMailSender is a debug implementation of mailsender which writes emails in
+ * a log file.
*
* @author Michael Schaefer
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.mail
- * @category Community Framework
+ * @category Community Framework
*/
class DebugMailSender extends MailSender {
+ /**
+ * log file
+ * @var wcf\system\io\File
+ */
protected $log = null;
/**
/**
* Prints the given mail.
*
- * @param Mail $mail
+ * @param wcf\system\mail\Mail $mail
* @return string
*/
protected static function printMail(Mail $mail) {
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.mail
- * @category Community Framework
+ * @category Community Framework
*/
class Mail {
protected $header = '';
protected $body = '';
public static $crlf = "\n";
-
+
/**
* Creates a new Mail object.
*
public function __construct($to = '', $subject = '', $message = '', $from = '', $cc = '', $bcc = '', $attachments = array(), $priority = '', $header = '') {
$this->setBoundary();
- if (empty($from)) $from = array(MAIL_FROM_NAME => MAIL_FROM_ADDRESS);
- if (empty($priority)) $priority = 3;
-
+ if (empty($from)) $from = array(MAIL_FROM_NAME => MAIL_FROM_ADDRESS);
+ if (empty($priority)) $priority = 3;
+
$this->setFrom($from);
$this->setSubject($subject);
$this->setMessage($message);
$this->setPriority($priority);
$this->setHeader($header);
- if (!empty($to)) $this->addTo($to);
- if (!empty($cc)) $this->addCC($cc);
- if (!empty($bcc)) $this->addBCC($bcc);
+ if (!empty($to)) $this->addTo($to);
+ if (!empty($cc)) $this->addCC($cc);
+ if (!empty($bcc)) $this->addBCC($bcc);
if (count($attachments) > 0) $this->setAttachments($attachments);
}
/**
- * Creates a Basic Header for the Mail
- * Returns this Header to the function which invoke this class
+ * Creates and returns a basic header for the email.
*
* @return string mail header
*/
}
/**
- * Creates the Recipients List (To, CC, BCC)
- * Returns this List to the function which invoke this class
+ * Creates and returned the recipients list (TO, CC, BCC).
*
* @param boolean $withTo
* @return string
}
/**
- * Creates the Body (Message, Attachments) for the Mail
- * Returns the created Body to the function which invoke this class
+ * Creates and returned the body (Message, Attachments) for the email.
*
* @return string mail body
*/
}
return $email;
}
-
+
/**
* Sends this mail.
*/
namespace wcf\system\mail;
/**
- * Mailsender sends e-mails.
+ * Mailsender sends emails.
*
* @author Michael Schaefer
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.mail
- * @category Community Framework
+ * @category Community Framework
*/
abstract class MailSender {
/**
* unique mail server instance
- * @var MailSender
+ * @var wcf\system\mail\MailSender
*/
protected static $instance = null;
switch (MAIL_SEND_METHOD) {
case 'php':
self::$instance = new PHPMailSender();
- break;
+ break;
case 'smtp':
self::$instance = new SMTPMailSender();
- break;
+ break;
case 'debug':
self::$instance = new DebugMailSender();
- break;
+ break;
}
}
/**
* Sends an e-mail.
*
- * @param Mail $mail
+ * @param wcf\system\mail\Mail $mail
*/
- public abstract function sendMail(Mail $mail);
+ abstract public function sendMail(Mail $mail);
}
namespace wcf\system\mail;
/**
- * Sends a Mail with the php mail function.
+ * Sends a mail with the php mail function.
*
* @author Michael Schaefer
- * @copyright 2001-2009 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.mail
- * @category Community Framework
+ * @category Community Framework
*/
class PHPMailSender extends MailSender {
/**
- * @see wcf\system\mail\MailSender::sendMail()
+ * @see wcf\system\mail\MailSender::sendMail()
*/
public function sendMail(Mail $mail) {
if (MAIL_USE_F_PARAM) return @mb_send_mail($mail->getToString(), $mail->getSubject(), $mail->getBody(), $mail->getHeader(), '-f'.MAIL_FROM_ADDRESS);
* Sends a Mail with a connection to a smtp server.
*
* @author Michael Schaefer
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage data.mail
- * @category Community Framework
+ * @category Community Framework
*/
class SMTPMailSender extends MailSender {
protected $connection = null;
public function __destruct() {
$this->disconnect();
}
-
+
/**
* Connects to the smtp-server
*/
}
/**
- * @see wcf\system\mail\MailSender::sendMail()
+ * @see wcf\system\mail\MailSender::sendMail()
*/
public function sendMail(Mail $mail) {
$this->recipients = array();
."Message-ID: <".md5(uniqid())."@".$_SERVER['SERVER_NAME'].">".Mail::$crlf
."Subject: ".Mail::encodeMIMEHeader($mail->getSubject()).Mail::$crlf
.$mail->getHeader();
-
+
$this->write($header);
$this->write("");
$this->write($mail->getBody());
if ($this->connection === null) {
return;
}
-
+
$this->write("QUIT");
$this->read();
$this->connection->close();
/**
* Any tree menu item should implement this interface.
- *
+ *
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.menu
- * @category Community Framework
+ * @category Community Framework
*/
interface ITreeMenuItem {
/**
/**
* Basis class for a tree menu.
- *
+ *
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.menu
- * @category Community Framework
+ * @category Community Framework
*/
abstract class TreeMenu extends SingletonFactory {
/**
* list of visible menu items
- * @var array<wcf\system\menu\ITreeMenuItem>
+ * @var array<wcf\system\menu\ITreeMenuItem>
*/
public $menuItemList = array();
/**
* list of the names of the active menu items
- * @var array<string>
+ * @var array<string>
*/
public $activeMenuItems = array();
/**
* list of all menu items
- * @var array<wcf\system\menu\ITreeMenuItem>
+ * @var array<wcf\system\menu\ITreeMenuItem>
*/
public $menuItems = null;
-
+
/**
* @see wcf\system\SingletonFactory::init()
*/
}
/**
- * Sets the active menu item.
+ * Sets the active menu item.
* This should be done before the menu.tpl template calls the function getMenu().
*
* This function should be used in each script which uses a template that includes the menu.tpl.
/**
* Builds the acp menu.
- *
+ *
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.menu.acp
- * @category Community Framework
+ * @category Community Framework
*/
class ACPMenu extends TreeMenu {
/**
* Provides default implementations for page menu item providers.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.menu.page
- * @category Community Framework
+ * @category Community Framework
*/
class DefaultPageMenuItemProvider extends DatabaseObjectDecorator implements IPageMenuItemProvider {
/**
/**
* Any page menu item provider should implement this interface.
- *
+ *
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.menu.page
- * @category Community Framework
+ * @category Community Framework
*/
interface IPageMenuItemProvider extends IDatabaseObjectProcessor {
/**
/**
* Builds the page menu.
- *
+ *
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.menu.page
- * @category Community Framework
+ * @category Community Framework
*/
class PageMenu extends TreeMenu {
/**
- * @see wcf\system\SingletonFactory::init()
+ * @see wcf\system\SingletonFactory::init()
*/
protected function init() {
// get menu items from cache
/**
* Provides a default implementation for object types.
- *
+ *
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.option
- * @category Community Framework
+ * @category Community Framework
*/
abstract class AbstractOptionType implements IOptionType {
/**
protected $supportI18n = false;
/**
- * @see wcf\system\option\IOptionType::validate()
+ * @see wcf\system\option\IOptionType::validate()
*/
public function validate(Option $option, $newValue) {}
/**
- * @see wcf\system\option\IOptionType::getData()
+ * @see wcf\system\option\IOptionType::getData()
*/
public function getData(Option $option, $newValue) {
return $newValue;
}
/**
- * @see wcf\system\option\IOptionType::getCSSClassName()
+ * @see wcf\system\option\IOptionType::getCSSClassName()
*/
public function getCSSClassName() {
return '';
/**
* BooleanOptionType is an implementation of IOptionType for boolean values.
- *
+ *
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.option
- * @category Community Framework
+ * @category Community Framework
*/
class BooleanOptionType extends AbstractOptionType implements ISearchableUserOption {
/**
- * @see wcf\system\option\IOptionType::getFormElement()
+ * @see wcf\system\option\IOptionType::getFormElement()
*/
public function getFormElement(Option $option, $value) {
$options = Option::parseEnableOptions($option->enableOptions);
}
/**
- * @see wcf\system\option\IOptionType::getData()
+ * @see wcf\system\option\IOptionType::getData()
*/
public function getData(Option $option, $newValue) {
if ($newValue !== null) return 1;
}
/**
- * @see wcf\system\option\IOptionType::getCSSClassName()
+ * @see wcf\system\option\IOptionType::getCSSClassName()
*/
public function getCSSClassName() {
return 'reversed';
}
/**
- * @see wcf\system\option\ISearchableUserOption::getSearchFormElement()
+ * @see wcf\system\option\ISearchableUserOption::getSearchFormElement()
*/
public function getSearchFormElement(Option $option, $value) {
return $this->getFormElement($option, $value);
}
/**
- * @see wcf\system\option\ISearchableUserOption::getCondition()
+ * @see wcf\system\option\ISearchableUserOption::getCondition()
*/
public function getCondition(PreparedStatementConditionBuilder &$conditions, Option $option, $value) {
$value = intval($value);
/**
* DateOptionType is an implementation of IOptionType for date inputs.
- *
+ *
* @author Marcel Werk
* @copyright 2001-2011 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.option
- * @category Community Framework
+ * @category Community Framework
*/
class DateOptionType extends TextOptionType {
/**
- * @see wcf\system\option\TextOptionType::$inputType
+ * @see wcf\system\option\TextOptionType::$inputType
*/
protected $inputType = 'date';
/**
- * @see wcf\system\option\TextOptionType::$inputClass
+ * @see wcf\system\option\TextOptionType::$inputClass
*/
protected $inputClass = '';
/**
- * @see wcf\system\option\IOptionType::getFormElement()
+ * @see wcf\system\option\IOptionType::getFormElement()
*/
public function validate(Option $option, $newValue) {
if (empty($newValue)) return;
/**
* FileSizeOptionType is an implementation of IOptionType for file sizes.
- *
+ *
* @author Tim Düsterhus
* @copyright 2011 Tim Düsterhus
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
*/
class FileSizeOptionType extends IntegerOptionType {
/**
- * @see wcf\system\option\IOptionType::getData()
+ * @see wcf\system\option\IOptionType::getData()
*/
public function getData(Option $option, $newValue) {
$number = StringUtil::replace(WCF::getLanguage()->get('wcf.global.thousandsSeparator'), '', $newValue);
}
/**
- * @see wcf\system\option\IOptionType::getFormElement()
+ * @see wcf\system\option\IOptionType::getFormElement()
*/
public function getFormElement(Option $option, $value) {
$value = FileUtil::formatFileSize($value);
/**
* FloatOptionType is an implementation of IOptionType for float fields.
- *
+ *
* @author Tobias Friebel
* @copyright 2001-2011 Tobias Friebel
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.option
- * @category Community Framework
+ * @category Community Framework
*/
class FloatOptionType extends TextOptionType {
/**
- * @see wcf\system\option\IOptionType::getFormElement()
+ * @see wcf\system\option\IOptionType::getFormElement()
*/
public function getFormElement(Option $option, $value) {
$value = str_replace('.', WCF::getLanguage()->get('wcf.global.decimalPoint'), $value);
}
/**
- * @see wcf\system\option\IOptionType::getData()
+ * @see wcf\system\option\IOptionType::getData()
*/
public function getData(Option $option, $newValue) {
$newValue = str_replace(' ', '', $newValue);
/**
* Default interface for option handlers.
- *
+ *
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.option
- * @category Community Framework
+ * @category Community Framework
*/
interface IOptionHandler {
/**
/**
* Any option type has to implement this interface.
- *
+ *
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.option
- * @category Community Framework
+ * @category Community Framework
*/
interface IOptionType {
/**
/**
* Any searchable option type should implement this interface.
- *
+ *
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.option
- * @category Community Framework
+ * @category Community Framework
*/
interface ISearchableUserOption {
/**
* IntegerOptionType is an implementation of IOptionType for integer fields.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.option
- * @category Community Framework
+ * @category Community Framework
*/
class IntegerOptionType extends TextOptionType {
/**
- * @see wcf\system\option\IOptionType::getData()
+ * @see wcf\system\option\IOptionType::getData()
*/
public function getData(Option $option, $newValue) {
return intval($newValue);
use wcf\util\ArrayUtil;
/**
- * MultiSelectOptionType is an implementation of IOptionType for multiple 'select' tags.
+ * MultiSelectOptionType is an implementation of IOptionType for multiple 'select'
+ * tags.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.option
- * @category Community Framework
+ * @category Community Framework
*/
class MultiSelectOptionType extends SelectOptionType {
/**
- * @see wcf\system\option\IOptionType::getFormElement()
+ * @see wcf\system\option\IOptionType::getFormElement()
*/
public function getFormElement(Option $option, $value) {
WCF::getTPL()->assign(array(
}
/**
- * @see wcf\system\option\IOptionType::validate()
+ * @see wcf\system\option\IOptionType::validate()
*/
public function validate(Option $option, $newValue) {
if (!is_array($newValue)) $newValue = array();
}
/**
- * @see wcf\system\option\IOptionType::getData()
+ * @see wcf\system\option\IOptionType::getData()
*/
public function getData(Option $option, $newValue) {
if (!is_array($newValue)) $newValue = array();
}
/**
- * @see wcf\system\option\ISearchableUserOption::getCondition()
+ * @see wcf\system\option\ISearchableUserOption::getCondition()
*/
public function getCondition(PreparedStatementConditionBuilder &$conditions, Option $option, $value) {
if (!is_array($value) || !count($value)) return false;
/**
* Handles options.
- *
+ *
* @author Alexander Ebert
* @copyright 2001-2011 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.option
- * @category Community Framework
+ * @category Community Framework
*/
class OptionHandler implements IOptionHandler {
/**
* cache name
- * @var string
+ * @var string
*/
public $cacheName = '';
/**
* cache class name
- * @var string
+ * @var string
*/
public $cacheClass = '';
/**
* list of all option categories
- * @var array<wcf\data\option\category\OptionCategory>
+ * @var array<wcf\data\option\category\OptionCategory>
*/
public $cachedCategories = null;
/**
* list of all options
- * @var array<wcf\data\option\Option>
+ * @var array<wcf\data\option\Option>
*/
public $cachedOptions = null;
/**
* category structure
- * @var array
+ * @var array
*/
public $cachedCategoryStructure = null;
/**
* option structure
- * @var array
+ * @var array
*/
public $cachedOptionToCategories = null;
/**
- * Name of the active option category.
- * @var string
+ * name of the active option category
+ * @var string
*/
public $categoryName = '';
/**
- * Options of the active category.
- * @var array<Option>
+ * options of the active category
+ * @var array<Option>
*/
public $options = array();
/**
- * Type object cache.
- * @var array<wcf\system\option\IOptionType>
+ * type object cache
+ * @var array<wcf\system\option\IOptionType>
*/
public $typeObjects = array();
/**
* option values
- * @var array<mixed>
+ * @var array<mixed>
*/
public $optionValues = array();
/**
* raw option values
- * @var array<mixed>
+ * @var array<mixed>
*/
public $rawValues = array();
use wcf\system\database\util\PreparedStatementConditionBuilder;
/**
- * PasswordOptionType is an implementation of IOptionType for 'input type="password"' tags.
+ * PasswordOptionType is an implementation of IOptionType for 'input type="password"'
+ * tags.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.option
- * @category Community Framework
+ * @category Community Framework
*/
class PasswordOptionType extends TextOptionType {
/**
- * @see wcf\system\option\TextOptionType::$inputType
+ * @see wcf\system\option\TextOptionType::$inputType
*/
protected $inputType = 'password';
/**
- * @see wcf\system\option\ISearchableUserOption::getCondition()
+ * @see wcf\system\option\ISearchableUserOption::getCondition()
*/
public function getCondition(PreparedStatementConditionBuilder &$conditions, Option $option, $value) {
return false;
use wcf\util\StringUtil;
/**
- * RadiobuttonsOptionType is an implementation of IOptionType for 'input type="radio"' tags.
+ * RadiobuttonsOptionType is an implementation of IOptionType for 'input type="radio"'
+ * tags.
*
* @author Marcel Werk
* @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.option
- * @category Community Framework
+ * @category Community Framework
*/
class RadioButtonOptionType extends AbstractOptionType implements ISearchableUserOption {
/**
* @var string
*/
public $templateName = 'radioButtonOptionType';
-
+
/**
- * @see wcf\system\option\IOptionType::getFormElement()
+ * @see wcf\system\option\IOptionType::getFormElement()
*/
public function getFormElement(Option $option, $value) {
// get options
$selectOptions = $option->parseSelectOptions();
-
+
$availableOptions = $option->parseMultipleEnableOptions();
$options = array(
'disableOptions' => array(),
}
/**
- * @see wcf\system\option\IOptionType::validate()
+ * @see wcf\system\option\IOptionType::validate()
*/
public function validate(Option $option, $newValue) {
if (!empty($newValue)) {
}
/**
- * @see wcf\system\option\ISearchableUserOption::getSearchFormElement()
+ * @see wcf\system\option\ISearchableUserOption::getSearchFormElement()
*/
public function getSearchFormElement(Option $option, $value) {
return $this->getFormElement($option, $value);
}
/**
- * @see wcf\system\option\ISearchableUserOption::getCondition()
+ * @see wcf\system\option\ISearchableUserOption::getCondition()
*/
public function getCondition(PreparedStatementConditionBuilder &$conditions, Option $option, $value) {
$value = StringUtil::trim($value);
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.option
- * @category Community Framework
+ * @category Community Framework
*/
class SelectOptionType extends RadioButtonOptionType {
/**
- * @see wcf\system\option\IOptionType::getFormElement()
+ * @see wcf\system\option\IOptionType::getFormElement()
*/
public function getFormElement(Option $option, $value) {
// get options
}
/**
- * @see wcf\system\option\ISearchableUserOption::getSearchFormElement()
+ * @see wcf\system\option\ISearchableUserOption::getSearchFormElement()
*/
public function getSearchFormElement(Option $option, $value) {
return $this->getFormElement($option, $value);
use wcf\system\WCF;
/**
- * TextI18nOptionType is an implementation of IOptionType for 'input type="text"' tags with i18n support.
+ * TextI18nOptionType is an implementation of IOptionType for 'input type="text"'
+ * tags with i18n support.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.option
- * @category Community Framework
+ * @category Community Framework
*/
class TextI18nOptionType extends TextOptionType {
/**
protected $supportI18n = true;
/**
- * @see wcf\system\option\IOptionType::getFormElement()
+ * @see wcf\system\option\IOptionType::getFormElement()
*/
public function getFormElement(Option $option, $value) {
$useRequestData = (count($_POST)) ? true : false;
}
/**
- * @see wcf\system\option\IOptionType::validate()
+ * @see wcf\system\option\IOptionType::validate()
*/
public function validate(Option $option, $newValue) {
if (!I18nHandler::getInstance()->validateValue($option->optionName, $option->requireI18n, true)) {
/**
* TextOptionType is an implementation of IOptionType for 'input type="text"' tags.
- *
+ *
* @author Marcel Werk
* @copyright 2001-2011 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.option
- * @category Community Framework
+ * @category Community Framework
*/
class TextOptionType extends AbstractOptionType implements ISearchableUserOption {
/**
* input type
- * @var string
+ * @var string
*/
protected $inputType = 'text';
/**
* input css class
- * @var string
+ * @var string
*/
protected $inputClass = 'long';
/**
- * @see wcf\system\option\IOptionType::getFormElement()
+ * @see wcf\system\option\IOptionType::getFormElement()
*/
public function getFormElement(Option $option, $value) {
WCF::getTPL()->assign(array(
}
/**
- * @see wcf\system\option\ISearchableUserOption::getSearchFormElement()
+ * @see wcf\system\option\ISearchableUserOption::getSearchFormElement()
*/
public function getSearchFormElement(Option $option, $value) {
return $this->getFormElement($option, $value);
}
/**
- * @see wcf\system\option\ISearchableUserOption::getCondition()
+ * @see wcf\system\option\ISearchableUserOption::getCondition()
*/
public function getCondition(PreparedStatementConditionBuilder &$conditions, Option $option, $value) {
$value = StringUtil::trim($value);
use wcf\system\WCF;
/**
- * TextareaI18nOptionType is an implementation of IOptionType for 'textarea' tags with i18n support.
- *
+ * TextareaI18nOptionType is an implementation of IOptionType for 'textarea' tags
+ * with i18n support.
+ *
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.option
- * @category Community Framework
+ * @category Community Framework
*/
class TextareaI18nOptionType extends TextareaOptionType {
/**
protected $supportI18n = true;
/**
- * @see wcf\system\option\IOptionType::getFormElement()
+ * @see wcf\system\option\IOptionType::getFormElement()
*/
public function getFormElement(Option $option, $value) {
$useRequestData = (count($_POST)) ? true : false;
}
/**
- * @see wcf\system\option\IOptionType::validate()
+ * @see wcf\system\option\IOptionType::validate()
*/
public function validate(Option $option, $newValue) {
if (!I18nHandler::getInstance()->validateValue($option->optionName, $option->requireI18n, true)) {
use wcf\util\UserUtil;
/**
- * TextareaIpAddressOptionType is an implementation of IOptionType for 'textarea' tags with IPv4/IPv6 support.
- * IP-Addresses will be converted into IPv6 upon saving but will be displayed as IPv4 whenever applicable.
- *
+ * TextareaIpAddressOptionType is an implementation of IOptionType for 'textarea'
+ * tags with IPv4/IPv6 support.
+ * IP addresses will be converted into IPv6 upon saving but will be displayed as
+ * IPv4 whenever applicable.
+ *
* @author Alexander Ebert
* @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.option
- * @category Community Framework
+ * @category Community Framework
*/
class TextareaIpAddressOptionType extends TextOptionType {
/**
- * @see wcf\system\option\IOptionType::getFormElement()
+ * @see wcf\system\option\IOptionType::getFormElement()
*/
public function getFormElement(Option $option, $value) {
if (!empty($value)) {
}
/**
- * @see wcf\system\option\IOptionType::getData()
+ * @see wcf\system\option\IOptionType::getData()
*/
public function getData(Option $option, $newValue) {
if (!empty($newValue)) {
/**
* TextareaOptionType is an implementation of IOptionType for 'textarea' tags.
- *
+ *
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.option
- * @category Community Framework
+ * @category Community Framework
*/
class TextareaOptionType extends TextOptionType {
/**
- * @see wcf\system\option\IOptionType::getFormElement()
+ * @see wcf\system\option\IOptionType::getFormElement()
*/
public function getFormElement(Option $option, $value) {
WCF::getTPL()->assign(array(
}
/**
- * @see wcf\system\option\IOptionType::getData()
+ * @see wcf\system\option\IOptionType::getData()
*/
public function getData(Option $option, $newValue) {
return StringUtil::unifyNewlines(parent::getData($option, $newValue));
use wcf\util\DateUtil;
/**
- * TimezoneOptionType is an implementation of IOptionType for a select box, which
+ * TimezoneOptionType is an implementation of IOptionType for a select box which
* list the available time zones.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.option
- * @category Community Framework
+ * @category Community Framework
*/
class TimezoneOptionType extends AbstractOptionType {
/**
- * @see wcf\system\option\IOptionType::getFormElement()
+ * @see wcf\system\option\IOptionType::getFormElement()
*/
public function getFormElement(Option $option, $value) {
$timezoneOptions = array();
}
/**
- * @see wcf\system\option\IOptionType::validate()
+ * @see wcf\system\option\IOptionType::validate()
*/
public function validate(Option $option, $newValue) {
if (!in_array($newValue, DateUtil::getAvailableTimezones())) {
/**
* Any user option output class should implement this interface.
- *
+ *
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.option.user
- * @category Community Framework
+ * @category Community Framework
*/
interface IUserOptionOutput {
/**
* Returns a short version of the html code for the output of the given user option.
*
- * @param wcf\data\user\User $user
- * @param wcf\data\user\option\UserOption $option
- * @param string $value
+ * @param wcf\data\user\User $user
+ * @param wcf\data\user\option\UserOption $option
+ * @param string $value
* @return string
*/
public function getShortOutput(User $user, UserOption $option, $value);
/**
* Returns a medium version of the html code for the output of the given user option.
*
- * @param wcf\data\user\User $user
- * @param wcf\data\user\option\UserOption $option
- * @param string $value
+ * @param wcf\data\user\User $user
+ * @param wcf\data\user\option\UserOption $option
+ * @param string $value
* @return string
*/
public function getMediumOutput(User $user, UserOption $option, $value);
/**
* Returns the html code for the output of the given user option.
*
- * @param wcf\data\user\User $user
- * @param wcf\data\user\option\UserOption $option
- * @param string $value
+ * @param wcf\data\user\User $user
+ * @param wcf\data\user\option\UserOption $option
+ * @param string $value
* @return string
*/
public function getOutput(User $user, UserOption $option, $value);
/**
* Any user option output class should implement this interface.
- *
+ *
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.option.user
- * @category Community Framework
+ * @category Community Framework
*/
interface IUserOptionOutputContactInformation {
/**
* Returns the output data of this user option.
- *
- * @param wcf\data\user\User $user
- * @param wcf\data\user\option\UserOption $optionData
- * @param string $value
+ *
+ * @param wcf\data\user\User $user
+ * @param wcf\data\user\option\UserOption $optionData
+ * @param string $value
* @return array
*/
public function getOutputData(User $user, UserOption $option, $value);
/**
* Handles user options.
- *
+ *
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.option.user
- * @category Community Framework
+ * @category Community Framework
*/
class UserOptionHandler extends OptionHandler {
/**
}
/**
- * @see wcf\system\option\OptionHandler::save()
+ * @see wcf\system\option\OptionHandler::save()
*/
public function save($categoryName = null, $optionPrefix = null) {
$options = parent::save($categoryName, $optionPrefix);
use wcf\system\option\BooleanOptionType;
/**
- * BooleanUserGroupOptionType is an implementation of IUserGroupOptionType for boolean values.
- * The merge of option values returns true, if at least one value is true. Otherwise false.
+ * BooleanUserGroupOptionType is an implementation of IUserGroupOptionType for
+ * boolean values.
+ * The merge of option values returns true, if at least one value is true.
*
* @author Marcel Werk
* @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.option.user.group
- * @category Community Framework
+ * @category Community Framework
*/
class BooleanUserGroupOptionType extends BooleanOptionType implements IUserGroupOptionType {
/**
- * @see wcf\system\option\user\group\IUserGroupOptionType::merge()
+ * @see wcf\system\option\user\group\IUserGroupOptionType::merge()
*/
public function merge($defaultValue, $groupValue) {
// don't save if values are equal or $defaultValue is better
use wcf\system\option\FileSizeOptionType;
/**
- * FileSizeUserGroupOptionType is an implementation of IUserGroupOptionType for file sizes.
+ * FileSizeUserGroupOptionType is an implementation of IUserGroupOptionType for
+ * file sizes.
* The merge of option values returns the highest value.
*
* @author Tim Düsterhus
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.option.user.group
- * @category Community Framework
+ * @category Community Framework
*/
class FileSizeUserGroupOptionType extends FileSizeOptionType implements IUserGroupOptionType {
/**
- * @see wcf\system\option\user.group\IUserGroupOptionType::merge()
+ * @see wcf\system\option\user.group\IUserGroupOptionType::merge()
*/
public function merge($defaultValue, $groupValue) {
if ($groupValue > $defaultValue) {
/**
* Any group permission type should implement this interface.
- *
+ *
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.option.user.group
- * @category Community Framework
+ * @category Community Framework
*/
interface IUserGroupOptionType extends IOptionType {
/**
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.option.user.group
- * @category Community Framework
+ * @category Community Framework
*/
class InfiniteIntegerUserGroupOptionType extends IntegerUserGroupOptionType {
/**
- * @see wcf\system\option\user\group\IUserGroupOptionType::merge()
+ * @see wcf\system\option\user\group\IUserGroupOptionType::merge()
*/
public function merge($defaultValue, $groupValue) {
if ($defaultValue == -1) {
/**
* InfiniteInverseIntegerUserGroupOptionType is an implementation of IUserGroupOptionType
* for integer values.
- * The merge of option values returns -1 if all values are -1 otherwise the lowest value.
- *
+ * The merge of option values returns -1 if all values are -1 otherwise the lowest
+ * value.
+ *
* @author Marcel Werk
* @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.option.user.group
- * @category Community Framework
+ * @category Community Framework
*/
class InfiniteInverseIntegerUserGroupOptionType extends InverseIntegerUserGroupOptionType {
/**
- * @see wcf\system\option\user\group\IUserGroupOptionType::merge()
+ * @see wcf\system\option\user\group\IUserGroupOptionType::merge()
*/
public function merge($defaultValue, $groupValue) {
if (($defaultValue == -1 && $groupValue == -1) || ($defaultValue == $groupValue)) {
use wcf\system\option\IntegerOptionType;
/**
- * IntegerUserGroupOptionType is an implementation of IUserGroupOptionType for integer values.
+ * IntegerUserGroupOptionType is an implementation of IUserGroupOptionType for
+ * integer values.
* The merge of option values returns the highest value.
*
* @author Marcel Werk
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.option.user.group
- * @category Community Framework
+ * @category Community Framework
*/
class IntegerUserGroupOptionType extends IntegerOptionType implements IUserGroupOptionType {
/**
- * @see wcf\system\option\user.group\IUserGroupOptionType::merge()
+ * @see wcf\system\option\user.group\IUserGroupOptionType::merge()
*/
public function merge($defaultValue, $groupValue) {
if ($groupValue > $defaultValue) {
use wcf\system\option\IntegerOptionType;
/**
- * InverseIntegerUserGroupOptionType is an implementation of IUserGroupOptionType for integer values.
+ * InverseIntegerUserGroupOptionType is an implementation of IUserGroupOptionType
+ * for integer values.
* The merge of option values returns the lowest value.
- *
+ *
* @author Marcel Werk
* @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.option.user.group
- * @category Community Framework
+ * @category Community Framework
*/
class InverseIntegerUserGroupOptionType extends IntegerOptionType implements IUserGroupOptionType {
/**
- * @see wcf\system\option\user\group\IUserGroupOptionType::merge()
+ * @see wcf\system\option\user\group\IUserGroupOptionType::merge()
*/
public function merge($defaultValue, $groupValue) {
if ($defaultValue < $groupValue) {
use wcf\util\StringUtil;
/**
- * TextUserGroupOptionType is an implementation of IUserGroupOptionType for text values.
+ * TextUserGroupOptionType is an implementation of IUserGroupOptionType for text
+ * values.
* The merge of option values returns merge of all text values.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.option.user.group
- * @category Community Framework
+ * @category Community Framework
*/
class TextUserGroupOptionType extends TextOptionType implements IUserGroupOptionType {
/**
- * @see wcf\system\option\user\group\IUserGroupOptionType::merge()
+ * @see wcf\system\option\user\group\IUserGroupOptionType::merge()
*/
public function merge($defaultValue, $groupValue) {
$defaultValue = explode("\n", StringUtil::unifyNewlines($defaultValue));
* The merge of option values returns merge of all text values.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.option.user.group
- * @category Community Framework
+ * @category Community Framework
*/
class TextareaUserGroupOptionType extends TextareaOptionType implements IUserGroupOptionType {
/**
- * @see wcf\system\option\user\group\IUserGroupOptionType::merge()
+ * @see wcf\system\option\user\group\IUserGroupOptionType::merge()
*/
public function merge($defaultValue, $groupValue) {
$defaultValue = explode("\n", StringUtil::unifyNewlines($defaultValue));
/**
* Handles user group options.
- *
+ *
* @author Alexander Ebert
* @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.option.user.group
- * @category Community Framework
+ * @category Community Framework
*/
class UserGroupOptionHandler extends OptionHandler {
/**
/**
* UserGroupsUserGroupOptionType generates a select-list of all available user groups.
- *
+ *
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.option.user.group
- * @category Community Framework
+ * @category Community Framework
*/
class UserGroupsUserGroupOptionType extends AbstractOptionType implements IUserGroupOptionType {
/**
- * @see wcf\system\option\IOptionType::getFormElement()
+ * @see wcf\system\option\IOptionType::getFormElement()
*/
public function getFormElement(Option $option, $value) {
// get selected group
}
/**
- * @see wcf\system\option\IOptionType::validate()
+ * @see wcf\system\option\IOptionType::validate()
*/
public function validate(Option $option, $newValue) {
// get all groups
}
/**
- * @see wcf\system\option\IOptionType::getData()
+ * @see wcf\system\option\IOptionType::getData()
*/
public function getData(Option $option, $newValue) {
if (!is_array($newValue)) $newValue = array();
}
/**
- * @see wcf\system\option\user\group\IUserGroupOptionType::merge()
+ * @see wcf\system\option\user\group\IUserGroupOptionType::merge()
*/
public function merge($defaultValue, $groupValue) {
$defaultValue = explode(',', $defaultValue);
* ACPTemplatesFileHandler is a FileHandler implementation for the installation of ACP-template files.
*
* @author Benjamin Kunz
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.package
- * @category Community Framework
+ * @category Community Framework
*/
class ACPTemplatesFileHandler extends PackageInstallationFileHandler {
/**
protected $tableName = 'acp_template';
/**
- * @see wcf\system\setup\IFileHandler::checkFiles()
+ * @see wcf\system\setup\IFileHandler::checkFiles()
*/
public function checkFiles(array $files) {
if ($this->packageInstallation->getPackage()->package != 'com.woltlab.wcf') {
}
/**
- * @see wcf\system\setup\IFileHandler::logFiles()
+ * @see wcf\system\setup\IFileHandler::logFiles()
*/
public function logFiles(array $files) {
$packageID = $this->packageInstallation->getPackageID();
* FilesFileHandler is a FileHandler implementation for the installation of regular files.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.package
- * @category Community Framework
+ * @category Community Framework
*/
class FilesFileHandler extends PackageInstallationFileHandler {
/**
- * @see wcf\system\setup\IFileHandler::checkFiles()
+ * @see wcf\system\setup\IFileHandler::checkFiles()
*/
public function checkFiles(array $files) {
if ($this->packageInstallation->getPackage()->package != 'com.woltlab.wcf') {
}
/**
- * @see wcf\system\setup\IFileHandler::logFiles()
+ * @see wcf\system\setup\IFileHandler::logFiles()
*/
public function logFiles(array $files) {
if (empty($files)) {
* This class holds all information of a package archive.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.package
- * @category Community Framework
+ * @category Community Framework
*/
class PackageArchive {
/**
- * path to archive
- * @var string
+ * path to package archive
+ * @var string
*/
protected $archive = null;
/**
* general package information
- * @var array
+ * @var array
*/
protected $packageInfo = array();
/**
* author information
- * @var array
+ * @var array
*/
protected $authorInfo = array();
/**
* list of requirements
- * @var array
+ * @var array
*/
protected $requirements = array();
/**
* list of optional packages
- * @var array
+ * @var array
*/
protected $optionals = array();
/**
* default name of the package.xml file
- * @var string
+ * @var string
*/
const INFO_FILE = 'package.xml';
* @param Package $package
*/
public function __construct($archive, Package $package = null) {
- $this->archive = $archive; // be careful: this is a string within this class,
+ $this->archive = $archive; // be careful: this is a string within this class,
// but an object in the packageStartInstallForm.class!
$this->package = $package;
}
/**
* Returns the object of the package archive.
*
- * @return Tar
+ * @return wcf\system\io\Tar
*/
public function getTar() {
return $this->tar;
if (!file_exists($this->archive)) {
throw new SystemException("unable to find package file '".$this->archive."'");
}
-
+
// open archive and read package information
$this->tar = new Tar($this->archive);
$this->readPackageInfo();
$this->requirements[$element->nodeValue] = $data;
}
-
- // get optional packages
+
+ // get optional packages
$elements = $xpath->query('child::ns:optionalpackages/ns:optionalpackage', $package);
foreach ($elements as $element) {
if (!Package::isValidPackageName($element->nodeValue)) {
switch ($element->tagName) {
case 'version':
$this->phpRequirements['version'] = $element->nodeValue;
- break;
+ break;
case 'setting':
$this->phpRequirements['settings'][$element->getAttribute('name')] = $element->nodeValue;
- break;
+ break;
case 'extension':
$this->phpRequirements['extensions'][] = $element->nodeValue;
- break;
+ break;
case 'function':
$this->phpRequirements['functions'][] = $element->nodeValue;
- break;
+ break;
case 'class':
$this->phpRequirements['classes'][] = $element->nodeValue;
- break;
+ break;
}
}
}
/**
* Checks if the new package is compatible with
* the package that is about to be updated.
- *
+ *
* @return boolean isValidUpdate
*/
public function isValidUpdate() {
$existingRequirements[$row['package']] = $row;
}
}
-
+
// build sql
$packageNames = array();
$requirements = $this->getRequirements();
$packageNames[] = $requirement['name'];
}
}
-
+
// check whether the required packages do already exist
if (!empty($packageNames)) {
$conditions = new PreparedStatementConditionBuilder();
foreach ($this->requirements as $requirement) {
$packageNames[] = $requirement['name'];
}
-
+
// check whether the required packages do already exist
$existingPackages = array();
if (!empty($packageNames)) {
/**
* PackageDependencyHandler stores package dependencies and providing a consistent interface for accessing.
- *
+ *
* @author Alexander Ebert
* @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.package
- * @category Community Framework
+ * @category Community Framework
*/
class PackageDependencyHandler extends SingletonFactory {
/**
protected $packageDependencyCache = null;
/**
- * @see wcf\system\SingletonFactory::init()
+ * @see wcf\system\SingletonFactory::init()
*/
protected function init() {
$cacheName = 'packageDependencies-'.PACKAGE_ID;
/**
* Returns the id of a specific package in the active dependencies.
- *
+ *
* @param string $package package identifier
* @return mixed
- */
+ */
public function getPackageID($package) {
if (!defined('PACKAGE_ID')) {
return null;
/**
* Returns the package ids of all dependent packages.
- *
+ *
* @return array
- */
+ */
public function getDependencies() {
if (!defined('PACKAGE_ID')) {
return null;
use wcf\system\form\container;
use wcf\system\form\element;
use wcf\system\form\FormDocument;
+use wcf\system\form;
use wcf\system\language\LanguageFactory;
use wcf\system\menu\acp\ACPMenu;
use wcf\system\request\LinkHandler;
use wcf\system\request\RouteHandler;
-use wcf\system\form;
use wcf\system\WCF;
use wcf\util\FileUtil;
use wcf\util\HeaderUtil;
/**
* PackageInstallationDispatcher handles the whole installation process.
- *
+ *
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.package
- * @category Community Framework
+ * @category Community Framework
*/
class PackageInstallationDispatcher {
/**
/**
* default name of the config file
- * @var string
+ * @var string
*/
const CONFIG_FILE = 'config.inc.php';
/**
* Creates a new instance of PackageInstallationDispatcher.
*
- * @param PackageInstallationQueue $queue
+ * @param wcf\data\package\installation\queue\PackageInstallationQueue $queue
*/
public function __construct(PackageInstallationQueue $queue) {
$this->queue = $queue;
/**
* Installs node components and returns next node.
- *
+ *
* @param string $node
* @return PackageInstallationStep
*/
/**
* Returns current package archive.
- *
+ *
* @return PackageArchive
*/
public function getArchive() {
/**
* Installs current package.
- *
+ *
* @param array $nodeData
*/
protected function installPackage(array $nodeData) {
/**
* Sets parent package and rebuilds dependencies for both.
- */
+ */
protected function installPackageParent() {
// do not handle parent package if current package is an application or does not have a plugin tag while within installation process
if ($this->getArchive()->getPackageInfo('isApplication') || $this->getAction() != 'install' || !$this->getArchive()->getPackageInfo('plugin')) {
/**
* Executes a package installation plugin.
- *
+ *
* @param array step
* @return boolean
*/
/**
* Extracts files from .tar (or .tar.gz) archive and installs them
*
- * @param string $targetDir
- * @param string $sourceArchive
+ * @param string $targetDir
+ * @param string $sourceArchive
* @param FileHandler $fileHandler
- * @return Installer
+ * @return wcf\system\setup\Installer
*/
public function extractFiles($targetDir, $sourceArchive, $fileHandler = null) {
return new \wcf\system\setup\Installer($targetDir, $sourceArchive, $fileHandler);
/**
* Returns current package.
- *
- * @return Package
+ *
+ * @return wcf\data\package\Package
*/
public function getPackage() {
if ($this->package === null) {
/**
* Prompts for a text input for package directory (applies for applications only)
- *
- * @return FormDocument
+ *
+ * @return wcf\system\form\FormDocument
*/
protected function promptPackageDir() {
if (!PackageInstallationFormManager::findForm($this->queue, 'packageDir')) {
/**
* Returns current package id.
- *
+ *
* @return integer
*/
public function getPackageID() {
/**
* Returns current package installation type.
- *
+ *
* @return string
*/
public function getAction() {
/**
* Opens the package installation queue and
* starts the installation, update or uninstallation of the first entry.
- *
+ *
* @param integer $parentQueueID
* @param integer $processNo
*/
/**
* Checks the package installation queue for outstanding entries.
- *
+ *
* @return integer
*/
public static function checkPackageInstallationQueue() {
* PackageInstallationFileHandler is the abstract FileHandler implementation for all file installations during the package installation.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.package
- * @category Community Framework
+ * @category Community Framework
*/
abstract class PackageInstallationFileHandler implements IFileHandler {
/**
/**
* PackageInstallationFormManager handels form documents associated with a queue.
- *
+ *
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.package.form
- * @category Community Framework
+ * @category Community Framework
*/
abstract class PackageInstallationFormManager {
/**
* Handles a POST or GET request.
- *
+ *
* @param PackageInstallationQueue $queue
*/
public static function handleRequest(PackageInstallationQueue $queue) {
/**
* Registers a form document.
- *
+ *
* @param PackageInstallationQueue $queue
* @param FormDocument $document
*/
/**
* Searches for an existing form document associated with given queue.
- *
+ *
* @param PackageInstallationQueue $queue
* @param string $formName
* @return boolean
/**
* Inserts a form document into database.
- *
+ *
* @param PackageInstallationQueue $queue
* @param FormDocument $document
*/
/**
* Updates a form document database entry.
- *
+ *
* @param PackageInstallationQueue $queue
* @param FormDocument $document
*/
/**
* Deletes form documents associated with given queue.
- *
+ *
* @param PackageInstallationQueue $queue
*/
public static function deleteForms(PackageInstallationQueue $queue) {
/**
* Returns a form document from database.
- *
+ *
* @param PackageInstallationQueue $queue
* @param string $formName
* @return FormDocument
/**
* PackageInstallationNodeBuilder creates a logical node-based installation tree.
- *
+ *
* @author Alexander Ebert
* @copyright 2001-2011 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.package
- * @category Community Framework
+ * @category Community Framework
*/
class PackageInstallationNodeBuilder {
/**
/**
* Creates a new instance of PackageInstallationNodeBuilder
- *
+ *
* @param PackageInstallationDispatcher $installation
*/
public function __construct(PackageInstallationDispatcher $installation) {
/**
* Returns the succeeding node.
- *
+ *
* @param string $parentNode
* @return string
*/
/**
* Returns data for current node.
- *
+ *
* @param string $node
* @return array
*/
/**
* Marks a node as completed.
- *
+ *
* @param string $node
*/
public function completeNode($node) {
/**
* Removes all nodes associated with queue's process no.
- *
+ *
* CAUTION: This method SHOULD NOT be called within the installation process!
*/
public function purgeNodes() {
/**
* Calculates current setup process.
- *
+ *
* @param string $node
* @return integer
*/
/**
* Duplicates a node by re-inserting it and moving all descendants into a new tree.
- *
+ *
* @param string $node
* @param integer $sequenceNo
*/
/**
* Builds nodes for required packages, whereas each has it own node.
- *
+ *
* @return string
*/
protected function buildRequirementNodes() {
/**
* Builds package installation plugin nodes, whereas pips could be grouped within
* one node, differ from each by nothing but the sequence number.
- *
+ *
* @return string
*/
protected function buildPluginNodes() {
* PackageInstallationSQLParser extends SQLParser by testing and logging functions.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.package
- * @category Community Framework
+ * @category Community Framework
*/
class PackageInstallationSQLParser extends SQLParser {
/**
* package object
- * @var wcf\data\package\Package
+ * @var wcf\data\package\Package
*/
protected $package = null;
/**
* Performs a test of the given queries.
- *
+ *
* @return array conflicts
*/
public function test() {
$this->conflicts = array();
-
+
// get all existing tables from database
$this->existingTables = WCF::getDB()->getEditor()->getTableNames();
}
/**
- * @see wcf\system\database\util\SQLParser::executeCreateTableStatement()
+ * @see wcf\system\database\util\SQLParser::executeCreateTableStatement()
*/
protected function executeCreateTableStatement($tableName, $columns, $indices = array()) {
if ($this->test) {
}
/**
- * @see wcf\system\database\util\SQLParser::executeAddColumnStatement()
+ * @see wcf\system\database\util\SQLParser::executeAddColumnStatement()
*/
protected function executeAddColumnStatement($tableName, $columnName, $columnData) {
if ($this->test) {
}
/**
- * @see wcf\system\database\util\SQLParser::executeAddColumnStatement()
+ * @see wcf\system\database\util\SQLParser::executeAddColumnStatement()
*/
protected function executeAlterColumnStatement($tableName, $oldColumnName, $newColumnName, $newColumnData) {
if ($this->test) {
}
/**
- * @see wcf\system\database\util\SQLParser::executeAddIndexStatement()
+ * @see wcf\system\database\util\SQLParser::executeAddIndexStatement()
*/
protected function executeAddIndexStatement($tableName, $indexName, $indexData) {
if ($this->test) {
}
/**
- * @see wcf\system\database\util\SQLParser::executeAddForeignKeyStatement()
+ * @see wcf\system\database\util\SQLParser::executeAddForeignKeyStatement()
*/
protected function executeAddForeignKeyStatement($tableName, $indexName, $indexData) {
if ($this->test) {
}
/**
- * @see wcf\system\database\util\SQLParser::executeDropColumnStatement()
+ * @see wcf\system\database\util\SQLParser::executeDropColumnStatement()
*/
protected function executeDropColumnStatement($tableName, $columnName) {
if ($this->test) {
}
/**
- * @see wcf\system\database\util\SQLParser::executeDropIndexStatement()
+ * @see wcf\system\database\util\SQLParser::executeDropIndexStatement()
*/
protected function executeDropIndexStatement($tableName, $indexName) {
if ($this->test) {
}
/**
- * @see wcf\system\database\util\SQLParser::executeDropTableStatement()
+ * @see wcf\system\database\util\SQLParser::executeDropTableStatement()
*/
protected function executeDropTableStatement($tableName) {
if ($this->test) {
}
/**
- * @see wcf\system\database\util\SQLParser::executeStandardStatement()
+ * @see wcf\system\database\util\SQLParser::executeStandardStatement()
*/
protected function executeStandardStatement($query) {
if (!$this->test) {
/**
* Contains business logic related to preparation of package installations.
- *
+ *
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.package
- * @category Community Framework
+ * @category Community Framework
*/
class PackageInstallationScheduler {
/**
/**
* Trys to install a new package. Checks the virtual package version list.
*
- * @param string $package package identifier
+ * @param string $package package identifier
* @param string $minversion preferred package version
* @param boolean $installOldVersion true, if you want to install the package in the given minversion and not in the newest version
*/
/**
* Installs a new package.
*
- * @param string $package package identifier
+ * @param string $package package identifier
* @param string $version package version
* @param integer $stackPosition
*/
protected function installPackage($package, $version = '', $stackPosition = -1) {
// get package update versions
$packageUpdateVersions = PackageUpdateDispatcher::getPackageUpdateVersions($package, $version);
-
+
// resolve requirements
$this->resolveRequirements($packageUpdateVersions[0]['packageUpdateVersionID']);
if ($filename = $this->getCachedDownload($package, $packageUpdateVersions[0]['package'])) {
return $filename;
}
-
+
// download file
$authorizationRequiredException = array();
$systemExceptions = array();
try {
// get auth data
$authData = $this->getAuthData($packageUpdateVersion);
-
+
// send request
if (!empty($packageUpdateVersion['file'])) {
$response = PackageUpdateDispatcher::sendRequest($packageUpdateVersion['file'], array(), $authData);
else {
$response = PackageUpdateDispatcher::sendRequest($packageUpdateVersion['server'], array('packageName' => $packageUpdateVersion['package'], 'packageVersion' => $packageUpdateVersion['packageVersion']), $authData);
}
-
+
// check response
// check http code
if ($response['httpStatusCode'] == 401) {
}
}
}
-
+
$excludedPackages[] = array(
'package' => $row['excludedPackage'],
'packageName' => $packageInstallation['packageName'],
}
}
}
-
+
return $excludedPackages;
}
/**
* Gets the filename of in session stored donwloads.
*
- * @param string $package package identifier
- * @param string $version package version
- * @return string $filename
+ * @param string $package package identifier
+ * @param string $version package version
+ * @return string $filename
*/
protected function getCachedDownload($package, $version) {
$cachedDownloads = WCF::getSession()->getVar('cachedPackageUpdateDownloads');
/**
* Gets stored auth data of given update server.
- *
+ *
* @param array $updateServer
* @return array $authData
*/
/**
* Represents step information within an installation node.
- *
+ *
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.package
- * @category Community Framework
+ * @category Community Framework
*/
class PackageInstallationStep {
/**
/**
* Sets next installation node.
- *
+ *
* @param string $node
*/
public function setNode($node) {
/**
* Returns next installation node.
- *
+ *
* @return string
*/
public function getNode() {
/**
* Sets form document object.
- *
+ *
* @param FormDocument $document
*/
public function setDocument(FormDocument $document) {
/**
* Returns HTML-representation of form document object.
- *
+ *
* @return string
*/
public function getTemplate() {
/**
* Returns true if current step holds a form document object.
- *
+ *
* @return boolean
*/
public function hasDocument() {
/**
* Returns true if node should be splitted.
- *
+ *
* @return boolean
*/
public function splitNode() {
/**
* PackageUninstallationDispatcher handles the whole uninstallation process.
- *
+ *
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.package
- * @category Community Framework
+ * @category Community Framework
*/
class PackageUninstallationDispatcher extends PackageInstallationDispatcher {
/**
* Creates a new instance of PackageUninstallationDispatcher.
*
- * @param PackageInstallationQueue $queue
+ * @param wcf\data\package\installation\queue\PackageInstallationQueue $queue
*/
public function __construct(PackageInstallationQueue $queue) {
$this->queue = $queue;
/**
* Uninstalls node components and returns next node.
- *
+ *
* @param string $node
* @return string
*/
/**
* Uninstalls current package.
- *
+ *
* @param array $nodeData
*/
protected function uninstallPackage(array $nodeData) {
/**
* Deletes the given list of files from the target dir.
- *
+ *
* @param string $targetDir
* @param string $files
* @param boolean $deleteEmptyDirectories
/**
* Get all packages which require this package.
- *
+ *
* @param integer $packageID
* @return array
*/
/**
* Returns true if package has dependencies
- *
+ *
* @param integer $packageID
* @return boolean
*/
/**
* Adds an uninstall entry to the package installation queue.
- *
+ *
* @param Package $package
* @param array $packages
*/
* PackageUninstallationNodeBuilder creates a logical node-based uninstallation tree.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.package
- * @category Community Framework
+ * @category Community Framework
*/
class PackageUninstallationNodeBuilder extends PackageInstallationNodeBuilder {
/**
use wcf\system\exception\UserException;
/**
- * A PackageUpdateAuthorizationRequiredException is thrown when a package update server requires a user authorization.
- *
+ * A PackageUpdateAuthorizationRequiredException is thrown when a package update
+ * server requires a user authorization.
+ *
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.package
- * @category Community Framework
+ * @category Community Framework
*/
class PackageUpdateAuthorizationRequiredException extends UserException {
/**
/**
* Creates a new PackageUpdateAuthorizationRequiredException object.
- *
+ *
* @param integer $packageUpdateServerID
* @param string $url
* @param array $response
/**
* Returns the package update server id.
- *
+ *
* @return integer
*/
public function getPackageUpdateServerID() {
/**
* Returns the server url.
- *
+ *
* @return string
*/
public function getURL() {
/**
* Returns the response header.
- *
+ *
* @return string
*/
public function getResponseHeader() {
/**
* Returns the response content.
- *
+ *
* @return string
*/
public function getResponseContent() {
* Provides functions to manage package updates.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.package
- * @category Community Framework
+ * @category Community Framework
*/
abstract class PackageUpdateDispatcher {
/**
* Refreshes the package database.
- *
+ *
* @param array $packageUpdateServerIDs
*/
public static function refreshPackageDatabase(array $packageUpdateServerIDs = array()) {
// send content type and length
$request .= "Content-Type: application/x-www-form-urlencoded\r\n";
- $request .= "Content-Length: ".strlen($postString)."\r\n";
- // if it is a POST request, there MUST be a blank line before the POST data, but there MUST NOT be
- // another blank line before, and of course there must be another blank line at the end of the request!
- $request .= "\r\n";
- if (!empty($postString)) $request .= $postString."\r\n";
+ $request .= "Content-Length: ".strlen($postString)."\r\n";
+ // if it is a POST request, there MUST be a blank line before the POST data, but there MUST NOT be
+ // another blank line before, and of course there must be another blank line at the end of the request!
+ $request .= "\r\n";
+ if (!empty($postString)) $request .= $postString."\r\n";
// send close
- $request .= "Connection: Close\r\n\r\n";
-
- // send request
- $remoteFile->puts($request);
- unset($request, $postString);
-
- // define response vars
- $header = $content = '';
+ $request .= "Connection: Close\r\n\r\n";
+
+ // send request
+ $remoteFile->puts($request);
+ unset($request, $postString);
+
+ // define response vars
+ $header = $content = '';
// fetch the response.
while (!$remoteFile->eof()) {
/**
* Parses a stream containing info from a packages_update.xml.
- *
+ *
* @param string $content
* @return array $allNewPackages
*/
/**
* Parses the xml stucture from a packages_update.xml.
- *
+ *
* @param \DOMXPath $xpath
* @param \DOMNode $package
*/
return $updates;
}
+ /**
+ * Creates a new package installation scheduler.
+ *
+ * @param array $selectedPackages
+ * @param array<integer> $packageUpdateServerIDs
+ * @param boolean $download
+ * @return wcf\system\package\PackageInstallationScheduler
+ */
public static function prepareInstallation(array $selectedPackages, array $packageUpdateServerIDs = array(), $download = true) {
return new PackageInstallationScheduler($selectedPackages, $packageUpdateServerIDs, $download);
}
namespace wcf\system\package;
/**
- * SplitNodeException is not a real exception, it is abused as a work-around for poor class design :(
+ * SplitNodeException is not a real exception, it is abused as a work-around for
+ * poor class design :(
*
* @author Alexander Ebert
* @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.exception
- * @category Community Framework
+ * @category Community Framework
*/
class SplitNodeException extends \Exception { }
* TemplatesFileHandler is a FileHandler implementation for the installation of template files.
*
* @author Benjamin Kunz
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.package
- * @category Community Framework
+ * @category Community Framework
*/
class TemplatesFileHandler extends ACPTemplatesFileHandler {
/**
- * @var wcf\system\package\ACPTemplatesFileHandler::$tableName
+ * @see wcf\system\package\ACPTemplatesFileHandler::$tableName
*/
protected $tableName = 'template';
}
/**
* This PIP installs, updates or deletes acp-menu items.
*
- * @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Alexander Ebert
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class ACPMenuPackageInstallationPlugin extends AbstractMenuPackageInstallationPlugin {
/**
/**
* @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::$tagName
- */
+ */
public $tagName = 'acpmenuitem';
}
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.package.plugin
- * @category Community Framework
+ * @category Community Framework
*/
class ACPSearchProviderPackageInstallationPlugin extends AbstractXMLPackageInstallationPlugin {
/**
/**
* @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::$tagName
- */
+ */
public $tagName = 'acpsearchprovider';
/**
/**
* @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::cleanup()
- */
+ */
protected function cleanup() {
CacheHandler::getInstance()->clear(WCF_DIR.'cache', 'cache.acpSearchProvider-*.php');
}
/**
* This PIP installs, updates or deletes by a package delivered ACP templates.
- *
- * @author Benjamin Kunz
- * @copyright 2001-2011 WoltLab GmbH
+ *
+ * @author Benjamin Kunz
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class ACPTemplatePackageInstallationPlugin extends AbstractPackageInstallationPlugin {
/**
/**
* @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::$tagName
- */
+ */
public $tagName = 'acptemplate';
-
+
/**
* @see wcf\system\package\plugin\IPackageInstallationPlugin::install()
*/
public function install() {
parent::install();
-
+
// extract files.tar to temp folder
$sourceFile = $this->installation->getArchive()->extractTar($this->instruction['value'], 'acptemplates_');
/**
* Default implementation for menu item manipulations.
*
- * @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Alexander Ebert
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
abstract class AbstractMenuPackageInstallationPlugin extends AbstractXMLPackageInstallationPlugin {
/**
use wcf\system\WCF;
/**
- * Default implementation of some functions for PackageInstallationPlugin using options.
+ * Default implementation of some functions for package installation plugin for
+ * options.
*
* @author Benjamin Kunz
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
abstract class AbstractOptionPackageInstallationPlugin extends AbstractXMLPackageInstallationPlugin {
/**
/**
* @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::deleteItems()
- */
+ */
protected function deleteItems(\DOMXPath $xpath) {
// delete options
$elements = $xpath->query('/ns:data/ns:delete/ns:option');
* Default implementation of some PackageInstallationPlugin functions.
*
* @author Benjamin Kunz
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
abstract class AbstractPackageInstallationPlugin implements IPackageInstallationPlugin {
/**
* @see wcf\system\package\plugin\IPackageInstallationPlugin::update()
*/
public function update() {
- // call update event
+ // call update event
EventHandler::getInstance()->fireAction($this, 'update');
return $this->install();
use wcf\util\XML;
/**
- * Default implementation of some functions for a PackageInstallationPlugin using xml definitions.
- *
+ * Default implementation of some functions for a package installation plugin using
+ * xml definitions.
+ *
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
abstract class AbstractXMLPackageInstallationPlugin extends AbstractPackageInstallationPlugin {
/**
*/
protected function getShowOrder($showOrder, $parentName = null, $columnName = null, $tableNameExtension = '') {
if ($showOrder === null) {
- // get greatest showOrder value
+ // get greatest showOrder value
$conditions = new PreparedStatementConditionBuilder();
if ($columnName !== null) $conditions->add($columnName." = ?", array($parentName));
- $sql = "SELECT MAX(showOrder) AS showOrder
- FROM wcf".WCF_N."_".$this->tableName.$tableNameExtension."
+ $sql = "SELECT MAX(showOrder) AS showOrder
+ FROM wcf".WCF_N."_".$this->tableName.$tableNameExtension."
".$conditions;
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditions->getParameters());
$maxShowOrder = $statement->fetchArray();
return (!$maxShowOrder) ? 1 : ($maxShowOrder['showOrder'] + 1);
- }
- else {
+ }
+ else {
// increase all showOrder values which are >= $showOrder
$sql = "UPDATE wcf".WCF_N."_".$this->tableName.$tableNameExtension."
SET showOrder = showOrder + 1
// return the wanted showOrder level
return $showOrder;
- }
+ }
}
}
* This PIP installs, updates or deletes clipboard actions.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage acp.package.plugin
- * @category Community Framework
+ * @category Community Framework
*/
class ClipboardActionPackageInstallationPlugin extends AbstractXMLPackageInstallationPlugin {
/**
/**
* @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::$tagName
- */
+ */
public $tagName = 'action';
/**
* This PIP installs, updates or deletes core objects.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class CoreObjectPackageInstallationPlugin extends AbstractXMLPackageInstallationPlugin {
/**
/**
* @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::$tagName
- */
+ */
public $tagName = 'coreobject';
/**
* This PIP installs, updates or deletes cronjobs.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage acp.package.plugin
- * @category Community Framework
+ * @category Community Framework
*/
class CronjobPackageInstallationPlugin extends AbstractXMLPackageInstallationPlugin {
/**
/**
* @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::$tagName
- */
+ */
public $tagName = 'cronjob';
/**
* This PIP installs, updates or deletes event listeners.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class EventListenerPackageInstallationPlugin extends AbstractXMLPackageInstallationPlugin {
/**
/**
* @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::$tagName
- */
+ */
public $tagName = 'eventlistener';
/**
/**
* This PIP installs, updates or deletes files delivered by a package.
- *
+ *
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class FilePackageInstallationPlugin extends AbstractPackageInstallationPlugin {
/**
* @see wcf\system\package\plugin\AbstractPackageInstallationPlugin::$tableName
- */
+ */
public $tableName = 'package_installation_file_log';
/**
* Any PackageInstallationPlugin should implement this interface.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
interface IPackageInstallationPlugin {
/**
/**
* This PIP installs, updates or deletes language and their categories and items.
- *
- * @author Benjamin Kunz
- * @copyright 2001-2011 WoltLab GmbH
+ *
+ * @author Benjamin Kunz
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class LanguagePackageInstallationPlugin extends AbstractXMLPackageInstallationPlugin {
/**
* @see wcf\system\package\plugin\AbstractPackageInstallationPlugin::$tableName
- */
+ */
public $tableName = 'language_item';
/**
if (isset($languageFiles[$installedLanguages[0]['languageCode']])) {
$languageFile = $languageFiles[$installedLanguages[0]['languageCode']];
}
-
+
// use english (if installed)
else if (isset($languageFiles['en'])) {
foreach ($installedLanguages as $installedLanguage2) {
}
}
}
-
+
// use any installed language
if ($languageFile === null) {
foreach ($installedLanguages as $installedLanguage2) {
}
}
}
-
+
// use first delivered language
if ($languageFile === null) {
foreach ($languageFiles as $languageFile) break;
}
/**
- * Extracts the language file and parses it with
- * SimpleXML. If the specified language file
- * was not found, an error message is thrown.
- *
+ * Extracts the language file and parses it. If the specified language file
+ * was not found, an exception message is thrown.
+ *
* @param string $filename
- * @return wcf\util\XML xml
+ * @return wcf\util\XML
*/
protected function readLanguage($filename) {
// search language files in package archive
/**
* Deletes categories which where changed by an update or deinstallation in case they are now empty.
- *
+ *
* @param array $categoryIDs
- * @param integer $packageID
+ * @param integer $packageID
*/
protected function deleteEmptyCategories(array $categoryIDs, $packageID) {
// Get empty categories which where changed by this package.
* This PIP installs, updates or deletes object type definitions.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage acp.package.plugin
- * @category Community Framework
+ * @category Community Framework
*/
class ObjectTypeDefinitionPackageInstallationPlugin extends AbstractXMLPackageInstallationPlugin {
/**
/**
* @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::$tagName
- */
+ */
public $tagName = 'definition';
/**
* This PIP installs, updates or deletes object types.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage acp.package.plugin
- * @category Community Framework
+ * @category Community Framework
*/
class ObjectTypePackageInstallationPlugin extends AbstractXMLPackageInstallationPlugin {
/**
/**
* @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::$tagName
- */
+ */
public $tagName = 'type';
/**
/**
* This PIP installs, updates or deletes options.
- *
- * @author Benjamin Kunz
- * @copyright 2001-2011 WoltLab GmbH
+ *
+ * @author Benjamin Kunz
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class OptionPackageInstallationPlugin extends AbstractOptionPackageInstallationPlugin {
/**
* @see wcf\system\package\plugin\AbstractPackageInstallationPlugin::$tableName
- */
+ */
public $tableName = 'option';
public static $reservedTags = array('name', 'optiontype', 'defaultvalue', 'validationpattern', 'enableoptions', 'showorder', 'hidden', 'selectoptions', 'categoryname', 'permissions', 'options', 'attrs', 'cdata', 'supporti18n');
/**
* This PIP installs, updates or deletes package installation plugins.
- *
+ *
* @author Marcel Werk
* @copyright 2001-2011 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
+ * @category Community Framework
*/
class PIPPackageInstallationPlugin extends AbstractXMLPackageInstallationPlugin {
/**
/**
* This PIP installs, updates or deletes the package icon of a package.
- *
+ *
* @author Alexander Ebert
* @copyright 2001-2012 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
+ * @category Community Framework
*/
class PackageIconPackageInstallationPlugin extends AbstractPackageInstallationPlugin {
/**
* This PIP installs, updates or deletes page page menu items.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class PageMenuPackageInstallationPlugin extends AbstractMenuPackageInstallationPlugin {
/**
/**
* This PIP executes the delivered sql file.
- *
- * @author Benjamin Kunz
- * @copyright 2001-2011 WoltLab GmbH
+ *
+ * @author Benjamin Kunz
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class SQLPackageInstallationPlugin extends AbstractPackageInstallationPlugin {
/**
* @see wcf\system\package\plugin\AbstractPackageInstallationPlugin::$tableName
- */
+ */
public $tableName = 'package_installation_sql_log';
/**
*/
public function install() {
parent::install();
-
+
// extract sql file from archive
if ($queries = $this->getSQL($this->instruction['value'])) {
$package = $this->installation->getPackage();
/**
* Extracts and returns the sql file.
* If the specified sql file was not found, an error message is thrown.
- *
+ *
* @param string $filename
* @return string
*/
/**
* This PIP executes an individual php script.
- *
- * @author Benjamin Kunz
- * @copyright 2001-2011 WoltLab GmbH
+ *
+ * @author Benjamin Kunz
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class ScriptPackageInstallationPlugin extends AbstractPackageInstallationPlugin {
/**
*/
public function install() {
parent::install();
-
+
// get installation path of package
$sql = "SELECT packageDir
FROM wcf".WCF_N."_package
}
}
+ /**
+ * Runs the script with the given path.
+ *
+ * @param string $scriptPath
+ */
private function run($scriptPath) {
include($scriptPath);
}
/**
* Returns false. Scripts can't be uninstalled.
- *
+ *
* @return boolean false
*/
public function hasUninstall() {
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.package.plugin
- * @category Community Framework
+ * @category Community Framework
*/
class SitemapPackageInstallationPlugin extends AbstractXMLPackageInstallationPlugin {
/**
* This PIP installs, updates or deletes style attributes.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class StyleAttributePackageInstallationPlugin extends AbstractXMLPackageInstallationPlugin {
/**
* list of updated or new style variables
* @var array
- */
+ */
protected $styleVariables = array();
/**
* @see wcf\system\package\plugin\AbstractPackageInstallationPlugin::$tableName
- */
+ */
public $tableName = 'style_variable_to_attribute';
/**
* This PIP installs, updates or deletes styles.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class StylePackageInstallationPlugin extends AbstractPackageInstallationPlugin {
/**
* This PIP installs, updates or deletes template listeners.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class TemplateListenerPackageInstallationPlugin extends AbstractXMLPackageInstallationPlugin {
/**
/**
* @see wcf\system\package\plugin\AbstractPackageInstallationPlugin::$tableName
- */
+ */
public $tableName = 'template_listener';
/**
* @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::$tagName
- */
+ */
public $tagName = 'templatelistener';
/**
/**
* This PIP installs, updates or deletes by a package delivered templates.
- *
- * @author Benjamin Kunz
+ *
+ * @author Benjamin Kunz
* @copyright 2001-2011 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
+ * @category Community Framework
*/
class TemplatePackageInstallationPlugin extends AbstractPackageInstallationPlugin {
/**
* @see wcf\system\package\plugin\AbstractPackageInstallationPlugin::$tableName
- */
+ */
public $tableName = 'template';
/**
/**
* This PIP installs, updates or deletes user group permissions.
- *
- * @author Benjamin Kunz
- * @copyright 2001-2011 WoltLab GmbH
+ *
+ * @author Benjamin Kunz
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class UserGroupOptionPackageInstallationPlugin extends AbstractOptionPackageInstallationPlugin {
/**
* @see wcf\system\package\plugin\AbstractPackageInstallationPlugin::$tableName
*/
public $tableName = 'user_group_option';
-
+
public static $reservedTags = array('name', 'optiontype', 'defaultvalue', 'admindefaultvalue', 'validationpattern', 'showorder', 'categoryname', 'selectoptions', 'enableoptions', 'permissions', 'options', 'attrs', 'cdata');
/**
/**
* This PIP installs, updates or deletes user fields.
- *
- * @author Benjamin Kunz
- * @copyright 2001-2011 WoltLab GmbH
+ *
+ * @author Benjamin Kunz
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class UserOptionPackageInstallationPlugin extends AbstractOptionPackageInstallationPlugin {
/**
* @see wcf\system\package\plugin\AbstractPackageInstallationPlugin::$tableName
- */
+ */
public $tableName = 'user_option';
-
+
public static $reservedTags = array('name', 'optiontype', 'defaultvalue', 'validationpattern', 'required', 'editable', 'visible', 'searchable', 'showorder', 'outputclass', 'selectoptions', 'enableoptions', 'disabled', 'categoryname', 'permissions', 'options', 'attrs', 'cdata');
/**
* Installs user option categories.
- *
+ *
* @param array $category
* @param array $categoryXML
*/
if (isset($option['permissions'])) $permissions = $option['permissions'];
if (isset($option['options'])) $options = $option['options'];
-
// check if optionType exists
$className = 'wcf\system\option\\'.StringUtil::firstCharToUpperCase($optionType).'OptionType';
if (!class_exists($className)) {
$data['packageID'] = $this->installation->getPackageID();
UserOptionEditor::create($data);
}
- }
+ }
/**
* Drops the columns from user option value table from options
/**
* Default interface for route controllers.
- *
+ *
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
interface IRouteController extends ITitledDatabaseObject {
/**
/**
* Handles relative links within the wcf.
*
- * @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Marcel Werk
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class LinkHandler extends SingletonFactory {
/**
/**
* Represents a page request.
*
- * @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Marcel Werk
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class Request {
/**
* page class name
- * @var string
+ * @var string
*/
protected $className = '';
/**
* page name
- * @var string
+ * @var string
*/
protected $pageName = '';
/**
* page type
- * @var string
+ * @var string
*/
protected $pageType = '';
/**
* Handles http requests.
*
- * @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Marcel Werk
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class RequestHandler extends SingletonFactory {
/**
* active request object
- * @var wcf\system\request\Request
+ * @var wcf\system\request\Request
*/
protected $activeRequest = null;
/**
* Builds a new request.
- *
- * @param string $application
+ *
+ * @param string $application
*/
protected function buildRequest($application) {
try {
/**
* Returns the active request object.
- *
+ *
* @return wcf\system\request\Request
*/
public function getActiveRequest() {
* Inspired by routing mechanism used by ASP.NET MVC and released under the terms of
* the Microsoft Public License (MS-PL) http://www.opensource.org/licenses/ms-pl.html
*
- * @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Alexander Ebert
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class Route {
/**
* the Microsoft Public License (MS-PL) http://www.opensource.org/licenses/ms-pl.html
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 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
+ * @category Community Framework
*/
class RouteHandler extends SingletonFactory {
/**
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.search.acp
- * @category Community Framework
+ * @category Community Framework
*/
class ACPSearchHandler extends SingletonFactory {
/**
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.search.acp
- * @category Community Framework
+ * @category Community Framework
*/
class ACPSearchResult {
/**
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.search.acp
- * @category Community Framework
+ * @category Community Framework
*/
class ACPSearchResultList implements \Countable, \Iterator {
/**
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.search.acp
- * @category Community Framework
+ * @category Community Framework
*/
abstract class AbstractACPSearchResultProvider {
/**
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.search.acp
- * @category Community Framework
+ * @category Community Framework
*/
abstract class AbstractCategorizedACPSearchResultProvider extends AbstractACPSearchResultProvider {
/**
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.search.acp
- * @category Community Framework
+ * @category Community Framework
*/
interface IACPSearchResultProvider {
/**
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.search.acp
- * @category Community Framework
+ * @category Community Framework
*/
class MenuItemACPSearchResultProvider extends AbstractACPSearchResultProvider implements IACPSearchResultProvider {
/**
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.search.acp
- * @category Community Framework
+ * @category Community Framework
*/
class OptionACPSearchResultProvider extends AbstractCategorizedACPSearchResultProvider implements IACPSearchResultProvider {
/**
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.search.acp
- * @category Community Framework
+ * @category Community Framework
*/
class UserGroupOptionACPSearchResultProvider extends AbstractCategorizedACPSearchResultProvider implements IACPSearchResultProvider {
/**
* ACPSessionFactory handles session for active user.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.session
- * @category Community Framework
+ * @category Community Framework
*/
class ACPSessionFactory {
/**
* session editor class name
* @var string
- */
+ */
protected $sessionEditor = 'wcf\data\acp\session\ACPSessionEditor';
/**
* Loads the object of the active session.
- */
+ */
public function load() {
// get session
$sessionID = $this->readSessionID();
}
/**
- * Gets the sessionID from request (GET/POST). Returns an empty string,
- * if no sessionID was given.
+ * Returns the session id from request (GET/POST). Returns an empty string,
+ * if no session id was given.
*
* @return string
- *
- */
+ */
protected function readSessionID() {
if (isset($_GET['s'])) {
return $_GET['s'];
* Abstract implementation for application-specific session handlers.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.session
- * @category Community Framework
+ * @category Community Framework
*/
abstract class AbstractSessionHandler extends SingletonFactory {
/**
/**
* @see wcf\system\SingletonFactory::init()
- */
+ */
protected final function init() {
$this->sessionHandler = SessionHandler::getInstance();
/**
* Initializes this session.
*/
- protected abstract function initSession();
+ abstract protected function initSession();
}
* SessionFactory handles session for active user.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.session
- * @category Community Framework
+ * @category Community Framework
*/
class SessionFactory extends ACPSessionFactory {
/**
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.session
- * @category Community Framework
+ * @category Community Framework
*/
class SessionHandler extends SingletonFactory {
/**
/**
* group data and permissions
- * @var array<array>
+ * @var array<array>
*/
protected $groupData = null;
/**
* Loads an existing session or creates a new one.
- *
+ *
* @param string $sessionEditorClassName
* @param string $sessionID
*/
}
/**
- * Defines WCF-global constants related to session.
+ * Defines global wcf constants related to session.
*/
protected function defineConstants() {
if ($this->useCookies) {
/**
* Registers a session variable.
- *
+ *
* @param string $key
* @param string $value
*/
/**
* Returns the user object of this session.
- *
- * @return User $user
+ *
+ * @return wcf\data\user\User $user
*/
public function getUser() {
return $this->user;
}
/**
- * Tries to read existing session identified by $sessionID.
- *
- * @param string $sessionID
- * @return UserSession
+ * Tries to read existing session identified by the given session id.
+ *
+ * @param string $sessionID
*/
protected function getExistingSession($sessionID) {
$this->session = new $this->sessionClassName($sessionID);
/**
* Returns the value of the permission with the given name.
- *
- * @param string $permission
+ *
+ * @param string $permission
* @return mixed permission value
*/
public function getPermission($permission) {
/**
* Stores a new user object in this session, e.g. a user was guest because not
* logged in, after the login his old session is used to store his full data.
- *
- * @param User $user
- * @param boolean $hideSession When set to true the database will not be updated.
+ *
+ * @param wcf\data\userUser $user
+ * @param boolean $hideSession if true, database won't be updated
*/
public function changeUser(User $user, $hideSession = false) {
$sessionTable = call_user_func(array($this->sessionClassName, 'getDatabaseTableName'));
/**
* Returns currently active language id.
- *
+ *
* @return integer
*/
public function getLanguageID() {
/**
* Sets the currently active language id.
- *
+ *
* @param integer $languageID
*/
public function setLanguageID($languageID) {
/**
* Resets session-specific storage data.
- *
+ *
* @param array<integer> $userIDs
*/
public static function resetSessions(array $userIDs = array()) {
* A FileHandler class logs files and checks their overwriting rights.
*
* @author Marcel Werk
- * @copyright 2001-2009 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.setup
- * @category Community Framework
+ * @category Community Framework
*/
interface IFileHandler {
/**
/**
* Installer extracts folders and files from a tar archive.
- *
+ *
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.setup
- * @category Community Framework
+ * @category Community Framework
*/
class Installer {
- protected $targetDir, $source, $folder, $fileHandler;
+ /**
+ * directory the files are installed into
+ * @var string
+ */
+ protected $targetDir;
+
+ /**
+ * name of the source tar archive
+ * @var string
+ */
+ protected $source;
+
+ /**
+ * folder within source that limits the installed files to those within
+ * this folder
+ * @var string
+ */
+ protected $folder;
+
+ /**
+ * file handler of the installed files
+ * @var wcf\system\setup\IFileHandler
+ */
+ protected $fileHandler;
/**
* Creates a new Installer object.
- *
- * @param string $targetDir extract the files in this dir
- * @param string $source name of the source tar archive
- * @param FileHandler $fileHandler
- * @param string $folder extract only the files from this subfolder
+ *
+ * @param string $targetDir
+ * @param string $source
+ * @param wcf\system\setup\IFileHandler $fileHandler
+ * @param string $folder
*/
public function __construct($targetDir, $source, $fileHandler = null, $folder = '') {
$this->targetDir = FileUtil::addTrailingSlash($targetDir);
/**
* Creates a directory in the target directory.
- *
+ *
* @param string $dir
*/
protected function createDir($dir) {
/**
* Touches a file in the target directory.
- *
+ *
* @param string $file
*/
public function touchFile($file) {
/**
* Creates a file in the target directory.
- *
+ *
* @param string $file
* @param integer $index
* @param Tar $tar
}
$this->checkFiles($files);
-
+
// now create the directories
$errors = array();
foreach ($directories as $dir) {
$errors[] = array('file' => $dir, 'code' => $e->getCode(), 'message' => $e->getMessage());
}
}
-
+
// now untar all files
foreach ($files as $index => $file) {
try {
}
$this->logFiles($files);
-
+
// close tar
$tar->close();
}
/**
* Checkes whether the given files overwriting locked existing files.
- *
- * @param array $files list of files
+ *
+ * @param array $files
*/
protected function checkFiles(&$files) {
if ($this->fileHandler != null && $this->fileHandler instanceof IFileHandler) {
/**
* Logs the extracted files.
- *
+ *
* @param array $files list of files
*/
protected function logFiles(&$files) {
/**
* Makes a file or directory writeable.
- *
+ *
* @param string $target
*/
protected function makeWriteable($target) {
/**
* Uninstaller deletes files and directories.
- *
+ *
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.setup
- * @category Community Framework
+ * @category Community Framework
*/
class Uninstaller {
- protected $targetDir, $files, $deleteEmptyTargetDir, $deleteEmptyDirectories;
+ /**
+ * directory which contains the files to delete
+ * @var string
+ */
+ protected $targetDir;
+
+ /**
+ * files to delete
+ * @var array<string>
+ */
+ protected $files;
+
+ /**
+ * indicates if target directory will be deleted if empty
+ * @var boolean
+ */
+ protected $deleteEmptyTargetDir;
+
+ /**
+ * indicates if sub directory will be deleted if empty
+ * @var boolean
+ */
+ protected $deleteEmptyDirectories;
/**
* Creates a new Uninstaller object.
- *
+ *
* @param string $targetDir
- * @param array $files delete the files
- * @param boolean $deleteEmptyTargetDir delete target dir if empty
- * @param boolean $deleteEmptyDirectories delete sub-directories if empty
+ * @param array $files
+ * @param boolean $deleteEmptyTargetDir
+ * @param boolean $deleteEmptyDirectories
*/
public function __construct($targetDir, $files, $deleteEmptyTargetDir, $deleteEmptyDirectories) {
$this->targetDir = $targetDir;
/**
* Returns true if a directory is emtpy.
- *
+ *
* @param string $dir
- * @return boolean true if dir is empty
+ * @return boolean
*/
protected function isEmpty($dir) {
if (is_dir($dir)) {
/**
* Deletes a file.
- *
+ *
* @param string $file
*/
protected function deleteFile($file) {
/**
* Deletes a directory.
- *
+ *
* @param string $dir
*/
protected function deleteDir($dir) {
$directories = array();
foreach ($this->files as $file) {
$this->deleteFile($this->targetDir.$file);
-
+
// store directory if this file is not direct in the targetdirectory
$dirname = dirname($file);
if ($dirname != '.') {
// split the directory
$path = explode("/", $dirname);
-
+
// store the directory in a key which is the representation
// for the depth of this directory.
// use dirname as key to store each dir only once
}
// TODO: else throw SystemException ?
}
-
}
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.sitemap
- * @category Community Framework
+ * @category Community Framework
*/
interface ISitemapProvider {
/**
/**
* Handles sitemap interactions.
*
- * @author Alexander Ebert
+ * @author Alexander Ebert
* @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage sitemap.sitemap
- * @category Community Framework
+ * @category Community Framework
*/
class SitemapHandler extends SingletonFactory {
/**
protected $cache = null;
/**
- * @see \wcf\system\SingletonFactory::init()
+ * @see wcf\system\SingletonFactory::init()
*/
protected function init() {
$application = ApplicationHandler::getInstance()->getPrimaryApplication();
/**
* Returns array of tree items or an empty array if only one sitemap is registered.
- *
+ *
* @return array<wcf\data\sitemap\Sitemap>
*/
public function getTree() {
* Handles style-related actions.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.style
- * @category Community Framework
+ * @category Community Framework
*/
class StyleHandler extends SingletonFactory {
/**
protected $style = null;
/**
- * Creates a new StyleHandler object.
+ * @see wcf\system\exception\SystemException::init()
*/
protected function init() {
// load cache
throw new SystemException('no default style defined');
}
}
-
+
// init style
$this->style = new ActiveStyle($this->cache['styles'][$styleID]);
* ACPTemplate loads and displays template in the admin control panel of the wcf.
* ACPTemplate does not support template groups.
*
- * @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Alexander Ebert
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.template
- * @category Community Framework
+ * @category Community Framework
*/
class ACPTemplateEngine extends TemplateEngine {
/**
}
/**
- * Template groups are not supported by acp template engine.
- *
* @see wcf\system\template\TemplateEngine::setTemplateGroupID()
*/
public final function setTemplateGroupID($templateGroupID) {
+ // template groups are not supported by the acp template engine
$this->templateGroupID = 0;
}
}
/**
* SetupTemplateEngine loads and displays template in the setup process.
*
- * @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Alexander Ebert
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.template
- * @category Community Framework
+ * @category Community Framework
*/
class SetupTemplateEngine extends TemplateEngine {
/**
- * @see wcf\system\template\TemplateEngine::loadTemplateGroupCache()
+ * @see wcf\system\template\TemplateEngine::loadTemplateGroupCache()
*/
protected function loadTemplateGroupCache() {}
/**
- * @see wcf\system\template\TemplateEngine::getSourceFilename()
+ * @see wcf\system\template\TemplateEngine::getSourceFilename()
*/
public function getSourceFilename($templateName, $packageID) {
return $this->templatePaths[PACKAGE_ID].'setup/template/'.$templateName.'.tpl';
}
/**
- * @see wcf\system\template\TemplateEngine::getCompiledFilename()
+ * @see wcf\system\template\TemplateEngine::getCompiledFilename()
*/
public function getCompiledFilename($templateName, $packageID) {
return $this->compileDir.'setup/template/compiled/'.$this->languageID.'_'.$templateName.'.php';
}
/**
- * @see wcf\system\template\TemplateEngine::getMetaDataFilename()
+ * @see wcf\system\template\TemplateEngine::getMetaDataFilename()
*/
public function getMetaDataFilename($templateName, $packageID) {
return $this->compileDir.'setup/template/compiled/'.$this->languageID.'_'.$templateName.'.meta.php';
}
/**
- * Template Listener are not available during setup.
+ * @see wcf\system\template\TemplateEngine::loadTemplateListeners()
*/
- protected function loadTemplateListeners() {}
+ protected function loadTemplateListeners() {
+ // template isteners are not available during setup
+ }
}
/**
* TemplateCompiler compiles template source into valid php code.
*
- * @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Marcel Werk
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.template
- * @category Community Framework
+ * @category Community Framework
*/
class TemplateCompiler extends TemplateScriptingCompiler {
/**
/**
* Returns the name of the current template.
*
- * @return string
+ * @return string
*/
public function getCurrentTemplate() {
return $this->getCurrentIdentifier();
/**
* TemplateEngine loads and displays template.
*
- * @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Alexander Ebert
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.template
- * @category Community Framework
+ * @category Community Framework
*/
class TemplateEngine extends SingletonFactory {
/**
/**
* forces the template engine to recompile all included templates
- * @var boolean
+ * @var boolean
*/
protected $forceCompile = false;
protected $environment = 'user';
/**
- * Creates a new instance of TemplateEngine.
- *
- * @see wcf\system\template\TemplateEngine::getInstance()
+ * @see wcf\system\SingletonFactory::init()
*/
protected function init() {
$this->templatePaths = array(1 => WCF_DIR.'templates/');
/**
* Assigns a template variable.
- *
+ *
* @param mixed $variable
* @param mixed $value
*/
/**
* Appends content to an existing template variable.
- *
+ *
* @param mixed $variable
* @param mixed $value
*/
/**
* Prepends content to an existing template variable.
- *
+ *
* @param mixed $variable
* @param mixed $value
*/
/**
* Assigns a template variable by reference.
- *
+ *
* @param string $variable
* @param mixed $value
*/
/**
* Clears an assignment of template variables.
- *
+ *
* @param mixed $variables
*/
public function clearAssign(array $variables) {
/**
* Outputs a template.
- *
+ *
* @param string $templateName
* @param integer $packageID
* @param boolean $sendHeaders
/**
* Returns the absolute filename of a template source.
- *
+ *
* @param string $templateName
* @param integer $packageID
* @return string $path
/**
* Returns the absolute filename of a compiled template.
- *
+ *
* @param string $templateName
* @param integer $packageID
*/
/**
* Checks wheater a template is already compiled or not.
- *
+ *
* @param string $templateName
* @param string $sourceFilename
* @param string $compiledFilename
/**
* Compiles a template.
- *
+ *
* @param string $templateName
* @param string $sourceFilename
* @param string $compiledFilename
/**
* Reads the content of a template file.
- *
+ *
* @param string $sourceFilename
* @return string $sourceContent
*/
/**
* Returns the class name of a plugin.
- *
- * @param string $type
- * @param string $tag
- * @return string class name
+ *
+ * @param string $type
+ * @param string $tag
+ * @return string
*/
public function getPluginClassName($type, $tag) {
return $this->pluginNamespace.StringUtil::firstCharToUpperCase($tag).StringUtil::firstCharToUpperCase(StringUtil::toLowerCase($type)).'TemplatePlugin';
throw new SystemException('TemplateEngine is already in sandbox mode. Disable the current sandbox mode before you enable a new one.');
}
}
-
+
/**
* Disables execution in sandbox.
*/
/**
* Returns the output of a template.
- *
- * @param string $templateName
- * @param array $variables
- * @param boolean $sandbox enables execution in sandbox
+ *
+ * @param string $templateName
+ * @param array $variables
+ * @param boolean $sandbox enables execution in sandbox
* @param integer $packageID
- * @return string output
+ * @return string
*/
public function fetch($templateName, array $variables = array(), $sandbox = false, $packageID = PACKAGE_ID) {
// enable sandbox
if ($sandbox) {
$this->disableSandbox();
}
-
+
return $output;
}
/**
* Executes a compiled template scripting source and returns the result.
*
- * @param string $compiledSource
- * @param array $variables
- * @param boolean $sandbox enables execution in sandbox
- * @return string result
+ * @param string $compiledSource
+ * @param array $variables
+ * @param boolean $sandbox enables execution in sandbox
+ * @return string
*/
public function fetchString($compiledSource, array $variables = array(), $sandbox = true) {
// enable sandbox
if ($sandbox) {
$this->disableSandbox();
}
-
+
return $output;
}
*/
public static function deleteCompiledTemplates($compileDir = '') {
if (empty($compileDir)) $compileDir = WCF_DIR.'templates/compiled/';
-
+
// delete compiled templates
DirectoryUtil::getInstance($compileDir)->removePattern(new Regex('.*_.*_.*\.php$'));
}
/**
* Returns an array with all prefilters.
- *
+ *
* @return array<string>
*/
public function getPrefilters() {
/**
* Registers prefilters.
- *
- * @param array<string> $prefilters
+ *
+ * @param array<string> $prefilters
*/
public function registerPrefilter(array $prefilters) {
foreach ($prefilters as $name) {
/**
* Sets the dir for the compiled templates.
*
- * @param string $compileDir
+ * @param string $compileDir
*/
public function setCompileDir($compileDir) {
if (!is_dir($compileDir)) {
/**
* Includes a template.
- *
- * @param string $templateName
- * @param array $variables
- * @param boolean $sandbox enables execution in sandbox
+ *
+ * @param string $templateName
+ * @param array $variables
+ * @param boolean $sandbox enables execution in sandbox
*/
protected function includeTemplate($templateName, array $variables = array(), $sandbox = true, $packageID = PACKAGE_ID) {
// enable sandbox
/**
* Returns the value of a template variable.
*
- * @param string $varname
+ * @param string $varname
* @return mixed
*/
public function get($varname) {
/**
* TemplateScriptingCompiler compiles template source in valid php code.
*
- * @author Marcel Werk
- * @copyright 2001-2009 WoltLab GmbH
+ * @author Marcel Werk
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.template
- * @category Community Framework
+ * @category Community Framework
*/
class TemplateScriptingCompiler {
/**
}
$this->popTag('if');
return '<?php } ?>';
-
+
case 'include':
return $this->compileIncludeTag($tagArgs, $identifier, $metaData);
case 'foreach':
$this->pushTag('foreach');
return $this->compileForeachTag($tagArgs);
-
+
case 'foreachelse':
list($openTag) = end($this->tagStack);
if ($openTag != 'foreach') {
case 'section':
$this->pushTag('section');
return $this->compileSectionTag($tagArgs);
-
+
case 'sectionelse':
list($openTag) = end($this->tagStack);
if ($openTag != 'section') {
case 'capture':
$this->pushTag('capture');
return $this->compileCaptureTag(true, $tagArgs);
-
+
case '/capture':
list($openTag) = end($this->tagStack);
if ($openTag != 'capture') {
case 'rdelim':
return $this->rightDelimiter;
-
+
default:
// 1) compiler functions first
if ($phpCode = $this->compileCompilerPlugin($tagCommand, $tagArgs)) {
/**
* Compiles a function plugin.
- *
- * @param string $tagCommand
- * @param string $tagArgs
- * @return mixed false, if the plugin does not exist
+ *
+ * @param string $tagCommand
+ * @param string $tagArgs
+ * @return mixed false, if the plugin does not exist
* otherwise the php output of the plugin
*/
protected function compileFunctionPlugin($tagCommand, $tagArgs) {
$this->autoloadPlugins[$className] = $className;
$tagArgs = $this->makeArgString($this->parseTagArgs($tagArgs, $tagCommand));
-
+
return "<?php echo \$this->pluginObjects['".$className."']->execute(array(".$tagArgs."), \$this); ?>";
}
/**
* Compiles a block plugin.
*
- * @param string $tagCommand
- * @param string $tagArgs
- * @return mixed false, if the plugin does not exist
+ * @param string $tagCommand
+ * @param string $tagArgs
+ * @return mixed false, if the plugin does not exist
* otherwise the php output of the plugin
*/
protected function compileBlockPlugin($tagCommand, $tagArgs) {
else {
$startTag = true;
}
-
+
$className = $this->template->getPluginClassName('block', $tagCommand);
if (!class_exists($className)) {
return false;
if ($startTag) {
$this->pushTag($tagCommand);
-
+
$tagArgs = $this->makeArgString($this->parseTagArgs($tagArgs, $tagCommand));
-
+
$phpCode = "<?php \$this->tagStack[] = array('".$tagCommand."', array(".$tagArgs."));\n";
$phpCode .= "\$this->pluginObjects['".$className."']->init(\$this->tagStack[count(\$this->tagStack) - 1][1], \$this);\n";
$phpCode .= "while (\$this->pluginObjects['".$className."']->next(\$this)) { ob_start(); ?>";
return $phpCode;
}
-
/**
* Compiles a compiler function/block.
- *
- * @param string $tagCommand
- * @param string $tagArgs
- * @return mixed false, if the plugin does not exist
+ *
+ * @param string $tagCommand
+ * @param string $tagArgs
+ * @return mixed false, if the plugin does not exist
* otherwise the php output of the plugin
*/
protected function compileCompilerPlugin($tagCommand, $tagArgs) {
else {
$startTag = true;
}
-
+
$className = $this->template->getPluginClassName('compiler', $tagCommand);
// if necessary load plugin from plugin-dir
if (!isset($this->compilerPlugins[$className])) {
return $phpCode;
}
-
+
/**
- * Compiles a capture tag.
- *
- * @param boolean $startTag
- * @param string $captureTag
- * @return string phpCode
+ * Compiles a capture tag and returns the compiled PHP code.
+ *
+ * @param boolean $startTag
+ * @param string $captureTag
+ * @return string
*/
protected function compileCaptureTag($startTag, $captureTag = null) {
if ($startTag) {
}
/**
- * Compiles a section tag.
- *
- * @param string $sectionTag
- * @return string phpCode
+ * Compiles a section tag and returns the compiled PHP code.
+ *
+ * @param string $sectionTag
+ * @return string
*/
protected function compileSectionTag($sectionTag) {
$args = $this->parseTagArgs($sectionTag, 'section');
-
+
// check arguments
if (!isset($args['loop'])) {
throw new SystemException($this->formatSyntaxError("missing 'loop' attribute in section tag", $this->currentIdentifier, $this->currentLineNo));
}
$sectionProp = "\$this->v['tpl']['section'][".$args['name']."]";
-
+
$phpCode = "<?php\n";
$phpCode .= "if (".$args['loop'].") {\n";
$phpCode .= $sectionProp." = array();\n";
$phpCode .= "} else {\n";
$phpCode .= "".$sectionProp."['total'] = 0;\n";
$phpCode .= "".$sectionProp."['show'] = false;}\n";
-
+
$phpCode .= "if (".$sectionProp."['show']) {\n";
$phpCode .= "for (".$sectionProp."['index'] = ".$sectionProp."['start'], ".$sectionProp."['rowNumber'] = 1;\n";
$phpCode .= $sectionProp."['rowNumber'] <= ".$sectionProp."['total'];\n";
$phpCode .= $sectionProp."['first'] = (".$sectionProp."['rowNumber'] == 1);\n";
$phpCode .= $sectionProp."['last'] = (".$sectionProp."['rowNumber'] == ".$sectionProp."['total']);\n";
$phpCode .= "?>";
-
+
return $phpCode;
}
/**
- * Compiles a foreach tag.
+ * Compiles a foreach tag and returns the compiled PHP code.
*
- * @param string $foreachTag
- * @return string phpCode
+ * @param string $foreachTag
+ * @return string
*/
protected function compileForeachTag($foreachTag) {
$args = $this->parseTagArgs($foreachTag, 'foreach');
-
+
// check arguments
if (!isset($args['from'])) {
throw new SystemException($this->formatSyntaxError("missing 'from' attribute in foreach tag", $this->currentIdentifier, $this->currentLineNo));
if (!isset($args['item'])) {
throw new SystemException($this->formatSyntaxError("missing 'item' attribute in foreach tag", $this->currentIdentifier, $this->currentLineNo));
}
-
+
$foreachProp = '';
if (isset($args['name'])) {
$foreachProp = "\$this->v['tpl']['foreach'][".$args['name']."]";
}
/**
- * Compiles an include tag.
+ * Compiles an include tag and returns the compiled PHP code.
*
- * @param string $includeTag
+ * @param string $includeTag
* @param string $identifier
* @param array $metaData
- * @return string phpCode
+ * @return
*/
protected function compileIncludeTag($includeTag, $identifier, array &$metaData) {
$args = $this->parseTagArgs($includeTag, 'include');
if (!isset($args['file'])) {
throw new SystemException($this->formatSyntaxError("missing 'file' attribute in include tag", $this->currentIdentifier, $this->currentLineNo));
}
-
+
// get filename
$file = $args['file'];
unset($args['file']);
-
+
// special parameters
$assignVar = false;
if (isset($args['assign'])) {
}
/**
- * Parses an argument list and returns
- * the keys and values in an associative array.
- *
- * @param string $tagArgs
- * @param string $tag
- * @return array $tagArgs
+ * Parses an argument list and returns the keys and values in an associative
+ * array.
+ *
+ * @param string $tagArgs
+ * @param string $tag
+ * @return array
*/
public function parseTagArgs($tagArgs, $tag) {
// replace strings
if (!preg_match('~^(?:\s+\w+\s*=\s*[^=]*(?=\s|$))*$~s', $tagArgs)) {
throw new SystemException($this->formatSyntaxError('syntax error in tag {'.$tag.'}', $this->currentIdentifier, $this->currentLineNo));
}
-
+
// parse tag arguments
$matches = array();
// find all variables
}
/**
- * Takes an array created by TemplateCompiler::parseTagArgs()
- * and creates a string.
- *
- * @param array $args
- * @return string $args
+ * Takes an array created by TemplateCompiler::parseTagArgs() and creates
+ * a string.
+ *
+ * @param array $args
+ * @return string $args
*/
public static function makeArgString($args) {
$argString = '';
}
/**
- * Formats a syntax error message.
+ * Returns a formatted syntax error message.
*
* @param string $errorMsg
* @param string $file
* @param integer $line
- * @return string formatted error message
+ * @return string
*/
public static function formatSyntaxError($errorMsg, $file = null, $line = null) {
$errorMsg = 'Template compilation failed: '.$errorMsg;
}
/**
- * Compiles an {if} Tag
+ * Compiles an {if} tag and returns the compiled PHP code.
*
- * @param string $tagArgs
+ * @param string $tagArgs
* @param boolean $elseif true, if this tag is an else tag
- * @return string php code of this tag
+ * @return string
*/
protected function compileIfTag($tagArgs, $elseif = false) {
$tagArgs = $this->replaceQuotes($tagArgs);
/**
* Adds a tag to the tag stack.
- *
- * @param string $tag
+ *
+ * @param string $tag
*/
public function pushTag($tag) {
$this->tagStack[] = array($tag, $this->currentLineNo);
/**
* Deletes a tag from the tag stack.
- *
- * @param string $tag
- * @return string $tag
+ *
+ * @param string $tag
+ * @return string $tag
*/
public function popTag($tag) {
list($openTag, $lineNo) = array_pop($this->tagStack);
}
/**
- * Compiles an output tag.
+ * Compiles an output tag and returns the compiled PHP code.
*
* @param string $tag
- * @return string php code of this tag
+ * @return string
*/
protected function compileOutputTag($tag) {
$encodeHTML = false;
}
/**
- * Compiles a variable tag.
+ * Compiles a variable tag and returns the compiled PHP code.
*
* @param string $variable
* @param string $type
}
/**
- * Compiles a modifier tag.
+ * Compiles a modifier tag and returns the compiled PHP code.
*
* @param array $data
* @return string
}
/**
- * Returns type of the given variable
+ * Returns type of the given variable.
*
* @param string $variable
* @return string
}
/**
- * Compiles a variable tag.
+ * Compiles a variable tag and returns the compiled PHP code.
*
* @param string $tag
* @return string
case 'start':
$result .= $this->compileSimpleVariable($values[$i], $variableType);
$statusStack[0] = $status = $variableType;
- break;
-
+ break;
+
case 'object access':
if (/*strpos($values[$i], '$') !== false || */strpos($values[$i], '@@') !== false) {
throw new SystemException($this->formatSyntaxError("unexpected '->".$values[$i]."' in tag '".$tag."'", $this->currentIdentifier, $this->currentLineNo));
if (strpos($values[$i], '$') !== false) $result .= '{'.$this->compileSimpleVariable($values[$i], $variableType).'}';
else $result .= $values[$i];
$statusStack[count($statusStack) - 1] = $status = 'object';
- break;
+ break;
case 'object method start':
$statusStack[count($statusStack) - 1] = 'object method';
$result .= $this->compileSimpleVariable($values[$i], $variableType);
$statusStack[] = $status = $variableType;
- break;
-
+ break;
+
case 'object method parameter separator':
array_pop($statusStack);
$result .= $this->compileSimpleVariable($values[$i], $variableType);
$statusStack[] = $status = $variableType;
- break;
-
+ break;
+
case 'dot access':
$result .= $this->compileSimpleVariable($values[$i], $variableType, false);
$result .= ']';
$statusStack[count($statusStack) - 1] = $status = 'variable';
- break;
-
+ break;
+
case 'object method':
case 'left parenthesis':
$result .= $this->compileSimpleVariable($values[$i], $variableType);
$statusStack[] = $status = $variableType;
- break;
-
+ break;
+
case 'bracket open':
$result .= $this->compileSimpleVariable($values[$i], $variableType, false);
$statusStack[] = $status = $variableType;
- break;
-
+ break;
+
case 'math':
$result .= $this->compileSimpleVariable($values[$i], $variableType);
$statusStack[count($statusStack) - 1] = $status = $variableType;
- break;
-
+ break;
+
case 'modifier end':
$result .= $this->compileSimpleVariable($values[$i], $variableType);
$statusStack[] = $status = $variableType;
- break;
+ break;
case 'modifier':
if (strpos($values[$i], '$') !== false || strpos($values[$i], '@@') !== false) {
}
$statusStack[count($statusStack) - 1] = $status = 'modifier end';
- break;
-
+ break;
+
case 'object':
case 'constant':
case 'variable':
case 'string':
throw new SystemException($this->formatSyntaxError('unknown tag {'.$tag.'}', $this->currentIdentifier, $this->currentLineNo));
- break;
+ break;
}
}
-
+
// check operator
if ($operator !== null) {
switch ($operator) {
}
throw new SystemException($this->formatSyntaxError("unexpected '.' in tag '".$tag."'", $this->currentIdentifier, $this->currentLineNo));
- break;
+ break;
// object access
case '->':
}
throw new SystemException($this->formatSyntaxError("unexpected '->' in tag '".$tag."'", $this->currentIdentifier, $this->currentLineNo));
- break;
+ break;
// left parenthesis
case '(':
}
throw new SystemException($this->formatSyntaxError("unexpected '(' in tag '".$tag."'", $this->currentIdentifier, $this->currentLineNo));
- break;
+ break;
// right parenthesis
case ')':
}
throw new SystemException($this->formatSyntaxError("unexpected ')' in tag '".$tag."'", $this->currentIdentifier, $this->currentLineNo));
- break;
+ break;
// bracket open
case '[':
}
throw new SystemException($this->formatSyntaxError("unexpected '[' in tag '".$tag."'", $this->currentIdentifier, $this->currentLineNo));
- break;
+ break;
// bracket close
case ']':
}
throw new SystemException($this->formatSyntaxError("unexpected ']' in tag '".$tag."'", $this->currentIdentifier, $this->currentLineNo));
- break;
-
+ break;
+
// modifier
case '|':
// handle previous modifier
$statusStack = array(0 => 'modifier');
$modifierData = array('name' => '', 'parameter' => array(0 => $result));
$result = '';
- break;
-
+ break;
+
// modifier parameter
case ':':
while ($oldStatus = array_pop($statusStack)) {
}
throw new SystemException($this->formatSyntaxError("unexpected ':' in tag '".$tag."'", $this->currentIdentifier, $this->currentLineNo));
- break;
-
+ break;
+
case ',':
while ($oldStatus = array_pop($statusStack)) {
if ($oldStatus != 'variable' && $oldStatus != 'object' && $oldStatus != 'constant' && $oldStatus != 'string') {
throw new SystemException($this->formatSyntaxError("unexpected ',' in tag '".$tag."'", $this->currentIdentifier, $this->currentLineNo));
break;
- // math operators
+ // math operators
case '+':
case '-':
case '*':
}
throw new SystemException($this->formatSyntaxError("unexpected '".$operator."' in tag '".$tag."'", $this->currentIdentifier, $this->currentLineNo));
- break;
+ break;
}
}
}
* The 'append' compiler function calls the append function on the template object.
*
* Usage:
- * {append var=name value="foo"}
+ * {append var=name value="foo"}
*
- * @author Marcel Werk
- * @copyright 2001-2009 WoltLab GmbH
+ * @author Marcel Werk
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.template.plugin
- * @category Community Framework
+ * @category Community Framework
*/
class AppendCompilerTemplatePlugin implements ICompilerTemplatePlugin {
/**
- * @see wcf\system\template\ICompilerTemplatePlugin::executeStart()
+ * @see wcf\system\template\ICompilerTemplatePlugin::executeStart()
*/
public function executeStart($tagArgs, TemplateScriptingCompiler $compiler) {
if (!isset($tagArgs['var'])) {
}
/**
- * @see wcf\system\template\ICompilerTemplatePlugin::executeEnd()
+ * @see wcf\system\template\ICompilerTemplatePlugin::executeEnd()
*/
public function executeEnd(TemplateScriptingCompiler $compiler) {
throw new SystemException($compiler->formatSyntaxError("unknown tag {/append}", $compiler->getCurrentIdentifier(), $compiler->getCurrentLineNo()));
<?php
namespace wcf\system\template\plugin;
-use wcf\data\option\Option;
use wcf\system\template\TemplateEngine;
/**
* The list has key-value pairs separated by : with each pair on an own line:
*
* Example list:
- * key1:value1
- * key2:value2
- * ...
+ * key1:value1
+ * key2:value2
+ * ...
*
* Usage:
- * {$list|arrayfromlist}
- *
- * @author Marcel Werk
- * @copyright 2001-2009 WoltLab GmbH
+ * {$list|arrayfromlist}
+ *
+ * @todo rename to 'ArrayFromListModifierTemplatePlugin'
+ *
+ * @author Marcel Werk
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.template.plugin
- * @category Community Framework
+ * @category Community Framework
*/
class ArrayfromlistModifierTemplatePlugin implements IModifierTemplatePlugin {
/**
- * @see wcf\system\template\IModifierTemplatePlugin::execute()
+ * @see wcf\system\template\IModifierTemplatePlugin::execute()
*/
public function execute($tagArgs, TemplateEngine $tplObj) {
- // TODO: doesn't work
- // return Option::parseSelectOptions($tagArgs[0]);
+ // TODO: implement
return '';
}
}
* The 'assign' compiler function calls the assign function on the template object.
*
* Usage:
- * {assign var=name value="foo"}
- *
- * @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * {assign var=name value="foo"}
+ *
+ * @author Marcel Werk
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.template.plugin
- * @category Community Framework
+ * @category Community Framework
*/
class AssignCompilerTemplatePlugin implements ICompilerTemplatePlugin {
/**
- * @see wcf\system\template\ICompilerTemplatePlugin::executeStart()
+ * @see wcf\system\template\ICompilerTemplatePlugin::executeStart()
*/
public function executeStart($tagArgs, TemplateScriptingCompiler $compiler) {
if (!isset($tagArgs['var'])) {
}
/**
- * @see wcf\system\template\ICompilerTemplatePlugin::executeEnd()
+ * @see wcf\system\template\ICompilerTemplatePlugin::executeEnd()
*/
public function executeEnd(TemplateScriptingCompiler $compiler) {
throw new SystemException($compiler->formatSyntaxError("unknown tag {/assign}", $compiler->getCurrentIdentifier(), $compiler->getCurrentLineNo()));
use wcf\system\template\TemplateEngine;
/**
- * The 'concat' modifier returns the string that results from concatenating the arguments.
- * May have two or more arguments.
+ * The 'concat' modifier returns the string that results from concatenating the
+ * arguments. May have two or more arguments.
*
* Usage:
- * {"left"|concat:$right}
+ * {"left"|concat:$right}
*
- * @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Marcel Werk
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.template.plugin
- * @category Community Framework
+ * @category Community Framework
*/
class ConcatModifierTemplatePlugin implements IModifierTemplatePlugin {
/**
- * @see wcf\system\template\ITemplatePluginModifier::execute()
+ * @see wcf\system\template\ITemplatePluginModifier::execute()
*/
public function execute($tagArgs, TemplateEngine $tplObj) {
if (count($tagArgs) < 2) {
foreach ($tagArgs as $arg) {
$result .= $arg;
}
-
+
return $result;
}
}
* The 'counter' template function is used to print out a count.
*
* Usage:
- * {counter assign=i}
- * {counter start=10 skip=2}
- *
- * @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * {counter assign=i}
+ * {counter start=10 skip=2}
+ *
+ * @author Marcel Werk
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.template.plugin
- * @category Community Framework
+ * @category Community Framework
*/
class CounterFunctionTemplatePlugin implements IFunctionTemplatePlugin {
+ /**
+ * counter data
+ * @var array
+ */
protected $counters = array();
/**
- * @see wcf\system\template\IFunctionTemplatePlugin::execute()
+ * @see wcf\system\template\IFunctionTemplatePlugin::execute()
*/
public function execute($tagArgs, TemplateEngine $tplObj) {
if (!isset($tagArgs['name'])) {
$tagArgs['name'] = 'default';
}
-
+
if (!isset($this->counters[$tagArgs['name']])) {
$this->counters[$tagArgs['name']] = array(
'skip' => isset($tagArgs['skip']) ? $tagArgs['skip'] : 1,
'count' => isset($tagArgs['start']) ? $tagArgs['start'] : 1
);
}
-
+
$counter =& $this->counters[$tagArgs['name']];
-
+
if ($counter['assign'] !== null) {
$tplObj->assign($counter['assign'], $counter['count']);
}
-
+
$result = '';
if ($counter['print']) {
$result = $counter['count'];
if ($counter['direction'] == 'down') {
$counter['count'] -= $counter['skip'];
- }
+ }
else {
$counter['count'] += $counter['skip'];
}
-
+
return $result;
}
}
* The 'cycle' template function cycles through given values.
*
* Usage:
- * {cycle values="#eee,#fff"}
+ * {cycle values="#eee,#fff"}
*
- * @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Marcel Werk
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.template.plugin
- * @category Community Framework
+ * @category Community Framework
*/
class CycleFunctionTemplatePlugin implements IFunctionTemplatePlugin {
+ /**
+ * cycle data
+ * @var array
+ */
protected $cycles = array();
/**
use wcf\util\DateUtil;
/**
- * The 'date' modifier formats a unix timestamp.
- * Default date format contains year, month and day.
+ * The 'date' modifier formats a unix timestamp. The default date format contains
+ * year, month and day.
*
* Usage:
- * {$timestamp|date}
- * {"132845333"|date:"Y-m-d"}
+ * {$timestamp|date}
+ * {"132845333"|date:"Y-m-d"}
*
- * @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Marcel Werk
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.template.plugin
- * @category Community Framework
+ * @category Community Framework
*/
class DateModifierTemplatePlugin implements IModifierTemplatePlugin {
/**
- * @see wcf\system\template\IModifierTemplatePlugin::execute()
+ * @see wcf\system\template\IModifierTemplatePlugin::execute()
*/
public function execute($tagArgs, TemplateEngine $tplObj) {
return DateUtil::format(DateUtil::getDateTimeByTimestamp($tagArgs[0]), (!empty($tagArgs[2]) ? $tagArgs[2] : DateUtil::DATE_FORMAT));
* The 'datediff' modifier calculates the difference between two unix timestamps.
*
* Usage:
- * {$timestamp|datediff}
- * {"123456789"|datediff:$timestamp}
+ * {$timestamp|datediff}
+ * {"123456789"|datediff:$timestamp}
*
- * @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Marcel Werk
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.template.plugin
- * @category Community Framework
+ * @category Community Framework
*/
class DatediffModifierTemplatePlugin implements IModifierTemplatePlugin {
/**
* Escapes single quotes and new lines.
*
* Usage:
- * {$string|encodeJS}
- * {"bl''ah"|encodeJS}
- *
- * @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * {$string|encodeJS}
+ * {"bl''ah"|encodeJS}
+ *
+ * @author Marcel Werk
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.template.plugin
- * @category Community Framework
+ * @category Community Framework
*/
class EncodeJSModifierTemplatePlugin implements IModifierTemplatePlugin {
/**
- * @see wcf\system\template\IModifierTemplatePlugin::execute()
+ * @see wcf\system\template\IModifierTemplatePlugin::execute()
*/
public function execute($tagArgs, TemplateEngine $tplObj) {
return StringUtil::encodeJS($tagArgs[0]);
* The 'escapeCDATA' modifier escapes the closing CDATA-Tag.
*
* Usage:
- * {$string|escapeCDATA}
- * {"ABC]]>XYZ"|escapeCDATA}
- *
- * @author Tim Düsterhus
+ * {$string|escapeCDATA}
+ * {"ABC]]>XYZ"|escapeCDATA}
+ *
+ * @author Tim Düsterhus
* @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.template.plugin
- * @category Community Framework
+ * @category Community Framework
*/
class EscapeCDATAModifierTemplatePlugin implements IModifierTemplatePlugin {
/**
- * @see wcf\system\template\IModifierTemplatePlugin::execute()
+ * @see wcf\system\template\IModifierTemplatePlugin::execute()
*/
public function execute($tagArgs, TemplateEngine $tplObj) {
return StringUtil::escapeCDATA($tagArgs[0]);
* The 'event' prefilter inserts template listener's code before compilation.
*
* Usage:
- * {event name='foo'}
- *
- * @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * {event name='foo'}
+ *
+ * @author Alexander Ebert
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.template.plugin
- * @category Community Framework
+ * @category Community Framework
*/
class EventPrefilterTemplatePlugin implements IPrefilterTemplatePlugin {
/**
- * @see wcf\system\template\IPrefilterTemplatePlugin::execute()
+ * @see wcf\system\template\IPrefilterTemplatePlugin::execute()
*/
public function execute($templateName, $sourceContent, TemplateScriptingCompiler $compiler) {
$ldq = preg_quote($compiler->getLeftDelimiter(), '~');
* The 'fetch' compiler function fetches files from the local file system, http, or ftp and displays the content.
*
* Usage:
- * {fetch file='x.html'}
- * {fetch file='x.html' assign=var}
+ * {fetch file='x.html'}
+ * {fetch file='x.html' assign=var}
*
- * @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Marcel Werk
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.template.plugin
- * @category Community Framework
+ * @category Community Framework
*/
class FetchCompilerTemplatePlugin implements ICompilerTemplatePlugin {
/**
- * @see wcf\system\template\ICompilerTemplatePlugin::executeStart()
+ * @see wcf\system\template\ICompilerTemplatePlugin::executeStart()
*/
public function executeStart($tagArgs, TemplateScriptingCompiler $compiler) {
if (!isset($tagArgs['file'])) {
}
/**
- * @see wcf\system\template\ICompilerTemplatePlugin::executeEnd()
+ * @see wcf\system\template\ICompilerTemplatePlugin::executeEnd()
*/
public function executeEnd(TemplateScriptingCompiler $compiler) {
throw new SystemException($compiler->formatSyntaxError("unknown tag {/fetch}", $compiler->getCurrentIdentifier(), $compiler->getCurrentLineNo()));
* The 'filesize' modifier formats a filesize (binary) (given in bytes).
*
* Usage:
- * {$string|filesizeBinary}
- * {123456789|filesizeBinary}
+ * {$string|filesizeBinary}
+ * {123456789|filesizeBinary}
*
- * @author Marcel Werk
- * @copyright 2001-2009 WoltLab GmbH
+ * @author Marcel Werk
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.template.plugin
- * @category Community Framework
+ * @category Community Framework
*/
class FilesizeBinaryModifierTemplatePlugin implements IModifierTemplatePlugin {
/**
- * @see wcf\system\template\IModifierTemplatePlugin::execute()
+ * @see wcf\system\template\IModifierTemplatePlugin::execute()
*/
public function execute($tagArgs, TemplateEngine $tplObj) {
return FileUtil::formatFilesizeBinary($tagArgs[0]);
* The 'filesize' modifier formats a filesize (given in bytes).
*
* Usage:
- * {$string|filesize}
- * {123456789|filesize}
- *
- * @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * {$string|filesize}
+ * {123456789|filesize}
+ *
+ * @author Marcel Werk
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.template.plugin
- * @category Community Framework
+ * @category Community Framework
*/
class FilesizeModifierTemplatePlugin implements IModifierTemplatePlugin {
/**
- * @see wcf\system\template\IModifierTemplatePlugin::execute()
+ * @see wcf\system\template\IModifierTemplatePlugin::execute()
*/
public function execute($tagArgs, TemplateEngine $tplObj) {
return FileUtil::formatFilesize($tagArgs[0]);
use wcf\util\StringUtil;
/**
- * The 'hascontent' prefilter inserts ability to insert code dynamically upon the contents of 'content'.
+ * The 'hascontent' prefilter inserts ability to insert code dynamically upon the
+ * contents of 'content'.
*
* Usage:
- * {hascontent}
- * <ul>
- * {content}
- * {if $foo}<li>bar</li>{/if}
- * {/content}
- * </ul>
- * {hascontentelse}
- * <p>baz</p>
- * {/hascontent}
- *
- * @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * {hascontent}
+ * <ul>
+ * {content}
+ * {if $foo}<li>bar</li>{/if}
+ * {/content}
+ * </ul>
+ * {hascontentelse}
+ * <p>baz</p>
+ * {/hascontent}
+ *
+ * @author Alexander Ebert
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.template.plugin
- * @category Community Framework
+ * @category Community Framework
*/
class HascontentPrefilterTemplatePlugin implements IPrefilterTemplatePlugin {
/**
- * @see wcf\system\template\IPrefilterTemplatePlugin::execute()
+ * @see wcf\system\template\IPrefilterTemplatePlugin::execute()
*/
public function execute($templateName, $sourceContent, TemplateScriptingCompiler $compiler) {
$ldq = preg_quote($compiler->getLeftDelimiter(), '~');
* The 'htmlCheckboxes' template function generates a list of html checkboxes.
*
* Usage:
- * {htmlCheckboxes name="x" options=$array}
- * {htmlCheckboxes name="x" options=$array selected=$foo}
- * {htmlCheckboxes name="x" output=$outputArray}
- * {htmlCheckboxes name="x" output=$outputArray values=$valueArray}
- *
- * @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * {htmlCheckboxes name="x" options=$array}
+ * {htmlCheckboxes name="x" options=$array selected=$foo}
+ * {htmlCheckboxes name="x" output=$outputArray}
+ * {htmlCheckboxes name="x" output=$outputArray values=$valueArray}
+ *
+ * @author Marcel Werk
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.template.plugin
- * @category Community Framework
+ * @category Community Framework
*/
class HtmlCheckboxesFunctionTemplatePlugin implements IFunctionTemplatePlugin {
+ /**
+ * indicates if encoding is disabled
+ * @var boolean
+ */
protected $disableEncoding = false;
/**
- * @see wcf\system\template\IFunctionTemplatePlugin::execute()
+ * @see wcf\system\template\IFunctionTemplatePlugin::execute()
*/
public function execute($tagArgs, TemplateEngine $tplObj) {
// get options
$tagArgs['options'] = array_combine($tagArgs['output'], $tagArgs['output']);
}
}
-
+
if (!isset($tagArgs['options']) || !is_array($tagArgs['options'])) {
throw new SystemException("missing 'options' argument in htmlCheckboxes tag");
}
* The 'htmlOptions' template function generates the options of an html select list.
*
* Usage:
- * {htmlOptions options=$array}
- * {htmlOptions options=$array selected=$foo}
- * {htmlOptions options=$array name="x"}
- * {htmlOptions output=$outputArray}
- * {htmlOptions output=$outputArray values=$valueArray}
- * {htmlOptions object=$databaseObjectList}
- * {htmlOptions object=$databaseObjectList selected=$foo}
- *
- * @author Marcel Werk
+ * {htmlOptions options=$array}
+ * {htmlOptions options=$array selected=$foo}
+ * {htmlOptions options=$array name="x"}
+ * {htmlOptions output=$outputArray}
+ * {htmlOptions output=$outputArray values=$valueArray}
+ * {htmlOptions object=$databaseObjectList}
+ * {htmlOptions object=$databaseObjectList selected=$foo}
+ *
+ * @author Marcel Werk
* @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.template.plugin
- * @category Community Framework
+ * @category Community Framework
*/
class HtmlOptionsFunctionTemplatePlugin extends HtmlCheckboxesFunctionTemplatePlugin {
+ /**
+ * selected values
+ * @var array<string>
+ */
protected $selected = array();
/**
$tagArgs['options'] = array();
}
}
-
+
if (!isset($tagArgs['options']) || (!is_array($tagArgs['options']) && !($tagArgs['options'] instanceof DatabaseObjectList))) {
throw new SystemException("missing 'options' or 'object' argument in htmlOptions tag");
}
}
/**
- * Makes the html for an option group.
+ * Makes the HTML for an option group.
*
* @param string $key
* @param array $values
- * @return string html code of an option group
+ * @return string
*/
protected function makeOptionGroup($key, $values) {
$html = '';
}
/**
- * Makes the html for an option.
+ * Makes the HTML code for an option.
*
* @param string $key
* @param string $value
- * @return string html code of an option tag
+ * @return string
*/
protected function makeOption($key, $value) {
$value = $this->encodeHTML($value);
/**
* Block functions encloses a template block and operate on the contents of this block.
*
- * @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Marcel Werk
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.template.plugin
- * @category Community Framework
+ * @category Community Framework
*/
interface IBlockTemplatePlugin {
/**
* Executes this template block.
*
- * @param array $tagArgs
- * @param string $blockContent
- * @param wcf\system\template\TemplateEngine $tplObj
- * @return string output
+ * @param array $tagArgs
+ * @param string $blockContent
+ * @param wcf\system\template\TemplateEngine $tplObj
+ * @return string
*/
public function execute($tagArgs, $blockContent, TemplateEngine $tplObj);
/**
* Initialises this template block.
*
- * @param array $tagArgs
- * @param wcf\system\template\TemplateEngine $tplObj
+ * @param array $tagArgs
+ * @param wcf\system\template\TemplateEngine $tplObj
*/
public function init($tagArgs, TemplateEngine $tplObj);
/**
* This function is called before every execution of this block function.
*
- * @param wcf\system\template\TemplateEngine $tplObj
+ * @param wcf\system\template\TemplateEngine $tplObj
* @return boolean
*/
public function next(TemplateEngine $tplObj);
/**
* Compiler functions are called during the compilation of a template.
- *
- * @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ *
+ * @author Marcel Werk
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.template.plugin
- * @category Community Framework
+ * @category Community Framework
*/
interface ICompilerTemplatePlugin {
/**
* Executes the start tag of this compiler function.
*
- * @param array $tagArgs
+ * @param array $tagArgs
* @param wcf\system\template\TemplateScriptingCompiler $compiler
- * @return string php code
+ * @return string
*/
public function executeStart($tagArgs, TemplateScriptingCompiler $compiler);
* Executes the end tag of this compiler function.
*
* @param wcf\system\template\TemplateScriptingCompiler $compiler
- * @return string php code
+ * @return string
*/
public function executeEnd(TemplateScriptingCompiler $compiler);
}
/**
* Template functions are identical to template blocks, but they have no closing tag.
*
- * @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Marcel Werk
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.template.plugin
- * @category Community Framework
+ * @category Community Framework
*/
interface IFunctionTemplatePlugin {
/**
* Executes this template function.
*
- * @param array $tagArgs
- * @param wcf\system\template\TemplateEngine $tplObj
- * @return string output
+ * @param array $tagArgs
+ * @param wcf\system\template\TemplateEngine $tplObj
+ * @return string
*/
public function execute($tagArgs, TemplateEngine $tplObj);
}
* Modifiers are functions that are applied to a variable in the template
* before it is displayed or used in some other context.
*
- * @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Marcel Werk
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.template
- * @category Community Framework
+ * @category Community Framework
*/
interface IModifierTemplatePlugin {
/**
* Executes this modifier.
*
- * @param array $tagArgs
- * @param wcf\system\template\TemplateEngine $tplObj
- * @return string output
+ * @param array $tagArgs
+ * @param wcf\system\template\TemplateEngine $tplObj
+ * @return string
*/
public function execute($tagArgs, TemplateEngine $tplObj);
}
/**
* Prefilters are used to process the source of the template immediately before compilation.
*
- * @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Marcel Werk
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.template
- * @category Community Framework
+ * @category Community Framework
*/
interface IPrefilterTemplatePlugin {
/**
* Executes this prefilter.
*
- * @param string $templateName
- * @param string $sourceContent
+ * @param string $templateName
+ * @param string $sourceContent
* @param wcf\system\template\TemplateScriptingCompiler $compiler
- * @return string
+ * @return string
*/
public function execute($templateName, $sourceContent, TemplateScriptingCompiler $compiler);
}
/**
* The 'icon' compiler function compiles dynamic icon paths.
- *
+ *
* Usage:
- * {icon size='L'}{$foo}{/icon}
- *
+ * {icon size='L'}{$foo}{/icon}
+ *
* @author Marcel Werk
* @copyright 2001-2011 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.template.plugin
- * @category Community Framework
+ * @category Community Framework
*/
class IconCompilerTemplatePlugin implements ICompilerTemplatePlugin {
/**
* icon size
- * @var string
+ * @var string
*/
protected $size = '';
/**
* valid icon sizes
- * @var array<string>
+ * @var array<string>
*/
protected static $validSizes = array('S', 'M', 'L');
/**
- * @see wcf\system\template\ICompilerTemplatePlugin::executeStart()
+ * @see wcf\system\template\ICompilerTemplatePlugin::executeStart()
*/
public function executeStart($tagArgs, TemplateScriptingCompiler $compiler) {
// set default size
if (strlen($tagArgs['size']) > 1) $tagArgs['size'] = substr($tagArgs['size'], 1, 1);
if (in_array($tagArgs['size'], self::$validSizes)) $this->size = $tagArgs['size'];
}
-
+
$compiler->pushTag('icon');
return "<?php ob_start(); ?>";
}
/**
- * @see wcf\system\template\ICompilerTemplatePlugin::executeEnd()
+ * @see wcf\system\template\ICompilerTemplatePlugin::executeEnd()
*/
public function executeEnd(TemplateScriptingCompiler $compiler) {
$compiler->popTag('icon');
* The 'icon' prefilter compiles static icon paths.
*
* Usage:
- * {icon size='L'}iconS.png{/icon}
- *
+ * {icon size='L'}iconName{/icon}
+ *
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.template.plugin
- * @category Community Framework
+ * @category Community Framework
*/
class IconPrefilterTemplatePlugin implements IPrefilterTemplatePlugin {
/**
- * @see wcf\system\template\ITemplatePluginPrefilter::execute()
+ * @see wcf\system\template\ITemplatePluginPrefilter::execute()
*/
public function execute($templateName, $sourceContent, TemplateScriptingCompiler $compiler) {
$ldq = preg_quote($compiler->getLeftDelimiter(), '~');
* The 'implode' compiler function joins array elements with a string.
*
* Usage:
- * {implode from=$array key=bar item=foo glue=";"}{$foo}{/implode}
- *
- * @author Marcel Werk
+ * {implode from=$array key=bar item=foo glue=";"}{$foo}{/implode}
+ *
+ * @author Marcel Werk
* @copyright 2001-2011 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.template.plugin
- * @category Community Framework
+ * @category Community Framework
*/
class ImplodeCompilerTemplatePlugin implements ICompilerTemplatePlugin {
+ /**
+ * local tag stack
+ * @var array<string>
+ */
protected $tagStack = array();
/**
- * @see wcf\system\template\ICompilerTemplatePlugin::executeStart()
+ * @see wcf\system\template\ICompilerTemplatePlugin::executeStart()
*/
public function executeStart($tagArgs, TemplateScriptingCompiler $compiler) {
$compiler->pushTag('implode');
}
/**
- * @see wcf\system\template\ICompilerTemplatePlugin::executeEnd()
+ * @see wcf\system\template\ICompilerTemplatePlugin::executeEnd()
*/
public function executeEnd(TemplateScriptingCompiler $compiler) {
$compiler->popTag('implode');
* The 'lang' compiler function compiles dynamic language variables.
*
* Usage:
- * {lang}$blah{/lang}
- * {lang var=$x}foo{/lang}
- *
- * @author Marcel Werk
- * @copyright 2001-2009 WoltLab GmbH
+ * {lang}$blah{/lang}
+ * {lang var=$x}foo{/lang}
+ *
+ * @author Marcel Werk
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.template.plugin
- * @category Community Framework
+ * @category Community Framework
*/
class LangCompilerTemplatePlugin implements ICompilerTemplatePlugin {
/**
- * @see wcf\system\template\ICompilerTemplatePlugin::executeStart()
+ * @see wcf\system\template\ICompilerTemplatePlugin::executeStart()
*/
public function executeStart($tagArgs, TemplateScriptingCompiler $compiler) {
$compiler->pushTag('lang');
}
/**
- * @see wcf\system\template\ICompilerTemplatePlugin::executeEnd()
+ * @see wcf\system\template\ICompilerTemplatePlugin::executeEnd()
*/
public function executeEnd(TemplateScriptingCompiler $compiler) {
$compiler->popTag('lang');
* It is recommended to use static language variables.
*
* Usage:
- * {lang}foo{/lang}
- * {lang}lang.foo.bar{/lang}
- *
- * @author Marcel Werk
+ * {lang}wcf.foo{/lang}
+ * {lang}app.foo.bar{/lang}
+ *
+ * @author Marcel Werk
* @copyright 2001-2011 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.template.plugin
- * @category Community Framework
+ * @category Community Framework
*/
class LangPrefilterTemplatePlugin implements IPrefilterTemplatePlugin {
/**
- * @see wcf\system\template\IPrefilterTemplatePlugin::execute()
+ * @see wcf\system\template\IPrefilterTemplatePlugin::execute()
*/
public function execute($templateName, $sourceContent, TemplateScriptingCompiler $compiler) {
$ldq = preg_quote($compiler->getLeftDelimiter(), '~');
* The 'language' modifier returns dynamic language variables.
*
* Usage:
- * {$string|language}
+ * {$string|language}
*
- * @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Marcel Werk
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.template.plugin
- * @category Community Framework
+ * @category Community Framework
*/
class LanguageModifierTemplatePlugin implements IModifierTemplatePlugin {
/**
- * @see wcf\system\template\IModifierTemplatePlugin::execute()
+ * @see wcf\system\template\IModifierTemplatePlugin::execute()
*/
public function execute($tagArgs, TemplateEngine $tplObj) {
return WCF::getLanguage()->getDynamicVariable($tagArgs[0]);
* Shortcut for usage of LinkHandler::getInstance()->getLink() in template scripting.
*
* Usage:
- * {link application='wcf'}index.php{/link}
+ * {link application='wcf'}index.php{/link}
*
- * @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Marcel Werk
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.template.plugin
- * @category Community Framework
+ * @category Community Framework
*/
class LinkBlockTemplatePlugin implements IBlockTemplatePlugin {
/**
* internal loop counter
- * @var integer
+ * @var integer
*/
protected $counter = 0;
/**
- * @see wcf\system\template\IBlockTemplatePlugin::execute()
+ * @see wcf\system\template\IBlockTemplatePlugin::execute()
*/
public function execute($tagArgs, $blockContent, TemplateEngine $tplObj) {
if (!isset($tagArgs['controller'])) throw new SystemException("missing 'controller' argument in link tag");
}
/**
- * @see wcf\system\template\IBlockTemplatePlugin::init()
+ * @see wcf\system\template\IBlockTemplatePlugin::init()
*/
public function init($tagArgs, TemplateEngine $tplObj) {
$this->counter = 0;
}
/**
- * @see wcf\system\template\IBlockTemplatePlugin::next()
+ * @see wcf\system\template\IBlockTemplatePlugin::next()
*/
public function next(TemplateEngine $tplObj) {
if ($this->counter == 0) {
* The 'pages' template function is used to generate sliding pagers.
*
* Usage:
- * {pages pages=10 link='page-%d.html'}
- * {pages page=8 pages=10 link='page-%d.html'}
+ * {pages pages=10 link='page-%d.html'}
+ * {pages page=8 pages=10 link='page-%d.html'}
+ *
+ * assign to variable 'output'; do not print:
+ * {pages page=8 pages=10 link='page-%d.html' assign='output'}
+ *
+ * assign to variable 'output' and do print also:
+ * {pages page=8 pages=10 link='page-%d.html' assign='output' print=true}
*
- * assign to variable 'output'; do not print:
- * {pages page=8 pages=10 link='page-%d.html' assign='output'}
- *
- * assign to variable 'output' and do print also:
- * {pages page=8 pages=10 link='page-%d.html' assign='output' print=true}
- *
- * @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Marcel Werk
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.template.plugin
- * @category Community Framework
+ * @category Community Framework
*/
class PagesFunctionTemplatePlugin implements IFunctionTemplatePlugin {
const SHOW_LINKS = 11;
/**
* Inserts the page number into the link.
*
- * @param string $link
- * @param integer $pageNo
+ * @param string $link
+ * @param integer $pageNo
* @return string final link
*/
protected static function insertPageNumber($link, $pageNo) {
}
/**
- * Generates html code of a link.
+ * Generates HTML code for a link.
*
- * @param string $link
- * @param integer $pageNo
- * @param integer $activePage
+ * @param string $link
+ * @param integer $pageNo
+ * @param integer $activePage
* @return string
*/
protected function makeLink($link, $pageNo, $activePage, $break = false) {
}
}
+ /**
+ * Generates HTML code for 'previous' link.
+ *
+ * @param type $link
+ * @param type $pageNo
+ * @return string
+ */
protected function makePreviousLink($link, $pageNo) {
if ($pageNo > 1) {
return '<li class="button skip"><a href="'.$this->insertPageNumber($link, $pageNo - 1).'" title="'.WCF::getLanguage()->getDynamicVariable('wcf.global.page.previous').'" class="jsTooltip"><img src="'.self::getIconPath('circleArrowLeft').'" alt="" class="icon16" /></a></li>'."\n";
}
}
+ /**
+ * Generates HTML code for 'next' link.
+ *
+ * @param type $link
+ * @param type $pageNo
+ * @return string
+ */
protected function makeNextLink($link, $pageNo, $pages) {
if ($pageNo && $pageNo < $pages) {
return '<li class="button skip"><a href="'.$this->insertPageNumber($link, $pageNo + 1).'" title="'.WCF::getLanguage()->getDynamicVariable('wcf.global.page.next').'" class="jsTooltip"><img src="'.self::getIconPath('circleArrowRight').'" alt="" class="icon16" /></a></li>'."\n";
}
/**
- * @see wcf\system\template\IFunctionTemplatePlugin::execute()
+ * @see wcf\system\template\IFunctionTemplatePlugin::execute()
*/
public function execute($tagArgs, TemplateEngine $tplObj) {
// needed params: controller, link, page, pages
return $html;
}
+ /**
+ * Returns the icon path for the icon with the given name.
+ *
+ * @param string $iconName
+ * @return string
+ */
private static function getIconPath($iconName) {
+ // todo:
+ // 1. use RequestHandler to determine if in ACP
+ // 2. replace RELATIVE_WCF_DIR
if (class_exists('wcf\system\WCFACP', false)) {
return RELATIVE_WCF_DIR.'icon/'.$iconName.'.svg';
}
* Default date format contains year, month, day, hour and minute.
*
* Usage:
- * {$timestamp|plainTime}
- * {"132845333"|plainTime}
- *
- * @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * {$timestamp|plainTime}
+ * {"132845333"|plainTime}
+ *
+ * @author Marcel Werk
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.template.plugin
- * @category Community Framework
+ * @category Community Framework
*/
class PlainTimeModifierTemplatePlugin implements IModifierTemplatePlugin {
/**
- * @see wcf\system\template\IModifierTemplatePlugin::execute()
+ * @see wcf\system\template\IModifierTemplatePlugin::execute()
*/
public function execute($tagArgs, TemplateEngine $tplObj) {
$dateTime = DateUtil::getDateTimeByTimestamp($tagArgs[0]);
* The 'prepend' compiler function calls the prepend function on the template object.
*
* Usage:
- * {prepend var=name value="foo"}
- *
- * @author Marcel Werk
+ * {prepend var=name value="foo"}
+ *
+ * @author Marcel Werk
* @copyright 2001-2011 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.template.plugin
- * @category Community Framework
+ * @category Community Framework
*/
class PrependCompilerTemplatePlugin implements ICompilerTemplatePlugin {
/**
- * @see wcf\system\template\ICompilerTemplatePlugin::executeStart()
+ * @see wcf\system\template\ICompilerTemplatePlugin::executeStart()
*/
public function executeStart($tagArgs, TemplateScriptingCompiler $compiler) {
if (!isset($tagArgs['var'])) {
if (!isset($tagArgs['value'])) {
throw new SystemException($compiler->formatSyntaxError("missing 'value' argument in prepend tag", $compiler->getCurrentIdentifier(), $compiler->getCurrentLineNo()));
}
-
+
return "<?php \$this->prepend(".$tagArgs['var'].", ".$tagArgs['value']."); ?>";
}
/**
- * @see wcf\system\template\ICompilerTemplatePlugin::executeEnd()
+ * @see wcf\system\template\ICompilerTemplatePlugin::executeEnd()
*/
public function executeEnd(TemplateScriptingCompiler $compiler) {
throw new SystemException($compiler->formatSyntaxError("unknown tag {/prepend}", $compiler->getCurrentIdentifier(), $compiler->getCurrentLineNo()));
* The 'smallpages' template function is used to generate simple sliding pagers.
*
* Usage:
- * {smallpages pages=10 link='page-%d.html'}
+ * {smallpages pages=10 link='page-%d.html'}
+ *
+ * assign to variable 'output'; do not print:
+ * {smallpages pages=10 link='page-%d.html' assign='output'}
+ *
+ * assign to variable 'output' and do print also:
+ * {smallpages pages=10 link='page-%d.html' assign='output' print=true}
*
- * assign to variable 'output'; do not print:
- * {smallpages pages=10 link='page-%d.html' assign='output'}
- *
- * assign to variable 'output' and do print also:
- * {smallpages pages=10 link='page-%d.html' assign='output' print=true}
- *
- * @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Marcel Werk
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.template.plugin
- * @category Community Framework
+ * @category Community Framework
*/
class SmallpagesFunctionTemplatePlugin extends PagesFunctionTemplatePlugin {
/**
- * @see wcf\system\template\plugin\PagesFunctionTemplatePlugin::SHOW_LINKS
+ * @see wcf\system\template\plugin\PagesFunctionTemplatePlugin::SHOW_LINKS
*/
const SHOW_LINKS = 7;
/**
- * @see wcf\system\template\plugin\PagesFunctionTemplatePlugin::makePreviousLink()
+ * @see wcf\system\template\plugin\PagesFunctionTemplatePlugin::makePreviousLink()
*/
protected function makePreviousLink($link, $pageNo) {
return '';
}
/**
- * @see wcf\system\template\plugin\PagesFunctionTemplatePlugin::makeNextLink()
+ * @see wcf\system\template\plugin\PagesFunctionTemplatePlugin::makeNextLink()
*/
protected function makeNextLink($link, $pageNo, $pages) {
return '';
}
/**
- * @see wcf\system\template\IFunctionTemplatePlugin::execute()
+ * @see wcf\system\template\IFunctionTemplatePlugin::execute()
*/
public function execute($tagArgs, TemplateEngine $tplObj) {
$tagArgs['page'] = 0;
* The 'staticlang' compiler function gets the source of a language variables.
*
* Usage:
- * {staticlang}$blah{/staticlang}
- *
- * @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * {staticlang}$blah{/staticlang}
+ *
+ * @author Marcel Werk
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.template.plugin
- * @category Community Framework
+ * @category Community Framework
*/
class StaticlangCompilerTemplatePlugin implements ICompilerTemplatePlugin {
/**
* Default date format contains year, month, day, hour and minute.
*
* Usage:
- * {$timestamp|time}
- * {"132845333"|time}
- *
- * @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * {$timestamp|time}
+ * {"132845333"|time}
+ *
+ * @author Marcel Werk
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.template.plugin
- * @category Community Framework
+ * @category Community Framework
*/
class TimeModifierTemplatePlugin implements IModifierTemplatePlugin {
/**
- * @see wcf\system\template\IModifierTemplatePlugin::execute()
+ * @see wcf\system\template\IModifierTemplatePlugin::execute()
*/
public function execute($tagArgs, TemplateEngine $tplObj) {
$timestamp = intval($tagArgs[0]);
* The 'truncate' modifier truncates a string.
*
* Usage:
- * {$foo|truncate:35:' and more'}
- *
- * @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * {$foo|truncate:35:' and more'}
+ *
+ * @author Marcel Werk
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.template.plugin
- * @category Community Framework
+ * @category Community Framework
*/
class TruncateModifierTemplatePlugin implements IModifierTemplatePlugin {
/**
- * @see wcf\system\template\IModifierTemplatePlugin::execute()
+ * @see wcf\system\template\IModifierTemplatePlugin::execute()
*/
public function execute($tagArgs, TemplateEngine $tplObj) {
// default values
/**
* Provides a default implementation for validation strategies.
- *
+ *
* @author Marcel Werk
* @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.upload
- * @category Community Framework
+ * @category Community Framework
*/
class DefaultUploadFileValidationStrategy implements IUploadFileValidationStrategy {
/**
* allowed max size
- * @var integer
+ * @var integer
*/
protected $maxFilesize = 0;
/**
* allowed file extensions
- * @var array<string>
+ * @var array<string>
*/
protected $fileExtensions = array();
}
/**
- * @see wcf\system\upload\IUploadFileValidationStrategy::validate()
+ * @see wcf\system\upload\IUploadFileValidationStrategy::validate()
*/
public function validate(UploadFile $uploadFile) {
if ($uploadFile->getErrorCode() != 0) {
/**
* Interface for file upload save strategies.
- *
+ *
* @author Marcel Werk
* @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.upload
- * @category Community Framework
+ * @category Community Framework
*/
interface IUploadFileSaveStrategy {
/**
/**
* Interface for file upload validation strategies.
- *
+ *
* @author Marcel Werk
* @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.upload
- * @category Community Framework
+ * @category Community Framework
*/
interface IUploadFileValidationStrategy {
/**
- * Validates the given file. Returns true on success, otherwise false.
+ * Validates the given file and returns true on success, otherwise false.
*
* @param wcf\system\upload\UploadFile $uploadFile
- * @return boolean
+ * @return boolean
*/
public function validate(UploadFile $uploadFile);
}
/**
* Represents a file upload.
- *
+ *
* @author Marcel Werk
* @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.upload
- * @category Community Framework
+ * @category Community Framework
*/
class UploadFile {
/**
* original file name
- * @var string
+ * @var string
*/
protected $filename = '';
/**
* location of the uploaded file
- * @var string
+ * @var string
*/
protected $location = '';
/**
* file size
- * @var integer
+ * @var integer
*/
protected $filesize = 0;
/**
* file upload error code
- * @var integer
+ * @var integer
*/
protected $errorCode = 0;
/**
* MIME type
- * @var string
+ * @var string
*/
protected $mimeType = '';
/**
* validation error type
- * @var string
+ * @var string
*/
protected $validationErrorType = '';
*
* @param string $filename
* @param string $location
- * @param integer $filesize
+ * @param integer $filesize
* @param integer $errorCode
* @param string $mimeType
*/
/**
* Returns the original file name.
*
- * @return string
+ * @return string
*/
public function getFilename() {
return $this->filename;
/**
* Returns the extension of the original file name.
*
- * @return string
+ * @return string
*/
public function getFileExtension() {
if (($position = StringUtil::lastIndexOf($this->getFilename(), '.')) !== false) {
/**
* Returns the file location.
*
- * @return string
+ * @return string
*/
public function getLocation() {
return $this->location;
/**
* Returns the file size.
*
- * @return integer
+ * @return integer
*/
public function getFilesize() {
return $this->filesize;
/**
* Returns the MIME type.
*
- * @return string
+ * @return string
*/
public function getMimeType() {
return $this->mimeType;
/**
* Returns the error code.
*
- * @return integer
+ * @return integer
*/
public function getErrorCode() {
return $this->errorCode;
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.upload
- * @category Community Framework
+ * @category Community Framework
*/
class UploadHandler {
/**
* list of uploaded files
- * @var array<wcf\system\upload\UploadFile>
+ * @var array<wcf\system\upload\UploadFile>
*/
protected $files = array();
/**
* list of validation errors.
- * @var array
+ * @var array
*/
protected $erroneousFiles = array();
/**
* Returns the list of uploaded files.
*
- * @return array<wcf\system\upload\UploadFile>
+ * @return array<wcf\system\upload\UploadFile>
*/
public function getFiles() {
return $this->files;
/**
* Returns a list of erroneous files.
*
- * @return array<wcf\system\upload\UploadFile>
+ * @return array<wcf\system\upload\UploadFile>
*/
public function getErroneousFiles() {
return $this->erroneousFiles;
* Provides an abstract implementation of the user authentication.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.user.authentication
- * @category Community Framework
+ * @category Community Framework
*/
abstract class AbstractUserAuthentication extends SingletonFactory implements IUserAuthentication {}
* Default implementation of the user authentication.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.user.authentication
- * @category Community Framework
+ * @category Community Framework
*/
class DefaultUserAuthentication extends AbstractUserAuthentication {
/**
- * @see wcf\system\user\authentication\IUserAuthentication::supportsPersistentLogins()
+ * @see wcf\system\user\authentication\IUserAuthentication::supportsPersistentLogins()
*/
public function supportsPersistentLogins() {
return true;
}
/**
- * @see wcf\system\user\authentication\IUserAuthentication::storeAccessData()
+ * @see wcf\system\user\authentication\IUserAuthentication::storeAccessData()
*/
public function storeAccessData(User $user, $username, $password) {
HeaderUtil::setCookie('userID', $user->userID, TIME_NOW + 365 * 24 * 3600);
}
/**
- * @see wcf\system\user\authentication\IUserAuthentication::loginManually()
+ * @see wcf\system\user\authentication\IUserAuthentication::loginManually()
*/
public function loginManually($username, $password, $userClassname = 'wcf\data\user\User') {
$user = $this->getUserByLogin($username);
if ($userSession->userID == 0) {
throw new UserInputException('username', 'notFound');
}
-
+
// check password
if (!$userSession->checkPassword($password)) {
throw new UserInputException('password', 'false');
}
/**
- * @see wcf\system\user\authentication\IUserAuthentication::loginAutomatically()
+ * @see wcf\system\user\authentication\IUserAuthentication::loginAutomatically()
*/
public function loginAutomatically($persistent = false, $userClassname = 'wcf\data\user\User') {
if (!$persistent) return null;
* Returns a user object by given login name.
*
* @param string $login
- * @return wcf\data\user\User
+ * @return wcf\data\user\User
*/
protected function getUserByLogin($login) {
return User::getUserByUsername($login);
* @param integer $userID
* @param string $password
* @param string $userClassname
- * @return wcf\data\user\User
+ * @return wcf\data\user\User
*/
protected function getUserAutomatically($userID, $password, $userClassname = 'wcf\data\user\User') {
$user = new $userClassname($userID);
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.user.authentication
- * @category Community Framework
+ * @category Community Framework
*/
class EmailUserAuthentication extends DefaultUserAuthentication {
/**
- * @see wcf\system\user\authentication\DefaultUserAuthentication::getUserByLogin()
+ * @see wcf\system\user\authentication\DefaultUserAuthentication::getUserByLogin()
*/
protected function getUserByLogin($login) {
return User::getUserByEmail($login);
* All user authentication types should implement this interface.
*
* @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.user.authentication
- * @category Community Framework
+ * @category Community Framework
*/
interface IUserAuthentication {
/**
* Stores the user access data for a persistent login.
*
* @param wcf\data\user\User $user
- * @param string $username
+ * @param string $username
* @param string $password
*/
public function storeAccessData(User $user, $username, $password);
/**
* Does a manual user login.
*
- * @param string $username
+ * @param string $username
* @param string $password
* @param string $userClassname class name of user class
* @return wcf\data\user\User
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.user.authentication
- * @category Community Framework
+ * @category Community Framework
*/
class UserAuthenticationFactory {
/**
* user authentication instance
- * @var wcf\system\user\authentication\IUserAuthentication
+ * @var wcf\system\user\authentication\IUserAuthentication
*/
protected static $userAuthentication = null;
/**
* Returns user authentication instance.
*
- * @return wcf\system\user\authentication\IUserAuthentication
+ * @return wcf\system\user\authentication\IUserAuthentication
*/
public static function getUserAuthentication() {
if (static::$userAuthentication === null) {
/**
* Provides basic methods to toggle container content.
*
- * @author Alexander Ebert
+ * @author Alexander Ebert
* @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.user.collapsible.content
- * @category Community Framework
+ * @category Community Framework
*/
interface ICollapsibleContentAction {
/**
* Provides methods for handling collapsible containers.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.user.collapsible.content
- * @category Community Framework
+ * @category Community Framework
*/
class UserCollapsibleContentHandler extends SingletonFactory {
/**
if (WCF::getUser()->userID) {
// get data from storage
UserStorageHandler::getInstance()->loadStorage(array(WCF::getUser()->userID));
-
+
// get ids
$data = UserStorageHandler::getInstance()->getStorage(array(WCF::getUser()->userID), 'collapsedContent-'.$objectTypeID);
-
+
// cache does not exist or is outdated
if ($data[WCF::getUser()->userID] === null) {
$sql = "SELECT objectID
* Handles the persistent user data storage.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.storage
- * @category Community Framework
+ * @category Community Framework
*/
class UserStorageHandler extends SingletonFactory {
/**
*
* @param string $field
* @param integer $packageID
- */
+ */
public function resetAll($field, $packageID = PACKAGE_ID) {
$sql = "DELETE FROM wcf".WCF_N."_user_storage
WHERE field = ?
* Basic implementation for workers.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.worker
- * @category Community Framework
+ * @category Community Framework
*/
abstract class AbstractWorker implements IWorker {
/**
* Basic interface for workers.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.worker
- * @category Community Framework
+ * @category Community Framework
*/
interface IWorker {
/**
* Worker implementation for sending mails.
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.worker
- * @category Community Framework
+ * @category Community Framework
*/
class MailWorker extends AbstractWorker {
/**
/**
* Contains Array-related functions.
- *
- * @author Marcel Werk
- * @copyright 2001-2009 WoltLab GmbH
+ *
+ * @author Marcel Werk
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage util
- * @category Community Framework
+ * @category Community Framework
*/
final class ArrayUtil {
/**
- * Applies StringUtil::trim() to all elements of an array.
- *
- * @param array $array
- * @param boolean $removeEmptyElements
- * @return array $array
+ * Applies StringUtil::trim() to all elements of the given array.
+ *
+ * @param array $array
+ * @param boolean $removeEmptyElements
+ * @return array
*/
public static function trim($array, $removeEmptyElements = true) {
if (!is_array($array)) {
}
/**
- * Applies intval() to all elements of an array.
- *
- * @param array $array
- * @return array $array
+ * Applies intval() to all elements of the given array.
+ *
+ * @param array $array
+ * @return array
*/
public static function toIntegerArray($array) {
if (!is_array($array)) {
}
/**
- * Converts html special characters in arrays.
- *
- * @param array $array
- * @return array $array
+ * Converts html special characters in the given array.
+ *
+ * @param array $array
+ * @return array
*/
public static function encodeHTML($array) {
if (!is_array($array)) {
}
/**
- * Applies stripslashes on all elements of an array.
- *
- * @param array $array
- * @return array $array
+ * Applies stripslashes on all elements of the given array.
+ *
+ * @param array $array
+ * @return array
*/
public static function stripslashes($array) {
if (!is_array($array)) {
/**
* Appends a suffix to all elements of the given array.
- *
- * @param array $array
- * @param string $suffix
- * @return array
+ *
+ * @param array $array
+ * @param string $suffix
+ * @return array
*/
public static function appendSuffix($array, $suffix) {
foreach ($array as $key => $value) {
* Alias to php array_intersect_key() function.
*
* @deprecated as of WCF 2.0, use PHP's array_intersect_key() function directly
- *
- * @param array $array1 The array with master keys to check.
- * @param array $array2 An array to compare keys against.
- * @return Returns an associative array containing all the values of array1 which have matching keys that are present in all arguments.
+ * @see array_intersect_key()
+ *
+ * @param array $array1
+ * @param array $array2
+ * @return array
*/
public static function intersectKeys($array1, $array2) {
$parameters = func_get_args();
/**
* Converts dos to unix newlines.
- *
- * @param array $array
- * @return array $array
+ *
+ * @param array $array
+ * @return array
*/
public static function unifyNewlines($array) {
if (!is_array($array)) {
* Converts a array of strings to requested character encoding.
* @see mb_convert_encoding()
*
- * @param string $inCharset
- * @param string $outCharset
- * @param string $array
- * @return string $array
+ * @param string $inCharset
+ * @param string $outCharset
+ * @param array $array
+ * @return string
*/
public static function convertEncoding($inCharset, $outCharset, $array) {
if (!is_array($array)) {
/**
* Provides methods for class interactions.
- *
- * @author Tim Düsterhus, Alexander Ebert
+ *
+ * @author Tim Düsterhus, Alexander Ebert
* @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage util
- * @category Community Framework
+ * @category Community Framework
*/
final class ClassUtil {
/**
* Checks whether the given objects are equal.
* Objects are considered equal, when they are instances of the same class and all attributes are equal.
- *
+ *
* @param object $a
* @param object $b
* @return boolean
/**
* Checks wether given class extends or implements the target class or interface.
* You SHOULD NOT call this method if 'instanceof' satisfies your request!
- *
+ *
* @param string $className
* @param string $targetClass
* @return boolean
* does not support using nicknames (prefixed by the '@' character).
*
* @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage util
- * @category Community Framework
+ * @category Community Framework
*/
final class CronjobUtil {
/**
// check if startMinute is a valid minute or a list of valid minutes.
case 'startMinute':
$pattern = '[ ]*(\b[0-5]?[0-9]\b)[ ]*';
- break;
-
+ break;
+
// check if startHour is a valid hour or a list of valid hours.
case 'startHour':
$pattern = '[ ]*(\b[01]?[0-9]\b|\b2[0-3]\b)[ ]*';
- break;
-
+ break;
+
// check if startDom is a valid day of month or a list of valid days of month.
case 'startDom':
$pattern = '[ ]*(\b[01]?[1-9]\b|\b2[0-9]\b|\b3[01]\b)[ ]*';
- break;
-
+ break;
+
// check if startMonth is a valid month or a list of valid months.
case 'startMonth':
$digits = '[ ]*(\b[0-1]?[0-9]\b)[ ]*';
$namesArr = explode('|', $months);
$pattern = '('.$digits.')|([ ]*('.$months.')[ ]*)';
- break;
-
+ break;
+
// check if startDow is a valid day of week or a list of valid days of week.
case 'startDow':
$digits = '[ ]*(\b[0]?[0-7]\b)[ ]*';
$namesArr = explode('|', $days);
$pattern = '('.$digits.')|([ ]*('.$days.')[ ]*)';
- break;
+ break;
}
// perform the actual regex pattern matching.
/**
* Contains date-related functions.
- *
- * @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ *
+ * @author Marcel Werk
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage util
- * @category Community Framework
+ * @category Community Framework
*/
final class DateUtil {
/**
* name of the default date format language variable
- * @var string
+ * @var string
*/
const DATE_FORMAT = 'wcf.date.dateFormat';
/**
* name of the default time format language variable
- * @var string
+ * @var string
*/
const TIME_FORMAT = 'wcf.date.timeFormat';
/**
* list of available time zones
- * @var array<string>
+ * @var array<string>
*/
protected static $availableTimezones = array(
'Pacific/Kwajalein', // (GMT-12:00) International Date Line West
* @param string $format
* @param wcf\data\language\Language $language
* @param wcf\data\user\User $user
+ * @return string
*/
public static function format(\DateTime $time = null, $format = null, Language $language = null, User $user = null) {
// get default values
*
* @param string $date
* @param string $format
- * @param wcf\data\language\Language $language
+ * @param wcf\data\language\Language $language
+ * @return string
*/
public static function localizeDate($date, $format, Language $language) {
if ($language->languageCode != 'en') {
*/
final class DirectoryUtil {
/**
- * @var \DirectoryIterator
+ * @var \DirectoryIterator
*/
protected $obj = null;
/**
* all files with full path
- *
- * @var array<string>
+ * @var array<string>
*/
protected $files = array();
/**
* all files with filename as key and DirectoryIterator object as value
- *
- * @var array<\DirectoryIterator>
+ * @var array<\DirectoryIterator>
*/
protected $fileObjects = array();
/**
* directory size in bytes
- *
* @var integer
*/
protected $size = 0;
/**
* directory path
- *
* @var string
*/
protected $directory = '';
/**
* determines whether scan should be recursive
- *
* @var boolean
*/
protected $recursive = true;
/**
* indicates that files won't be sorted
- *
* @var integer
*/
const SORT_NONE = -1;
/**
* all recursive and non-recursive instances of DirectoryUtil
- *
* @var array<array>
*/
protected static $instances = array(
/**
* Contains file-related functions.
- *
- * @author Marcel Werk
- * @copyright 2001-2009 WoltLab GmbH
+ *
+ * @author Marcel Werk
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage util
- * @category Community Framework
+ * @category Community Framework
*/
final class FileUtil {
/**
* finfo instance
- * @var \finfo
+ * @var \finfo
*/
protected static $finfo = null;
/**
* Generates a new temporary filename in TMP_DIR.
- *
- * @param string $prefix
- * @param string $extension
- * @param string $dir
- * @return string temporary filename
+ *
+ * @param string $prefix
+ * @param string $extension
+ * @param string $dir
+ * @return string
*/
public static function getTemporaryFilename($prefix = 'tmpFile_', $extension = '', $dir = TMP_DIR) {
$dir = self::addTrailingSlash($dir);
}
/**
- * Removes a leading slash.
+ * Removes a leading slash from the given path.
*
- * @param string $path
- * @return string $path
+ * @param string $path
+ * @return string
*/
public static function removeLeadingSlash($path) {
return ltrim($path, '/');
}
-
+
/**
- * Removes a trailing slash.
- *
- * @param string $path
- * @return string $path
+ * Removes a trailing slash from the given path.
+ *
+ * @param string $path
+ * @return string
*/
public static function removeTrailingSlash($path) {
return rtrim($path, '/');
}
/**
- * Adds a trailing slash.
- *
- * @param string $path
- * @return string $path
+ * Adds a trailing slash to the given path.
+ *
+ * @param string $path
+ * @return string
*/
public static function addTrailingSlash($path) {
return rtrim($path, '/').'/';
}
/**
- * Adds a leading slash.
+ * Adds a leading slash to the given path.
*
* @param string $path
- * @return string $path
+ * @return string
*/
public static function addLeadingSlash($path) {
return '/'.ltrim($path, '/');
}
-
+
/**
- * Builds a relative path from two absolute paths.
- *
- * @param string $currentDir
- * @param string $targetDir
- * @return string relative Path
+ * Returns the relative path from the given absolute paths.
+ *
+ * @param string $currentDir
+ * @param string $targetDir
+ * @return string
*/
public static function getRelativePath($currentDir, $targetDir) {
// remove trailing slashes
}
/**
- * Creates a path on the local filesystem.
- * Parent directories do not need to exists as
- * they will be created if necessary.
- * Return true on success, otherwise false.
+ * Creates a path on the local filesystem and returns true on success.
+ * Parent directories do not need to exists as they will be created if
+ * necessary.
*
- * @param string $path
- * @param integer $chmod
- * @return boolean success
+ * @param string $path
+ * @param integer $chmod
+ * @return boolean
*/
public static function makePath($path, $chmod = 0777) {
// directory already exists, abort
/**
* Unifies windows and unix directory seperators.
- *
- * @param string $path
- * @return string $path
+ *
+ * @param string $path
+ * @return string
*/
public static function unifyDirSeperator($path) {
$path = str_replace('\\\\', '/', $path);
/**
* Scans a folder (and subfolder) for a specific file.
* Returns the filename if found, otherwise false.
- *
- * @param string $folder
- * @param string $searchfile
- * @param boolean $recursive
- * @return mixed $found
+ *
+ * @param string $folder
+ * @param string $searchfile
+ * @param boolean $recursive
+ * @return mixed
*/
public static function scanFolder($folder, $searchfile, $recursive = true) {
if (!@is_dir($folder)) {
if (!$searchfile) {
return false;
}
-
+
$folder = self::addTrailingSlash($folder);
$dirh = @opendir($folder);
while ($filename = @readdir($dirh)) {
@closedir($dirh);
return $folder.$filename;
}
-
+
if ($recursive == true && @is_dir($folder.$filename)) {
if ($found = self::scanFolder($folder.$filename, $searchfile, $recursive)) {
@closedir($dirh);
/**
* Return true, if the given filename is an url (http or ftp).
*
- * @param string $filename
+ * @param string $filename
* @return boolean
*/
public static function isURL($filename) {
if ($pathA[0] === '') {
$result[] = '';
}
-
+
foreach ($pathA as $key => $dir) {
if ($dir == '..') {
if (end($result) == '..') {
}
/**
- * formats a filesize
- *
- * @param integer $byte
- * @param integer $precision
- * @return string filesize
+ * Formats the given filesize.
+ *
+ * @param integer $byte
+ * @param integer $precision
+ * @return string
*/
public static function formatFilesize($byte, $precision = 2) {
$symbol = 'Byte';
}
/**
- * formats a filesize (binary prefix)
+ * Formats a filesize with binary prefix.
*
* For more informations: <http://en.wikipedia.org/wiki/Binary_prefix>
- *
- * @param integer $byte
- * @param integer $precision
- * @return string filesize
+ *
+ * @param integer $byte
+ * @param integer $precision
+ * @return string
*/
public static function formatFilesizeBinary($byte, $precision = 2) {
$symbol = 'Byte';
}
/**
- * Downloads a package archive from an http URL.
+ * Downloads a package archive from an http URL and returns the path to
+ * the downloaded file.
*
* @param string $httpUrl
* @param string $prefix
* @param array $options
* @param array $postParameters
- * @param array $headers Should be either an empty array or a not initialized variable.
- * @return string path to the downloaded file
+ * @param array $headers empty array or a not initialized variable
+ * @return string
*/
public static function downloadFileFromHttp($httpUrl, $prefix = 'package', array $options = array(), array $postParameters = array(), &$headers = array()) {
$newFileName = self::getTemporaryFilename($prefix.'_');
* fwrite($fileHandle, $byte);
* }
*
- * @param string $sourceContent
- * @param string $characterEncoding
- * @return string destinationContent
+ * @param string $sourceContent
+ * @param string $characterEncoding
+ * @return string destinationContent
*/
public static function stripBoms($sourceContent = '', $characterEncoding = 'UTF-8') {
try {
* otherwise it considers the file to be binary.
*
* @param string $file
- * @return boolean
+ * @return boolean
*/
public static function isBinary($file) {
// open file
}
/**
- * Uncompresses a gzipped file
- *
- * @param string $gzipped
- * @param string $destination
- * @return boolean result
+ * Uncompresses a gzipped file and returns true if successful.
+ *
+ * @param string $gzipped
+ * @param string $destination
+ * @return boolean
*/
public static function uncompressFile($gzipped, $destination) {
if (!@is_file($gzipped)) {
/**
* Returns true, if php is running as apache module.
*
- * @return boolean
+ * @return boolean
*/
public static function isApacheModule() {
return function_exists('apache_get_version');
/**
* Contains header-related functions.
*
- * @author Marcel Werk
- * @copyright 2001-2009 WoltLab GmbH
+ * @author Marcel Werk
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage util
- * @category Community Framework
+ * @category Community Framework
*/
final class HeaderUtil {
/**
- * alias to php setcookie() function
+ * Alias to php setcookie() function.
*/
public static function setCookie($name, $value = '', $expire = 0) {
@header('Set-Cookie: '.rawurlencode(COOKIE_PREFIX.$name).'='.rawurlencode($value).($expire ? '; expires='.gmdate('D, d-M-Y H:i:s', $expire).' GMT' : '').(COOKIE_PATH ? '; path='.COOKIE_PATH : '').(COOKIE_DOMAIN ? '; domain='.COOKIE_DOMAIN : '').((isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == '443') ? '; secure' : '').'; HttpOnly', false);
$size = strlen($output);
$crc = crc32($output);
-
+
$newOutput = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff";
$newOutput .= substr(gzcompress($output, HTTP_GZIP_LEVEL), 2, -4);
unset($output);
/**
* Redirects the user agent.
- *
+ *
* @param string $location
- * @param boolean $prependDir
+ * @param boolean $prependDir
* @param boolean $sendStatusCode
*/
public static function redirect($location, $prependDir = true, $sendStatusCode = false) {
/**
* Does a delayed redirect.
- *
+ *
* @param string $location
- * @param string $message
+ * @param string $message
* @param integer $delay
*/
public static function delayedRedirect($location, $message, $delay = 5) {
/**
* Contains image-related functions.
*
- * @author Marcel Werk
- * @copyright 2001-2009 WoltLab GmbH
+ * @author Marcel Werk
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf.data.image
* @subpackage util
- * @category Community Framework
+ * @category Community Framework
*/
final class ImageUtil {
/**
/**
* Provides methods for JSON.
*
- * @author Alexander Ebert
- * @copyright 2001-2010 WoltLab GmbH
+ * @author Alexander Ebert
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage util
- * @category Community Framework
+ * @category Community Framework
*/
final class JSON {
/**
/**
* Contains math-related functions.
*
- * @author Marcel Werk
- * @copyright 2001-2009 WoltLab GmbH
+ * @author Marcel Werk
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage util
- * @category Community Framework
+ * @category Community Framework
*/
final class MathUtil {
/**
* Generates a random value.
- *
+ *
* @param integer $min
* @param integer $max
* @return integer
/**
* Contains option-related functions.
- *
- * @author Marcel Werk
- * @copyright 2001-2011 WoltLab GmbH
+ *
+ * @author Marcel Werk
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage util
- * @category Community Framework
+ * @category Community Framework
*/
final class OptionUtil {
/**
/**
* Replaces quoted strings in a text.
*
- * @author Marcel Werk
- * @copyright 2001-2009 WoltLab GmbH
+ * @author Marcel Werk
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage util
- * @category Community Framework
+ * @category Community Framework
*/
final class StringStack {
+ /**
+ * local string stack
+ * @var array<string>
+ */
protected static $stringStack = array();
/**
* Replaces a string with an unique hash value.
- *
- * @param string $string
- * @param string $type
+ *
+ * @param string $string
+ * @param string $type
* @return string $hash
*/
public static function pushToStringStack($string, $type = 'default') {
}
/**
- * Reinserts Strings that have been replaced by unique hash values.
+ * Reinserts strings that have been replaced by unique hash values.
*
- * @param string $string
- * @param string $type
- * @return string $string
+ * @param string $string
+ * @param string $type
+ * @return string
*/
public static function reinsertStrings($string, $type = 'default') {
if (isset(self::$stringStack[$type])) {
/**
* Returns the stack.
- *
- * @param string $type
+ *
+ * @param string $type
* @return array
*/
public static function getStack($type = 'default') {
/**
* Contains string-related functions.
*
- * @author Marcel Werk
- * @copyright 2001-2009 WoltLab GmbH
+ * @author Marcel Werk
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage util
- * @category Community Framework
+ * @category Community Framework
*/
final class StringUtil {
const HTML_PATTERN = '~</?[a-z]+[1-6]?
/**
* Returns a salted hash of the given value.
*
- * @param string $value
+ * @param string $value
* @param string $salt
- * @return string $hash
+ * @return string
*/
public static function getSaltedHash($value, $salt) {
if (!defined('ENCRYPTION_ENABLE_SALTING') || ENCRYPTION_ENABLE_SALTING) {
/**
* Returns a double salted hash of the given value.
*
- * @param string $value
+ * @param string $value
* @param string $salt
- * @return string $hash
+ * @return string
*/
public static function getDoubleSaltedHash($value, $salt) {
return self::encrypt($salt . self::getSaltedHash($value, $salt));
}
/**
- * encrypts the given value.
+ * Encrypts the given value.
*
- * @param string $value
- * @return string $hash
+ * @param string $value
+ * @return string
*/
public static function encrypt($value) {
if (defined('ENCRYPTION_METHOD')) {
}
/**
- * alias to php sha1() function.
+ * Alias to php sha1() function.
*
- * @param string $value
- * @return string $hash
+ * @param string $value
+ * @return string
*/
public static function getHash($value) {
return sha1($value);
}
-
+
/**
* Creates a random hash.
*
- * @return string a random hash
+ * @return string
*/
public static function getRandomID() {
return self::getHash(microtime() . uniqid(mt_rand(), true));
}
-
+
/**
* Converts dos to unix newlines.
- *
- * @param string $string
- * @return string $string
+ *
+ * @param string $string
+ * @return string
*/
public static function unifyNewlines($string) {
return preg_replace("%(\r\n)|(\r)%", "\n", $string);
}
-
+
/**
* Swallowes whitespace from beginnung and end of the string.
*
- * @param string $string
- * @return string $string
+ * @param string $string
+ * @return string
*/
public static function trim($text) {
// Whitespace + (narrow) non breaking spaces.
$text = preg_replace('/(\s|'.chr(226).chr(128).chr(175).'|'.chr(194).chr(160).')+$/', '', $text);
return $text;
}
-
+
/**
* Converts html special characters.
- *
- * @param string $string
- * @return string $string
+ *
+ * @param string $string
+ * @return string
*/
public static function encodeHTML($string) {
if (is_object($string))
/**
* Converts javascript special characters.
- *
- * @param string $string
- * @return string $string
+ *
+ * @param string $string
+ * @return string
*/
public static function encodeJS($string) {
if (is_object($string)) $string = $string->__toString();
/**
* Decodes html entities.
- *
- * @param string $string
- * @return string $string
+ *
+ * @param string $string
+ * @return string
*/
public static function decodeHTML($string) {
$string = str_ireplace(' ', ' ', $string); // convert non-breaking spaces to ascii 32; not ascii 160
return @html_entity_decode($string, ENT_COMPAT, 'UTF-8');
}
-
+
/**
* Formats a numeric.
- *
- * @param numeric $numeric
- * @return string
+ *
+ * @param numeric $numeric
+ * @return string
*/
public static function formatNumeric($numeric) {
if (is_int($numeric))
if (!$maxDecimals && preg_match('~^(-?\d+)(?:\.(?:0*|00[0-4]\d*))?$~', $double, $match)) {
return self::formatInteger($match[1]);
}
-
+
// round
$double = round($double, ($maxDecimals > 2 ? $maxDecimals : 2));
public static function sort(array &$strings) {
return asort($strings, SORT_LOCALE_STRING);
}
-
+
/**
- * alias to php strlen() function.
+ * Alias to php mb_strlen() function.
*/
public static function length($string) {
return mb_strlen($string);
}
/**
- * alias to php strpos() function.
+ * Alias to php mb_strpos() function.
*/
public static function indexOf($hayStack, $needle, $offset = 0) {
return mb_strpos($hayStack, $needle, $offset);
}
/**
- * alias to php stripos() function.
+ * Alias to php stripos() function with multibyte support.
*/
public static function indexOfIgnoreCase($hayStack, $needle, $offset = 0) {
return mb_strpos(self::toLowerCase($hayStack), self::toLowerCase($needle), $offset);
}
/**
- * alias to php strrpos() function.
+ * Alias to php mb_strrpos() function.
*/
public static function lastIndexOf($hayStack, $needle) {
return mb_strrpos($hayStack, $needle);
}
/**
- * alias to php substr() function.
+ * Alias to php mb_substr() function.
*/
public static function substring($string, $start, $length = null) {
if ($length !== null) return mb_substr($string, $start, $length);
}
/**
- * alias to php strtolower() function.
+ * Alias to php mb_strtolower() function.
*/
public static function toLowerCase($string) {
return mb_strtolower($string);
}
/**
- * alias to php strtoupper() function.
+ * Alias to php mb_strtoupper() function.
*/
public static function toUpperCase($string) {
return mb_strtoupper($string);
}
/**
- * alias to php substr_count() function.
+ * Alias to php substr_count() function.
*/
public static function countSubstring($hayStack, $needle) {
return mb_substr_count($hayStack, $needle);
}
/**
- * alias to php ucfirst() function.
+ * Alias to php ucfirst() function with multibyte support.
*/
public static function firstCharToUpperCase($string) {
return self::toUpperCase(self::substring($string, 0, 1)).self::substring($string, 1);
}
/**
- * alias to php lcfirst() function.
+ * Alias to php lcfirst() function with multibyte support.
*/
public static function firstCharToLowerCase($string) {
return self::toLowerCase(self::substring($string, 0, 1)).self::substring($string, 1);
}
/**
- * alias to php ucwords() function.
+ * Alias to php mb_convert_case() function.
*/
public static function wordsToUpperCase($string) {
return mb_convert_case($string, MB_CASE_TITLE);
}
/**
- * alias to php str_replace() function.
+ * Alias to php str_replace() function.
*/
public static function replace($search, $replace, $subject, &$count = null) {
return str_replace($search, $replace, $subject, $count);
}
/**
- * alias to php str_ireplace() function.
+ * Alias to php str_ireplace() function with multibyte support.
*/
public static function replaceIgnoreCase($search, $replace, $subject, &$count = 0) {
$startPos = self::indexOf(self::toLowerCase($subject), self::toLowerCase($search));
*
* @param string $string
* @param string $chars
- * @return string
+ * @return string
*/
public static function unescape($string, $chars = '"') {
for ($i = 0, $j = strlen($chars); $i < $j; $i++) {
/**
* Converts UTF-8 to Unicode
* @see http://www1.tip.nl/~t876506/utf8tbl.html
- *
+ *
* @param string $c
- * @return integer unicode value of $c
+ * @return integer
*/
public static function getCharValue($c) {
$ud = 0;
use wcf\system\io\File;
/**
- * Contains Style-related functions.
+ * Contains style-related functions.
*
- * @author Marcel Werk
- * @copyright 2001-2009 WoltLab GmbH
+ * @author Marcel Werk
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage util
- * @category Community Framework
+ * @category Community Framework
*/
final class StyleUtil {
/**
/**
* Contains user-related functions.
*
- * @author Marcel Werk
- * @copyright 2001-2009 WoltLab GmbH
+ * @author Marcel Werk
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage util
- * @category Community Framework
+ * @category Community Framework
*/
final class UserUtil {
protected static $privateIpList = array("/^0\./", "/^127\.0\.0\.1/", "/^192\.168\..*/", "/^172\.16\..*/", "/^10..*/", "/^224..*/", "/^240..*/");
/**
* Returns true, if the given name is a valid username.
*
- * @param string $name username
- * @return boolean
+ * @param string $name
+ * @return boolean
*/
public static function isValidUsername($name) {
// check illegal characters
/**
* Returns true, if the given username is available.
*
- * @param string $name username
- * @return boolean
+ * @param string $name
+ * @return boolean
*/
public static function isAvailableUsername($name) {
$sql = "SELECT COUNT(username) AS count
$row = $statement->fetchArray();
return $row['count'] == 0;
}
-
+
/**
* Returns true, if the given e-mail is a valid address.
* @see http://www.faqs.org/rfcs/rfc821.html
*
* @param string $email
- * @return boolean
+ * @return boolean
*/
public static function isValidEmail($email) {
// local-part
/**
* Returns true, if the given email address is available.
*
- * @param string $email email address
- * @return boolean
+ * @param string $email
+ * @return boolean
*/
public static function isAvailableEmail($email) {
$sql = "SELECT COUNT(email) AS count
/**
* Returns the ipv6 address of the client.
*
- * @return string ipv6 address
+ * @return string
*/
public static function getIpAddress() {
$REMOTE_ADDR = '';
/**
* Reads and validates xml documents.
*
- * @author Alexander Ebert
- * @copyright 2001-2011 WoltLab GmbH
+ * @author Alexander Ebert
+ * @copyright 2001-2012 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage util
- * @category Community Framework
+ * @category Community Framework
*/
class XML {
/**
.aclPermissionList {
margin-top: 0;
min-height: 100px;
-
+
> li {
display: block;
padding: @wcfGapTiny;
-
+
&:first-child {
border-top-left-radius: @wcfContainerBorderRadius;
border-top-right-radius: @wcfContainerBorderRadius;
> li {
cursor: pointer;
-
+
&:hover,
&.active:hover {
background-color: @wcfButtonHoverBackgroundColor;
margin-top: @wcfGapSmall;
min-height: 200px;
text-align: right;
-
+
> li {
&:hover {
background-color: @wcfButtonHoverBackgroundColor;
right: 40%;
top: 0;
z-index: 460;
-
+
.transition(opacity, .3s);
&.open {
}
}
}
-
+
.dropdownMenu {
background-color: @wcfDropdownBackgroundColor;
border: 1px solid @wcfDropdownBorderColor;
top: 0;
width: 50%;
outline: none;
-
+
.transition(opacity, .2s);
> span {
left: 0;
padding-right: @wcfGapMedium;
text-align: right;
-
+
.borderRadius(0, 30px, 30px, 0);
}
}
#lbNextLink {
right: 0;
-
+
> span {
padding-left: @wcfGapMedium;
right: 0;
-
+
.borderRadius(30px, 0, 0, 30px);
}
}
#lbNextLink,
#lbPrevLink {
opacity: 1;
-
+
.transition(opacity, .2s);
}
}
.containerList {
> li {
padding: @wcfGapMedium @wcfGapLarge;
-
+
.transition(background-color, .1s);
-
+
&:nth-child(even) {
background-color: @wcfContainerAccentBackgroundColor;
}
text-align: right;
.transition(opacity, .1s);
-
+
ul.smallButtons > li {
display: inline-block;
margin-left: -5px;
color: @wcfDimmedColor;
opacity: .7;
padding: @wcfGapMedium @wcfGapLarge;
-
+
.boxShadow(0, 0, @wcfContainerBorderColor, 10px);
.transition(opacity, .1s);
#messageQuoteList {
max-width: 800px !important;
-
+
li {
&:not(:first-child) {
margin-top: @wcfGapSmall;
.userNotificationDetails {
padding: @wcfGapMedium;
width: 250px - 2 * @wcfGapMedium;
-
+
> header {
margin-top: 0;
.contentNavigation .pageNavigation {
float: left;
margin: @wcfGapMedium + 5 0 3px;
-
+
ul li {
margin: 0 2px;
}
.tabularBoxTitle > hgroup {
color: @wcfTabularBoxColor;
padding: 5px 7px;
-
+
h1 {
font-size: @wcfTitleFontSize;
font-weight: bold;
.textShadow(@wcfTabularBoxBackgroundColor);
-
+
a {
color: @wcfTabularBoxColor;
.userProfilePreview {
position: relative;
-
+
> .userInformation {
padding-bottom: 16px;// + @wcfGapTiny;
border-bottom-left-radius: @wcfContainerBorderRadius - 1;
}
}
-
+
&:nth-child(4n), &:nth-child(4n+1) {
background-color: @wcfContainerBackgroundColor;
}
}
}
}
-
+
> .searchBar {
float: right;
padding: 6px 0;
<item name="wcf.date.day.thu"><![CDATA[Don]]></item>
<item name="wcf.date.day.fri"><![CDATA[Fre]]></item>
<item name="wcf.date.day.sat"><![CDATA[Sam]]></item>
-
+
<!-- localized days -->
<item name="wcf.date.day.sunday"><![CDATA[Sonntag]]></item>
<item name="wcf.date.day.monday"><![CDATA[Montag]]></item>
<item name="wcf.date.day.thursday"><![CDATA[Donnerstag]]></item>
<item name="wcf.date.day.friday"><![CDATA[Freitag]]></item>
<item name="wcf.date.day.saturday"><![CDATA[Samstag]]></item>
-
+
<!-- time zones -->
<item name="wcf.date.timezone.pacific.kwajalein"><![CDATA[(UTC-12:00) Kwajalein]]></item>
<item name="wcf.date.timezone.pacific.midway"><![CDATA[(UTC-11:00) Midway]]></item>
<item name="wcf.acp.option.user_online_timeout"><![CDATA[Users online timeout]]></item>
<item name="wcf.acp.option.user_online_timeout.description"><![CDATA[Enter the time users should remain marked as online when they are inactive [seconds].]]></item>
</category>
-
+
<category name="wcf.acp.package">
<item name="wcf.acp.package.application.installed"><![CDATA[Installed applications]]></item>
<item name="wcf.acp.package.application.title"><![CDATA[Applications]]></item>
<item name="wcf.global.form.add.success"><![CDATA[The new entry has been successfully saved.]]></item>
<item name="wcf.global.form.data"><![CDATA[General information]]></item>
<item name="wcf.global.form.edit.success"><![CDATA[Your changes have been successfully saved.]]></item>
- <item name="wcf.global.form.error"><![CDATA[The data you have entered are not valid. Please check the information you have given in the marked fields.]]></item><item name="wcf.global.form.error.empty"><![CDATA[Please enter the required information for this field.]]></item>
+ <item name="wcf.global.form.error"><![CDATA[The data you have entered are not valid. Please check the information you have given in the marked fields.]]></item>
+ <item name="wcf.global.form.error.empty"><![CDATA[Please enter the required information for this field.]]></item>
<item name="wcf.global.loading"><![CDATA[Loading …]]></item>
<item name="wcf.global.locale.unix"><![CDATA[en_US]]></item> <!-- system variable; do not translate -->
<item name="wcf.global.locale.win"><![CDATA[english]]></item> <!-- system variable; do not translate -->
-/**** tables ****/
+/* tables */
DROP TABLE IF EXISTS wcf1_acp_menu_item;
CREATE TABLE wcf1_acp_menu_item (
menuItemID INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY,
UNIQUE KEY userID (userID, languageID)
);
-/**** foreign keys ****/
+/* foreign keys */
ALTER TABLE wcf1_acp_menu_item ADD FOREIGN KEY (packageID) REFERENCES wcf1_package (packageID) ON DELETE CASCADE;
ALTER TABLE wcf1_acp_search_provider ADD FOREIGN KEY (packageID) REFERENCES wcf1_package (packageID) ON DELETE CASCADE;
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;
-/**** default inserts ****/
+/* default inserts */
-- default user groups
INSERT INTO wcf1_user_group (groupName, groupType) VALUES ('wcf.acp.group.group1', 1);
INSERT INTO wcf1_user_group (groupName, groupType) VALUES ('wcf.acp.group.group2', 2);