2013-04-25 Miguel de Dios <miguel.dedios@artica.es>

* extensions/agents_modules.php: changed the header of the table
	agents modules, now it uses css3 (and some tricks in javascript)
	and the text for the modules is vertical.
	
	Fixes: #3539424
	
	* operation/integria_incidents/incident.list.php,
	operation/search_users.getdata.php,
	godmode/servers/manage_recontask_form.php,
	godmode/massive/massive_delete_action_alerts.php,
	godmode/modules/manage_network_components_form.php: improved the
	source code style.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8059 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2013-04-25 15:34:53 +00:00
parent 4889cbe92c
commit 3ad9dd799d
7 changed files with 91 additions and 25 deletions

View File

@ -1,3 +1,18 @@
2013-04-25 Miguel de Dios <miguel.dedios@artica.es>
* extensions/agents_modules.php: changed the header of the table
agents modules, now it uses css3 (and some tricks in javascript)
and the text for the modules is vertical.
Fixes: #3539424
* operation/integria_incidents/incident.list.php,
operation/search_users.getdata.php,
godmode/servers/manage_recontask_form.php,
godmode/massive/massive_delete_action_alerts.php,
godmode/modules/manage_network_components_form.php: improved the
source code style.
2013-04-25 Ramon Novoa <rnovoa@artica.es> 2013-04-25 Ramon Novoa <rnovoa@artica.es>
* images/cross_double.png, * images/cross_double.png,

View File

@ -90,7 +90,9 @@ function mainAgentsModules() {
(string)SECONDS_2MINUTES => __('2 minutes'), (string)SECONDS_2MINUTES => __('2 minutes'),
(string)SECONDS_5MINUTES => __('5 minutes'), (string)SECONDS_5MINUTES => __('5 minutes'),
(string)SECONDS_10MINUTES => __('10 minutes')), (string)SECONDS_10MINUTES => __('10 minutes')),
'refr', (int)get_parameter('refr', 0), $script = 'this.form.submit()', '', 0, true, false, false, '', false, 'width: 100px; margin-right: 10px; margin-top: 5px;'); 'refr', (int)get_parameter('refr', 0),
$script = 'this.form.submit()', '', 0, true, false, false, '',
false, 'width: 100px; margin-right: 10px; margin-top: 5px;');
$comborefr .= "</form>"; $comborefr .= "</form>";
if ($config["pure"] == 0) { if ($config["pure"] == 0) {
@ -168,13 +170,16 @@ function mainAgentsModules() {
return; return;
} }
echo '<table cellpadding="4" cellspacing="4" border="0" width=98%>'; echo '<table cellpadding="4" cellspacing="4" border="0">';
echo "<th width='140px' height='25px'>".__("Agents")." / ".__("Modules")."</th>"; echo "<tr>";
echo "<th width='140px' height='25px' valign='bottom' style='text-align: right !important;'>" . __("Agents") . " / " . __("Modules") . "</th>";
if ($hor_offset > 0) { if ($hor_offset > 0) {
$new_hor_offset = $hor_offset-$block; $new_hor_offset = $hor_offset-$block;
echo "<th width='20px' style='vertical-align:top; padding-top: 35px;' rowspan='".($nagents+1)."'><a href='index.php?sec=extensions&sec2=extensions/agents_modules&refr=0&hor_offset=".$new_hor_offset."&offset=".$offset."&group_id=".$group_id."&modulegroup=".$modulegroup."'>".html_print_image("images/darrowleft.png",true, array('title' => __('Previous modules')))."</a> </th>"; echo "<th width='20px' style='vertical-align:top; padding-top: 35px;' rowspan='" . ($nagents + 1) . "'>" .
"<a href='index.php?sec=extensions&sec2=extensions/agents_modules&refr=0&hor_offset=" . $new_hor_offset . "&offset=".$offset."&group_id=".$group_id."&modulegroup=".$modulegroup."'>".html_print_image("images/darrowleft.png",true, array('title' => __('Previous modules')))."</a> </th>";
} }
$nmodules = 0; $nmodules = 0;
foreach ($modules_by_name as $module) { foreach ($modules_by_name as $module) {
@ -184,7 +189,15 @@ function mainAgentsModules() {
continue; continue;
} }
echo '<th width="20px" >'. html_print_image('images/information.png', true, array('title' => io_safe_output($module['name']))) ."</th>"; $text = ui_print_truncate_text(io_safe_output($module['name']), 'module_small');
echo '<th align="center" width="20px" id="th_module_r_' . $nmodules . '" class="th_class_module_r">
<div style="width: 30px;">
<div id="div_module_r_' . $nmodules . '" style="display: none;" class="rotate_text_module">' .
$text .
'</div>
</div>
</th>';
} }
if (($hor_offset + $block) < $nmodules) { if (($hor_offset + $block) < $nmodules) {
@ -192,6 +205,8 @@ function mainAgentsModules() {
echo "<th width='20px' style='vertical-align:top; padding-top: 35px;' rowspan='".($nagents+1)."'><a href='index.php?sec=extensions&sec2=extensions/agents_modules&hor_offset=".$new_hor_offset."&offset=".$offset."&group_id=".$group_id."&modulegroup=".$modulegroup."'>".html_print_image("images/darrowright.png",true, array('title' => __('More modules')))."</a> </th>"; echo "<th width='20px' style='vertical-align:top; padding-top: 35px;' rowspan='".($nagents+1)."'><a href='index.php?sec=extensions&sec2=extensions/agents_modules&hor_offset=".$new_hor_offset."&offset=".$offset."&group_id=".$group_id."&modulegroup=".$modulegroup."'>".html_print_image("images/darrowright.png",true, array('title' => __('More modules')))."</a> </th>";
} }
echo "</tr>";
$filter_agents = false; $filter_agents = false;
if ($group_id > 0) { if ($group_id > 0) {
$filter_agents = array('id_grupo' => $group_id); $filter_agents = array('id_grupo' => $group_id);
@ -307,6 +322,42 @@ function mainAgentsModules() {
'</li>' . '</li>' .
"</ul>" . "</ul>" .
"</p>"; "</p>";
echo "
<style type='text/css'>
.rotate_text_module {
-webkit-transform: rotate(270deg);
-moz-transform: rotate(270deg);
-o-transform: rotate(270deg);
writing-mode: lr-tb;
white-space: nowrap;
}
</style>
<script type='text/javascript'>
$(document).ready(function () {
//Get max width of name of modules
max_width = 0;
$.each($('.th_class_module_r'), function (i, elem) {
id = $(elem).attr('id').replace('th_module_r_', '');
width = $(\"#div_module_r_\" + id).width();
if (max_width < width) {
max_width = width;
}
});
$.each($('.th_class_module_r'), function (i, elem) {
id = $(elem).attr('id').replace('th_module_r_', '');
$(\"#th_module_r_\" + id).height(($(\"#div_module_r_\" + id).width() + 10) + 'px');
console.log($(\"#div_module_r_\" + id).width());
//$(\"#div_module_r_\" + id).css('margin-top', (max_width - $(\"#div_module_r_\" + id).width()) + 'px');
$(\"#div_module_r_\" + id).css('margin-top', (max_width - 20) + 'px');
$(\"#div_module_r_\" + id).show();
});
});
</script>
";
} }
extensions_add_operation_menu_option(__("Agents/Modules view"), 'estado', 'agents_modules/icon_menu.png', "v1r1"); extensions_add_operation_menu_option(__("Agents/Modules view"), 'estado', 'agents_modules/icon_menu.png', "v1r1");