1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-03 05:07:27 +02:00

Fixes #1020 - checkall was failing.

This commit is contained in:
Cameron
2015-07-18 20:40:14 -07:00
parent e0f56d3641
commit 23a5be23eb
4 changed files with 14 additions and 11 deletions

View File

@@ -1105,7 +1105,7 @@ class system_tools
{ {
$text .= "<div class='pull-left' style='width:50%;padding-bottom:10px'> $text .= "<div class='pull-left' style='width:50%;padding-bottom:10px'>
<a class='btn btn-large pull-left' style='margin-right:10px' href='".e_SELF."?mode=".$key."' title=\"".$val['label']."\">".ADMIN_EXECUTE_ICON."</a> <a class='btn btn-default btn-large pull-left' style='margin-right:10px' href='".e_SELF."?mode=".$key."' title=\"".$val['label']."\">".ADMIN_EXECUTE_ICON."</a>
<h4 style='margin-bottom:3px'><a href='".e_SELF."?mode=".$key."' title=\"".$val['label']."\">".$val['label']."</a></h4><small>".$val['diz']."</small> <h4 style='margin-bottom:3px'><a href='".e_SELF."?mode=".$key."' title=\"".$val['label']."\">".$val['label']."</a></h4><small>".$val['diz']."</small>
</div>"; </div>";

View File

@@ -941,23 +941,23 @@ class db_verify
<form method='post' action='".e_SELF.(e_QUERY ? '?'.e_QUERY : '')."' id='core-db-verify-sql-tables-form'> <form method='post' action='".e_SELF.(e_QUERY ? '?'.e_QUERY : '')."' id='core-db-verify-sql-tables-form'>
<fieldset id='core-db-verify-sql-tables'> <fieldset id='core-db-verify-sql-tables'>
<legend>".DBVLAN_14."</legend> <legend>".DBVLAN_14."</legend>
<table class='table adminlist'> <table class='table table-striped adminlist'>
<colgroup> <colgroup>
<col style='width: 100%'></col> <col style='width: 100%'></col>
</colgroup> </colgroup>
<thead> <thead>
<tr> <tr>
<th class='last'>".$frm->checkbox_toggle('check-all-verify', 'verify_table',false,LAN_CHECKALL.' | '.LAN_UNCHECKALL)."</th> <th class='first form-inline'><label for='check-all-verify-jstarget-verify-table'>".$frm->checkbox_toggle('check-all-verify', 'verify_table', false )." ".LAN_CHECKALL.' | '.LAN_UNCHECKALL."</label></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
"; ";
foreach(array_keys($this->tables) as $x) foreach(array_keys($this->tables) as $t=>$x)
{ {
$text .= " $text .= "
<tr> <tr>
<td>".$frm->checkbox('verify_table[]', $x,false,'label='.$x)."</td> <td>".$frm->checkbox('verify_table['.$t.']', $x, false, array('label'=>$x))."</td>
</tr> </tr>
"; ";
} }

View File

@@ -1504,7 +1504,7 @@ class e_form
return $this->checkbox($name, $value, $checked).$this->label($label ? $label : LAN_ENABLED, $name, $value); return $this->checkbox($name, $value, $checked).$this->label($label ? $label : LAN_ENABLED, $name, $value);
} }
function checkbox_toggle($name, $selector = 'multitoggle', $id = false, $label='') function checkbox_toggle($name, $selector = 'multitoggle', $id = false, $label='') //TODO Fixme - labels will break this. Don't use checkbox, use html.
{ {
$selector = 'jstarget:'.$selector; $selector = 'jstarget:'.$selector;
if($id) $id = $this->name2id($id); if($id) $id = $this->name2id($id);

View File

@@ -539,15 +539,18 @@ $(document).ready(function()
// Check-All checkbox toggle // Check-All checkbox toggle
$("input.toggle-all").click(function(evt) { $("input.toggle-all").click(function(evt) {
var selector = 'input[type="checkbox"].checkbox'; var selector = 'input[type="checkbox"].checkbox';
if($(this).val().indexOf('jstarget:') === 0) { if($(this).val().indexOf('jstarget:') === 0) {
selector = 'input[type="checkbox"][name^="' + $(this).val().split(/jstarget\:/)[1] + '"]'; selector = 'input[type="checkbox"][name^="' + $(this).val().split(/jstarget\:/)[1] + '"]';
} }
if($(this).is(":checked")){ if($(this).is(":checked")){
$(selector).attr("checked", "checked"); //$(selector).attr("checked", "checked");
$(selector).prop('checked', true);
} }
else{ else{
$(selector).removeAttr("checked"); $(selector).prop('checked',false);
// $(selector).removeAttr("checked");
} }
}); });