consistancy change.
This commit is contained in:
parent
442716a75b
commit
b010d3e665
|
@ -1,82 +1,82 @@
|
||||||
<?php defined("SYSPATH") or die("No direct script access.");
|
<?php defined("SYSPATH") or die("No direct script access.");
|
||||||
/**
|
/**
|
||||||
* Gallery - a web based photo album viewer and editor
|
* Gallery - a web based photo album viewer and editor
|
||||||
* Copyright (C) 2000-2011 Bharat Mediratta
|
* Copyright (C) 2000-2011 Bharat Mediratta
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* 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
|
* the Free Software Foundation; either version 2 of the License, or (at
|
||||||
* your option) any later version.
|
* your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
* General Public License for more details.
|
* General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
|
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
class Admin_SharePhoto_Controller extends Admin_Controller {
|
class Admin_SharePhoto_Controller extends Admin_Controller {
|
||||||
public function index() {
|
public function index() {
|
||||||
// Generate a new admin page.
|
// Generate a new admin page.
|
||||||
$view = new Admin_View("admin.html");
|
$view = new Admin_View("admin.html");
|
||||||
$view->content = new View("admin_sharephoto.html");
|
$view->content = new View("admin_sharephoto.html");
|
||||||
$view->content->sharephoto_form = $this->_get_admin_form();
|
$view->content->sharephoto_form = $this->_get_admin_form();
|
||||||
print $view;
|
print $view;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function saveprefs() {
|
public function saveprefs() {
|
||||||
// Prevent Cross Site Request Forgery
|
// Prevent Cross Site Request Forgery
|
||||||
access::verify_csrf();
|
access::verify_csrf();
|
||||||
|
|
||||||
$form = $this->_get_admin_form();
|
$form = $this->_get_admin_form();
|
||||||
|
|
||||||
// Figure out which boxes where checked
|
// Figure out which boxes where checked
|
||||||
$shareOpts_array = Input::instance()->post("ShareOptions");
|
$shareOpts_array = Input::instance()->post("ShareOptions");
|
||||||
|
|
||||||
$IconsButton = false;
|
$IconsButton = false;
|
||||||
$HTMLLinksButton = false;
|
$HTMLLinksButton = false;
|
||||||
|
|
||||||
for ($i = 0; $i < count($shareOpts_array); $i++) {
|
for ($i = 0; $i < count($shareOpts_array); $i++) {
|
||||||
if ($shareOpts_array[$i] == "Icons") {
|
if ($shareOpts_array[$i] == "Icons") {
|
||||||
$IconsButton = true;
|
$IconsButton = true;
|
||||||
}
|
}
|
||||||
if ($shareOpts_array[$i] == "HTMLLinks") {
|
if ($shareOpts_array[$i] == "HTMLLinks") {
|
||||||
$HTMLLinksButton = true;
|
$HTMLLinksButton = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save Settings.
|
// Save Settings.
|
||||||
module::set_var("sharephoto", "Icons", $IconsButton);
|
module::set_var("sharephoto", "Icons", $IconsButton);
|
||||||
module::set_var("sharephoto", "HTMLLinks", $HTMLLinksButton);
|
module::set_var("sharephoto", "HTMLLinks", $HTMLLinksButton);
|
||||||
message::success(t("Your Selection Has Been Saved."));
|
message::success(t("Your Selection Has Been Saved."));
|
||||||
|
|
||||||
// Load Admin page.
|
// Load Admin page.
|
||||||
$view = new Admin_View("admin.html");
|
$view = new Admin_View("admin.html");
|
||||||
$view->content = new View("admin_sharephoto.html");
|
$view->content = new View("admin_sharephoto.html");
|
||||||
$view->content->sharephoto_form = $form;
|
$view->content->sharephoto_form = $form;
|
||||||
print $view;
|
print $view;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function _get_admin_form() {
|
private function _get_admin_form() {
|
||||||
// New Form.
|
// New Form.
|
||||||
$form = new Forge("admin/sharephoto/saveprefs", "", "post",
|
$form = new Forge("admin/sharephoto/saveprefs", "", "post",
|
||||||
array("id" => "g-sharephoto-adminForm"));
|
array("id" => "g-sharephoto-adminForm"));
|
||||||
|
|
||||||
// Select what to show on the Photo page.
|
// Select what to show on the Photo page.
|
||||||
$shareTypes["Icons"] = array(t("Show Icons "), module::get_var("sharephoto", "Icons"));
|
$shareTypes["Icons"] = array(t("Show Icons "), module::get_var("sharephoto", "Icons"));
|
||||||
$shareTypes["HTMLLinks"] = array(t("Show HTML Links"), module::get_var("sharephoto", "HTMLLinks"));
|
$shareTypes["HTMLLinks"] = array(t("Show HTML Links"), module::get_var("sharephoto", "HTMLLinks"));
|
||||||
|
|
||||||
// Checkboxes
|
// Checkboxes
|
||||||
$add_links = $form->group("SharePhoto");
|
$add_links = $form->group("SharePhoto");
|
||||||
$add_links->checklist("ShareOptions")
|
$add_links->checklist("ShareOptions")
|
||||||
->options($shareTypes);
|
->options($shareTypes);
|
||||||
|
|
||||||
// Save button
|
// Save button
|
||||||
$add_links->submit("SaveSettings")->value(t("Save"));
|
$add_links->submit("SaveSettings")->value(t("Save"));
|
||||||
|
|
||||||
// Return the newly generated form.
|
// Return the newly generated form.
|
||||||
return $form;
|
return $form;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,28 +1,28 @@
|
||||||
<?php defined("SYSPATH") or die("No direct script access.");
|
<?php defined("SYSPATH") or die("No direct script access.");
|
||||||
/**
|
/**
|
||||||
* Gallery - a web based photo album viewer and editor
|
* Gallery - a web based photo album viewer and editor
|
||||||
* Copyright (C) 2000-2011 Bharat Mediratta
|
* Copyright (C) 2000-2011 Bharat Mediratta
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* 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
|
* the Free Software Foundation; either version 2 of the License, or (at
|
||||||
* your option) any later version.
|
* your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
* General Public License for more details.
|
* General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
|
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
class sharephoto_event_Core {
|
class sharephoto_event_Core {
|
||||||
static function admin_menu($menu, $theme) {
|
static function admin_menu($menu, $theme) {
|
||||||
$menu->get("settings_menu")
|
$menu->get("settings_menu")
|
||||||
->append(Menu::factory("link")
|
->append(Menu::factory("link")
|
||||||
->id("sharephoto")
|
->id("sharephoto")
|
||||||
->label(t("SharePhoto"))
|
->label(t("SharePhoto"))
|
||||||
->url(url::site("admin/sharephoto")));
|
->url(url::site("admin/sharephoto")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,38 +1,38 @@
|
||||||
<?php defined("SYSPATH") or die("No direct script access.");
|
<?php defined("SYSPATH") or die("No direct script access.");
|
||||||
/**
|
/**
|
||||||
* Gallery - a web based photo album viewer and editor
|
* Gallery - a web based photo album viewer and editor
|
||||||
* Copyright (C) 2000-2011 Bharat Mediratta
|
* Copyright (C) 2000-2011 Bharat Mediratta
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* 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
|
* the Free Software Foundation; either version 2 of the License, or (at
|
||||||
* your option) any later version.
|
* your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but
|
* This program is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
* General Public License for more details.
|
* General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
|
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
class sharephoto_theme_Core {
|
class sharephoto_theme_Core {
|
||||||
static function head($theme) {
|
static function head($theme) {
|
||||||
return $theme->css("sharephoto.css")
|
return $theme->css("sharephoto.css")
|
||||||
. $theme->script("sharephoto.js");
|
. $theme->script("sharephoto.js");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static function photo_bottom($theme) {
|
static function photo_bottom($theme) {
|
||||||
$block = new Block;
|
$block = new Block;
|
||||||
$block->css_id = "g-sharephoto";
|
$block->css_id = "g-sharephoto";
|
||||||
$block->title = t("Share Photo");
|
$block->title = t("Share Photo");
|
||||||
$block->anchor = "sharephoto";
|
$block->anchor = "sharephoto";
|
||||||
|
|
||||||
$view = new View("sharephoto.html");
|
$view = new View("sharephoto.html");
|
||||||
|
|
||||||
$block->content = $view;
|
$block->content = $view;
|
||||||
return $block;
|
return $block;
|
||||||
}
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user