From: Matthias Schmidt Date: Fri, 12 Aug 2011 19:59:45 +0000 (+0200) Subject: Some deletions that weren't commit the last time X-Git-Tag: 2.0.0_Beta_1~1878^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2120ec2f47169be43fbd2040f00ee1a92fe49d9f;p=GitHub%2FWoltLab%2FWCF.git Some deletions that weren't commit the last time --- diff --git a/wcfsetup/install/files/lib/system/template/plugin/TemplatePluginModifierDatediff.class.php b/wcfsetup/install/files/lib/system/template/plugin/TemplatePluginModifierDatediff.class.php deleted file mode 100644 index 73375f3eb3..0000000000 --- a/wcfsetup/install/files/lib/system/template/plugin/TemplatePluginModifierDatediff.class.php +++ /dev/null @@ -1,33 +0,0 @@ - - * @package com.woltlab.wcf - * @subpackage system.template.plugin - * @category Community Framework - */ -class TemplatePluginModifierDatediff implements ITemplatePluginModifier { - /** - * @see wcf\system\template\ITemplatePluginModifier::execute() - */ - public function execute($tagArgs, TemplateEngine $tplObj) { - // get timestamps - if (!isset($tagArgs[1])) $tagArgs[1] = TIME_NOW; - $start = min($tagArgs[0], $tagArgs[1]); - $end = max($tagArgs[0], $tagArgs[1]); - - return DateUtil::diff($start, $end, 'string'); - } -} diff --git a/wcfsetup/install/files/lib/system/template/plugin/TemplatePluginModifierEncodejs.class.php b/wcfsetup/install/files/lib/system/template/plugin/TemplatePluginModifierEncodejs.class.php deleted file mode 100644 index cb1a247265..0000000000 --- a/wcfsetup/install/files/lib/system/template/plugin/TemplatePluginModifierEncodejs.class.php +++ /dev/null @@ -1,41 +0,0 @@ - - * @package com.woltlab.wcf - * @subpackage system.template.plugin - * @category Community Framework - */ -class TemplatePluginModifierEncodejs implements ITemplatePluginModifier { - /** - * @see wcf\system\template\ITemplatePluginModifier::execute() - */ - public function execute($tagArgs, TemplateEngine $tplObj) { - // escape backslash - $tagArgs[0] = StringUtil::replace("\\", "\\\\", $tagArgs[0]); - - // escape singe quote - $tagArgs[0] = StringUtil::replace("'", "\'", $tagArgs[0]); - - // escape new lines - $tagArgs[0] = StringUtil::replace("\n", '\n', $tagArgs[0]); - - // escape slashes - $tagArgs[0] = StringUtil::replace("/", '\/', $tagArgs[0]); - - return $tagArgs[0]; - } -} diff --git a/wcfsetup/install/files/lib/system/template/plugin/TemplatePluginModifierFilesize.class.php b/wcfsetup/install/files/lib/system/template/plugin/TemplatePluginModifierFilesize.class.php deleted file mode 100644 index fcd7452f84..0000000000 --- a/wcfsetup/install/files/lib/system/template/plugin/TemplatePluginModifierFilesize.class.php +++ /dev/null @@ -1,28 +0,0 @@ - - * @package com.woltlab.wcf - * @subpackage system.template.plugin - * @category Community Framework - */ -class TemplatePluginModifierFilesize implements ITemplatePluginModifier { - /** - * @see wcf\system\template\ITemplatePluginModifier::execute() - */ - public function execute($tagArgs, TemplateEngine $tplObj) { - return FileUtil::formatFilesize($tagArgs[0]); - } -} diff --git a/wcfsetup/install/files/lib/system/template/plugin/TemplatePluginModifierFilesizeBinary.class.php b/wcfsetup/install/files/lib/system/template/plugin/TemplatePluginModifierFilesizeBinary.class.php deleted file mode 100644 index 98469ed3df..0000000000 --- a/wcfsetup/install/files/lib/system/template/plugin/TemplatePluginModifierFilesizeBinary.class.php +++ /dev/null @@ -1,28 +0,0 @@ - - * @package com.woltlab.wcf - * @subpackage system.template.plugin - * @category Community Framework - */ -class TemplatePluginModifierFilesizeBinary implements ITemplatePluginModifier { - /** - * @see wcf\system\template\ITemplatePluginModifier::execute() - */ - public function execute($tagArgs, TemplateEngine $tplObj) { - return FileUtil::formatFilesizeBinary($tagArgs[0]); - } -} diff --git a/wcfsetup/install/files/lib/system/template/plugin/TemplatePluginModifierPlainTime.class.php b/wcfsetup/install/files/lib/system/template/plugin/TemplatePluginModifierPlainTime.class.php deleted file mode 100644 index 3337b1e8d2..0000000000 --- a/wcfsetup/install/files/lib/system/template/plugin/TemplatePluginModifierPlainTime.class.php +++ /dev/null @@ -1,31 +0,0 @@ - - * @package com.woltlab.wcf - * @subpackage system.template.plugin - * @category Community Framework - */ -class TemplatePluginModifierPlainTime implements ITemplatePluginModifier { - /** - * @see wcf\system\template\ITemplatePluginModifier::execute() - */ - public function execute($tagArgs, TemplateEngine $tplObj) { - $dateTime = DateUtil::getDateTimeByTimestamp($tagArgs[0]); - return str_replace('%time%', DateUtil::format($dateTime, DateUtil::TIME_FORMAT), str_replace('%date%', DateUtil::format($dateTime, DateUtil::DATE_FORMAT), WCF::getLanguage()->get('wcf.global.date.dateTimeFormat'))); - } -} diff --git a/wcfsetup/install/files/lib/system/template/plugin/TemplatePluginModifierTime.class.php b/wcfsetup/install/files/lib/system/template/plugin/TemplatePluginModifierTime.class.php deleted file mode 100644 index 7fcfec95ac..0000000000 --- a/wcfsetup/install/files/lib/system/template/plugin/TemplatePluginModifierTime.class.php +++ /dev/null @@ -1,36 +0,0 @@ - - * @package com.woltlab.wcf - * @subpackage system.template.plugin - * @category Community Framework - */ -class TemplatePluginModifierTime implements ITemplatePluginModifier { - /** - * @see wcf\system\template\ITemplatePluginModifier::execute() - */ - public function execute($tagArgs, TemplateEngine $tplObj) { - $timestamp = intval($tagArgs[0]); - $dateTimeObject = DateUtil::getDateTimeByTimestamp($timestamp); - $date = DateUtil::format($dateTimeObject, DateUtil::DATE_FORMAT); - $time = DateUtil::format($dateTimeObject, DateUtil::TIME_FORMAT); - $dateTime = str_replace('%time%', $time, str_replace('%date%', $date, WCF::getLanguage()->get('wcf.global.date.dateTimeFormat'))); - - return ''; - } -} diff --git a/wcfsetup/install/files/lib/system/template/plugin/TemplatePluginModifierTruncate.class.php b/wcfsetup/install/files/lib/system/template/plugin/TemplatePluginModifierTruncate.class.php deleted file mode 100644 index b9ff456934..0000000000 --- a/wcfsetup/install/files/lib/system/template/plugin/TemplatePluginModifierTruncate.class.php +++ /dev/null @@ -1,54 +0,0 @@ - - * @package com.woltlab.wcf - * @subpackage system.template.plugin - * @category Community Framework - */ -class TemplatePluginModifierTruncate implements ITemplatePluginModifier { - /** - * @see wcf\system\template\ITemplatePluginModifier::execute() - */ - public function execute($tagArgs, TemplateEngine $tplObj) { - // default values - $length = 80; - $etc = '...'; - $breakWords = false; - - // get values - $string = $tagArgs[0]; - if (isset($tagArgs[1])) $length = intval($tagArgs[1]); - if (isset($tagArgs[2])) $etc = $tagArgs[2]; - if (isset($tagArgs[3])) $breakWords = $tagArgs[3]; - - // execute plugin - if ($length == 0) { - return ''; - } - - if (StringUtil::length($string) > $length) { - $length -= StringUtil::length($etc); - - if (!$breakWords) { - $string = preg_replace('/\s+?(\S+)?$/', '', StringUtil::substring($string, 0, $length + 1)); - } - - return StringUtil::substring($string, 0, $length).$etc; - } - else { - return $string; - } - } -} diff --git a/wcfsetup/install/files/lib/system/template/plugin/TemplatePluginPrefilterEvent.class.php b/wcfsetup/install/files/lib/system/template/plugin/TemplatePluginPrefilterEvent.class.php deleted file mode 100644 index be1dcf8737..0000000000 --- a/wcfsetup/install/files/lib/system/template/plugin/TemplatePluginPrefilterEvent.class.php +++ /dev/null @@ -1,30 +0,0 @@ - - * @package com.woltlab.wcf - * @subpackage system.template.plugin - * @category Community Framework - */ -class TemplatePluginPrefilterEvent implements ITemplatePluginPrefilter { - /** - * @see wcf\system\template\ITemplatePluginPrefilter::execute() - */ - public function execute($templateName, $sourceContent, TemplateScriptingCompiler $compiler) { - $ldq = preg_quote($compiler->getLeftDelimiter(), '~'); - $rdq = preg_quote($compiler->getRightDelimiter(), '~'); - $sourceContent = preg_replace("~{$ldq}event\ name\=\'([\w]+)\'{$rdq}~e", 'wcf\system\WCF::getTPL()->getTemplateListenerCode(\''.$templateName.'\', \'$1\')', $sourceContent); - - return $sourceContent; - } -} diff --git a/wcfsetup/install/files/lib/system/template/plugin/TemplatePluginPrefilterHascontent.class.php b/wcfsetup/install/files/lib/system/template/plugin/TemplatePluginPrefilterHascontent.class.php deleted file mode 100644 index 97ceb43ab7..0000000000 --- a/wcfsetup/install/files/lib/system/template/plugin/TemplatePluginPrefilterHascontent.class.php +++ /dev/null @@ -1,70 +0,0 @@ - - * {content} - * {if $foo}
  • bar
  • {/if} - * {/content} - * - * {hascontentelse} - *

    baz

    - * {/hascontent} - * - * @author Alexander Ebert - * @copyright 2001-2011 WoltLab GmbH - * @license GNU Lesser General Public License - * @package com.woltlab.wcf - * @subpackage system.template.plugin - * @category Community Framework - */ -class TemplatePluginPrefilterHascontent implements ITemplatePluginPrefilter { - /** - * @see wcf\system\template\ITemplatePluginPrefilter::execute() - */ - public function execute($templateName, $sourceContent, TemplateScriptingCompiler $compiler) { - $ldq = preg_quote($compiler->getLeftDelimiter(), '~'); - $rdq = preg_quote($compiler->getRightDelimiter(), '~'); - - $sourceContent = preg_replace_callback("~{$ldq}hascontent{$rdq}(.*){$ldq}content{$rdq}(.*){$ldq}\/content{$rdq}(.*)({$ldq}hascontentelse{$rdq}(.*))?{$ldq}\/hascontent{$rdq}~sU", array('self', 'replaceContentCallback'), $sourceContent); - - return $sourceContent; - } - - /** - * Reorders content to provide a logical order. In fact the content of - * '{content}' is moved outside the if-condition in order to capture - * the content during runtime, safely determining wether content is empty - * or not. - * - * @param array $matches - * @return string - */ - protected static function replaceContentCallback(array $matches) { - $beforeContent = $matches[1]; - $content = $matches[2]; - $afterContent = $matches[3]; - $elseContent = (isset($matches[5])) ? $matches[5] : ''; - - $variable = 'hascontent_' . StringUtil::getRandomID(); - - $newContent = '{capture assign='.$variable.'}'.$content.'{/capture}'."\n"; - $newContent .= '{assign var='.$variable.' value=$'.$variable.'|trim}'."\n"; - $newContent .= '{if $'.$variable.'}'.$beforeContent.'{@$'.$variable.'}'."\n".$afterContent; - - if (!empty($elseContent)) { - $newContent .= '{else}'.$elseContent."\n"; - } - - $newContent .= '{/if}'."\n"; - - return $newContent; - } -} diff --git a/wcfsetup/install/files/lib/system/template/plugin/TemplatePluginPrefilterIcon.class.php b/wcfsetup/install/files/lib/system/template/plugin/TemplatePluginPrefilterIcon.class.php deleted file mode 100644 index 22769ccf51..0000000000 --- a/wcfsetup/install/files/lib/system/template/plugin/TemplatePluginPrefilterIcon.class.php +++ /dev/null @@ -1,30 +0,0 @@ - - * @package com.woltlab.wcf - * @subpackage system.template.plugin - * @category Community Framework - */ -class TemplatePluginPrefilterIcon implements ITemplatePluginPrefilter { - /** - * @see wcf\system\template\ITemplatePluginPrefilter::execute() - */ - public function execute($sourceContent, TemplateScriptingCompiler $compiler) { - $ldq = preg_quote($compiler->getLeftDelimiter(), '~'); - $rdq = preg_quote($compiler->getRightDelimiter(), '~'); - $sourceContent = preg_replace("~{$ldq}icon{$rdq}([\w\.]+){$ldq}/icon{$rdq}~", '{literal}getStyle()->getIconPath(\'$1\'); ?>{/literal}', $sourceContent); - - return $sourceContent; - } -} diff --git a/wcfsetup/install/files/lib/system/template/plugin/TemplatePluginPrefilterLang.class.php b/wcfsetup/install/files/lib/system/template/plugin/TemplatePluginPrefilterLang.class.php deleted file mode 100644 index 4f3847214d..0000000000 --- a/wcfsetup/install/files/lib/system/template/plugin/TemplatePluginPrefilterLang.class.php +++ /dev/null @@ -1,34 +0,0 @@ - - * @package com.woltlab.wcf - * @subpackage system.template.plugin - * @category Community Framework - */ -class TemplatePluginPrefilterLang implements ITemplatePluginPrefilter { - /** - * @see wcf\system\template\ITemplatePluginPrefilter::execute() - */ - public function execute($templateName, $sourceContent, TemplateScriptingCompiler $compiler) { - $ldq = preg_quote($compiler->getLeftDelimiter(), '~'); - $rdq = preg_quote($compiler->getRightDelimiter(), '~'); - $sourceContent = preg_replace("~{$ldq}lang{$rdq}([\w\.]+){$ldq}/lang{$rdq}~e", 'wcf\system\WCF::getLanguage()->get(\'$1\')', $sourceContent); - - return $sourceContent; - } -}