2006 => 2007 Happy New Year\!
[platal.git] / include / validations / listes.inc.php
index fe06410..356fd98 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2006 Polytechnique.org                              *
+ *  Copyright (C) 2003-2007 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -61,6 +61,25 @@ class ListeReq extends Validate
     { return 'include/form.valid.listes.tpl'; }
 
     // }}}
+    // {{{ function editor()
+
+    function editor()
+    {
+        return 'include/form.valid.edit-listes.tpl';
+    }
+
+    // }}}
+    // {{{ function handle_editor()
+
+    function handle_editor()
+    {
+        if (Env::has('listname')) {
+            $this->liste = trim(Env::v('listname'));
+        }
+        return true;
+    }
+
+    // }}}
     // {{{ function _mail_subj
 
     function _mail_subj()
@@ -82,16 +101,13 @@ class ListeReq extends Validate
 
     // }}}
     // {{{ function commit()
-    
+
     function commit()
     {
-        require_once('platal/xmlrpc-client.inc.php');
-        require_once('lists.inc.php');
-
-        $client =& lists_xmlrpc(S::v('uid'), S::v('password'));
-        $ret = $client->create_list($this->liste, $this->desc,
-            $this->advertise, $this->modlevel, $this->inslevel,
-            $this->owners, $this->members);
+        $list = new MMList(S::v('uid'), S::v('password'));
+        $ret = $list->create_list($this->liste, $this->desc, $this->advertise,
+                                  $this->modlevel, $this->inslevel,
+                                  $this->owners, $this->members);
         $liste = strtolower($this->liste);
         if ($ret) {
             foreach(Array($liste, $liste."-owner", $liste."-admin", $liste."-bounces") as $l) {