summaryrefslogtreecommitdiff
path: root/modules/gallery
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gallery')
-rw-r--r--modules/gallery/helpers/movie.php2
-rw-r--r--modules/gallery/helpers/photo.php2
-rw-r--r--modules/gallery/libraries/Identity.php18
-rw-r--r--modules/gallery/libraries/drivers/Identity.php41
4 files changed, 9 insertions, 54 deletions
diff --git a/modules/gallery/helpers/movie.php b/modules/gallery/helpers/movie.php
index 32a27646..bc0efa01 100644
--- a/modules/gallery/helpers/movie.php
+++ b/modules/gallery/helpers/movie.php
@@ -77,7 +77,7 @@ class movie_Core {
$movie->title = $title;
$movie->description = $description;
$movie->name = $name;
- $movie->owner_id = $owner_id ? $owner_id : Identity::active();
+ $movie->owner_id = $owner_id ? $owner_id : Identity::active()->id;
$movie->width = $movie_info[0];
$movie->height = $movie_info[1];
$movie->mime_type = strtolower($pi["extension"]) == "mp4" ? "video/mp4" : "video/x-flv";
diff --git a/modules/gallery/helpers/photo.php b/modules/gallery/helpers/photo.php
index cf316819..ad23e322 100644
--- a/modules/gallery/helpers/photo.php
+++ b/modules/gallery/helpers/photo.php
@@ -76,7 +76,7 @@ class photo_Core {
$photo->title = $title;
$photo->description = $description;
$photo->name = $name;
- $photo->owner_id = $owner_id ? $owner_id : Identity::active();
+ $photo->owner_id = $owner_id ? $owner_id : Identity::active()->id;
$photo->width = $image_info[0];
$photo->height = $image_info[1];
$photo->mime_type = empty($image_info['mime']) ? "application/unknown" : $image_info['mime'];
diff --git a/modules/gallery/libraries/Identity.php b/modules/gallery/libraries/Identity.php
index 229d0da9..fb553de6 100644
--- a/modules/gallery/libraries/Identity.php
+++ b/modules/gallery/libraries/Identity.php
@@ -191,22 +191,8 @@ class Identity_Core {
/**
* @see Identity_Driver::get_user_list.
*/
- static function get_user_list($filter=array()) {
- return self::instance()->driver->get_user_list($filter);
- }
-
- /**
- * @see Identity_Driver::get_group_list.
- */
- static function get_group_list($filter=array()) {
- return self::instance()->driver->get_group_list($filter);
- }
-
- /**
- * @see Identity_Driver::get_edit_rules.
- */
- static function get_edit_rules($object_type) {
- return self::instance()->driver->get_edit_rules($object_type);
+ static function get_user_list($ids) {
+ return self::instance()->driver->get_user_list($ids);
}
static function get_login_form($url) {
diff --git a/modules/gallery/libraries/drivers/Identity.php b/modules/gallery/libraries/drivers/Identity.php
index 0b789908..a9e1a75b 100644
--- a/modules/gallery/libraries/drivers/Identity.php
+++ b/modules/gallery/libraries/drivers/Identity.php
@@ -83,37 +83,11 @@ interface Identity_Driver {
/**
* List the users
- * @param mixed options to apply to the selection of the user
- * currently supported:
- * "orderby" => array(<field name>, "ASC|DESC")
- * "in" => array(<field name>, array(values, ...))
- * "where" => array(<field name>, value)
- * <field name> follows Kohana syntax where it could contain the first
- * half of a logical expression (i.e. "field IS NOT")
- * @return array the group list.
+ * @param array array of ids to return the user objects for
+ * @return array the user list.
*/
- public function get_user_list($filter=array());
+ public function get_user_list($ids);
- /**
- * List the groups
- * @param mixed options to apply to the selection of the group
- * currently supported:
- * "orderby" => array(<field name>, "ASC|DESC")
- * "in" => array(<field name>, array(values, ...))
- * "where" => array(<field name>, value)
- * <field name> follows Kohana syntax where it could contain the first
- * half of a logical expression (i.e. "field IS NOT")
- * @return array the group list.
- */
- public function get_group_list($filter=array());
-
- /**
- * Return the edit rules associated with an group.
- *
- * @param string $object_type to return rules for ("user"|"group")
- * @return stdClass containing the rules
- */
- public function get_edit_rules($object_type);
} // End Identity Driver Definition
/**
@@ -205,19 +179,14 @@ abstract class User_Definition {
* @param integer $size the target size of the image (default 80px)
* @return string a url
*/
- public function avatar_url($size=80, $default=null) {
- return sprintf("http://www.gravatar.com/avatar/%s.jpg?s=%d&r=pg%s",
- md5($this->user->email), $size, $default ? "&d=" . urlencode($default) : "");
- }
+ abstract public function avatar_url($size=80, $default=null);
/**
* Return the best version of the user's name. Either their specified full name, or fall back
* to the user name.
* @return string
*/
- public function display_name() {
- return empty($this->user->full_name) ? $this->user->name : $this->user->full_name;
- }
+ abstract public function display_name();
/**
* Return the internal user object without the wrapper.