Resolved some TODOs
authorMarcel Werk <burntime@woltlab.com>
Fri, 12 Apr 2013 17:51:23 +0000 (19:51 +0200)
committerMarcel Werk <burntime@woltlab.com>
Fri, 12 Apr 2013 17:51:23 +0000 (19:51 +0200)
wcfsetup/install/files/acp/templates/userEmailAddressExport.tpl
wcfsetup/install/files/lib/system/WCFACP.class.php
wcfsetup/install/files/lib/system/style/StyleHandler.class.php
wcfsetup/install/files/lib/system/template/TemplateScriptingCompiler.class.php
wcfsetup/install/files/lib/util/FileUtil.class.php

index 2d695835568da1b9c4f43cc5f9b8b74d6842089a..e484d31e5dc501c63b2c6de58f43194519dfc300 100644 (file)
@@ -56,7 +56,7 @@
                                </dd>
                        </dl>
                        
-                       <dl id="textSeparatorDiv"><!-- ToDo: Checkbox -->
+                       <dl id="textSeparatorDiv">
                                <dt><label for="textSeparator">{lang}wcf.acp.user.exportEmailAddress.textSeparator{/lang}</label></dt>
                                <dd>
                                        <input type="text" id="textSeparator" name="textSeparator" value="{$textSeparator}" class="medium" />
index f49c0e2aca1e0ad2a1cee117cc31c7086329824e..96f6c6d5dfa059f64371e6f1e2569918e7b7ac43 100644 (file)
@@ -117,9 +117,7 @@ class WCFACP extends WCF {
                $path = RouteHandler::getPath();
                
                self::getTPL()->assign(array(
-                       'baseHref' => $host . $path,
-                       'quickAccessPackages' => $this->getQuickAccessPackages(),
-                       // todo: 'timezone' => \wcf\util\DateUtil::getTimezone()
+                       'baseHref' => $host . $path
                ));
        }
        
@@ -133,23 +131,6 @@ class WCFACP extends WCF {
                }
        }
        
-       /**
-        * Returns a list of all installed applications packages.
-        * 
-        * @return      array
-        */
-       protected function getQuickAccessPackages() {
-               $quickAccessPackages = array();
-               foreach (PackageCacheBuilder::getInstance()->getData(array(), 'packages') as $packageID => $package) {
-                       if (!$package->isApplication) break;
-                       if ($package->package != 'com.woltlab.wcf') {
-                               $quickAccessPackages[] = $package;
-                       }
-               }
-               
-               return $quickAccessPackages;
-       }
-       
        /**
         * Checks whether the active user has entered the valid master password.
         */
index c6943436bc70cabd0fab8235c59b315f7b0c61ee..b20b881f604244f052aab5d0f504cfd1b1217ba7 100644 (file)
@@ -116,21 +116,19 @@ class StyleHandler extends SingletonFactory {
        /**
         * Returns the HTML tag to include current stylesheet.
         * 
-        * @todo        Add RTL support
-        * 
         * @return      string
         */
        public function getStylesheet() {
                if (RequestHandler::getInstance()->isACPRequest()) {
                        // ACP
-                       $filename = 'acp/style/style.css';
+                       $filename = 'acp/style/style'.(WCF::getLanguage()->get('wcf.global.pageDirection') == 'rtl' ? '-rtl' : '').'.css';
                        if (!file_exists(WCF_DIR.$filename)) {
                                StyleCompiler::getInstance()->compileACP();
                        }
                }
                else {
                        // frontend
-                       $filename = 'style/style-'.$this->getStyle()->styleID.'.css';
+                       $filename = 'style/style-'.$this->getStyle()->styleID.(WCF::getLanguage()->get('wcf.global.pageDirection') == 'rtl' ? '-rtl' : '').'.css';
                        if (!file_exists(WCF_DIR.$filename)) {
                                StyleCompiler::getInstance()->compile($this->getStyle()->getDecoratedObject());
                        }
index ea3b6e3155ec3d40208606c2674ed520c2aae321..118b78f1d5c9929b5ba0931cb82b8184b6a0ca21 100644 (file)
@@ -266,8 +266,6 @@ class TemplateScriptingCompiler {
                $compiledContent .= $textBlocks[$i];
                $compiledContent = chop($compiledContent);
                
-               // @todo: INSERT POSTFILTERS HERE!?
-               
                // reinsert {literal} Tags
                $compiledContent = $this->reinsertLiterals($compiledContent);
                
index c1e2ceb57a4811ac31e1d90bc7c93494869aa9c9..de5bff87cdb2e373dfdc5d74d487b704390afdf2 100644 (file)
@@ -412,77 +412,6 @@ final class FileUtil {
                return $newFileName;
        }
        
-       /**
-        * Strips supernumerous BOMs from a given bytestream.
-        *
-        * If we are dealing with bytestreams being pushed from one program or script to another in a UTF-8 
-        * environment, we might encounter problems with BOMs (Byte Order Marks). E.g., if there's a script 
-        * that reads a .tar file via readfile(), and this script is encoded in UTF-8, and being called from another
-        * script which wants to handle the bytestream that results from readfile(). But apparently because of the 
-        * UTF-8 encoding of the called script -- at least in some PHP versions -- readfile() adds a UTF-8 BOM
-        * at the beginning of the bytestream. If we do write this bytestream to disk and then try to open the
-        * resulting file, we will get an error because it is no more a valid .tar archive. The same thing happens
-        * if we handle an .xml file and then try to parse it.
-        * So, if bytestreams are being handled in a UTF-8 environment, be sure always to use this function 
-        * before writing the bytestream to disk or trying to parse it with an xml parser.
-        * This works regardless of multibyte string support (mb_strpos and friends) being enabled or not.
-        * 
-        * Btw, if you try to apply the following to a bytestream read from a .tar file, 
-        * you will end up with a file sized zero bytes:
-        * while (($byte = fgetc($fileHandle)) !== false) {
-        *      fwrite($fileHandle, $byte);
-        * }
-        * 
-        * @param       string          $sourceContent
-        * @param       string          $characterEncoding
-        * @return      string          destinationContent
-        */
-       public static function stripBoms($sourceContent = '', $characterEncoding = 'UTF-8') {
-               try {
-                       // TODO: implement recognition of other BOMs (UTF-7, UTF-16 big endian, UTF-16 little endian etc.)
-                       if ($characterEncoding == 'UTF-8') {
-                               // get the ASCII codes for the three bytes the UTF-8 BOM is consisting of.
-                               $firstByte = intval(0xEF);
-                               $secondByte = intval(0xBB);
-                               $thirdByte = intval(0xBF);
-                       }
-                       else {
-                               return $sourceContent;
-                       }
-                       
-                       // put the bytestream's first three bytes to an array.
-                       $workArray = unpack('C3', $sourceContent);
-                       if (!is_array($workArray)) {
-                               throw new SystemException("Unable to process bytestream.");
-                       }
-                       
-                       // detect the UTF-8 BOM.
-                       if (($workArray['1'] == $firstByte) && ($workArray['2'] == $secondByte) && ($workArray['3'] == $thirdByte)) {
-                               $tmpname = self::getTemporaryFilename('stripBoms_');
-                               $tmpStream = fopen($tmpname, 'w+');
-                               fwrite($tmpStream, $sourceContent);
-                               rewind($tmpStream);
-                               
-                               // cut off the BOM.
-                               fseek($tmpStream, 3); // compatibility for PHP < 5.1.0
-                               $destinationContent = stream_get_contents($tmpStream);
-                               fclose($tmpStream);
-                               @unlink($tmpname);
-                               
-                               return $destinationContent;
-                       } 
-                       else {
-                               return $sourceContent;
-                       }
-               }
-               catch (SystemException $e) {
-                       // clean up
-                       if (isset($tmpname) && file_exists($tmpname)) @unlink($tmpname);
-                       
-                       throw $e;
-               }
-       }
-       
        /**
         * Determines whether a file is text or binary by checking the first few bytes in the file.
         * The exact number of bytes is system dependent, but it is typically several thousand.