1
0
This repository has been archived on 2021-04-26. You can view files and clone it, but cannot push or open issues or pull requests.
gallery3-contrib/modules/minislideshow/helpers/minislideshow_event.php
Bharat Mediratta 1a0dc96e77 First pass at upgrading contrib code to the Kohana 2.4 standards.
Here's a summary of the changes I made:

1) html::specialchars --> html::chars
2) ORM::orderby() -> ORM::order_by()
3) ORM::where() now takes 3 parameters including a comparator.  So
   ORM::where("a", $b) is now ORM::where("a", "=", $b) and the middle
   value can be any comparator.
4) ORM::$loaded --> ORM::loaded()
5) Database::instance() --> db::build()  (and there are some other
   subtle differences, like now you always call execute() at the end
   of the chain)
6) form::close() and form::close_fieldset() are now gone.  Use
   </form> and </fieldset> respectively.
7) Controller::$input is gone.  Use Input::instance() instead.

I've done very rudimentary testing so far.
2009-12-22 21:31:03 -08:00

66 lines
2.6 KiB
PHP

<?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.
*/
class minislideshow_event_Core {
static function admin_menu($menu, $theme) {
// Add a menu option to the admin screen for configuring the slideshow.
$menu->get("settings_menu")
->append(Menu::factory("link")
->id("minislideshow")
->label(t("MiniSlide Show settings"))
->url(url::site("admin/minislideshow")));
}
static function module_change($changes) {
// Display a warning message if the RSS module is not installed.
if (!module::is_active("rss") || in_array("rss", $changes->deactivate)) {
site_status::warning(
t("The MiniSlide Show module requires the RSS module. " .
"<a href=\"%url\">Activate the RSS module now</a>",
array("url" => url::site("admin/modules"))),
"minislideshow_needs_rss");
} else {
site_status::clear("minislideshow_needs_rss");
}
}
static function album_menu($menu, $theme) {
// Add an option to access the slideshow from the album view.
$menu
->append(Menu::factory("link")
->id("minislideshow")
->label(t("View MiniSlide Show"))
->url(url::site("minislideshow/showslideshow/" . $theme->item()->id))
->css_class("g-dialog-link")
->css_id("g-mini-slideshow-link"));
}
static function photo_menu($menu, $theme) {
// Add an option to access the slideshow from the photo view.
$menu
->append(Menu::factory("link")
->id("minislideshow")
->label(t("View MiniSlide Show"))
->url(url::site("minislideshow/showslideshow/" . $theme->item()->id))
->css_class("g-dialog-link")
->css_id("g-mini-slideshow-link"));
}
}