2009-01-12 07:39:53 +00:00
|
|
|
<?php defined("SYSPATH") or die("No direct script access.");
|
|
|
|
|
/**
|
|
|
|
|
* Gallery - a web based photo album viewer and editor
|
2009-05-13 20:04:58 +00:00
|
|
|
* Copyright (C) 2000-2009 Bharat Mediratta
|
2009-01-12 07:39:53 +00:00
|
|
|
*
|
|
|
|
|
* 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.
|
|
|
|
|
*/
|
2009-01-18 06:55:04 +00:00
|
|
|
class comment_block_Core {
|
2009-09-30 07:31:11 -07:00
|
|
|
static function get_admin_list() {
|
2009-10-28 12:15:52 -07:00
|
|
|
return array("recent_comments" => t("Recent comments"));
|
2009-01-12 07:39:53 +00:00
|
|
|
}
|
|
|
|
|
|
2009-01-18 06:55:04 +00:00
|
|
|
static function get($block_id) {
|
2009-01-12 07:39:53 +00:00
|
|
|
$block = new Block();
|
|
|
|
|
switch ($block_id) {
|
|
|
|
|
case "recent_comments":
|
2009-10-04 00:27:22 -06:00
|
|
|
$block->css_id = "g-recent-comments";
|
2009-10-28 12:15:52 -07:00
|
|
|
$block->title = t("Recent comments");
|
2009-01-12 07:39:53 +00:00
|
|
|
$block->content = new View("admin_block_recent_comments.html");
|
|
|
|
|
$block->content->comments =
|
2009-11-25 19:26:52 -08:00
|
|
|
ORM::factory("comment")->order_by("created", "DESC")->limit(5)->find_all();
|
2009-01-12 07:39:53 +00:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return $block;
|
|
|
|
|
}
|
|
|
|
|
}
|