You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

93 lines
2.3 KiB

<?php
/*
Slovenski narečni atlas / Slovenian dialectal atlas
Copyright (C) 2017 Gregor Šajn
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
if(isset($legend) and $legend)
{
$last = array_pop($legend);
ksort($legend);
array_push($legend,$last);
?>
<div class="info-panel-image-borders legend">
<div class="legend_title text-left" style="font-size:10px">
<strong><span>Legenda</span></strong>
</div>
<table class="table" style="font-size:10px">
<thead>
<tr>
<th class="text-center"><input style="width:10px;height:10px;" type="checkbox" class="toggle_all" checked="1"/></th>
<th class="text-center">Znak</th>
<th class="text-center">Leksem</th>
</tr>
</thead>
<tbody>
<?
foreach($legend as $title=>$row)
{
?>
<tr>
<td class="text-center"><input style="width:10px;height:10px;" type="checkbox" checked="1" id="icons-<?=$row['code_title']?>" class="toggle_icons"/></td>
<td class="text-center SIMBola" style="color:<?=$row['icon_color']?>;"><?=$row['icon']?></td>
<td class="text-center">
<?
if($title=='no_title')
{
echo "ni odgovora";
}
else
{
echo $title;
}
?>
</td>
</tr>
<?
}
?>
</tbody>
</table>
</div>
<?
}
?>
<script type="text/javascript">
$('.toggle_icons').click(function() {
var icons = $(this).attr('id');
$('.'+icons).toggle();
});
$(".toggle_all").click(function () {
if($(this).is(":checked"))
$(".icons_all").show();
else
$(".icons_all").hide();
$('input:checkbox').not(this).prop('checked', this.checked);
});
</script>