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

  • AdminController
  • Api2Controller
  • ApiController
  • BugReportsController
  • CommonSiteControllerBehavior
  • ProfileController
  • RelationshipsController
  • SearchController
  • SiteController
  • StudioController
  • TemplatesController
  • TopicsController
  • x2base
  • X2Controller
  • Overview
  • Package
  • Class
  • Tree

Class SiteController

Primary/default controller for the web application.

CComponent
Extended by CBaseController
Extended by CController
Extended by X2Controller
Extended by x2base
Extended by SiteController
Package: application\controllers
Located at x2engine/protected/controllers/SiteController.php
Methods summary
public array
# filters( )

Returns

array
action filters

Overrides

x2base::filters()
public array
# behaviors( )

Returns a list of behaviors that this controller should behave as. The return value should be an array of behavior configurations indexed by behavior names. Each behavior configuration can be either a string specifying the behavior class or an array of the following structure:

'behaviorName'=>array(
    'class'=>'path.to.BehaviorClass',
    'property1'=>'value1',
    'property2'=>'value2',
)

Returns a list of behaviors that this controller should behave as. The return value should be an array of behavior configurations indexed by behavior names. Each behavior configuration can be either a string specifying the behavior class or an array of the following structure:

'behaviorName'=>array(
    'class'=>'path.to.BehaviorClass',
    'property1'=>'value1',
    'property2'=>'value2',
)

Note, the behavior classes must implement IBehavior or extend from CBehavior. Behaviors declared in this method will be attached to the controller when it is instantiated.

For more details about behaviors, see CComponent.

Returns

array
the behavior configurations (behavior name=>behavior configuration)

Overrides

x2base::behaviors()
protected boolean
# beforeAction( CAction $action = null )

This method is invoked right before an action is to be executed (after all possible filters.) You may override this method to do last-minute preparation for the action.

This method is invoked right before an action is to be executed (after all possible filters.) You may override this method to do last-minute preparation for the action.

Parameters

$action
CAction
$action the action to be executed.

Returns

boolean
whether the action should be executed.

Overrides

x2base::beforeAction()
public array
# accessRules( )

Returns the access rules for this controller. Override this method if you use the filterAccessControl accessControl filter.

Returns the access rules for this controller. Override this method if you use the filterAccessControl accessControl filter.

Returns

array
list of access rules. See CAccessControlFilter for details about rule specification.

Overrides

CController::accessRules()
public array
# actions( )

Returns a list of external action classes. Array keys are action IDs, and array values are the corresponding action class in dot syntax (e.g. 'edit'=>'application.controllers.article.EditArticle') or arrays representing the configuration of the actions, such as the following,

return array(
    'action1'=>'path.to.Action1Class',
    'action2'=>array(
        'class'=>'path.to.Action2Class',
        'property1'=>'value1',
        'property2'=>'value2',
    ),
);

Derived classes may override this method to declare external actions.

Returns a list of external action classes. Array keys are action IDs, and array values are the corresponding action class in dot syntax (e.g. 'edit'=>'application.controllers.article.EditArticle') or arrays representing the configuration of the actions, such as the following,

return array(
    'action1'=>'path.to.Action1Class',
    'action2'=>array(
        'class'=>'path.to.Action2Class',
        'property1'=>'value1',
        'property2'=>'value2',
    ),
);

Derived classes may override this method to declare external actions.

Note, in order to inherit actions defined in the parent class, a child class needs to merge the parent actions with child actions using functions like array_merge().

You may import actions from an action provider (such as a widget, see CWidget::actions), like the following:

return array(
    ...other actions...
    // import actions declared in ProviderClass::actions()
    // the action IDs will be prefixed with 'pro.'
    'pro.'=>'path.to.ProviderClass',
    // similar as above except that the imported actions are
    // configured with the specified initial property values
    'pro2.'=>array(
        'class'=>'path.to.ProviderClass',
        'action1'=>array(
            'property1'=>'value1',
        ),
        'action2'=>array(
            'property2'=>'value2',
        ),
    ),
)

In the above, we differentiate action providers from other action declarations by the array keys. For action providers, the array keys must contain a dot. As a result, an action ID 'pro2.action1' will be resolved as the 'action1' action declared in the 'ProviderClass'.

Returns

array
list of external action classes

See

CController::createAction()

Overrides

x2base::actions()
public
# actionSendErrorReport( )
public
# actionActivityFeedOrder( )
public
# actionActivityFeedWidgetBgColor( mixed $color )
public
# actionMediaWidgetToggle( )
public
# actionWidgetSetting( string $widget, string $setting )

Action to set a widget setting

Action to set a widget setting

Parameters

$widget
string
$widget the widget name
$setting
string
$setting the setting name
public
# convertTextColor( mixed $colorString, mixed $textType )
public
# actionDynamicDropdown( mixed $val, mixed $dropdownId, mixed $field = false, mixed $module = null )
public string
# actionMinMaxLeftWidget( string $action, string $widgetName )

Saves left widget minimize setting to user's profile.

Saves left widget minimize setting to user's profile.

Parameters

$action
string
('collapse' | 'expand')
$widgetName
string
The name of the widget. This should match the widget name defined in the layout stored in the user's profile.

Returns

string
'failure' if the setting could not be saved, 'success' otherwise
public
# actionMotd( )

Displays message of the day.

Displays message of the day.

public
# actionGroupChat( )

Renders the group chat.

Renders the group chat.

public
# actionNewMessage( )

Creates a new chat message from the current web user.

Creates a new chat message from the current web user.

public
# actionAddPersonalNote( )

Add a personal note to the list of notes for the current web user.

Add a personal note to the list of notes for the current web user.

public
# actionAddSite( )

Adds a new URL

Adds a new URL

public
# actionGetNotes( string $url )

Obtains notes for displaying within the notes widget.

Obtains notes for displaying within the notes widget.

Parameters

$url
string
$url The deletion URL for notes
public
# actionDeleteURL( mixed $id )
public
# actionEditURL( mixed $id, mixed $url )
public
# actionDeleteMessage( integer $id, string $url )

Delete a message from the social feed.

Delete a message from the social feed.

Parameters

$id
integer
$id
$url
string
$url
public
# actionFullscreen( )

Sets "Fullscreen" mode for the current web user / session

Sets "Fullscreen" mode for the current web user / session

public
# actionDeleteRelationship( mixed $firstId, mixed $firstType, mixed $secondId, mixed $secondType )
public
# actionWidgetState( )

Checks for the widget's state.

Checks for the widget's state.

public
# actionWidgetOrder( )

Responds with the order of widgets for the current user.

Responds with the order of widgets for the current user.

public
# actionSaveGridviewSettings( )

Save custom gridview settings.

Save custom gridview settings.

Saves the settings (i.e. columns, column position and column width) for the X2GridView model.

public
# actionSaveFormSettings( )

Save settings for a custom form layout.

Save settings for a custom form layout.

Throws

CHttpException
public
# actionSaveWidgetHeight( )

Saves the height of a widget.

Saves the height of a widget.

public
# actionTmpUpload( )

Uploads a file to a temporary folder.

Uploads a file to a temporary folder.

Upload a file to a temp folder, which will presumably be deleted shortly thereafter Temp files are stored in a temp folder with a randomly generated name. They are stored in 'uploads/media/temp'

public
# actionRemoveTmpUpload( )

Remove a temp file and the temp folder that is in.

Remove a temp file and the temp folder that is in.

public
# actionUpload( )

Upload a file.

Upload a file.

public
# actionUploadFeedPostPicture( )
public
# actionUploadProfilePicture( )

Upload contact profile picture from Facebook.

Upload contact profile picture from Facebook.

public
# actionIndex( )
public
# phpinfo_array( mixed $return = false )
public
# actionError( )

Error printing.

Error printing.

This is the action to handle external exceptions.

public
# actionBugReport( )
public
# actionContact( )

Displays the About page

Displays the About page

protected mixed
# getAssociation( string $type, integer $id )

Obtains the record association type for an object, i.e. contacts.

Obtains the record association type for an object, i.e. contacts.

Parameters

$type
string
$type
$id
integer
$id

Returns

mixed
public
# actionViewNotifications( )

View all notifications for the current web user.

View all notifications for the current web user.

public
# actionWarning( )
public
# actionForgetMe( )

Clears remember me cookies and redirects to login page.

Clears remember me cookies and redirects to login page.

public
# actionLogin( )

Displays the login page

Displays the login page

public
# actionGoogleLogin( )

Log in using a Google account.

Log in using a Google account.

public
# actionStoreToken( )
public
# actionToggleShowTags( mixed $tags )

Toggle display of tags.

Toggle display of tags.

public
# actionAppendTag( )

Adds a tag to a model.

Adds a tag to a model.

Echoes "true" if tag was created (and was not a duplicate), "false" otherwise.

public
# actionRemoveTag( )

Removes a tag from a model.

Removes a tag from a model.

Echoes "true" if tag was removed, "false" otherwise.

public
# actionPrintRecord( mixed $modelClass, mixed $id, mixed $pageTitle = '' )

Display a print-friendly version of the x2layout view associated with the specified model class and id.

Display a print-friendly version of the x2layout view associated with the specified model class and id.

public
# actionCreateRecords( )
public
# createContact( mixed $model, mixed $oldAttributes, mixed $api )

Creates contact record

Creates contact record

Call this function from createRecords

public
# createAccount( mixed $model, mixed $oldAttributes, mixed $api )

Creates account record

Creates account record

Call this function from createRecords

public
# createOpportunity( mixed $model, mixed $oldAttributes, mixed $api = 0 )

Creates opportunity record

Creates opportunity record

Call this function from createRecords

public
# actionLogout( )

Logs out the current user and redirect to homepage.

Logs out the current user and redirect to homepage.

public
# actionToggleVisibility( )
public
# actionHideWidget( )

Remove a right widget from the page and put it in the hidden widgets menu

Remove a right widget from the page and put it in the hidden widgets menu

public
# actionShowWidget( )
public
# actionReorderWidgets( )
public
# actionMinimizeWidget( )
public
# resetPasswordHelper( mixed $id, mixed $title )
public
# actionResetPassword( type $id = null )

Reset a user's password via a really basic email verification process

Reset a user's password via a really basic email verification process

Parameters

$id
type
$id ID/key of the password recovery record
public
# actionAnonHelp( )

Prints a very brief help page

Prints a very brief help page

public
# actionDuplicateCheck( mixed $moduleName, mixed $modelName, mixed $id = null, mixed $ref = 'view', mixed $showAll = false )
public
# actionResolveDuplicates( )
public
# actionGetSkypeLink( array $usernames )
public
# actionAjaxSave( )

Save model attributes POSTed by inline edit form.

Save model attributes POSTed by inline edit form.

public
# actionTourSeen( integer $id )

Action called to mark a tour (tip) as seen

Action called to mark a tour (tip) as seen

Parameters

$id
integer
$id ID of the tip
public Echoes
# actionLayoutPreview( )

Gets a preview of a layout form for the form editor

Gets a preview of a layout form for the form editor

Returns

Echoes
out HTML
Methods inherited from x2base
actionDeleteNote(), actionGetX2ModelInput(), actionQuickView(), actionSearch(), admin(), ajaxResponse(), appLockout(), checkPermissions(), cleanUpTags(), convertUrls(), create(), decodeQuotes(), denied(), encodeQuotes(), filterSetPortlets(), getCurrentWorkflow(), getDetailView(), getHistory(), getModelFromTypeAndId(), getModelsFromTypeAndId(), getModuleObj(), getPageTitle(), getPhpMailer(), index(), mailingListToString(), parseEmailTo(), performAjaxValidation(), prepareMenu(), render(), renderLayout(), renderPartialAjax(), sendUserEmail(), setPageTitle(), throwException(), update(), view(), widget()
Methods inherited from X2Controller
badRequest(), badRequestException(), getBehaviorActions(), isAjaxRequest(), redirectToLogin(), resolveViewFile(), runBehaviorBeforeActionHandlers(), setFileFields(), validateMobileRequest()
Methods inherited from CController
__construct(), afterAction(), afterRender(), beforeRender(), clearPageStates(), createAbsoluteUrl(), createAction(), createActionFromMap(), createUrl(), filterAccessControl(), filterAjaxOnly(), filterPostOnly(), forward(), getAction(), getActionParams(), getCachingStack(), getClips(), getId(), getLayoutFile(), getModule(), getPageState(), getRoute(), getUniqueId(), getViewFile(), getViewPath(), init(), invalidActionParams(), isCachingStackEmpty(), loadPageStates(), missingAction(), processDynamicOutput(), processOutput(), recordCachingAction(), redirect(), refresh(), renderClip(), renderDynamic(), renderDynamicInternal(), renderPartial(), renderText(), replaceDynamicOutput(), run(), runAction(), runActionWithFilters(), savePageStates(), setAction(), setPageState()
Methods inherited from CBaseController
beginCache(), beginClip(), beginContent(), beginWidget(), createWidget(), endCache(), endClip(), endContent(), endWidget(), renderFile(), renderInternal()
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 inherited from CController
STATE_INPUT_NAME
Properties summary
public string $modelClass 'Admin'
#
public array $portlets array()
#
Properties inherited from x2base
$actionMenu, $breadcrumbs, $layout, $leftPortlets, $leftWidgets, $menu, $noBackdrop
Properties inherited from CController
$defaultAction
Magic properties inherited from CController
$action, $actionParams, $cachingStack, $clips, $id, $module, $pageTitle, $route, $uniqueId, $viewPath
X2CRM Documentation API documentation generated by ApiGen 2.8.0