Example #1
0
 function disable($base_dir)
 {
     global $app_strings;
     $total_steps = 3;
     //min steps with no tasks
     $current_step = 0;
     $this->base_dir = $base_dir;
     $tasks = array('disable_copy', 'disable_dashlets', 'disable_relationships', 'disable_extensions', 'disable_global_search', 'disable_manifest_logichooks', 'reset_opcodes');
     $total_steps += count($tasks);
     //now the real number of steps
     if (file_exists($this->base_dir . '/manifest.php')) {
         if (!$this->silent) {
             $current_step++;
             display_progress_bar('install', $current_step, $total_steps);
             echo '<div id ="displayLoglink" ><a href="#" onclick="toggleDisplay(\'displayLog\')">' . $app_strings['LBL_DISPLAY_LOG'] . '</a> </div><div id="displayLog" style="display:none">';
         }
         require_once $this->base_dir . '/manifest.php';
         $this->installdefs = $installdefs;
         $this->id_name = $this->installdefs['id'];
         $installed_modules = array();
         if (isset($this->installdefs['beans'])) {
             foreach ($this->installdefs['beans'] as $bean) {
                 $installed_modules[] = $bean['module'];
             }
         }
         if (!$this->silent) {
             $current_step++;
             update_progress_bar('install', $current_step, $total_steps);
         }
         foreach ($tasks as $task) {
             $this->{$task}();
             if (!$this->silent) {
                 $current_step++;
                 update_progress_bar('install', $current_step, $total_steps);
             }
         }
         if (!$this->silent) {
             $current_step++;
             update_progress_bar('install', $current_step, $total_steps);
             echo '</div>';
         }
         UpdateSystemTabs('Restore', $installed_modules);
     } else {
         die("No manifest.php Defined In {$this->base_dir}/manifest.php");
     }
 }
Example #2
0
 function disable($base_dir)
 {
     global $app_strings;
     $total_steps = 3;
     //min steps with no tasks
     $current_step = 0;
     $this->base_dir = $base_dir;
     $tasks = array('disable_copy', 'disable_menus', 'disable_dashlets', 'disable_userpage', 'disable_administration', 'disable_vardefs', 'disable_layoutdefs', 'disable_relationships', 'disable_languages', 'disable_logichooks', 'reset_opcodes');
     $total_steps += count($tasks);
     //now the real number of steps
     if (file_exists($this->base_dir . '/manifest.php')) {
         if (!$this->silent) {
             $current_step++;
             display_progress_bar('install', $current_step, $total_steps);
             echo '<div id ="displayLoglink" ><a href="#" onclick="toggleDisplay(\'displayLog\')">' . $app_strings['LBL_DISPLAY_LOG'] . '</a> </div><div id="displayLog" style="display:none">';
         }
         require_once $this->base_dir . '/manifest.php';
         $this->installdefs = $installdefs;
         $this->id_name = $this->installdefs['id'];
         $installed_modules = array();
         if (isset($this->installdefs['beans'])) {
             foreach ($this->installdefs['beans'] as $bean) {
                 $installed_modules[] = $bean['module'];
             }
             mkdir_recursive("custom/Extension/application/Ext/Include/" . DISABLED_PATH, true);
             //Clear any older disabled version
             if (file_exists("custom/Extension/application/Ext/Include/" . DISABLED_PATH . '/' . $this->id_name . '.php')) {
                 rmdir_recursive("custom/Extension/application/Ext/Include/" . DISABLED_PATH . '/' . $this->id_name . '.php');
             }
             if (file_exists("custom/Extension/application/Ext/Include/{$this->id_name}.php")) {
                 rename("custom/Extension/application/Ext/Include/{$this->id_name}.php", "custom/Extension/application/Ext/Include/" . DISABLED_PATH . '/' . $this->id_name . '.php');
             }
             $this->rebuild_modules();
         }
         if (!$this->silent) {
             $current_step++;
             update_progress_bar('install', $current_step, $total_steps);
         }
         foreach ($tasks as $task) {
             $this->{$task}();
             if (!$this->silent) {
                 $current_step++;
                 update_progress_bar('install', $current_step, $total_steps);
             }
         }
         if (!$this->silent) {
             $current_step++;
             update_progress_bar('install', $current_step, $total_steps);
             echo '</div>';
         }
         UpdateSystemTabs('Restore', $installed_modules);
     } else {
         die("No manifest.php Defined In {$this->base_dir}/manifest.php");
     }
 }