summaryrefslogtreecommitdiff
path: root/modules/tag/helpers
diff options
context:
space:
mode:
authormamouneyya <mamoun.diraneyya@gmail.com>2011-02-16 18:25:18 +0300
committermamouneyya <mamoun.diraneyya@gmail.com>2011-02-16 18:25:18 +0300
commit00772aaa62e6bce14e58e163ea72f386136c731d (patch)
treeed658d454d8bea79d551969fffa0bc18faee5d52 /modules/tag/helpers
parent3e2610ea83c60805d5e727df6509da6c49fd6c7b (diff)
parentd2c77fd0590501f7b6b51d9f4cc033ed9485b082 (diff)
Merge remote-tracking branch 'gallery3/master'
Diffstat (limited to 'modules/tag/helpers')
-rw-r--r--modules/tag/helpers/item_tags_rest.php2
-rw-r--r--modules/tag/helpers/tag.php6
-rw-r--r--modules/tag/helpers/tag_block.php2
-rw-r--r--modules/tag/helpers/tag_event.php17
-rw-r--r--modules/tag/helpers/tag_installer.php2
-rw-r--r--modules/tag/helpers/tag_item_rest.php2
-rw-r--r--modules/tag/helpers/tag_items_rest.php2
-rw-r--r--modules/tag/helpers/tag_rest.php2
-rw-r--r--modules/tag/helpers/tag_rss.php2
-rw-r--r--modules/tag/helpers/tag_task.php2
-rw-r--r--modules/tag/helpers/tag_theme.php12
-rw-r--r--modules/tag/helpers/tags_rest.php2
12 files changed, 33 insertions, 20 deletions
diff --git a/modules/tag/helpers/item_tags_rest.php b/modules/tag/helpers/item_tags_rest.php
index 02c79e5d..74505cf7 100644
--- a/modules/tag/helpers/item_tags_rest.php
+++ b/modules/tag/helpers/item_tags_rest.php
@@ -1,7 +1,7 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
- * Copyright (C) 2000-2010 Bharat Mediratta
+ * Copyright (C) 2000-2011 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
diff --git a/modules/tag/helpers/tag.php b/modules/tag/helpers/tag.php
index 14d27c94..733215b3 100644
--- a/modules/tag/helpers/tag.php
+++ b/modules/tag/helpers/tag.php
@@ -1,7 +1,7 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
- * Copyright (C) 2000-2010 Bharat Mediratta
+ * Copyright (C) 2000-2011 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
@@ -36,11 +36,9 @@ class tag_Core {
$tag = ORM::factory("tag")->where("name", "=", $tag_name)->find();
if (!$tag->loaded()) {
$tag->name = $tag_name;
- $tag->count = 0;
}
$tag->add($item);
- $tag->count++;
return $tag->save();
}
@@ -118,7 +116,7 @@ class tag_Core {
static function clear_all($item) {
db::build()
->update("tags")
- ->set("count", new Database_Expression("`count` - 1"))
+ ->set("count", db::expr("`count` - 1"))
->where("count", ">", 0)
->where("id", "IN", db::build()->select("tag_id")->from("items_tags")->where("item_id", "=", $item->id))
->execute();
diff --git a/modules/tag/helpers/tag_block.php b/modules/tag/helpers/tag_block.php
index 0473e4b2..8df58a6e 100644
--- a/modules/tag/helpers/tag_block.php
+++ b/modules/tag/helpers/tag_block.php
@@ -1,7 +1,7 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
- * Copyright (C) 2000-2010 Bharat Mediratta
+ * Copyright (C) 2000-2011 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
diff --git a/modules/tag/helpers/tag_event.php b/modules/tag/helpers/tag_event.php
index 829089c4..cd79f734 100644
--- a/modules/tag/helpers/tag_event.php
+++ b/modules/tag/helpers/tag_event.php
@@ -1,7 +1,7 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
- * Copyright (C) 2000-2010 Bharat Mediratta
+ * Copyright (C) 2000-2011 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
@@ -147,4 +147,19 @@ class tag_event_Core {
}
}
}
+
+ static function info_block_get_metadata($block, $item) {
+ $tags = array();
+ foreach (tag::item_tags($item) as $tag) {
+ $tags[] = "<a href=\"" . url::site("tag/{$tag->name}") . "\">{$tag->name}</a>";
+ }
+ if ($tags) {
+ $info = $block->content->metadata;
+ $info["tags"] = array(
+ "label" => t("Tags:"),
+ "value" => implode(", ", $tags)
+ );
+ $block->content->metadata = $info;
+ }
+ }
}
diff --git a/modules/tag/helpers/tag_installer.php b/modules/tag/helpers/tag_installer.php
index df6f0c65..16ad1239 100644
--- a/modules/tag/helpers/tag_installer.php
+++ b/modules/tag/helpers/tag_installer.php
@@ -1,7 +1,7 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
- * Copyright (C) 2000-2010 Bharat Mediratta
+ * Copyright (C) 2000-2011 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
diff --git a/modules/tag/helpers/tag_item_rest.php b/modules/tag/helpers/tag_item_rest.php
index 17cb726e..a8d3d0bc 100644
--- a/modules/tag/helpers/tag_item_rest.php
+++ b/modules/tag/helpers/tag_item_rest.php
@@ -1,7 +1,7 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
- * Copyright (C) 2000-2010 Bharat Mediratta
+ * Copyright (C) 2000-2011 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
diff --git a/modules/tag/helpers/tag_items_rest.php b/modules/tag/helpers/tag_items_rest.php
index 848c2cd3..535ab513 100644
--- a/modules/tag/helpers/tag_items_rest.php
+++ b/modules/tag/helpers/tag_items_rest.php
@@ -1,7 +1,7 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
- * Copyright (C) 2000-2010 Bharat Mediratta
+ * Copyright (C) 2000-2011 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
diff --git a/modules/tag/helpers/tag_rest.php b/modules/tag/helpers/tag_rest.php
index e0b7bd87..7f744a9e 100644
--- a/modules/tag/helpers/tag_rest.php
+++ b/modules/tag/helpers/tag_rest.php
@@ -1,7 +1,7 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
- * Copyright (C) 2000-2010 Bharat Mediratta
+ * Copyright (C) 2000-2011 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
diff --git a/modules/tag/helpers/tag_rss.php b/modules/tag/helpers/tag_rss.php
index f60bd908..a8947c84 100644
--- a/modules/tag/helpers/tag_rss.php
+++ b/modules/tag/helpers/tag_rss.php
@@ -1,7 +1,7 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
- * Copyright (C) 2000-2010 Bharat Mediratta
+ * Copyright (C) 2000-2011 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
diff --git a/modules/tag/helpers/tag_task.php b/modules/tag/helpers/tag_task.php
index 7bf50546..39df6c21 100644
--- a/modules/tag/helpers/tag_task.php
+++ b/modules/tag/helpers/tag_task.php
@@ -1,7 +1,7 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
- * Copyright (C) 2000-2010 Bharat Mediratta
+ * Copyright (C) 2000-2011 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
diff --git a/modules/tag/helpers/tag_theme.php b/modules/tag/helpers/tag_theme.php
index f731dbb7..c532e708 100644
--- a/modules/tag/helpers/tag_theme.php
+++ b/modules/tag/helpers/tag_theme.php
@@ -1,7 +1,7 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
- * Copyright (C) 2000-2010 Bharat Mediratta
+ * Copyright (C) 2000-2011 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
@@ -19,13 +19,13 @@
*/
class tag_theme_Core {
static function head($theme) {
- $theme->css("jquery.autocomplete.css");
- $theme->script("jquery.autocomplete.js");
- $theme->css("tag.css");
+ return $theme->css("jquery.autocomplete.css")
+ . $theme->script("jquery.autocomplete.js")
+ . $theme->css("tag.css");
}
static function admin_head($theme) {
- $theme->css("tag.css");
- $theme->script("gallery.in_place_edit.js");
+ return $theme->css("tag.css")
+ . $theme->script("gallery.in_place_edit.js");
}
} \ No newline at end of file
diff --git a/modules/tag/helpers/tags_rest.php b/modules/tag/helpers/tags_rest.php
index 4f40e7f4..8785ad79 100644
--- a/modules/tag/helpers/tags_rest.php
+++ b/modules/tag/helpers/tags_rest.php
@@ -1,7 +1,7 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
- * Copyright (C) 2000-2010 Bharat Mediratta
+ * Copyright (C) 2000-2011 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