Files
gallery3/modules/comment/helpers/comment_theme.php
Bharat Mediratta dbeadc1407 Use the Kohana cascading filesystem to locate resources loaded by the
theme.  Because the theme comes first, this means that themes can
override any module resources, at the cost that we no longer have
namespacing for JS and CSS files.

The only file getting used outside of this model is
themes/default/screen.css which is used in the admin theme.  I fixed
that by copying screen.css into admin_default and renaming its
screen.css to admin_screen.css.  I also copied over all the images
that it was referencing.

Fixes tickets #48 and #539.

Theme API changes:
- theme_script(), theme_url() and theme_css() are no longer needed
- script(), url() and css() now refer to the first matching asset in
  the module load path, where gallery3/lib is at the end of the path
2009-07-22 14:27:57 -07:00

43 lines
1.5 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 comment_theme_Core {
static function head($theme) {
$theme->script("comment.js");
return "";
}
static function photo_bottom($theme) {
$block = new Block;
$block->css_id = "gComments";
$block->anchor = t("comments");
$block->title = t("Comments");
$view = new View("comments.html");
$view->comments = ORM::factory("comment")
->where("item_id", $theme->item()->id)
->where("state", "published")
->orderby("created", "ASC")
->find_all();
$block->content = $view;
$block->content .= comment::get_add_form($theme->item())->render("form.html");
return $block;
}
}