* Copyright (C) 2013 Laurent Destailleur * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ // Protection to avoid direct call of template if (empty($blocname)) { print "Error, template page can't be called as URL"; exit; } $hide = true; // Hide by default if (isset($parameters['showblocbydefault'])) { $hide = (empty($parameters['showblocbydefault']) ? true : false); } if (isset($object->extraparams[$blocname]['showhide'])) { $hide = (empty($object->extraparams[$blocname]['showhide']) ? true : false); } ?> '."\n"; print '$(document).ready(function() {'."\n"; print '$("#hide-'.$blocname.'").click(function(){'."\n"; print ' setShowHide(0);'."\n"; print ' $("#'.$blocname.'_bloc").hide("blind", {direction: "vertical"}, 300).removeClass("nohideobject");'."\n"; print ' $(this).hide();'."\n"; print ' $("#show-'.$blocname.'").show();'."\n"; print '});'."\n"; print '$("#show-'.$blocname.'").click(function(){'."\n"; print ' setShowHide(1);'."\n"; print ' $("#'.$blocname.'_bloc").show("blind", {direction: "vertical"}, 300).addClass("nohideobject");'."\n"; print ' $(this).hide();'."\n"; print ' $("#hide-'.$blocname.'").show();'."\n"; print '});'."\n"; print 'function setShowHide(status) {'."\n"; print ' var id = '.$object->id.";\n"; print " var element = '".$object->element."';\n"; print " var htmlelement = '".$blocname."';\n"; print ' var type = "showhide";'."\n"; print ' $.get("'.dol_buildpath('/core/ajax/extraparams.php', 1); print '?id="+id+"&element="+element+"&htmlelement="+htmlelement+"&type="+type+"&value="+status);'."\n"; print '}'."\n"; print '});'."\n"; print ''."\n"; print '
'.img_picto('', '1uparrow.png').'
'."\n"; print '
'.img_picto('', '1downarrow.png').'
'."\n"; print '
'.$title.'
'."\n"; print '
'."\n"; include DOL_DOCUMENT_ROOT.'/core/tpl/'.$blocname.'.tpl.php'; print '

'; ?>