Stud.IP  trunk Revision
BaseWidget Class Reference
Inheritance diagram for BaseWidget:
Inheritance graph
Collaboration diagram for BaseWidget:
Collaboration graph

Public Member Functions

 suitableForRange (\Range $range, $scope=null)
 
 getContent (\Range $range, $scope)
 
 getActions (\Range $range, $scope)
 
 getConfigurationTemplate (Element $element, Response $response)
 
 saveConfiguration (Element $element, Response $response)
 
 getListTemplate (Element $element, Response $response)
 
 getRangeLabel (\FolderType $folder)
 
- Public Member Functions inherited from Widget
 suitableForRange (Range $range, $scope=null)
 
 connectWithElement (Element $element)
 
 getElement ()
 
 url_for ($to, $parameters=[])
 
 getTitle ()
 
 setOptions (array $options=[])
 
 getOptions ()
 
 hasLayout ()
 
 mayBeRemoved ()
 
 mayBeDuplicated ()
 
 getActions (Range $range, $scope)
 
 getTemplate ($name, array $variables=[])
 
- Public Member Functions inherited from SimpleORMap
 __construct ($id=null)
 
 __clone ()
 
 getRelationOptions ($relation)
 
 getTableMetadata ()
 
 hasAutoIncrementColumn ()
 
 setId ($id)
 
 getId ()
 
 getNewId ()
 
 toArray ($only_these_fields=null)
 
 toRawArray ($only_these_fields=null)
 
 toArrayRecursive ($only_these_fields=null)
 
 getValue ($field)
 
 getRelationValue ($relation, $field)
 
 getDefaultValue ($field)
 
 setValue ($field, $value)
 
 __get ($field)
 
 __set ($field, $value)
 
 __isset ($field)
 
 offsetExists ($offset)
 
 offsetGet ($offset)
 
 offsetSet ($offset, $value)
 
 offsetUnset ($offset)
 
 getIterator ()
 
 count ()
 
 isField ($field)
 
 isAdditionalField ($field)
 
 isAliasField ($field)
 
 isI18nField ($field)
 
 setData ($data, $reset=false)
 
 isNew ()
 
 isDeleted ()
 
 setNew ($is_new)
 
 getWhereQuery ()
 
 restore ()
 
 store ()
 
 triggerChdate ()
 
 delete ()
 
 isDirty ()
 
 isFieldDirty ($field)
 
 revertValue ($field)
 
 getPristineValue ($field)
 
 initRelation ($relation)
 
 resetRelation ($relation)
 
 cleanup ()
 
- Public Member Functions inherited from WidgetInterface
 getId ()
 
 getName ()
 
 getDescription ()
 
 getContent (Range $range, $scope)
 

Protected Member Functions

 getFilesAndFolders (\Range $range, $scope)
 
 createConfigurationAction ()
 
 hasConfiguration ()
 
 getVariables (\Range $range, $scope)
 
 getDefaultOptions ()
 
 getFilesController ()
 
- Protected Member Functions inherited from SimpleORMap
 _getId ($field)
 
 _setId ($field, $value)
 
 _getAdditionalValueFromRelation ($field)
 
 _setAdditionalValueFromRelation ($field, $value)
 
 _getAdditionalValue ($field)
 
 _setAdditionalValue ($field, $value)
 
 parseRelationOptions ($type, $name, $options)
 
 storeRelations ($only_these=null)
 
 deleteRelations ()
 
 initializeContent ()
 
 applyCallbacks ($type)
 
 registerCallback ($types, $cb)
 
 unregisterCallback ($types, $cb)
 
 cbAutoIncrementColumn ($type)
 
 cbAutoKeyCreation ()
 
 cbNotificationMapper ($cb_type)
 
 cbAfterInitialize ($cb_type)
 
 setSerializedValue ($field, $value)
 
 setI18nValue ($field, $value)
 
 cbI18N ($type)
 

Additional Inherited Members

- Static Public Member Functions inherited from Widget
static create ($id, Range $range_to_check=null)
 
static findAll ()
 
static registerWidget (Widget $widget)
 
static listForRange (Range $range, $scope=null)
 
- Static Public Member Functions inherited from SimpleORMap
static tableScheme ($db_table)
 
static expireTableScheme ()
 
static find ($id)
 
static exists ($id)
 
static countBySql ($sql=1, $params=[])
 
static create ($data)
 
static build ($data, $is_new=true)
 
static buildExisting ($data)
 
static import ($data)
 
static findBySQL ($sql, $params=[])
 
static findOneBySQL ($where, $params=[])
 
static findThru ($foreign_key_value, $options)
 
static findEachBySQL ($callable, $sql, $params=[])
 
static findMany ($pks=[], $order='', $order_params=[])
 
static findEachMany ($callable, $pks=[], $order='', $order_params=[])
 
static findAndMapBySQL ($callable, $where, $params=[])
 
static findAndMapMany ($callable, $pks=[], $order='', $order_params=[])
 
static deleteBySQL ($where, $params=[])
 
static toObject ($id_or_object)
 
static __callStatic ($name, $arguments)
 
- Data Fields inherited from Widget
const EXECUTION_BASE_URL = 'dispatch.php/widgets/execute'
 
- Data Fields inherited from SimpleORMap
const ID_SEPARATOR = '_'
 
- Static Public Attributes inherited from SimpleORMap
static $schemes = null
 
- Static Protected Member Functions inherited from Widget
static configure ($config=[])
 
- Static Protected Member Functions inherited from SimpleORMap
static configure ($config=[])
 
static config ($key)
 
- Protected Attributes inherited from SimpleORMap
 $content = []
 
 $content_db = []
 
 $is_new = true
 
 $is_deleted = false
 
 $db_table = ''
 
 $db_fields = null
 
 $pk = null
 
 $default_values = []
 
 $serialized_fields = []
 
 $alias_fields = []
 
 $i18n_fields = []
 
 $additional_fields = []
 
 $relations = []
 
 $has_many = []
 
 $has_one = []
 
 $belongs_to = []
 
 $has_and_belongs_to_many = []
 
 $registered_callbacks = []
 
 $known_slots = []
 
 $notification_map = []
 
 $additional_data = []
 
 $getter_setter_map = []
 
- Static Protected Attributes inherited from SimpleORMap
static $config = []
 
static $reserved_slots = ['value','newid','iterator','tablemetadata', 'relationvalue','wherequery','relationoptions','data','new','id']
 

Detailed Description

Base Widget of all files dashboard widgets.

GPL2 or any later version

Since
Stud.IP 4.1

Member Function Documentation

◆ createConfigurationAction()

createConfigurationAction ( )
protected

This method creates the config action if the widget has a configuration.

Returns
WidgetAction the created config action
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getActions()

getActions ( \Range  $range,
  $scope 
)

(PHPMD.UnusedFormalParameter)

{}

Here is the call graph for this function:

◆ getConfigurationTemplate()

getConfigurationTemplate ( Element  $element,
Response  $response 
)

If this widget has a config action, this method returns the the template to be shown.

Parameters
Element$elementthe widget element whose config action shall be shown
Response$responsea response object given to all widget actions
Returns
mixed Content of the response (might be a string or a flexi template)

(PHPMD.UnusedFormalParameter)

◆ getContent()

getContent ( \Range  $range,
  $scope 
)

{}

Here is the call graph for this function:

◆ getDefaultOptions()

getDefaultOptions ( )
protected

All widget have options. This method may be overridden to defines default option values.

See also
Widget::setOptions
Widget::getOptions
Returns
array an array of default option values
Here is the caller graph for this function:

◆ getFilesAndFolders()

getFilesAndFolders ( \Range  $range,
  $scope 
)
abstractprotected

Retrieve a list of files and their folders of a range to be displayed in the widget element. Similar to FileManager::getFolderFilesRecursive.

Parameters
Range$rangeThe range whose files and folders shall be retrieved
mixed$scopeOptional scope which was given to BaseWidget::getContent
Returns
mixed[] a mixed array containing instances of FolderType in 'folders' and instances of FileRef in 'files'
Here is the caller graph for this function:

◆ getFilesController()

getFilesController ( )
protected

This helper method creates a which is used by the templates of the basic and list view action.

See also
BaseWidget::getVariables
Returns
FilesController an instance of a FilesController
Here is the caller graph for this function:

◆ getListTemplate()

getListTemplate ( Element  $element,
Response  $response 
)

This method is the callback of the list action. It returns a list view of the results of calling self::getFilesAndFolders.

Parameters
Element$elementthe widget element whose list action is performing
Response$responsea response object given to all widget actions
Returns
mixed Content of the response (might be a string or a flexi template)

(PHPMD.Superglobals) (PHPMD.UnusedFormalParameter)

Here is the call graph for this function:

◆ getRangeLabel()

getRangeLabel ( \FolderType  $folder)

This method creates a string containing a 'title' of a folder.

Parameters
FolderType$folderthe folder a 'title' shall be created
Returns
return_type the 'title' of a folder

◆ getVariables()

getVariables ( \Range  $range,
  $scope 
)
protected

This method return all the variables used for the templates of the basic widget view and of the list view.

Parameters
Range$rangeThe range whose files and folders shall be retrieved
Returns
array an array of all the template variables
Here is the call graph for this function:
Here is the caller graph for this function:

◆ hasConfiguration()

hasConfiguration ( )
protected

If an element of a widget needs a configuration icon in its header bar, this method should return true.

Returns
bool return true if the widget needs a configuration page or false if it does not
Here is the caller graph for this function:

◆ saveConfiguration()

saveConfiguration ( Element  $element,
Response  $response 
)

If this widget has a config action, this method may store the configuration.

Parameters
Element$elementthe widget element whose config action was performed
Response$responsea response object given to all widget actions
Returns
mixed Content of the response (might be a string or a flexi template)

(PHPMD.UnusedFormalParameter)

Here is the call graph for this function:

◆ suitableForRange()

suitableForRange ( \Range  $range,
  $scope = null 
)

{}


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