From: hickert Date: Mon, 19 Mar 2007 14:41:42 +0000 (+0000) Subject: Udpated Comments X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=68590716276c3117cab8b08298bb51e2ae5f4e8a;p=gosa.git Udpated Comments git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5823 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/include/sieve/class_sieveElement_Comment.inc b/include/sieve/class_sieveElement_Comment.inc index bad1dce11..197b3211a 100644 --- a/include/sieve/class_sieveElement_Comment.inc +++ b/include/sieve/class_sieveElement_Comment.inc @@ -5,6 +5,7 @@ class sieve_comment { var $data = ""; var $object_id= -1; + var $small = TRUE; function get_sieve_script_part() { @@ -16,7 +17,7 @@ class sieve_comment $this->object_id = $object_id; if($data == NULL){ - $data = array('ELEMENTS' => array(array('class' => "quoted-string" ,"text" => _("Your comment here")))); + $data = array('ELEMENTS' => array(array('class' => "quoted-string" ,"text" => "/*"._("Your comment here")."*/"))); } foreach($data['ELEMENTS'] as $node){ @@ -35,12 +36,17 @@ class sieve_comment $cm = stripslashes( $_POST['comment_'.$this->object_id]); $this->data = "/*".$cm."*/"; } + + if(isset($_POST['toggle_small_'.$this->object_id])){ + $this->small = !$this->small; + } } function execute() { $smarty = get_smarty(); $smarty->assign("ID", $this->object_id); + $smarty->assign("Small", $this->small); $object_container = $smarty->fetch(get_template_path("templates/object_container.tpl",TRUE,dirname(__FILE__))); $Comment = $this->data; @@ -51,6 +57,10 @@ class sieve_comment $Comment = preg_replace("#^\/\*#","",$Comment); $Comment = preg_replace("#\*\/$#","",$Comment); } + + if($this->small){ + $Comment = nl2br($Comment); + } /* Create html object */ $smarty = get_smarty(); diff --git a/include/sieve/templates/element_comment.tpl b/include/sieve/templates/element_comment.tpl index 6a52d04e9..c08743922 100644 --- a/include/sieve/templates/element_comment.tpl +++ b/include/sieve/templates/element_comment.tpl @@ -3,10 +3,21 @@ {t}Comment{/t} + + {if $Small} + + {else} + + {/if} + - - + + {if $Small} + {$Comment} + {else} + + {/if}