summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0e03125)
raw | patch | inline | side by side (parent: 0e03125)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 19 Mar 2007 14:41:42 +0000 (14:41 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 19 Mar 2007 14:41:42 +0000 (14:41 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5823 594d385d-05f5-0310-b6e9-bd551577e9d8
include/sieve/class_sieveElement_Comment.inc | patch | blob | history | |
include/sieve/templates/element_comment.tpl | patch | blob | history |
diff --git a/include/sieve/class_sieveElement_Comment.inc b/include/sieve/class_sieveElement_Comment.inc
index bad1dce113a80a9b8715f3cf13b6046070aa5f2e..197b3211a9f1ea262280551fb4fedba996400736 100644 (file)
{
var $data = "";
var $object_id= -1;
+ var $small = TRUE;
function get_sieve_script_part()
{
$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){
$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;
$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 6a52d04e98481b1ec341f52a7a9a1f9467d456e8..c08743922f28b35c9f9404fc354dc17e62bfba8f 100644 (file)
<td>
<b>{t}Comment{/t}</b>
</td>
+ <td style='text-align: right;'>
+ {if $Small}
+ <input type='submit' name='toggle_small_{$ID}' value='{t}Edit{/t}'>
+ {else}
+ <input type='submit' name='toggle_small_{$ID}' value='{t}Close{/t}'>
+ {/if}
+ </td>
</tr>
<tr>
- <td style='padding-left:20px;'>
- <textarea name='comment_{$ID}' style='width:100%;height:30px'>{$Comment}</textarea>
+ <td style='padding-left:20px;' colspan=2>
+ {if $Small}
+ {$Comment}
+ {else}
+ <textarea name='comment_{$ID}' style='width:100%;height:80px'>{$Comment}</textarea>
+ {/if}
</td>
</tr>
</table>