25 private $widgetCache = array();
33 $widget_cache_key =
"$context-$owner_guid";
35 if (isset($this->widgetCache[$widget_cache_key])) {
36 return $this->widgetCache[$widget_cache_key];
41 'subtype' =>
'widget',
43 'private_setting_name' =>
'context',
52 $sorted_widgets = array();
54 if (!isset($sorted_widgets[(
int)
$widget->column])) {
55 $sorted_widgets[(int)
$widget->column] = array();
60 foreach ($sorted_widgets as $col => $widgets) {
61 ksort($sorted_widgets[$col]);
64 $this->widgetCache[$widget_cache_key] = $sorted_widgets;
66 return $sorted_widgets;
87 if (isset($access_id)) {
88 $widget->access_id = $access_id;
141 if (!isset($this->widgets)) {
142 $this->widgets =
new stdClass;
144 if (!isset($this->widgets->handlers)) {
145 $this->widgets->handlers = array();
148 $handlerobj =
new stdClass;
149 $handlerobj->name =
$name;
152 $handlerobj->multiple = $multiple;
154 $this->widgets->handlers[
$handler] = $handlerobj;
167 if (!isset($this->widgets)) {
171 if (!isset($this->widgets->handlers)) {
175 if (isset($this->widgets->handlers[
$handler])) {
176 unset($this->widgets->handlers[
$handler]);
188 if (!empty($this->widgets) &&
189 !empty($this->widgets->handlers) &&
190 is_array($this->widgets->handlers) &&
191 array_key_exists(
$handler, $this->widgets->handlers)) {
204 if (empty($this->widgets) ||
205 empty($this->widgets->handlers) ||
206 !is_array($this->widgets->handlers)) {
212 foreach ($this->widgets->handlers as
$key =>
$handler) {
224 if (isset($this->widgets->handlers[
$handler])) {
225 return $this->widgets->handlers[
$handler]->name;
236 if (empty($this->widgets) ||
237 empty($this->widgets->handlers) ||
238 !is_array($this->widgets->handlers)) {
248 foreach ($this->widgets->handlers as
$key =>
$handler) {
if($guid==elgg_get_logged_in_user_guid()) $name
$user_guid
Avatar remove action.
elgg_trigger_plugin_hook($hook, $type, $params=null, $returnvalue=null)
Trigger a Plugin Hook and run all handler callbacks registered to that hook:type.
get_default_access(ElggUser $user=null)
Gets the default access permission.
get_entity($guid)
Loads and returns an entity object from a guid.
elgg_get_page_owner_entity()
Gets the owner entity for the current page.
elgg_get_context()
Get the current context.
elgg_get_page_owner_guid($guid=0)
Gets the guid of the entity that owns the current page.
if($screenshots) $description
elgg_get_entities_from_private_settings(array $options=array())
Returns entities based upon private settings.
elgg_is_admin_logged_in()
Returns whether or not the viewer is currently logged in and an admin user.
elgg_get_logged_in_user_entity()
Return the current logged in user, or null if no user is logged in.