Skip to content

Commit

Permalink
Closes #4907 - Improved interface on database table verification form.
Browse files Browse the repository at this point in the history
  • Loading branch information
CaMer0n committed Nov 12, 2022
1 parent ca32c2f commit 4c2ff6c
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 11 deletions.
23 changes: 23 additions & 0 deletions e107_admin/db.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,29 @@ function __construct()

if(isset($_POST['verify_sql']) || !empty($_POST['verify_table']) || varset($_GET['mode']) =='verify_sql')
{
e107::css('inline', "
td.darker { background-color: rgba(0,0,0,0.5) }
");
e107::js('footer-inline', "
$('#core-db-verify-sql-tables input[type=\"checkbox\"]').click(function(evt){
if(this.checked)
{
$(this).closest('td').addClass('darker', 50 );
}
else
{
$(this).closest('td').removeClass('darker', 300 );
}
});
");


e107::getCache()->clear('Dbverify',true);
require_once(e_HANDLER."db_verify_class.php");
$dbv = new db_verify;
Expand Down
66 changes: 55 additions & 11 deletions e107_handlers/db_verify_class.php
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ function renderResults($fileArray=array())
";


$ns->tablerender(DBVLAN_23.' - '.DBVLAN_16, $mes->render().$text);
$ns->tablerender(DBVLAN_23.SEP.DBVLAN_16, $mes->render().$text);

}

Expand Down Expand Up @@ -1221,26 +1221,70 @@ function renderTableSelect()
<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 table-striped adminlist'>
<table class='table table-striped table-hover' >
<colgroup>
<col style='width: 100%'></col>
<col style='width: 33%'></col>
<col style='width: 33%'></col>
<col style='width: 33%'></col>
</colgroup>
<thead>
<tr>
<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>
<th class='first form-inline' colspan='3'><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>
";


$c = 0;
$plg = e107::getPlug();

foreach(array_keys($this->sqlFileTables) as $t=>$x)
{
$text .= "
<tr>
<td>".$frm->checkbox('verify_table['.$t.']', $x, false, array('label'=>$x))."</td>
</tr>
";
if($x !== 'core')
{
$plg->load($x);
if(!$plg->getId()) // no data.
{
$plg->load($x.'_menu');// try menu folder.
}

$icon = $plg->getIcon();
$name = $plg->getName();

}
else
{
$icon = E_16_E107;
$name = LAN_CORE;
}
$text .= ($c === 0) ? "<tr>\n" : '';
$text .= "<td title='".$x."'>".$frm->checkbox('verify_table['.$t.']', $x, false, array('label'=>$icon.' '.$name))."</td>";
$text .= ($c === 2) ? "</tr>\n" : '';

$c++;

if($c > 2)
{
$c = 0;
}

}

while (($c % 3) !== 0)
{
$text .= "<td>&nbsp;</td>\n";
$text .= (($c+1) % 3 == 0) ? "</tr>" : "";
$c++;
}

/* if($c !== 2)
{
$add = (3 - $c) + 1;
$text .= "<td>".$c."</td>";
$text .= "</tr>";
}*/

$text .= "
</tbody>
Expand All @@ -1253,7 +1297,7 @@ function renderTableSelect()
</form>
";

$ns->tablerender(DBVLAN_23.' - '.DBVLAN_16, $mes->render().$text);
$ns->tablerender(DBVLAN_23.SEP.DBVLAN_16, $mes->render().$text);
}


Expand Down

0 comments on commit 4c2ff6c

Please sign in to comment.