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')) {
110 if (array_key_exists(
$name, $this->attributes)) {
111 parent::__unset(
$name);
130 if (array_key_exists(
$name, $this->attributes)) {
131 return parent::__isset(
$name);
134 return !is_null($private_setting);
185 'subtype' =>
'widget',
188 'private_setting_name_value_pairs' => array(
189 array(
'name' =>
'context',
'value' => $this->
getContext()),
190 array(
'name' =>
'column',
'value' =>
$column)
200 usort(
$widgets,
function($a, $b) {
return (
int) $a->order > (
int) $b->order;});
204 'context' => $this->context,
207 $inactive_widgets = array();
209 if (!array_key_exists(
$widget->handler, $widget_types)) {
216 if (
$column == $this->column) {
222 $this->order = reset(
$widgets)->order - 10;
223 } elseif ($rank == $bottom_rank) {
225 $this->order = end(
$widgets)->order + 10;
231 if (
$widget->guid == $this->guid) {
237 $before = array_slice(
$widgets, 0, $rank);
238 array_push($before, $this);
239 $after = array_slice(
$widgets, $rank);
240 $widgets = array_merge($before, $after);
244 $widget->order = $order;
250 if ($inactive_widgets) {
253 if ($widget->order > $bottom) {
254 $bottom = $widget->order;
258 foreach ($inactive_widgets as $widget) {
259 $widget->order = $bottom;
289 $hook_params = array(
293 if (
_elgg_services()->hooks->trigger(
'widget_settings', $this->handler, $hook_params,
false) ==
true) {
if($guid==elgg_get_logged_in_user_guid()) $name
removePrivateSetting($name)
Removes private setting.
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_deprecated_notice($msg, $dep_version, $backtrace_level=1)
Log a notice about deprecated use of a function, view, etc.
_elgg_services(\Elgg\Di\ServiceProvider $services=null)
Get the global service provider.
getContainerEntity()
Get the container entity for this object.