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