CSPortalWidget
extends CSPortalObject
in package
Represents a Widget Model in the CS Portal
This class only refers to the modal part of the widget, how it is stored to the database. If you are looking for information about building a widget probably the view part is more relevant. The view is implemented by the [@see CSWidget} plugin interface.
If the representing CSWidget object is required it can be recieved using the loadPlugin method
Tags
Table of Contents
- SHARING_TYPE_INSERTABLE = 2
- SHARING_TYPE_NONE = 0
- SHARING_TYPE_VISIBLE = 1
- SHARING_TYPE_VISIBLE_AND_INSERTABLE = 3
- $sharingFilterType : mixed
- __construct() : CSPortalObject
- Construct CSPortalObject instance.
- applySharingToSubElements() : void
- Transpose sharing to Object's children
- copyToOwner() : CSPortalWidget
- Enter description here .
- delete() : void
- Deletes the Widget from the Portal
- getAbsoluteUwaUrl() : string
- Get absolute UWA URL
- getCol() : int
- Get Column number of Widget in Tab
- getColor() : string
- Get Widget title bar color in CSS Syntax, e.g. '#FFCCDD' or 'rgb(255, 155, 55)'
- getCONTENTSERVUwaPath() : string
- Enter description here.
- getCreationDate() : string
- Get creation date of object
- getCreator() : string
- Get the user name of the Object's creator
- getHeight() : int
- Get Widget height
- getID() : int
- Retrieve Record ID of current Object
- getLastHeight() : int
- Get height of Widget as it was last time it was used
- getMetaDescription() : string
- Get meta description of current Object
- getMetaKeywords() : string
- Get the meta keywords for current Object
- getModuleForTranslation() : string
- Returns a module name for which the translation should be retrieved Default: "portal"
- getName() : string
- Get UWA file name of Widget
- getOwnerID() : int
- Get UserID of current Owner
- getPortalTabID() : int
- Get ID of parent Tab
- getProvider() : string
- Get UWA Widget Provider
- getRubrics() : array<string|int, mixed>
- Get the rubrics set for current Object
- getSharingType() : int
- Check if current Object is shared
- getSortOrder() : int
- Get sort order of Widget
- getTab() : CSPortalTab
- Get parent Tab of Widget
- getTitle() : string
- Get the title of the Object
- getUsage() : array<string|int, mixed>
- Get usage information of Widget
- getUwaUrl() : string
- Get UWA URL of Widget relative to admin folder
- getUWAWidget() : mixed
- Retrieve Netvibes Widget (UWA Widget) using the Netvibes API
- getWidgetsByRank() : array<string|int, mixed>
- Retrieve Widgets by rank
- getWidgetsBySearch() : array<string|int, mixed>
- Search Widget with an SQL statement
- isCSWidget() : bool
- Check if Object is indeed a Widget
- loadPlugin() : CSWidget
- Instantiates a CSWidgets plugin for the current widget to be able to use it in the current context The Plugin is loaded and registered as current instance in the CSWidget::getInstance() method If another plugin with a different ID had been registered before the method returns false
- setCol() : void
- Set column of Widget in Tab
- setColor() : void
- Set Widget title bar color in CSS Syntax, e.g. '#FFCCDD' or 'rgb(255, 155, 55)'
- setHeight() : void
- Set the height of Widget
- setID() : void
- Set the ID of the Object
- setLastHeight() : void
- Set last used height of Widget
- setMaxHeight() : void
- Set maximum height of Widget
- setMetaDescription() : void
- Set the meta description of current Object
- setMetaKeywords() : void
- Set meta keywords describing current Object
- setMinHeight() : void
- Set the minimum height of Widget
- setOwnerID() : void
- Sets the OnwerID of the object
- setParentID() : void
- Move Object to another parent Object.
- setPortalTabID() : void
- Move Widget to another Tab by stating the Tab ID
- setProvider() : void
- Set Widget Provider
- setRubrics() : mixed
- Set the Rubrics for current Object with ID list of ItemRubric Records
- setSharingType() : void
- Set object sharing
- setSortOrder() : void
- Set sort order of Widget, i.e. move position of Widget in column
- setTitle() : void
- Set the title of the Object
- setUwaUrl() : void
- Set the UWA URL of Widget
- store() : void
- Store current object to database
Constants
SHARING_TYPE_INSERTABLE
public
mixed
SHARING_TYPE_INSERTABLE
= 2
Tags
SHARING_TYPE_NONE
public
mixed
SHARING_TYPE_NONE
= 0
Tags
SHARING_TYPE_VISIBLE
public
mixed
SHARING_TYPE_VISIBLE
= 1
Tags
SHARING_TYPE_VISIBLE_AND_INSERTABLE
public
mixed
SHARING_TYPE_VISIBLE_AND_INSERTABLE
= 3
Tags
Properties
$sharingFilterType
public
static mixed
$sharingFilterType
= self::SHARING_TYPE_INSERTABLE
Tags
Methods
__construct()
Construct CSPortalObject instance.
public
__construct() : CSPortalObject
If this method is extended ensure that the object variable $this->record is set correctly.
Tags
Return values
CSPortalObject —applySharingToSubElements()
Transpose sharing to Object's children
public
final applySharingToSubElements([bool $makeAllElementsVisible = true ][, bool $applySharedWith = true ]) : void
Parameters
- $makeAllElementsVisible : bool = true
-
inherit visibility to child Objects
- $applySharedWith : bool = true
-
set access levels on children as well
Tags
Return values
void —copyToOwner()
Enter description here .
public
copyToOwner([int $OwnerID = null ][, int $newTabID = null ][, int $newColID = null ]) : CSPortalWidget
..
Parameters
- $OwnerID : int = null
- $newTabID : int = null
- $newColID : int = null
Tags
Return values
CSPortalWidget —delete()
Deletes the Widget from the Portal
public
delete() : void
Tags
Return values
void —getAbsoluteUwaUrl()
Get absolute UWA URL
public
getAbsoluteUwaUrl() : string
Tags
Return values
string —the absolute uwa url of the widget
getCol()
Get Column number of Widget in Tab
public
getCol() : int
Tags
Return values
int —the col number of the widget in the tab starting from 0
getColor()
Get Widget title bar color in CSS Syntax, e.g. '#FFCCDD' or 'rgb(255, 155, 55)'
public
getColor() : string
Tags
Return values
string —the rgb color string of the widget title bar
getCONTENTSERVUwaPath()
Enter description here.
public
static getCONTENTSERVUwaPath(string $widgetPath) : string
..
Parameters
- $widgetPath : string
Tags
Return values
string —getCreationDate()
Get creation date of object
public
final getCreationDate() : string
Tags
Return values
string —the date when the object was created
getCreator()
Get the user name of the Object's creator
public
final getCreator() : string
Tags
Return values
string —the user name of the creator of the object
getHeight()
Get Widget height
public
getHeight() : int
Tags
Return values
int —the height of the widget in pixels
getID()
Retrieve Record ID of current Object
public
final getID() : int
Tags
Return values
int —the id of the object
getLastHeight()
Get height of Widget as it was last time it was used
public
getLastHeight() : int
Tags
Return values
int —the height of the widget the last time it was used in Pixels
getMetaDescription()
Get meta description of current Object
public
final getMetaDescription() : string
Tags
Return values
string —the meta description of the object
getMetaKeywords()
Get the meta keywords for current Object
public
final getMetaKeywords() : string
Tags
Return values
string —the meta keywords of the object
getModuleForTranslation()
Returns a module name for which the translation should be retrieved Default: "portal"
public
final getModuleForTranslation() : string
Tags
Return values
string —getName()
Get UWA file name of Widget
public
getName() : string
Tags
Return values
string —getOwnerID()
Get UserID of current Owner
public
final getOwnerID() : int
Tags
Return values
int —the ID of the current Owner
getPortalTabID()
Get ID of parent Tab
public
getPortalTabID() : int
Tags
Return values
int —the TabID of the tab the widget is located in
getProvider()
Get UWA Widget Provider
public
getProvider() : string
Tags
Return values
string —the name of the provider company that implemented the source of the widget
getRubrics()
Get the rubrics set for current Object
public
final getRubrics() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —the rubricIDS of the object
getSharingType()
Check if current Object is shared
public
final getSharingType() : int
Sharing types are:
- SHARING_TYPE_NONE (not shared) = 0
- SHARING_TYPE_VISIBLE (visible for others) = 1
- SHARING_TYPE_INSERTABLE (can be inserted in other portals) = 2
- SHARING_TYPE_VISIBLE_AND_INSERTABLE (visible to others and can be inserted) = 3
Tags
Return values
int —sharing type
getSortOrder()
Get sort order of Widget
public
getSortOrder() : int
Tags
Return values
int —the sort order of the widget within its tab column
getTab()
Get parent Tab of Widget
public
getTab() : CSPortalTab
Tags
Return values
CSPortalTab —the tab of the widget
getTitle()
Get the title of the Object
public
final getTitle([bool $translated = false ]) : string
Parameters
- $translated : bool = false
Tags
Return values
string —The title of the object
getUsage()
Get usage information of Widget
public
static getUsage(string $UwaUrl) : array<string|int, mixed>
Parameters
- $UwaUrl : string
Tags
Return values
array<string|int, mixed> —getUwaUrl()
Get UWA URL of Widget relative to admin folder
public
getUwaUrl([bool $relative = true ]) : string
Parameters
- $relative : bool = true
-
if true the url is provided relative to the admin folder
Tags
Return values
string —the uwa url of the widget
getUWAWidget()
Retrieve Netvibes Widget (UWA Widget) using the Netvibes API
public
getUWAWidget([bool $cached = true ]) : mixed
Parameters
- $cached : bool = true
Tags
Return values
mixed —getWidgetsByRank()
Retrieve Widgets by rank
public
static getWidgetsByRank([string $filterProvider = null ]) : array<string|int, mixed>
Parameters
- $filterProvider : string = null
-
name of single provider
Tags
Return values
array<string|int, mixed> —list of UWA URLs
getWidgetsBySearch()
Search Widget with an SQL statement
public
final getWidgetsBySearch(string $query[, mixed $asTemplate = false ]) : array<string|int, mixed>
Returns a proprietary array of information on the found Widgets containing the following keys:
- Title (display name of Widget)
- Path (plugin directory of Widget)
- File (Widget main file)
- UwaPath (relative UWA URL to Widget)
- Icon (path to icon file for Widget)
Parameters
- $query : string
-
SQL statement
- $asTemplate : mixed = false
Tags
Return values
array<string|int, mixed> —list of found Widgets
isCSWidget()
Check if Object is indeed a Widget
public
isCSWidget() : bool
Tags
Return values
bool —loadPlugin()
Instantiates a CSWidgets plugin for the current widget to be able to use it in the current context The Plugin is loaded and registered as current instance in the CSWidget::getInstance() method If another plugin with a different ID had been registered before the method returns false
public
loadPlugin() : CSWidget
Tags
Return values
CSWidget —the current widget instance or false, if any error had been occured
setCol()
Set column of Widget in Tab
public
setCol(int $col) : void
Parameters
- $col : int
-
the number of the column in the tab (starting from 0 = leftmost)
Tags
Return values
void —setColor()
Set Widget title bar color in CSS Syntax, e.g. '#FFCCDD' or 'rgb(255, 155, 55)'
public
setColor(string $color) : void
Parameters
- $color : string
-
the color as RGB Value that should be used for the widget title bar
Tags
Return values
void —setHeight()
Set the height of Widget
public
setHeight(int $height) : void
Parameters
- $height : int
-
the height in pixel, percent or auto or fullheight
Tags
Return values
void —setID()
Set the ID of the Object
public
final setID(int $ID) : void
Parameters
- $ID : int
-
the ID of the object
Tags
Return values
void —setLastHeight()
Set last used height of Widget
public
setLastHeight(int $height) : void
Parameters
- $height : int
-
the last height in pixel
Tags
Return values
void —setMaxHeight()
Set maximum height of Widget
public
setMaxHeight(int $height) : void
Parameters
- $height : int
-
the maximum height in pixel, percent or auto or fullheight
Tags
Return values
void —setMetaDescription()
Set the meta description of current Object
public
final setMetaDescription(string $description) : void
Parameters
- $description : string
-
sets the description for the object
Tags
Return values
void —setMetaKeywords()
Set meta keywords describing current Object
public
final setMetaKeywords(string $keywords) : void
Parameters
- $keywords : string
-
sets a string with blank separated keywords for the object
Tags
Return values
void —setMinHeight()
Set the minimum height of Widget
public
setMinHeight(int $height) : void
Parameters
- $height : int
-
the minimum height in pixel, percent or auto or fullheight
Tags
Return values
void —setOwnerID()
Sets the OnwerID of the object
public
final setOwnerID(int $OwnerID) : void
Parameters
- $OwnerID : int
-
the id of the new Owner
Tags
Return values
void —setParentID()
Move Object to another parent Object.
public
final setParentID(int $ID) : void
E.g. by moving a widget to a different Tab or Portal
Parameters
- $ID : int
-
the ID of the parent object
Tags
Return values
void —setPortalTabID()
Move Widget to another Tab by stating the Tab ID
public
setPortalTabID(int $portalTabID) : void
Parameters
- $portalTabID : int
-
sets the TabID of the tab the widget should be located in
Tags
Return values
void —setProvider()
Set Widget Provider
public
setProvider(string $provider) : void
Parameters
- $provider : string
-
the name of the provider company that implemented the source of the widget
Tags
Return values
void —setRubrics()
Set the Rubrics for current Object with ID list of ItemRubric Records
public
final setRubrics(array<string|int, mixed> $rubricIDs) : mixed
Parameters
- $rubricIDs : array<string|int, mixed>
-
the new rubricIDS of the object
Tags
Return values
mixed —setSharingType()
Set object sharing
public
final setSharingType(int $sharingType) : void
Sharing types are:
- SHARING_TYPE_NONE (not shared) = 0
- SHARING_TYPE_VISIBLE (visible for others) = 1
- SHARING_TYPE_INSERTABLE (can be inserted in other portals) = 2
- SHARING_TYPE_VISIBLE_AND_INSERTABLE (visible to others and can be inserted) = 3
Parameters
- $sharingType : int
-
the CSPortal SHARING_TYPE constants
Tags
Return values
void —setSortOrder()
Set sort order of Widget, i.e. move position of Widget in column
public
setSortOrder(int $sortOrder) : void
Parameters
- $sortOrder : int
-
the sort order of the widget within its tab column
Tags
Return values
void —setTitle()
Set the title of the Object
public
final setTitle(string $title) : void
Parameters
- $title : string
-
the title of the object
Tags
Return values
void —setUwaUrl()
Set the UWA URL of Widget
public
setUwaUrl(string $url) : void
Parameters
- $url : string
-
the UwaUrl used when creating the widget
Tags
Return values
void —store()
Store current object to database
public
final store() : void
Stores the object to the database layer
