2011-01-19 Miguel de Dios <miguel.dedios@artica.es>
* godmode/agentes/module_manager.php: added to call to enterprise functions to delete "pseudo code" of local module when delete in multiple delete action. Fixes: #3161621 * include/functions_filemanager.php: cleaned source code old unused comments. * include/functions_ui.php: in function "printTruncateText" fixed when pass 0 character to trunk, now return all text. And in function "print_agent_name" cleaned source code style. * operation/agentes/estado_agente.php: fixed order of params in the call of function "print_agent_name". git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3751 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
3a02320e3f
commit
7c6b945524
|
@ -1,3 +1,21 @@
|
|||
2011-01-19 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* godmode/agentes/module_manager.php: added to call to enterprise functions
|
||||
to delete "pseudo code" of local module when delete in multiple delete
|
||||
action.
|
||||
|
||||
Fixes: #3161621
|
||||
|
||||
* include/functions_filemanager.php: cleaned source code old unused
|
||||
comments.
|
||||
|
||||
* include/functions_ui.php: in function "printTruncateText" fixed when pass
|
||||
0 character to trunk, now return all text. And in function
|
||||
"print_agent_name" cleaned source code style.
|
||||
|
||||
* operation/agentes/estado_agente.php: fixed order of params in the call
|
||||
of function "print_agent_name".
|
||||
|
||||
2011-01-19 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* include/functions_visual_map.php,
|
||||
|
|
|
@ -91,6 +91,9 @@ if ($multiple_delete) {
|
|||
exit;
|
||||
}
|
||||
|
||||
enterprise_include_once('include/functions_config_agents.php');
|
||||
enterprise_hook('deleteLocalModuleInConf', array(get_agentmodule_agent($id_agent_module_del), get_agentmodule_name($id_agent_module_del)));
|
||||
|
||||
//Init transaction
|
||||
$error = 0;
|
||||
process_sql_begin ();
|
||||
|
|
|
@ -392,18 +392,12 @@ function read_recursive_dir($dir, $relative_path = '') {
|
|||
{
|
||||
while (false !== ($entry = readdir($handle))) {
|
||||
if (($entry != ".") && ($entry != "..")) {
|
||||
|
||||
// debugPrint($entry);
|
||||
// debugPrint($return);
|
||||
|
||||
if (is_dir($dir . $entry))
|
||||
{
|
||||
// debugPrint('dir');
|
||||
$return = array_merge($return, read_recursive_dir($dir . $entry . '/', $relative_path . $entry . '/' ));
|
||||
}
|
||||
else
|
||||
{
|
||||
// debugPrint('file');
|
||||
$return[] = array('relative' => $relative_path . $entry, 'absolute' => $dir . $entry);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,13 +31,22 @@
|
|||
* @param string $suffix String at the end of a strimmed string.
|
||||
*/
|
||||
function printTruncateText($text, $numChars = 25, $showTextInAToopTip = true, $return = true, $showTextInTitle = true, $suffix = '[…]') {
|
||||
if ($numChars == 0) {
|
||||
if ($return == true) {
|
||||
return $text;
|
||||
}
|
||||
else {
|
||||
echo $text;
|
||||
}
|
||||
}
|
||||
|
||||
$text = safe_output_html($text);
|
||||
if ((strlen($text)) > ($numChars)) {
|
||||
$l=intval(($numChars-3)/2); // '/2' because [...] is in the middle of the word.
|
||||
$truncateText2 = mb_strimwidth($text, (strlen($text)-$l), strlen($text));
|
||||
$half_lenght = intval(($numChars - 3) / 2); // '/2' because [...] is in the middle of the word.
|
||||
$truncateText2 = mb_strimwidth($text, (strlen($text) - $half_lenght), strlen($text));
|
||||
// In case $numChars were an odd number.
|
||||
$l=$numChars-$l-3;
|
||||
$truncateText = mb_strimwidth($text, 0, $l) . $suffix;
|
||||
$half_lenght = $numChars - $half_lenght - 3;
|
||||
$truncateText = mb_strimwidth($text, 0, $half_lenght) . $suffix;
|
||||
$truncateText=$truncateText . $truncateText2;
|
||||
|
||||
if ($showTextInTitle) {
|
||||
|
@ -350,7 +359,7 @@ function print_os_icon ($id_os, $name = true, $return = false) {
|
|||
function print_agent_name ($id_agent, $return = false, $cutoff = 0, $style = '', $cutname = false) {
|
||||
$agent_name = (string) get_agent_name ($id_agent);
|
||||
$agent_name_full = $agent_name;
|
||||
if($cutname) {
|
||||
if ($cutname) {
|
||||
$agent_name = printTruncateText($agent_name, $cutoff);
|
||||
}
|
||||
$output = '<a style="' . $style . '" href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$id_agent.'" title="'.$agent_name_full.'"><b>'.$agent_name.'</b></a>';
|
||||
|
|
|
@ -297,7 +297,7 @@ foreach ($agents as $agent) {
|
|||
$data[0] .= '</a> ';
|
||||
}
|
||||
|
||||
$data[0] .= print_agent_name ($agent["id_agente"], true, "none", '', 23);
|
||||
$data[0] .= print_agent_name($agent["id_agente"], true, 0, 'none', true);
|
||||
|
||||
$data[1] = print_os_icon ($agent["id_os"], false, true);
|
||||
|
||||
|
|
Loading…
Reference in New Issue