Merge pull request #7055 from defrance/patch-16
Let's time to refactoring the tpl folder
This commit is contained in:
commit
7e192559d6
@ -21,43 +21,45 @@ if (isset($parameters['showblocbydefault'])) $hide=(empty($parameters['showblocb
|
|||||||
if (isset($object->extraparams[$blocname]['showhide'])) $hide = (empty($object->extraparams[$blocname]['showhide']) ? true : false);
|
if (isset($object->extraparams[$blocname]['showhide'])) $hide = (empty($object->extraparams[$blocname]['showhide']) ? true : false);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<!-- BEGIN PHP TEMPLATE BLOC SHOW/HIDE -->
|
<!-- BEGIN PHP TEMPLATE BLOC SHOW/HIDE -->
|
||||||
|
|
||||||
<script type="text/javascript">
|
<?php
|
||||||
$(document).ready(function() {
|
print '<script type="text/javascript">'."\n";
|
||||||
$("#hide-<?php echo $blocname ?>").click(function(){
|
print '$(document).ready(function() {'."\n";
|
||||||
setShowHide(0);
|
print '$("#hide-'.$blocname.'").click(function(){'."\n";
|
||||||
$("#<?php echo $blocname ?>_bloc").hide("blind", {direction: "vertical"}, 300).removeClass("nohideobject");
|
print ' setShowHide(0);'."\n";
|
||||||
$(this).hide();
|
print ' $("#'.$blocname.'_bloc").hide("blind", {direction: "vertical"}, 300).removeClass("nohideobject");'."\n";
|
||||||
$("#show-<?php echo $blocname ?>").show();
|
print ' $(this).hide();'."\n";
|
||||||
});
|
print ' $("#show-'.$blocname.'").show();'."\n";
|
||||||
$("#show-<?php echo $blocname ?>").click(function(){
|
print '});'."\n";
|
||||||
setShowHide(1);
|
|
||||||
$("#<?php echo $blocname ?>_bloc").show("blind", {direction: "vertical"}, 300).addClass("nohideobject");
|
|
||||||
$(this).hide();
|
|
||||||
$("#hide-<?php echo $blocname ?>").show();
|
|
||||||
});
|
|
||||||
function setShowHide(status) {
|
|
||||||
var id = <?php echo $object->id; ?>;
|
|
||||||
var element = '<?php echo $object->element; ?>';
|
|
||||||
var htmlelement = '<?php echo $blocname ?>';
|
|
||||||
var type = 'showhide';
|
|
||||||
|
|
||||||
$.get("<?php echo dol_buildpath('/core/ajax/extraparams.php', 1); ?>?id="+id+"&element="+element+"&htmlelement="+htmlelement+"&type="+type+"&value="+status);
|
print '$("#show-'.$blocname.'").click(function(){'."\n";
|
||||||
}
|
print ' setShowHide(1);'."\n";
|
||||||
});
|
print ' $("#'.$blocname.'").show("blind", {direction: "vertical"}, 300).addClass("nohideobject");'."\n";
|
||||||
</script>
|
print ' $(this).hide();'."\n";
|
||||||
|
print ' $("#hide-'.$blocname.'").show();'."\n";
|
||||||
|
print '});'."\n";
|
||||||
|
|
||||||
<div style="float:right; position: relative; top: 3px; right:5px;" id="hide-<?php echo $blocname ?>" class="linkobject<?php echo ($hide ? ' hideobject' : ''); ?>"><?php echo img_picto('', '1uparrow.png'); ?></div>
|
print 'function setShowHide(status) {'."\n";
|
||||||
<div style="float:right; position: relative; top: 3px; right:5px;" id="show-<?php echo $blocname ?>" class="linkobject<?php echo ($hide ? '' : ' hideobject'); ?>"><?php echo img_picto('', '1downarrow.png'); ?></div>
|
print ' var id = '.$object->id."\n";
|
||||||
<div id="<?php echo $blocname ?>_title" class="liste_titre"><?php echo $title; ?></div>
|
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";
|
||||||
|
|
||||||
<div id="<?php echo $blocname ?>_bloc" class="<?php echo ($hide ? 'hideobject' : 'nohideobject'); ?>">
|
print '});'."\n";
|
||||||
|
print '</script>'."\n";
|
||||||
|
|
||||||
<?php include DOL_DOCUMENT_ROOT.'/core/tpl/'.$blocname.'.tpl.php'; ?>
|
print '<div style="float:right; position: relative; top: 3px; right:5px;" id="hide-'.$blocname.'"';
|
||||||
|
print ' class="linkobject'.($hide ? ' hideobject' : '').'">'.img_picto('', '1uparrow.png').'</div>'."\n";
|
||||||
|
print '<div style="float:right; position: relative; top: 3px; right:5px;" id="show-'.$blocname.'"';
|
||||||
|
print ' class="linkobject'.($hide ? '' : ' hideobject').'">'.img_picto('', '1downarrow.png').'</div>'."\n";
|
||||||
|
print '<div id="'.$blocname.'_title" class="liste_titre">'.$title.'</div>'."\n";
|
||||||
|
print '<div id="'.$blocname.'_bloc" class="'.($hide ? 'hideobject' : 'nohideobject')'">'."\n";
|
||||||
|
|
||||||
</div>
|
include DOL_DOCUMENT_ROOT.'/core/tpl/'.$blocname.'.tpl.php';
|
||||||
<br>
|
print '</div><br>';
|
||||||
|
?>
|
||||||
<!-- END PHP TEMPLATE BLOC SHOW/HIDE -->
|
<!-- END PHP TEMPLATE BLOC SHOW/HIDE -->
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user