old files no longer needed.
This commit is contained in:
parent
af883743e0
commit
435b677141
|
@ -1,63 +0,0 @@
|
|||
<?php defined("SYSPATH") or die("No direct script access.");
|
||||
/**
|
||||
* Gallery - a web based photo album viewer and editor
|
||||
* Copyright (C) 2000-2010 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.
|
||||
*/
|
||||
class Admin_ecards_Controller extends Admin_Controller {
|
||||
public function index() {
|
||||
$view = new Admin_View("admin.html");
|
||||
$view->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;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
<?php defined("SYSPATH") or die("No direct script access.");
|
||||
/**
|
||||
* Gallery - a web based photo album viewer and editor
|
||||
* Copyright (C) 2000-2010 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.
|
||||
*/
|
||||
class ecards_Controller extends Controller {
|
||||
/**
|
||||
* Send the ecard.
|
||||
*/
|
||||
public function send($id) {
|
||||
$item = ORM::factory("item", $id);
|
||||
access::required("view", $item);
|
||||
if (!ecard::can_send_ecard()) {
|
||||
access::forbidden();
|
||||
}
|
||||
|
||||
$form = ecard::get_send_form($item);
|
||||
if ($form->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));
|
||||
}
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
<?php defined("SYSPATH") or die("No direct script access.") ?>
|
||||
<div class="g-block">
|
||||
<h1> <?= t("eCard settings") ?> </h1>
|
||||
<div class="g-block-content">
|
||||
<?= $form ?>
|
||||
</div>
|
||||
</div>
|
|
@ -1,6 +0,0 @@
|
|||
<?php defined("SYSPATH") or die("No direct script access.") ?>
|
||||
<a href="<?= url::site("ecards/form_send/{$item->id}") ?>" id="g-add-ecard"
|
||||
class="g-button ui-corner-all ui-icon-left ui-state-default g-dialog-link">
|
||||
<span class="ui-icon ui-icon-ecard"></span>
|
||||
<?= t("Send an eCard") ?>
|
||||
</a>
|
Reference in New Issue
Block a user