Stud.IP  5.4
WidgetHelper Class Reference

Static Public Member Functions

static setActiveWidget ($activeWidget)
 
static getWidgetPosition ($pluginid)
 
static storeNewPositions (array $lanes)
 
static addInitialPositions ($col, $ids, $range_id)
 
static storeInitialPositions ($col, $ids, $perm)
 
static getInitialPositions ($perm)
 
static setAsInitialPositions ($range_id, $group)
 
static setInitialPositions ()
 
static getUserWidgets ($id, $col=0)
 
static hasUserWidgets ($user_id)
 
static addWidgetUserConfig ($id, $pluginName, $confArray)
 
static getWidgetUserConfig ($id, $pluginName)
 
static removeWidget ($id, $pluginName, $range_id)
 
static addWidget ($id, $range_id)
 
static getWidgetName ($id)
 
static getWidget ($pluginid)
 
static getAvailableWidgets ($user_id=null)
 
static hasWidget ($user_id, $widget)
 

Member Function Documentation

◆ addInitialPositions()

static addInitialPositions (   $col,
  $ids,
  $range_id 
)
static

addInitialPositons - adds the global widget default settings to an user setting

Parameters
string$col
array$idsof widgets
string$range_id
Returns
void

◆ addWidget()

static addWidget (   $id,
  $range_id 
)
static

addWidget - adds a widget for a given user

Parameters
string$id- widget_id
string$range_ide.g. user_id
Returns
bool|int false on error, id of inserted widget otherwise

◆ addWidgetUserConfig()

static addWidgetUserConfig (   $id,
  $pluginName,
  $confArray 
)
static

addWidgetUserConfig - creates user_config entry for widget newly added by a user

Parameters
string$id- user_id
string$pluginName
array$confArray
Returns
void

◆ getAvailableWidgets()

static getAvailableWidgets (   $user_id = null)
static

getAvailableWidgets - fetches all widgets that are not already in use.

Parameters
string$user_idthe user to check
Returns
array All available widgets.

◆ getInitialPositions()

static getInitialPositions (   $perm)
static

◆ getUserWidgets()

static getUserWidgets (   $id,
  $col = 0 
)
static

getUserWidgets - retrieves the widget settings for a given user

Parameters
string$id
Returns
array $widgets

◆ getWidget()

static getWidget (   $pluginid)
static

getWidget - retrieves an instance of a given widget / portal plugin

Parameters
string$pluginid
Returns
object widget

◆ getWidgetName()

static getWidgetName (   $id)
static

getWidgetName - retrieves the name of a given widget

Parameters
string$id- widget_id
Returns
string widget_name

◆ getWidgetPosition()

static getWidgetPosition (   $pluginid)
static

Returns the position in the two column layout on the Startpage If no position is stored in UserConfig, the widget will be displayed on the right side.

Parameters
string$pluginid
Returns
the position as array matrix

◆ getWidgetUserConfig()

static getWidgetUserConfig (   $id,
  $pluginName 
)
static

getWidgetUserConfig - retrieves user_config entry for widget newly added by a user

Parameters
string$iduser_id
string$pluginName
Returns
object UserConfig

◆ hasUserWidgets()

static hasUserWidgets (   $user_id)
static

Returns whether a user has any defined widgets.

Parameters
string$user_idUser id
Returns
boolean

◆ hasWidget()

static hasWidget (   $user_id,
  $widget 
)
static

hasWidget - returns whether has a certain widget activated

Parameters
string$user_idId of the user
mixed$widgetId or name of the widget (you may omit the 'Widget' in the name)
Returns
bool indicating whether the widget is activated

◆ removeWidget()

static removeWidget (   $id,
  $pluginName,
  $range_id 
)
static

removeWidget - removes a widget for a user

Parameters
string$id- widget_id
string$pluginName
string$range_ide.g. user_id
Returns
bool success

◆ setActiveWidget()

static setActiveWidget (   $activeWidget)
static

Set the last active Widget

Parameters
string$activeWidget

◆ setAsInitialPositions()

static setAsInitialPositions (   $range_id,
  $group 
)
static

Sets the current setting of a user as the default for a usergroup

Parameters
string$range_idThe range id of the user that defines the setting
string$groupThe usergroup

◆ setInitialPositions()

static setInitialPositions ( )
static

setInitialPositions - copies the default to the logged on user

◆ storeInitialPositions()

static storeInitialPositions (   $col,
  $ids,
  $perm 
)
static

storeInitialPositions - stores the global widget default for a given perm

Parameters
string$col
array$idsof widgets
string$perm
Returns
boolean success

◆ storeNewPositions()

static storeNewPositions ( array  $lanes)
static

storeNewPositions - stores new Widget positions for a given user

Parameters
array$lanesarray with column as index and ids array as value
Returns
void

The documentation for this class was generated from the following file: