Rename Ansel's Form objects for autoloading
authorMichael J. Rubinsky <mrubinsk@horde.org>
Fri, 31 Jul 2009 17:55:42 +0000 (13:55 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Fri, 31 Jul 2009 17:55:42 +0000 (13:55 -0400)
14 files changed:
ansel/edit_dates.php
ansel/image.php
ansel/img/ecard.php
ansel/img/upload.php
ansel/lib/Form/Ecard.php [new file with mode: 0644]
ansel/lib/Form/Image.php [new file with mode: 0644]
ansel/lib/Form/ImageDate.php [new file with mode: 0644]
ansel/lib/Form/Upload.php [new file with mode: 0644]
ansel/lib/Form/Watermark.php [new file with mode: 0644]
ansel/lib/Forms/Ecard.php [deleted file]
ansel/lib/Forms/Image.php [deleted file]
ansel/lib/Forms/ImageDate.php [deleted file]
ansel/lib/Forms/Upload.php [deleted file]
ansel/lib/Forms/Watermark.php [deleted file]

index 1c8ddf7..e3c5a20 100644 (file)
@@ -7,7 +7,6 @@
  *
  * @author Michael J. Rubinsky <mrubinsk@horde.org>
  */
-
 require_once dirname(__FILE__) . '/lib/base.php';
 
 $images = Horde_Util::getFormData('image', array());
@@ -35,13 +34,9 @@ if (!count($images)) {
     exit;
 }
 
-/* Includes */
-require_once ANSEL_BASE . '/lib/Forms/ImageDate.php';
-require_once 'Horde/Form/Renderer.php';
-
 /* Set up the form */
 $vars = Horde_Variables::getDefaultVariables();
-$form = new ImageDateForm($vars, _("Edit Dates"));
+$form = new Ansel_Form_ImageDate($vars, _("Edit Dates"));
 /* Are we doing the edit now? */
 if ($actionID == 'edit_dates') {
     $count = 0;
index db64b0f..4121bf9 100644 (file)
@@ -13,7 +13,6 @@
  */
 
 require_once dirname(__FILE__) . '/lib/base.php';
-require_once 'Horde/Form/Renderer.php';
 
 /* Get all the form data */
 $actionID = Horde_Util::getFormData('actionID');
@@ -145,7 +144,7 @@ case 'modify':
     } else {
         $vars->set('actionID', 'savecloseimage');
     }
-    $form = new ImageForm($vars, $title);
+    $form = new Ansel_Form_Image($vars, $title);
     $renderer = new Horde_Form_Renderer();
 
     /* Set up the gallery attributes. */
@@ -185,7 +184,7 @@ case 'save':
     $vars = Horde_Variables::getDefaultVariables();
     $vars->set('actionID', 'save');
     $renderer = new Horde_Form_Renderer();
-    $form = new ImageForm($vars, _("Edit a photo"));
+    $form = new Ansel_Form_Image($vars, _("Edit a photo"));
 
     /* Update existing image. */
     if ($form->validate($vars)) {
@@ -463,7 +462,7 @@ case 'setwatermark':
     require_once ANSEL_BASE . '/lib/Forms/Watermark.php';
     $vars = Horde_Variables::getDefaultVariables();
     $vars->set('actionID', 'previewcustomwatermark');
-    $form = new WatermarkForm($vars, _("Watermark"));
+    $form = new Ansel_Form_Watermark($vars, _("Watermark"));
     $renderer = new Horde_Form_Renderer();
 
     require ANSEL_TEMPLATES . '/common-header.inc';
index 4e344d1..9cbc587 100644 (file)
@@ -9,8 +9,6 @@
  */
 
 require_once dirname(__FILE__) . '/../lib/base.php';
-require_once ANSEL_BASE . '/lib/Forms/Ecard.php';
-require_once 'Horde/Form/Renderer.php';
 
 /* Abort if ecard sending is disabled. */
 if (empty($conf['ecard']['enable'])) {
@@ -99,7 +97,7 @@ $title = sprintf(_("Send Ecard :: %s"), $image->filename);
 $vars = Horde_Variables::getDefaultVariables();
 $vars->set('actionID', 'send');
 $vars->set('image_desc', strlen($image->caption) ? $image->caption : $image->filename);
-$form = new EcardForm($vars, $title);
+$form = new Ansel_Form_Ecard($vars, $title);
 $renderer = new Horde_Form_Renderer();
 
 if ($browser->hasFeature('rte')) {
index 70e2c0b..c975cdb 100644 (file)
@@ -9,8 +9,6 @@
  */
 
 require_once dirname(__FILE__) . '/../lib/base.php';
-require_once ANSEL_BASE . '/lib/Forms/Upload.php';
-require_once 'Horde/Form/Renderer.php';
 
 $gallery_id = Horde_Util::getFormData('gallery');
 $gallery = &$ansel_storage->getGallery($gallery_id);
@@ -23,7 +21,7 @@ if (is_a($gallery, 'PEAR_Error')) {
 $page = Horde_Util::getFormData('page', 0);
 $vars = Horde_Variables::getDefaultVariables();
 
-$form = new UploadForm($vars, _("Upload photos"));
+$form = new Ansel_Form_Upload($vars, _("Upload photos"));
 if ($form->validate($vars)) {
     $valid = true;
     $uploaded = 0;
diff --git a/ansel/lib/Form/Ecard.php b/ansel/lib/Form/Ecard.php
new file mode 100644 (file)
index 0000000..bf50f3f
--- /dev/null
@@ -0,0 +1,37 @@
+<?php
+/**
+ * Ecard generator.
+ *
+ * @package Ansel
+ */
+
+class Ansel_Form_Ecard extends Horde_Form {
+
+    protected $_useFormToken = false;
+
+    public function __construct(&$vars, $title)
+    {
+        parent::Horde_Form($vars, $title);
+
+        $this->setButtons(_("Send"));
+        $this->addHidden('', 'actionID', 'text', false);
+        $this->addHidden('', 'gallery', 'text', false);
+        $this->addHidden('', 'image', 'text', false);
+        $this->addHidden('', 'image_desc', 'text', false);
+
+        $user = Horde_Auth::getAuth();
+        if (empty($user)) {
+            $this->addVariable(_("Use the following return address:"), 'ecard_retaddr', 'text', true);
+        } else {
+            require_once 'Horde/Identity.php';
+            $identity = Identity::singleton();
+            $from_addr = $identity->getDefaultFromAddress();
+            $vars->set('ecard_retaddr', $from_addr);
+            $this->addHidden('', 'ecard_retaddr', 'text', true);
+        }
+
+        $this->addVariable(_("Send ecard to the following address:"), 'ecard_addr', 'text', true);
+        $this->addVariable(_("Comments:"), 'ecard_comments', 'longtext', false, false, null, array('15', '60'));
+    }
+
+}
diff --git a/ansel/lib/Form/Image.php b/ansel/lib/Form/Image.php
new file mode 100644 (file)
index 0000000..77d1d29
--- /dev/null
@@ -0,0 +1,67 @@
+<?php
+/**
+ * Copyright 2003-2009 The Horde Project (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license information (GPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
+ *
+ * @author Chuck Hagenbuch <chuck@horde.org>
+ */
+class Ansel_Form_Image extends Horde_Form
+{
+    protected $_useFormToken = false;
+
+    public function __construct(&$vars, $title)
+    {
+        global $gallery;
+
+        parent::Horde_Form($vars, $title);
+
+        $this->setButtons(_("Save"));
+        $this->addHidden('', 'actionID', 'text', false);
+        $this->addHidden('', 'gallery', 'text', false);
+        $this->addHidden('', 'image', 'text', false);
+        $this->addHidden('', 'page', 'text', false);
+
+        $filesize = ini_get('upload_max_filesize');
+        if (substr($filesize, -1) == 'M') {
+            $filesize = $filesize * 1048576;
+        }
+        $filesize = $this->_get_size($filesize);
+        $this->addVariable(_("Make this the default photo for this gallery?"),
+                           'image_default', 'boolean', false);
+        $this->addVariable(_("Caption"), 'image_desc', 'longtext', false, false,
+                           null, array('4', '40'));
+
+        $this->addVariable(_("Original Date"), 'image_originalDate',
+                           'monthdayyear', true, false, null,
+                           array('start_year' => 1900));
+
+        $this->addVariable(_("Tags"), 'image_tags', 'text', false);
+
+        $this->addHidden('', 'image0', 'text', false);
+        $upload = &$this->addVariable(
+        _("Replace photo with this file"), 'file0', 'image', false, false,
+        _("Maximum photo size:") . ' '  . $filesize, array(false));
+        $upload->setHelp('upload');
+    }
+
+    /**
+     * Format file size
+     */
+    protected function _get_size($size)
+    {
+        $bytes = array('B', 'KB', 'MB', 'GB', 'TB');
+
+        foreach ($bytes as $val) {
+            if ($size > 1024) {
+                $size = $size / 1024;
+            } else {
+                break;
+            }
+        }
+
+        return round($size, 2) . ' '  . $val;
+    }
+
+}
diff --git a/ansel/lib/Form/ImageDate.php b/ansel/lib/Form/ImageDate.php
new file mode 100644 (file)
index 0000000..19e26dc
--- /dev/null
@@ -0,0 +1,31 @@
+<?php
+/**
+ * Copyright 2008-2009 The Horde Project (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license information (GPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
+ *
+ * @author Michael J. Rubinsky <mrubinsk@horde.org>
+ */
+class Ansel_Form_ImageDate extends Horde_Form
+{
+    protected $_useFormToken = false;
+
+    public function __construct(&$vars, $title)
+    {
+        global $gallery;
+
+        parent::Horde_Form($vars, $title);
+
+        $this->setButtons(_("Save"));
+        $this->addHidden('', 'actionID', 'text', false);
+        $this->addHidden('', 'gallery', 'text', false);
+        $this->addHidden('', 'image', 'text', false);
+        $this->addHidden('', 'page', 'text', false);
+        $this->addVariable(_("Editing dates for the following photos"), 'image_list', 'html', false, true);
+        $this->addVariable(_("Original Date"), 'image_originalDate',
+                           'monthdayyear', true, false, null,
+                           array('start_year' => 1900));
+    }
+
+}
diff --git a/ansel/lib/Form/Upload.php b/ansel/lib/Form/Upload.php
new file mode 100644 (file)
index 0000000..7f1ca25
--- /dev/null
@@ -0,0 +1,93 @@
+<?php
+/**
+ * Image uploader. Provides 3 different options - single images,
+ * multiple images, and zip file.
+ *
+ * @package Ansel
+ */
+class Ansel_Form_Upload extends Horde_Form
+{
+    protected $_useFormToken = false;
+
+    public function __construct(&$vars, $title)
+    {
+        global $gallery, $conf;
+
+        parent::Horde_Form($vars, $title);
+
+        $filesize = ini_get('upload_max_filesize');
+        if (substr($filesize, -1) == 'M') {
+            $filesize = $filesize * 1048576;
+        }
+        $filesize = $this->_get_size($filesize);
+
+        $postsize = ini_get('post_max_size');
+        if (substr($postsize, -1) == 'M') {
+            $postsize = $postsize * 1048576;
+        }
+        $postsize = $this->_get_size($postsize);
+
+        $this->setButtons(array(_("Upload"), _("Cancel")));
+        $this->addHidden('', 'gallery', 'text', false);
+        $this->addHidden('', 'page', 'text', false);
+
+        $this->setSection('single_file', _("Single Photo"));
+        $this->addHidden('', 'image0', 'text', false);
+        if (!strlen($vars->get('image0'))) {
+            $upload = &$this->addVariable(
+                _("File to upload"), 'file0', 'image', false, false,
+                _("Maximum photo size:") . ' '  . $filesize, array(false));
+            $upload->setHelp('upload');
+        }
+        $this->addVariable(_("Make this the default photo for this gallery?"), 'image0_default', 'boolean', false);
+        $this->addVariable(_("Caption"), 'image0_desc', 'longtext', false, false, null, array('4', '40'));
+        $this->addVariable(_("Tags"), 'image0_tags', 'text', false, false, _("Separate tags with commas."));
+
+        $this->setSection('multi_file', _("Multiple Photos"));
+
+        if (!strlen($vars->get('image0'))) {
+            $msg = sprintf(_("Maximum photo size: %s; with a total of: %s"),
+                           $filesize, $postsize);
+            $this->addVariable($msg, 'description', 'description', false);
+        }
+
+        // start at $i = 1 because 0 is used above.
+        for ($i = 1; $i <= $conf['image']['num_uploads']; $i++) {
+            $this->addHidden('', 'image' . $i, 'text', false);
+            if (!strlen($vars->get('image' . $i))) {
+                $upload = &$this->addVariable(sprintf(_("File %s"), $i), 'file' . $i, 'image', false, false, null, array(false));
+                $upload->setHelp('upload');
+            }
+        }
+
+        $this->setSection('zip_file', _("Zip File Upload"));
+        $this->addHidden('', 'image' . ($conf['image']['num_uploads'] + 1), 'text', false);
+        if (!strlen($vars->get('zip'))) {
+            $upload = &$this->addVariable(
+                _("File to upload"),
+                'file' . ($conf['image']['num_uploads'] + 1),
+                'file', false, false,
+                _("Maximum file size:") . ' ' . $filesize);
+            $upload->setHelp('upload');
+        }
+    }
+
+    /**
+     * Format file size
+     */
+    protected function _get_size($size)
+    {
+        $bytes = array('B', 'KB', 'MB', 'GB', 'TB');
+
+        foreach ($bytes as $val) {
+            if ($size > 1024) {
+                $size = $size / 1024;
+            } else {
+                break;
+            }
+        }
+
+        return round($size, 2) . ' '  . $val;
+    }
+
+}
diff --git a/ansel/lib/Form/Watermark.php b/ansel/lib/Form/Watermark.php
new file mode 100644 (file)
index 0000000..128ffde
--- /dev/null
@@ -0,0 +1,54 @@
+<?php
+/**
+ * Copyright 2003-2009 The Horde Project (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license information (GPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
+ *
+ * @author Chuck Hagenbuch <chuck@horde.org>
+ */
+class Ansel_Form_Watermark extends Horde_Form
+{
+    protected $_useFormToken = false;
+
+    public function __construct(&$vars, $title)
+    {
+        global $gallery, $prefs;
+
+        parent::Horde_Form($vars, $title);
+
+        $this->setButtons(_("Save"));
+        $this->addHidden('', 'actionID', 'text', false);
+        $this->addHidden('', 'gallery', 'text', false);
+        $this->addHidden('', 'image', 'text', false);
+        $this->addHidden('', 'page', 'text', false);
+
+        $w = &$this->addVariable(_("Custom Watermark"), 'watermark', 'text',
+                                 false, false, null);
+        $w->setDefault($prefs->getValue('watermark_text'));
+
+        $fonts = array('tiny' => _("Tiny"),
+                       'small' => _("Small"),
+                       'medium' => _("Medium"),
+                       'large' => _("Large"),
+                       'giant' => _("Giant"));
+        $f = &$this->addVariable(_("Watermark Font"), 'font', 'enum', false,
+                                 false, null, array($fonts));
+        $f->setDefault($prefs->getValue('watermark_font'));
+
+        $ha = array('left' => _("Left"),
+                    'center' => _("Center"),
+                    'right' => _("Right"));
+        $wha = &$this->addVariable(_("Horizontal Alignment"), 'whalign', 'enum',
+                                   false, false, null, array($ha));
+        $wha->setDefault($prefs->getValue('watermark_horizontal'));
+
+        $va = array('top' => _("Top"),
+                    'center' => _("Center"),
+                    'bottom' => _("Bottom"));
+        $wva = &$this->addVariable(_("Vertical Alignment"), 'wvalign', 'enum',
+                                   false, false, null, array($va));
+        $wva->setDefault($prefs->getValue('watermark_vertical'));
+    }
+
+}
diff --git a/ansel/lib/Forms/Ecard.php b/ansel/lib/Forms/Ecard.php
deleted file mode 100644 (file)
index 6fc69a3..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-<?php
-/**
- * Ecard generator.
- *
- * @package Ansel
- */
-
-class EcardForm extends Horde_Form {
-
-    var $_useFormToken = false;
-
-    function EcardForm(&$vars, $title)
-    {
-        parent::Horde_Form($vars, $title);
-
-        $this->setButtons(_("Send"));
-        $this->addHidden('', 'actionID', 'text', false);
-        $this->addHidden('', 'gallery', 'text', false);
-        $this->addHidden('', 'image', 'text', false);
-        $this->addHidden('', 'image_desc', 'text', false);
-
-        $user = Horde_Auth::getAuth();
-        if (empty($user)) {
-            $this->addVariable(_("Use the following return address:"), 'ecard_retaddr', 'text', true);
-        } else {
-            require_once 'Horde/Identity.php';
-            $identity = Identity::singleton();
-            $from_addr = $identity->getDefaultFromAddress();
-            $vars->set('ecard_retaddr', $from_addr);
-            $this->addHidden('', 'ecard_retaddr', 'text', true);
-        }
-
-        $this->addVariable(_("Send ecard to the following address:"), 'ecard_addr', 'text', true);
-        $this->addVariable(_("Comments:"), 'ecard_comments', 'longtext', false, false, null, array('15', '60'));
-    }
-
-}
diff --git a/ansel/lib/Forms/Image.php b/ansel/lib/Forms/Image.php
deleted file mode 100644 (file)
index 416a16f..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-<?php
-/**
- * Copyright 2003-2009 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Chuck Hagenbuch <chuck@horde.org>
- */
-class ImageForm extends Horde_Form {
-
-    var $_useFormToken = false;
-
-    function ImageForm(&$vars, $title)
-    {
-        global $gallery;
-
-        parent::Horde_Form($vars, $title);
-
-        $this->setButtons(_("Save"));
-        $this->addHidden('', 'actionID', 'text', false);
-        $this->addHidden('', 'gallery', 'text', false);
-        $this->addHidden('', 'image', 'text', false);
-        $this->addHidden('', 'page', 'text', false);
-
-        $filesize = ini_get('upload_max_filesize');
-        if (substr($filesize, -1) == 'M') {
-            $filesize = $filesize * 1048576;
-        }
-        $filesize = $this->_get_size($filesize);
-        $this->addVariable(_("Make this the default photo for this gallery?"),
-                           'image_default', 'boolean', false);
-        $this->addVariable(_("Caption"), 'image_desc', 'longtext', false, false,
-                           null, array('4', '40'));
-
-        $this->addVariable(_("Original Date"), 'image_originalDate',
-                           'monthdayyear', true, false, null,
-                           array('start_year' => 1900));
-
-        $this->addVariable(_("Tags"), 'image_tags', 'text', false);
-
-        $this->addHidden('', 'image0', 'text', false);
-        $upload = &$this->addVariable(
-        _("Replace photo with this file"), 'file0', 'image', false, false,
-        _("Maximum photo size:") . ' '  . $filesize, array(false));
-        $upload->setHelp('upload');
-    }
-
-    /**
-     * Format file size
-     */
-    function _get_size($size)
-    {
-        $bytes = array('B', 'KB', 'MB', 'GB', 'TB');
-
-        foreach ($bytes as $val) {
-            if ($size > 1024) {
-                $size = $size / 1024;
-            } else {
-                break;
-            }
-        }
-
-        return round($size, 2) . ' '  . $val;
-    }
-
-}
diff --git a/ansel/lib/Forms/ImageDate.php b/ansel/lib/Forms/ImageDate.php
deleted file mode 100644 (file)
index a0944fd..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-<?php
-/**
- * Copyright 2008-2009 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Michael J. Rubinsky <mrubinsk@horde.org>
- */
-class ImageDateForm extends Horde_Form {
-
-    var $_useFormToken = false;
-
-    function ImageDateForm(&$vars, $title)
-    {
-        global $gallery;
-
-        parent::Horde_Form($vars, $title);
-
-        $this->setButtons(_("Save"));
-        $this->addHidden('', 'actionID', 'text', false);
-        $this->addHidden('', 'gallery', 'text', false);
-        $this->addHidden('', 'image', 'text', false);
-        $this->addHidden('', 'page', 'text', false);
-        $this->addVariable(_("Editing dates for the following photos"), 'image_list', 'html', false, true);
-        $this->addVariable(_("Original Date"), 'image_originalDate',
-                           'monthdayyear', true, false, null,
-                           array('start_year' => 1900));
-    }
-
-}
diff --git a/ansel/lib/Forms/Upload.php b/ansel/lib/Forms/Upload.php
deleted file mode 100644 (file)
index d165a30..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-<?php
-/**
- * Image uploader. Provides 3 different options - single images,
- * multiple images, and zip file.
- *
- * @package Ansel
- */
-class UploadForm extends Horde_Form {
-
-    var $_useFormToken = false;
-
-    function UploadForm(&$vars, $title)
-    {
-        global $gallery, $conf;
-
-        parent::Horde_Form($vars, $title);
-
-        $filesize = ini_get('upload_max_filesize');
-        if (substr($filesize, -1) == 'M') {
-            $filesize = $filesize * 1048576;
-        }
-        $filesize = $this->_get_size($filesize);
-
-        $postsize = ini_get('post_max_size');
-        if (substr($postsize, -1) == 'M') {
-            $postsize = $postsize * 1048576;
-        }
-        $postsize = $this->_get_size($postsize);
-
-        $this->setButtons(array(_("Upload"), _("Cancel")));
-        $this->addHidden('', 'gallery', 'text', false);
-        $this->addHidden('', 'page', 'text', false);
-
-        $this->setSection('single_file', _("Single Photo"));
-        $this->addHidden('', 'image0', 'text', false);
-        if (!strlen($vars->get('image0'))) {
-            $upload = &$this->addVariable(
-                _("File to upload"), 'file0', 'image', false, false,
-                _("Maximum photo size:") . ' '  . $filesize, array(false));
-            $upload->setHelp('upload');
-        }
-        $this->addVariable(_("Make this the default photo for this gallery?"), 'image0_default', 'boolean', false);
-        $this->addVariable(_("Caption"), 'image0_desc', 'longtext', false, false, null, array('4', '40'));
-        $this->addVariable(_("Tags"), 'image0_tags', 'text', false, false, _("Separate tags with commas."));
-
-        $this->setSection('multi_file', _("Multiple Photos"));
-
-        if (!strlen($vars->get('image0'))) {
-            $msg = sprintf(_("Maximum photo size: %s; with a total of: %s"),
-                           $filesize, $postsize);
-            $this->addVariable($msg, 'description', 'description', false);
-        }
-
-        // start at $i = 1 because 0 is used above.
-        for ($i = 1; $i <= $conf['image']['num_uploads']; $i++) {
-            $this->addHidden('', 'image' . $i, 'text', false);
-            if (!strlen($vars->get('image' . $i))) {
-                $upload = &$this->addVariable(sprintf(_("File %s"), $i), 'file' . $i, 'image', false, false, null, array(false));
-                $upload->setHelp('upload');
-            }
-        }
-
-        $this->setSection('zip_file', _("Zip File Upload"));
-        $this->addHidden('', 'image' . ($conf['image']['num_uploads'] + 1), 'text', false);
-        if (!strlen($vars->get('zip'))) {
-            $upload = &$this->addVariable(
-                _("File to upload"),
-                'file' . ($conf['image']['num_uploads'] + 1),
-                'file', false, false,
-                _("Maximum file size:") . ' ' . $filesize);
-            $upload->setHelp('upload');
-        }
-    }
-
-    /**
-     * Format file size
-     */
-    function _get_size($size)
-    {
-        $bytes = array('B', 'KB', 'MB', 'GB', 'TB');
-
-        foreach ($bytes as $val) {
-            if ($size > 1024) {
-                $size = $size / 1024;
-            } else {
-                break;
-            }
-        }
-
-        return round($size, 2) . ' '  . $val;
-    }
-
-}
diff --git a/ansel/lib/Forms/Watermark.php b/ansel/lib/Forms/Watermark.php
deleted file mode 100644 (file)
index ae1f89e..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-<?php
-/**
- * Copyright 2003-2009 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Chuck Hagenbuch <chuck@horde.org>
- */
-class WatermarkForm extends Horde_Form {
-
-    var $_useFormToken = false;
-
-    function WatermarkForm(&$vars, $title)
-    {
-        global $gallery, $prefs;
-
-        parent::Horde_Form($vars, $title);
-
-        $this->setButtons(_("Save"));
-        $this->addHidden('', 'actionID', 'text', false);
-        $this->addHidden('', 'gallery', 'text', false);
-        $this->addHidden('', 'image', 'text', false);
-        $this->addHidden('', 'page', 'text', false);
-
-        $w = &$this->addVariable(_("Custom Watermark"), 'watermark', 'text',
-                                 false, false, null);
-        $w->setDefault($prefs->getValue('watermark_text'));
-
-        $fonts = array('tiny' => _("Tiny"),
-                       'small' => _("Small"),
-                       'medium' => _("Medium"),
-                       'large' => _("Large"),
-                       'giant' => _("Giant"));
-        $f = &$this->addVariable(_("Watermark Font"), 'font', 'enum', false,
-                                 false, null, array($fonts));
-        $f->setDefault($prefs->getValue('watermark_font'));
-
-        $ha = array('left' => _("Left"),
-                    'center' => _("Center"),
-                    'right' => _("Right"));
-        $wha = &$this->addVariable(_("Horizontal Alignment"), 'whalign', 'enum',
-                                   false, false, null, array($ha));
-        $wha->setDefault($prefs->getValue('watermark_horizontal'));
-
-        $va = array('top' => _("Top"),
-                    'center' => _("Center"),
-                    'bottom' => _("Bottom"));
-        $wva = &$this->addVariable(_("Vertical Alignment"), 'wvalign', 'enum',
-                                   false, false, null, array($va));
-        $wva->setDefault($prefs->getValue('watermark_vertical'));
-    }
-
-}