Overview

Packages

  • application
    • commands
    • components
      • actions
      • filters
      • leftWidget
      • permissions
      • sortableWidget
      • util
      • webupdater
      • x2flow
        • actions
        • triggers
      • X2GridView
      • X2Settings
    • controllers
    • models
      • embedded
    • modules
      • accounts
        • controllers
        • models
      • actions
        • controllers
        • models
      • calendar
        • controllers
        • models
      • charts
        • models
      • contacts
        • controllers
        • models
      • docs
        • components
        • controllers
        • models
      • groups
        • controllers
        • models
      • marketing
        • components
        • controllers
        • models
      • media
        • controllers
        • models
      • mobile
        • components
      • opportunities
        • controllers
        • models
      • products
        • controllers
        • models
      • quotes
        • controllers
        • models
      • services
        • controllers
        • models
      • template
        • models
      • users
        • controllers
        • models
      • workflow
        • controllers
        • models
      • x2Leads
        • controllers
        • models
  • None
  • system
    • base
    • caching
    • console
    • db
      • ar
      • schema
    • validators
    • web
      • actions
      • auth
      • helpers
      • widgets
        • captcha
        • pagers
  • zii
    • widgets
      • grid

Classes

  • ActionsWidget
  • CallsWidget
  • ChartWidget
  • CommentsWidget
  • EmailsWidget
  • EventsWidget
  • InlineRelationshipsWidget
  • InlineTagsWidget
  • LoggedTimeWidget
  • PublisherWidget
  • QuotesWidget
  • SortableWidget
  • TransactionalViewWidget
  • TwitterFeedWidget
  • WebActivityWidget
  • WorkflowStageDetailsWidget
  • Overview
  • Package
  • Class
  • Tree

Class SortableWidget

Base widget class for all of the profile widgets

CComponent
Extended by CBaseController
Extended by CWidget
Extended by X2Widget
Extended by SortableWidget

Direct known subclasses

ChartWidget, DocViewerProfileWidget, GridViewWidget, IframeWidget, InlineTagsWidget, PublisherWidget, TwitterFeedWidget, WorkflowStageDetailsWidget

Indirect known subclasses

AccountsGridViewProfileWidget, ActionsGridViewProfileWidget, InlineRelationshipsWidget, LoggedTimeWidget, MarketingGridViewProfileWidget, NewWebLeadsGridViewProfileWidget, OpportunitiesGridViewProfileWidget, ProfileGridViewWidget, ProfilesGridViewProfileWidget, QuotesGridViewProfileWidget, QuotesWidget, ServicesGridViewProfileWidget, ActionsWidget, TemplatesGridViewProfileWidget, TransactionalViewWidget, UsersChartProfileWidget, WebActivityWidget, X2LeadsGridViewProfileWidget, CallsWidget, CommentsWidget, ContactsGridViewProfileWidget, DocsGridViewProfileWidget, EmailsWidget, EventsChartProfileWidget, EventsWidget
Abstract
Package: application\components\sortableWidget
Located at x2engine/protected/components/sortableWidget/SortableWidget.php
Methods summary
public static
# getParentType( mixed $widgetType )

Used for situations where widget type should resolve to parent type (e.g for module-specific record view layouts)

Used for situations where widget type should resolve to parent type (e.g for module-specific record view layouts)

public static
# getPathAlias( string $widgetType )

Returns path alias of directory that contains widgets of the specified type

Returns path alias of directory that contains widgets of the specified type

Parameters

$widgetType
string
$widgetType
public static string
# getWidgetSubtypes( mixed $widgetType )

Returns

string
array of instantiatable widget class names

Throws

CException

Var

string $widgetType
public static
# subtypeIsValid( mixed $widgetType, mixed $widgetSubtype )
public static
# getCreatableWidgetOptions( mixed $widgetType )
public static array
# getWidgetSubtypeOptions( mixed $widgetType )

Returns

array
associative array with widget class names as keys and widget labels as values

Var

string $widgetType
public static
# getWidgetContents( object $controller, object $profile, string $widgetType, array $widgetUID, mixed $extraWidgetParams = array () )

Used to render a widget and its associated scripts during an AJAX request

Used to render a widget and its associated scripts during an AJAX request

Parameters

$controller
object
$controller The instance of the controller that called this method. This allows us to call renderPartial, which is necessary if we want registered scripts to be included in the AJAX response.
$profile
object
$profile The profile model of the user for which this widget will be rendered
$widgetType
string
$widgetType The type of widget that this is (profile)
$widgetUID
array
$extraWidgetParams Extra params to pass to the widget (optional)
$extraWidgetParams
public static
# getJSONPropertiesStructure( )

Returns

array the property _JSONPropertiesStructure
public static
# instantiateWidget( string $widgetLayoutKey, object $profile, mixed $widgetType = 'profile', mixed $options = array() )

Instantiates the widget

Instantiates the widget

Parameters

$widgetLayoutKey
string
$widgetLayoutKey Key in widget layout associative array. Contains the widget class name as well as the uid
$profile
object
profile
$widgetType
$options
public static array
# parseWidgetLayoutKey( mixed $widgetLayoutKey )

Parameters

$widgetLayoutKey
mixed
$layoutKey The key in the widget layout associated with the widgets json properties. The key contains both the widget class name and the widget's unique id

Returns

array
(<widget class name>, <widget uid>)
public static array
# createSortableWidget( object $profile, string $widgetClass, string $widgetType, array $widgetSettings = array () )

Parameters

$profile
object
$profile The profile model
$widgetClass
string
$widgetType The type of the widget
$widgetType
string
$widgetLayoutName The name of the layout that the widget belongs to
$widgetSettings
array
$widgetSettings (optional) Widget setting values indexed by setting names. Used to set initial values of widget settings

Returns

array
(<success>, <uid>)
public static boolean
# deleteSortableWidget( object $profile, string $widgetClass, string $widgetUID, string $widgetLayoutName )

Parameters

$profile
object
$profile The profile model
$widgetClass
string
$widgetClass
$widgetUID
string
$widgetUID
$widgetLayoutName
string
$widgetLayoutName

Returns

boolean
true for success, false otherwise
public static
# setSortOrder( object $profile, array $widgetOrder, string $widgetType )

Sets the order of widgets specified in the widget layout JSON property of the Profile model

Sets the order of widgets specified in the widget layout JSON property of the Profile model

Parameters

$profile
object
$profile The profile model
$widgetOrder
array
$widgetOrder An array of strings where each string is a profile widget class name
$widgetType
string
$widgetType The type of widget that this is (profile)

Returns

boolean True for update success, false otherwise
public static boolean
# setJSONProperties( object $profile, array $props, string $widgetType, mixed $widgetUID )

Sets the values of a properties, for the current widget class, of the widget layout JSON object.

Sets the values of a properties, for the current widget class, of the widget layout JSON object.

Parameters

$profile
object
$profile The profile model
$props
array
$props
$widgetType
string
$widgetType The type of widget that this is (profile)
$widgetUID

Returns

boolean
True for update success, false otherwise
public static mixed
# getJSONProperty( object $profile, string $key, string $widgetType, mixed $widgetUID )

Retrieves the value of a property, for the current widget class, of the widget layout JSON object.

Retrieves the value of a property, for the current widget class, of the widget layout JSON object.

Parameters

$profile
object
$profile The profile model
$key
string
$key The name of the JSON property
$widgetType
string
$widgetType The type of widget that this is (profile)
$widgetUID

Returns

mixed
null if the property cannot be retrieved, other the value of the property
public static mixed
# getJSONProperties( object $profile, string $widgetType, string $widgetUID )

Retrieves the value of a property, for the current widget class, of the widget layout JSON object.

Retrieves the value of a property, for the current widget class, of the widget layout JSON object.

Parameters

$profile
object
$profile The profile model
$widgetType
string
$key The name of the JSON property
$widgetUID
string
$widgetType The type of widget that this is (profile)

Returns

mixed
null if the property cannot be retrieved, other the value of the property
public string
# getWidgetKey( )

Returns

string
key which uniquely identifies this widget
public
# getWidgetProperty( string $key )

Non-static wrapper around getJSONProperty which adds caching

Non-static wrapper around getJSONProperty which adds caching

Parameters

$key
string
$key The name of the JSON property
public
# getWidgetProperties( )
public
# setWidgetProperties( array $props )

Non-static wrapper around setJSONProperties which caches the property value for getWidgetProperty ()

Non-static wrapper around setJSONProperties which caches the property value for getWidgetProperty ()

Parameters

$props
array
$props
public
# setWidgetProperty( string $key, string $value )

Non-static wrapper around setJSONProperty which caches the property value for getWidgetProperty ()

Non-static wrapper around setJSONProperty which caches the property value for getWidgetProperty ()

Parameters

$key
string
$key The name of the JSON property
$value
string
$value
public string
# getWidgetLabel( )

Returns

string
widget label
public
# getSharedViewFile( )
public
# setSharedViewFile( mixed $sharedViewFile )
public
# getPackages( )

Magic getter. Returns this widget's packages.

Magic getter. Returns this widget's packages.

public
# setPackages( array $packages )

Magic setter

Magic setter

Parameters

$packages
array
$packages
public
# addPackage( array $package )

Add a package to the array of registered packages

Add a package to the array of registered packages

Parameters

$package
array
$package
public
# getJSInstanceName( )
public string
# getSetupScript( )

Magic getter. Returns this widget's setup script.

Magic getter. Returns this widget's setup script.

Returns

string
JS string which gets registered when widget content gets rendered
public
# registerSharedCss( )

Used to register all shared css before the widget container gets rendered.

Used to register all shared css before the widget container gets rendered.

public
# registerCss( )

Used to register all css before the widget gets rendered.

Used to register all css before the widget gets rendered.

public array
# getViewFileParams( )

Magic getter. Returns an array of parameters which should be passed to the view file associated with this
widget.

Magic getter. Returns an array of parameters which should be passed to the view file associated with this widget.

Returns

array
The value stored in $_viewFileParams
public
# addError( mixed $message )
public
# hasError( )
public
# renderWidget( )

Renders widget components by parsing the template string and calling rendering methods for each template item. HTML contained in the template gets echoed out.

Renders widget components by parsing the template string and calling rendering methods for each template item. HTML contained in the template gets echoed out.

public
# getMinimized( )
public
# setMinimized( mixed $minimized )
public
# renderWidgetContents( )

Renders widget contents contained in the view file pointed to by the viewFile property. This gets called if {widgetContents} is contained in the template string.

Renders widget contents contained in the view file pointed to by the viewFile property. This gets called if {widgetContents} is contained in the template string.

public
# renderErrors( )
public
# renderWidgetLabel( )

Renders the widget label saved in the profile JSON widget settings property This gets called if {widgetLabel} is contained in the template string.

Renders the widget label saved in the profile JSON widget settings property This gets called if {widgetLabel} is contained in the template string.

public
# renderSettingsMenu( )

Renders the show/hide settings menu icon as well as the settings menu content

Renders the show/hide settings menu icon as well as the settings menu content

public
# renderMinimizeButton( )

Renders a button which allows the user to minimize/maximize the widget. This gets called if {minimizeButton} is contained in the template string.

Renders a button which allows the user to minimize/maximize the widget. This gets called if {minimizeButton} is contained in the template string.

public
# renderCloseButton( )

Renders a button which allows the user to hide/show the widget. This gets called if {closeButton} is contained in the template string.

Renders a button which allows the user to hide/show the widget. This gets called if {closeButton} is contained in the template string.

public
# run( )

Render the widget container view

Render the widget container view

Overrides

CWidget::run()
protected
# getSettingsMenuContent( )

Override in child class. This content will be turned into a popup dropdown menu with the PopupDropdownMenu JS prototype.

Override in child class. This content will be turned into a popup dropdown menu with the PopupDropdownMenu JS prototype.

protected string
# getSettingsMenuContentEntries( )

Returns

string
HTML string containing settings menu options
protected string
# getSettingsMenuContentDialogs( )

Returns

string
HTML string containing dialog containers used by settings menu options
public
# getSharedCssFileNames( )
protected array
# getSharedCss( )

Magic getter. Returns this widget's shared css

Magic getter. Returns this widget's shared css

Returns

array
key is the proposed name of the css string which should be passed as the first argument to yii's registerCss. The value is the css string.
protected array
# getCss( )

Magic getter. Returns this widget's css

Magic getter. Returns this widget's css

Returns

array
key is the proposed name of the css string which should be passed as the first argument to yii's registerCss. The value is the css string.
protected array
# getTranslations( )

Returns

array
translations to pass to JS objects
protected
# getJSSortableWidgetParams( )
public
# init( )

Initializes the widget. This method is called by CBaseController::createWidget and CBaseController::beginWidget after the widget's properties have been initialized.

Initializes the widget. This method is called by CBaseController::createWidget and CBaseController::beginWidget after the widget's properties have been initialized.

Overrides

X2Widget::init()
Methods inherited from X2Widget
__construct(), ajaxRender(), behaviors(), getModule(), renderFile(), setModule()
Methods inherited from CWidget
actions(), getController(), getId(), getOwner(), getViewFile(), getViewPath(), render(), setId()
Methods inherited from CBaseController
beginCache(), beginClip(), beginContent(), beginWidget(), createWidget(), endCache(), endClip(), endContent(), endWidget(), renderInternal(), widget()
Methods inherited from CComponent
__call(), __get(), __isset(), __set(), __unset(), asa(), attachBehavior(), attachBehaviors(), attachEventHandler(), canGetProperty(), canSetProperty(), detachBehavior(), detachBehaviors(), detachEventHandler(), disableBehavior(), disableBehaviors(), enableBehavior(), enableBehaviors(), evaluateExpression(), getEventHandlers(), hasEvent(), hasEventHandler(), hasProperty(), raiseEvent()
Constants summary
string PROFILE_WIDGET_PATH_ALIAS 'application.components.sortableWidget.profileWidgets'
#
string RECORD_VIEW_WIDGET_PATH_ALIAS 'application.components.sortableWidget.recordViewWidgets'
#
Properties summary
public static boolean $createByDefault true
#
public static boolean $canBeCreated true
#
public string $widgetType
#

The type of widget that this is (profile). This value is used to detect the
view files and the profile model JSON property which stores the widget layout for widgets
of this type.

The shared view file must have the following name:
<widget type>Widget.php

The profile model widget layout JSON property must have the following name
<widget type>WidgetLayout

The type of widget that this is (profile). This value is used to detect the view files and the profile model JSON property which stores the widget layout for widgets of this type.
The shared view file must have the following name: <widget type>Widget.php
The profile model widget layout JSON property must have the following name <widget type>WidgetLayout

public SortableWidgetManager $widgetManager
#

$widgetManager

$widgetManager

public string $sortableWidgetJSClass 'SortableWidget'
#

JS class which is used to manage the front-end behavior of this widget. This is
the class which gets instantiated by the setup script.

JS class which is used to manage the front-end behavior of this widget. This is the class which gets instantiated by the setup script.

public mixed $defaultTitle
#
public string $widgetUID ''
#

Used to distinguish widget clones from eachother

Used to distinguish widget clones from eachother

public string $info ''
#

A description of the widget

A description of the widget

public object $profile
#

The profile model associated with the widget

The profile model associated with the widget

public boolean $isAjaxRequest false
#

Set to true when the current request is an ajax request

Set to true when the current request is an ajax request

public string $viewFile ''
#

The name of the view file containing the widget contents

The name of the view file containing the widget contents

public boolean $relabelingEnabled false
#

If true, the widget can be relabeled by the user from the widget settings menu

If true, the widget can be relabeled by the user from the widget settings menu

public boolean $canBeDeleted false
#

If true, the widget can be deleted by the user from the widget settings menu

If true, the widget can be deleted by the user from the widget settings menu

public string $template '<div class="submenu-title-bar widget-title-bar">{widgetLabel}{closeButton}{minimizeButton}</div>{widgetContents}'
#

A mixture of html and attributes inside curly braces. This gets used by renderWidget to render widget elements specified in child classes. As with X2GridView, each attribute inside curly braces should have a corresponding method called render<attribute_name>.

A mixture of html and attributes inside curly braces. This gets used by renderWidget to render widget elements specified in child classes. As with X2GridView, each attribute inside curly braces should have a corresponding method called render<attribute_name>.

protected array $_JSSortableWidgetParams
#

properties which will get passed to the constructor of the JS SortableWidget
class or subclass which corresponds with this widget.

properties which will get passed to the constructor of the JS SortableWidget class or subclass which corresponds with this widget.

protected array $_translations
#

translations to be passed along with $_JSSortableWidgetParams to the JS Sortable
Widget class constructor

translations to be passed along with $_JSSortableWidgetParams to the JS Sortable Widget class constructor

protected string $containerClass 'sortable-widget-container x2-layout-island'
#

CSS class to be added to the container element

CSS class to be added to the container element

protected mixed $_packages
#

Packages which will be registered when the widget content gets rendered.

Packages which will be registered when the widget content gets rendered.

protected string $_setupScript
#

This script gets registered when the widget content gets rendered.

This script gets registered when the widget content gets rendered.

protected string $_sharedCss
#

This css gets registered when the widget container gets rendered.

This css gets registered when the widget container gets rendered.

protected string $_css
#

This css gets registered when the widget content gets rendered.

This css gets registered when the widget content gets rendered.

protected array $_viewFileParams
#

Parameters to be passed to the specified view file referred to by the property
$viewFile

Parameters to be passed to the specified view file referred to by the property $viewFile

protected string $_sharedViewFile
#

The name of the view file shared by all widgets of a certain type. This is the
view file from which the view file specified in $viewFile gets rendered.

The name of the view file shared by all widgets of a certain type. This is the view file from which the view file specified in $viewFile gets rendered.

protected array $_settingsFormFields
#
protected mixed $_sharedCssFileNames
#

Returns paths of shared css files relative to themes/x2engine/css.

Returns paths of shared css files relative to themes/x2engine/css.

Properties inherited from X2Widget
$_module
Properties inherited from CWidget
$actionPrefix, $skin
Magic properties inherited from X2Widget
$module
Magic properties inherited from CWidget
$controller, $id, $owner, $viewPath
X2CRM Documentation API documentation generated by ApiGen 2.8.0