/engine/lib/deprecated-1.8.php
PHP | 4701 lines | 2449 code | 570 blank | 1682 comment | 350 complexity | 274ed8a9958d464992fead2e2eb0b719 MD5 | raw file
Possible License(s): MIT, BSD-3-Clause, LGPL-2.1, GPL-2.0
Large files files are truncated, but you can click here to view the full file
- <?php
- /**
- * Lists entities from an access collection
- *
- * @deprecated 1.8 Use elgg_list_entities_from_access_id()
- *
- * @return str
- */
- function list_entities_from_access_id($access_id, $entity_type = "", $entity_subtype = "", $owner_guid = 0, $limit = 10, $fullview = true, $listtypetoggle = true, $pagination = true) {
- elgg_deprecated_notice("All list_entities* functions were deprecated in 1.8. Use elgg_list_entities* instead.", 1.8);
- echo elgg_list_entities_from_access_id(array('access_id' => $access_id,
- 'type' => $entity_type, 'subtype' => $entity_subtype, 'owner_guids' => $owner_guid,
- 'limit' => $limit, 'full_view' => $fullview, 'list_type_toggle' => $listtypetoggle,
- 'pagination' => $pagination,));
- }
- /**
- * Registers a particular action in memory
- *
- * @deprecated 1.8 Use {@link elgg_register_action()} instead
- *
- * @param string $action The name of the action (eg "register", "account/settings/save")
- * @param boolean $public Can this action be accessed by people not logged into the system?
- * @param string $filename Optionally, the filename where this action is located
- * @param boolean $admin_only Whether this action is only available to admin users.
- */
- function register_action($action, $public = false, $filename = "", $admin_only = false) {
- elgg_deprecated_notice("register_action() was deprecated by elgg_register_action()", 1.8);
- if ($admin_only) {
- $access = 'admin';
- } elseif ($public) {
- $access = 'public';
- } else {
- $access = 'logged_in';
- }
- return elgg_register_action($action, $filename, $access);
- }
- /**
- * Register an admin page with the admin panel.
- * This function extends the view "admin/main" with the provided view.
- * This view should provide a description and either a control or a link to.
- *
- * @deprecated 1.8 Extend admin views manually
- *
- * Usage:
- * - To add a control to the main admin panel then extend admin/main
- * - To add a control to a new page create a page which renders a view admin/subpage
- * (where subpage is your new page -
- * nb. some pages already exist that you can extend), extend the main view to point to it,
- * and add controls to your new view.
- *
- * At the moment this is essentially a wrapper around elgg_extend_view().
- *
- * @param string $new_admin_view The view associated with the control you're adding
- * @param string $view The view to extend, by default this is 'admin/main'.
- * @param int $priority Optional priority to govern the appearance in the list.
- *
- * @return void
- */
- function extend_elgg_admin_page($new_admin_view, $view = 'admin/main', $priority = 500) {
- elgg_deprecated_notice('extend_elgg_admin_page() does nothing. Extend admin views manually.', 1.8);
- }
- /**
- * Get entities ordered by a mathematical calculation
- *
- * @deprecated 1.8 Use elgg_get_entities_from_annotation_calculation()
- *
- * @param string $sum What sort of calculation to perform
- * @param string $entity_type Type of Entity
- * @param string $entity_subtype Subtype of Entity
- * @param string $name Name of annotation
- * @param string $mdname Metadata name
- * @param string $mdvalue Metadata value
- * @param int $owner_guid GUID of owner of annotation
- * @param int $limit Limit of results
- * @param int $offset Offset of results
- * @param string $orderdir Order of results
- * @param bool $count Return count or entities
- *
- * @return mixed
- */
- function get_entities_from_annotations_calculate_x($sum = "sum", $entity_type = "", $entity_subtype = "", $name = "", $mdname = '', $mdvalue = '', $owner_guid = 0, $limit = 10, $offset = 0, $orderdir = 'desc', $count = false) {
- $msg = 'get_entities_from_annotations_calculate_x() is deprecated by elgg_get_entities_from_annotation_calculation().';
- elgg_deprecated_notice($msg, 1.8);
- $options = array();
- $options['calculation'] = $sum;
- if ($entity_type) {
- $options['types'] = $entity_type;
- }
- if ($entity_subtype) {
- $options['subtypes'] = $entity_subtype;
- }
- $options['annotation_names'] = $name;
- if ($mdname) {
- $options['metadata_names'] = $mdname;
- }
- if ($mdvalue) {
- $options['metadata_values'] = $mdvalue;
- }
- // original function rewrote this to container guid.
- if ($owner_guid) {
- if (is_array($owner_guid)) {
- $options['container_guids'] = $owner_guid;
- } else {
- $options['container_guid'] = $owner_guid;
- }
- }
- $options['limit'] = $limit;
- $options['offset'] = $offset;
- $options['order_by'] = "annotation_calculation $orderdir";
- $options['count'] = $count;
- return elgg_get_entities_from_annotation_calculation($options);
- }
- /**
- * Returns entities ordered by the sum of an annotation
- *
- * @warning This is function uses sum instead of count. THIS IS SLOW. See #3366.
- * This should be used when you have annotations with different values and you
- * want a list of entities ordered by the sum of all of those values.
- * If you want a list of entities ordered by the number of annotations on each entity,
- * use __get_entities_from_annotations_calculate_x() and pass 'count' as the first param.
- *
- * @deprecated 1.8 Use elgg_get_entities_from_annotation_calculation()
- *
- * @param string $entity_type Type of Entity
- * @param string $entity_subtype Subtype of Entity
- * @param string $name Name of annotation
- * @param string $mdname Metadata name
- * @param string $mdvalue Metadata value
- * @param int $owner_guid GUID of owner of annotation
- * @param int $limit Limit of results
- * @param int $offset Offset of results
- * @param string $orderdir Order of results
- * @param bool $count Return count or entities
- *
- * @return unknown
- */
- function get_entities_from_annotation_count($entity_type = "", $entity_subtype = "", $name = "", $mdname = '', $mdvalue = '', $owner_guid = 0, $limit = 10, $offset = 0, $orderdir = 'desc', $count = false) {
- $msg = 'get_entities_from_annotation_count() is deprecated by elgg_get_entities_from_annotation_calculation().';
- elgg_deprecated_notice($msg, 1.8);
- $options = array();
- $options['calculation'] = 'sum';
- if ($entity_type) {
- $options['types'] = $entity_type;
- }
- if ($entity_subtype) {
- $options['subtypes'] = $entity_subtype;
- }
- $options['annotation_names'] = $name;
- if ($mdname) {
- $options['metadata_names'] = $mdname;
- }
- if ($mdvalue) {
- $options['metadata_values'] = $mdvalue;
- }
- if ($owner_guid) {
- if (is_array($owner_guid)) {
- $options['owner_guids'] = $owner_guid;
- } else {
- $options['owner_guid'] = $owner_guid;
- }
- }
- $options['limit'] = $limit;
- $options['offset'] = $offset;
- $options['order_by'] = "annotation_calculation $orderdir";
- $options['count'] = $count;
- return elgg_get_entities_from_annotation_calculation($options);
- }
- /**
- * Lists entities by the totals of a particular kind of annotation
- *
- * @deprecated 1.8 Use elgg_list_entities_from_annotation_calculation()
- *
- * @param string $entity_type Type of entity.
- * @param string $entity_subtype Subtype of entity.
- * @param string $name Name of annotation.
- * @param int $limit Maximum number of results to return.
- * @param int $owner_guid Owner.
- * @param int $group_guid Group container. Currently only supported if entity_type is object
- * @param boolean $asc Whether to list in ascending or descending order (default: desc)
- * @param boolean $fullview Whether to display the entities in full
- * @param boolean $listtypetoggle Can the 'gallery' view can be displayed (default: no)
- * @param boolean $pagination Add pagination
- * @param string $orderdir Order desc or asc
- *
- * @return string Formatted entity list
- */
- function list_entities_from_annotation_count($entity_type = "", $entity_subtype = "", $name = "", $limit = 10, $owner_guid = 0, $group_guid = 0, $asc = false, $fullview = true, $listtypetoggle = false, $pagination = true, $orderdir = 'desc') {
- $msg = 'list_entities_from_annotation_count() is deprecated by elgg_list_entities_from_annotation_calculation().';
- elgg_deprecated_notice($msg, 1.8);
- $options = array();
- $options['calculation'] = 'sum';
- if ($entity_type) {
- $options['types'] = $entity_type;
- }
- if ($entity_subtype) {
- $options['subtypes'] = $entity_subtype;
- }
- $options['annotation_names'] = $name;
- if ($owner_guid) {
- if (is_array($owner_guid)) {
- $options['owner_guids'] = $owner_guid;
- } else {
- $options['owner_guid'] = $owner_guid;
- }
- }
- $options['full_view'] = $fullview;
- $options['list_type_toggle'] = $listtypetoggle;
- $options['pagination'] = $pagination;
- $options['limit'] = $limit;
- $options['order_by'] = "annotation_calculation $orderdir";
- return elgg_get_entities_from_annotation_calculation($options);
- }
- /**
- * Adds an entry in $CONFIG[$register_name][$subregister_name].
- *
- * @deprecated 1.8 Use the new menu system.
- *
- * This is only used for the site-wide menu. See {@link add_menu()}.
- *
- * @param string $register_name The name of the top-level register
- * @param string $subregister_name The name of the subregister
- * @param mixed $subregister_value The value of the subregister
- * @param array $children_array Optionally, an array of children
- *
- * @return true|false Depending on success
- */
- function add_to_register($register_name, $subregister_name, $subregister_value, $children_array = array()) {
- elgg_deprecated_notice("add_to_register() has been deprecated", 1.8);
- global $CONFIG;
- if (empty($register_name) || empty($subregister_name)) {
- return false;
- }
- if (!isset($CONFIG->registers)) {
- $CONFIG->registers = array();
- }
- if (!isset($CONFIG->registers[$register_name])) {
- $CONFIG->registers[$register_name] = array();
- }
- $subregister = new stdClass;
- $subregister->name = $subregister_name;
- $subregister->value = $subregister_value;
- if (is_array($children_array)) {
- $subregister->children = $children_array;
- }
- $CONFIG->registers[$register_name][$subregister_name] = $subregister;
- return true;
- }
- /**
- * Removes a register entry from $CONFIG[register_name][subregister_name]
- *
- * @deprecated 1.8 Use the new menu system.
- *
- * This is used to by {@link remove_menu()} to remove site-wide menu items.
- *
- * @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) {
- elgg_deprecated_notice("remove_from_register() has been deprecated", 1.8);
- global $CONFIG;
- if (empty($register_name) || empty($subregister_name)) {
- return false;
- }
- if (!isset($CONFIG->registers)) {
- return false;
- }
- if (!isset($CONFIG->registers[$register_name])) {
- return false;
- }
- if (isset($CONFIG->registers[$register_name][$subregister_name])) {
- unset($CONFIG->registers[$register_name][$subregister_name]);
- return true;
- }
- return false;
- }
- /**
- * If it exists, returns a particular register as an array
- *
- * @deprecated 1.8 Use the new menu system
- *
- * @param string $register_name The name of the register
- *
- * @return array|false Depending on success
- */
- function get_register($register_name) {
- elgg_deprecated_notice("get_register() has been deprecated", 1.8);
- global $CONFIG;
- if ($register_name == 'menu') {
- // backward compatible code for site menu
- $menu = $CONFIG->menus['site'];
- $builder = new ElggMenuBuilder($menu);
- $menu_items = $builder->getMenu('text');
- $menu_items = $menu_items['default'];
- $menu = array();
- foreach ($menu_items as $item) {
- $subregister = new stdClass;
- $subregister->name = $item->getText();
- $subregister->value = $item->getHref();
- $menu[$subregister->name] = $subregister;
- }
- return $menu;
- }
- if (isset($CONFIG->registers[$register_name])) {
- return $CONFIG->registers[$register_name];
- }
- return false;
- }
- /**
- * Deprecated events core function. Code divided between elgg_register_event_handler()
- * and trigger_elgg_event().
- *
- * @deprecated 1.8 Use explicit register/trigger event functions
- *
- * @param string $event The type of event (eg 'init', 'update', 'delete')
- * @param string $object_type The type of object (eg 'system', 'blog', 'user')
- * @param string $function The name of the function that will handle the event
- * @param int $priority Priority to call handler. Lower numbers called first (default 500)
- * @param boolean $call Set to true to call the event rather than add to it (default false)
- * @param mixed $object Optionally, the object the event is being performed on (eg a user)
- *
- * @return true|false Depending on success
- */
- function events($event = "", $object_type = "", $function = "", $priority = 500, $call = false, $object = null) {
- elgg_deprecated_notice('events() has been deprecated.', 1.8);
- // leaving this here just in case someone was directly calling this internal function
- if (!$call) {
- return elgg_register_event_handler($event, $object_type, $function, $priority);
- } else {
- return trigger_elgg_event($event, $object_type, $object);
- }
- }
- /**
- * Alias function for events, that registers a function to a particular kind of event
- *
- * @deprecated 1.8 Use elgg_register_event_handler() instead
- *
- * @param string $event The event type
- * @param string $object_type The object type
- * @param string $function The function name
- * @return true|false Depending on success
- */
- function register_elgg_event_handler($event, $object_type, $callback, $priority = 500) {
- elgg_deprecated_notice("register_elgg_event_handler() was deprecated by elgg_register_event_handler()", 1.8);
- return elgg_register_event_handler($event, $object_type, $callback, $priority);
- }
- /**
- * Unregisters a function to a particular kind of event
- *
- * @deprecated 1.8 Use elgg_unregister_event_handler instead
- *
- * @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, $callback) {
- elgg_deprecated_notice('unregister_elgg_event_handler => elgg_unregister_event_handler', 1.8);
- elgg_unregister_event_handler($event, $object_type, $callback);
- }
- /**
- * Alias function for events, that triggers a particular kind of event
- *
- * @deprecated 1.8 Use elgg_trigger_event() instead
- *
- * @param string $event The event type
- * @param string $object_type The object type
- * @param string $function The function name
- * @return true|false Depending on success
- */
- function trigger_elgg_event($event, $object_type, $object = null) {
- elgg_deprecated_notice('trigger_elgg_event() was deprecated by elgg_trigger_event()', 1.8);
- return elgg_trigger_event($event, $object_type, $object);
- }
- /**
- * Register a function to a plugin hook for a particular entity type, with a given priority.
- *
- * @deprecated 1.8 Use elgg_register_plugin_hook_handler() instead
- *
- * eg if you want the function "export_user" to be called when the hook "export" for "user" entities
- * is run, use:
- *
- * register_plugin_hook("export", "user", "export_user");
- *
- * "all" is a valid value for both $hook and $entity_type. "none" is a valid value for $entity_type.
- *
- * The export_user function would then be defined as:
- *
- * function export_user($hook, $entity_type, $returnvalue, $params);
- *
- * Where $returnvalue is the return value returned by the last function returned by the hook, and
- * $params is an array containing a set of parameters (or nothing).
- *
- * @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
- * @param string $priority The priority - 0 is first, 1000 last, default is 500
- * @return true|false Depending on success
- */
- function register_plugin_hook($hook, $type, $callback, $priority = 500) {
- elgg_deprecated_notice("register_plugin_hook() was deprecated by elgg_register_plugin_hook_handler()", 1.8);
- return elgg_register_plugin_hook_handler($hook, $type, $callback, $priority);
- }
- /**
- * Unregister a function to a plugin hook for a particular entity type
- *
- * @deprecated 1.8 Use elgg_unregister_plugin_hook_handler() instead
- *
- * @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, $callback) {
- elgg_deprecated_notice("unregister_plugin_hook() was deprecated by elgg_unregister_plugin_hook_handler()", 1.8);
- elgg_unregister_plugin_hook_handler($hook, $entity_type, $callback);
- }
- /**
- * Triggers a plugin hook, with various parameters as an array. For example, to provide
- * a 'foo' hook that concerns an entity of type 'bar', with a parameter called 'param1'
- * with value 'value1', that by default returns true, you'd call:
- *
- * @deprecated 1.8 Use elgg_trigger_plugin_hook() instead
- *
- * trigger_plugin_hook('foo', 'bar', array('param1' => 'value1'), true);
- *
- * @see register_plugin_hook
- * @param string $hook The name of the hook to trigger
- * @param string $entity_type The name of the entity type to trigger it for (or "all", or "none")
- * @param array $params Any parameters. It's good practice to name the keys, i.e. by using array('name' => 'value', 'name2' => 'value2')
- * @param mixed $returnvalue An initial return value
- * @return mixed|null The cumulative return value for the plugin hook functions
- */
- function trigger_plugin_hook($hook, $type, $params = null, $returnvalue = null) {
- elgg_deprecated_notice("trigger_plugin_hook() was deprecated by elgg_trigger_plugin_hook()", 1.8);
- return elgg_trigger_plugin_hook($hook, $type, $params, $returnvalue);
- }
- /**
- * Checks if code is being called from a certain function.
- *
- * To use, call this function with the function name (and optional
- * file location) that it has to be called from, it will either
- * return true or false.
- *
- * e.g.
- *
- * function my_secure_function()
- * {
- * if (!call_gatekeeper("my_call_function"))
- * return false;
- *
- * ... do secure stuff ...
- * }
- *
- * function my_call_function()
- * {
- * // will work
- * my_secure_function();
- * }
- *
- * function bad_function()
- * {
- * // Will not work
- * my_secure_function();
- * }
- *
- * @param mixed $function The function that this function must have in its call stack,
- * to test against a method pass an array containing a class and
- * method name.
- * @param string $file Optional file that the function must reside in.
- *
- * @return bool
- *
- * @deprecated 1.8 A neat but pointless function
- */
- function call_gatekeeper($function, $file = "") {
- elgg_deprecated_notice("call_gatekeeper() is neat but pointless", 1.8);
- // Sanity check
- if (!$function) {
- return false;
- }
- // Check against call stack to see if this is being called from the correct location
- $callstack = debug_backtrace();
- $stack_element = false;
- foreach ($callstack as $call) {
- if (is_array($function)) {
- if ((strcmp($call['class'], $function[0]) == 0) && (strcmp($call['function'], $function[1]) == 0)) {
- $stack_element = $call;
- }
- } else {
- if (strcmp($call['function'], $function) == 0) {
- $stack_element = $call;
- }
- }
- }
- if (!$stack_element) {
- return false;
- }
- // If file then check that this it is being called from this function
- if ($file) {
- $mirror = null;
- if (is_array($function)) {
- $mirror = new ReflectionMethod($function[0], $function[1]);
- } else {
- $mirror = new ReflectionFunction($function);
- }
- if ((!$mirror) || (strcmp($file, $mirror->getFileName()) != 0)) {
- return false;
- }
- }
- return true;
- }
- /**
- * This function checks to see if it is being called at somepoint by a function defined somewhere
- * on a given path (optionally including subdirectories).
- *
- * This function is similar to call_gatekeeper() but returns true if it is being called
- * by a method or function which has been defined on a given path or by a specified file.
- *
- * @param string $path The full path and filename that this function must have
- * in its call stack If a partial path is given and
- * $include_subdirs is true, then the function will return
- * true if called by any function in or below the specified path.
- * @param bool $include_subdirs Are subdirectories of the path ok, or must you specify an
- * absolute path and filename.
- * @param bool $strict_mode If true then the calling method or function must be directly
- * called by something on $path, if false the whole call stack is
- * searched.
- *
- * @return void
- *
- * @deprecated 1.8 A neat but pointless function
- */
- function callpath_gatekeeper($path, $include_subdirs = true, $strict_mode = false) {
- elgg_deprecated_notice("callpath_gatekeeper() is neat but pointless", 1.8);
- global $CONFIG;
- $path = sanitise_string($path);
- if ($path) {
- $callstack = debug_backtrace();
- foreach ($callstack as $call) {
- $call['file'] = str_replace("\\", "/", $call['file']);
- if ($include_subdirs) {
- if (strpos($call['file'], $path) === 0) {
- if ($strict_mode) {
- $callstack[1]['file'] = str_replace("\\", "/", $callstack[1]['file']);
- if ($callstack[1] === $call) {
- return true;
- }
- } else {
- return true;
- }
- }
- } else {
- if (strcmp($path, $call['file']) == 0) {
- if ($strict_mode) {
- if ($callstack[1] === $call) {
- return true;
- }
- } else {
- return true;
- }
- }
- }
- }
- return false;
- }
- if (isset($CONFIG->debug)) {
- system_message("Gatekeeper'd function called from {$callstack[1]['file']}:" . "{$callstack[1]['line']}\n\nStack trace:\n\n" . print_r($callstack, true));
- }
- return false;
- }
- /**
- * Returns SQL where clause for owner and containers.
- *
- * @deprecated 1.8 Use elgg_get_guid_based_where_sql();
- *
- * @param string $table Entity table prefix as defined in SELECT...FROM entities $table
- * @param NULL|array $owner_guids Owner GUIDs
- *
- * @return FALSE|str
- * @since 1.7.0
- * @access private
- */
- function elgg_get_entity_owner_where_sql($table, $owner_guids) {
- elgg_deprecated_notice('elgg_get_entity_owner_where_sql() is deprecated by elgg_get_guid_based_where_sql().', 1.8);
- return elgg_get_guid_based_where_sql("{$table}.owner_guid", $owner_guids);
- }
- /**
- * Returns SQL where clause for containers.
- *
- * @deprecated 1.8 Use elgg_get_guid_based_where_sql();
- *
- * @param string $table Entity table prefix as defined in
- * SELECT...FROM entities $table
- * @param NULL|array $container_guids Array of container guids
- *
- * @return FALSE|string
- * @since 1.7.0
- * @access private
- */
- function elgg_get_entity_container_where_sql($table, $container_guids) {
- elgg_deprecated_notice('elgg_get_entity_container_where_sql() is deprecated by elgg_get_guid_based_where_sql().', 1.8);
- return elgg_get_guid_based_where_sql("{$table}.container_guid", $container_guids);
- }
- /**
- * Returns SQL where clause for site entities
- *
- * @deprecated 1.8 Use elgg_get_guid_based_where_sql()
- *
- * @param string $table Entity table prefix as defined in SELECT...FROM entities $table
- * @param NULL|array $site_guids Array of site guids
- *
- * @return FALSE|string
- * @since 1.7.0
- * @access private
- */
- function elgg_get_entity_site_where_sql($table, $site_guids) {
- elgg_deprecated_notice('elgg_get_entity_site_where_sql() is deprecated by elgg_get_guid_based_where_sql().', 1.8);
- return elgg_get_guid_based_where_sql("{$table}.site_guid", $site_guids);
- }
- /**
- * Return an array of objects in a given container.
- *
- * @see get_entities()
- *
- * @param int $group_guid The container (defaults to current page owner)
- * @param string $subtype The subtype
- * @param int $owner_guid Owner
- * @param int $site_guid The site
- * @param string $order_by Order
- * @param int $limit Limit on number of elements to return, by default 10.
- * @param int $offset Where to start, by default 0.
- * @param bool $count Whether to return the entities or a count of them.
- *
- * @return array|false
- * @deprecated 1.8 Use elgg_get_entities() instead
- */
- function get_objects_in_group($group_guid, $subtype = "", $owner_guid = 0, $site_guid = 0, $order_by = "", $limit = 10, $offset = 0, $count = FALSE) {
- elgg_deprecated_notice("get_objects_in_group was deprected in 1.8. Use elgg_get_entities() instead", 1.8);
- global $CONFIG;
- if ($subtype === FALSE || $subtype === null || $subtype === 0) {
- return FALSE;
- }
- if ($order_by == "") {
- $order_by = "e.time_created desc";
- }
- $order_by = sanitise_string($order_by);
- $limit = (int)$limit;
- $offset = (int)$offset;
- $site_guid = (int)$site_guid;
- if ($site_guid == 0) {
- $site_guid = $CONFIG->site_guid;
- }
- $container_guid = (int)$group_guid;
- if ($container_guid == 0) {
- $container_guid = elgg_get_page_owner_guid();
- }
- $where = array();
- $where[] = "e.type='object'";
- if (!empty($subtype)) {
- if (!$subtype = get_subtype_id('object', $subtype)) {
- return FALSE;
- }
- $where[] = "e.subtype=$subtype";
- }
- if ($owner_guid != "") {
- if (!is_array($owner_guid)) {
- $owner_guid = (int)$owner_guid;
- $where[] = "e.container_guid = '$owner_guid'";
- } else if (sizeof($owner_guid) > 0) {
- // Cast every element to the owner_guid array to int
- $owner_guid = array_map("sanitise_int", $owner_guid);
- $owner_guid = implode(",", $owner_guid);
- $where[] = "e.container_guid in ({$owner_guid})";
- }
- }
- if ($site_guid > 0) {
- $where[] = "e.site_guid = {$site_guid}";
- }
- if ($container_guid > 0) {
- $where[] = "e.container_guid = {$container_guid}";
- }
- if (!$count) {
- $query = "SELECT * from {$CONFIG->dbprefix}entities e" . " join {$CONFIG->dbprefix}objects_entity o on e.guid=o.guid where ";
- } else {
- $query = "SELECT count(e.guid) as total from {$CONFIG->dbprefix}entities e" . " join {$CONFIG->dbprefix}objects_entity o on e.guid=o.guid where ";
- }
- foreach ($where as $w) {
- $query .= " $w and ";
- }
- // Add access controls
- $query .= get_access_sql_suffix('e');
- if (!$count) {
- $query .= " order by $order_by";
- // Add order and limit
- if ($limit) {
- $query .= " limit $offset, $limit";
- }
- $dt = get_data($query, "entity_row_to_elggstar");
- return $dt;
- } else {
- $total = get_data_row($query);
- return $total->total;
- }
- }
- /**
- * Lists entities that belong to a group.
- *
- * @param string $subtype The arbitrary subtype of the entity
- * @param int $owner_guid The GUID of the owning user
- * @param int $container_guid The GUID of the containing group
- * @param int $limit The number of entities to display per page (default: 10)
- * @param bool $fullview Whether or not to display the full view (default: true)
- * @param bool $listtypetoggle Whether or not to allow gallery view (default: true)
- * @param bool $pagination Whether to display pagination (default: true)
- *
- * @return string List of parsed entities
- *
- * @see elgg_list_entities()
- * @deprecated 1.8 Use elgg_list_entities() instead
- */
- function list_entities_groups($subtype = "", $owner_guid = 0, $container_guid = 0, $limit = 10, $fullview = true, $listtypetoggle = true, $pagination = true) {
- elgg_deprecated_notice("list_entities_groups was deprecated in 1.8. Use elgg_list_entities() instead.", 1.8);
- $offset = (int)get_input('offset');
- $count = get_objects_in_group($container_guid, $subtype, $owner_guid, 0, "", $limit, $offset, true);
- $entities = get_objects_in_group($container_guid, $subtype, $owner_guid, 0, "", $limit, $offset);
- return elgg_view_entity_list($entities, $count, $offset, $limit, $fullview, $listtypetoggle, $pagination);
- }
- /**
- * Get all the entities from metadata from a group.
- *
- * @param int $group_guid The ID of the group.
- * @param mixed $meta_name Metadata name
- * @param mixed $meta_value Metadata value
- * @param string $entity_type The type of entity to look for, eg 'site' or 'object'
- * @param string $entity_subtype The subtype of the entity.
- * @param int $owner_guid Owner guid
- * @param int $limit Limit
- * @param int $offset Offset
- * @param string $order_by Optional ordering.
- * @param int $site_guid Site GUID. 0 for current, -1 for any
- * @param bool $count Return count instead of entities
- *
- * @return array|false
- * @deprecated 1.8 Use elgg_get_entities_from_metadata()
- */
- function get_entities_from_metadata_groups($group_guid, $meta_name, $meta_value = "", $entity_type = "", $entity_subtype = "", $owner_guid = 0, $limit = 10, $offset = 0, $order_by = "", $site_guid = 0, $count = false) {
- elgg_deprecated_notice("get_entities_from_metadata_groups was deprecated in 1.8.", 1.8);
- global $CONFIG;
- $meta_n = get_metastring_id($meta_name);
- $meta_v = get_metastring_id($meta_value);
- $entity_type = sanitise_string($entity_type);
- $entity_subtype = get_subtype_id($entity_type, $entity_subtype);
- $limit = (int)$limit;
- $offset = (int)$offset;
- if ($order_by == "") {
- $order_by = "e.time_created desc";
- }
- $order_by = sanitise_string($order_by);
- $site_guid = (int)$site_guid;
- if (is_array($owner_guid)) {
- foreach ($owner_guid as $key => $guid) {
- $owner_guid[$key] = (int)$guid;
- }
- } else {
- $owner_guid = (int)$owner_guid;
- }
- if ($site_guid == 0) {
- $site_guid = $CONFIG->site_guid;
- }
- $container_guid = (int)$group_guid;
- if ($container_guid == 0) {
- $container_guid = elgg_get_page_owner_guid();
- }
- $where = array();
- if ($entity_type != "") {
- $where[] = "e.type='$entity_type'";
- }
- if ($entity_subtype) {
- $where[] = "e.subtype=$entity_subtype";
- }
- if ($meta_name != "") {
- $where[] = "m.name_id='$meta_n'";
- }
- if ($meta_value != "") {
- $where[] = "m.value_id='$meta_v'";
- }
- if ($site_guid > 0) {
- $where[] = "e.site_guid = {$site_guid}";
- }
- if ($container_guid > 0) {
- $where[] = "e.container_guid = {$container_guid}";
- }
- if (is_array($owner_guid)) {
- $where[] = "e.container_guid in (" . implode(",", $owner_guid) . ")";
- } else if ($owner_guid > 0) {
- $where[] = "e.container_guid = {$owner_guid}";
- }
- if (!$count) {
- $query = "SELECT distinct e.* ";
- } else {
- $query = "SELECT count(e.guid) as total ";
- }
- $query .= "from {$CONFIG->dbprefix}entities e" . " JOIN {$CONFIG->dbprefix}metadata m on e.guid = m.entity_guid " . " JOIN {$CONFIG->dbprefix}objects_entity o on e.guid = o.guid where";
- foreach ($where as $w) {
- $query .= " $w and ";
- }
- // Add access controls
- $query .= get_access_sql_suffix("e");
- if (!$count) {
- $query .= " order by $order_by limit $offset, $limit"; // Add order and limit
- return get_data($query, "entity_row_to_elggstar");
- } else {
- if ($row = get_data_row($query)) {
- return $row->total;
- }
- }
- return false;
- }
- /**
- * As get_entities_from_metadata_groups() but with multiple entities.
- *
- * @param int $group_guid The ID of the group.
- * @param array $meta_array Array of 'name' => 'value' pairs
- * @param string $entity_type The type of entity to look for, eg 'site' or 'object'
- * @param string $entity_subtype The subtype of the entity.
- * @param int $owner_guid Owner GUID
- * @param int $limit Limit
- * @param int $offset Offset
- * @param string $order_by Optional ordering.
- * @param int $site_guid Site GUID. 0 for current, -1 for any
- * @param bool $count Return count of entities instead of entities
- *
- * @return int|array List of ElggEntities, or the total number if count is set to false
- * @deprecated 1.8 Use elgg_get_entities_from_metadata()
- */
- function get_entities_from_metadata_groups_multi($group_guid, $meta_array, $entity_type = "", $entity_subtype = "", $owner_guid = 0, $limit = 10, $offset = 0, $order_by = "", $site_guid = 0, $count = false) {
- elgg_deprecated_notice("get_entities_from_metadata_groups_multi was deprecated in 1.8.", 1.8);
- global $CONFIG;
- if (!is_array($meta_array) || sizeof($meta_array) == 0) {
- return false;
- }
- $where = array();
- $mindex = 1;
- $join = "";
- foreach ($meta_array as $meta_name => $meta_value) {
- $meta_n = get_metastring_id($meta_name);
- $meta_v = get_metastring_id($meta_value);
- $join .= " JOIN {$CONFIG->dbprefix}metadata m{$mindex} on e.guid = m{$mindex}.entity_guid" . " JOIN {$CONFIG->dbprefix}objects_entity o on e.guid = o.guid ";
- if ($meta_name != "") {
- $where[] = "m{$mindex}.name_id='$meta_n'";
- }
- if ($meta_value != "") {
- $where[] = "m{$mindex}.value_id='$meta_v'";
- }
- $mindex++;
- }
- $entity_type = sanitise_string($entity_type);
- $entity_subtype = get_subtype_id($entity_type, $entity_subtype);
- $limit = (int)$limit;
- $offset = (int)$offset;
- if ($order_by == "") {
- $order_by = "e.time_created desc";
- }
- $order_by = sanitise_string($order_by);
- $owner_guid = (int)$owner_guid;
- $site_guid = (int)$site_guid;
- if ($site_guid == 0) {
- $site_guid = $CONFIG->site_guid;
- }
- //$access = get_access_list();
- if ($entity_type != "") {
- $where[] = "e.type = '{$entity_type}'";
- }
- if ($entity_subtype) {
- $where[] = "e.subtype = {$entity_subtype}";
- }
- if ($site_guid > 0) {
- $where[] = "e.site_guid = {$site_guid}";
- }
- if ($owner_guid > 0) {
- $where[] = "e.owner_guid = {$owner_guid}";
- }
- if ($container_guid > 0) {
- $where[] = "e.container_guid = {$container_guid}";
- }
- if ($count) {
- $query = "SELECT count(e.guid) as total ";
- } else {
- $query = "SELECT distinct e.* ";
- }
- $query .= " from {$CONFIG->dbprefix}entities e {$join} where";
- foreach ($where as $w) {
- $query .= " $w and ";
- }
- $query .= get_access_sql_suffix("e"); // Add access controls
- if (!$count) {
- $query .= " order by $order_by limit $offset, $limit"; // Add order and limit
- return get_data($query, "entity_row_to_elggstar");
- } else {
- if ($count = get_data_row($query)) {
- return $count->total;
- }
- }
- return false;
- }
- /**
- * List items within a given geographic area.
- *
- * @param real $lat Latitude
- * @param real $long Longitude
- * @param real $radius The radius
- * @param string $type The type of entity (eg "user", "object" etc)
- * @param string $subtype The arbitrary subtype of the entity
- * @param int $owner_guid The GUID of the owning user
- * @param int $limit The number of entities to display per page (default: 10)
- * @param bool $fullview Whether or not to display the full view (default: true)
- * @param bool $listtypetoggle Whether or not to allow gallery view
- * @param bool $navigation Display pagination? Default: true
- *
- * @return string A viewable list of entities
- * @deprecated 1.8 Use elgg_get_entities_from_location()
- */
- function list_entities_in_area($lat, $long, $radius, $type = "", $subtype = "", $owner_guid = 0, $limit = 10, $fullview = true, $listtypetoggle = false, $navigation = true) {
- elgg_deprecated_notice('list_entities_in_area() was deprecated. Use elgg_list_entities_from_location()', 1.8);
- $options = array();
- $options['latitude'] = $lat;
- $options['longitude'] = $long;
- $options['distance'] = $radius;
- if ($type) {
- $options['types'] = $type;
- }
- if ($subtype) {
- $options['subtypes'] = $subtype;
- }
- if ($owner_guid) {
- if (is_array($owner_guid)) {
- $options['owner_guids'] = $owner_guid;
- } else {
- $options['owner_guid'] = $owner_guid;
- }
- }
- $options['limit'] = $limit;
- $options['full_view'] = $fullview;
- $options['list_type_toggle'] = $listtypetoggle;
- $options['pagination'] = $pagination;
- return elgg_list_entities_from_location($options);
- }
- /**
- * List entities in a given location
- *
- * @param string $location Location
- * @param string $type The type of entity (eg "user", "object" etc)
- * @param string $subtype The arbitrary subtype of the entity
- * @param int $owner_guid The GUID of the owning user
- * @param int $limit The number of entities to display per page (default: 10)
- * @param bool $fullview Whether or not to display the full view (default: true)
- * @param bool $listtypetoggle Whether or not to allow gallery view
- * @param bool $navigation Display pagination? Default: true
- *
- * @return string A viewable list of entities
- * @deprecated 1.8 Use elgg_list_entities_from_location()
- */
- function list_entities_location($location, $type = "", $subtype = "", $owner_guid = 0, $limit = 10, $fullview = true, $listtypetoggle = false, $navigation = true) {
- elgg_deprecated_notice('list_entities_location() was deprecated. Use elgg_list_entities_from_metadata()', 1.8);
- return list_entities_from_metadata('location', $location, $type, $subtype, $owner_guid, $limit, $fullview, $listtypetoggle, $navigation);
- }
- /**
- * Return entities within a given geographic area.
- *
- * @param float $lat Latitude
- * @param float $long Longitude
- * @param float $radius The radius
- * @param string $type The type of entity (eg "user", "object" etc)
- * @param string $subtype The arbitrary subtype of the entity
- * @param int $owner_guid The GUID of the owning user
- * @param string $order_by The field to order by; by default, time_created desc
- * @param int $limit The number of entities to return; 10 by default
- * @param int $offset The indexing offset, 0 by default
- * @param boolean $count Count entities
- * @param int $site_guid Site GUID. 0 for current, -1 for any
- * @param int|array $container_guid Container GUID
- *
- * @return array A list of entities.
- * @deprecated 1.8 Use elgg_get_entities_from_location()
- */
- function get_entities_in_area($lat, $long, $radius, $type = "", $subtype = "", $owner_guid = 0, $order_by = "", $limit = 10, $offset = 0, $count = false, $site_guid = 0, $container_guid = NULL) {
- elgg_deprecated_notice('get_entities_in_area() was deprecated by elgg_get_entities_from_location()!', 1.8);
- $options = array();
- $options['latitude'] = $lat;
- $options['longitude'] = $long;
- $options['distance'] = $radius;
- // set container_guid to owner_guid to emulate old functionality
- if ($owner_guid != "") {
- if (is_null($container_guid)) {
- $container_guid = $owner_guid;
- }
- }
- if ($type) {
- $options['types'] = $type;
- }
- if ($subtype) {
- $options['subtypes'] = $subtype;
- }
- if ($owner_guid) {
- if (is_array($owner_guid)) {
- $options['owner_guids'] = $owner_guid;
- } else {
- $options['owner_guid'] = $owner_guid;
- }
- }
- if ($container_guid) {
- if (is_array($container_guid)) {
- $options['container_guids'] = $container_guid;
- } else {
- $options['container_guid'] = $container_guid;
- }
- }
- $options['limit'] = $limit;
- if ($offset) {
- $options['offset'] = $offset;
- }
- if ($order_by) {
- $options['order_by'];
- }
- if ($site_guid) {
- $options['site_guid'];
- }
- if ($count) {
- $options['count'] = $count;
- }
- return elgg_get_entities_from_location($options);
- }
- /**
- * Return a list of entities suitable for display based on the given search criteria.
- *
- * @see elgg_view_entity_list
- *
- * @deprecated 1.8 Use elgg_list_entities_from_metadata
- *
- * @param mixed $meta_name Metadata name to search on
- * @param mixed $meta_value The value to match, optionally
- * @param string $entity_type The type of entity to look for, eg 'site' or 'object'
- * @param string $entity_subtype The subtype of the entity
- * @param int $owner_guid Owner GUID
- * @param int $limit Number of entities to display per page
- * @param bool $fullview WDisplay the full view (default: true)
- * @param bool $listtypetoggle Allow users to toggle to the gallery view. Default: true
- * @param bool $pagination Display pagination? Default: true
- * @param bool $case_sensitive Case sensitive metadata names?
- *
- * @return string
- *
- * @return string A list of entities suitable for display
- */
- function list_entities_from_metadata($meta_name, $meta_value = "", $entity_type = ELGG_ENTITIES_ANY_VALUE, $entity_subtype = ELGG_ENTITIES_ANY_VALUE, $owner_guid = 0, $limit = 10, $fullview = true, $listtypetoggle = true, $pagination = true, $case_sensitive = true) {
- elgg_deprecated_notice('list_entities_from_metadata() was deprecated by elgg_list_entities_from_metadata()!', 1.8);
- $offset = (int)get_input('offset');
- $limit = (int)$limit;
- $options = array(
- 'metadata_name' => $meta_name,
- 'metadata_value' => $meta_value,
- 'type' => $entity_type,
- 'subtype' => $entity_subtype,
- 'limit' => $limit,
- 'offset' => $offset,
- 'count' => TRUE,
- 'metadata_case_sensitive' => $case_sensitive
- );
- // previous function allowed falsy $owner_guid for anything
- if ($owner_guid) {
- $options['owner_guid'] = $owner_guid;
- }
- $count = elgg_get_entities_from_metadata($options);
- $options['count'] = FALSE;
- $entities = elgg_get_entities_from_metadata($options);
- return elgg_view_entity_list($entities, $count, $offset, $limit, $fullview, $listtypetoggle, $pagination);
- }
- /**
- * Returns a viewable list of entities based on the given search criteria.
- *
- * @see elgg_view_entity_list
- *
- * @param array $meta_array Array of 'name' => 'value' pairs
- * @param string $entity_type The type of entity to look for, eg 'site' or 'object'
- * @param string $entity_subtype The subtype of the entity.
- * @param int $owner_guid Owner GUID
- * @param int $limit Limit
- * @param bool $fullview WDisplay the full view (default: true)
- * @param bool $listtypetoggle Allow users to toggle to the gallery view. Default: true
- * @param bool $pagination Display pagination? Default: true
- *
- * @return string List of ElggEntities suitable for display
- *
- * @deprecated 1.8 Use elgg_list_entities_from_metadata() instead
- */
- function list_entities_from_metadata_multi($meta_array, $entity_type = "", $entity_subtype = "", $owner_guid = 0, $limit = 10, $fullview = true, $listtypetoggle = true, $pagination = true) {
- elgg_deprecated_notice(elgg_echo('deprecated:function', array(
- 'list_entities_from_metadata_multi', 'elgg_get_entities_from_metadata')), 1.8);
- $offset = (int)get_input('offset');
- $limit = (int)$limit;
- $count = get_entities_from_metadata_multi($meta_array, $entity_type, $entity_subtype, $owner_guid, $limit, $offset, "", $site_guid, true);
- $entities = get_entities_from_metadata_multi($meta_array, $entity_type, $entity_subtype, $owner_guid, $limit, $offset, "", $site_guid, false);
- return elgg_view_entity_list($entities, $count, $offset, $limit, $fullview, $listtypetoggle, $pagination);
- }
- /**
- * Deprecated by elgg_register_menu_item(). Set $menu_name to 'page'.
- *
- * @see elgg_register_menu_item()
- * @deprecated 1.8 Use the new menu system
- *
- * @param string $label The label
- * @param string $link The link
- * @param string $group The group to store item in
- * @param boolean $onclick Add a confirmation when clicked?
- * @param boolean $selected Is menu item selected
- *
- * @return bool
- */
- function add_submenu_item($label, $link, $group = 'default', $onclick = false, $selected = NULL) {
- elgg_deprecated_notice('add_submenu_item was deprecated by elgg_register_menu_item', 1.8);
- // submenu items were added in the page setup hook usually by checking
- // the context. We'll pass in the current context here, which will
- // emulate that effect.
- // if context == 'main' (default) it probably means they always wanted
- // the menu item to show up everywhere.
- $context = elgg_get_context();
- if ($context == 'main') {
- $context = 'all';
- }
- $item = array('name' => $label, 'text' => $label, 'href' => $link, 'context' => $context,
- 'section' => $group,);
- if ($selected) {
- $item['selected'] = true;
- }
- if ($onclick) {
- $js = "onclick=\"javascript:return confirm('" . elgg_echo('deleteconfirm') . "')\"";
- $item['vars'] = array('js' => $js);
- }
- return elgg_register_menu_item('page', $item);
- }
- /**
- * Remove an item from submenu by label
- *
- * @deprecated 1.8 Use the new menu system
- * @see elgg_unregister_menu_item()
- *
- * @param string $label The item label
- * @param string $group The submenu group (default "a")
- * @return bool whether the item was removed or not
- * @since 1.7.8
- */
- function remove_submenu_item($label, $group = 'a') {
- elgg_deprecated_notice('remove_submenu_item was deprecated by elgg_unregister_menu_item', 1.8);
- return elgg_unregister_menu_item('page', $label);
- }
- /**
- * Use elgg_view_menu(). Set $menu_name to 'owner_block'.
- *
- * @see elgg_view_menu()
- * @deprecated 1.8 Use the new menu system. elgg_view_menu()
- *
- * @return string
- */
- function get_submenu() {
- elgg_deprecated_notice("get_submenu() has been deprecated by elgg_view_menu()", 1.8);
- return elgg_view_menu('owner_block', array('entity' => $owner,
- 'class' => 'elgg-menu-owner-block',));
- }
- /**
- * Adds an item to the site-wide menu.
- *
- * You can obtain the menu array by calling {@link get_register('menu')}
- *
- * @param string $menu_name The name of the menu item
- * @param string $menu_url The URL of the page
- * @param array $menu_children Optionally, an array of submenu items (not used)
- * @param string $context (not used)
- *
- * @return true|false Depending on success
- * @deprecated 1.8 use elgg_register_menu_item() for the menu 'site'
- */
- function add_menu($menu_name, $menu_url, $menu_children = array(), $context = "") {
- elgg_deprecated_notice('add_menu() deprecated by elgg_register_menu_item()', 1.8);
- return elgg_register_menu_item('site', array('name' => $menu_name, 'text' => $menu_name,
- 'href' => $menu_url,));
- }
- /**
- * Removes an item from the menu register
- *
- * @param string $menu_name The name of the menu item
- *
- * @return true|false Depending on success
- * @deprecated 1.8 Use the new menu system
- */
- function remove_menu($menu_name) {
- elgg_deprecated_notice("remove_menu() deprecated by elgg_unregister_menu_item()", 1.8);
- return elgg_unregister_menu_item('site', $menu_name);
- }
- /**
- * When given a title, returns a version suitable for inclusion in a URL
- *
- * @param string $title The title
- *
- * @return string The optimised title
- * @deprecated 1.8 Use elgg_get_friendly_title()
- */
- function friendly_title($title) {
- elgg_deprecated_notice('friendly_title was deprecated by elgg_get_friendly_title', 1.8);
- return elgg_get_friendly_title($title);
- }
- /**
- * Displays a UNIX timestamp in a friendly way (eg "less than a minute ago")
- *
- * @param int $time A UNIX epoch timestamp
- *
- * @return string The friendly time
- * @deprecated 1.8 Use elgg_view_friendly_time()
- */
- function friendly_time($time) {
- elgg_deprecated_notice('friendly_time was deprecated by elgg_view_friendly_time', 1.8);
- return elgg_view_friendly_time($time);
- }
- /**
- * Filters a string into an array of significant words
- *
- * @deprecated 1.8 Don't use this.
- *
- * @param string $string A string
- *
- * @return array
- */
- function filter_string($string) {
- elgg_deprecated_notice('filter_string() was deprecated!', 1.8);
- // Convert it to lower and trim
- $string = strtolower($string);
- $string = trim($string);
- // Remove links and email addresses
- // match protocol://address/path/file.extension?some=variable&another=asf%
- $string = preg_replace("/\s([a-zA-Z]+:\/\/[a-z][a-z0-9\_\.\-]*[a-z]{2,6}" . "[a-zA-Z0-9\/\*\-\?\&\%\=]*)([\s|\.|\,])/iu", " ", $string);
- // match www.something.domain/path/file.extension?some=variable&another=asf%
- $string = preg_replace("/\s(www\.[a-z][a-z0-9\_\.\-]*[a-z]{2,6}" . "[a-zA-Z0-9\/\*\-\?\&\%\=]*)([\s|\.|\,])/iu", " ", $string);
- // match name@address
- $string = preg_replace("/\s([a-zA-Z][a-zA-Z0-9\_\.\-]*[a-zA-Z]" . "*\@[a-zA-Z][a-zA-Z0-9\_\.\-]*[a-zA-Z]{2,6})([\s|\.|\,])/iu", " ", $string);
- // Sanitise the string; remove unwanted characters
- $string = preg_replace('/\W/ui', ' ', $string);
- // Explode it into an array
- $terms = explode(' ', $string);
- // Remove any blacklist terms
- //$terms = array_filter($terms, 'remove_blacklist');
- return $terms;
- }
- /**
- * Returns true if the word in $input is considered significant
- *
- * @deprecated 1.8 Don't use this.
- *
- * @param string $input A word
- *
- * @return true|false
- */
- function remove_blacklist($input) {
- elgg_deprecated_notice('remove_blacklist() was deprecated!', 1.8);
- global $CONFIG;
- if (!is_array($CONFIG->wordblacklist)) {
- return $input;
- }
- if (strlen($input) < 3 || in_array($input, $CONFIG->wordblacklist)) {
- return false;
- }
- return true;
- }
- /**
- * Gets the guid of the entity that owns the current page.
- *
- * @deprecated 1.8 Use elgg_get_page_owner_guid()
- *
- * @return int The current page owner guid (0 if none).
- */
- function page_owner() {
- elgg_deprecated_notice('page_owner() was deprecated by elgg_get_page_owner_guid().', 1.8);
- return elgg_get_page_owner_guid();
- }
- /**
- * Gets the owner entity for the current page.
- *
- * @deprecated 1.8 Use elgg_get_page_owner_entity()
- * @return ElggEntity|false The current page owner or false if none.
- */
- function page_owner_entity() {
- elgg_deprecated_notice('page_owner_entity() was deprecated by elgg_get_page_owner_entity().', 1.8);
- return elgg_get_page_owner_entity();
- }
- /**
- * Registers a page owner handler function
- *
- * @param string $functionname The callback function
- *
- * @deprecated 1.8 Use the 'page_owner', 'system' plugin hook
- * @return void
- */
- function add_page_owner_handler($functionname) {
- elgg_deprecated_notice("add_page_owner_handler() was deprecated by the plugin hook 'page_owner', 'system'.", 1.8);
- }
- /**
- * Set a page owner entity
- *
- * @param int $entitytoset The GUID of the entity
- *
- * @deprecated 1.8 Use elgg_set_page_owner_guid()
- * @return void
- */
- function set_page_o…
Large files files are truncated, but you can click here to view the full file