]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Merged r6757:6810 from 1.7 branch into trunk
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Sun, 22 Aug 2010 23:15:43 +0000 (23:15 +0000)
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Sun, 22 Aug 2010 23:15:43 +0000 (23:15 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@6850 36083f99-b078-4883-b0ff-0f9b5a30f544

57 files changed:
CHANGES.txt
actions/notifications/settings/usersettings/save.php
actions/user/default_access.php
engine/lib/access.php
engine/lib/actions.php
engine/lib/annotations.php
engine/lib/api.php
engine/lib/cache.php
engine/lib/database.php
engine/lib/elgglib.php
engine/lib/entities.php
engine/lib/extender.php
engine/lib/filestore.php
engine/lib/group.php
engine/lib/install.php
engine/lib/languages.php
engine/lib/location.php
engine/lib/mb_wrapper.php
engine/lib/memcache.php
engine/lib/metadata.php
engine/lib/notification.php
engine/lib/objects.php
engine/lib/pam.php
engine/lib/plugins.php
engine/lib/query.php
engine/lib/relationships.php
engine/lib/river.php
engine/lib/sessions.php
engine/lib/sites.php
engine/lib/tags.php
engine/lib/users.php
engine/lib/views.php
engine/lib/widgets.php
engine/lib/xml-rpc.php
languages/en.php
mod/friends/add.php [deleted file]
mod/friends/collections.php [deleted file]
mod/friends/edit.php [deleted file]
mod/friends/languages/en.php
mod/friends/start.php
mod/friends/views/default/widgets/friends/edit.php
mod/friends/views/default/widgets/friends/view.php
mod/htmlawed/start.php
mod/messages/start.php
mod/messages/views/default/widgets/messages/edit.php [deleted file]
mod/messages/views/default/widgets/messages/view.php [deleted file]
mod/pages/languages/en.php
mod/riverdashboard/languages/en.php
services/export/handler.php
views/default/account/forms/useradd.php
views/default/friends/collection.php
views/default/friends/collectiontabs.php
views/default/input/autocomplete.php
views/default/page_elements/title.php
views/default/usersettings/plugins_opt/plugin.php
views/default/usersettings/statistics_opt/numentities.php
views/default/usersettings/statistics_opt/online.php

index 22615012eba81b0a2e8c2ef5d65c292c734f1a80..dcf33bce75bd01c4349cb922e2153215846b3f34 100644 (file)
@@ -17,6 +17,32 @@ Version 1.8.0 (Jackie)
     elgg_clear_sticky_form(), elgg_is_sticky_form(), and elgg_get_sticky_value().
 
 
+Version 1.7.2
+(xxxxx from http://code.elgg.org/elgg/branches/1.7)
+
+ UI Changes:
+  * Group "widgets" have been standardized with new blog and bookmark widgets.
+  * New group member listing page.
+  * Group forum topics can be edited including title and status.
+  * Added a group creation river entry.
+
+ Bugfixes:
+  * Fixed preview and draft saving for blog plugin.
+  * Page titles are now editable.
+  * Fixed several bugs with the new elgg_get* and elgg_list* functions.
+  * Groups do not show up as personal friend collections anymore.
+  * Fixed an upgrade issue with utf8 usernames.
+  * Encoding of & in group forums is fixed.
+
+ API changes:
+  * Added elgg_list_entities_from_metadata().
+  * Added elgg_send_email().
+  * Added remove_from_river_by_id().
+  * Added remove_from_register() for removing menu items.
+  * Added elgg_get_excerpt().
+  * Added elgg_get_friendly_title() and elgg_get_friendly_time().
+
+
 Version 1.7.1
 (April 21, 2010 from http://code.elgg.org/elgg/branches/1.7)
 
index 159dd501b3f17195fef65b859a19f3b72350f799..7df0e7e5cefa3da5411474372f9d78cf19bd6aea 100644 (file)
 $method = get_input('method');
 gatekeeper();
 
+$current_settings = get_user_notification_settings();
+
 $result = false;
 foreach ($method as $k => $v) {
-       $result = set_user_notification_setting($_SESSION['user']->guid, $k, ($v == 'yes') ? true : false);
+       // check if setting has changed and skip if not
+       if ($current_settings->$k == ($v == 'yes')) {
+               continue;
+       }
+
+       $result = set_user_notification_setting(get_loggedin_userid(), $k, ($v == 'yes') ? true : false);
 
        if (!$result) {
                register_error(elgg_echo('notifications:usersettings:save:fail'));
@@ -23,6 +30,4 @@ foreach ($method as $k => $v) {
 
 if ($result) {
        system_message(elgg_echo('notifications:usersettings:save:ok'));
-} else {
-       register_error(elgg_echo('notifications:usersettings:save:fail'));
-}
\ No newline at end of file
+}
index 0aacf209c018b7d2df93dc259c42cdcfa560bec3..845e1fbfc3f0f6e8ff3398530d547a2d3683999d 100644 (file)
@@ -24,8 +24,8 @@ if ($CONFIG->allow_user_default_access) {
 
        if ($user) {
                $current_default_access = $user->getPrivateSetting('elgg_default_access');
-               if ($default_access != $current_default_access) {
-                       if ($user->setPrivateSetting('elgg_default_access',$default_access)) {
+               if ($default_access !== $current_default_access) {
+                       if ($user->setPrivateSetting('elgg_default_access', $default_access)) {
                                system_message(elgg_echo('user:default_access:success'));
                        } else {
                                register_error(elgg_echo('user:default_access:fail'));
index b8d8820e131c99b291e6f0ab4b3218710ea954f0..39f7925c6a73d099b35cb6fb0dbdd5a7e35d763f 100644 (file)
@@ -188,7 +188,7 @@ function get_default_access(ElggUser $user = null) {
  * Override the default behaviour and allow results to show hidden entities as well.
  * THIS IS A HACK.
  *
- * TODO: Replace this with query object!
+ * @todo Replace this with query object!
  */
 $ENTITY_SHOW_HIDDEN_OVERRIDE = false;
 
@@ -216,13 +216,13 @@ function access_get_show_hidden_status() {
  * Returns an SQL fragment that is true (or optionally false) if the given user has
  * added an annotation with the given name to the given entity.
  *
- * TODO: This is fairly generic so perhaps it could be moved to annotations.php
+ * @todo This is fairly generic so perhaps it could be moved to annotations.php
  *
  * @param string $annotation_name name of the annotation
      * @param string $entity_guid SQL string that evaluates to the GUID of the entity the annotation should be attached to
      * @param string $owner_guid SQL string that evaluates to the GUID of the owner of the annotation                 *
      * @param boolean $exists If set to true, will return true if the annotation exists, otherwise returns false
      * @return string An SQL fragment suitable for inserting into a WHERE clause
+ * @param string $entity_guid SQL string that evaluates to the GUID of the entity the annotation should be attached to
* @param string $owner_guid SQL string that evaluates to the GUID of the owner of the annotation               *
+ * @param boolean $exists If set to true, will return true if the annotation exists, otherwise returns false
+ * @return string An SQL fragment suitable for inserting into a WHERE clause
  */
 function get_annotation_sql($annotation_name, $entity_guid, $owner_guid, $exists) {
        global $CONFIG;
@@ -246,7 +246,7 @@ END;
 /**
  * Add access restriction sql code to a given query.
  * Note that if this code is executed in privileged mode it will return blank.
- * @TODO: DELETE once Query classes are fully integrated
+ * @todo DELETE once Query classes are fully integrated
  *
  * @param string $table_prefix Optional table. prefix for the access code.
  * @param int $owner
@@ -734,7 +734,7 @@ function get_entities_from_access_id($collection_id, $entity_type = "", $entity_
  * @param int $collection_id
  * @param array $options @see elgg_get_entities()
  * @return array
- * @since 1.7
+ * @since 1.7.0
  */
 function elgg_get_entities_from_access_id(array $options=array()) {
        // restrict the resultset to access collection provided
@@ -785,7 +785,8 @@ function list_entities_from_access_id($collection_id, $entity_type = "", $entity
  *
  * @param $entity_accessid (int) The entity's access id
  * @return string e.g. Public, Private etc
- **/
+ * @since 1.7.0
+ */
 function get_readable_access_level($entity_accessid){
        $access = (int) $entity_accessid;
        //get the access level for object in readable string
@@ -804,6 +805,7 @@ function get_readable_access_level($entity_accessid){
  * Set if entity access system should be ignored.
  *
  * @return bool Previous ignore_access setting.
+ * @since 1.7.0
  */
 function elgg_set_ignore_access($ignore = true) {
        $elgg_access = elgg_get_access_object();
@@ -814,6 +816,7 @@ function elgg_set_ignore_access($ignore = true) {
  * Get current ignore access setting.
  *
  * @return bool
+ * @since 1.7.0
  */
 function elgg_get_ignore_access() {
        return elgg_get_access_object()->get_ignore_access();
@@ -823,6 +826,7 @@ function elgg_get_ignore_access() {
  * Decides if the access system is being ignored.
  *
  * @return bool
+ * @since 1.7.0
  */
 function elgg_check_access_overrides($user_guid = null) {
        if (!$user_guid || $user_guid <= 0) {
@@ -838,6 +842,7 @@ function elgg_check_access_overrides($user_guid = null) {
  * Returns the ElggAccess object.
  *
  * @return ElggAccess
+ * @since 1.7.0
  */
 function elgg_get_access_object() {
        static $elgg_access;
@@ -865,6 +870,7 @@ function access_init() {
  * Override permissions system
  *
  * @return true|null
+ * @since 1.7.0
  */
 function elgg_override_permissions_hook($hook, $type, $returnval, $params) {
        $user_guid = get_loggedin_userid();
index 47c0bf7af82bd6cce4ade4512cd276f8dbe7cf6f..c7abd5f181eee2e709ce14623057fb98d86b5ab3 100644 (file)
@@ -54,14 +54,15 @@ function action($action, $forwarder = "") {
                if ((isadminloggedin()) || (!$CONFIG->actions[$action]['admin'])) {
                        if ($CONFIG->actions[$action]['public'] || get_loggedin_userid()) {
 
-                               // Trigger action event TODO: This is only called before the primary action is called. We need to rethink actions for 1.5
+                               // Trigger action event
+                               // @todo This is only called before the primary action is called. We need to rethink actions for 1.5
                                $event_result = true;
                                $event_result = trigger_plugin_hook('action', $action, null, $event_result);
 
                                // Include action
                                // Event_result being false doesn't produce an error -
                                // since i assume this will be handled in the hook itself.
-                               // TODO make this better!
+                               // @todo make this better!
                                if ($event_result) {
                                        if (!include($CONFIG->actions[$action]['file'])) {
                                                register_error(sprintf(elgg_echo('actionundefined'),$action));
index c960da014e433848a675b8b79fc2f2c154822e1f..dcb29d0abed3b237c4d782bc97e327343597943a 100644 (file)
@@ -450,6 +450,7 @@ $value = "", $owner_guid = 0, $limit = 10, $offset = 0, $order_by = "asc", $time
  *  annotation_owner_guids => NULL|ARR guids for annotaiton owners
  *
  * @return array
+ * @since 1.7.0
  */
 function elgg_get_entities_from_annotations(array $options = array()) {
        $defaults = array(
index a3869d262637516f893d068b1d4729b26f7698a0..82377410892ab6de2ed4546eb833d8c83d4d2905 100644 (file)
@@ -389,6 +389,7 @@ function expose_function($method, $function, array $parameters = NULL, $descript
 /**
  * Unregister an API method
  * @param string $method The api name that was exposed
+ * @since 1.7.0
  */
 function unexpose_function($method) {
        global $API_METHODS;
@@ -403,6 +404,7 @@ function unexpose_function($method) {
  * @param string $method The api name that was exposed
  * @return true or throws an exception
  * @throws APIException
+ * @since 1.7.0
  */
 function authenticate_method($method) {
        global $API_METHODS;
@@ -557,6 +559,7 @@ function get_post_data() {
 
 /**
  * This fixes the post parameters that are munged due to page handler
+ * @since 1.7.0
  */
 function include_post_data() {
 
@@ -578,6 +581,7 @@ function include_post_data() {
  * @param $parameters
  * @return true on success or exception
  * @throws APIException
+ * @since 1.7.0
  */
 function verify_parameters($method, $parameters) {
        global $API_METHODS;
@@ -610,6 +614,7 @@ function verify_parameters($method, $parameters) {
  * @param array $parameters Array of parameters
  * @return string or exception
  * @throws APIException
+ * @since 1.7.0
  */
 function serialise_parameters($method, $parameters) {
        global $API_METHODS;
@@ -688,6 +693,7 @@ function serialise_parameters($method, $parameters) {
  * PAM: Confirm that the call includes a valid API key
  * @return true if good API key - otherwise throws exception
  * @throws APIException
+ * @since 1.7.0
  */
 function api_auth_key() {
        global $CONFIG;
@@ -715,6 +721,7 @@ function api_auth_key() {
  * PAM: Confirm the HMAC signature
  * @return true if success - otherwise throws exception
  * @throws SecurityException
+ * @since 1.7.0
  */
 function api_auth_hmac() {
        global $CONFIG;
@@ -850,7 +857,7 @@ function get_and_validate_api_headers() {
 function map_api_hash($algo) {
        $algo = strtolower(sanitise_string($algo));
        $supported_algos = array(
-               "md5" => "md5", // TODO: Consider phasing this out
+               "md5" => "md5", // @todo Consider phasing this out
                "sha" => "sha1", // alias for sha1
                "sha1" => "sha1",
                "sha256" => "sha256"
@@ -897,7 +904,7 @@ function calculate_hmac($algo, $time, $nonce, $api_key, $secret_key, $get_variab
 /**
  * Calculate a hash for some post data.
  *
- * TODO: Work out how to handle really large bits of data.
+ * @todo Work out how to handle really large bits of data.
  *
  * @param string $postdata string The post data.
  * @param string $algo The algorithm used.
@@ -1094,6 +1101,7 @@ function create_user_token($username, $expire = 60) {
  * @param int $site_guid The ID of the site (default is current site)
  * @return false if none available or array of stdClass objects
  *             (see users_apisessions schema for available variables in objects)
+ * @since 1.7.0
  */
 function get_user_tokens($user_guid, $site_guid) {
        global $CONFIG;
@@ -1149,6 +1157,7 @@ function validate_user_token($token, $site_guid) {
  * @param string $token
  * @param int $site_guid The ID of the site (default is current site)
  * @return bool
+ * @since 1.7.0
  */
 function remove_user_token($token, $site_guid) {
        global $CONFIG;
@@ -1168,6 +1177,7 @@ function remove_user_token($token, $site_guid) {
  * Remove expired tokens
  *
  * @return bool
+ * @since 1.7.0
  */
 function remove_expired_user_tokens() {
        global $CONFIG;
@@ -1474,6 +1484,7 @@ function service_handler($handler, $request) {
  * @param string $handler web services type
  * @param string $function Your function name
  * @return true|false Depending on success
+ * @since 1.7.0
  */
 function register_service_handler($handler, $function) {
        global $CONFIG;
@@ -1494,6 +1505,7 @@ function register_service_handler($handler, $function) {
  * with register_service_handler().
  *
  * @param string $handler web services type
+ * @return 1.7.0
  */
 function unregister_service_handler($handler) {
        global $CONFIG;
index df7b1e5254c5d811e51d5d409f13ca316f08df94..e227ba7709388bd01355d15fb8b03c925ffe5fa9 100644 (file)
@@ -332,7 +332,7 @@ class ElggFileCache extends ElggCache {
         * @param string $filename
         */
        protected function sanitise_filename($filename) {
-               // TODO : Writeme
+               // @todo : Writeme
 
                return $filename;
        }
@@ -397,11 +397,11 @@ class ElggFileCache extends ElggCache {
        }
 
        public function clear() {
-               // TODO : writeme
+               // @todo writeme
        }
 
        public function __destruct() {
-               // TODO: Check size and age, clean up accordingly
+               // @todo Check size and age, clean up accordingly
                $size = 0;
                $dir = $this->get_variable("cache_path");
 
@@ -430,7 +430,7 @@ class ElggFileCache extends ElggCache {
                                        unlink($dir.$f);
                                }
 
-                               // TODO: Size
+                               // @todo Size
                        }
                }
        }
index c8945e2d16a18b48c4dbd9b5e9b70c86263c3407..798f3ef591d3ffb4a050b5751a2262c47cbcb251 100644 (file)
@@ -577,7 +577,7 @@ function db_upgrade($version, $fromdir = "", $quiet = FALSE) {
  * This function, called by validate_platform(), will check whether the installed version of
  * MySQL meets the minimum required.
  *
- * TODO: If multiple dbs are supported check which db is supported and use the appropriate code to validate
+ * @todo If multiple dbs are supported check which db is supported and use the appropriate code to validate
  * the appropriate version.
  *
  * @return bool
index 1d52c05343e30b4ec683f1e9ca17812cdfee5f36..9a09d4f72443c2f56caafe1bfc054ad77d57723a 100644 (file)
@@ -85,8 +85,8 @@ function current_page_url() {
 /**
  * This is a factory function which produces an ElggCache object suitable for caching file load paths.
  *
- * TODO: Can this be done in a cleaner way?
- * TODO: Swap to memcache etc?
+ * @todo Can this be done in a cleaner way?
+ * @todo Swap to memcache etc?
  */
 function elgg_get_filepath_cache() {
        global $CONFIG;
@@ -654,6 +654,7 @@ function add_to_register($register_name, $subregister_name, $subregister_value,
  * @param string $register_name The name of the top-level register
  * @param string $subregister_name The name of the subregister
  * @return true|false Depending on success
+ * @since 1.7.0
  */
 function remove_from_register($register_name, $subregister_name) {
        global $CONFIG;
@@ -963,6 +964,7 @@ function register_elgg_event_handler($event, $object_type, $function, $priority
  * @param string $event The event type
  * @param string $object_type The object type
  * @param string $function The function name
+ * @since 1.7.0
  */
 function unregister_elgg_event_handler($event, $object_type, $function) {
        global $CONFIG;
@@ -1046,6 +1048,7 @@ function register_plugin_hook($hook, $type, $function, $priority = 500) {
  * @param string $hook The name of the hook
  * @param string $entity_type The name of the type of entity (eg "user", "object" etc)
  * @param string $function The name of a valid function to be run
+ * @since 1.7.0
  */
 function unregister_plugin_hook($hook, $entity_type, $function) {
        global $CONFIG;
@@ -1130,7 +1133,7 @@ function __elgg_php_error_handler($errno, $errmsg, $filename, $linenum, $vars) {
 
        switch ($errno) {
                case E_USER_ERROR:
-                       error_log("ERROR: $error");
+                       error_log("PHP ERROR: $error");
                        register_error("ERROR: $error");
 
                        // Since this is a fatal error, we want to stop any further execution but do so gracefully.
@@ -1139,13 +1142,13 @@ function __elgg_php_error_handler($errno, $errmsg, $filename, $linenum, $vars) {
 
                case E_WARNING :
                case E_USER_WARNING :
-                       error_log("WARNING: $error");
+                       error_log("PHP WARNING: $error");
                        break;
 
                default:
                        global $CONFIG;
                        if (isset($CONFIG->debug) && $CONFIG->debug === 'NOTICE') {
-                               error_log("NOTICE: $error");
+                               error_log("PHP NOTICE: $error");
                        }
        }
 
@@ -1164,6 +1167,7 @@ function __elgg_php_error_handler($errno, $errmsg, $filename, $linenum, $vars) {
  * @param str $message User message
  * @param str $level NOTICE | WARNING | ERROR | DEBUG
  * @return bool
+ * @since 1.7.0
  */
 function elgg_log($message, $level='NOTICE') {
        global $CONFIG;
@@ -1211,6 +1215,7 @@ function elgg_log($message, $level='NOTICE') {
  * @param bool $to_screen
  * @param string $level
  * @return void
+ * @since 1.7.0
  */
 function elgg_dump($value, $to_screen = TRUE, $level = 'NOTICE') {
        global $CONFIG;
@@ -1394,6 +1399,7 @@ function run_function_once($functionname, $timelastupdatedcheck = 0) {
  * @param str $version human-readable *release* version the function was deprecated. No bloody A, B, (R)C, or D.
  *
  * @return bool
+ * @since 1.7.0
  */
 function elgg_deprecated_notice($msg, $dep_version) {
        // if it's a major release behind, visual and logged
@@ -1620,6 +1626,7 @@ function is_not_null($string) {
  * @param $options
  * @param $singulars
  * @return array
+ * @since 1.7.0
  */
 function elgg_normalise_plural_options_array($options, $singulars) {
        foreach ($singulars as $singular) {
@@ -1659,7 +1666,7 @@ function full_url() {
  * Useful function found in the comments on the PHP man page for ip2long.
  * Returns 1 if an IP matches a given range.
  *
- * TODO: Check licence... assuming this is PD since it was found several places on the interwebs..
+ * @todo Check licence... assuming this is PD since it was found several places on the interwebs..
  * please check or rewrite.
  *
  * Matches:
@@ -1832,7 +1839,7 @@ interface Friendable {
  * @param array $parts Associative array of URL components like parse_url() returns
  * @param bool $htmlencode HTML Encode the url?
  * @return str Full URL
- * @since 1.7
+ * @since 1.7.0
  */
 function elgg_http_build_url(array $parts, $html_encode = TRUE) {
        // build only what's given to us.
@@ -1858,7 +1865,7 @@ function elgg_http_build_url(array $parts, $html_encode = TRUE) {
  * @param str $link Full action URL
  * @param bool $htmlencode html encode the url?
  * @return str URL with action tokens
- * @since 1.7
+ * @since 1.7.0
  */
 function elgg_add_action_tokens_to_url($url, $html_encode = TRUE) {
        $components = parse_url($url);
@@ -1897,6 +1904,7 @@ function elgg_validate_action_url($url) {
  * @param string $url
  * @param string $element
  * @return string
+ * @since 1.7.0
  */
 function elgg_http_remove_url_query_element($url, $element) {
        $url_array = parse_url($url);
@@ -1924,6 +1932,7 @@ function elgg_http_remove_url_query_element($url, $element) {
  * @param str $url
  * @param array $elements k/v pairs.
  * @return str
+ * @since 1.7.0
  */
 function elgg_http_add_url_query_elements($url, array $elements) {
        $url_array = parse_url($url);
@@ -2100,7 +2109,7 @@ function elgg_set_active_sticky_form($form_name) {
  *
  * @param str $setting
  * @return int
- * @since 1.7
+ * @since 1.7.0
  * @link http://www.php.net/manual/en/function.ini-get.php
  */
 function elgg_get_ini_setting_in_bytes($setting) {
@@ -2416,7 +2425,7 @@ define('ACCESS_PUBLIC', 2);
 define('ACCESS_FRIENDS', -2);
 
 /**
- * @since 1.7
+ * @since 1.7.0
  */
 define('ELGG_ENTITIES_ANY_VALUE', NULL);
 define('ELGG_ENTITIES_NO_VALUE', 0);
index e6c2baa8e516b7844b9729c2ca8d9032018a95c1..9b3895fd5bc935509c5ab1be11bd6b29c83f0852 100644 (file)
@@ -15,7 +15,8 @@ $ENTITY_CACHE = NULL;
 /// Cache subtype searches
 $SUBTYPE_CACHE = NULL;
 
-/// Require the locatable interface TODO: Move this into start.php?
+/// Require the locatable interface
+// @todo Move this into start.php?
 require_once('location.php');
 
 /**
@@ -781,7 +782,8 @@ abstract class ElggEntity implements
                                throw new IOException(elgg_echo('IOException:BaseEntitySaveFailed'));
                        }
 
-                       // Save any unsaved metadata TODO: How to capture extra information (access id etc)
+                       // Save any unsaved metadata
+                       // @todo How to capture extra information (access id etc)
                        if (sizeof($this->temp_metadata) > 0) {
                                foreach($this->temp_metadata as $name => $value) {
                                        $this->$name = $value;
@@ -789,7 +791,8 @@ abstract class ElggEntity implements
                                }
                        }
 
-                       // Save any unsaved annotations metadata. TODO: How to capture extra information (access id etc)
+                       // Save any unsaved annotations metadata.
+                       // @todo How to capture extra information (access id etc)
                        if (sizeof($this->temp_annotations) > 0) {
                                foreach($this->temp_annotations as $name => $value) {
                                        $this->annotate($name, $value);
@@ -1233,7 +1236,7 @@ function initialise_entity_cache() {
        global $ENTITY_CACHE;
 
        if (!$ENTITY_CACHE) {
-               //select_default_memcache('entity_cache'); // TODO: Replace with memcache?
+               //select_default_memcache('entity_cache'); // @todo Replace with memcache?
                $ENTITY_CACHE = array();
        }
 }
@@ -1306,7 +1309,7 @@ function retrieve_cached_entity_row($guid) {
 /**
  * Return the integer ID for a given subtype, or false.
  *
- * TODO: Move to a nicer place?
+ * @todo Move to a nicer place?
  *
  * @param string $type
  * @param string $subtype
@@ -1342,7 +1345,7 @@ function get_subtype_id($type, $subtype) {
 /**
  * For a given subtype ID, return its identifier text.
  *
- * TODO: Move to a nicer place?
+ * @todo Move to a nicer place?
  *
  * @param int $subtype_id
  */
@@ -1791,6 +1794,7 @@ function get_entity($guid) {
  *
  * @return     if count, int
  *                     if not count, array or false if no entities
+ * @since 1.7.0
  */
 function elgg_get_entities(array $options = array()) {
        global $CONFIG;
@@ -2026,6 +2030,7 @@ $count = false, $site_guid = 0, $container_guid = null, $timelower = 0, $timeupp
  * @param NULL|array $subtypes
  * @param NULL|array $pairs
  * @return FALSE|string
+ * @since 1.7.0
  */
 function elgg_get_entity_type_subtype_where_sql($table, $types, $subtypes, $pairs) {
        // subtype depends upon type.
@@ -2179,6 +2184,7 @@ function elgg_get_entity_type_subtype_where_sql($table, $types, $subtypes, $pair
  * @param str $table
  * @param NULL|array $owner_guids
  * @return FALSE|str
+ * @since 1.7.0
  */
 function elgg_get_entity_owner_where_sql($table, $owner_guids) {
        // short circuit if nothing requested
@@ -2216,6 +2222,7 @@ function elgg_get_entity_owner_where_sql($table, $owner_guids) {
  * @param string $table entity table prefix
  * @param NULL|array $container_guids
  * @return FALSE|string
+ * @since 1.7.0
  */
 function elgg_get_entity_container_where_sql($table, $container_guids) {
        // short circuit if nothing is requested.
@@ -2257,6 +2264,7 @@ function elgg_get_entity_container_where_sql($table, $container_guids) {
  * @param NULL|int $time_updated_lower
  *
  * @return FALSE|str FALSE on fail, string on success.
+ * @since 1.7.0
  */
 function elgg_get_entity_time_where_sql($table, $time_created_upper = NULL, $time_created_lower = NULL,
        $time_updated_upper = NULL, $time_updated_lower = NULL) {
@@ -2294,6 +2302,7 @@ function elgg_get_entity_time_where_sql($table, $time_created_upper = NULL, $tim
  * @param string $table entity table name
  * @param NULL|array $site_guids
  * @return FALSE|string
+ * @since 1.7.0
  */
 function elgg_get_entity_site_where_sql($table, $site_guids) {
        // short circuit if nothing requested
@@ -2334,6 +2343,7 @@ function elgg_get_entity_site_where_sql($table, $site_guids) {
  *     pagination => BOOL Display pagination links
  *
  * @return str
+ * @since 1.7.0
  */
 function elgg_list_entities($options) {
        $defaults = array(
@@ -2526,7 +2536,8 @@ function disable_entity($guid, $reason = "", $recursive = true) {
                                }
 
                                if ($recursive) {
-                                       // Temporary token overriding access controls TODO: Do this better.
+                                       // Temporary token overriding access controls
+                                       // @todo Do this better.
                                        static $__RECURSIVE_DELETE_TOKEN;
                                        // Make it slightly harder to guess
                                        $__RECURSIVE_DELETE_TOKEN = md5(get_loggedin_userid());
@@ -2612,7 +2623,8 @@ function delete_entity($guid, $recursive = true) {
 
                                // Delete contained owned and otherwise releated objects (depth first)
                                if ($recursive) {
-                                       // Temporary token overriding access controls TODO: Do this better.
+                                       // Temporary token overriding access controls
+                                       // @todo Do this better.
                                        static $__RECURSIVE_DELETE_TOKEN;
                                        // Make it slightly harder to guess
                                        $__RECURSIVE_DELETE_TOKEN = md5(get_loggedin_userid());
@@ -3245,6 +3257,7 @@ function list_registered_entities($owner_guid = 0, $limit = 10, $fullview = true
  *     pagination => BOOL Display pagination links
  *
  * @return string A viewable list of entities
+ * @since 1.7.0
  */
 function elgg_list_registered_entities($options) {
        $defaults = array(
@@ -3778,7 +3791,7 @@ function entities_init() {
        register_plugin_hook('unit_test', 'system', 'entities_test');
 
        // Allow a permission override for recursive entity deletion
-       // TODO: Can this be done better?
+       // @todo Can this be done better?
        register_plugin_hook('permissions_check','all','recursive_delete_permissions_check');
        register_plugin_hook('permissions_check:metadata','all','recursive_delete_permissions_check');
 
index cbcdd6eb7766bf250d8a54dd3c08378a2bada5a1..7b54a784223b7c6be9f0497434e55b02eb6a1708 100644 (file)
@@ -87,6 +87,7 @@ abstract class ElggExtender implements
         * Return the owner entity
         *
         * @return mixed
+        * @since 1.7.0
         */
        public function getOwnerEntity() {
                return get_user($this->owner_guid);
@@ -263,7 +264,7 @@ abstract class ElggExtender implements
  * Detect the value_type for a given value.
  * Currently this is very crude.
  *
- * TODO: Make better!
+ * @todo Make better!
  *
  * @param mixed $value
  * @param string $value_type If specified, overrides the detection.
index 0a30f5551af23d253c03056b1e78e9925f0f3e59..31fc9ab0d89d2348d8d30bd135536cc29ac612c5 100644 (file)
@@ -471,7 +471,7 @@ class ElggFile extends ElggObject {
                        return $this->mimetype;
                }
 
-               // TODO : Guess mimetype if not here
+               // @todo Guess mimetype if not here
        }
 
        /**
@@ -648,7 +648,8 @@ class ElggFile extends ElggObject {
                        return $this->filestore;
                }
 
-               // If filestore meta set then retrieve filestore TODO: Better way of doing this?
+               // If filestore meta set then retrieve filestore
+               // @todo Better way of doing this?
                $metas = get_metadata_for_entity($this->guid);
                $parameters = array();
                if (is_array($metas)) {
index 474baf609b4b21493fe2f4142f48e86d92780611..ab6c9112d5602bf67ecc3b09dfb388d008efe4bb 100644 (file)
@@ -857,8 +857,7 @@ function group_gatekeeper($forward = true) {
  * @param string $label Used for the group edit form
  * @param boolean $default_on True if this option should be active by default
  *
- **/
-
+ */
 function add_group_tool_option($name,$label,$default_on=true) {
        global $CONFIG;
 
index e2b0c52517bc5105f8ec72b1849d63624924788e..42df3e17faa702b6c0032b7ed8b7329290974b8b 100644 (file)
@@ -40,7 +40,7 @@ function validate_platform() {
                throw new ConfigurationException(elgg_echo('ConfigurationException:BadPHPVersion'));
        }
 
-       // TODO: Consider checking for installed modules etc
+       // @todo Consider checking for installed modules etc
        return true;
 }
 
@@ -52,6 +52,7 @@ function validate_platform() {
  * @param string $dbname
  * @param string $host
  * @return bool
+ * @since 1.7.1
  */
 function db_check_settings($user, $password, $dbname, $host) {
        $mysql_dblink = mysql_connect($host, $user, $password, true);
index 98283f141ac348903135ba4b4cf96440606597e5..d20fa6a447703960a970c6dab1ba32c1cabe27ea 100644 (file)
@@ -147,7 +147,7 @@ function register_translations($path, $load_all = false) {
  * This is only called by functions which need to know all possible translations, namely the
  * statistic gathering ones.
  *
- * TODO: Better on demand loading based on language_paths array
+ * @todo Better on demand loading based on language_paths array
  *
  * @return bool
  */
index 21ee7d5fa3e4e9571cf8cfe91ea6bfef5ebea9db..7b96f4a9157e1e21f8a6ea0f79a78e849f6c25f9 100644 (file)
@@ -277,6 +277,6 @@ function list_entities_in_area($lat, $long, $radius, $type= "", $subtype = "", $
 define("MILE", 0.01515);
 define("KILOMETER", 0.00932);
 
-// TODO: get objects within x miles by entities, metadata and relationship
+// @todo get objects within x miles by entities, metadata and relationship
 
-// TODO: List
\ No newline at end of file
+// @todo List
\ No newline at end of file
index 9aa4aac4c7d66358239b8947371c8403eb23299d..ce70addc1f223a997da47b450e10d9c001e5287c 100644 (file)
@@ -13,6 +13,7 @@ if (is_callable('mb_internal_encoding')) {
  *
  * @param str $str
  * @return array
+ * @since 1.7.0
  */
 function elgg_parse_str($str) {
        if (is_callable('mb_parse_str')) {
@@ -64,4 +65,4 @@ foreach ($str_funcs as $func) {
 
 eval($eval_statement);
 
-// TODO: Other wrapper functions
\ No newline at end of file
+// @todo Other wrapper functions
\ No newline at end of file
index ed93cacf032574206c6051e3c3fb1aff13eaa7ce..1a428dac5e8322ccb7ac95fe4acb7eb471c3a67b 100644 (file)
@@ -157,7 +157,7 @@ class ElggMemcache extends ElggSharedMemoryCache {
                // DISABLE clearing for now - you must use delete on a specific key.
                return true;
 
-               //TODO: Namespaces as in #532
+               // @todo Namespaces as in #532
        }
 }
 
index a07b0958dab15c81e635588fca1dd2e4ce775a7c..66fa784015223140eda1ba84e596ed483edbee5d 100644 (file)
@@ -572,6 +572,7 @@ function find_metadata($meta_name = "", $meta_value = "", $entity_type = "", $en
  *  metadata_owner_guids => NULL|ARR guids for metadata owners
  *
  * @return array
+ * @since 1.7.0
  */
 function elgg_get_entities_from_metadata(array $options = array()) {
        $defaults = array(
@@ -605,6 +606,7 @@ function elgg_get_entities_from_metadata(array $options = array()) {
  * @param array $options Options
  *
  * @return array
+ * @since 1.7.0
  */
 function elgg_entities_get_metastrings_options($type, $options) {
        $valid_types = array('metadata', 'annotation');
@@ -672,6 +674,7 @@ function elgg_entities_get_metastrings_options($type, $options) {
  * @param BOOL $case_sensitive
  * @param ARR|NULL $order_by_metadata array of names / direction
  * @return FALSE|array False on fail, array('joins', 'wheres')
+ * @since 1.7.0
  */
 function elgg_get_entity_metadata_where_sql($e_table, $n_table, $names = NULL, $values = NULL, $pairs = NULL, $pair_operator = 'AND', $case_sensitive = TRUE, $order_by_metadata = NULL, $owner_guids = NULL) {
        global $CONFIG;
@@ -1018,6 +1021,7 @@ function list_entities_from_metadata($meta_name, $meta_value = "", $entity_type
  * @see elgg_get_entities_from_metadata
  *
  * @param array $options
+ * @since 1.7.0
  */
 function elgg_list_entities_from_metadata($options) {
        $defaults = array(
index 5ab9626c32b6be5e3a81382edf7b37d0c1153043..475a590ec4ca3662916f7d0612acfa64986e6ecd 100644 (file)
@@ -54,6 +54,7 @@ function register_notification_handler($method, $handler, $params = NULL) {
  * This function unregisters a handler for a given notification type (eg "email")
  *
  * @param string $method The method
+ * @since 1.7.1
  */
 function unregister_notification_handler($method) {
        global $NOTIFICATION_HANDLERS;
@@ -271,6 +272,7 @@ function email_notify_handler(ElggEntity $from, ElggUser $to, $subject, $message
  * @param string $body The message body
  * @param array $params Optional parameters (none used in this function)
  * @return bool
+ * @since 1.7.2
  */
 function elgg_send_email($from, $to, $subject, $body, array $params = NULL) {
        global $CONFIG;
index 6023a4805f004a1e23473f33980a561095c51973..63376c72dbe6a0a8845cffa171c11a7ae54e2dd1 100644 (file)
@@ -272,7 +272,7 @@ function create_object_entity($guid, $title, $description) {
  * THIS FUNCTION IS DEPRECATED.
  *
  * Delete a object's extra data.
- *
+ * @todo - this should be removed - was deprecated in 1.5 or earlier
  * @param int $guid
  */
 function delete_object_entity($guid) {
index 590ef9fdee79f0d0c5a56460b7054cdec9188e1b..5dbb0e1ab5339029d4f86d0ae89cba447d576854 100644 (file)
@@ -57,6 +57,7 @@ function register_pam_handler($handler, $importance = "sufficient", $policy = "u
  *
  * @param string $handler The PAM handler function name
  * @param string $policy - the policy type, default is "user"
+ * @since 1.7.0
  */
 function unregister_pam_handler($handler, $policy = "user") {
        global $_PAM_HANDLERS;
index 66b22a0aa633d3871bfbb966bfcdd48cbc11beb2..47a103dcd48bb30cef64f0c0063ac02d9ca4a94d 100644 (file)
@@ -622,6 +622,7 @@ function clear_plugin_setting($name, $plugin_name = "") {
  * Clear all plugin settings.
  *
  * @param string $plugin_name Optional plugin name, if not specified then it is detected from where you are calling from.
+ * @since 1.7.0
  */
 function clear_all_plugin_settings($plugin_name = "") {
        $plugin = find_plugin_settings($plugin_name);
index 619a2d2889cf4e6a4ba5a185361d4ab568b5037d..bdb28559fbde29c809ac8dd12d0d3ad9d085ae5d 100644 (file)
                        // Note: currently get_access_sql_suffix is hardwired to use
                        // $acl_field = "access_id", $object_owner_table = $acl_table, and
                        // $object_owner_id_field = "owner_guid"
-                       // TODO: recode get_access_sql_suffix to make it possible to specify alternate field names
+                       // @todo recode get_access_sql_suffix to make it possible to specify alternate field names
                        return "and ".get_access_sql_suffix($this->acl_table); // Add access controls
 
                        //return "and ({$this->acl_table}.{$this->acl_field} in {$access} or ({$this->acl_table}.{$this->acl_field} = 0 and {$this->object_owner_table}.{$this->object_owner_id_field} = {$_SESSION['id']}))";
index bf55a893266f308ff577312ee5b5bf3f5cd94aaf..dd8a2b188fea830de8fdfa0f52827b16cd92e5c9 100644 (file)
@@ -502,6 +502,7 @@ function get_entity_relationships($guid, $inverse_relationship = FALSE) {
  *     inverse_relationship => BOOL Inverse the relationship
  *
  * @return array
+ * @since 1.7.0
  */
 function elgg_get_entities_from_relationship($options) {
        $defaults = array(
@@ -547,6 +548,7 @@ function elgg_get_entities_from_relationship($options) {
  * @param $relationship relationship string
  * @param $entity_guid entity guid to check
  * @return mixed
+ * @since 1.7.0
  */
 function elgg_get_entity_relationship_where_sql($table, $relationship = NULL, $relationship_guid = NULL, $inverse_relationship = FALSE) {
        if ($relationship == NULL && $entity_guid == NULL) {
index 74e7322e8879491796347af01b6cc29f046cfd98..09799aa5960beae2e7dbb995844529839453ee5d 100644 (file)
@@ -106,6 +106,7 @@ function remove_from_river_by_object($object_guid) {
  *
  * @param int annotation_id The ID of the annotation
  * @return true|false Depending on success
+ * @since 1.7.0
  */
 function remove_from_river_by_annotation($annotation_id) {
        // Sanitise
index b74b2f52476493e747672fed1bd65cda7e5706ed..428a521a2be5f421749ee065a20c31e8dd2135b5 100644 (file)
@@ -186,6 +186,7 @@ function isadminloggedin() {
  *
  * @param $user_guid
  * @return bool
+ * @since 1.7.1
  */
 function elgg_is_admin_user($user_guid) {
        global $CONFIG;
index d67a540ccca89b1530fa28f31d7e9aabee5ac4d9..23a922757f29d1192c0af7b10e366664a925fdc5 100644 (file)
@@ -375,7 +375,7 @@ function create_site_entity($guid, $name, $description, $url) {
  * THIS FUNCTION IS DEPRECATED.
  *
  * Delete a site's extra data.
- *
+ * @todo remove
  * @param int $guid
  */
 function delete_site_entity($guid) {
index 1d2b552ada9b13aef7a132dfae4e095ab870f5a1..e7344493075c0399b786c7e3480d148930d943e2 100644 (file)
@@ -73,7 +73,6 @@ function generate_tag_cloud(array $tags, $buckets = 6) {
  *
  * Supports similar arguments as elgg_get_entities()
  *
- * @since 1.7.1
  *
  * @param array $options Array in format:
  *
@@ -109,6 +108,7 @@ function generate_tag_cloud(array $tags, $buckets = 6) {
  *
  * @return     false/array - if no tags or error, false
  *                     otherwise, array of objects with ->tag and ->total values
+ * @since 1.7.1
  */
 function elgg_get_tags(array $options = array()) {
        global $CONFIG;
@@ -306,7 +306,6 @@ function get_tags($threshold = 1, $limit = 10, $metadata_name = "", $entity_type
 /**
  * Returns viewable tagcloud
  *
- * @since 1.7.1
  *
  * @see elgg_get_tags
  *
@@ -317,7 +316,7 @@ function get_tags($threshold = 1, $limit = 10, $metadata_name = "", $entity_type
  *     subtype => must be single entity subtype
  *
  * @return string
- * 
+ * @since 1.7.1
  */
 function elgg_view_tagcloud(array $options = array()) {
 
@@ -370,10 +369,10 @@ function display_tagcloud($threshold = 1, $limit = 10, $metadata_name = "", $ent
  * This is required if you are using a non-standard metadata name
  * for your tags.
  *
- * @since 1.7
  *
  * @param string $name
- * @return TRUE
+ * @return bool
+ * @since 1.7.0
  */
 function elgg_register_tag_metadata_name($name) {
        global $CONFIG;
@@ -392,9 +391,8 @@ function elgg_register_tag_metadata_name($name) {
 /**
  * Returns an array of valid metadata names for tags.
  *
- * @since 1.7
- *
  * @return array
+ * @since 1.7.0
  */
 function elgg_get_registered_tag_metadata_names() {
        global $CONFIG;
index 99ef15246ccaaa4584ca4d10b78f28340d1abb6c..3722c8ed15e39a369560ecdfcd9149d3b18fd8a4 100644 (file)
@@ -682,7 +682,7 @@ function remove_user_admin($user_guid) {
  * THIS FUNCTION IS DEPRECATED.
  *
  * Delete a user's extra data.
- *
+ * @todo remove
  * @param int $guid
  */
 function delete_user_entity($guid) {
@@ -1362,7 +1362,7 @@ function request_user_validation($user_guid) {
  * @return bool
  */
 function is_email_address($address) {
-       // TODO: Make this better!
+       // @todo Make this better!
 
        if (strpos($address, '@')=== false) {
                return false;
@@ -1434,7 +1434,8 @@ function validate_username($username) {
                throw new RegistrationException(elgg_echo('registration:invalidchars'));
        }
 
-       // Belts and braces TODO: Tidy into main unicode
+       // Belts and braces
+       // @todo Tidy into main unicode
        $blacklist2 = '\'/\\"*& ?#%^(){}[]~?<>;|¬`@-+=';
        for ($n=0; $n < strlen($blacklist2); $n++) {
                if (strpos($username, $blacklist2[$n])!==false) {
@@ -1718,7 +1719,7 @@ function set_last_login($user_guid) {
  * A permissions plugin hook that grants access to users if they are newly created - allows
  * for email activation.
  *
- * TODO: Do this in a better way!
+ * @todo Do this in a better way!
  *
  * @param unknown_type $hook
  * @param unknown_type $entity_type
@@ -1839,7 +1840,7 @@ function users_init() {
        register_elgg_event_handler('create', 'user', 'user_create_hook_add_site_relationship');
 
        // Handle a special case for newly created users when the user is not logged in
-       // TODO: handle this better!
+       // @todo handle this better!
        register_plugin_hook('permissions_check','all','new_user_enable_permissions_check');
 }
 
index 76d2a57da251283583656c1b01d11525bd288559..ceaced80cdef8fafadfc2e1a00fc3fcd50ec9244 100644 (file)
@@ -451,7 +451,7 @@ function elgg_view_disable_simplecache() {
  * @param string $dir
  * @param string $base
  * @return array
- * @since 1.7
+ * @since 1.7.0
  */
 function elgg_get_views($dir, $base) {
        $return = array();
@@ -886,6 +886,7 @@ function set_template_handler($function_name) {
  * @param string $view_extension This view is added to $view
  * @param int $priority The priority, from 0 to 1000, to add at (lowest numbers displayed first)
  * @param string $viewtype Not used
+ * @since 1.7.0
  */
 function elgg_extend_view($view, $view_extension, $priority = 501, $viewtype = '') {
        global $CONFIG;
@@ -990,6 +991,7 @@ function set_view_location($view, $location, $viewtype = '') {
  * @param string $folder The folder to begin looking in
  * @param string $base_location_path The base views directory to use with set_view_location
  * @param string $viewtype The type of view we're looking at (default, rss, etc)
+ * @since 1.7.0
  */
 function autoregister_views($view_base, $folder, $base_location_path, $viewtype) {
        if (!isset($i)) {
@@ -1071,6 +1073,7 @@ function page_draw($title, $body, $page_shell = 'page_shells/default', $vars = a
  *
  * @param string $view_type
  * @return bool
+ * @since 1.7.2
  */
 function elgg_is_valid_view_type($view_type) {
        global $CONFIG;
index 1862ef7e41e95e72d58b9fff111dbc9f6e7f9963..03524da6213a380dce0f16ce2e9352b439c49d28 100644 (file)
@@ -284,6 +284,7 @@ function add_widget_type($handler, $name, $description, $context = "all", $multi
  * Remove a widget type
  *
  * @param string $handler The identifier for the widget handler
+ * @since 1.7.1
  */
 function remove_widget_type($handler) {
        global $CONFIG;
@@ -378,7 +379,7 @@ function save_widget_info($widget_guid, $params) {
                                        'guid','owner_guid','site_guid'
                                ))) {
                                        if (is_array($value)) {
-                                               // TODO: Handle arrays securely
+                                               // @todo Handle arrays securely
                                                $widget->setMetaData($name, $value, "", true);
                                        } else {
                                                $widget->$name = $value;
index 7c369edc1d5491d3f4807e55e9bce73782613a52..110dd76ddd9d2d3f45f252b993189048b94e24eb 100644 (file)
                case 'value':
                    return xmlrpc_scalar_value($object->children[0]);
                default:
-                   // TODO unsupported, throw an error
+                   // @todo unsupported, throw an error
                    return false;
            }
        }
index 743ac6eafe9c637b48f4876d74fe3d393b6b55bd..f70a8707412fa7643f73793da5e417cb9b2a6fba 100644 (file)
@@ -285,10 +285,6 @@ To remove a widget drag it back to the <b>Widget gallery</b>.",
 
        'friends:of:owned' => "People who have made %s a friend",
 
-       'friends:num_display' => "Number of friends to display",
-       'friends:icon_size' => "Icon size",
-       'friends:tiny' => "tiny",
-       'friends:small' => "small",
        'friends:of' => "Friends of",
        'friends:collections' => "Collections of friends",
        'friends:collections:add' => "New friends collection",
@@ -304,9 +300,6 @@ To remove a widget drag it back to the <b>Widget gallery</b>.",
        'friends:collections:members' => "Collection members",
        'friends:collections:edit' => "Edit collection",
 
-       'friends:river:created' => "%s added the friends widget.",
-       'friends:river:updated' => "%s updated their friends widget.",
-       'friends:river:delete' => "%s removed their friends widget.",
        'friends:river:add' => "%s is now a friend with",
 
        'friendspicker:chararray' => 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
diff --git a/mod/friends/add.php b/mod/friends/add.php
deleted file mode 100644 (file)
index aec7208..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-<?php
-
-       /**
-        * Elgg add a collection of friends
-        * 
-        * @package ElggFriends
-        * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
-        * @author Curverider Ltd <info@elgg.com>
-        * @copyright Curverider Ltd 2008-2010
-        * @link http://elgg.org/
-        */
-
-       // Start engine
-               require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
-               
-       // You need to be logged in for this one
-               gatekeeper();
-               
-               $area1 = elgg_view_title(elgg_echo('friends:new'));
-               
-           $area2 = elgg_view('friends/forms/edit', array('friends' => get_user_friends($_SESSION['user']->getGUID(),"",9999)));
-               
-       // Format page
-               $body = elgg_view_layout('two_column_left_sidebar',$area1, $area2);
-               
-       // Draw it
-               page_draw(elgg_echo('friends:add'),$body);
-
-?>
\ No newline at end of file
diff --git a/mod/friends/collections.php b/mod/friends/collections.php
deleted file mode 100644 (file)
index f80eea5..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-<?php
-
-       /**
-        * Elgg collections of friends
-        * 
-        * @package ElggFriends
-        * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
-        * @author Curverider Ltd <info@elgg.com>
-        * @copyright Curverider Ltd 2008-2010
-        * @link http://elgg.org/
-        */
-
-       // Start engine
-               require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
-               
-       // You need to be logged in for this one
-               gatekeeper();
-               
-               $area1 = elgg_view_title(elgg_echo('friends:new'));
-           
-               $area2 = elgg_view_access_collections($_SESSION['user']->getGUID());
-               
-       // Format page
-               $body = elgg_view_layout('two_column_left_sidebar',$area1, $area2);
-               
-       // Draw it
-               page_draw(elgg_echo('friends:add'),$body);
-
-?>
\ No newline at end of file
diff --git a/mod/friends/edit.php b/mod/friends/edit.php
deleted file mode 100644 (file)
index 6be47f4..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-<?php
-
-       /**
-        * Elgg add a collection of friends
-        * 
-        * @package ElggFriends
-        * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
-        * @author Curverider Ltd <info@elgg.com>
-        * @copyright Curverider Ltd 2008-2010
-        * @link http://elgg.org/
-        */
-
-       // Start engine
-               require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
-               
-       // You need to be logged in for this one
-               gatekeeper();
-               
-               //set the title
-               $area1 = elgg_view_title(elgg_echo('friends:collectionedit'), false);
-               
-               //grab the collection id passed to the edit form
-               $collection_id = get_input('collection');
-               
-               //get the full collection
-               $collection = get_access_collection($collection_id);
-               //get all members of the collection
-               $collection_members = get_members_of_access_collection($collection_id);
-               
-           $area2 = elgg_view('friends/forms/edit', array('collection' => $collection, 'collection_members' => $collection_members));
-               
-       // Format page
-               $body = elgg_view_layout('two_column_left_sidebar',$area1. $area2);
-               
-       // Draw it
-               page_draw(elgg_echo('friends:add'),$body);
-
-?>
\ No newline at end of file
index aa09456565e5129ee35175d06218f8d8e40c67cc..1d09cfca6c7d620021f2825563d97ad231771a34 100644 (file)
@@ -1,15 +1,15 @@
 <?php
 
-       $english = array(
-       
-               /**
-                * Friends widget
-                */
-                       'friends:widget:description' => "Displays some of your friends.",
-               
-               
-       );
-                                       
-       add_translation("en",$english);
+$english = array(
 
-?>
\ No newline at end of file
+       /**
+        * Friends widget
+        */
+       'friends:widget:description' => "Displays some of your friends.",
+       'friends:num_display' => "Number of friends to display",
+       'friends:icon_size' => "Icon size",
+       'friends:tiny' => "tiny",
+       'friends:small' => "small",
+);
+
+add_translation("en", $english);
index 631b54c1d1e7ae46be144624b4110576c490abb1..c0729ac9091af6d8f96a19d29907e6952d2f32a5 100644 (file)
@@ -1,26 +1,18 @@
 <?php
 
-       /**
-        * Elgg Friends widget
-        * This plugin allows users to put a list of their friends, on their profile
-        * 
-        * @package ElggFriends
-        * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
-        * @author Curverider Ltd <info@elgg.com>
-        * @copyright Curverider Ltd 2008-2010
-        * @link http://elgg.com/
-        */
-       
-               function friends_init() {
-               
-               // Load system configuration
-                               global $CONFIG;
-               
-               //add a widget
-                           add_widget_type('friends',elgg_echo("friends"),elgg_echo('friends:widget:description'));
-                       
-               }
-               
-               register_elgg_event_handler('init','system','friends_init');
-        
-?>
\ No newline at end of file
+/**
+ * Elgg Friends widget
+ * This plugin allows users to put a list of their friends on their profile
+ *
+ * @package ElggFriends
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd <info@elgg.com>
+ * @copyright Curverider Ltd 2008-2010
+ * @link http://elgg.com/
+ */
+
+function friends_init() {
+       add_widget_type('friends', elgg_echo("friends"), elgg_echo('friends:widget:description'));
+}
+
+register_elgg_event_handler('init', 'system', 'friends_init');
index 0d9d441365d4a4c809dc3add15cb113e16d09dab..50c44af3c7c6815ac227b843e99626b27a9a454d 100644 (file)
@@ -1,44 +1,61 @@
 <?php
 
-    /**
-        * Elgg Friends
-        * Friend widget options
-        * 
-        * @package ElggFriends
-        * @subpackage Core
-        * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
-        * @author Curverider Ltd
-        * @copyright Curverider Ltd 2008-2010
-        * @link http://elgg.org/
-        */
-        
+/**
+ * Elgg Friends
+ * Friend widget options
+ *
+ * @package ElggFriends
+ * @subpackage Core
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd
+ * @copyright Curverider Ltd 2008-2010
+ * @link http://elgg.org/
+ */
+
+$selections = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 15, 20, 30, 50, 100);
+$icon_sizes = array('small', 'tiny');
+
+// set defaults
+if (!isset($vars['entity']->num_display)) {
+       $vars['entity']->num_display = 12;
+       $vars['entity']->icon_size = 'small';
+}
+
+// handle upgrade to 1.7.2 from previous versions
+if ($vars['entity']->icon_size == 1) {
+       $vars['entity']->icon_size = 'small';
+} elseif ($vars['entity']->icon_size == 2) {
+       $vars['entity']->icon_size = 'tiny';
+}
 ?>
 
 <p>
-               <?php echo elgg_echo("friends:num_display"); ?>:
-               <select name="params[num_display]">
-                       <option value="1" <?php if($vars['entity']->num_display == 1) echo "SELECTED"; ?>>1</option>
-                       <option value="2" <?php if($vars['entity']->num_display == 2) echo "SELECTED"; ?>>2</option>
-                       <option value="3" <?php if($vars['entity']->num_display == 3) echo "SELECTED"; ?>>3</option>
-                       <option value="4" <?php if($vars['entity']->num_display == 4) echo "SELECTED"; ?>>4</option>
-                       <option value="5" <?php if($vars['entity']->num_display == 5) echo "SELECTED"; ?>>5</option>
-                       <option value="6" <?php if($vars['entity']->num_display == 6) echo "SELECTED"; ?>>6</option>
-                       <option value="7" <?php if($vars['entity']->num_display == 7) echo "SELECTED"; ?>>7</option>
-                       <option value="8" <?php if($vars['entity']->num_display == 8) echo "SELECTED"; ?>>8</option>
-                       <option value="9" <?php if($vars['entity']->num_display == 9) echo "SELECTED"; ?>>9</option>
-                       <option value="10" <?php if($vars['entity']->num_display == 10) echo "SELECTED"; ?>>10</option>
-                       <option value="15" <?php if($vars['entity']->num_display == 15) echo "SELECTED"; ?>>15</option>
-                       <option value="20" <?php if($vars['entity']->num_display == 20) echo "SELECTED"; ?>>20</option>
-                       <option value="30" <?php if($vars['entity']->num_display == 30) echo "SELECTED"; ?>>30</option>
-                       <option value="50" <?php if($vars['entity']->num_display == 50) echo "SELECTED"; ?>>50</option>
-                       <option value="100" <?php if($vars['entity']->num_display == 100) echo "SELECTED"; ?>>100</option>
-               </select>
+       <?php echo elgg_echo("friends:num_display"); ?>:
+       <select name="params[num_display]">
+<?php
+foreach ($selections as $selection) {
+       $selected = '';
+       if ($vars['entity']->num_display == $selection) {
+               $selected = 'selected="selected"';
+       }
+       echo "<option value=\"$selection\" $selected>$selection</option>";
+}
+?>
+       </select>
 </p>
 
 <p>
-    <?php echo elgg_echo("friends:icon_size"); ?>
-    <select name="params[icon_size]">
-        <option value="1" <?php if($vars['entity']->icon_size == 1) echo "SELECTED"; ?>><?php echo elgg_echo("friends:small"); ?></option>
-           <option value="2" <?php if($vars['entity']->icon_size == 2) echo "SELECTED"; ?>><?php echo elgg_echo("friends:tiny"); ?></option>
-    </select>
-</p>
\ No newline at end of file
+       <?php echo elgg_echo("friends:icon_size"); ?>
+       <select name="params[icon_size]">
+<?php
+foreach ($icon_sizes as $size) {
+       $selected = '';
+       if ($vars['entity']->icon_size == $size) {
+               $selected = 'selected="selected"';
+       }
+       $label = elgg_echo("friends:$size");
+       echo "<option value=\"$size\" $selected>$label</option>";
+}
+?>
+       </select>
+</p>
index ab702399aed47f2a01a8c574712693dbd631ad90..4532e7aceb2af96e995e5c32fe32dbdeba0bda2a 100644 (file)
@@ -1,50 +1,40 @@
 <?php
 
-    /**
-        * Elgg Friends
-        * Friend widget options
-        * 
-        * @package ElggFriends
-        * @subpackage Core
-        * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
-        * @author Curverider Ltd
-        * @copyright Curverider Ltd 2008-2010
-        * @link http://elgg.org/
-        */
-       
-
-    //the page owner
-       $owner = get_user($vars['entity']->owner_guid);
-
-    //the number of files to display
-       $num = (int) $vars['entity']->num_display;
-       if (!$num)
-               $num = 8;
-               
-       //get the correct size
-       $size = (int) $vars['entity']->icon_size;
-       if (!$size || $size == 1){
-               $size_value = "small";
-       }else{
-       $size_value = "tiny";
-       }
-               
-    // Get the users friends
-       $friends = $owner->getFriends("", $num, $offset = 0);
-               
-       // If there are any $friend to view, view them
-       if (is_array($friends) && sizeof($friends) > 0) {
+/**
+ * Elgg Friends
+ * Friend widget display view
+ *
+ * @package ElggFriends
+ * @subpackage Core
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd
+ * @copyright Curverider Ltd 2008-2010
+ * @link http://elgg.org/
+ */
+
+
+// owner of the profile page
+$owner = get_user($vars['entity']->owner_guid);
+
+// the number of friends to display
+$num = (int) $vars['entity']->num_display;
 
-               echo "<div id=\"widget_friends_list\">";
+// get the correct size
+$size = $vars['entity']->icon_size;
 
-               foreach($friends as $friend) {
-                       echo "<div class=\"widget_friends_singlefriend\" >";
-                       echo elgg_view("profile/icon",array('entity' => get_user($friend->guid), 'size' => $size_value));
-                       echo "</div>";
-               }
+// Get the user's friends
+$friends = $owner->getFriends("", $num);
 
+// If there are any friends to view, view them
+if (is_array($friends) && sizeof($friends) > 0) {
+
+       echo "<div id=\"widget_friends_list\">";
+
+       foreach($friends as $friend) {
+               echo "<div class=\"widget_friends_singlefriend\" >";
+               echo elgg_view("profile/icon",array('entity' => get_user($friend->guid), 'size' => $size));
                echo "</div>";
-                       
-    }
-       
-?>
\ No newline at end of file
+       }
+
+       echo "</div>";
+}
index 419034f5a5bd7bc1fe28795ae5b38aa00e27787d..523b4d264b344554d441c3c35d2c15dd1618fa07 100644 (file)
@@ -13,7 +13,7 @@
  *
  */
 function htmlawed_init() {
-       /** For now declare allowed tags and protocols here, TODO: Make this configurable */
+       /** For now declare allowed tags and protocols here, @todo Make this configurable */
        global $CONFIG;
        $CONFIG->htmlawed_config = array(
                // seems to handle about everything we need.
index 1984944749cdfc0c430f04c034bffd76b03374f8..fbf9bc543edb4240c600cfe1c9d4ca642685a5fd 100644 (file)
@@ -20,7 +20,6 @@
 * @param unknown_type $object_type
 * @param unknown_type $object
 */
-
 function messages_init() {
     
     // Load system configuration
@@ -28,7 +27,7 @@ function messages_init() {
                
        //add submenu options
                if (get_context() == "messages") {
-                       add_submenu_item(elgg_echo('messages:inbox'), $CONFIG->wwwroot . "pg/messages/" . $_SESSION['user']->username);
+                       add_submenu_item(elgg_echo('messages:inbox'), $CONFIG->wwwroot . "pg/messages/" . get_loggedin_user()->username);
                        add_submenu_item(elgg_echo('messages:sentmessages'), $CONFIG->wwwroot . "mod/messages/sent.php");
                }
                
@@ -50,12 +49,8 @@ function messages_init() {
        // Register a notification handler for site messages
                register_notification_handler("site", "messages_site_notify_handler");
                register_plugin_hook('notify:entity:message','object','messages_notification_msg');
-               if (is_callable('register_notification_object'))
-                       register_notification_object('object','messages',elgg_echo('messages:new'));
-               
-    // Shares widget
-         //  add_widget_type('messages',elgg_echo("messages:recent"),elgg_echo("messages:widget:description"));
-           
+               register_notification_object('object','messages',elgg_echo('messages:new'));
+                           
        // Override metadata permissions
            register_plugin_hook('permissions_check:metadata','object','messages_can_edit_metadata');
            
@@ -295,10 +290,10 @@ function count_unread_messages() {
     //get the users inbox messages
     //$num_messages = get_entities_from_metadata("toId", $_SESSION['user']->getGUID(), "object", "messages", 0, 10, 0, "", 0, false);
    $num_messages = elgg_get_entities_from_metadata(array('metadata_name_value_pairs' => array(
-                                                       'toId' => $_SESSION['user']->guid,
+                                                       'toId' => get_loggedin_userid(),
                                                        'readYet' => 0,
                                                        'msg' => 1
-                                               ), 'owner_guid' => $_SESSION['user']->guid));
+                                               ), 'owner_guid' => get_loggedin_userid()));
 
        if (is_array($num_messages))
                $counter = sizeof($num_messages);
diff --git a/mod/messages/views/default/widgets/messages/edit.php b/mod/messages/views/default/widgets/messages/edit.php
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/mod/messages/views/default/widgets/messages/view.php b/mod/messages/views/default/widgets/messages/view.php
deleted file mode 100644 (file)
index e4d1385..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-
-       <?php
-       
-           $num_messages = count_unread_messages();
-           
-        if($num_messages  == 0)
-                   echo "<h3 class=\"new_messages_count\">You have no new messages.</h3>";
-               else {
-                   echo "<h3 class=\"new_messages_count\">" . $num_messages . " new message(s).</h3>";
-                   echo "<a href=\"" . $vars['url'] . "pg/messages/" . $_SESSION['user']->username ."\">check them out</a>";
-           }
-
-       ?>
index 295c0ef09d325f79a9c0d2bb78b72f99c8e6332a..1c20a4297b41f4f5809856db9d7a86376bf2f664 100644 (file)
@@ -61,11 +61,11 @@ $english = array(
         * Status and error messages
         */
        'pages:noaccess' => 'No access to page',
-       'pages:cantedit' => 'You can not edit this page',
-       'pages:saved' => 'Pages saved',
+       'pages:cantedit' => 'You cannot edit this page',
+       'pages:saved' => 'Page saved',
        'pages:notsaved' => 'Page could not be saved',
        'pages:notitle' => 'You must specify a title for your page.',
-       'pages:delete:success' => 'Your page was successfully deleted.',
+       'pages:delete:success' => 'The page was successfully deleted.',
        'pages:delete:failure' => 'The page could not be deleted.',
 
        /**
index d317b8688da3d2623ff3aabfdd81a7599371f4b9..a078536804d0ba6a076ea27693127b0c7e456578 100644 (file)
@@ -25,8 +25,6 @@ $english = array(
        'river:clustered' => 'Clustered',
        'river:type' => 'Would you like the activity stream to be in classic format (chronological) or clustered?',
        'river:widget:description' => "Show your latest activity.",
-       'river:widget:title:friends' => "Friends' activity",
-       'river:widget:description:friends' => "Show what your friends are up to.",
        'river:widgets:friends' => "Friends",
        'river:widgets:mine' => "Mine",
        'river:friends' => "My friends' activity",
index f68ecbfa9152dedf7de06995b27a2333de6809a4..dc1cb40150d80b478e93bdc8694ddf2840ce4b45 100644 (file)
@@ -45,7 +45,7 @@ else if (($guid!="") && ($type!="") && ($id_or_name!="")) {
        $uuid = guid_to_uuid($entity->getGUID()) . "$type/$id_or_name/";
 
        switch ($type) {
-               case 'attr' : // TODO: Do this better? - This is a bit of a hack...
+               case 'attr' : // @todo: Do this better? - This is a bit of a hack...
                        $v = $entity->get($id_or_name);
                        if (!$v) {
                                throw new InvalidParameterException(sprintf(elgg_echo('InvalidParameterException:IdNotExistForGUID'), $id_or_name, $guid));
index 11323ab144ad9583faf7d902c09326ff1f829ce2..7794e3b939629750fedb41e9cfe28b3bdec1f1dd 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 $admin_option = false;
-if (($_SESSION['user']->isAdmin()) && ($vars['show_admin'])) {
+if ((get_loggedin_user()->isAdmin()) && ($vars['show_admin'])) {
        $admin_option = true;
 }
 
index deadb2f6a9d3436573a5023a8ed2e58a5ad82355..ddd0a0ed0217938b58837e4496ccc69389301a6e 100644 (file)
@@ -24,7 +24,7 @@ if (is_array($vars['collection']->members)) {
 echo "<li><h2>";
 
 //as collections are private, check that the logged in user is the owner
-if($coll->owner_guid == $_SESSION['user']->getGUID()) {
+if ($coll->owner_guid == get_loggedin_userid()) {
        echo "<div class=\"friends_collections_controls\">";
        echo elgg_view('output/confirmlink', array(
                        'href' => $vars['url'] . 'action/friends/deletecollection?collection=' . $coll->id,
@@ -36,8 +36,8 @@ echo $coll->name;
 echo " (<span id=\"friends_membership_count{$vars['friendspicker']}\">{$count}</span>) </h2>";
 
 // individual collection panels
-if($friends = $vars['collection']->entities) {
-       $content = elgg_view('friends/collectiontabs', array('owner' => $_SESSION['user'], 'collection' => $vars['collection'], 'friendspicker' => $vars['friendspicker']));
+if ($friends = $vars['collection']->entities) {
+       $content = elgg_view('friends/collectiontabs', array('owner' => get_loggedin_user(), 'collection' => $vars['collection'], 'friendspicker' => $vars['friendspicker']));
 
        echo elgg_view('friends/picker',array('entities' => $friends, 'value' => $members, 'content' => $content, 'replacement' => '', 'friendspicker' => $vars['friendspicker']));
        ?>
@@ -45,7 +45,7 @@ if($friends = $vars['collection']->entities) {
        <script type="text/javascript">
        $(document).ready(function () {
 
-       $('#friends_picker_placeholder<?php echo $vars['friendspicker']; ?>').load('<?php echo $vars['url']; ?>friends/pickercallback.php?username=<?php echo $_SESSION['user']->username; ?>&type=list&collection=<?php echo $vars['collection']->id; ?>');
+                       $('#friends_picker_placeholder<?php echo $vars['friendspicker']; ?>').load('<?php echo $vars['url']; ?>friends/pickercallback.php?username=<?php echo get_loggedin_user()->username; ?>&type=list&collection=<?php echo $vars['collection']->id; ?>');
 
        });
        </script>
index 453cbb1121b6dcdbcaf52ef7dfe2d7c20f899127..9a6577671e778898dde824285d97a766c885e489 100644 (file)
@@ -32,7 +32,7 @@ $(document).ready(function () {
 
        $('a.collectionmembers<?php echo $friendspicker; ?>').click(function () {
                // load collection members pane
-               $('#friends_picker_placeholder<?php echo $friendspicker; ?>').load('<?php echo $vars['url']; ?>friends/pickercallback.php?username=<?php echo $_SESSION['user']->username; ?>&type=list&collection=<?php echo $collectionid; ?>&friendspicker=<?php echo $friendspicker; ?>');
+               $('#friends_picker_placeholder<?php echo $friendspicker; ?>').load('<?php echo $vars['url']; ?>friends/pickercallback.php?username=<?php echo get_loggedin_user()->username; ?>&type=list&collection=<?php echo $collectionid; ?>&friendspicker=<?php echo $friendspicker; ?>');
 
                // remove selected state from previous tab
                $(this).parent().parent().find("li.selected").removeClass("selected");
@@ -44,7 +44,7 @@ $(document).ready(function () {
 
        $('a.editmembers<?php echo $friendspicker; ?>').click(function () {
                // load friends picker pane
-               $('#friends_picker_placeholder<?php echo $friendspicker; ?>').load('<?php echo $vars['url']; ?>friends/pickercallback.php?username=<?php echo $_SESSION['user']->username; ?>&type=picker&collection=<?php echo $collectionid; ?>&friendspicker=<?php echo $friendspicker; ?>');
+               $('#friends_picker_placeholder<?php echo $friendspicker; ?>').load('<?php echo $vars['url']; ?>friends/pickercallback.php?username=<?php echo get_loggedin_user()->username; ?>&type=picker&collection=<?php echo $collectionid; ?>&friendspicker=<?php echo $friendspicker; ?>');
 
                // remove selected state from previous tab
                $(this).parent().parent().find("li.selected").removeClass("selected");
index 7dc088d0e0135dacfb0f2c187a4a6ff77bd96409..b6044e55f33ea25d676d67ec31526ea524b79792 100644 (file)
@@ -7,7 +7,7 @@
  * @author Curverider Ltd
  * @link http://elgg.org/
  *
- * @TODO: This currently only works for ONE AUTOCOMPLETE TEXT FIELD on a page.
+ * @todo This currently only works for ONE AUTOCOMPLETE TEXT FIELD on a page.
  *
  * @uses $vars['value'] The current value, if any
  * @uses $vars['js'] Any Javascript to enter into the input tag
index c893710135eccbf2ab385f93a0549194892ee891..a340e7a090d56089c0b0dec85c0479a1cc729980 100644 (file)
@@ -5,37 +5,18 @@
  */
 
 $page_owner = page_owner();
-$page_owner_user = get_entity($page_owner);
+$page_owner_entity = get_entity($page_owner);
 
-$submenu = get_submenu(); // elgg_view('canvas_header/submenu');
+$display = "<h2>" . $vars['title'] . "</h2>";
+
+$submenu = get_submenu();
 if (!empty($submenu)) {
        $submenu = "<ul class='submenu extended'>" . $submenu . "</ul>";
 }
 
-if (($_SESSION['guid']) && ($page_owner && $page_owner_user->guid != $_SESSION['user']->getGUID())) {
-       $info = "<h2>" . $vars['title'] . "</h2>";
-       if($page_owner_user instanceOf ElggGroup) {
-               $display = $info;
-       } else {
-               $display = $info;
-       }
-       if (!empty($submenu) && $vars['submenu'] == true) {
-               // plugins can extend this to add menu options
-               $display .= $submenu;
-       }
-} else {
-       $info = "<h2>" . $vars['title'] . "</h2>";
-       if($page_owner_user instanceOf ElggGroup) {
-               $display = $info;
-       } else {
-               $display = $info;
-       }
-       if (!empty($submenu)  && $vars['submenu'] == true) {
-               // plugins can extend this to add menu options
-               $display .= $submenu;
-       }
+if (!empty($submenu)  && $vars['submenu'] == true) {
+       // plugins can extend this to add menu options
+       $display .= $submenu;
 }
 
-
-//print to screen
 echo $display;
\ No newline at end of file
index d32e44283c9acd5e1748ceb6bf51ef1fc5aafaba..79286ec90e8c285ab5f7e37211c38ed708640f23 100644 (file)
@@ -20,7 +20,7 @@ $manifest = $details['manifest'];
 
 $user_guid = $details['user_guid'];
 if ($user_guid) {
-       $user_guid = $_SESSION['user']->guid;
+       $user_guid = get_loggedin_userid();
 }
 
 if (elgg_view("usersettings/{$plugin}/edit")) {
index 1c4b127ec7a9ecfdad67d0db490e4ac815a5fd2f..ee38bdfeec5996d5bd0957b4d561eb288af47c99 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 // Get entity statistics
-$entity_stats = get_entity_statistics($_SESSION['user']->guid);
+$entity_stats = get_entity_statistics(get_loggedin_userid());
 
 if ($entity_stats) {
 ?>
index 817b18cde7e3b3088ebd72d1193edf4d39bf3ce6..e176aaf9f194046b427d0d632ca2c94473c4c0ff 100644 (file)
@@ -8,13 +8,13 @@
  * @link http://elgg.org/
  */
 
-$user = $_SESSION['user'];
+$user = get_loggedin_user();
 
 $logged_in = 0;
-$log = get_system_log($_SESSION['user']->guid, "login", "", 'user', '', 1);
+$log = get_system_log($user->guid, "login", "", 'user', '', 1);
 
 if ($log) {
-       $logged_in=$log[0]->time_created;
+       $logged_in = $log[0]->time_created;
 }
 
 ?>