Changeset 11024

Show
Ignore:
Timestamp:
01/19/11 14:49:43 (2 years ago)
Author:
p_lindheimer
Message:

adds a Page Refresh the Advanced Settings page, also makes refresh automatic when changing display settings if no pending updates exist

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/branches/2.9/core/advancedsettings.js

    r11014 r11024  
    4141        if (data.saved) { 
    4242          mythis.parent().delay(500).fadeOut(); 
    43         } 
    44          
     43          mythis.unbind('click', savebinder); 
     44 
     45          // If they changed the page layout 
     46          switch (mykey) { 
     47          case 'AS_DISPLAY_DETAIL_LEVEL': 
     48          case 'AS_DISPLAY_HIDDEN_SETTINGS': 
     49          case 'AS_DISPLAY_READONLY_SETTINGS': 
     50            if (page_reload_check()) { 
     51              location.href=location.href; 
     52            } else { 
     53              alert(msgChangesRefresh); 
     54            } 
     55          break; 
     56          } 
     57        } 
    4558        //reset data-valueinput-orig to new value 
    4659        switch (mythis.attr('data-type')) { 
     
    5669        alert('Ajax Web ERROR: When saving key ' + mykey + ': ' + textStatus); 
    5770      } 
    58      
    5971    }) 
    6072  } 
     
    8799    } 
    88100  }) 
    89  
     101  $("#page_reload").click(function(){ 
     102      if (!page_reload_check()) { 
     103        if (!confirm(msgUnsavedChanges)) { 
     104          return false; 
     105        } 
     106      } 
     107      location.href=location.href; 
     108  }); 
    90109}); 
    91110 
     111function page_reload_check(msgUnsavedChanges) { 
     112  var reload = true; 
     113  $(".save").each(function() { 
     114    if ($(this).data("events") != undefined) { 
     115      reload = false; 
     116      return false; 
     117    } 
     118  }); 
     119  return reload; 
     120} 
  • modules/branches/2.9/core/page.advancedsettings.php

    r11014 r11024  
    2424  echo '<script type="text/javascript">'; 
    2525  echo 'can_write_amportalconf = ' . $amportal_canwrite . '; '; 
    26   echo 'amportalconf_error ="' . _("You must run 'amportal restart' from the Linux command line before you can save setting here.") . '"'; 
     26  echo 'amportalconf_error = "' . _("You must run 'amportal restart' from the Linux command line before you can save setting here.") . '";'; 
     27  echo 'msgUnsavedChanges = "' . _("You have un-saved changes, press OK to disregard changes and reload page or Cancel to abort.") . '";'; 
     28  echo 'msgChangesRefresh = "' . _("Your Display settings have been changed, click on 'Refresh Page' to view the affects of your changes once you have saved other outstanding changes that are still un-confirmed.") . '";'; 
    2729  echo '</script>'; 
    2830   
     
    127129 
    128130// Ugly, but I need to display the whole help text within the page     
    129 echo "<br><br><br><br></div>"; 
     131?> 
     132<br /><br /> <br /> 
     133<input type="button" id="page_reload" value="Refresh Page"/> 
     134<br /><br /><br /><br /></div> 
    130135 
    131 ?>