diff options
-rw-r--r-- | modules/comment/helpers/comment.php | 6 | ||||
-rw-r--r-- | modules/gallery/helpers/album.php | 4 | ||||
-rw-r--r-- | modules/gallery/helpers/movie.php | 5 | ||||
-rw-r--r-- | modules/gallery/helpers/photo.php | 4 | ||||
-rw-r--r-- | modules/recaptcha/config/recaptcha.php | 24 | ||||
-rw-r--r-- | modules/recaptcha/helpers/recaptcha_event.php | 10 | ||||
-rw-r--r-- | modules/tag/helpers/tag_event.php | 18 |
7 files changed, 15 insertions, 56 deletions
diff --git a/modules/comment/helpers/comment.php b/modules/comment/helpers/comment.php index e2772707..35685d8c 100644 --- a/modules/comment/helpers/comment.php +++ b/modules/comment/helpers/comment.php @@ -72,11 +72,7 @@ class comment_Core { $group->input("url") ->label(t("Website (hidden)"))->id("g-url"); $group->textarea("text")->label(t("Comment")) ->id("g-text"); $group->hidden("item_id")->value($item->id); - - $extend_form = (object)array("data" => $item, "form" => $form, "id" => "g-comment-form", - "append_to" => $group); - module::event("extend_form", $extend_form); - + module::event("comment_add_form", $form); $group->submit("")->value(t("Add"))->class("ui-state-default ui-corner-all"); $active = identity::active_user(); diff --git a/modules/gallery/helpers/album.php b/modules/gallery/helpers/album.php index c9c6e2c9..72a79a75 100644 --- a/modules/gallery/helpers/album.php +++ b/modules/gallery/helpers/album.php @@ -154,9 +154,7 @@ class album_Core { "DESC" => t("Descending"))) ->selected($parent->sort_order); - $extend_form = (object)array("data" => $parent, "form" => $form, "id" => "g-edit-album-form", - "append_to" => $group); - module::event("extend_form", $extend_form); + module::event("item_edit_form", $parent, $form); $group = $form->group("buttons")->label(""); $group->hidden("type")->value("album"); diff --git a/modules/gallery/helpers/movie.php b/modules/gallery/helpers/movie.php index 9e663d1f..e84e8ea6 100644 --- a/modules/gallery/helpers/movie.php +++ b/modules/gallery/helpers/movie.php @@ -151,9 +151,7 @@ class movie_Core { "not_url_safe", t("The internet address should contain only letters, numbers, hyphens and underscores")); - $extend_form = (object)array("data" => $parent, "form" => $form, "id" => "g-edit-movie-form", - "append_to" => $group); - module::event("extend_form", $extend_form); + module::event("item_edit_form", $movie, $form); $group = $form->group("buttons")->label(""); $group->submit("")->value(t("Modify")); @@ -161,6 +159,7 @@ class movie_Core { return $form; } + static function getmoviesize($filename) { $ffmpeg = self::find_ffmpeg(); if (empty($ffmpeg)) { diff --git a/modules/gallery/helpers/photo.php b/modules/gallery/helpers/photo.php index f5e1e1dc..01cf5278 100644 --- a/modules/gallery/helpers/photo.php +++ b/modules/gallery/helpers/photo.php @@ -179,9 +179,7 @@ class photo_Core { "not_url_safe", t("The internet address should contain only letters, numbers, hyphens and underscores")); - $extend_form = (object)array("data" => $photo, "form" => $form, "id" => "g-edit-photo-form", - "append_to" => $group); - module::event("extend_form", $extend_form); + module::event("item_edit_form", $photo, $form); $group = $form->group("buttons")->label(""); $group->submit("")->value(t("Modify")); diff --git a/modules/recaptcha/config/recaptcha.php b/modules/recaptcha/config/recaptcha.php deleted file mode 100644 index 04827673..00000000 --- a/modules/recaptcha/config/recaptcha.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php defined("SYSPATH") or die("No direct script access."); -/** - * Gallery - a web based photo album viewer and editor - * Copyright (C) 2000-2009 Bharat Mediratta - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or (at - * your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. - */ - -/** - * The list of forms that recaptcha should append itself to. - */ -$config["recaptcha"] = array("g-comment-form"); diff --git a/modules/recaptcha/helpers/recaptcha_event.php b/modules/recaptcha/helpers/recaptcha_event.php index 04af9568..e7ded3ab 100644 --- a/modules/recaptcha/helpers/recaptcha_event.php +++ b/modules/recaptcha/helpers/recaptcha_event.php @@ -18,13 +18,9 @@ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class recaptcha_event_Core { - static function extend_form($event_data) { - // @todo put into an admin interface - $config = Kohana::config("recaptcha"); - if (module::get_var("recaptcha", "public_key") && - in_array($event_data->id, $config["recaptcha"])) { - $input = empty($event_data->append_to) ? $event_data->form : $event_data->append_to; - $input->recaptcha("recaptcha")->label("")->id("g-recaptcha"); + static function comment_add_form($form) { + if (module::get_var("recaptcha", "public_key")) { + $form->add_comment->recaptcha("recaptcha")->label("")->id("g-recaptcha"); } } diff --git a/modules/tag/helpers/tag_event.php b/modules/tag/helpers/tag_event.php index cc134766..57986e40 100644 --- a/modules/tag/helpers/tag_event.php +++ b/modules/tag/helpers/tag_event.php @@ -64,20 +64,16 @@ class tag_event_Core { tag::compact(); } - static function extend_form($event_data) { - if (in_array($event_data->id, - array("g-edit-album-form", "g-edit-movie-form", "g-edit-photo-form"))) { - $url = url::site("tags/autocomplete"); - $event_data->form->script("") - ->text("$('form input[id=tags]').ready(function() { + static function item_edit_form($item, $form) { + $url = url::site("tags/autocomplete"); + $form->script("") + ->text("$('form input[id=tags]').ready(function() { $('form input[id=tags]').autocomplete( '$url', {max: 30, multiple: true, multipleSeparator: ',', cacheLength: 1}); });"); - $tag_value = implode(", ", tag::item_tags($event_data->data)); - $input = empty($event_data->append_to) ? $event_data->form : $event_data->append_to; - $input->input("tags")->label(t("Tags (comma separated)")) - ->value($tag_value); - } + $tag_value = implode(", ", tag::item_tags($item)); + $form->edit_item->input("tags")->label(t("Tags (comma separated)")) + ->value($tag_value); } static function item_edit_form_completed($item, $form) { |