Commit 5a539802 authored by mcramer's avatar mcramer
Browse files

Fixed: Some templates used changeTab in a way that was not compatible with the...

Fixed: Some templates used changeTab in a way that was not compatible with the new options to discard changes on changeTab
parent 08a328b7
<div class="pnl_toolsarea">
c<div class="pnl_toolsarea">
<fieldset><legend>{tmpl_var name="toolsarea_head_txt"}</legend>
<div class="buttons topbuttons">
<button class="button iconstxt icoAdd" type="button" onClick="loadContent('dns/dns_a_edit.php?zone={tmpl_var name='parent_id'}');"><span>A</span></button>
......@@ -37,7 +37,7 @@
<td class="tbl_col_aux"><input type="text" name="search_aux" value="{tmpl_var name='search_aux'}" /></td>
<td class="tbl_col_ttl"><input type="text" name="search_ttl" value="{tmpl_var name='search_ttl'}" /></td>
<td class="tbl_col_buttons">
<button type="button" class="button icons16 icoFilter" name="Filter" id="Filter" value="{tmpl_var name="filter_txt"}" onClick="changeTab('dns_records','dns/dns_soa_edit.php');"><span>{tmpl_var name="filter_txt"}</span></button>
<button type="button" class="button icons16 icoFilter" name="Filter" id="Filter" value="{tmpl_var name="filter_txt"}" onclick="return changeTab('dns_records','dns/dns_soa_edit.php');"><span>{tmpl_var name="filter_txt"}</span></button>
</td>
</tr>
</thead>
......
......@@ -306,11 +306,14 @@ function changeTab(tab,target) {
//document.forms[0].next_tab.value = tab;
document.pageForm.next_tab.value = tab;
var id = document.pageForm.id.value;
var idel = jQuery('form#pageForm').find('[name="id"]');
var id = null;
if(idel.length > 0) id = idel.val();
if(tabChangeDiscard == 'y') {
if(id && (pageFormChanged == false || window.confirm(tabChangeDiscardTxt))) {
if((idel.length < 1 || id) && (pageFormChanged == false || window.confirm(tabChangeDiscardTxt))) {
var next_tab = tab;
loadContent(target, {'next_tab': next_tab, 'id': id});
if(id) loadContent(target, {'next_tab': next_tab, 'id': id});
else loadContent(target, {'next_tab': next_tab});
} else {
return false;
}
......@@ -320,8 +323,8 @@ function changeTab(tab,target) {
submitForm('pageForm', target);
} else {
var next_tab = tab;
var id = document.pageForm.id.value;
loadContent(target, {'next_tab': next_tab, 'id': id});
if(id) loadContent(target, {'next_tab': next_tab, 'id': id});
else loadContent(target, {'next_tab': next_tab});
}
} else {
submitForm('pageForm',target);
......
......@@ -20,7 +20,7 @@
<tr class="filter">
<td class="tbl_col_rulename"><input type="text" name="search_rulename" value="{tmpl_var name='search_rulename'}" /></td>
<td class="tbl_col_buttons">
<button type="button" class="button icons16 icoFilter" name="Filter" id="Filter" value="{tmpl_var name="filter_txt"}" onClick="changeTab('filter_records','mail/mail_user_edit.php');"><span>{tmpl_var name="filter_txt"}</span></button>
<button type="button" class="button icons16 icoFilter" name="Filter" id="Filter" value="{tmpl_var name="filter_txt"}" onclick="return changeTab('filter_records','mail/mail_user_edit.php');"><span>{tmpl_var name="filter_txt"}</span></button>
</td>
</tr>
</thead>
......
......@@ -68,9 +68,10 @@ if(isset($details['error'])) $app->error($details['error']);
// Set the active and default tab
$next_tab = 'details';
if(isset($_POST['next_tab']))
if(isset($_POST['next_tab']) || isset($_GET['next_tab']))
{
switch($_POST['next_tab'])
$tab = (isset($_POST['next_tab']) ? $_POST['next_tab'] : $_GET['next_tab']);
switch($tab)
{
case 'details': $next_tab = 'details'; break;
case 'settings': $next_tab = 'settings'; break;
......
......@@ -19,18 +19,18 @@
<input type="hidden" name="next_tab" value="" />
<ul>
<li<tmpl_if name='next_tab' op='==' value='details'> class="active"</tmpl_if>>
<a href="javascript:changeTab('details', 'sites/aps_packagedetails_show.php?id={tmpl_var name='pkg_id'}');">{tmpl_var name='details_txt'}</a>
<a href="#" onclick="return changeTab('details', 'sites/aps_packagedetails_show.php?id={tmpl_var name='pkg_id'}');">{tmpl_var name='details_txt'}</a>
</li>
<tmpl_if name='pkg_screenshots'>
<li<tmpl_if name='next_tab' op='==' value='screenshots'> class="active"</tmpl_if>>
<a href="javascript:changeTab('screenshots', 'sites/aps_packagedetails_show.php?id={tmpl_var name='pkg_id'}');">{tmpl_var name='screenshots_txt'}</a>
<a href="#" onclick="return changeTab('screenshots', 'sites/aps_packagedetails_show.php?id={tmpl_var name='pkg_id'}');">{tmpl_var name='screenshots_txt'}</a>
</li></tmpl_if>
<tmpl_if name='pkg_changelog'>
<li<tmpl_if name='next_tab' op='==' value='changelog'> class="active"</tmpl_if>>
<a href="javascript:changeTab('changelog', 'sites/aps_packagedetails_show.php?id={tmpl_var name='pkg_id'}');">{tmpl_var name='changelog_txt'}</a>
<a href="#" onclick="return changeTab('changelog', 'sites/aps_packagedetails_show.php?id={tmpl_var name='pkg_id'}');">{tmpl_var name='changelog_txt'}</a>
</li></tmpl_if>
<li<tmpl_if name='next_tab' op='==' value='settings'> class="active"</tmpl_if>>
<a href="javascript:changeTab('settings', 'sites/aps_packagedetails_show.php?id={tmpl_var name='pkg_id'}');">{tmpl_var name='settings_txt'}</a>
<a href="#" onclick="return changeTab('settings', 'sites/aps_packagedetails_show.php?id={tmpl_var name='pkg_id'}');">{tmpl_var name='settings_txt'}</a>
</li>
</ul>
</div>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment