aboutsummaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
Diffstat (limited to 'actions')
-rw-r--r--actions/photos/admin/settings.php8
-rw-r--r--actions/photos/admin/upgrade.php4
-rw-r--r--actions/photos/image/tag.php109
-rw-r--r--actions/photos/image/untag.php24
-rw-r--r--actions/photos/image/upload.php1
5 files changed, 6 insertions, 140 deletions
diff --git a/actions/photos/admin/settings.php b/actions/photos/admin/settings.php
index 1a4a4bdda..aa607756d 100644
--- a/actions/photos/admin/settings.php
+++ b/actions/photos/admin/settings.php
@@ -6,12 +6,10 @@
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2
*/
-$plugin = elgg_get_plugin_from_id('tidypics');
-
$params = get_input('params');
foreach ($params as $k => $v) {
- if (!$plugin->setSetting($k, $v)) {
- register_error(elgg_echo('plugins:settings:save:fail', array('tidypics')));
+ if (!elgg_set_plugin_setting($k, $v, 'lightpics')) {
+ register_error(elgg_echo('plugins:settings:save:fail', array('lightpics')));
forward(REFERER);
}
}
@@ -24,7 +22,7 @@ $image_sizes['small_image_width'] = get_input('small_image_width');
$image_sizes['small_image_height'] = get_input('small_image_height');
$image_sizes['tiny_image_width'] = get_input('tiny_image_width');
$image_sizes['tiny_image_height'] = get_input('tiny_image_height');
-$plugin->setSetting('image_sizes', serialize($image_sizes));
+elgg_set_plugin_setting('image_sizes', serialize($image_sizes), 'lightpics');
system_message(elgg_echo('tidypics:settings:save:ok'));
diff --git a/actions/photos/admin/upgrade.php b/actions/photos/admin/upgrade.php
index c9ae1da48..8e03c6bc5 100644
--- a/actions/photos/admin/upgrade.php
+++ b/actions/photos/admin/upgrade.php
@@ -5,7 +5,7 @@
$plugins_path = elgg_get_plugins_path();
-require_once "{$plugins_path}tidypics/version.php";
+require_once "{$plugins_path}lightpics/version.php";
$local_version = elgg_get_plugin_setting('version', 'tidypics');
@@ -16,7 +16,7 @@ if ($version <= $local_version) {
set_time_limit(0);
-$base_dir = "{$plugins_path}tidypics/upgrades";
+$base_dir = "{$plugins_path}lightpics/upgrades";
// taken from engine/lib/version.php
if ($handle = opendir($base_dir)) {
diff --git a/actions/photos/image/tag.php b/actions/photos/image/tag.php
deleted file mode 100644
index e623bd546..000000000
--- a/actions/photos/image/tag.php
+++ /dev/null
@@ -1,109 +0,0 @@
-<?php
-/**
- * Add photo tag action
- *
- * @author Cash Costello
- * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2
- */
-
-$coordinates_str = get_input('coordinates');
-$username = get_input('username');
-$image_guid = get_input('guid');
-
-if ($image_guid == 0) {
- register_error(elgg_echo("tidypics:phototagging:error"));
- forward(REFERER);
-}
-
-$image = get_entity($image_guid);
-if (!$image) {
- register_error(elgg_echo("tidypics:phototagging:error"));
- forward(REFERER);
-}
-
-if (empty($username)) {
- register_error(elgg_echo("tidypics:phototagging:error"));
- forward(REFERER);
-}
-
-$user = get_user_by_username($username);
-if (!$user) {
- // plain tag
- $relationships_type = 'word';
- $value = $username;
-} else {
- $relationships_type = 'user';
- $value = $user->guid;
-}
-
-/* // not adding as plain tag yet
-$new_word_tag = false;
-if ($user_id != 0) {
- $relationships_type = 'user';
- $value = $user_id;
-} else {
- $relationships_type = 'word';
- $value = $word;
-
- // check to see if the photo has this tag and add if not
- if (!is_array($image->tags)) {
- if ($image->tags != $word) {
- $new_word_tag = true;
- $tagarray = $image->tags . ',' . $word;
- $tagarray = string_to_tag_array($tagarray);
- }
- } else {
- if (!in_array($word, $image->tags)) {
- $new_word_tag = true;
- $tagarray = $image->tags;
- $tagarray[] = $word;
- }
- }
-}
-
-// add new tag now so it is available in search
-if ($new_word_tag) {
- $image->clearMetadata('tags');
- $image->tags = $tagarray;
-}
-*/
-
-$tag = new stdClass();
-$tag->coords = $coordinates_str;
-$tag->type = $relationships_type;
-$tag->value = $value;
-$access_id = $image->getAccessID();
-
-$annotation_id = $image->annotate('phototag', serialize($tag), $access_id);
-if ($annotation_id) {
- // if tag is a user id, add relationship for searching (find all images with user x)
- if ($tag->type === 'user') {
- if (!check_entity_relationship($tag->value, 'phototag', $image_guid)) {
- add_entity_relationship($tag->value, 'phototag', $image_guid);
-/*
- // also add this to the river - subject is image, object is the tagged user
- add_to_river('river/object/image/tag', 'tag', $tagger->guid, $user_id, $access_id, 0, $annotation_id);
-
- // notify user of tagging as long as not self
- if ($owner_id != $user_id) {
- notify_user(
- $user_id,
- $owner_id,
- elgg_echo('tidypics:tag:subject'),
- sprintf(
- elgg_echo('tidypics:tag:body'),
- $image->getTitle(),
- $tagger->name,
- $image->getURL()
- )
- );
- }
- *
- */
- }
- }
-
- system_message(elgg_echo("tidypics:phototagging:success"));
-}
-
-forward(REFERER);
diff --git a/actions/photos/image/untag.php b/actions/photos/image/untag.php
deleted file mode 100644
index 11c433a61..000000000
--- a/actions/photos/image/untag.php
+++ /dev/null
@@ -1,24 +0,0 @@
-<?php
-/**
- * Remove photo tag action
- */
-
-$annotation = elgg_get_annotation_from_id(get_input('annotation_id'));
-
-if (!$annotation instanceof ElggAnnotation || $annotation->name != 'phototag') {
- register_error(elgg_echo("tidypics:phototagging:delete:error"));
- forward(REFERER);
-}
-
-if (!$annotation->canEdit()) {
- register_error(elgg_echo("tidypics:phototagging:delete:error"));
- forward(REFERER);
-}
-
-if ($annotation->delete()) {
- system_message(elgg_echo("tidypics:phototagging:delete:success"));
-} else {
- system_message(elgg_echo("tidypics:phototagging:delete:error"));
-}
-
-forward(REFERER);
diff --git a/actions/photos/image/upload.php b/actions/photos/image/upload.php
index cb0a2f90d..2dd0959bf 100644
--- a/actions/photos/image/upload.php
+++ b/actions/photos/image/upload.php
@@ -53,6 +53,7 @@ foreach ($_FILES['images']['name'] as $index => $value) {
$mime = tp_upload_get_mimetype($data['name']);
$image = new TidypicsImage();
+ $image->title = $data['name'];
$image->container_guid = $album->getGUID();
$image->setMimeType($mime);
$image->access_id = $album->access_id;