21 if (empty($blocname)) {
22 print
"Error, template page can't be called as URL";
27 if (isset($parameters[
'showblocbydefault'])) {
28 $hide = (empty($parameters[
'showblocbydefault']) ? true :
false);
30 if (isset($object->extraparams[$blocname][
'showhide'])) {
31 $hide = (empty($object->extraparams[$blocname][
'showhide']) ? true :
false);
35 <!-- BEGIN PHP TEMPLATE bloc_showhide.tpl.php -->
38 print
'<script>'.
"\n";
39 print
'$(document).ready(function() {'.
"\n";
40 print
'$("#hide-'.$blocname.
'").click(function(){'.
"\n";
41 print
' setShowHide(0);'.
"\n";
42 print
' $("#'.$blocname.
'_bloc").hide("blind", {direction: "vertical"}, 300).removeClass("nohideobject");'.
"\n";
43 print
' $(this).hide();'.
"\n";
44 print
' $("#show-'.$blocname.
'").show();'.
"\n";
47 print
'$("#show-'.$blocname.
'").click(function(){'.
"\n";
48 print
' setShowHide(1);'.
"\n";
49 print
' $("#'.$blocname.
'_bloc").show("blind", {direction: "vertical"}, 300).addClass("nohideobject");'.
"\n";
50 print
' $(this).hide();'.
"\n";
51 print
' $("#hide-'.$blocname.
'").show();'.
"\n";
54 print
'function setShowHide(status) {'.
"\n";
55 print
' var id = '.$object->id.
";\n";
56 print
" var element = '".$object->element.
"';\n";
57 print
" var htmlelement = '".$blocname.
"';\n";
58 print
' var type = "showhide";'.
"\n";
59 print
' $.get("'.dol_buildpath(
'/core/ajax/extraparams.php', 1);
60 print
'?id="+id+"&element="+element+"&htmlelement="+htmlelement+"&type="+type+"&value="+status);'.
"\n";
64 print
'</script>'.
"\n";
66 print
'<div style="float:right; position: relative; top: 3px; right:5px;" id="hide-'.$blocname.
'"';
67 print
' class="linkobject'.($hide ?
' hideobject' :
'').
'">'.
img_picto(
'',
'1uparrow.png').
'</div>'.
"\n";
68 print
'<div style="float:right; position: relative; top: 3px; right:5px;" id="show-'.$blocname.
'"';
69 print
' class="linkobject'.($hide ?
'' :
' hideobject').
'">'.
img_picto(
'',
'1downarrow.png').
'</div>'.
"\n";
70 print
'<div id="'.$blocname.
'_title" class="liste_titre">'.$title.
'</div>'.
"\n";
71 print
'<div id="'.$blocname.
'_bloc" class="'.($hide ?
'hideobject' :
'nohideobject').
'">'.
"\n";
73 include DOL_DOCUMENT_ROOT.
'/core/tpl/'.$blocname.
'.tpl.php';
76 <!-- END PHP TEMPLATE BLOC SHOW/HIDE -->
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)