1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-29 19:00:26 +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'>
<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>
</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'>
<fieldset id='core-db-verify-sql-tables'>
<legend>".DBVLAN_14."</legend>
<table class='table adminlist'>
<table class='table table-striped adminlist'>
<colgroup>
<col style='width: 100%'></col>
</colgroup>
<thead>
<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>
</thead>
<tbody>
";
foreach(array_keys($this->tables) as $x)
foreach(array_keys($this->tables) as $t=>$x)
{
$text .= "
<tr>
<td>".$frm->checkbox('verify_table[]', $x,false,'label='.$x)."</td>
<td>".$frm->checkbox('verify_table['.$t.']', $x, false, array('label'=>$x))."</td>
</tr>
";
}

View File

@@ -1504,11 +1504,11 @@ class e_form
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;
if($id) $id = $this->name2id($id);
return $this->checkbox($name, $selector, false, array('id' => $id,'class' => 'checkbox checkbox-inline toggle-all','label'=>$label));
}

View File

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