24 parent::initializeAttributes();
26 $this->attributes[
'subtype'] =
"widget";
37 if (array_key_exists(
$name, $this->attributes)) {
38 return $this->attributes[
$name];
72 if (array_key_exists(
$name, $this->attributes)) {
74 if ((array_key_exists(
'guid', $this->attributes)) && (
$name ==
'guid')) {
145 'subtype' =>
'widget',
148 'private_setting_name_value_pairs' => array(
149 array(
'name' =>
'context',
'value' => $this->
getContext()),
150 array(
'name' =>
'column',
'value' =>
$column)
160 usort(
$widgets, create_function(
'$a,$b',
'return (int)$a->order > (int)$b->order;'));
164 $inactive_widgets = array();
173 if (
$column == $this->column) {
179 $this->order = reset(
$widgets)->order - 10;
180 } elseif ($rank == $bottom_rank) {
182 $this->order = end(
$widgets)->order + 10;
188 if (
$widget->guid == $this->guid) {
194 $before = array_slice(
$widgets, 0, $rank);
195 array_push($before, $this);
196 $after = array_slice(
$widgets, $rank);
197 $widgets = array_merge($before, $after);
201 $widget->order = $order;
207 if ($inactive_widgets) {
210 if ($widget->order > $bottom) {
211 $bottom = $widget->order;
215 foreach ($inactive_widgets as $widget) {
216 $widget->order = $bottom;
246 $hook_params = array(
if($guid==elgg_get_logged_in_user_guid()) $name
setPrivateSetting($name, $value)
Adds a private setting to this entity.
getPrivateSetting($name)
Returns a private setting value.
elgg_get_entities_from_private_settings(array $options=array())
Returns entities based upon private settings.
canEdit($user_guid=0)
Can a user edit this entity?
elgg_trigger_plugin_hook($hook, $type, $params=null, $returnvalue=null)
Trigger a Plugin Hook and run all handler callbacks registered to that hook:type. ...
elgg_deprecated_notice($msg, $dep_version, $backtrace_level=1)
Sends a notice about deprecated use of a function, view, etc.