aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2011-11-10 07:31:37 -0500
committerCash Costello <cash.costello@gmail.com>2011-11-10 07:31:37 -0500
commited5637b991ab341ead6a97276f313b84f263a145 (patch)
tree5eba0a60c722dc55f12837d30ee867412a67cfa1
parent59811d171349c3b903fef77a6ca7268d79b3edc4 (diff)
downloadelgg-ed5637b991ab341ead6a97276f313b84f263a145.tar.gz
elgg-ed5637b991ab341ead6a97276f313b84f263a145.tar.bz2
moved classes into classes directory
-rw-r--r--classes/TidypicsAlbum.php (renamed from lib/album.php)0
-rw-r--r--classes/TidypicsImage.php (renamed from lib/image.php)49
-rw-r--r--lib/tidypics.php45
-rw-r--r--start.php6
4 files changed, 50 insertions, 50 deletions
diff --git a/lib/album.php b/classes/TidypicsAlbum.php
index e178acd5d..e178acd5d 100644
--- a/lib/album.php
+++ b/classes/TidypicsAlbum.php
diff --git a/lib/image.php b/classes/TidypicsImage.php
index f6ecd8ad9..531d54912 100644
--- a/lib/image.php
+++ b/classes/TidypicsImage.php
@@ -108,7 +108,7 @@ class TidypicsImage extends ElggFile {
* @param string $imageLib
*/
public function saveThumbnails($imageLib) {
- include_once dirname(__FILE__) . "/resize.php";
+ include_once dirname(dirname(__FILE__)) . "/lib/resize.php";
$prefix = "image/" . $this->container_guid . "/";
$filename = $this->getFilename();
@@ -137,7 +137,7 @@ class TidypicsImage extends ElggFile {
* @warning image file must be saved first
*/
public function extractExifData() {
- include_once dirname(__FILE__) . "/exif.php";
+ include_once dirname(dirname(__FILE__)) . "/lib/exif.php";
td_get_exif($this);
}
@@ -290,48 +290,3 @@ class TidypicsImage extends ElggFile {
}
}
}
-
-/**
- * get a list of people that can be tagged in an image
- *
- * @param $viewer entity
- * @return array of guid->name for tagging
- */
-function tp_get_tag_list($viewer) {
- $friends = get_user_friends($viewer->getGUID(), '', 999, 0);
- $friend_list = array();
- if ($friends) {
- foreach($friends as $friend) {
- //error_log("friend $friend->name");
- $friend_list[$friend->guid] = $friend->name;
- }
- }
-
- // is this a group
- $is_group = tp_is_group_page();
- if ($is_group) {
- $group_guid = page_owner();
- $viewer_guid = $viewer->guid;
- $members = get_group_members($group_guid, 999);
- if (is_array($members)) {
- foreach ($members as $member) {
- if ($viewer_guid != $member->guid) {
- $group_list[$member->guid] = $member->name;
- //error_log("group $member->name");
- }
- }
-
- // combine group and friends list
- $intersect = array_intersect_key($friend_list, $group_list);
- $unique_friends = array_diff_key($friend_list, $group_list);
- $unique_members = array_diff_key($group_list, $friend_list);
- //$friend_list = array_merge($friend_list, $group_list);
- //$friend_list = array_unique($friend_list);
- $friend_list = $intersect + $unique_friends + $unique_members;
- }
- }
-
- asort($friend_list);
-
- return $friend_list;
-}
diff --git a/lib/tidypics.php b/lib/tidypics.php
index 581503a51..8fcfc22c9 100644
--- a/lib/tidypics.php
+++ b/lib/tidypics.php
@@ -187,3 +187,48 @@ function tp_is_person() {
return false;
}
+
+/**
+ * get a list of people that can be tagged in an image
+ *
+ * @param $viewer entity
+ * @return array of guid->name for tagging
+ */
+function tp_get_tag_list($viewer) {
+ $friends = get_user_friends($viewer->getGUID(), '', 999, 0);
+ $friend_list = array();
+ if ($friends) {
+ foreach($friends as $friend) {
+ //error_log("friend $friend->name");
+ $friend_list[$friend->guid] = $friend->name;
+ }
+ }
+
+ // is this a group
+ $is_group = tp_is_group_page();
+ if ($is_group) {
+ $group_guid = page_owner();
+ $viewer_guid = $viewer->guid;
+ $members = get_group_members($group_guid, 999);
+ if (is_array($members)) {
+ foreach ($members as $member) {
+ if ($viewer_guid != $member->guid) {
+ $group_list[$member->guid] = $member->name;
+ //error_log("group $member->name");
+ }
+ }
+
+ // combine group and friends list
+ $intersect = array_intersect_key($friend_list, $group_list);
+ $unique_friends = array_diff_key($friend_list, $group_list);
+ $unique_members = array_diff_key($group_list, $friend_list);
+ //$friend_list = array_merge($friend_list, $group_list);
+ //$friend_list = array_unique($friend_list);
+ $friend_list = $intersect + $unique_friends + $unique_members;
+ }
+ }
+
+ asort($friend_list);
+
+ return $friend_list;
+}
diff --git a/start.php b/start.php
index 3543dede1..167db651e 100644
--- a/start.php
+++ b/start.php
@@ -10,9 +10,9 @@ define('TP_OLD_ALBUM', 0);
define('TP_NEW_ALBUM', 1);
// include core libraries
-include dirname(__FILE__) . "/lib/tidypics.php";
-include dirname(__FILE__) . "/lib/image.php";
-include dirname(__FILE__) . "/lib/album.php";
+require dirname(__FILE__) . "/lib/tidypics.php";
+require dirname(__FILE__) . "/classes/TidypicsImage.php";
+require dirname(__FILE__) . "/classes/TidypicsAlbum.php";
// Make sure tidypics_init is called on initialization