Removed debug code
authorAlexander Ebert <ebert@woltlab.com>
Tue, 28 May 2013 19:29:41 +0000 (21:29 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 28 May 2013 19:29:41 +0000 (21:29 +0200)
wcfsetup/install/files/lib/system/package/plugin/PageMenuPackageInstallationPlugin.class.php

index 16e069f4bd4fce73376b935a521a7c6d74dde440..fc18abe5f0709124ddb80189e564d92dc4bad948 100644 (file)
@@ -85,8 +85,6 @@ class PageMenuPackageInstallationPlugin extends AbstractMenuPackageInstallationP
         * @return      integer
         */
        protected function getMenuItemPosition(array $data) {
-               file_put_contents(WCF_DIR.'__pageMenu.log', "Calculating show order for '{$data['menuItem']}'\n", FILE_APPEND);
-               
                if ($data['showOrder'] === null) {
                        // get greatest showOrder value
                        $conditions = new PreparedStatementConditionBuilder();
@@ -99,22 +97,9 @@ class PageMenuPackageInstallationPlugin extends AbstractMenuPackageInstallationP
                        $statement = WCF::getDB()->prepareStatement($sql);
                        $statement->execute($conditions->getParameters());
                        $maxShowOrder = $statement->fetchArray();
-                       //return (!$maxShowOrder) ? 1 : ($maxShowOrder['showOrder'] + 1);
-                       $showOrder = (!$maxShowOrder) ? 1 : ($maxShowOrder['showOrder'] + 1);
+                       return (!$maxShowOrder) ? 1 : ($maxShowOrder['showOrder'] + 1);
                }
                else {
-                       file_put_contents(WCF_DIR.'__pageMenu.log', "\t!!! INCREASING SHOW ORDER !!!\n", FILE_APPEND);
-                       
-                       $sql = "SELECT  showOrder
-                               FROM    wcf".WCF_N."_page_menu_item
-                               WHERE   menuItem = ?";
-                       $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array('wcf.user.dashboard'));
-                       $row = $statement->fetchArray();
-                       if ($row) {
-                               file_put_contents(WCF_DIR.'__pageMenu.log', "  show order of dashboard is currently {$row['showOrder']}\n\n", FILE_APPEND);
-                       }
-                       
                        // increase all showOrder values which are >= $showOrder
                        $sql = "UPDATE  wcf".WCF_N."_".$this->tableName."
                                SET     showOrder = showOrder + 1
@@ -131,23 +116,8 @@ class PageMenuPackageInstallationPlugin extends AbstractMenuPackageInstallationP
                        
                        $statement->execute($parameters);
                        
-                       file_put_contents(WCF_DIR.'__pageMenu.log', "\n\nSQL\n\n{$sql}\n\nPARAMETERS\n\n".print_r($parameters, true)."\n\n", FILE_APPEND);
-                       
                        // return the wanted showOrder level
-                       //return $data['showOrder'];
-                       $showOrder = $data['showOrder'];
-               }
-               
-               $sql = "SELECT  showOrder
-                       FROM    wcf".WCF_N."_page_menu_item
-                       WHERE   menuItem = ?";
-               $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array('wcf.user.dashboard'));
-               $row = $statement->fetchArray();
-               if ($row) {
-                       file_put_contents(WCF_DIR.'__pageMenu.log', "  show order of dashboard is now {$row['showOrder']}\n\n", FILE_APPEND);
+                       return $data['showOrder'];
                }
-               
-               return $showOrder;
        }
 }