1
0

Rename 3nids to three_nids so that we can use the theme name as an

identifier in PHP.  PHP identifiers are not allowed to start with a
digit (sigh).
This commit is contained in:
Bharat Mediratta 2009-11-27 16:21:18 -08:00
parent bbd14d449d
commit 4e9c467a10
82 changed files with 57 additions and 59 deletions

View File

@ -1,3 +0,0 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<?= theme_3nids::fancylink($item, "dynamic", false, false, "h4") ?>

View File

@ -12,9 +12,9 @@ Requirements:
*********
Installation:
1. Copy the theme folder (3nids) into gallery3/themes directory.
1. Copy the theme folder (three_nids) into gallery3/themes directory.
2. Copy the tagsmap module into the gallery3/modules folder.
3. Activate tagsmap module and 3nids theme.
3. Activate tagsmap module and three_nids theme.
*********
Configuration:

View File

@ -18,14 +18,14 @@
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
class Admin_theme_3nids_Controller extends Admin_Controller {
class Admin_theme_three_nids_Controller extends Admin_Controller {
public function index() {
// Generate a new admin page.
$view = new Admin_View("admin.html");
$view->content = new View("admin_theme_3nids.html");
$view->content = new View("admin_theme_three_nids.html");
// Generate a form for Google Maps Settings.
$view->content->theme_form = $this->_get_3nids_form();
$view->content->theme_form = $this->_get_three_nids_form();
// Display the page.
@ -33,21 +33,21 @@ class Admin_theme_3nids_Controller extends Admin_Controller {
}
private function _get_3nids_form() {
private function _get_three_nids_form() {
// Make a new form for inputing information associated with google maps.
$form = new Forge("admin/theme_3nids/save3nidsprefs", "", "post",
$form = new Forge("admin/theme_three_nids/savethree_nidsprefs", "", "post",
array("id" => "gTagsMapAdminForm"));
// Input box for the Maps API Key
$form->input("title")
->label(t("item title : parent or item."))
->value(module::get_var("3nids", "title"));
->value(module::get_var("three_nids", "title"));
$form->input("description")
->label(t("item description : tags or item or parent or nothing. If item description chosen and not available, then parent description is used."))
->value(module::get_var("3nids", "description"));
->value(module::get_var("three_nids", "description"));
$form->input("photo_size")
->label(t("Photo size: resize or full."))
->value(module::get_var("3nids", "photo_size"));
->value(module::get_var("three_nids", "photo_size"));
// Add a save button to the form.
$form->submit("SaveSettings")->value(t("Save"));
@ -56,7 +56,7 @@ class Admin_theme_3nids_Controller extends Admin_Controller {
return $form;
}
public function save3nidsprefs() {
public function savethree_nidsprefs() {
// Save information associated with Google Maps to the database.
// Prevent Cross Site Request Forgery
@ -68,12 +68,12 @@ class Admin_theme_3nids_Controller extends Admin_Controller {
$photo_size = Input::instance()->post("photo_size");
// Save Settings.
module::set_var("3nids", "description", $description);
module::set_var("3nids", "title", $title);
module::set_var("3nids", "photo_size", $photo_size);
module::set_var("three_nids", "description", $description);
module::set_var("three_nids", "title", $title);
module::set_var("three_nids", "photo_size", $photo_size);
// Display a success message and redirect back to the TagsMap admin page.
message::success(t("Your Settings Have Been Saved."));
url::redirect("admin/theme_3nids");
url::redirect("admin/theme_three_nids");
}
}

View File

@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
class Comments_3nids_Controller extends Items_Controller {
class Comments_three_nids_Controller extends Items_Controller {
public function _index() {
$item_id = $this->input->get('item_id');
@ -60,7 +60,7 @@ class Comments_3nids_Controller extends Items_Controller {
$item = ORM::factory("item", $this->input->post("item_id"));
access::required("view", $item);
$form = comment_3nids::get_add_form($item);
$form = comment_three_nids::get_add_form($item);
$valid = $form->validate();
if ($valid) {
if (user::active()->guest && !$form->add_comment->inputs["name"]->value) {
@ -93,7 +93,7 @@ class Comments_3nids_Controller extends Items_Controller {
$form->add_comment->url->value($active->url);
}
}
url::redirect(url::site("comments_3nids?item_id=".$item->id));
url::redirect(url::site("comments_three_nids?item_id=".$item->id));
}
/**
* Display an existing comment.
@ -131,7 +131,7 @@ class Comments_3nids_Controller extends Items_Controller {
access::required("view", $item);
access::required("edit", $item);
$form = comment_3nids::get_edit_form($comment);
$form = comment_three_nids::get_edit_form($comment);
if ($form->validate()) {
$comment->guest_name = $form->edit_comment->inputs["name"]->value;
$comment->guest_email = $form->edit_comment->email->value;
@ -170,7 +170,7 @@ class Comments_3nids_Controller extends Items_Controller {
$item = ORM::factory("item", $item_id);
access::required("view", $item);
print comment_3nids::get_add_form($item);
print comment_three_nids::get_add_form($item);
}
/**
@ -181,6 +181,6 @@ class Comments_3nids_Controller extends Items_Controller {
if (!user::active()->admin) {
access::forbidden();
}
print comment_3nids::get_edit_form($comment);
print comment_three_nids::get_edit_form($comment);
}
}

View File

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

Before

Width:  |  Height:  |  Size: 8.5 KiB

After

Width:  |  Height:  |  Size: 8.5 KiB

View File

Before

Width:  |  Height:  |  Size: 8.6 KiB

After

Width:  |  Height:  |  Size: 8.6 KiB

View File

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

Before

Width:  |  Height:  |  Size: 8.5 KiB

After

Width:  |  Height:  |  Size: 8.5 KiB

View File

Before

Width:  |  Height:  |  Size: 8.5 KiB

After

Width:  |  Height:  |  Size: 8.5 KiB

View File

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

View File

@ -23,7 +23,7 @@
*
* Note: by design, this class does not do any permission checking.
*/
class comment_3nids_Core {
class comment_three_nids_Core {
public function count($item) {
access::required("view", $item);
@ -78,7 +78,7 @@ class comment_3nids_Core {
}
static function get_add_form($item) {
$form = new Forge("comments_3nids?item_id=".$item->id, "", "post", array("id" => "gAddCommentForm"));
$form = new Forge("comments_three_nids?item_id=".$item->id, "", "post", array("id" => "gAddCommentForm"));
$group = $form->group("add_comment")->label(t("Add comment"));
$group->input("name") ->label(t("Name")) ->id("gAuthor");
$group->input("email") ->label(t("Email (hidden)")) ->id("gEmail");

View File

@ -18,14 +18,14 @@
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
class theme_3nids_Core {
class theme_three_nids_Core {
public function fancylink($item, $view_type="album", $group_img = true,
$display_comment = true, $parent_title_class = "h2") {
// view_type = album || dynamic || header
$link = "";
access::required("view", $item);
$photo_size = module::get_var("3nids", "photo_size");
$photo_size = module::get_var("three_nids", "photo_size");
if ($photo_size == "full" || $item->is_movie()){
$width = $item->width;
$height = $item->height;
@ -34,7 +34,7 @@ class theme_3nids_Core {
$height = $item->resize_height;
}
$description_mode = module::get_var("3nids", "description");
$description_mode = module::get_var("three_nids", "description");
$description = "";
$tags = tag::item_tags($item);
if(count($tags) && $description_mode == "tags"){
@ -46,7 +46,7 @@ class theme_3nids_Core {
$description = " || " . str_replace("\"", "&quot;", $item->parent()->description);
}
$title_mode = module::get_var("3nids", "title");
$title_mode = module::get_var("three_nids", "title");
if ($title_mode == "parent"){
$title = html::clean($item->parent()->title);
} else {
@ -64,8 +64,8 @@ class theme_3nids_Core {
$fancymodule .= "exif::" . url::site("exif/show/{$item->id}") . ";;";
}
if (module::is_active("comment")) {
$fancymodule .= "comment::" . url::site("comments_3nids?item_id={$item->id}") .
";;comment_count::" . comment_3nids::count($item) . ";;";
$fancymodule .= "comment::" . url::site("comments_three_nids?item_id={$item->id}") .
";;comment_count::" . comment_three_nids::count($item) . ";;";
}
if ($item->is_photo()){
$link .= "<a href=\"" . url::site("photos/{$item->id}") ."/?w=" . $width .
@ -102,8 +102,8 @@ class theme_3nids_Core {
if (($item->is_photo() || $item->is_movie()) && $display_comment &&
module::is_active("comment")) {
$link .= "<ul class=\"g-metadata\"><li><a href=\"" .
url::site("comments_3nids?item_id={$item->id}") .
"\" class=\"iframe fancyclass g-hidden\">" . comment_3nids::count($item) .
url::site("comments_three_nids?item_id={$item->id}") .
"\" class=\"iframe fancyclass g-hidden\">" . comment_three_nids::count($item) .
" " . t("comments") . "</a></li></ul>";
}
} else {

View File

@ -17,13 +17,13 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
class theme_3nids_event_Core {
class three_nids_event_Core {
static function admin_menu($menu, $theme) {
// Add a link to the TagsMap admin page to the Content menu.
// Add a link to the three_nids admin page to the Content menu.
$menu->get("content_menu")
->append(Menu::factory("link")
->id("3nids")
->label(t("Theme 3nids Settings"))
->url(url::site("admin/theme_3nids")));
->id("three_nids")
->label(t("three_nids Settings"))
->url(url::site("admin/three_nids")));
}
}

View File

@ -16,11 +16,9 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
class theme_3nids_theme {
class three_nids_theme {
static function credits($theme) {
return "<a href=\"http://codex.gallery2.org/Gallery3:Themes:3nids\">3nids theme</a>";
return "<a href=\"http://codex.gallery2.org/Gallery3:Themes:three_nids\">three_nids theme</a>";
}
}

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

Before

Width:  |  Height:  |  Size: 146 B

After

Width:  |  Height:  |  Size: 146 B

View File

Before

Width:  |  Height:  |  Size: 129 B

After

Width:  |  Height:  |  Size: 129 B

View File

Before

Width:  |  Height:  |  Size: 245 B

After

Width:  |  Height:  |  Size: 245 B

View File

Before

Width:  |  Height:  |  Size: 207 B

After

Width:  |  Height:  |  Size: 207 B

View File

Before

Width:  |  Height:  |  Size: 136 B

After

Width:  |  Height:  |  Size: 136 B

View File

Before

Width:  |  Height:  |  Size: 239 B

After

Width:  |  Height:  |  Size: 239 B

View File

Before

Width:  |  Height:  |  Size: 221 B

After

Width:  |  Height:  |  Size: 221 B

View File

Before

Width:  |  Height:  |  Size: 140 B

After

Width:  |  Height:  |  Size: 140 B

View File

Before

Width:  |  Height:  |  Size: 556 B

After

Width:  |  Height:  |  Size: 556 B

View File

Before

Width:  |  Height:  |  Size: 149 B

After

Width:  |  Height:  |  Size: 149 B

View File

Before

Width:  |  Height:  |  Size: 559 B

After

Width:  |  Height:  |  Size: 559 B

View File

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

Before

Width:  |  Height:  |  Size: 786 B

After

Width:  |  Height:  |  Size: 786 B

View File

Before

Width:  |  Height:  |  Size: 989 B

After

Width:  |  Height:  |  Size: 989 B

View File

Before

Width:  |  Height:  |  Size: 768 B

After

Width:  |  Height:  |  Size: 768 B

View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

Before

Width:  |  Height:  |  Size: 960 B

After

Width:  |  Height:  |  Size: 960 B

View File

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

View File

@ -4,7 +4,7 @@
</h2>
<div class="g-block">
<h3>
<?= t("3nids theme Settings") ?>
<?= t("three_nids theme Settings") ?>
</h3>
<?= $theme_form ?>
</div>

View File

@ -16,7 +16,7 @@ $children_offset = ($theme->pagination->current_page -1) * $page_size ;
<? if (count($children)): ?>
<? for ($i = 0; $i < $children_offset; $i++): ?>
<? $child = $children_all[$i] ?>
<?= theme_3nids::fancylink($child, "header") ?>
<?= theme_three_nids::fancylink($child, "header") ?>
<? endfor ?>
<? foreach ($children as $i => $child): ?>
@ -26,7 +26,7 @@ $children_offset = ($theme->pagination->current_page -1) * $page_size ;
<? endif ?>
<li id="g-item-id-<?= $child->id ?>" class="g-item <?= $item_class ?>">
<?= $theme->thumb_top($child) ?>
<?= theme_3nids::fancylink($child, "album") ?>
<?= theme_three_nids::fancylink($child, "album") ?>
<?= $theme->thumb_bottom($child) ?>
<?= $theme->context_menu($child, "#g-item-id-{$child->id} .g-thumbnail") ?>
</li>
@ -34,7 +34,7 @@ $children_offset = ($theme->pagination->current_page -1) * $page_size ;
<? for($i= $children_offset + $page_size; $i < $children_count; $i++): ?>
<? $child = $children_all[$i] ?>
<?= theme_3nids::fancylink($child, "header") ?>
<?= theme_three_nids::fancylink($child, "header") ?>
<? endfor ?>
<? else: ?>
<? if ($user->admin || access::can("add", $item)): ?>

View File

@ -10,7 +10,7 @@
<?= $theme->css("gallery.common.css") ?>
<?= $theme->css("jquery.fancybox.css") ?>
<?= $theme->css("screen.css") ?>
<?= $theme->css("3nids.css") ?>
<?= $theme->css("three_nids.css") ?>
<?= $theme->script("jquery.js") ?>
<?= $theme->script("jquery.form.js") ?>
<?= $theme->script("jquery-ui.js") ?>
@ -30,7 +30,7 @@
</head>
<body class="g-fancy-iframe-body">
<div class="g-comment-thumb"> <img src="<?=$thumb?>"></div>
<a href="<?= url::site("form/add/comments_3nids/{$item_id}") ?>" id="g-admin-comment-button"
<a href="<?= url::site("form/add/comments_three_nids/{$item_id}") ?>" id="g-admin-comment-button"
class="g-button ui-corner-all ui-icon-left ui-state-default right">
<span class="ui-icon ui-icon-comment"></span>
<?= t("Add a comment") ?>

View File

@ -14,7 +14,7 @@
<ul id="g-album-grid" class="ui-helper-clearfix">
<? for($i=0;$i<$children_offset;$i++): ?>
<? $child = $children_all[$i] ?>
<?= theme_3nids::fancylink($child,"header") ?>
<?= theme_three_nids::fancylink($child,"header") ?>
<? endfor ?>
<? foreach ($children as $i => $child): ?>
@ -22,7 +22,7 @@
<!--<li class="g-Item <?= $child->is_album() ? "g-album" : "" ?>">!-->
<li id="g-item-id-<?= $child->id ?>" class="g-item g-album">
<?= $theme->thumb_top($child) ?>
<?= theme_3nids::fancylink($child,"dynamic") ?>
<?= theme_three_nids::fancylink($child,"dynamic") ?>
<?= $theme->thumb_bottom($child) ?>
<?= $theme->context_menu($child, "#g-ItemId-{$child->id} .g-Thumbnail") ?>
</li>
@ -30,7 +30,7 @@
</ul>
<? for($i=$children_offset+$page_size;$i<$children_count;$i++): ?>
<? $child = $children_all[$i] ?>
<?= theme_3nids::fancylink($child,"header") ?>
<?= theme_three_nids::fancylink($child,"header") ?>
<? endfor ?>
<?= $theme->dynamic_bottom() ?>

View File

@ -0,0 +1,3 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<?= theme_three_nids::fancylink($item, "dynamic", false, false, "h4") ?>

View File

@ -10,7 +10,7 @@
<?= $theme->css("gallery.common.css") ?>
<?= $theme->css("jquery.fancybox.css") ?>
<?= $theme->css("screen.css") ?>
<?= $theme->css("3nids.css") ?>
<?= $theme->css("three_nids.css") ?>
<?= $theme->script("jquery.js") ?>
<?= $theme->script("jquery.form.js") ?>
<?= $theme->script("jquery-ui.js") ?>

View File

@ -36,7 +36,7 @@
<?= $theme->css("gallery.common.css") ?>
<?= $theme->css("jquery.fancybox.css") ?>
<?= $theme->css("screen.css") ?>
<?= $theme->css("3nids.css") ?>
<?= $theme->css("three_nids.css") ?>
<!--[if lt IE 8]>
<link rel="stylesheet" type="text/css" href="<?= $theme->url("css/fix-ie.css") ?>"
media="screen,print,projection" />

View File

@ -10,7 +10,7 @@
<?= $theme->css("gallery.common.css") ?>
<?= $theme->css("jquery.fancybox.css") ?>
<?= $theme->css("screen.css") ?>
<?= $theme->css("3nids.css") ?>
<?= $theme->css("three_nids.css") ?>
<?= $theme->script("jquery.js") ?>
<?= $theme->script("jquery.form.js") ?>
<?= $theme->script("jquery-ui.js") ?>
@ -30,7 +30,7 @@
</head>
<body class="g-fancy-iframe-body">
<div id="g-item-box">
<? if (module::get_var("3nids", "photo_size") == "full"): ?>
<? if (module::get_var("three_nids", "photo_size") == "full"): ?>
<img src="<?= $item->file_url() ?>" id="g-item-img"/>
<? else: ?>
<img src="<?= $item->resize_url() ?>" id="g-item-img"/>

View File

@ -13,19 +13,19 @@
<ul id="g-album-grid" class="ui-helper-clearfix">
<? for($i=0;$i<$children_offset;$i++): ?>
<? $child = $children_all[$i] ?>
<?= theme_3nids::fancylink($child,"header") ?>
<?= theme_three_nids::fancylink($child,"header") ?>
<? endfor ?>
<? foreach ($items as $child): ?>
<li id="g-item-id-<?= $child->id ?>" class="g-item g-album">
<?= $theme->thumb_top($child) ?>
<?= theme_3nids::fancylink($child,"dynamic") ?>
<?= theme_three_nids::fancylink($child,"dynamic") ?>
<?= $theme->thumb_bottom($child) ?>
<?= $theme->context_menu($child, "#g-item-id-{$child->id} .g-thumbnail") ?>
</li>
<? endforeach ?>
<? for($i=$children_offset+$page_size;$i<$children_count;$i++): ?>
<? $child = $children_all[$i] ?>
<?= theme_3nids::fancylink($child,"header") ?>
<?= theme_three_nids::fancylink($child,"header") ?>
<? endfor ?>
</ul>
<?= $theme->paginator() ?>