Elgg  Version 1.9
deprecated-1.8.php
Go to the documentation of this file.
1 <?php
2 
10 function list_entities_from_access_id($access_id, $entity_type = "", $entity_subtype = "", $owner_guid = 0, $limit = 10, $fullview = true, $listtypetoggle = true, $pagination = true) {
11 
12  elgg_deprecated_notice("All list_entities* functions were deprecated in 1.8. Use elgg_list_entities* instead.", 1.8);
13 
14  echo elgg_list_entities_from_access_id(array('access_id' => $access_id,
15  'type' => $entity_type, 'subtype' => $entity_subtype, 'owner_guids' => $owner_guid,
16  'limit' => $limit, 'full_view' => $fullview, 'list_type_toggle' => $listtypetoggle,
17  'pagination' => $pagination,));
18 }
19 
30 function register_action($action, $public = false, $filename = "", $admin_only = false) {
31  elgg_deprecated_notice("register_action() was deprecated by elgg_register_action()", 1.8);
32 
33  if ($admin_only) {
34  $access = 'admin';
35  } elseif ($public) {
36  $access = 'public';
37  } else {
38  $access = 'logged_in';
39  }
40 
42 }
43 
66 function extend_elgg_admin_page($new_admin_view, $view = 'admin/main', $priority = 500) {
67  elgg_deprecated_notice('extend_elgg_admin_page() does nothing. Extend admin views manually.', 1.8);
68 }
69 
89 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) {
90 
91  $msg = 'get_entities_from_annotations_calculate_x() is deprecated by elgg_get_entities_from_annotation_calculation().';
92 
93  elgg_deprecated_notice($msg, 1.8);
94 
95  $options = array();
96 
97  $options['calculation'] = $sum;
98 
99  if ($entity_type) {
100  $options['types'] = $entity_type;
101  }
102 
103  if ($entity_subtype) {
104  $options['subtypes'] = $entity_subtype;
105  }
106 
107  $options['annotation_names'] = $name;
108 
109  if ($mdname) {
110  $options['metadata_names'] = $mdname;
111  }
112 
113  if ($mdvalue) {
114  $options['metadata_values'] = $mdvalue;
115  }
116 
117  // original function rewrote this to container guid.
118  if ($owner_guid) {
119  if (is_array($owner_guid)) {
120  $options['container_guids'] = $owner_guid;
121  } else {
122  $options['container_guid'] = $owner_guid;
123  }
124  }
125 
126  $options['limit'] = $limit;
127  $options['offset'] = $offset;
128 
129  $options['order_by'] = "annotation_calculation $orderdir";
130 
131  $options['count'] = $count;
132 
134 }
135 
160 function get_entities_from_annotation_count($entity_type = "", $entity_subtype = "", $name = "", $mdname = '', $mdvalue = '', $owner_guid = 0, $limit = 10, $offset = 0, $orderdir = 'desc', $count = false) {
161 
162  $msg = 'get_entities_from_annotation_count() is deprecated by elgg_get_entities_from_annotation_calculation().';
163 
164  elgg_deprecated_notice($msg, 1.8);
165 
166  $options = array();
167 
168  $options['calculation'] = 'sum';
169 
170  if ($entity_type) {
171  $options['types'] = $entity_type;
172  }
173 
174  if ($entity_subtype) {
175  $options['subtypes'] = $entity_subtype;
176  }
177 
178  $options['annotation_names'] = $name;
179 
180  if ($mdname) {
181  $options['metadata_names'] = $mdname;
182  }
183 
184  if ($mdvalue) {
185  $options['metadata_values'] = $mdvalue;
186  }
187 
188  if ($owner_guid) {
189  if (is_array($owner_guid)) {
190  $options['owner_guids'] = $owner_guid;
191  } else {
192  $options['owner_guid'] = $owner_guid;
193  }
194  }
195 
196  $options['limit'] = $limit;
197  $options['offset'] = $offset;
198 
199  $options['order_by'] = "annotation_calculation $orderdir";
200 
201  $options['count'] = $count;
202 
204 }
205 
225 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') {
226 
227  $msg = 'list_entities_from_annotation_count() is deprecated by elgg_list_entities_from_annotation_calculation().';
228 
229  elgg_deprecated_notice($msg, 1.8);
230 
231  $options = array();
232 
233  $options['calculation'] = 'sum';
234 
235  if ($entity_type) {
236  $options['types'] = $entity_type;
237  }
238 
239  if ($entity_subtype) {
240  $options['subtypes'] = $entity_subtype;
241  }
242 
243  $options['annotation_names'] = $name;
244 
245  if ($owner_guid) {
246  if (is_array($owner_guid)) {
247  $options['owner_guids'] = $owner_guid;
248  } else {
249  $options['owner_guid'] = $owner_guid;
250  }
251  }
252 
253  $options['full_view'] = $fullview;
254 
255  $options['list_type_toggle'] = $listtypetoggle;
256 
257  $options['pagination'] = $pagination;
258 
259  $options['limit'] = $limit;
260 
261  $options['order_by'] = "annotation_calculation $orderdir";
262 
264 }
265 
280 function add_to_register($register_name, $subregister_name, $subregister_value, $children_array = array()) {
281  elgg_deprecated_notice("add_to_register() has been deprecated", 1.8);
282  global $CONFIG;
283 
284  if (empty($register_name) || empty($subregister_name)) {
285  return false;
286  }
287 
288  if (!isset($CONFIG->registers)) {
289  $CONFIG->registers = array();
290  }
291 
292  if (!isset($CONFIG->registers[$register_name])) {
293  $CONFIG->registers[$register_name] = array();
294  }
295 
296  $subregister = new stdClass;
297  $subregister->name = $subregister_name;
298  $subregister->value = $subregister_value;
299 
300  if (is_array($children_array)) {
301  $subregister->children = $children_array;
302  }
303 
304  $CONFIG->registers[$register_name][$subregister_name] = $subregister;
305  return true;
306 }
307 
321 function remove_from_register($register_name, $subregister_name) {
322  elgg_deprecated_notice("remove_from_register() has been deprecated", 1.8);
323  global $CONFIG;
324 
325  if (empty($register_name) || empty($subregister_name)) {
326  return false;
327  }
328 
329  if (!isset($CONFIG->registers)) {
330  return false;
331  }
332 
333  if (!isset($CONFIG->registers[$register_name])) {
334  return false;
335  }
336 
337  if (isset($CONFIG->registers[$register_name][$subregister_name])) {
338  unset($CONFIG->registers[$register_name][$subregister_name]);
339  return true;
340  }
341 
342  return false;
343 }
344 
354 function get_register($register_name) {
355  elgg_deprecated_notice("get_register() has been deprecated", 1.8);
356  global $CONFIG;
357 
358  if ($register_name == 'menu') {
359  // backward compatible code for site menu
360  $menu = $CONFIG->menus['site'];
362  $menu_items = $builder->getMenu('text');
363  $menu_items = $menu_items['default'];
364 
365  $menu = array();
366  foreach ($menu_items as $item) {
367  $subregister = new stdClass;
368  $subregister->name = $item->getText();
369  $subregister->value = $item->getHref();
370  $menu[$subregister->name] = $subregister;
371  }
372  return $menu;
373  }
374 
375  if (isset($CONFIG->registers[$register_name])) {
376  return $CONFIG->registers[$register_name];
377  }
378 
379  return false;
380 }
381 
397 function events($event = "", $object_type = "", $function = "", $priority = 500, $call = false, $object = null) {
398 
399  elgg_deprecated_notice('events() has been deprecated.', 1.8);
400 
401  // leaving this here just in case someone was directly calling this internal function
402  if (!$call) {
403  return elgg_register_event_handler($event, $object_type, $function, $priority);
404  } else {
405  return trigger_elgg_event($event, $object_type, $object);
406  }
407 }
408 
419 function register_elgg_event_handler($event, $object_type, $callback, $priority = 500) {
420  elgg_deprecated_notice("register_elgg_event_handler() was deprecated by elgg_register_event_handler()", 1.8);
421  return elgg_register_event_handler($event, $object_type, $callback, $priority);
422 }
423 
434 function unregister_elgg_event_handler($event, $object_type, $callback) {
435  elgg_deprecated_notice('unregister_elgg_event_handler => elgg_unregister_event_handler', 1.8);
436  elgg_unregister_event_handler($event, $object_type, $callback);
437 }
438 
449 function trigger_elgg_event($event, $object_type, $object = null) {
450  elgg_deprecated_notice('trigger_elgg_event() was deprecated by elgg_trigger_event()', 1.8);
451  return elgg_trigger_event($event, $object_type, $object);
452 }
453 
479 function register_plugin_hook($hook, $type, $callback, $priority = 500) {
480  elgg_deprecated_notice("register_plugin_hook() was deprecated by elgg_register_plugin_hook_handler()", 1.8);
481  return elgg_register_plugin_hook_handler($hook, $type, $callback, $priority);
482 }
483 
494 function unregister_plugin_hook($hook, $entity_type, $callback) {
495  elgg_deprecated_notice("unregister_plugin_hook() was deprecated by elgg_unregister_plugin_hook_handler()", 1.8);
496  elgg_unregister_plugin_hook_handler($hook, $entity_type, $callback);
497 }
498 
515 function trigger_plugin_hook($hook, $type, $params = null, $returnvalue = null) {
516  elgg_deprecated_notice("trigger_plugin_hook() was deprecated by elgg_trigger_plugin_hook()", 1.8);
517  return elgg_trigger_plugin_hook($hook, $type, $params, $returnvalue);
518 }
519 
558 function call_gatekeeper($function, $file = "") {
559  elgg_deprecated_notice("call_gatekeeper() is neat but pointless", 1.8);
560  // Sanity check
561  if (!$function) {
562  return false;
563  }
564 
565  // Check against call stack to see if this is being called from the correct location
566  $callstack = debug_backtrace();
567  $stack_element = false;
568 
569  foreach ($callstack as $call) {
570  if (is_array($function)) {
571  if ((strcmp($call['class'], $function[0]) == 0) && (strcmp($call['function'], $function[1]) == 0)) {
572  $stack_element = $call;
573  }
574  } else {
575  if (strcmp($call['function'], $function) == 0) {
576  $stack_element = $call;
577  }
578  }
579  }
580 
581  if (!$stack_element) {
582  return false;
583  }
584 
585  // If file then check that this it is being called from this function
586  if ($file) {
587  $mirror = null;
588 
589  if (is_array($function)) {
590  $mirror = new ReflectionMethod($function[0], $function[1]);
591  } else {
592  $mirror = new ReflectionFunction($function);
593  }
594 
595  if ((!$mirror) || (strcmp($file, $mirror->getFileName()) != 0)) {
596  return false;
597  }
598  }
599 
600  return true;
601 }
602 
624 function callpath_gatekeeper($path, $include_subdirs = true, $strict_mode = false) {
625  elgg_deprecated_notice("callpath_gatekeeper() is neat but pointless", 1.8);
626 
627  global $CONFIG;
628 
630 
631  if ($path) {
632  $callstack = debug_backtrace();
633 
634  foreach ($callstack as $call) {
635  $call['file'] = str_replace("\\", "/", $call['file']);
636 
637  if ($include_subdirs) {
638  if (strpos($call['file'], $path) === 0) {
639 
640  if ($strict_mode) {
641  $callstack[1]['file'] = str_replace("\\", "/", $callstack[1]['file']);
642  if ($callstack[1] === $call) {
643  return true;
644  }
645  } else {
646  return true;
647  }
648  }
649  } else {
650  if (strcmp($path, $call['file']) == 0) {
651  if ($strict_mode) {
652  if ($callstack[1] === $call) {
653  return true;
654  }
655  } else {
656  return true;
657  }
658  }
659  }
660 
661  }
662  return false;
663  }
664 
665  if (isset($CONFIG->debug)) {
666  system_message("Gatekeeper'd function called from {$callstack[1]['file']}:" . "{$callstack[1]['line']}\n\nStack trace:\n\n" . print_r($callstack, true));
667  }
668 
669  return false;
670 }
671 
684 function elgg_get_entity_owner_where_sql($table, $owner_guids) {
685  elgg_deprecated_notice('elgg_get_entity_owner_where_sql() is deprecated by elgg_get_guid_based_where_sql().', 1.8);
686 
687  return _elgg_get_guid_based_where_sql("{$table}.owner_guid", $owner_guids);
688 }
689 
703 function elgg_get_entity_container_where_sql($table, $container_guids) {
704  elgg_deprecated_notice('elgg_get_entity_container_where_sql() is deprecated by elgg_get_guid_based_where_sql().', 1.8);
705 
706  return _elgg_get_guid_based_where_sql("{$table}.container_guid", $container_guids);
707 }
708 
721 function elgg_get_entity_site_where_sql($table, $site_guids) {
722  elgg_deprecated_notice('elgg_get_entity_site_where_sql() is deprecated by elgg_get_guid_based_where_sql().', 1.8);
723 
724  return _elgg_get_guid_based_where_sql("{$table}.site_guid", $site_guids);
725 }
726 
744 function get_objects_in_group($group_guid, $subtype = "", $owner_guid = 0, $site_guid = 0, $order_by = "", $limit = 10, $offset = 0, $count = FALSE) {
745  elgg_deprecated_notice("get_objects_in_group was deprected in 1.8. Use elgg_get_entities() instead", 1.8);
746 
747  global $CONFIG;
748 
749  if ($subtype === FALSE || $subtype === null || $subtype === 0) {
750  return FALSE;
751  }
752 
753  if ($order_by == "") {
754  $order_by = "e.time_created desc";
755  }
756  $order_by = sanitise_string($order_by);
757  $limit = (int)$limit;
758  $offset = (int)$offset;
759  $site_guid = (int)$site_guid;
760  if ($site_guid == 0) {
761  $site_guid = $CONFIG->site_guid;
762  }
763 
764  $container_guid = (int)$group_guid;
765  if ($container_guid == 0) {
766  $container_guid = elgg_get_page_owner_guid();
767  }
768 
769  $where = array();
770 
771  $where[] = "e.type='object'";
772 
773  if (!empty($subtype)) {
774  if (!$subtype = get_subtype_id('object', $subtype)) {
775  return FALSE;
776  }
777  $where[] = "e.subtype=$subtype";
778  }
779  if ($owner_guid != "") {
780  if (!is_array($owner_guid)) {
781  $owner_guid = (int)$owner_guid;
782  $where[] = "e.container_guid = '$owner_guid'";
783  } else if (sizeof($owner_guid) > 0) {
784  // Cast every element to the owner_guid array to int
785  $owner_guid = array_map("sanitise_int", $owner_guid);
786  $owner_guid = implode(",", $owner_guid);
787  $where[] = "e.container_guid in ({$owner_guid})";
788  }
789  }
790  if ($site_guid > 0) {
791  $where[] = "e.site_guid = {$site_guid}";
792  }
793 
794  if ($container_guid > 0) {
795  $where[] = "e.container_guid = {$container_guid}";
796  }
797 
798  if (!$count) {
799  $query = "SELECT * from {$CONFIG->dbprefix}entities e" . " join {$CONFIG->dbprefix}objects_entity o on e.guid=o.guid where ";
800  } else {
801  $query = "SELECT count(e.guid) as total from {$CONFIG->dbprefix}entities e" . " join {$CONFIG->dbprefix}objects_entity o on e.guid=o.guid where ";
802  }
803  foreach ($where as $w) {
804  $query .= " $w and ";
805  }
806 
807  // Add access controls
808  $query .= _elgg_get_access_where_sql();
809  if (!$count) {
810  $query .= " order by $order_by";
811 
812  // Add order and limit
813  if ($limit) {
814  $query .= " limit $offset, $limit";
815  }
816 
817  $dt = get_data($query, "entity_row_to_elggstar");
818  return $dt;
819  } else {
820  $total = get_data_row($query);
821  return $total->total;
822  }
823 }
824 
841 function list_entities_groups($subtype = "", $owner_guid = 0, $container_guid = 0, $limit = 10, $fullview = true, $listtypetoggle = true, $pagination = true) {
842  elgg_deprecated_notice("list_entities_groups was deprecated in 1.8. Use elgg_list_entities() instead.", 1.8);
843  $offset = (int)get_input('offset');
844  $count = get_objects_in_group($container_guid, $subtype, $owner_guid, 0, "", $limit, $offset, true);
845  $entities = get_objects_in_group($container_guid, $subtype, $owner_guid, 0, "", $limit, $offset);
846 
847  return elgg_view_entity_list($entities, $count, $offset, $limit, $fullview, $listtypetoggle, $pagination);
848 }
849 
868 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) {
869  elgg_deprecated_notice("get_entities_from_metadata_groups was deprecated in 1.8.", 1.8);
870  global $CONFIG;
871 
872  $meta_n = get_metastring_id($meta_name);
873  $meta_v = get_metastring_id($meta_value);
874 
875  $entity_type = sanitise_string($entity_type);
876  $entity_subtype = get_subtype_id($entity_type, $entity_subtype);
877  $limit = (int)$limit;
878  $offset = (int)$offset;
879  if ($order_by == "") {
880  $order_by = "e.time_created desc";
881  }
882  $order_by = sanitise_string($order_by);
883  $site_guid = (int)$site_guid;
884  if (is_array($owner_guid)) {
885  foreach ($owner_guid as $key => $guid) {
886  $owner_guid[$key] = (int)$guid;
887  }
888  } else {
889  $owner_guid = (int)$owner_guid;
890  }
891  if ($site_guid == 0) {
892  $site_guid = $CONFIG->site_guid;
893  }
894 
895  $container_guid = (int)$group_guid;
896  if ($container_guid == 0) {
897  $container_guid = elgg_get_page_owner_guid();
898  }
899 
900  $where = array();
901 
902  if ($entity_type != "") {
903  $where[] = "e.type='$entity_type'";
904  }
905  if ($entity_subtype) {
906  $where[] = "e.subtype=$entity_subtype";
907  }
908  if ($meta_name != "") {
909  $where[] = "m.name_id='$meta_n'";
910  }
911  if ($meta_value != "") {
912  $where[] = "m.value_id='$meta_v'";
913  }
914  if ($site_guid > 0) {
915  $where[] = "e.site_guid = {$site_guid}";
916  }
917  if ($container_guid > 0) {
918  $where[] = "e.container_guid = {$container_guid}";
919  }
920 
921  if (is_array($owner_guid)) {
922  $where[] = "e.container_guid in (" . implode(",", $owner_guid) . ")";
923  } else if ($owner_guid > 0) {
924  $where[] = "e.container_guid = {$owner_guid}";
925  }
926 
927  if (!$count) {
928  $query = "SELECT distinct e.* ";
929  } else {
930  $query = "SELECT count(e.guid) as total ";
931  }
932 
933  $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";
934 
935  foreach ($where as $w) {
936  $query .= " $w and ";
937  }
938 
939  // Add access controls
940  $query .= _elgg_get_access_where_sql();
941 
942  if (!$count) {
943  $query .= " order by $order_by limit $offset, $limit"; // Add order and limit
944  return get_data($query, "entity_row_to_elggstar");
945  } else {
946  if ($row = get_data_row($query)) {
947  return $row->total;
948  }
949  }
950  return false;
951 }
952 
970 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) {
971  elgg_deprecated_notice("get_entities_from_metadata_groups_multi was deprecated in 1.8.", 1.8);
972 
973  global $CONFIG;
974 
975  if (!is_array($meta_array) || sizeof($meta_array) == 0) {
976  return false;
977  }
978 
979  $where = array();
980 
981  $mindex = 1;
982  $join = "";
983  foreach ($meta_array as $meta_name => $meta_value) {
984  $meta_n = get_metastring_id($meta_name);
985  $meta_v = get_metastring_id($meta_value);
986  $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 ";
987 
988  if ($meta_name != "") {
989  $where[] = "m{$mindex}.name_id='$meta_n'";
990  }
991 
992  if ($meta_value != "") {
993  $where[] = "m{$mindex}.value_id='$meta_v'";
994  }
995 
996  $mindex++;
997  }
998 
999  $entity_type = sanitise_string($entity_type);
1000  $entity_subtype = get_subtype_id($entity_type, $entity_subtype);
1001  $limit = (int)$limit;
1002  $offset = (int)$offset;
1003  if ($order_by == "") {
1004  $order_by = "e.time_created desc";
1005  }
1006  $order_by = sanitise_string($order_by);
1007  $owner_guid = (int)$owner_guid;
1008 
1009  $site_guid = (int)$site_guid;
1010  if ($site_guid == 0) {
1011  $site_guid = $CONFIG->site_guid;
1012  }
1013 
1014  //$access = get_access_list();
1015 
1016  if ($entity_type != "") {
1017  $where[] = "e.type = '{$entity_type}'";
1018  }
1019 
1020  if ($entity_subtype) {
1021  $where[] = "e.subtype = {$entity_subtype}";
1022  }
1023 
1024  if ($site_guid > 0) {
1025  $where[] = "e.site_guid = {$site_guid}";
1026  }
1027 
1028  if ($owner_guid > 0) {
1029  $where[] = "e.owner_guid = {$owner_guid}";
1030  }
1031 
1032  if ($group_guid > 0) {
1033  $where[] = "e.container_guid = {$group_guid}";
1034  }
1035 
1036  if ($count) {
1037  $query = "SELECT count(e.guid) as total ";
1038  } else {
1039  $query = "SELECT distinct e.* ";
1040  }
1041 
1042  $query .= " from {$CONFIG->dbprefix}entities e {$join} where";
1043  foreach ($where as $w) {
1044  $query .= " $w and ";
1045  }
1046  $query .= _elgg_get_access_where_sql();
1047 
1048  if (!$count) {
1049  $query .= " order by $order_by limit $offset, $limit"; // Add order and limit
1050  return get_data($query, "entity_row_to_elggstar");
1051  } else {
1052  if ($count = get_data_row($query)) {
1053  return $count->total;
1054  }
1055  }
1056  return false;
1057 }
1058 
1076 function list_entities_in_area($lat, $long, $radius, $type = "", $subtype = "", $owner_guid = 0, $limit = 10, $fullview = true, $listtypetoggle = false, $navigation = true) {
1077  elgg_deprecated_notice('list_entities_in_area() was deprecated. Use elgg_list_entities_from_location()', 1.8);
1078 
1079  $options = array();
1080 
1081  $options['latitude'] = $lat;
1082  $options['longitude'] = $long;
1083  $options['distance'] = $radius;
1084 
1085  if ($type) {
1086  $options['types'] = $type;
1087  }
1088 
1089  if ($subtype) {
1090  $options['subtypes'] = $subtype;
1091  }
1092 
1093  if ($owner_guid) {
1094  if (is_array($owner_guid)) {
1095  $options['owner_guids'] = $owner_guid;
1096  } else {
1097  $options['owner_guid'] = $owner_guid;
1098  }
1099  }
1100 
1101  $options['limit'] = $limit;
1102 
1103  $options['full_view'] = $fullview;
1104  $options['list_type_toggle'] = $listtypetoggle;
1105  $options['pagination'] = true;
1106 
1108 }
1109 
1125 function list_entities_location($location, $type = "", $subtype = "", $owner_guid = 0, $limit = 10, $fullview = true, $listtypetoggle = false, $navigation = true) {
1126  elgg_deprecated_notice('list_entities_location() was deprecated. Use elgg_list_entities_from_metadata()', 1.8);
1127 
1128  return list_entities_from_metadata('location', $location, $type, $subtype, $owner_guid, $limit, $fullview, $listtypetoggle, $navigation);
1129 }
1130 
1150 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) {
1151  elgg_deprecated_notice('get_entities_in_area() was deprecated by elgg_get_entities_from_location()!', 1.8);
1152 
1153  $options = array();
1154 
1155  $options['latitude'] = $lat;
1156  $options['longitude'] = $long;
1157  $options['distance'] = $radius;
1158 
1159  // set container_guid to owner_guid to emulate old functionality
1160  if ($owner_guid != "") {
1161  if (is_null($container_guid)) {
1162  $container_guid = $owner_guid;
1163  }
1164  }
1165 
1166  if ($type) {
1167  $options['types'] = $type;
1168  }
1169 
1170  if ($subtype) {
1171  $options['subtypes'] = $subtype;
1172  }
1173 
1174  if ($owner_guid) {
1175  if (is_array($owner_guid)) {
1176  $options['owner_guids'] = $owner_guid;
1177  } else {
1178  $options['owner_guid'] = $owner_guid;
1179  }
1180  }
1181 
1182  if ($container_guid) {
1183  if (is_array($container_guid)) {
1184  $options['container_guids'] = $container_guid;
1185  } else {
1186  $options['container_guid'] = $container_guid;
1187  }
1188  }
1189 
1190  $options['limit'] = $limit;
1191 
1192  if ($offset) {
1193  $options['offset'] = $offset;
1194  }
1195 
1196  if ($order_by) {
1197  $options['order_by'];
1198  }
1199 
1200  if ($site_guid) {
1201  $options['site_guid'];
1202  }
1203 
1204  if ($count) {
1205  $options['count'] = $count;
1206  }
1207 
1209 }
1210 
1233 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) {
1234 
1235  elgg_deprecated_notice('list_entities_from_metadata() was deprecated by elgg_list_entities_from_metadata()!', 1.8);
1236 
1237  $offset = (int)get_input('offset');
1238  $limit = (int)$limit;
1239  $options = array(
1240  'metadata_name' => $meta_name,
1241  'metadata_value' => $meta_value,
1242  'type' => $entity_type,
1243  'subtype' => $entity_subtype,
1244  'limit' => $limit,
1245  'offset' => $offset,
1246  'count' => TRUE,
1247  'metadata_case_sensitive' => $case_sensitive
1248  );
1249 
1250  // previous function allowed falsy $owner_guid for anything
1251  if ($owner_guid) {
1252  $options['owner_guid'] = $owner_guid;
1253  }
1254 
1256 
1257  $options['count'] = FALSE;
1259 
1260  return elgg_view_entity_list($entities, $count, $offset, $limit, $fullview, $listtypetoggle, $pagination);
1261 }
1262 
1281 function list_entities_from_metadata_multi($meta_array, $entity_type = "", $entity_subtype = "", $owner_guid = 0, $limit = 10, $fullview = true, $listtypetoggle = true, $pagination = true) {
1282  elgg_deprecated_notice(elgg_echo('deprecated:function', array(
1283  'list_entities_from_metadata_multi', 'elgg_get_entities_from_metadata')), 1.8);
1284 
1285  $offset = (int)get_input('offset');
1286  $limit = (int)$limit;
1287  $count = get_entities_from_metadata_multi($meta_array, $entity_type, $entity_subtype, $owner_guid, $limit, $offset, "", 0, true);
1288  $entities = get_entities_from_metadata_multi($meta_array, $entity_type, $entity_subtype, $owner_guid, $limit, $offset, "", 0, false);
1289 
1290  return elgg_view_entity_list($entities, $count, $offset, $limit, $fullview, $listtypetoggle, $pagination);
1291 }
1292 
1307 function add_submenu_item($label, $link, $group = 'default', $onclick = false, $selected = NULL) {
1308  elgg_deprecated_notice('add_submenu_item was deprecated by elgg_register_menu_item', 1.8);
1309 
1310  // submenu items were added in the page setup hook usually by checking
1311  // the context. We'll pass in the current context here, which will
1312  // emulate that effect.
1313  // if context == 'main' (default) it probably means they always wanted
1314  // the menu item to show up everywhere.
1316 
1317  if ($context == 'main') {
1318  $context = 'all';
1319  }
1320 
1321  $item = array('name' => $label, 'text' => $label, 'href' => $link, 'context' => $context,
1322  'section' => $group,);
1323 
1324  if ($selected) {
1325  $item['selected'] = true;
1326  }
1327 
1328  if ($onclick) {
1329  $js = "onclick=\"javascript:return confirm('" . elgg_echo('deleteconfirm') . "')\"";
1330  $item['vars'] = array('js' => $js);
1331  }
1332 
1333  return elgg_register_menu_item('page', $item);
1334 }
1335 
1347 function remove_submenu_item($label, $group = 'a') {
1348  elgg_deprecated_notice('remove_submenu_item was deprecated by elgg_unregister_menu_item', 1.8);
1349 
1350  return elgg_unregister_menu_item('page', $label);
1351 }
1352 
1361 function get_submenu() {
1362  elgg_deprecated_notice("get_submenu() has been deprecated by elgg_view_menu()", 1.8);
1364  return elgg_view_menu('owner_block', array('entity' => $owner,
1365  'class' => 'elgg-menu-owner-block',));
1366 }
1367 
1381 function add_menu($menu_name, $menu_url, $menu_children = array(), $context = "") {
1382  elgg_deprecated_notice('add_menu() deprecated by elgg_register_menu_item()', 1.8);
1383 
1384  return elgg_register_menu_item('site', array('name' => $menu_name, 'text' => $menu_name,
1385  'href' => $menu_url,));
1386 }
1387 
1396 function remove_menu($menu_name) {
1397  elgg_deprecated_notice("remove_menu() deprecated by elgg_unregister_menu_item()", 1.8);
1398  return elgg_unregister_menu_item('site', $menu_name);
1399 }
1400 
1410  elgg_deprecated_notice('friendly_title was deprecated by elgg_get_friendly_title', 1.8);
1412 }
1413 
1422 function friendly_time($time) {
1423  elgg_deprecated_notice('friendly_time was deprecated by elgg_view_friendly_time', 1.8);
1424  return elgg_view_friendly_time($time);
1425 }
1426 
1437  elgg_deprecated_notice('filter_string() was deprecated!', 1.8);
1438 
1439  // Convert it to lower and trim
1440  $string = strtolower($string);
1441  $string = trim($string);
1442 
1443  // Remove links and email addresses
1444  // match protocol://address/path/file.extension?some=variable&another=asf%
1445  $string = preg_replace("/\s([a-zA-Z]+:\/\/[a-z][a-z0-9\_\.\-]*[a-z]{2,6}" . "[a-zA-Z0-9\/\*\-\?\&\%\=]*)([\s|\.|\,])/iu", " ", $string);
1446 
1447  // match www.something.domain/path/file.extension?some=variable&another=asf%
1448  $string = preg_replace("/\s(www\.[a-z][a-z0-9\_\.\-]*[a-z]{2,6}" . "[a-zA-Z0-9\/\*\-\?\&\%\=]*)([\s|\.|\,])/iu", " ", $string);
1449 
1450  // match name@address
1451  $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);
1452 
1453  // Sanitise the string; remove unwanted characters
1454  $string = preg_replace('/\W/ui', ' ', $string);
1455 
1456  // Explode it into an array
1457  $terms = explode(' ', $string);
1458 
1459  // Remove any blacklist terms
1460  //$terms = array_filter($terms, 'remove_blacklist');
1461 
1462  return $terms;
1463 }
1464 
1475  elgg_deprecated_notice('remove_blacklist() was deprecated!', 1.8);
1476 
1477  global $CONFIG;
1478 
1479  if (!is_array($CONFIG->wordblacklist)) {
1480  return $input;
1481  }
1482 
1483  if (strlen($input) < 3 || in_array($input, $CONFIG->wordblacklist)) {
1484  return false;
1485  }
1486 
1487  return true;
1488 }
1489 
1497 function page_owner() {
1498  elgg_deprecated_notice('page_owner() was deprecated by elgg_get_page_owner_guid().', 1.8);
1499  return elgg_get_page_owner_guid();
1500 }
1501 
1508 function page_owner_entity() {
1509  elgg_deprecated_notice('page_owner_entity() was deprecated by elgg_get_page_owner_entity().', 1.8);
1510  return elgg_get_page_owner_entity();
1511 }
1512 
1521 function add_page_owner_handler($functionname) {
1522  elgg_deprecated_notice("add_page_owner_handler() was deprecated by the plugin hook 'page_owner', 'system'.", 1.8);
1523 }
1524 
1533 function set_page_owner($entitytoset = -1) {
1534  elgg_deprecated_notice('set_page_owner() was deprecated by elgg_set_page_owner_guid().', 1.8);
1535  elgg_set_page_owner_guid($entitytoset);
1536 }
1537 
1548  elgg_deprecated_notice('set_context() was deprecated by elgg_set_context().', 1.8);
1550  if (empty($context)) {
1551  return false;
1552  }
1553  return $context;
1554 }
1555 
1563 function get_context() {
1564  elgg_deprecated_notice('get_context() was deprecated by elgg_get_context().', 1.8);
1565  return elgg_get_context();
1566 
1567  // @todo - used to set context based on calling script
1568  // $context = get_plugin_name(true)
1569 }
1570 
1578 function get_plugin_list() {
1579  elgg_deprecated_notice('get_plugin_list() is deprecated by elgg_get_plugin_ids_in_dir() or elgg_get_plugins()', 1.8);
1580 
1581  $plugins = elgg_get_plugins('any');
1582 
1583  $list = array();
1584  if ($plugins) {
1585  foreach ($plugins as $i => $plugin) {
1586  // in <=1.7 this returned indexed by multiples of 10.
1587  // uh...sure...why not.
1588  $index = ($i + 1) * 10;
1589  $list[$index] = $plugin->getID();
1590  }
1591  }
1592 
1593  return $list;
1594 }
1595 
1611 function regenerate_plugin_list($pluginorder = FALSE) {
1612  $msg = 'regenerate_plugin_list() is (sorta) deprecated by elgg_generate_plugin_entities() and'
1613  . ' elgg_set_plugin_priorities().';
1614  elgg_deprecated_notice($msg, 1.8);
1615 
1616  // they're probably trying to set it?
1617  if ($pluginorder) {
1619  // sort the plugins by the index numerically since we used
1620  // weird indexes in the old system.
1621  ksort($pluginorder, SORT_NUMERIC);
1622  return _elgg_set_plugin_priorities($pluginorder);
1623  }
1624  return false;
1625  } else {
1626  // they're probably trying to regenerate from disk?
1628  }
1629 }
1630 
1645 function get_plugin_name($mainfilename = false) {
1646  elgg_deprecated_notice('get_plugin_name() is deprecated by elgg_get_calling_plugin_id()', 1.8);
1647 
1648  return elgg_get_calling_plugin_id($mainfilename);
1649 }
1650 
1660  elgg_deprecated_notice('load_plugin_manifest() is deprecated by ElggPlugin->getManifest()', 1.8);
1661 
1662  $xml_file = elgg_get_plugins_path() . "$plugin/manifest.xml";
1663 
1664  try {
1665  $manifest = new ElggPluginManifest($xml_file, $plugin);
1666  } catch(Exception $e) {
1667  return false;
1668  }
1669 
1670  return $manifest->getManifest();
1671 }
1672 
1682 function check_plugin_compatibility($manifest_elgg_version_string) {
1683  elgg_deprecated_notice('check_plugin_compatibility() is deprecated by ElggPlugin->canActivate()', 1.8);
1684 
1686 
1687  if (strpos($manifest_elgg_version_string, '.') === false) {
1688  // Using version
1689  $req_version = (int)$manifest_elgg_version_string;
1690 
1691  return ($version >= $req_version);
1692  }
1693 
1694  return false;
1695 }
1696 
1708  elgg_deprecated_notice('find_plugin_setting() is deprecated by elgg_get_calling_plugin_entity() or elgg_get_plugin_from_id()', 1.8);
1709  if ($plugin_id) {
1711  } else {
1713  }
1714 }
1715 
1724 function get_installed_plugins($status = 'all') {
1725  global $CONFIG;
1726 
1727  elgg_deprecated_notice('get_installed_plugins() was deprecated by elgg_get_plugins()', 1.8);
1728 
1729  $plugins = elgg_get_plugins($status);
1730 
1731  if (!$plugins) {
1732  return array();
1733  }
1734 
1735  $installed_plugins = array();
1736 
1737  foreach ($plugins as $plugin) {
1738  if (!$plugin->isValid()) {
1739  continue;
1740  }
1741 
1742  $include = true;
1743 
1744  if ($status == 'enabled' && !$plugin->isActive()) {
1745  $include = false;
1746  } elseif ($status == 'disabled' && $plugin->isActive()) {
1747  $include = true;
1748  }
1749 
1750  if ($include) {
1751  $installed_plugins[$plugin->getID()] = array(
1752  'active' => $plugin->isActive(),
1753  'manifest' => $plugin->getManifest()->getManifest()
1754  );
1755  }
1756  }
1757 
1758  return $installed_plugins;
1759 }
1760 
1778 function enable_plugin($plugin, $site_guid = null) {
1779  elgg_deprecated_notice('enable_plugin() was deprecated by ElggPlugin->activate()', 1.8);
1780 
1782 
1783  $site_guid = (int) $site_guid;
1784  if (!$site_guid) {
1785  $site = get_config('site');
1786  $site_guid = $site->guid;
1787  }
1788 
1789  try {
1790  $plugin = new ElggPlugin($plugin);
1791  } catch(Exception $e) {
1792  return false;
1793  }
1794 
1795  if (!$plugin->canActivate($site_guid)) {
1796  return false;
1797  }
1798 
1799  return $plugin->activate($site_guid);
1800 }
1801 
1819 function disable_plugin($plugin, $site_guid = 0) {
1820  elgg_deprecated_notice('disable_plugin() was deprecated by ElggPlugin->deactivate()', 1.8);
1821 
1823 
1824  $site_guid = (int) $site_guid;
1825  if (!$site_guid) {
1826  $site = get_config('site');
1827  $site_guid = $site->guid;
1828  }
1829 
1830  try {
1831  $plugin = new ElggPlugin($plugin);
1832  } catch(Exception $e) {
1833  return false;
1834  }
1835 
1836  return $plugin->deactivate($site_guid);
1837 }
1838 
1849 function is_plugin_enabled($plugin, $site_guid = 0) {
1850  elgg_deprecated_notice('is_plugin_enabled() was deprecated by elgg_is_active_plugin()', 1.8);
1851  return elgg_is_active_plugin($plugin, $site_guid);
1852 }
1853 
1873 $owner_guid = 0, $order_by = "", $limit = 10, $offset = 0, $count = false, $site_guid = 0,
1874 $container_guid = null) {
1875  elgg_deprecated_notice('get_entities_from_private_setting() was deprecated by elgg_get_entities_from_private_setting()!', 1.8);
1876 
1877  $options = array();
1878 
1879  $options['private_setting_name'] = $name;
1880  $options['private_setting_value'] = $value;
1881 
1882  // set container_guid to owner_guid to emulate old functionality
1883  if ($owner_guid != "") {
1884  if (is_null($container_guid)) {
1885  $container_guid = $owner_guid;
1886  }
1887  }
1888 
1889  if ($type) {
1890  $options['types'] = $type;
1891  }
1892 
1893  if ($subtype) {
1894  $options['subtypes'] = $subtype;
1895  }
1896 
1897  if ($owner_guid) {
1898  if (is_array($owner_guid)) {
1899  $options['owner_guids'] = $owner_guid;
1900  } else {
1901  $options['owner_guid'] = $owner_guid;
1902  }
1903  }
1904 
1905  if ($container_guid) {
1906  if (is_array($container_guid)) {
1907  $options['container_guids'] = $container_guid;
1908  } else {
1909  $options['container_guid'] = $container_guid;
1910  }
1911  }
1912 
1913  $options['limit'] = $limit;
1914 
1915  if ($offset) {
1916  $options['offset'] = $offset;
1917  }
1918 
1919  if ($order_by) {
1920  $options['order_by'];
1921  }
1922 
1923  if ($site_guid) {
1924  $options['site_guid'];
1925  }
1926 
1927  if ($count) {
1928  $options['count'] = $count;
1929  }
1930 
1932 }
1933 
1952 $owner_guid = 0, $order_by = "", $limit = 10, $offset = 0, $count = false,
1953 $site_guid = 0, $container_guid = null) {
1954 
1955  elgg_deprecated_notice('get_entities_from_private_setting_multi() was deprecated by elgg_get_entities_from_private_settings()!', 1.8);
1956 
1957  $options = array();
1958 
1959  $pairs = array();
1960  foreach ($name as $setting_name => $setting_value) {
1961  $pairs[] = array('name' => $setting_name, 'value' => $setting_value);
1962  }
1963  $options['private_setting_name_value_pairs'] = $pairs;
1964 
1965  // set container_guid to owner_guid to emulate old functionality
1966  if ($owner_guid != "") {
1967  if (is_null($container_guid)) {
1968  $container_guid = $owner_guid;
1969  }
1970  }
1971 
1972  if ($type) {
1973  $options['types'] = $type;
1974  }
1975 
1976  if ($subtype) {
1977  $options['subtypes'] = $subtype;
1978  }
1979 
1980  if ($owner_guid) {
1981  if (is_array($owner_guid)) {
1982  $options['owner_guids'] = $owner_guid;
1983  } else {
1984  $options['owner_guid'] = $owner_guid;
1985  }
1986  }
1987 
1988  if ($container_guid) {
1989  if (is_array($container_guid)) {
1990  $options['container_guids'] = $container_guid;
1991  } else {
1992  $options['container_guid'] = $container_guid;
1993  }
1994  }
1995 
1996  $options['limit'] = $limit;
1997 
1998  if ($offset) {
1999  $options['offset'] = $offset;
2000  }
2001 
2002  if ($order_by) {
2003  $options['order_by'];
2004  }
2005 
2006  if ($site_guid) {
2007  $options['site_guid'];
2008  }
2009 
2010  if ($count) {
2011  $options['count'] = $count;
2012  }
2013 
2015 }
2016 
2037 function list_entities_from_relationship($relationship, $relationship_guid,
2038 $inverse_relationship = false, $type = ELGG_ENTITIES_ANY_VALUE,
2040 $fullview = true, $listtypetoggle = false, $pagination = true, $order_by = '') {
2041 
2042  elgg_deprecated_notice("list_entities_from_relationship was deprecated by elgg_list_entities_from_relationship()!", 1.8);
2044  'relationship' => $relationship,
2045  'relationship_guid' => $relationship_guid,
2046  'inverse_relationship' => $inverse_relationship,
2047  'type' => $type,
2048  'subtype' => $subtype,
2049  'owner_guid' => $owner_guid,
2050  'order_by' => $order_by,
2051  'limit' => $limit,
2052  'full_view' => $fullview,
2053  'list_type_toggle' => $listtypetoggle,
2054  'pagination' => $pagination,
2055  ));
2056 }
2057 
2077 function get_entities_by_relationship_count($relationship, $inverse_relationship = true, $type = "",
2078 $subtype = "", $owner_guid = 0, $limit = 10, $offset = 0, $count = false, $site_guid = 0) {
2079  elgg_deprecated_notice('get_entities_by_relationship_count() is deprecated by elgg_get_entities_from_relationship_count()', 1.8);
2080 
2081  $options = array();
2082 
2083  $options['relationship'] = $relationship;
2084 
2085  // this used to default to true, which is wrong.
2086  // flip it for the new function
2087  $options['inverse_relationship'] = !$inverse_relationship;
2088 
2089  if ($type) {
2090  $options['types'] = $type;
2091  }
2092 
2093  if ($subtype) {
2094  $options['subtypes'] = $subtype;
2095  }
2096 
2097  if ($owner_guid) {
2098  $options['owner_guid'] = $owner_guid;
2099  }
2100 
2101  $options['limit'] = $limit;
2102 
2103  if ($offset) {
2104  $options['offset'] = $offset;
2105  }
2106 
2107  if ($site_guid) {
2108  $options['site_guid'];
2109  }
2110 
2111  if ($count) {
2112  $options['count'] = $count;
2113  }
2114 
2116 }
2117 
2135 function list_entities_by_relationship_count($relationship, $inverse_relationship = true,
2136 $type = "", $subtype = "", $owner_guid = 0, $limit = 10, $fullview = true,
2137 $listtypetoggle = false, $pagination = true) {
2138 
2139  elgg_deprecated_notice('list_entities_by_relationship_count() was deprecated by elgg_list_entities_from_relationship_count()', 1.8);
2140 
2141  $options = array();
2142 
2143  $options['relationship'] = $relationship;
2144 
2145  // this used to default to true, which is wrong.
2146  // flip it for the new function
2147  $options['inverse_relationship'] = !$inverse_relationship;
2148 
2149  if ($type) {
2150  $options['types'] = $type;
2151  }
2152 
2153  if ($subtype) {
2154  $options['subtypes'] = $subtype;
2155  }
2156 
2157  if ($owner_guid) {
2158  $options['owner_guid'] = $owner_guid;
2159  }
2160 
2161  $options['limit'] = $limit;
2162 
2163  $options['full_view'] = $fullview;
2164 
2166 }
2167 
2189 function get_entities_from_relationships_and_meta($relationship, $relationship_guid,
2190 $inverse_relationship = false, $meta_name = "", $meta_value = "", $type = "",
2191 $subtype = "", $owner_guid = 0, $limit = 10, $offset = 0, $count = false, $site_guid = 0) {
2192 
2193  elgg_deprecated_notice('get_entities_from_relationship_and_meta() was deprecated by elgg_get_entities_from_relationship()!', 1.7);
2194 
2195  $options = array();
2196 
2197  $options['relationship'] = $relationship;
2198  $options['relationship_guid'] = $relationship_guid;
2199  $options['inverse_relationship'] = $inverse_relationship;
2200 
2201  if ($meta_value) {
2202  $options['values'] = $meta_value;
2203  }
2204 
2205  if ($type) {
2206  $options['types'] = $type;
2207  }
2208 
2209  if ($subtype) {
2210  $options['subtypes'] = $subtype;
2211  }
2212 
2213  if ($owner_guid) {
2214  $options['owner_guid'] = $owner_guid;
2215  }
2216 
2217  if ($limit) {
2218  $options['limit'] = $limit;
2219  }
2220 
2221  if ($offset) {
2222  $options['offset'] = $offset;
2223  }
2224 
2225  if ($site_guid) {
2226  $options['site_guid'] = $site_guid;
2227  }
2228 
2229  if ($count) {
2230  $options['count'] = $count;
2231  }
2232 
2234 }
2235 
2236 
2258 function get_river_items($subject_guid = 0, $object_guid = 0, $subject_relationship = '',
2259 $type = '', $subtype = '', $action_type = '', $limit = 20, $offset = 0, $posted_min = 0,
2260 $posted_max = 0) {
2261  elgg_deprecated_notice("get_river_items deprecated by elgg_get_river", 1.8);
2262 
2263  $options = array();
2264 
2265  if ($subject_guid) {
2266  $options['subject_guid'] = $subject_guid;
2267  }
2268 
2269  if ($object_guid) {
2270  $options['object_guid'] = $object_guid;
2271  }
2272 
2273  if ($subject_relationship) {
2274  $options['relationship'] = $subject_relationship;
2275  unset($options['subject_guid']);
2276  $options['relationship_guid'] = $subject_guid;
2277  }
2278 
2279  if ($type) {
2280  $options['type'] = $type;
2281  }
2282 
2283  if ($subtype) {
2284  $options['subtype'] = $subtype;
2285  }
2286 
2287  if ($action_type) {
2288  $options['action_type'] = $action_type;
2289  }
2290 
2291  $options['limit'] = $limit;
2292  $options['offset'] = $offset;
2293 
2294  if ($posted_min) {
2295  $options['posted_time_lower'] = $posted_min;
2296  }
2297 
2298  if ($posted_max) {
2299  $options['posted_time_upper'] = $posted_max;
2300  }
2301 
2302  return elgg_get_river($options);
2303 }
2304 
2325 function elgg_view_river_items($subject_guid = 0, $object_guid = 0, $subject_relationship = '',
2326 $type = '', $subtype = '', $action_type = '', $limit = 20, $posted_min = 0,
2327 $posted_max = 0, $pagination = true) {
2328  elgg_deprecated_notice("elgg_view_river_items deprecated for elgg_list_river", 1.8);
2329 
2330  $river_items = get_river_items($subject_guid, $object_guid, $subject_relationship,
2331  $type, $subtype, $action_type, $limit + 1, $posted_min, $posted_max);
2332 
2333  // Get input from outside world and sanitise it
2334  $offset = (int) get_input('offset', 0);
2335 
2336  // view them
2337  $params = array(
2338  'items' => $river_items,
2339  'count' => count($river_items),
2340  'offset' => $offset,
2341  'limit' => $limit,
2342  'pagination' => $pagination,
2343  'list-class' => 'elgg-list-river',
2344  );
2345 
2346  return elgg_view('page/components/list', $params);
2347 }
2348 
2355 function get_activity_stream_data($limit = 10, $offset = 0, $type = "", $subtype = "",
2356 $owner_guid = "", $owner_relationship = "") {
2357  elgg_deprecated_notice("get_activity_stream_data was deprecated", 1.8);
2358 
2359  global $CONFIG;
2360 
2361  $limit = (int)$limit;
2362  $offset = (int)$offset;
2363 
2364  if ($type) {
2365  if (!is_array($type)) {
2366  $type = array(sanitise_string($type));
2367  } else {
2368  foreach ($type as $k => $v) {
2369  $type[$k] = sanitise_string($v);
2370  }
2371  }
2372  }
2373 
2374  if ($subtype) {
2375  if (!is_array($subtype)) {
2376  $subtype = array(sanitise_string($subtype));
2377  } else {
2378  foreach ($subtype as $k => $v) {
2379  $subtype[$k] = sanitise_string($v);
2380  }
2381  }
2382  }
2383 
2384  if ($owner_guid) {
2385  if (is_array($owner_guid)) {
2386  foreach ($owner_guid as $k => $v) {
2387  $owner_guid[$k] = (int)$v;
2388  }
2389  } else {
2390  $owner_guid = array((int)$owner_guid);
2391  }
2392  }
2393 
2394  $owner_relationship = sanitise_string($owner_relationship);
2395 
2396  // Get a list of possible views
2397  $activity_events = array();
2398  $activity_views = array_merge(elgg_view_tree('activity', 'default'),
2399  elgg_view_tree('river', 'default'));
2400 
2401  $done = array();
2402 
2403  foreach ($activity_views as $view) {
2404  $fragments = explode('/', $view);
2405  $tmp = explode('/', $view, 2);
2406  $tmp = $tmp[1];
2407 
2408  if ((isset($fragments[0])) && (($fragments[0] == 'river') || ($fragments[0] == 'activity'))
2409  && (!in_array($tmp, $done))) {
2410 
2411  if (isset($fragments[1])) {
2412  $f = array();
2413  for ($n = 1; $n < count($fragments); $n++) {
2414  $val = sanitise_string($fragments[$n]);
2415  switch($n) {
2416  case 1: $key = 'type'; break;
2417  case 2: $key = 'subtype'; break;
2418  case 3: $key = 'event'; break;
2419  }
2420  $f[$key] = $val;
2421  }
2422 
2423  // Filter result based on parameters
2424  $add = true;
2425  if ($type) {
2426  if (!in_array($f['type'], $type)) {
2427  $add = false;
2428  }
2429  }
2430  if (($add) && ($subtype)) {
2431  if (!in_array($f['subtype'], $subtype)) {
2432  $add = false;
2433  }
2434  }
2435 
2436  if ($add) {
2437  $activity_events[] = $f;
2438  }
2439  }
2440 
2441  $done[] = $tmp;
2442  }
2443  }
2444 
2445  $n = 0;
2446  foreach ($activity_events as $details) {
2447  // Get what we're talking about
2448  if ($details['subtype'] == 'default') {
2449  $details['subtype'] = '';
2450  }
2451 
2452  if (($details['type']) && ($details['event'])) {
2453  if ($n > 0) {
2454  $obj_query .= " or ";
2455  }
2456 
2457  $access = "";
2458  if ($details['type'] != 'relationship') {
2459  $access = " and " . _elgg_get_access_where_sql(array('table_alias' => 'sl'));
2460  }
2461 
2462  $obj_query .= "( sl.object_type='{$details['type']}'
2463  AND sl.object_subtype='{$details['subtype']}'
2464  AND sl.event='{$details['event']}' $access )";
2465 
2466  $n++;
2467  }
2468  }
2469 
2470  // User
2471  if ((count($owner_guid)) && ($owner_guid[0] != 0)) {
2472  $user = " and sl.performed_by_guid in (" . implode(',', $owner_guid) . ")";
2473 
2474  if ($owner_relationship) {
2475  $friendsarray = "";
2477  'relationship' => $owner_relationship,
2478  'relationship_guid' => $owner_guid[0],
2479  'inverse_relationship' => FALSE,
2480  'type' => 'user',
2481  'subtype' => $subtype,
2482  'limit' => false))
2483  ) {
2484 
2485  $friendsarray = array();
2486  foreach ($friends as $friend) {
2487  $friendsarray[] = $friend->getGUID();
2488  }
2489 
2490  $user = " and sl.performed_by_guid in (" . implode(',', $friendsarray) . ")";
2491  }
2492  }
2493  }
2494 
2495  $query = "SELECT sl.* FROM {$CONFIG->dbprefix}system_log sl
2496  WHERE 1 $user AND ($obj_query)
2497  ORDER BY sl.time_created desc limit $offset, $limit";
2498  return get_data($query);
2499 }
2500 
2515  elgg_deprecated_notice('authenticate() has been deprecated for elgg_authenticate()', 1.8);
2516  $pam = new ElggPAM('user');
2517  $credentials = array('username' => $username, 'password' => $password);
2518  $result = $pam->authenticate($credentials);
2519  if ($result) {
2521  }
2522  return false;
2523 }
2524 
2525 
2536 function get_site_members($site_guid, $limit = 10, $offset = 0) {
2537  elgg_deprecated_notice("get_site_members() deprecated.
2538  Use ElggSite::getMembers()", 1.8);
2539 
2540  $site = get_entity($site_guid);
2541  if ($site) {
2542  return $site->getMembers($limit, $offset);
2543  }
2544 
2545  return false;
2546 }
2547 
2558 function list_site_members($site_guid, $limit = 10, $fullview = true) {
2559  elgg_deprecated_notice("list_site_members() deprecated.
2560  Use ElggSite::listMembers()", 1.8);
2561 
2562  $options = array(
2563  'limit' => $limit,
2564  'full_view' => $fullview,
2565  );
2566 
2567  $site = get_entity($site_guid);
2568  if ($site) {
2569  return $site->listMembers($options);
2570  }
2571 
2572  return '';
2573 }
2574 
2575 
2585 function add_site_collection($site_guid, $collection_guid) {
2586  elgg_deprecated_notice("add_site_collection has been deprecated", 1.8);
2587  global $CONFIG;
2588 
2589  $site_guid = (int)$site_guid;
2590  $collection_guid = (int)$collection_guid;
2591 
2592  return add_entity_relationship($collection_guid, "member_of_site", $site_guid);
2593 }
2594 
2604 function remove_site_collection($site_guid, $collection_guid) {
2605  elgg_deprecated_notice("remove_site_collection has been deprecated", 1.8);
2606  $site_guid = (int)$site_guid;
2607  $collection_guid = (int)$collection_guid;
2608 
2609  return remove_entity_relationship($collection_guid, "member_of_site", $site_guid);
2610 }
2611 
2623 function get_site_collections($site_guid, $subtype = "", $limit = 10, $offset = 0) {
2624  elgg_deprecated_notice("get_site_collections has been deprecated", 1.8);
2625  $site_guid = (int)$site_guid;
2627  $limit = (int)$limit;
2628  $offset = (int)$offset;
2629 
2630  // collection isn't a valid type. This won't work.
2632  'relationship' => 'member_of_site',
2633  'relationship_guid' => $site_guid,
2634  'inverse_relationship' => TRUE,
2635  'type' => 'collection',
2636  'subtype' => $subtype,
2637  'limit' => $limit,
2638  'offset' => $offset
2639  ));
2640 }
2641 
2662 function get_tags($threshold = 1, $limit = 10, $metadata_name = "", $entity_type = "object",
2663 $entity_subtype = "", $owner_guid = "", $site_guid = -1, $start_ts = "", $end_ts = "") {
2664 
2665  elgg_deprecated_notice('get_tags() has been replaced by elgg_get_tags()', 1.8);
2666 
2667  if (is_array($metadata_name)) {
2668  return false;
2669  }
2670 
2671  $options = array();
2672  if ($metadata_name === '') {
2673  $options['tag_names'] = array();
2674  } else {
2675  $options['tag_names'] = array($metadata_name);
2676  }
2677 
2678  $options['threshold'] = $threshold;
2679  $options['limit'] = $limit;
2680 
2681  // rewrite owner_guid to container_guid to emulate old functionality
2682  $container_guid = $owner_guid;
2683  if ($container_guid) {
2684  $options['container_guids'] = $container_guid;
2685  }
2686 
2687  if ($entity_type) {
2688  $options['type'] = $entity_type;
2689  }
2690 
2691  if ($entity_subtype) {
2692  $options['subtype'] = $entity_subtype;
2693  }
2694 
2695  if ($site_guid != -1) {
2696  $options['site_guids'] = $site_guid;
2697  }
2698 
2699  if ($end_ts) {
2700  $options['created_time_upper'] = $end_ts;
2701  }
2702 
2703  if ($start_ts) {
2704  $options['created_time_lower'] = $start_ts;
2705  }
2706 
2708  return $r;
2709 }
2710 
2732 function display_tagcloud($threshold = 1, $limit = 10, $metadata_name = "", $entity_type = "object",
2733 $entity_subtype = "", $owner_guid = "", $site_guid = -1, $start_ts = "", $end_ts = "") {
2734 
2735  elgg_deprecated_notice('display_tagcloud() was deprecated by elgg_view_tagcloud()!', 1.8);
2736 
2737  $tags = get_tags($threshold, $limit, $metadata_name, $entity_type,
2738  $entity_subtype, $owner_guid, $site_guid, $start_ts, $end_ts);
2739 
2740  return elgg_view('output/tagcloud', array(
2741  'value' => $tags,
2742  'type' => $entity_type,
2743  'subtype' => $entity_subtype,
2744  ));
2745 }
2746 
2747 
2762 $offset = 0, $timelower = 0, $timeupper = 0) {
2763  elgg_deprecated_notice("get_user_objects() was deprecated in favor of elgg_get_entities()", 1.8);
2764  $ntt = elgg_get_entities(array(
2765  'type' => 'object',
2766  'subtype' => $subtype,
2767  'owner_guid' => $user_guid,
2768  'limit' => $limit,
2769  'offset' => $offset,
2770  'container_guid' => $user_guid,
2771  'created_time_lower' => $timelower,
2772  'created_time_upper' => $timeupper
2773  ));
2774  return $ntt;
2775 }
2776 
2789 $timeupper = 0) {
2790  elgg_deprecated_notice("count_user_objects() was deprecated in favor of elgg_get_entities()", 1.8);
2791  $total = elgg_get_entities(array(
2792  'type' => 'object',
2793  'subtype' => $subtype,
2794  'owner_guid' => $user_guid,
2795  'count' => TRUE,
2796  'container_guid' => $user_guid,
2797  'created_time_lower' => $timelower,
2798  'created_time_upper' => $timeupper
2799  ));
2800  return $total;
2801 }
2802 
2821 $fullview = true, $listtypetoggle = true, $pagination = true, $timelower = 0, $timeupper = 0) {
2822  elgg_deprecated_notice("list_user_objects() was deprecated in favor of elgg_list_entities()", 1.8);
2823 
2824  $offset = (int) get_input('offset');
2825  $limit = (int) $limit;
2826  $count = (int) count_user_objects($user_guid, $subtype, $timelower, $timeupper);
2827  $entities = get_user_objects($user_guid, $subtype, $limit, $offset, $timelower, $timeupper);
2828 
2829  return elgg_view_entity_list($entities, $count, $offset, $limit, $fullview, $listtypetoggle,
2830  $pagination);
2831 }
2832 
2833 
2847 $limit = 0, $offset = 0) {
2848  elgg_deprecated_notice("get_user_objects_by_metadata() was deprecated in favor of elgg_get_entities_from_metadata()", 1.8);
2850  $limit, $offset);
2851 }
2852 
2862  elgg_deprecated_notice("set_user_validation_status() is deprecated", 1.8);
2864 }
2865 
2875  elgg_deprecated_notice("request_user_validation() is deprecated.
2876  Plugins should register for the 'register, user' plugin hook", 1.8);
2878 
2879  if (($user) && ($user instanceof ElggUser)) {
2880  // invalidate any existing validations
2882 
2883  // request validation
2884  trigger_elgg_event('validate', 'user', $user);
2885  }
2886 }
2887 
2909 function extend_elgg_settings_page($new_settings_view, $view = 'usersettings/main',
2910 $priority = 500) {
2911  // see views: /core/settings
2912  elgg_deprecated_notice("extend_elgg_settings_page has been deprecated. Extend one of the settings views instead", 1.8);
2913 
2914  return elgg_extend_view($view, $new_settings_view, $priority);
2915 }
2916 
2927 function page_draw($title, $body, $sidebar = "") {
2928  elgg_deprecated_notice("page_draw() was deprecated in favor of elgg_view_page() in 1.8.", 1.8);
2929 
2930  $vars = array(
2931  'sidebar' => $sidebar
2932  );
2933  echo elgg_view_page($title, $body, 'default', $vars);
2934 }
2935 
2945 function elgg_view_listing($icon, $info) {
2946  elgg_deprecated_notice('elgg_view_listing deprecated by elgg_view_image_block', 1.8);
2947  return elgg_view('page/components/image_block', array('image' => $icon, 'body' => $info));
2948 }
2949 
2964  elgg_deprecated_notice("get_entity_icon_url() deprecated for getIconURL()", 1.8);
2965  global $CONFIG;
2966 
2968  switch (strtolower($size)) {
2969  case 'master':
2970  $size = 'master';
2971  break;
2972 
2973  case 'large' :
2974  $size = 'large';
2975  break;
2976 
2977  case 'topbar' :
2978  $size = 'topbar';
2979  break;
2980 
2981  case 'tiny' :
2982  $size = 'tiny';
2983  break;
2984 
2985  case 'small' :
2986  $size = 'small';
2987  break;
2988 
2989  case 'medium' :
2990  default:
2991  $size = 'medium';
2992  }
2993 
2994  $url = false;
2995 
2997 
2998  // Step one, see if anyone knows how to render this in the current view
2999  $params = array('entity' => $entity, 'viewtype' => $viewtype, 'size' => $size);
3000  $url = elgg_trigger_plugin_hook('entity:icon:url', $entity->getType(), $params, $url);
3001 
3002  // Fail, so use default
3003  if (!$url) {
3004  $type = $entity->getType();
3005  $subtype = $entity->getSubtype();
3006 
3007  if (!empty($subtype)) {
3008  $overrideurl = elgg_view("icon/{$type}/{$subtype}/{$size}", array('entity' => $entity));
3009  if (!empty($overrideurl)) {
3010  return $overrideurl;
3011  }
3012  }
3013 
3014  $overrideurl = elgg_view("icon/{$type}/default/{$size}", array('entity' => $entity));
3015  if (!empty($overrideurl)) {
3016  return $overrideurl;
3017  }
3018 
3019  $url = "_graphics/icons/default/$size.png";
3020  }
3021 
3022  return elgg_normalize_url($url);
3023 }
3024 
3035 function get_loggedin_user() {
3036  elgg_deprecated_notice('get_loggedin_user() is deprecated by elgg_get_logged_in_user_entity()', 1.8);
3038 }
3039 
3048  elgg_deprecated_notice('get_loggedin_userid() is deprecated by elgg_get_logged_in_user_guid()', 1.8);
3050 }
3051 
3052 
3059 function isloggedin() {
3060  elgg_deprecated_notice('isloggedin() is deprecated by elgg_is_logged_in()', 1.8);
3061  return elgg_is_logged_in();
3062 }
3063 
3070 function isadminloggedin() {
3071  elgg_deprecated_notice('isadminloggedin() is deprecated by elgg_is_admin_logged_in()', 1.8);
3072  return elgg_is_admin_logged_in();
3073 }
3074 
3075 
3083 function load_plugins() {
3084  elgg_deprecated_notice('load_plugins() is deprecated by elgg_load_plugins()', 1.8);
3085  return _elgg_load_plugins();
3086 }
3087 
3098  elgg_deprecated_notice('find_plugin_usersettings() is deprecated by elgg_get_all_plugin_user_settings()', 1.8);
3100 }
3101 
3115  elgg_deprecated_notice('find_plugin_usersettings() is deprecated by elgg_get_all_plugin_user_settings()', 1.8);
3117 }
3118 
3130  elgg_deprecated_notice('clear_plugin_usersetting() is deprecated by elgg_unset_plugin_usersetting()', 1.8);
3132 }
3133 
3146  elgg_deprecated_notice('get_plugin_usersetting() is deprecated by elgg_get_plugin_user_setting()', 1.8);
3148 }
3149 
3162  elgg_deprecated_notice('set_plugin_setting() is deprecated by elgg_set_plugin_setting()', 1.8);
3164 }
3165 
3177  elgg_deprecated_notice('get_plugin_setting() is deprecated by elgg_get_plugin_setting()', 1.8);
3179 }
3180 
3192  elgg_deprecated_notice('clear_plugin_setting() is deprecated by elgg_unset_plugin_setting()', 1.8);
3194 }
3195 
3207  elgg_deprecated_notice('clear_all_plugin_settings() is deprecated by elgg_unset_all_plugin_setting()', 1.8);
3209 }
3210 
3211 
3231 function get_annotations($entity_guid = 0, $entity_type = "", $entity_subtype = "", $name = "",
3232 $value = "", $owner_guid = 0, $limit = 10, $offset = 0, $order_by = "asc", $timelower = 0,
3233 $timeupper = 0, $entity_owner_guid = 0) {
3234 
3235  elgg_deprecated_notice('get_annotations() is deprecated by elgg_get_annotations()', 1.8);
3236  $options = array();
3237 
3238  if ($entity_guid) {
3239  $options['guid'] = $entity_guid;
3240  }
3241 
3242  if ($entity_type) {
3243  $options['type'] = $entity_type;
3244  }
3245 
3246  if ($entity_subtype) {
3247  $options['subtype'] = $entity_subtype;
3248  }
3249 
3250  if ($name) {
3251  $options['annotation_name'] = $name;
3252  }
3253 
3254  if ($value) {
3255  $options['annotation_value'] = $value;
3256  }
3257 
3258  if ($owner_guid) {
3259  $options['annotation_owner_guid'] = $owner_guid;
3260  }
3261 
3262  $options['limit'] = $limit;
3263  $options['offset'] = $offset;
3264 
3265  if ($order_by == 'desc') {
3266  $options['order_by'] = 'n_table.time_created desc';
3267  }
3268 
3269  if ($timelower) {
3270  $options['annotation_time_lower'] = $timelower;
3271  }
3272 
3273  if ($timeupper) {
3274  $options['annotation_time_upper'] = $timeupper;
3275  }
3276 
3277  if ($entity_owner_guid) {
3278  $options['owner_guid'] = $entity_owner_guid;
3279  }
3280 
3282 }
3283 
3284 
3296 function list_annotations($entity_guid, $name = "", $limit = 25, $asc = true) {
3297  elgg_deprecated_notice('list_annotations() is deprecated by elgg_list_annotations()', 1.8);
3298 
3299  if ($asc) {
3300  $asc = "asc";
3301  } else {
3302  $asc = "desc";
3303  }
3304 
3305  $options = array(
3306  'guid' => $entity_guid,
3307  'limit' => $limit,
3308  'order_by' => "n_table.time_created $asc"
3309  );
3310 
3312 }
3313 
3330 function elgg_deprecated_annotation_calculation($entity_guid = 0, $entity_type = "", $entity_subtype = "",
3331 $name = "", $value = "", $value_type = "", $owner_guid = 0, $timelower = 0,
3332 $timeupper = 0, $calculation = '') {
3333 
3334  $options = array('annotation_calculation' => $calculation);
3335 
3336  if ($entity_guid) {
3337  $options['guid'] = $entity_guid;
3338  }
3339 
3340  if ($entity_type) {
3341  $options['type'] = $entity_type;
3342  }
3343 
3344  if ($entity_subtype) {
3345  $options['subtype'] = $entity_subtype;
3346  }
3347 
3348  if ($name) {
3349  $options['annotation_name'] = $name;
3350  }
3351 
3352  if ($value) {
3353  $options['annotation_value'] = $value;
3354  }
3355 
3356  if ($owner_guid) {
3357  $options['annotation_owner_guid'] = $owner_guid;
3358  }
3359 
3360  if ($timelower) {
3361  $options['annotation_time_lower'] = $timelower;
3362  }
3363 
3364  if ($timeupper) {
3365  $options['annotation_time_upper'] = $timeupper;
3366  }
3367 
3369 }
3370 
3387 function count_annotations($entity_guid = 0, $entity_type = "", $entity_subtype = "",
3388 $name = "", $value = "", $value_type = "", $owner_guid = 0, $timelower = 0,
3389 $timeupper = 0) {
3390  elgg_deprecated_notice('count_annotations() is deprecated by elgg_get_annotations() and passing "count" => true', 1.8);
3391  return elgg_deprecated_annotation_calculation($entity_guid, $entity_type, $entity_subtype,
3392  $name, $value, $value_type, $owner_guid, $timelower, $timeupper, 'count');
3393 }
3394 
3409 function get_annotations_sum($entity_guid, $entity_type = "", $entity_subtype = "", $name = "",
3410 $value = "", $value_type = "", $owner_guid = 0) {
3411  elgg_deprecated_notice('get_annotations_sum() is deprecated by elgg_get_annotations() and passing "annotation_calculation" => "sum"', 1.8);
3412 
3413  return elgg_deprecated_annotation_calculation($entity_guid, $entity_type, $entity_subtype,
3414  $name, $value, $value_type, $owner_guid, 0, 0, 'sum');
3415 }
3416 
3431 function get_annotations_max($entity_guid, $entity_type = "", $entity_subtype = "", $name = "",
3432 $value = "", $value_type = "", $owner_guid = 0) {
3433  elgg_deprecated_notice('get_annotations_max() is deprecated by elgg_get_annotations() and passing "annotation_calculation" => "max"', 1.8);
3434 
3435  return elgg_deprecated_annotation_calculation($entity_guid, $entity_type, $entity_subtype,
3436  $name, $value, $value_type, $owner_guid, 0, 0, 'max');
3437 }
3438 
3439 
3454 function get_annotations_min($entity_guid, $entity_type = "", $entity_subtype = "", $name = "",
3455 $value = "", $value_type = "", $owner_guid = 0) {
3456  elgg_deprecated_notice('get_annotations_min() is deprecated by elgg_get_annotations() and passing "annotation_calculation" => "min"', 1.8);
3457 
3458  return elgg_deprecated_annotation_calculation($entity_guid, $entity_type, $entity_subtype,
3459  $name, $value, $value_type, $owner_guid, 0, 0, 'min');
3460 }
3461 
3462 
3478 function get_annotations_avg($entity_guid, $entity_type = "", $entity_subtype = "", $name = "",
3479 $value = "", $value_type = "", $owner_guid = 0) {
3480  elgg_deprecated_notice('get_annotations_avg() is deprecated by elgg_get_annotations() and passing "annotation_calculation" => "avg"', 1.8);
3481 
3482  return elgg_deprecated_annotation_calculation($entity_guid, $entity_type, $entity_subtype,
3483  $name, $value, $value_type, $owner_guid, 0, 0, 'avg');
3484 }
3485 
3486 
3504 function get_annotations_calculate_x($sum = "avg", $entity_guid, $entity_type = "",
3505 $entity_subtype = "", $name = "", $value = "", $value_type = "", $owner_guid = 0,
3506 $timelower = 0, $timeupper = 0) {
3507  elgg_deprecated_notice('get_annotations_calculate_x() is deprecated by elgg_get_annotations() and passing "annotation_calculation" => "calculation"', 1.8);
3508 
3509  return elgg_deprecated_annotation_calculation($entity_guid, $entity_type, $entity_subtype,
3510  $name, $value, $value_type, $owner_guid, $timelower, $timeupper, $sum);
3511 }
3512 
3513 
3536 function list_entities_from_annotation_count_by_metadata($entity_type = "", $entity_subtype = "",
3537 $name = "", $mdname = '', $mdvalue = '', $limit = 10, $owner_guid = 0, $group_guid = 0,
3538 $asc = false, $fullview = true, $listtypetoggle = false, $pagination = true, $orderdir = 'desc') {
3539 
3540  $msg = 'list_entities_from_annotation_count_by_metadata() is deprecated by elgg_list_entities_from_annotation_calculation().';
3541 
3542  elgg_deprecated_notice($msg, 1.8);
3543 
3544  $options = array();
3545 
3546  $options['calculation'] = 'sum';
3547 
3548  if ($entity_type) {
3549  $options['types'] = $entity_type;
3550  }
3551 
3552  if ($entity_subtype) {
3553  $options['subtypes'] = $entity_subtype;
3554  }
3555 
3556  $options['annotation_names'] = $name;
3557 
3558  if ($mdname) {
3559  $options['metadata_name'] = $mdname;
3560  }
3561 
3562  if ($mdvalue) {
3563  $options['metadata_value'] = $mdvalue;
3564  }
3565 
3566  if ($owner_guid) {
3567  if (is_array($owner_guid)) {
3568  $options['owner_guids'] = $owner_guid;
3569  } else {
3570  $options['owner_guid'] = $owner_guid;
3571  }
3572  }
3573 
3574  $options['full_view'] = $fullview;
3575 
3576  $options['list_type_toggle'] = $listtypetoggle;
3577 
3578  $options['pagination'] = $pagination;
3579 
3580  $options['limit'] = $limit;
3581 
3582  $options['order_by'] = "annotation_calculation $orderdir";
3583 
3585 }
3586 
3595 function set_view_location($view, $location, $viewtype = '') {
3596  elgg_deprecated_notice("set_view_location() was deprecated by elgg_set_view_location()", 1.8);
3597  return elgg_set_view_location($view, $location, $viewtype);
3598 }
3599 
3610 function register_entity_url_handler($function_name, $entity_type = "all", $entity_subtype = "all") {
3611  elgg_deprecated_notice("register_entity_url_handler() was deprecated by elgg_register_entity_url_handler()", 1.8);
3612  return elgg_register_entity_url_handler($entity_type, $entity_subtype, $function_name);
3613 }
3614 
3615 
3631 function find_metadata($meta_name = "", $meta_value = "", $entity_type = "", $entity_subtype = "",
3632  $limit = 10, $offset = 0, $order_by = "", $site_guid = 0) {
3633 
3634  elgg_deprecated_notice('get_metadata() is deprecated by elgg_get_metadata()', 1.8);
3635 
3636  $options = array();
3637 
3638  if ($meta_name) {
3639  $options['annotation_name'] = $meta_name;
3640  }
3641 
3642  if ($meta_value) {
3643  $options['annotation_value'] = $meta_value;
3644  }
3645 
3646  if ($entity_type) {
3647  $options['type'] = $entity_type;
3648  }
3649 
3650  if ($entity_subtype) {
3651  $options['subtype'] = $entity_subtype;
3652  }
3653 
3654  $options['limit'] = $limit;
3655  $options['offset'] = $offset;
3656 
3657  if ($order_by == 'desc') {
3658  $options['order_by'] = 'n_table.time_created desc';
3659  }
3660 
3661  if ($site_guid) {
3662  $options['site_guid'] = $site_guid;
3663  }
3664 
3665  return elgg_get_metadata($options);
3666 }
3667 
3677 function get_metadata_byname($entity_guid, $meta_name) {
3678  elgg_deprecated_notice('get_metadata_byname() is deprecated by elgg_get_metadata()', 1.8);
3679 
3680  if (!$entity_guid || !$meta_name) {
3681  return false;
3682  }
3683 
3684  $options = array(
3685  'guid' => $entity_guid,
3686  'metadata_name' => $meta_name,
3687  'limit' => 0
3688  );
3689 
3690  $md = elgg_get_metadata($options);
3691 
3692  if ($md && count($md) == 1) {
3693  return $md[0];
3694  }
3695 
3696  return $md;
3697 }
3698 
3708  elgg_deprecated_notice('get_metadata_for_entity() is deprecated by elgg_get_metadata()', 1.8);
3709 
3710  if (!$entity_guid) {
3711  return false;
3712  }
3713 
3714  $options = array(
3715  'guid' => $entity_guid,
3716  'limit' => 0
3717  );
3718 
3719  return elgg_get_metadata($options);
3720 }
3721 
3730 function get_metadata($id) {
3731  elgg_deprecated_notice('get_metadata() is deprecated by elgg_get_metadata_from_id()', 1.8);
3733 }
3734 
3744  elgg_deprecated_notice('clear_metadata() is deprecated by elgg_delete_metadata()', 1.8);
3745  if (!$guid) {
3746  return false;
3747  }
3748  return elgg_delete_metadata(array('guid' => $guid, 'limit' => 0));
3749 }
3750 
3760  elgg_deprecated_notice('clear_metadata() is deprecated by elgg_delete_metadata()', 1.8);
3761  if (!$owner_guid) {
3762  return false;
3763  }
3764  return elgg_delete_metadata(array('metadata_owner_guid' => $owner_guid, 'limit' => 0));
3765 }
3766 
3776  elgg_deprecated_notice('delete_metadata() is deprecated by elgg_delete_metadata()', 1.8);
3777  if (!$id) {
3778  return false;
3779  }
3780  return elgg_delete_metadata(array('metadata_id' => $id));
3781 }
3782 
3793 function remove_metadata($guid, $name, $value = "") {
3794  elgg_deprecated_notice('delete_metadata() is deprecated by elgg_delete_metadata()', 1.8);
3795 
3796  // prevent them from deleting everything
3797  if (!$guid) {
3798  return false;
3799  }
3800 
3801  $options = array(
3802  'guid' => $guid,
3803  'metadata_name' => $name,
3804  'limit' => 0
3805  );
3806 
3807  if ($value) {
3808  $options['metadata_value'] = $value;
3809  }
3810 
3812 }
3813 
3822 function get_annotation($annotation_id) {
3823  elgg_deprecated_notice('get_annotation() is deprecated by elgg_get_annotation_from_id()', 1.8);
3824  return elgg_get_annotation_from_id($annotation_id);
3825 }
3826 
3836  elgg_deprecated_notice('delete_annotation() is deprecated by elgg_delete_annotations()', 1.8);
3837  if (!$id) {
3838  return false;
3839  }
3840  return elgg_delete_annotations(array('annotation_id' => $id));
3841 }
3842 
3852 function clear_annotations($guid, $name = "") {
3853  elgg_deprecated_notice('clear_annotations() is deprecated by elgg_delete_annotations()', 1.8);
3854 
3855  if (!$guid) {
3856  return false;
3857  }
3858 
3859  $options = array(
3860  'guid' => $guid,
3861  'limit' => 0
3862  );
3863 
3864  if ($name) {
3865  $options['annotation_name'] = $name;
3866  }
3867 
3869 }
3870 
3880  elgg_deprecated_notice('clear_annotations_by_owner() is deprecated by elgg_delete_annotations()', 1.8);
3881 
3882  if (!$owner_guid) {
3883  return false;
3884  }
3885 
3886  $options = array(
3887  'annotation_owner_guid' => $owner_guid,
3888  'limit' => 0
3889  );
3890 
3892 }
3893 
3918 function register_page_handler($handler, $function){
3919  elgg_deprecated_notice("register_page_handler() was deprecated by elgg_register_page_handler()", 1.8);
3920  return elgg_register_page_handler($handler, $function);
3921 }
3922 
3934  elgg_deprecated_notice("unregister_page_handler() was deprecated by elgg_unregister_page_handler()", 1.8);
3936 }
3937 
3946 function register_annotation_url_handler($function, $extender_name) {
3947  elgg_deprecated_notice("register_annotation_url_handler() was deprecated by elgg_register_annotation_url_handler()", 1.8);
3948  return elgg_register_annotation_url_handler($extender_name, $function);
3949 }
3950 
3963 function register_extender_url_handler($function, $type = "all", $name = "all") {
3964  elgg_deprecated_notice("register_extender_url_handler() was deprecated by elgg_register_extender_url_handler()", 1.8);
3965  return elgg_register_extender_url_handler($type, $name, $function);
3966 }
3967 
3980  elgg_deprecated_notice("register_entity_type() was deprecated by elgg_register_entity_type()", 1.8);
3982 }
3983 
3992 function register_metadata_url_handler($function, $extender_name = "all") {
3993  return elgg_register_metadata_url_handler($extender_name, $function);
3994 }
3995 
4005 function register_relationship_url_handler($function_name, $relationship_type = "all") {
4006  elgg_deprecated_notice("register_relationship_url_handler() was deprecated by elgg_register_relationship_url_handler()", 1.8);
4007  return elgg_register_relationship_url_handler($relationship_type, $function_name);
4008 }
4009 
4022 function elgg_view_register_simplecache($viewname) {
4023  elgg_deprecated_notice("elgg_view_register_simplecache() was deprecated by elgg_register_simplecache_view()", 1.8);
4024  return elgg_register_simplecache_view($viewname);
4025 }
4026 
4036  elgg_deprecated_notice("elgg_view_regenerate_simplecache() was deprecated by elgg_regenerate_simplecache()", 1.8);
4038 }
4039 
4048  elgg_deprecated_notice("elgg_view_enable_simplecache() was deprecated by elgg_enable_simplecache()", 1.8);
4049  return elgg_enable_simplecache();
4050 }
4051 
4060  elgg_deprecated_notice("elgg_view_disable_simplecache() was deprecated by elgg_disable_simplecache()", 1.8);
4061  return elgg_disable_simplecache();
4062 }
4063 
4064 // these were internal functions that perhaps can be removed rather than deprecated
4068 function is_db_installed() {
4069  elgg_deprecated_notice('is_db_installed() has been deprecated', 1.8);
4070  return true;
4071 }
4072 
4076 function is_installed() {
4077  elgg_deprecated_notice('is_installed() has been deprecated', 1.8);
4078  return true;
4079 }
4080 
4100 function pam_authenticate($credentials = NULL, $policy = "user") {
4101  elgg_deprecated_notice('pam_authenticate has been deprecated for ElggPAM', 1.8);
4102  global $_PAM_HANDLERS, $_PAM_HANDLERS_MSG;
4103 
4104  $_PAM_HANDLERS_MSG = array();
4105 
4106  $authenticated = false;
4107 
4108  foreach ($_PAM_HANDLERS[$policy] as $k => $v) {
4109  $handler = $v->handler;
4110  $importance = $v->importance;
4111 
4112  try {
4113  // Execute the handler
4114  if ($handler($credentials)) {
4115  // Explicitly returned true
4116  $_PAM_HANDLERS_MSG[$k] = "Authenticated!";
4117 
4118  $authenticated = true;
4119  } else {
4120  $_PAM_HANDLERS_MSG[$k] = "Not Authenticated.";
4121 
4122  // If this is required then abort.
4123  if ($importance == 'required') {
4124  return false;
4125  }
4126  }
4127  } catch (Exception $e) {
4128  $_PAM_HANDLERS_MSG[$k] = "$e";
4129 
4130  // If this is required then abort.
4131  if ($importance == 'required') {
4132  return false;
4133  }
4134  }
4135  }
4136 
4137  return $authenticated;
4138 }
4139 
4140 
4153  elgg_deprecated_notice('save_widget_location() is deprecated', 1.8);
4154  if ($widget instanceof ElggObject) {
4155  if ($widget->getSubtype() == "widget") {
4156  // If you can't move the widget, don't save a new location
4157  if (!$widget->draggable) {
4158  return false;
4159  }
4160 
4161  // Sanitise the column value
4162  if ($column != 1 || $column != 2 || $column != 3) {
4163  $column = 1;
4164  }
4165 
4166  $widget->column = (int) $column;
4167 
4168  $ordertmp = array();
4169  $params = array(
4170  'context' => $widget->context,
4171  'column' => $column,
4172  );
4173 
4174  if ($entities = get_entities_from_metadata_multi($params, 'object', 'widget')) {
4175  foreach ($entities as $entity) {
4176  $entityorder = $entity->order;
4177  if ($entityorder < $order) {
4178  $ordertmp[$entityorder] = $entity;
4179  }
4180  if ($entityorder >= $order) {
4181  $ordertmp[$entityorder + 10000] = $entity;
4182  }
4183  }
4184  }
4185 
4186  $ordertmp[$order] = $widget;
4187  ksort($ordertmp);
4188 
4189  $orderticker = 10;
4190  foreach ($ordertmp as $orderval => $entity) {
4191  $entity->order = $orderticker;
4192  $orderticker += 10;
4193  }
4194 
4195  return true;
4196  } else {
4197  register_error($widget->getSubtype());
4198  }
4199 
4200  }
4201 
4202  return false;
4203 }
4204 
4216  elgg_deprecated_notice('get_widgets is depecated for elgg_get_widgets', 1.8);
4217  $params = array(
4218  'column' => $column,
4219  'context' => $context
4220  );
4222  "widget", $user_guid, "", 10000);
4223 
4224  if ($widgets) {
4225  $widgetorder = array();
4226  foreach ($widgets as $widget) {
4227  $order = $widget->order;
4228  while (isset($widgetorder[$order])) {
4229  $order++;
4230  }
4231  $widgetorder[$order] = $widget;
4232  }
4233 
4234  ksort($widgetorder);
4235 
4236  return $widgetorder;
4237  }
4238 
4239  return false;
4240 }
4241 
4255 function add_widget($entity_guid, $handler, $context, $order = 0, $column = 1, $access_id = null) {
4256  elgg_deprecated_notice('add_widget has been deprecated for elgg_create_widget', 1.8);
4257  if (empty($entity_guid) || empty($context) || empty($handler) || !widget_type_exists($handler)) {
4258  return false;
4259  }
4260 
4261  if ($entity = get_entity($entity_guid)) {
4262  $widget = new ElggWidget;
4263  $widget->owner_guid = $entity_guid;
4264  $widget->container_guid = $entity_guid;
4265  if (isset($access_id)) {
4266  $widget->access_id = $access_id;
4267  } else {
4268  $widget->access_id = get_default_access();
4269  }
4270 
4271  $guid = $widget->save();
4272 
4273  // private settings cannot be set until ElggWidget saved
4274  $widget->handler = $handler;
4275  $widget->context = $context;
4276  $widget->column = $column;
4277  $widget->order = $order;
4278 
4279  return $guid;
4280  }
4281 
4282  return false;
4283 }
4284 
4302 $multiple = false, $positions = "side,main") {
4303  elgg_deprecated_notice("add_widget_type deprecated for elgg_register_widget_type", 1.8);
4304 
4306 }
4307 
4318  elgg_deprecated_notice("remove_widget_type deprecated for elgg_unregister_widget_type", 1.8);
4320 }
4321 
4331  elgg_deprecated_notice("widget_type_exists deprecated for elgg_is_widget_type", 1.8);
4332  return elgg_is_widget_type($handler);
4333 }
4334 
4341 function get_widget_types() {
4342  elgg_deprecated_notice("get_widget_types deprecrated for elgg_get_widget_types", 1.8);
4343  return elgg_get_widget_types();
4344 }
4345 
4356 function save_widget_info($widget_guid, $params) {
4357  elgg_deprecated_notice("save_widget_info() is deprecated for elgg_save_widget_settings", 1.8);
4358  if ($widget = get_entity($widget_guid)) {
4359 
4360  $subtype = $widget->getSubtype();
4361 
4362  if ($subtype != "widget") {
4363  return false;
4364  }
4365  $handler = $widget->handler;
4366  if (empty($handler) || !widget_type_exists($handler)) {
4367  return false;
4368  }
4369 
4370  if (!$widget->canEdit()) {
4371  return false;
4372  }
4373 
4374  // Save the params to the widget
4375  if (is_array($params) && sizeof($params) > 0) {
4376  foreach ($params as $name => $value) {
4377 
4378  if (!empty($name) && !in_array($name, array(
4379  'guid', 'owner_guid', 'site_guid'
4380  ))) {
4381  if (is_array($value)) {
4382  // @todo Handle arrays securely
4383  $widget->setMetadata($name, $value, "", true);
4384  } else {
4385  $widget->$name = $value;
4386  }
4387  }
4388  }
4389  $widget->save();
4390  }
4391 
4392  $function = "save_{$handler}_widget";
4393  if (is_callable($function)) {
4394  return $function($params);
4395  }
4396 
4397  return true;
4398  }
4399 
4400  return false;
4401 }
4402 
4415 function reorder_widgets_from_panel($panelstring1, $panelstring2, $panelstring3, $context, $owner) {
4416  elgg_deprecated_notice("reorder_widgets_from_panel() is deprecated", 1.8);
4417  $return = true;
4418 
4419  $mainwidgets = explode('::', $panelstring1);
4420  $sidewidgets = explode('::', $panelstring2);
4421  $rightwidgets = explode('::', $panelstring3);
4422 
4423  $handlers = array();
4424  $guids = array();
4425 
4426  if (is_array($mainwidgets) && sizeof($mainwidgets) > 0) {
4427  foreach ($mainwidgets as $widget) {
4428 
4429  $guid = (int) $widget;
4430 
4431  if ("{$guid}" == "{$widget}") {
4432  $guids[1][] = $widget;
4433  } else {
4434  $handlers[1][] = $widget;
4435  }
4436  }
4437  }
4438  if (is_array($sidewidgets) && sizeof($sidewidgets) > 0) {
4439  foreach ($sidewidgets as $widget) {
4440 
4441  $guid = (int) $widget;
4442 
4443  if ("{$guid}" == "{$widget}") {
4444  $guids[2][] = $widget;
4445  } else {
4446  $handlers[2][] = $widget;
4447  }
4448 
4449  }
4450  }
4451  if (is_array($rightwidgets) && sizeof($rightwidgets) > 0) {
4452  foreach ($rightwidgets as $widget) {
4453 
4454  $guid = (int) $widget;
4455 
4456  if ("{$guid}" == "{$widget}") {
4457  $guids[3][] = $widget;
4458  } else {
4459  $handlers[3][] = $widget;
4460  }
4461 
4462  }
4463  }
4464 
4465  // Reorder existing widgets or delete ones that have vanished
4466  foreach (array(1, 2, 3) as $column) {
4467  if ($dbwidgets = get_widgets($owner, $context, $column)) {
4468 
4469  foreach ($dbwidgets as $dbwidget) {
4470  if (in_array($dbwidget->getGUID(), $guids[1])
4471  || in_array($dbwidget->getGUID(), $guids[2]) || in_array($dbwidget->getGUID(), $guids[3])) {
4472 
4473  if (in_array($dbwidget->getGUID(), $guids[1])) {
4474  $pos = array_search($dbwidget->getGUID(), $guids[1]);
4475  $col = 1;
4476  } else if (in_array($dbwidget->getGUID(), $guids[2])) {
4477  $pos = array_search($dbwidget->getGUID(), $guids[2]);
4478  $col = 2;
4479  } else {
4480  $pos = array_search($dbwidget->getGUID(), $guids[3]);
4481  $col = 3;
4482  }
4483  $pos = ($pos + 1) * 10;
4484  $dbwidget->column = $col;
4485  $dbwidget->order = $pos;
4486  } else {
4487  $dbguid = $dbwidget->getGUID();
4488  if (!$dbwidget->delete()) {
4489  $return = false;
4490  } else {
4491  // Remove state cookie
4492  $cookie = new ElggCookie("widget$dbguid");
4493  $cookie->value = NULL;
4494  elgg_set_cookie($cookie);
4495  }
4496  }
4497  }
4498 
4499  }
4500  // Add new ones
4501  if (sizeof($guids[$column]) > 0) {
4502  foreach ($guids[$column] as $key => $guid) {
4503  if ($guid == 0) {
4504  $pos = ($key + 1) * 10;
4505  $handler = $handlers[$column][$key];
4506  if (!add_widget($owner, $handler, $context, $pos, $column)) {
4507  $return = false;
4508  }
4509  }
4510  }
4511  }
4512  }
4513 
4514  return $return;
4515 }
4516 
4526  elgg_deprecated_notice("use_widgets is deprecated", 1.8);
4527  global $CONFIG;
4528 
4529  if (!isset($CONFIG->widgets)) {
4530  $CONFIG->widgets = new stdClass;
4531  }
4532 
4533  if (!isset($CONFIG->widgets->contexts)) {
4534  $CONFIG->widgets->contexts = array();
4535  }
4536 
4537  if (!empty($context)) {
4538  $CONFIG->widgets->contexts[] = $context;
4539  }
4540 }
4541 
4548 function using_widgets() {
4549  elgg_deprecated_notice("using_widgets is deprecated", 1.8);
4550  global $CONFIG;
4551 
4553  if (isset($CONFIG->widgets->contexts) && is_array($CONFIG->widgets->contexts)) {
4554  if (in_array($context, $CONFIG->widgets->contexts)) {
4555  return true;
4556  }
4557  }
4558 
4559  return false;
4560 }
4561 
4571  elgg_deprecated_notice("display_widget() was been deprecated. Use elgg_view_entity().", 1.8);
4572  return elgg_view_entity($widget);
4573 }
4574 
4583  elgg_deprecated_notice('elgg_count_comments() is deprecated by ElggEntity->countComments()', 1.8);
4584 
4585  if ($entity instanceof ElggEntity) {
4586  return $entity->countComments();
4587  }
4588 
4589  return 0;
4590 }
4591 
4600 function remove_from_river_by_subject($subject_guid) {
4601  elgg_deprecated_notice("remove_from_river_by_subject() deprecated by elgg_delete_river()", 1.8);
4602 
4603  return elgg_delete_river(array('subject_guid' => $subject_guid));
4604 }
4605 
4614 function remove_from_river_by_object($object_guid) {
4615  elgg_deprecated_notice("remove_from_river_by_object() deprecated by elgg_delete_river()", 1.8);
4616 
4617  return elgg_delete_river(array('object_guid' => $object_guid));
4618 }
4619 
4629 function remove_from_river_by_annotation($annotation_id) {
4630  elgg_deprecated_notice("remove_from_river_by_annotation() deprecated by elgg_delete_river()", 1.8);
4631 
4632  return elgg_delete_river(array('annotation_id' => $annotation_id));
4633 }
4634 
4645  elgg_deprecated_notice("remove_from_river_by_id() deprecated by elgg_delete_river()", 1.8);
4646 
4647  return elgg_delete_river(array('id' => $id));
4648 }
4649 
4660 function default_page_handler($page, $handler) {
4661  global $CONFIG;
4662 
4663  elgg_deprecated_notice("default_page_handler is deprecated", "1.8");
4664 
4665  $page = implode('/', $page);
4666 
4667  // protect against including arbitary files
4668  $page = str_replace("..", "", $page);
4669 
4670  $callpath = $CONFIG->path . $handler . "/" . $page;
4671  if (is_dir($callpath)) {
4672  $callpath = sanitise_filepath($callpath);
4673  $callpath .= "index.php";
4674  if (file_exists($callpath)) {
4675  if (include($callpath)) {
4676  return TRUE;
4677  }
4678  }
4679  } else if (file_exists($callpath)) {
4680  include($callpath);
4681  return TRUE;
4682  }
4683 
4684  return FALSE;
4685 }
4686 
4697  elgg_deprecated_notice('invalidate_cache_for_entity() is a private function and should not be used.', 1.8);
4699 }
4700 
4713  elgg_deprecated_notice('cache_entity() is a private function and should not be used.', 1.8);
4714  _elgg_cache_entity($entity);
4715 }
4716 
4727  elgg_deprecated_notice('retrieve_cached_entity() is a private function and should not be used.', 1.8);
4729 }
isadminloggedin()
Returns whether or not the user is currently logged in and that they are an admin user...
get_user_objects($user_guid, $subtype=ELGG_ENTITIES_ANY_VALUE, $limit=10, $offset=0, $timelower=0, $timeupper=0)
Obtains a list of objects owned by a user.
$tags
Definition: summary.php:41
elgg_view_river_items($subject_guid=0, $object_guid=0, $subject_relationship= '', $type= '', $subtype= '', $action_type= '', $limit=20, $posted_min=0, $posted_max=0, $pagination=true)
Returns a human-readable version of the river.
get_objects_in_group($group_guid, $subtype="", $owner_guid=0, $site_guid=0, $order_by="", $limit=10, $offset=0, $count=FALSE)
Return an array of objects in a given container.
$view
Definition: crop.php:68
elgg_get_calling_plugin_id($mainfilename=false)
Get the name of the most recent plugin to be called in the call stack (or the plugin that owns the cu...
get_metastring_id($string, $case_sensitive=TRUE)
Return the meta string id for a given tag, or false.
trigger_plugin_hook($hook, $type, $params=null, $returnvalue=null)
Triggers a plugin hook, with various parameters as an array.
getSubtype()
Get the entity subtype.
$n
Profile fields.
Definition: list.php:9
$r
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)
Return a list of entities suitable for display based on the given search criteria.
elgg_view_register_simplecache($viewname)
Registers a view to be simply cached.
page_owner()
Gets the guid of the entity that owns the current page.
elgg_is_logged_in()
Returns whether or not the user is currently logged in.
Definition: sessions.php:56
clear_metadata_by_owner($owner_guid)
Clear all metadata belonging to a given owner_guid.
elgg_get_entity_owner_where_sql($table, $owner_guids)
Returns SQL where clause for owner and containers.
elgg_unregister_menu_item($menu_name, $item_name)
Remove an item from a menu.
Definition: navigation.php:103
$plugin
elgg_get_entities_from_metadata(array $options=array())
ElggEntities interfaces.
Definition: metadata.php:431
register_entity_url_handler($function_name, $entity_type="all", $entity_subtype="all")
Sets the URL handler for a particular entity type and subtype.
elgg_unregister_plugin_hook_handler($hook, $entity_type, $callback)
Unregister a callback as a plugin hook.
Definition: elgglib.php:867
$context
Definition: add.php:11
register_action($action, $public=false, $filename="", $admin_only=false)
Registers a particular action in memory.
elgg_is_widget_type($handler)
Has a widget type with the specified handler been registered.
Definition: widgets.php:104
$installed_plugins
Definition: plugins.php:17
find_metadata($meta_name="", $meta_value="", $entity_type="", $entity_subtype="", $limit=10, $offset=0, $order_by="", $site_guid=0)
Get the metadata where the entities they are referring to match a given criteria. ...
get_input($variable, $default=null, $filter_result=true)
Get some input from variables passed submitted through GET or POST.
Definition: input.php:27
$username
Definition: delete.php:22
list_entities_by_relationship_count($relationship, $inverse_relationship=true, $type="", $subtype="", $owner_guid=0, $limit=10, $fullview=true, $listtypetoggle=false, $pagination=true)
Displays a human-readable list of entities.
global $_PAM_HANDLERS
Definition: pam.php:23
register_relationship_url_handler($function_name, $relationship_type="all")
Sets the URL handler for a particular relationship type.
elgg_view_entity(ElggEntity $entity, $vars=array(), $bypass=false, $debug=false)
Returns a string of a rendered entity.
Definition: views.php:790
get_data_row($query, $callback="")
Retrieve a single row from the database.
Definition: database.php:66
set_plugin_setting($name, $value, $plugin_id=null)
Set a setting for a plugin.
elgg_get_tags(array $options=array())
Get popular tags and their frequencies.
Definition: tags.php:71
_elgg_invalidate_cache_for_entity($guid)
Invalidate this class&#39;s entry in the cache.
Definition: entities.php:72
clear_annotations($guid, $name="")
Clear all the annotations for a given entity, assuming you have access to that metadata.
invalidate_cache_for_entity($guid)
Invalidate this class&#39;s entry in the cache.
get_tags($threshold=1, $limit=10, $metadata_name="", $entity_type="object", $entity_subtype="", $owner_guid="", $site_guid=-1, $start_ts="", $end_ts="")
Get an array of tags with weights for use with the output/tagcloud view.
remove_blacklist($input)
Returns true if the word in $input is considered significant.
get_loggedin_user()
Return the current logged in user, or NULL if no user is logged in.
$table
Definition: cron.php:28
extend_elgg_admin_page($new_admin_view, $view= 'admin/main', $priority=500)
Register an admin page with the admin panel.
get_site_collections($site_guid, $subtype="", $limit=10, $offset=0)
Get the collections belonging to a site.
get_annotations_calculate_x($sum="avg", $entity_guid, $entity_type="", $entity_subtype="", $name="", $value="", $value_type="", $owner_guid=0, $timelower=0, $timeupper=0)
Perform a mathmatical calculation on integer annotations.
add_entity_relationship($guid_one, $relationship, $guid_two)
Create a relationship between two entities.
delete_metadata($id)
Delete a piece of metadata, where the current user has access.
elgg_is_admin_logged_in()
Returns whether or not the viewer is currently logged in and an admin user.
Definition: sessions.php:65
elgg_normalize_url($url)
Definition: output.php:290
elgg_set_plugin_setting($name, $value, $plugin_id=null)
Set a setting for a plugin.
Definition: plugins.php:928
get_annotations_avg($entity_guid, $entity_type="", $entity_subtype="", $name="", $value="", $value_type="", $owner_guid=0)
Return the average of a given integer annotation.
get_entities_from_private_setting($name="", $value="", $type="", $subtype="", $owner_guid=0, $order_by="", $limit=10, $offset=0, $count=false, $site_guid=0, $container_guid=null)
Get entities based on their private data.
unregister_elgg_event_handler($event, $object_type, $callback)
Unregisters a function to a particular kind of event.
if($guid==elgg_get_logged_in_user_guid()) $name
Definition: delete.php:21
elgg_set_cookie(ElggCookie $cookie)
Set a cookie, but allow plugins to customize it first.
Definition: sessions.php:285
remove_metadata($guid, $name, $value="")
Removes metadata on an entity with a particular name, optionally with a given value.
remove_entity_relationship($guid_one, $relationship, $guid_two)
Delete a relationship between two entities.
get_metadata_byname($entity_guid, $meta_name)
Get metadata objects by name.
get_entities_from_annotation_count($entity_type="", $entity_subtype="", $name="", $mdname= '', $mdvalue= '', $owner_guid=0, $limit=10, $offset=0, $orderdir= 'desc', $count=false)
Returns entities ordered by the sum of an annotation.
$method
Definition: form.php:25
$size
Definition: view.php:10
_elgg_retrieve_cached_entity($guid)
Retrieve a entity from the cache.
Definition: entities.php:134
if(!$owner||!($owner instanceof ElggUser)||!$owner->canEdit()) $input
Definition: edit.php:19
elgg_delete_annotations(array $options)
Deletes annotations based on $options.
elgg_get_all_plugin_user_settings($user_guid=0, $plugin_id=null, $return_obj=false)
Returns an array of all plugin user settings for a user.
Definition: plugins.php:811
$e
Definition: metadata.php:12
get_subtype_id($type, $subtype)
Return the id for a given subtype.
Definition: entities.php:166
list_entities_from_access_id($access_id, $entity_type="", $entity_subtype="", $owner_guid=0, $limit=10, $fullview=true, $listtypetoggle=true, $pagination=true)
Lists entities from an access collection.
$object
Definition: upgrade.php:12
elgg_get_entity_container_where_sql($table, $container_guids)
Returns SQL where clause for containers.
list_entities_location($location, $type="", $subtype="", $owner_guid=0, $limit=10, $fullview=true, $listtypetoggle=false, $navigation=true)
List entities in a given location.
list_site_members($site_guid, $limit=10, $fullview=true)
Display a list of site members.
elgg_register_widget_type($handler, $name, $description, $context=array('all'), $multiple=false)
Register a widget type.
Definition: widgets.php:73
_elgg_get_guid_based_where_sql($column, $guids)
Returns SQL where clause for owner and containers.
Definition: entities.php:1238
elgg_view_entity_list($entities, $vars=array(), $offset=0, $limit=10, $full_view=true, $list_type_toggle=true, $pagination=true)
Returns a rendered list of entities with pagination.
Definition: views.php:969
if(elgg_in_context('widget')) $offset
Definition: pagination.php:20
elgg_register_simplecache_view($view_name)
Registers a view to simple cache.
Definition: cache.php:136
sanitise_filepath($path, $append_slash=true)
Sanitise file paths ensuring that they begin and end with slashes etc.
Definition: elgglib.php:484
list_annotations($entity_guid, $name="", $limit=25, $asc=true)
Returns a human-readable list of annotations on a particular entity.
elgg_get_entities_from_private_settings(array $options=array())
Returns entities based upon private settings.
get_config($name, $site_guid=0)
Gets a configuration value.
find_plugin_settings($plugin_id=null)
Shorthand function for finding the plugin settings.
get_activity_stream_data($limit=10, $offset=0, $type="", $subtype="", $owner_guid="", $owner_relationship="")
Construct and execute the query required for the activity stream.
$metadata
Definition: entity.php:19
page_draw($title, $body, $sidebar="")
Returns a representation of a full &#39;page&#39; (which might be an HTML page, RSS file, etc...
elgg_view_regenerate_simplecache($viewtype=NULL)
Regenerates the simple cache.
remove_menu($menu_name)
Removes an item from the menu register.
register_elgg_event_handler($event, $object_type, $callback, $priority=500)
Alias function for events, that registers a function to a particular kind of event.
use_widgets($context)
Register a particular context for use with widgets.
$value
Definition: longtext.php:29
get_plugin_usersetting($name, $user_guid=0, $plugin_id="")
Get a user specific setting for a plugin.
$column
Definition: add.php:13
if($screenshots) $description
Definition: full.php:173
$widget
Definition: delete.php:9
remove_from_register($register_name, $subregister_name)
Removes a register entry from $CONFIG[register_name][subregister_name].
elgg_list_entities_from_relationship_count($options)
Returns a list of entities by relationship count.
using_widgets()
Determines whether or not the current context is using widgets.
elgg_list_entities_from_access_id(array $options=array())
Lists entities from an access collection.
Definition: access.php:918
set_view_location($view, $location, $viewtype= '')
Set an alternative base location for a view (as opposed to the default of $CONFIG->viewpath) ...
$friend
Definition: add.php:11
$return
Definition: opendd.php:15
$pagination
Definition: gallery.php:23
elgg_get_entity_site_where_sql($table, $site_guids)
Returns SQL where clause for site entities.
get_river_items($subject_guid=0, $object_guid=0, $subject_relationship= '', $type= '', $subtype= '', $action_type= '', $limit=20, $offset=0, $posted_min=0, $posted_max=0)
Retrieves items from the river.
$guid
Removes an admin notice.
unregister_page_handler($handler)
Unregister a page handler for an identifier.
display_widget(ElggObject $widget)
Displays a particular widget.
save_widget_info($widget_guid, $params)
Saves a widget&#39;s settings (by passing an array of (name => value) pairs to save_{$handler}_widget) ...
get_annotations($entity_guid=0, $entity_type="", $entity_subtype="", $name="", $value="", $owner_guid=0, $limit=10, $offset=0, $order_by="asc", $timelower=0, $timeupper=0, $entity_owner_guid=0)
Get a list of annotations for a given object/user/annotation type.
get_loggedin_userid()
Return the current logged in user by id.
get_context()
Returns the functional context of a page.
elgg_register_metadata_url_handler($extender_name, $function)
Register a metadata url handler.
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)
Get all the entities from metadata from a group.
call_gatekeeper($function, $file="")
Checks if code is being called from a certain function.
register_annotation_url_handler($function, $extender_name)
Register an annotation url handler.
elgg_get_metadata_from_id($id)
Get a specific metadata object by its id.
Definition: metadata.php:35
extend_elgg_settings_page($new_settings_view, $view= 'usersettings/main', $priority=500)
Register a user settings page with the admin panel.
elgg_register_plugin_hook_handler($hook, $type, $callback, $priority=500)
Register a callback as a plugin hook handler.
Definition: elgglib.php:853
elgg_get_plugin_user_setting($name, $user_guid=0, $plugin_id=null)
Get a user specific setting for a plugin.
Definition: plugins.php:902
set_context($context)
Sets the functional context of a page.
elgg_get_entities_from_location(array $options=array())
Return entities within a given geographic area.
get_register($register_name)
If it exists, returns a particular register as an array.
_elgg_load_plugins()
Loads all active plugins in the order specified in the tool admin panel.
Definition: plugins.php:316
widget_type_exists($handler)
Determines whether or not widgets with the specified handler have been defined.
get_plugin_list()
Returns a list of plugins to load, in the order that they should be loaded.
count_user_objects($user_guid, $subtype=ELGG_ENTITIES_ANY_VALUE, $timelower=0, $timeupper=0)
Counts the objects (optionally of a particular subtype) owned by a user.
regenerate_plugin_list($pluginorder=FALSE)
Regenerates the list of known plugins and saves it to the current site.
clear_plugin_usersetting($name, $user_guid=0, $plugin_id= '')
Clears a user-specific plugin setting.
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')
Lists entities by the totals of a particular kind of annotation.
list_entities_from_annotation_count_by_metadata($entity_type="", $entity_subtype="", $name="", $mdname= '', $mdvalue= '', $limit=10, $owner_guid=0, $group_guid=0, $asc=false, $fullview=true, $listtypetoggle=false, $pagination=true, $orderdir= 'desc')
Lists entities by the totals of a particular kind of annotation AND the value of a piece of metadata...
events($event="", $object_type="", $function="", $priority=500, $call=false, $object=null)
Deprecated events core function.
set_user_validation_status($user_guid, $status, $method= '')
Set the validation status for a user.
get_plugin_setting($name, $plugin_id="")
Get setting for a plugin.
$url
Definition: exceptions.php:24
if(!$icontime) $js
Definition: default.php:49
find_plugin_usersettings($plugin_id=null, $user_guid=0)
Find the plugin settings for a user.
remove_widget_type($handler)
Remove a widget type.
elgg_set_page_owner_guid($guid)
Set the guid of the entity that owns this page.
Definition: pageowner.php:73
$sidebar
Definition: river.php:60
$title
Definition: save.php:24
register_entity_type($type, $subtype=null)
Registers and entity type and subtype to return in search and other places.
$action
elgg_view_disable_simplecache()
Disables the simple cache.
callpath_gatekeeper($path, $include_subdirs=true, $strict_mode=false)
This function checks to see if it is being called at somepoint by a function defined somewhere on a g...
elgg_register_extender_url_handler($extender_type, $extender_name, $function_name)
Sets the URL handler for a particular extender type and name.
get_user_by_username($username)
Get user by username.
Definition: users.php:246
if(!$owner) $icon
Definition: default.php:16
add_widget($entity_guid, $handler, $context, $order=0, $column=1, $access_id=null)
Add a new widget instance.
$string
is_db_installed()
save_widget_location(ElggObject $widget, $order, $column)
When given a widget entity and a new requested location, saves the new location and also provides a s...
$params
Definition: login.php:72
$entity_guid
Definition: save.php:9
$options
Definition: index.php:14
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)
Get entities ordered by a mathematical calculation.
request_user_validation($user_guid)
Trigger an event requesting that a user guid be validated somehow - either by email address or some o...
elgg_view_menu($menu_name, array $vars=array())
Render a menu.
Definition: views.php:687
list_entities_groups($subtype="", $owner_guid=0, $container_guid=0, $limit=10, $fullview=true, $listtypetoggle=true, $pagination=true)
Lists entities that belong to a group.
cache_entity(ElggEntity $entity)
Cache an entity.
get_site_members($site_guid, $limit=10, $offset=0)
Get the members of a site.
elgg_register_annotation_url_handler($extender_name="all", $function_name)
Register an annotation url handler.
elgg_unset_all_plugin_settings($plugin_id=null)
Unsets all plugin settings for a plugin.
Definition: plugins.php:1003
get_entity_icon_url(ElggEntity $entity, $size= 'medium')
Return the icon URL for an entity.
$owner_guid
$plugins
elgg_list_annotations($options)
Returns a rendered list of annotations with pagination.
$limit
Definition: userpicker.php:33
elgg_view_listing($icon, $info)
Wrapper function to display search listings.
get_entities_from_relationships_and_meta($relationship, $relationship_guid, $inverse_relationship=false, $meta_name="", $meta_value="", $type="", $subtype="", $owner_guid=0, $limit=10, $offset=0, $count=false, $site_guid=0)
Gets the number of entities by a the number of entities related to them in a particular way also cons...
elgg_get_viewtype()
Return the current view type.
Definition: views.php:91
elgg_echo($message_key, $args=array(), $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
elgg_view_friendly_time($time)
Displays a UNIX timestamp in a friendly way.
Definition: views.php:1126
elgg_get_annotation_from_id($id)
Get a specific annotation by its id.
Definition: annotations.php:36
add_widget_type($handler, $name, $description, $context="all", $multiple=false, $positions="side,main")
Define a new widget type.
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)
Return entities within a given geographic area.
get_annotations_max($entity_guid, $entity_type="", $entity_subtype="", $name="", $value="", $value_type="", $owner_guid=0)
Return the max of a given integer annotation.
get_user_objects_by_metadata($user_guid, $subtype="", $metadata=array(), $limit=0, $offset=0)
Get user objects by an array of metadata.
$menu_items
Definition: save.php:14
$owner
Definition: crop.php:8
$key
Definition: summary.php:34
add_site_collection($site_guid, $collection_guid)
Add a collection to a site.
elgg_set_view_location($view, $location, $viewtype= '')
Set an alternative base location for a view.
Definition: views.php:303
load_plugin_manifest($plugin)
Load and parse a plugin manifest from a plugin XML file.
get_widget_types()
Returns an array of stdClass objects representing the defined widget types.
clear_plugin_setting($name, $plugin_id="")
Clear a plugin setting.
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)
As get_entities_from_metadata_groups() but with multiple entities.
count_annotations($entity_guid=0, $entity_type="", $entity_subtype="", $name="", $value="", $value_type="", $owner_guid=0, $timelower=0, $timeupper=0)
Count the number of annotations based on search parameters.
$plugin_id
Definition: save.php:16
$item
Definition: item.php:12
elgg_view_enable_simplecache()
Enables the simple cache.
global $CONFIG
elgg_set_context($context)
Sets the page context.
Definition: pageowner.php:201
sanitise_string($string)
Wrapper function for alternate English spelling (.
Definition: database.php:150
elgg_get_entities_from_annotation_calculation($options)
Get entities ordered by a mathematical calculation on annotation values.
elgg_extend_view($view, $view_extension, $priority=501, $viewtype= '')
Extends a view with another view.
Definition: views.php:401
remove_from_river_by_annotation($annotation_id)
Removes all items relating to a particular annotation being acted upon from the river.
enable_plugin($plugin, $site_guid=null)
Enable a plugin for a site (default current site)
$user
Definition: ban.php:13
get_widgets($user_guid, $context, $column)
Get widgets for a particular context and column, in order of display.
elgg_set_plugin_user_setting($name, $value, $user_guid=0, $plugin_id=null)
Set a user specific setting for a plugin.
Definition: plugins.php:850
is_plugin_enabled($plugin, $site_guid=0)
Return whether a plugin is enabled or not.
add_to_register($register_name, $subregister_name, $subregister_value, $children_array=array())
Adds an entry in $CONFIG[$register_name][$subregister_name].
list_entities_from_metadata_multi($meta_array, $entity_type="", $entity_subtype="", $owner_guid=0, $limit=10, $fullview=true, $listtypetoggle=true, $pagination=true)
Returns a viewable list of entities based on the given search criteria.
const ELGG_ENTITIES_ANY_VALUE
Definition: elgglib.php:2134
elgg_count_comments($entity)
Count the number of comments attached to an entity.
elgg echo
Translates a string.
Definition: languages.js:43
elgg_get_entities(array $options=array())
Returns an array of entities with optional filtering.
Definition: entities.php:777
elgg_trigger_plugin_hook($hook, $type, $params=null, $returnvalue=null)
Trigger a Plugin Hook and run all handler callbacks registered to that hook:type. ...
Definition: elgglib.php:925
elgg_register_page_handler($identifier, $function)
Registers a page handler for a particular identifier.
Definition: pagehandler.php:34
elgg_regenerate_simplecache($viewtype=NULL)
Regenerates the simple cache.
list_user_objects($user_guid, $subtype=ELGG_ENTITIES_ANY_VALUE, $limit=10, $fullview=true, $listtypetoggle=true, $pagination=true, $timelower=0, $timeupper=0)
Displays a list of user objects of a particular subtype, with navigation.
elgg_get_context()
Get the current context.
Definition: pageowner.php:226
elgg_deprecated_notice($msg, $dep_version, $backtrace_level=1)
Sends a notice about deprecated use of a function, view, etc.
Definition: elgglib.php:1171
elgg global
Pointer to the global context.
Definition: elgglib.js:12
elgg_get_page_owner_entity()
Gets the owner entity for the current page.
Definition: pageowner.php:53
list_entities_from_relationship($relationship, $relationship_guid, $inverse_relationship=false, $type=ELGG_ENTITIES_ANY_VALUE, $subtype=ELGG_ENTITIES_ANY_VALUE, $owner_guid=0, $limit=10, $fullview=true, $listtypetoggle=false, $pagination=true, $order_by= '')
Returns a viewable list of entities by relationship.
$type
Definition: add.php:8
get_metadata($id)
Get a specific metadata object.
remove_from_river_by_id($id)
Removes a single river entry.
elgg_register_menu_item($menu_name, $menu_item)
Register an item for an Elgg menu.
Definition: navigation.php:73
elgg_view($view, $vars=array(), $bypass=false, $ignored=false, $viewtype= '')
Return a parsed view.
Definition: views.php:354
get_annotations_sum($entity_guid, $entity_type="", $entity_subtype="", $name="", $value="", $value_type="", $owner_guid=0)
Return the sum of a given integer annotation.
elgg_list_entities_from_location(array $options=array())
Returns a viewable list of entities from location.
$password
Definition: login.php:25
get_entities_from_private_setting_multi(array $name, $type="", $subtype="", $owner_guid=0, $order_by="", $limit=10, $offset=0, $count=false, $site_guid=0, $container_guid=null)
Get entities based on their private data by multiple keys.
remove_site_collection($site_guid, $collection_guid)
Remove a collection from a site.
elgg system_message
Wrapper function for system_messages.
Definition: elgglib.js:374
elgg_register_event_handler($event, $object_type, $callback, $priority=500)
Register a callback as an Elgg event handler.
Definition: elgglib.php:669
add_submenu_item($label, $link, $group= 'default', $onclick=false, $selected=NULL)
Deprecated by elgg_register_menu_item().
$builder
Definition: save.php:12
elgg_get_calling_plugin_entity()
Returns the ElggPlugin entity of the last plugin called.
Definition: plugins.php:789
add_menu($menu_name, $menu_url, $menu_children=array(), $context="")
Adds an item to the site-wide menu.
list_entities_in_area($lat, $long, $radius, $type="", $subtype="", $owner_guid=0, $limit=10, $fullview=true, $listtypetoggle=false, $navigation=true)
List items within a given geographic area.
elgg_unregister_page_handler($identifier)
Unregister a page handler for an identifier.
Definition: pagehandler.php:48
elgg_register_entity_url_handler($entity_type, $entity_subtype, $function_name)
Sets the URL handler for a particular entity type and subtype.
get_entities_by_relationship_count($relationship, $inverse_relationship=true, $type="", $subtype="", $owner_guid=0, $limit=10, $offset=0, $count=false, $site_guid=0)
Gets the number of entities by a the number of entities related to them in a particular way...
unregister_plugin_hook($hook, $entity_type, $callback)
Unregister a function to a plugin hook for a particular entity type.
remove_from_river_by_object($object_guid)
Removes all items relating to a particular entity being acted upon from the river.
friendly_time($time)
Displays a UNIX timestamp in a friendly way (eg "less than a minute ago")
$friends
Definition: add.php:10
elgg_list_entities_from_relationship(array $options=array())
Returns a viewable list of entities by relationship.
elgg_unset_plugin_user_setting($name, $user_guid=0, $plugin_id=null)
Unsets a user-specific plugin setting.
Definition: plugins.php:876
elgg_view_tree($view_root, $viewtype="")
Returns all views below a partial view.
$guids
get_data($query, $callback="")
Retrieve rows from the database.
Definition: database.php:50
elgg_delete_metadata(array $options)
Deletes metadata based on $options.
Definition: metadata.php:306
clear_annotations_by_owner($owner_guid)
Clear all annotations belonging to a given owner_guid.
elgg_get_plugins($status= 'active', $site_guid=null)
Returns an ordered list of plugins.
Definition: plugins.php:372
authenticate($username, $password)
Perform standard authentication with a given username and password.
get_entities_from_metadata_multi($meta_array, $entity_type="", $entity_subtype="", $owner_guid=0, $limit=10, $offset=0, $order_by="", $site_guid=0, $count=false, $meta_array_operator= 'and')
Return entities from metadata.
$count
Definition: tools.php:19
elgg_get_river(array $options=array())
Get river items.
Definition: river.php:286
default_page_handler($page, $handler)
A default page handler Tries to locate a suitable file to include.
elgg_get_version($human_readable=false)
Get the current Elgg version information.
Definition: elgglib.php:1126
elgg_unset_plugin_setting($name, $plugin_id=null)
Unsets a plugin setting.
Definition: plugins.php:979
get_annotation($annotation_id)
Get a specific annotation.
_elgg_set_plugin_priorities(array $order)
Reorder plugins to an order specified by the array.
Definition: plugins.php:435
elgg register_error
Wrapper function for system_messages.
Definition: elgglib.js:383
get_submenu()
Use elgg_view_menu().
remove_from_river_by_subject($subject_guid)
Removes all items relating to a particular acting entity from the river.
elgg_get_metadata(array $options=array())
Returns metadata.
Definition: metadata.php:282
reorder_widgets_from_panel($panelstring1, $panelstring2, $panelstring3, $context, $owner)
Reorders the widgets from a widget panel.
register_metadata_url_handler($function, $extender_name="all")
Register a metadata url handler.
$label
Elgg profile plugin edit default profile action.
Definition: add.php:7
clear_metadata($guid)
Clear all the metadata for a given entity, assuming you have access to that entity.
elgg_get_widget_types($context="", $exact=false)
Get the widget types for a context.
Definition: widgets.php:119
elgg_get_plugin_setting($name, $plugin_id=null, $default=null)
Get setting for a plugin.
Definition: plugins.php:954
register_page_handler($handler, $function)
Registers a page handler for a particular identifier.
getType()
Returns the entity type.
elgg_get_annotations(array $options=array())
Returns annotations.
elgg_get_entities_from_relationship_count(array $options=array())
Gets the number of entities by a the number of entities related to them in a particular way...
filter_string($string)
Filters a string into an array of significant words.
elgg_disable_simplecache()
Disables the simple cache.
Definition: cache.php:240
elgg_delete_river(array $options=array())
Delete river items.
Definition: river.php:168
is_installed()
register_plugin_hook($hook, $type, $callback, $priority=500)
Register a function to a plugin hook for a particular entity type, with a given priority.
elgg_is_active_plugin($plugin_id, $site_guid=null)
Returns if a plugin is active for a current site.
Definition: plugins.php:285
page_owner_entity()
Gets the owner entity for the current page.
register_extender_url_handler($function, $type="all", $name="all")
Sets the URL handler for a particular extender type and name.
remove_submenu_item($label, $group= 'a')
Remove an item from submenu by label.
set_plugin_usersetting($name, $value, $user_guid=0, $plugin_id="")
Set a user specific setting for a plugin.
elgg_get_friendly_title($title)
When given a title, returns a version suitable for inclusion in a URL.
Definition: output.php:348
$filename
Definition: crop.php:23
$row
elgg_view_page($title, $body, $page_shell= 'default', $vars=array())
Assembles and outputs a full page.
Definition: views.php:437
disable_plugin($plugin, $site_guid=0)
Disable a plugin for a site (default current site)
friendly_title($title)
When given a title, returns a version suitable for inclusion in a URL.
elgg_get_logged_in_user_entity()
Return the current logged in user, or null if no user is logged in.
Definition: sessions.php:32
elgg_get_plugins_path()
Get the plugin path for this installation.
add_page_owner_handler($functionname)
Registers a page owner handler function.
$menu
Definition: default.php:19
elgg_register_relationship_url_handler($relationship_type, $function_name)
Sets the URL handler for a particular relationship type.
get_default_access(ElggUser $user=null)
Gets the default access permission.
Definition: access.php:246
get_metadata_for_entity($entity_guid)
Return all the metadata for a given GUID.
$handler
Definition: add.php:10
elgg_enable_simplecache()
Enables the simple cache.
Definition: cache.php:225
elgg_get_entities_from_relationship($options)
Return entities matching a given query joining against a relationship.
elgg_register_action($action, $filename="", $access= 'logged_in')
Registers an action.
Definition: actions.php:85
elgg_deprecated_annotation_calculation($entity_guid=0, $entity_type="", $entity_subtype="", $name="", $value="", $value_type="", $owner_guid=0, $timelower=0, $timeupper=0, $calculation= '')
Helper function to deprecate annotation calculation functions.
$widgets
Definition: dashboard.php:10
elgg_register_entity_type($type, $subtype=null)
Registers an entity type and subtype as a public-facing entity that should be shown in search and by ...
Definition: entities.php:1675
get_installed_plugins($status= 'all')
Return an array of installed plugins.
$user_guid
Avatar remove action.
Definition: remove.php:6
$entity
Definition: delete.php:10
load_plugins()
Loads plugins.
trigger_elgg_event($event, $object_type, $object=null)
Alias function for events, that triggers a particular kind of event.
get_annotations_min($entity_guid, $entity_type="", $entity_subtype="", $name="", $value="", $value_type="", $owner_guid=0)
Return the minumum of a given integer annotation.
_elgg_get_access_where_sql(array $options=array())
Returns the SQL where clause for enforcing read access to data.
Definition: access.php:343
elgg_trigger_event($event, $object_type, $object=null)
Trigger an Elgg Event and attempt to run all handler callbacks registered to that event...
Definition: elgglib.php:720
$subtype
Definition: river.php:10
display_tagcloud($threshold=1, $limit=10, $metadata_name="", $entity_type="object", $entity_subtype="", $owner_guid="", $site_guid=-1, $start_ts="", $end_ts="")
Loads and displays a tagcloud given particular criteria.
clear_all_plugin_settings($plugin_id="")
Unsets all plugin settings for a plugin.
elgg_set_user_validation_status($user_guid, $status, $method= '')
Set the validation status for a user.
Definition: users.php:736
if(!$collection_name) $id
Definition: add.php:17
get_plugin_name($mainfilename=false)
Get the name of the most recent plugin to be called in the call stack (or the plugin that owns the cu...
pam_authenticate($credentials=NULL, $policy="user")
Attempt to authenticate.
delete_annotation($id)
Delete a given annotation.
$version
Definition: version.php:14
$path
Definition: invalid.php:17
elgg_get_page_owner_guid($guid=0)
Gets the guid of the entity that owns the current page.
Definition: pageowner.php:18
_elgg_cache_entity(ElggEntity $entity)
Cache an entity.
Definition: entities.php:101
isloggedin()
Returns whether or not the user is currently logged in.
$viewtype
Definition: start.php:132
retrieve_cached_entity($guid)
Retrieve a entity from the cache.
elgg_get_logged_in_user_guid()
Return the current logged in user by guid.
Definition: sessions.php:42
Elgg Object.
Definition: ElggObject.php:22
elgg_unregister_widget_type($handler)
Remove a widget type.
Definition: widgets.php:92
elgg_unregister_event_handler($event, $object_type, $callback)
Unregisters a callback for an event.
Definition: elgglib.php:683
$priority
check_plugin_compatibility($manifest_elgg_version_string)
This function checks a plugin manifest &#39;elgg_version&#39; value against the current install returning TRU...
_elgg_generate_plugin_entities()
Discovers plugins in the plugins_path setting and creates ElggPlugin entities for them if they don&#39;t ...
Definition: plugins.php:93
elgg_get_plugin_from_id($plugin_id)
Returns an ElggPlugin object with the path $path.
Definition: plugins.php:204
set_page_owner($entitytoset=-1)
Set a page owner entity.
get_entity($guid)
Loads and returns an entity object from a guid.
Definition: entities.php:604
$access
Definition: save.php:15
if(file_exists($welcome)) $vars
Definition: upgrade.php:93
$add
Admin area: edit default profile fields.