Changeset 9961

Show
Ignore:
Timestamp:
06/26/10 11:17:47 (2 years ago)
Author:
p_lindheimer
Message:

closes #4376 setting repository select box to extended if such modules are present, also changes 'type' form tool to what ever is currently selected

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/branches/2.8/amp_conf/htdocs/admin/page.modules.php

    r9043 r9961  
    116116  function process_module_actions(actions) { 
    117117    freepbx_modal_show('moduleBox'); 
    118    urlStr = "config.php?type=tool&amp;display=modules&amp;extdisplay=process&amp;quietmode=1&amp;module_repo=<?php echo $module_repo ?>"; 
     118    urlStr = "config.php?type=<?php echo $type ?>&amp;display=modules&amp;extdisplay=process&amp;quietmode=1&amp;module_repo=<?php echo $module_repo ?>"; 
    119119    for (var i in actions) { 
    120120      urlStr += "&amp;moduleaction["+i+"]="+actions[i]; 
     
    126126    freepbx_modal_hide('moduleBox'); 
    127127    if (goback) { 
    128      location.href = 'config.php?display=modules&amp;type=tool&amp;online=<?php echo ($_REQUEST['online']?1:0); ?>'; 
     128      location.href = 'config.php?display=modules&amp;type=<?php echo $type ?>&amp;online=<?php echo ($_REQUEST['online']?1:0); ?>'; 
    129129    } 
    130130  } 
     
    280280      echo "\t<a href=\"#\" onclick=\"parent.close_module_actions(true);\" />"._("Return")."</a>"; 
    281281    } else { 
    282       echo "\t<input type=\"button\" value=\""._("Return")."\" onclick=\"location.href = 'config.php?display=modules&amp;type=tool&amp;online=".($_REQUEST['online']?1:0)."';\" />"; 
     282      echo "\t<input type=\"button\" value=\""._("Return")."\" onclick=\"location.href = 'config.php?display=modules&amp;type=$type&amp;online=".($_REQUEST['online']?1:0)."';\" />"; 
    283283    echo "</div>"; 
    284284    } 
     
    447447      echo "<p>"._("Please select at least one action to perform by clicking on the module, and selecting an action on the \"Action\" tab.")."</p>"; 
    448448    } 
    449     echo "\t<input type=\"button\" value=\""._("Cancel")."\" onclick=\"location.href = 'config.php?display=modules&amp;type=tool&amp;online=".($_REQUEST['online']?1:0)."';\" />"; 
     449    echo "\t<input type=\"button\" value=\""._("Cancel")."\" onclick=\"location.href = 'config.php?display=modules&amp;type=$type&amp;online=".($_REQUEST['online']?1:0)."';\" />"; 
    450450    echo "</form>"; 
    451451     
     
    456456      displayRepoSelect(); 
    457457    } 
    458     echo "| <a href='config.php?display=modules&amp;type=tool'>"._("Manage local modules")."</a>\n"; 
     458    echo "| <a href='config.php?display=modules&amp;type=$type'>"._("Manage local modules")."</a>\n"; 
    459459    if (!EXTERNAL_PACKAGE_MANAGEMENT) { 
    460       echo " | <a class='info check_updates' href='config.php?display=modules&type=tool&online=1&module_repo=$module_repo'>"._("Check for updates online")."<span>"._("Checking for updates will transmit your FreePBX and Asterisk version numbers along with a unique but random identifier. This is used to provide proper update information and track version usage to focus development and maintenance efforts. No private information is transmitted.")."</span></a>\n"; 
     460      echo " | <a class='info check_updates' href='config.php?display=modules&type=$type&online=1&module_repo=$module_repo'>"._("Check for updates online")."<span>"._("Checking for updates will transmit your FreePBX and Asterisk version numbers along with a unique but random identifier. This is used to provide proper update information and track version usage to focus development and maintenance efforts. No private information is transmitted.")."</span></a>\n"; 
    461461    } 
    462462         
    463463    if (isset($_FILES['uploadmod']) && !empty($_FILES['uploadmod']['name'])) { 
    464464      // display upload link, only if they did upload something 
    465       echo " | <a href='config.php?display=modules&type=tool&extdisplay=upload'>"._("Upload module")."</a><br />\n"; 
     465      echo " | <a href='config.php?display=modules&type=$type&extdisplay=upload'>"._("Upload module")."</a><br />\n"; 
    466466       
    467467      $res = module_handleupload($_FILES['uploadmod']); 
     
    472472             '<ul><li>'.implode('</li><li>',$res).'</li></ul>'); 
    473473        echo sprintf(_('You should fix the problem or select another file and %s.'),  
    474              "<a href='config.php?display=modules&amp;type=tool'>"._("try again")."</a>"); 
     474             "<a href='config.php?display=modules&amp;type=$type'>"._("try again")."</a>"); 
    475475        echo "</p></div>\n"; 
    476476      } else { 
    477477         
    478478        echo "<p>".sprintf(_("Module uploaded successfully. You need to enable the module using %s to make it available."), 
    479              "<a href='config.php?display=modules&amp;type=tool'>"._("local module administration")."</a>") 
     479             "<a href='config.php?display=modules&amp;type=$type'>"._("local module administration")."</a>") 
    480480           ."</p>\n"; 
    481481      } 
     
    508508       
    509509      if (!EXTERNAL_PACKAGE_MANAGEMENT) { 
    510         echo "<a href='config.php?display=modules&amp;type=tool&amp;online=0'>"._("Manage local modules")."</a>\n"; 
     510        echo "<a href='config.php?display=modules&amp;type=$type&amp;online=0'>"._("Manage local modules")."</a>\n"; 
    511511        echo "<input type=\"checkbox\" id=\"show_upgradable_only\" onclick=\"showhide_upgrades();\" /><label for=\"show_upgradable_only\">"._("Show only upgradeable")."</label>"; 
    512512      } 
     
    514514      if (!EXTERNAL_PACKAGE_MANAGEMENT) { 
    515515        displayRepoSelect(); 
    516         echo " | <a class='info check_updates' href='config.php?display=modules&amp;type=tool&amp;online=1&amp;module_repo=$module_repo'>"._("Check for updates online")."<span>"._("Checking for updates will transmit your FreePBX and Asterisk version numbers along with a unique but random identifier. This is used to provide proper update information and track version usage to focus development and maintenance efforts. No private information is transmitted.")."</span></a>\n"; 
    517       } 
    518       echo " | <a href='config.php?display=modules&type=tool&extdisplay=upload'>"._("Upload module")."</a><br />\n"; 
     516        echo " | <a class='info check_updates' href='config.php?display=modules&amp;type=$type&amp;online=1&amp;module_repo=$module_repo'>"._("Check for updates online")."<span>"._("Checking for updates will transmit your FreePBX and Asterisk version numbers along with a unique but random identifier. This is used to provide proper update information and track version usage to focus development and maintenance efforts. No private information is transmitted.")."</span></a>\n"; 
     517      } 
     518      echo " | <a href='config.php?display=modules&type=$type&extdisplay=upload'>"._("Upload module")."</a><br />\n"; 
    519519    } 
    520520 
     
    545545 
    546546    $category = false; 
     547    $has_extended_modules = false; 
    547548    $numdisplayed = 0; 
    548549    $fd = $amp_conf['ASTETCDIR'].'/freepbx_module_admin.conf'; 
     
    603604       
    604605      echo "\t\t\t<span class=\"modulestatus\">"; 
     606      if (!$has_extended_modules && $category == 'Third Party Addon') { 
     607        $has_extended_modules = true; 
     608      } 
    605609      switch ($modules[$name]['status']) { 
    606610        case MODULE_STATUS_NOTINSTALLED: 
     
    828832 
    829833    echo "</form>"; 
     834    if ($has_extended_modules) { 
     835?> 
     836  <script language="javascript"> 
     837  <!-- Begin 
     838 
     839  $(document).ready(function(){ 
     840    $("#module_repo").val('extended'); 
     841    $('.check_updates').attr('href','config.php?display=modules&type=<?php echo $type ?>&online=1&module_repo=extended'); 
     842  }); 
     843 
     844  // End --> 
     845  </script> 
     846<?php 
     847    } 
    830848  break; 
    831849} 
     
    938956 
    939957function displayRepoSelect() { 
     958  global $type; 
    940959?> 
    941960  <select name="module_repo" id="module_repo"> 
     
    948967  $(document).ready(function(){ 
    949968    $("#module_repo").change(function(){ 
    950    $('.check_updates').attr('href','config.php?display=modules&type=tool&online=1&module_repo='+this.value); 
     969    $('.check_updates').attr('href','config.php?display=modules&type=<?php echo $type ?>&online=1&module_repo='+this.value); 
    951970    if (this.value == "extended") { 
    952971      alert("<?php echo _("You have selected to access the Extended Repository. This repository contains some Third Party and un-supported modules. Although these modules are believed to work with FreePBX, they are either developed by third parties in conjunction with optional PBX components, or they are not directly sponsored by the core FreePBX team and may not receive the same level of responsiveness to issues as the main code base does.") ?>");