diff --git a/modules/ecard/controllers/admin_ecards.php b/modules/ecard/controllers/admin_ecards.php deleted file mode 100644 index b2bde957..00000000 --- a/modules/ecard/controllers/admin_ecards.php +++ /dev/null @@ -1,63 +0,0 @@ -page_title = t("eCard settings"); - $view->content = new View("admin_ecards.html"); - $view->content->form = $this->_get_admin_form(); - print $view; - } - - public function save() { - access::verify_csrf(); - $form = $this->_get_admin_form(); - if ($form->validate()) { - module::set_var("ecard", "sender", $form->ecard->sender->value); - module::set_var("ecard", "subject", $form->ecard->subject->value); - module::set_var("ecard", "message", $form->ecard->message->value); - module::set_var("ecard", "access_permissions", $form->ecard->access_permissions->value); - message::success(t("eCard settings updated")); - url::redirect("admin/ecards"); - } else { - print $form; - } - } - - private function _get_admin_form() { - $form = new Forge("admin/ecards/save", "", "post", array("id" => "g-ecards-admin-form")); - $ecard_settings = $form->group("ecard")->label(t("eCard settings")); - $ecard_settings->input("sender") - ->label(t("E-mail sender (leave blank for a user-defined address)")) - ->value(module::get_var("ecard", "sender", "")); - $ecard_settings->input("subject")->label(t("E-mail subject")) - ->value(module::get_var("ecard", "subject")); - $ecard_settings->textarea("message")->label(t("E-mail message")) - ->value(module::get_var("ecard", "message")); - $ecard_settings->dropdown("access_permissions") - ->label(t("Who can send eCards?")) - ->options(array("everybody" => t("Everybody"), - "registered_users" => t("Only registered users"))) - ->selected(module::get_var("ecard", "access_permissions")); - $ecard_settings->submit("save")->value(t("Save")); - return $form; - } -} - diff --git a/modules/ecard/controllers/ecards.php b/modules/ecard/controllers/ecards.php deleted file mode 100644 index 6ea77a00..00000000 --- a/modules/ecard/controllers/ecards.php +++ /dev/null @@ -1,53 +0,0 @@ -validate()) { - Kohana_Log::add("error",print_r($form,1)); - // Send the ecard here, based on the form data - json::reply(array("result" => "success")); - } else { - json::reply(array("result" => "error", "html" => (string)$form)); - } - } - - /** - * Present a form for adding a new ecard to this item or editing an existing ecard. - */ - public function form_send($item_id) { - $item = ORM::factory("item", $item_id); - access::required("view", $item); - if (!ecard::can_send_ecard()) { - access::forbidden(); - } - - print ecard::prefill_send_form(ecard::get_send_form($item)); - } -} diff --git a/modules/ecard/views/admin_ecards.html.php b/modules/ecard/views/admin_ecards.html.php deleted file mode 100644 index 0dd6b926..00000000 --- a/modules/ecard/views/admin_ecards.html.php +++ /dev/null @@ -1,7 +0,0 @@ - -