Changeset 2697

Show
Ignore:
Timestamp:
10/15/06 13:16:49 (7 years ago)
Author:
gregmac
Message:

Code cleanup

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/trunk/amp_conf/htdocs/admin/common/mainstyle.css

    r2696 r2697  
    361361} 
    362362#moduleprogress hr { 
     363  margin-left:0; 
    363364  width:40%; 
    364365  color:#ccc; 
  • freepbx/trunk/amp_conf/htdocs/admin/page.modules.php

    r2684 r2697  
    44$online = isset($_REQUEST['online'])?$_REQUEST['online']:false; 
    55$moduleaction = isset($_REQUEST['moduleaction'])?$_REQUEST['moduleaction']:false; 
    6  
    7 $installed = find_allmodules(); 
     6/* 
     7  moduleaction is an array with the key as the module name, and possible values: 
     8   
     9  downloadinstall - download and install (used when a module is not locally installed) 
     10  upgrade - download and install (used when a module is locally installed) 
     11  install - install/upgrade locally available module 
     12  enable - enable local module 
     13  disable - disable local module 
     14  uninstall - uninstall local module 
     15*/ 
    816 
    917function pageReload(){ 
     
    1220} 
    1321 
    14 /* 
    15 if (isset($_POST['submit']) && is_array($_POST['modules'])) { // if form has been submitted 
    16   foreach ($_POST['modules'] as $module) { 
    17     switch ($_POST['modaction']) { 
    18       case "install": 
    19         if (runModuleSQL($module,'install')) { 
    20           installModule($module,$_POST[$module.'_version']); 
    21           needreload(); 
    22         } else 
    23           echo "<div class=\"error\">"._("Module install script failed to run")."</div>"; 
    24       break; 
    25       case "uninstall": 
    26         if (runModuleSQL($module,'uninstall')) { 
    27           uninstallModule($module); 
    28           needreload(); 
    29         } else 
    30           echo "<div class=\"error\">"._("Module uninstall script failed to run")."</div>"; 
    31       break; 
    32       case "enable": 
    33         enableModule($module); 
    34         needreload(); 
    35         echo pageReload(); 
    36       break; 
    37       case "disable": 
    38         disableModule($module); 
    39         needreload(); 
    40         echo pageReload(); 
    41       break; 
    42       case "delete": 
    43         deleteModule($module); 
    44         needreload(); 
    45         rmModule($module); 
    46       break; 
    47       case "download": 
    48         fetchModule($module); 
    49       break; 
    50       case "upgrade": 
    51         upgradeModule($module); 
    52         needreload(); 
    53       break; 
    54       case "installenable": // install and enable a module 
    55         $boolInstall = true; 
    56         // only run install if it's not installed 
    57         if ($installed[$module]['status'] == 0) { 
    58           // set to false on failed install 
    59           $boolInstall = runModuleSQL($module,'install'); 
    60           if ($boolInstall) { 
    61             installModule($module,$_POST[$module.'_version']); 
    62             enableModule($module); 
    63             echo pageReload(); 
    64           } else { 
    65             echo "<div class=\"error\">{$module}: "._("Module install script failed to run")."</div>"; 
    66           } 
    67         } else { // it's already installed, so just enable it 
    68           enableModule($module); 
    69           echo pageReload(); 
    70         } 
    71         needreload(); 
    72       break; 
    73       case "downloadinstall": // download, install and enable 
    74         fetchModule($module); 
    75         if (runModuleSQL($module,'install'))  
    76           installModule($module,$_POST[$module.'_version']); 
    77         else 
    78           echo "<div class=\"error\">"._("Module install script failed to run")."</div>"; 
    79         enableModule($module); 
    80         needreload(); 
    81       break; 
    82       case "downloadupdate": //download and update 
    83         fetchModule($module); 
    84         upgradeModule($module); 
    85         needreload(); 
    86       break; 
    87       case "uninstalldelete": //uninstall and delete 
    88         if (runModuleSQL($module,'uninstall')) 
    89           uninstallModule($module); 
    90         else 
    91           echo "<div class=\"error\">"._("Module uninstall script failed to run")."</div>"; 
    92         deleteModule($module); 
    93         rmModule($module); 
    94         needreload(); 
    95       break; 
    96     } 
    97   } 
    98 
    99  
    100 */ 
    101 /* 
    102 downloadinstall - download and install (used when a module is not locally installed) 
    103 upgrade - download and install (used when a module is locally installed) 
    104 install - install/upgrade locally available module 
    105 enable - enable local module 
    106 disable - disable local module 
    107 uninstall - uninstall local module 
    108 */ 
     22 
    10923 
    11024?>