An abstract class that every widget must extend. It contains the implementation of some of the common methods like widget creation, deletion, etc. Other methods must be defined by the derived class. widget.lib.php. More...
Public Member Functions | |
initWidget () | |
For widget initialization. | |
getHTML () | |
For retrieving the widget output. | |
getCommonHTML () | |
For retrieving the widget output which is common for all instances of same widget. | |
__construct ($widgetId, $widgetInstanceId, $pageId, $defaultconfigs) | |
loadWidget () | |
validInstall () | |
installWidget () | |
setConfigs ($configs) | |
saveSetting ($key, $value) | |
saveData ($key, $value) | |
createWidget ($pageId, &$widgetLocation, &$widgetOrder) | |
Data Fields | |
$widgetName | |
Name of the widget. | |
$widgetDescription | |
Description of the widget. | |
$widgetVersion | |
Version of the widget. | |
$widgetAuthor | |
Author of the widget. | |
$widgetId | |
Id of the widget. | |
$widgetInstanceId | |
Instance Id of the widget. | |
$widgetPageId | |
Page Id of the page this instance is located on. | |
$widgetLocation | |
Location of the widget on the page. | |
$widgetOrder | |
Order of the widget, in case when multiple widgets are on the same location. | |
$settings | |
Instance-Specific Settings of the widget in key=>value format. | |
$data | |
A sort of RAM or heap store for the widget in key=>value format. | |
$defaultConfigs | |
Default configurations of the widget. |
An abstract class that every widget must extend. It contains the implementation of some of the common methods like widget creation, deletion, etc. Other methods must be defined by the derived class. widget.lib.php.
Definition at line 17 of file widgetFramework.class.php.
__construct | ( | $ | widgetId, | |
$ | widgetInstanceId, | |||
$ | pageId, | |||
$ | defaultconfigs | |||
) |
Constructor.
$widgetId | Widget ID of the widget | |
$widgetName | Widget Name of the widget |
Definition at line 50 of file widgetFramework.class.php.
createWidget | ( | $ | pageId, | |
&$ | widgetLocation, | |||
&$ | widgetOrder | |||
) | [final] |
Creates an instance of the widget on the given page Id by adding the appropriate fields in the database. Default configuration will be used initially.
$pageID | Page Id of the page on which to create the widget | |
$widgetLocation | Location ID of the widget on the page | |
$widgetOrder | Order of the widget on a location, when multiple widgets are there |
Default location for the creation of the widget
Definition at line 262 of file widgetFramework.class.php.
getCommonHTML | ( | ) | [abstract] |
For retrieving the widget output which is common for all instances of same widget.
Reimplemented in count_down, facebook, serverDateTime, and slider.
getHTML | ( | ) | [abstract] |
For retrieving the widget output.
Reimplemented in count_down, facebook, serverDateTime, and slider.
initWidget | ( | ) | [abstract] |
For widget initialization.
Reimplemented in count_down, facebook, serverDateTime, and slider.
installWidget | ( | ) |
Installs the widget properly by storing its configuration in the configsinfo table and updating the install flag in data.
If some configuration fields are already there in table, we remove them.
Definition at line 165 of file widgetFramework.class.php.
loadWidget | ( | ) | [final] |
Loads the widget information, settings and data from the database if the widget already exists.
$widgetInstanceId | widget instance id of the existing widget | |
$pageId | page Id of the page in which widget exists |
Loading widget information
Loading configuration settings (both instance-specific and global)
If configurations doesn't exists, then loading default values.
Only add to database if the current instance type and the configuration type matches i.e. global or instance-specific.
Loading data settigns
Definition at line 67 of file widgetFramework.class.php.
saveData | ( | $ | key, | |
$ | value | |||
) | [final] |
Saves a particular widget data in the database.
$key | The data name which is to be saved. | |
$value | The data value. |
Definition at line 235 of file widgetFramework.class.php.
saveSetting | ( | $ | key, | |
$ | value | |||
) | [final] |
Saves a particular widget configuration in the database.
$key | The setting name which is to be saved. | |
$value | The value of the setting. |
Definition at line 214 of file widgetFramework.class.php.
setConfigs | ( | $ | configs | ) | [final] |
Sets the widget settings by creating the settings in the database. Only needed during installation.
$configs | Configuration for the widget. |
Definition at line 187 of file widgetFramework.class.php.
validInstall | ( | ) |
Checks whether the widget has been installed properly. It checks the install flag in data. If its 0, it assumes the widget needs installation.
Definition at line 154 of file widgetFramework.class.php.
$data |
A sort of RAM or heap store for the widget in key=>value format.
Definition at line 30 of file widgetFramework.class.php.
$defaultConfigs |
Default configurations of the widget.
Definition at line 31 of file widgetFramework.class.php.
$settings |
Instance-Specific Settings of the widget in key=>value format.
Definition at line 29 of file widgetFramework.class.php.
$widgetAuthor |
Author of the widget.
Definition at line 23 of file widgetFramework.class.php.
$widgetDescription |
Description of the widget.
Definition at line 21 of file widgetFramework.class.php.
$widgetId |
Id of the widget.
Definition at line 24 of file widgetFramework.class.php.
$widgetInstanceId |
Instance Id of the widget.
Definition at line 25 of file widgetFramework.class.php.
$widgetLocation |
Location of the widget on the page.
Definition at line 27 of file widgetFramework.class.php.
$widgetName |
Name of the widget.
Definition at line 20 of file widgetFramework.class.php.
$widgetOrder |
Order of the widget, in case when multiple widgets are on the same location.
Definition at line 28 of file widgetFramework.class.php.
$widgetPageId |
Page Id of the page this instance is located on.
Definition at line 26 of file widgetFramework.class.php.
$widgetVersion |
Version of the widget.
Definition at line 22 of file widgetFramework.class.php.