Fixed LanguageAddForm
authorAlexander Ebert <ebert@woltlab.com>
Wed, 5 Dec 2012 19:35:00 +0000 (20:35 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 5 Dec 2012 19:35:00 +0000 (20:35 +0100)
files/lib/acp/form/LanguageAddForm.class.php

index 669244ef0d32d3af27d4a45114716aa73fafd66f..531fb6def196eea99e886ec29c9e134fbd34a7d1 100644 (file)
@@ -25,19 +25,64 @@ class LanguageAddForm extends ACPForm {
         */
        public $activeMenuItem = 'wcf.acp.menu.link.language.add';
        
+       /**
+        * file name
+        * @var string
+        */
+       public $filename = '';
+       
+       /**
+        * import field
+        * @var string
+        */
+       public $importField = 'languageFile';
+       
+       /**
+        * language object
+        * @var wcf\data\language\Language
+        */
+       public $language = null;
+       
+       /**
+        * language code
+        * @var string
+        */
+       public $languageCode = '';
+       
+       /**
+        * import language file
+        * @var string
+        */
+       public $languageFile = '';
+       
+       /**
+        * list of available languages
+        * @var array<wcf\data\language\Language>
+        */
+       public $languages = array();
+       
+       /**
+        * mode
+        * @var string
+        */
+       public $mode = 'import';
+       
        /**
         * @see wcf\page\AbstractPage::$neededPermissions
         */
        public $neededPermissions = array('admin.language.canAddLanguage');
        
-       public $mode = 'import';
-       public $languageFile = '';
-       public $languageCode = '';
+       /**
+        * source language object
+        * @var wcf\data\language\Language
+        */
+       public $sourceLanguage = null;
+       
+       /**
+        * source language id
+        * @var integer
+        */
        public $sourceLanguageID = 0;
-       public $filename = '';
-       public $sourceLanguage, $language;
-       public $importField = 'languageFile';
-       public $languages = array();
        
        /**
         * @see wcf\form\Form::readFormParameters()
@@ -126,29 +171,6 @@ class LanguageAddForm extends ACPForm {
                        $languageEditor->copy($this->language);
                }
                
-               // add language to this package
-               $sql = "SELECT  COUNT(*) AS count
-                       FROM    wcf".WCF_N."_language_to_package
-                       WHERE   languageID = ?
-                               AND packageID = ?";
-               $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
-                       $this->language->languageID,
-                       PACKAGE_ID
-               ));
-               
-               $row = $statement->fetchArray();
-               if (!$row['count']) {
-                       $sql = "INSERT INTO     wcf".WCF_N."_language_to_package
-                                               (languageID, packageID)
-                               VALUES          (?, ?)";
-                       $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array(
-                               $this->language->languageID,
-                               PACKAGE_ID
-                       ));
-               }
-               
                LanguageFactory::getInstance()->clearCache();
                
                $this->saved();