diff --git a/html/ajax_misc.php b/html/ajax_misc.php index 704d58c19..7086ea5a5 100644 --- a/html/ajax_misc.php +++ b/html/ajax_misc.php @@ -424,7 +424,7 @@ EOF; from menu_ref where me_code=$1", array($me_code)); if (empty($m)) { - echo HtmlInput::title_box(_("Ce plugin n'existe pas "), $ctl); + echo HtmlInput::title_box(_("Ce plugin n'existe pas "), $ctl,"close","","y"); echo "
"._("Il y a une erreur, ce plugin n'existe pas"). "
"; exit; diff --git a/html/js/scripts.js b/html/js/scripts.js index 9de2e7202..97326f7a4 100644 --- a/html/js/scripts.js +++ b/html/js/scripts.js @@ -25,7 +25,7 @@ */ var ask_reload = 0; var tag_choose = ''; - +var aDraggableElement=new Array(); /** * callback function when we just need to update a hidden div with an info * message @@ -671,11 +671,13 @@ function create_div(obj) else if ( ! obj.effect ){ Effect.Grow(obj.id,{direction:'top-right',duration:0.1}); }*/ if (obj.drag) { - new Draggable(obj.id, {starteffect: function () + aDraggableElement[obj.id]=new Draggable(obj.id, {starteffect: function () { new Effect.Highlight(obj.id, {scroll: window, queue: 'end'}); }} ); + + } return elt; } @@ -2958,4 +2960,22 @@ function alternate_row_color(p_table) } } +} +/** + * Make an DOM element draggable or not + * @param object_id DOM id + */ +function pin (object_id) { + if ( aDraggableElement[object_id]) { + aDraggableElement[object_id].destroy(); + aDraggableElement[object_id]=undefined; + $('pin_'+object_id).firstChild.innerHTML="⊕"; + } else { + aDraggableElement[object_id]=new Draggable(object_id, {starteffect: function () + { + new Effect.Highlight(object_id, {scroll: window, queue: 'end'}); + }} + ); + $('pin_'+object_id).firstChild.innerHTML="❉"; + } } \ No newline at end of file diff --git a/include/lib/html_input.class.php b/include/lib/html_input.class.php index c71c8f39d..eebb6b369 100755 --- a/include/lib/html_input.class.php +++ b/include/lib/html_input.class.php @@ -824,20 +824,43 @@ class HtmlInput * @param type $div element id, except for mode none or custom * @param type $mod hide , close , zoom , custom or none, with * custom , the $name contains all the code - * @param type $p_js contains the javascript with "custom" contains button + code + * @param type $p_js contains the javascript if mod = "custom" or "zoom" contains button + code * @return type */ - static function title_box($name,$div,$mod="close",$p_js="") + static function title_box($p_name,$p_div,$p_mod="close",$p_js="",$p_draggable="y") { - if ($mod=='close') {$r=HtmlInput::anchor_close($div,$p_js); }else - if ($mod=='hide') {$r=HtmlInput::anchor_hide("⨉","$('$div').hide();$p_js");} else - if ($mod=='zoom') {$r=''.'
'.''; } else
- if ( $mod == 'custom') {$r=''.$p_js."";} else
- if ( $mod == 'none') {$r="" ; }
- else
- die (__FILE__.":".__LINE__._('Paramètre invaide'));
- $r.=h2($name,' class="title" ');
- return $r;
+ $r="";
+ if ($p_mod=='close'){
+ $r=HtmlInput::anchor_close($p_div,$p_js);
+
+ }
+ elseif ($p_mod=='zoom') {
+ $r=''.HtmlInput::anchor("⬜","",$p_js,' name="small'.$p_div.'" id="close_div" class="input_text" ').'';
+
+ }
+ elseif ($p_mod=='hide') {
+ $r=HtmlInput::anchor_hide("⨉","$('$p_div').hide();$p_js");
+
+ }
+ elseif ($p_mod=='zoom') {
+ $r=''.'
'.'';
+ }
+ else
+ if ( $p_mod == 'custom')
+ {$r=''.$p_js."";} else
+ if ( $p_mod == 'none') {$r="" ; }
+ else
+ die (__FILE__.":".__LINE__._('Paramètre invaide'));
+
+ if ( $p_draggable=="y") {
+ $drag=sprintf(' ↷ ',
+ $p_div,
+ $p_div);
+ $r.=$drag;
+
+ }
+ $r.=h2($p_name,' class="title" ');
+ return $r;
}
/**
* @brief let you create only a link and set an id on it.
@@ -873,10 +896,12 @@ class HtmlInput
if ($p_js != "")
{
$p_url="javascript:void(0)";
+ } else {
+ $p_url=sprintf('href="%s"',$p_url);
}
- $str=sprintf('%s',
+ $str=sprintf('%s',
$p_style,$p_url,$p_js,$p_text);
return $str;
}
diff --git a/include/template/dashboard.php b/include/template/dashboard.php
index 8fc41b34b..b2dd1adaa 100644
--- a/include/template/dashboard.php
+++ b/include/template/dashboard.php
@@ -3,11 +3,11 @@
//see licence.txt
?>