gunnar: server/kolab-webadmin/kolab-webadmin/lib/KolabAdmin/Sieve Segment.php, 1.2, 1.3

cvs at kolab.org cvs at kolab.org
Thu Apr 1 15:38:21 CEST 2010


Author: gunnar

Update of /kolabrepository/server/kolab-webadmin/kolab-webadmin/lib/KolabAdmin/Sieve
In directory doto:/tmp/cvs-serv16540/kolab-webadmin/lib/KolabAdmin/Sieve

Modified Files:
	Segment.php 
Log Message:
Complete the handling of the folder delivery segment.

Index: Segment.php
===================================================================
RCS file: /kolabrepository/server/kolab-webadmin/kolab-webadmin/lib/KolabAdmin/Sieve/Segment.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- Segment.php	1 Apr 2010 09:12:30 -0000	1.2
+++ Segment.php	1 Apr 2010 13:38:19 -0000	1.3
@@ -26,9 +26,23 @@
  * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
  * @link     http://www.kolab.org
  */
-class KolabAdmin_Sieve_Segment
+abstract class KolabAdmin_Sieve_Segment
 {
     /**
+     * The segment type
+     *
+     * @var string
+     */
+    protected $type;
+
+    /**
+     * The script template
+     *
+     * @var string
+     */
+    protected $template;
+
+    /**
      * Is this particular segment active?
      *
      * @var bool
@@ -42,6 +56,9 @@
      */
     public function __construct($script = '')
     {
+        if (!empty($script)) {
+            $this->parseArguments($script);
+        }
     }
 
     /**
@@ -76,6 +93,13 @@
 
     public function generate()
     {
-        return '';
+        return '### SEGMENT START ' . strtoupper($this->type) .' ' .
+            (($this->_active) ? 'ENABLED' : 'DISABLED') . "\r\n" .
+            vsprintf($this->template, $this->getArguments()) .
+            '### SEGMENT END ' . strtoupper($this->type) . "\r\n";
     }
+
+    abstract public function getArguments();
+
+    abstract public function parseArguments($script);
 }





More information about the commits mailing list