diff options
author | Bharat Mediratta <bharat@menalto.com> | 2008-12-26 04:34:20 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2008-12-26 04:34:20 +0000 |
commit | 837a5430b8ef578bba19850272c6e399756b792f (patch) | |
tree | 2ed0267f359f4d54cc14a70870aa35dcbda2283d /modules/watermark/helpers | |
parent | b20b56d762ef276d731fef7e83cb9482595cc26a (diff) |
More watermark changes:
Change admin/watermarks/upload -> admin/watermarks/add for consistency.
Internationalize position text, store it as text in the database,
display it to the admin.
Make i18n strings consistent to reduce l10n load.
Diffstat (limited to 'modules/watermark/helpers')
-rw-r--r-- | modules/watermark/helpers/watermark.php | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/modules/watermark/helpers/watermark.php b/modules/watermark/helpers/watermark.php index c17bf0ab..af266bc5 100644 --- a/modules/watermark/helpers/watermark.php +++ b/modules/watermark/helpers/watermark.php @@ -19,7 +19,7 @@ */ class watermark_Core { public static function get_add_form() { - $form = new Forge("admin/watermarks/upload", "", "post"); + $form = new Forge("admin/watermarks/add", "", "post"); $group = $form->group("add_watermark")->label(_("Upload Watermark")); $group->upload("file")->label(_("Watermark"))->rules("allow[jpg,png,gif]|size[1MB]|required"); $group->dropdown("position")->label(_("Watermark Position")) @@ -35,9 +35,7 @@ class watermark_Core { $form = new Forge("admin/watermarks/edit", "", "post"); $group = $form->group("edit_watermark")->label(_("Edit Watermark")); $group->dropdown("position")->label(_("Watermark Position")) - ->options(array("northwest", "north", "northeast", - "west", "center", "east", - "southwest", "south", "southeast")) + ->options(self::positions()) ->selected("8"); $group->submit(_("Modify")); return $form; @@ -49,4 +47,21 @@ class watermark_Core { $group->submit(_("Delete")); return $form; } + + public static function positions() { + return array("northwest" => _("Northwest"), + "north" => _("North"), + "northeast" => _("Northeast"), + "west" => _("West"), + "center" => _("Center"), + "east" => _("East"), + "southwest" => _("Southwest"), + "south" => _("South"), + "southeast" => _("Southeast")); + } + + public static function position($key) { + $positions = self::positions(); + return $positions[$key]; + } }
\ No newline at end of file |