Changeset 1465
- Timestamp:
- 04/10/06 18:52:31 (7 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
freepbx/trunk/amp_conf/htdocs/admin/functions.inc.php
r1413 r1465 241 241 1=disabled 242 242 2=enabled 243 3=enabled and needs upgrade 243 244 */ 244 245 if(is_array($xmlarray[ $result['modulename'] ])) { 245 if ($result['enabled'] != 0) 246 $xmlarray[ $result['modulename'] ]["status"] = 2; 247 else 246 if ($result['enabled'] != 0) { 247 // check if file and registered versions are the same 248 // version_compare returns 0 if no difference 249 if (version_compare($result['version'],$xmlarray[ $result['modulename'] ]["version"]) === 0) 250 $xmlarray[ $result['modulename'] ]["status"] = 2; 251 else 252 $xmlarray[ $result['modulename'] ]["status"] = 3; 253 } else { 248 254 $xmlarray[ $result['modulename'] ]["status"] = 1; 255 } 249 256 } else { 250 257 $xmlarray[ $result['modulename'] ]["status"] = -1; freepbx/trunk/amp_conf/htdocs/admin/page.modules.php
r1442 r1465 27 27 case "delete": 28 28 deleteModule($_POST['modname']); 29 //echo "<script language=\"Javascript\">document.location='".$_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING']."'</script>";30 29 break; 31 30 case "download": 32 31 fetchModule($_POST['location']); 33 //echo "<script language=\"Javascript\">document.location='".$_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING']."'</script>"; 32 break; 33 case "upgrade": 34 upgradeModule($_POST['modname']); 34 35 break; 35 36 } … … 124 125 $action .= "<input type=\"submit\" name=\"submit\" value=\""._("Disable")."\">"; 125 126 $action .= "</form>"; 127 } else if($mod['status'] == 3){ 128 $status = _("Enabled - needs upgrade"); 129 //disable form 130 $action = "<form method=\"POST\" action=\"{$_SERVER['REQUEST_URI']}\" style=display:inline>"; 131 $action .= "<input type=\"hidden\" name=\"modname\" value=\"{$key}\">"; 132 $action .= "<input type=\"hidden\" name=\"modaction\" value=\"disable\">"; 133 $action .= "<input type=\"submit\" name=\"submit\" value=\""._("Disable")."\">"; 134 $action .= "</form>"; 135 //upgrade form 136 $action .= "<form method=\"POST\" action=\"{$_SERVER['REQUEST_URI']}\" style=display:inline>"; 137 $action .= "<input type=\"hidden\" name=\"modname\" value=\"{$key}\">"; 138 $action .= "<input type=\"hidden\" name=\"modversion\" value=\"{$mod['version']}\">"; 139 $action .= "<input type=\"hidden\" name=\"modaction\" value=\"upgrade\">"; 140 $action .= "<input type=\"submit\" name=\"submit\" value=\""._("Upgrade")."\">"; 141 $action .= "</form>"; 126 142 } else if($mod['status'] == -1){ 127 143 $status = _("Broken"); … … 376 392 } 377 393 394 function upgradeModule($module) { 395 if(is_file("modules/$module/install.php")) 396 include "modules/$module/install.php"; 397 } 398 378 399 ?> 379 400
