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

  • BaseDocsMassAction
  • CommonFieldsBehavior
  • Expression
  • MassAction
  • MassAddToList
  • MassCompleteAction
  • MassMoveFileSysObjToFolder
  • MassRemoveFromList
  • MassRenameFileSysObj
  • MassUncompleteAction
  • MobileRecentItems
  • ModulePanelItem
  • NewListFromSelection
  • PanelItem
  • QuickCRUDBehavior
  • RecentItemPanelItem
  • ServiceRoutingBehavior
  • SettingsPanelItem
  • X2AddressBehavior
  • X2AuthCache
  • X2BaseListViewBehavior

Exceptions

  • TwitterFeedWidgetException
  • Overview
  • Package
  • Class
  • Tree

Class MassAction

CComponent is the base class for all components.

CComponent implements the protocol of defining, using properties and events.

A property is defined by a getter method, and/or a setter method. Properties can be accessed in the way like accessing normal object members. Reading or writing a property will cause the invocation of the corresponding getter or setter method, e.g

$a=$component->text;     // equivalent to $a=$component->getText();
$component->text='abc';  // equivalent to $component->setText('abc');

The signatures of getter and setter methods are as follows,

// getter, defines a readable property 'text'
public function getText() { ... }
// setter, defines a writable property 'text' with $value to be set to the property
public function setText($value) { ... }

An event is defined by the presence of a method whose name starts with 'on'. The event name is the method name. When an event is raised, functions (called event handlers) attached to the event will be invoked automatically.

An event can be raised by calling CComponent::raiseEvent() method, upon which the attached event handlers will be invoked automatically in the order they are attached to the event. Event handlers must have the following signature,

function eventHandler($event) { ... }

where $event includes parameters associated with the event.

To attach an event handler to an event, see CComponent::attachEventHandler(). You can also use the following syntax:

$component->onClick=$callback;    // or $component->onClick->add($callback);

where $callback refers to a valid PHP callback. Below we show some callback examples:

'handleOnClick'                   // handleOnClick() is a global function
array($object,'handleOnClick')    // using $object->handleOnClick()
array('Page','handleOnClick')     // using Page::handleOnClick()

To raise an event, use CComponent::raiseEvent(). The on-method defining an event is commonly written like the following:

public function onClick($event)
{
    $this->raiseEvent('onClick',$event);
}

where <span class="php-var">$event</span> is an instance of CEvent or its child class. One can then raise the event by calling the on-method instead of CComponent::raiseEvent() directly.

Both property names and event names are case-insensitive.

CComponent supports behaviors. A behavior is an instance of IBehavior which is attached to a component. The methods of the behavior can be invoked as if they belong to the component. Multiple behaviors can be attached to the same component.

To attach a behavior to a component, call CComponent::attachBehavior(); and to detach the behavior from the component, call CComponent::detachBehavior().

A behavior can be temporarily enabled or disabled by calling CComponent::enableBehavior() or CComponent::disableBehavior(), respectively. When disabled, the behavior methods cannot be invoked via the component.

Starting from version 1.1.0, a behavior's properties (either its public member variables or its properties defined via getters and/or setters) can be accessed through the component it is attached to.

CComponent
Extended by MassAction

Direct known subclasses

BaseDocsMassAction, MassAddToList, MassCompleteAction, MassRemoveFromList, MassUncompleteAction, NewListFromSelection

Indirect known subclasses

MassMoveFileSysObjToFolder, MassRenameFileSysObj
Abstract
Package: system\base
Author: Qiang Xue <qiang.xue@gmail.com>
Since: 1.0
Located at x2engine/protected/components/X2GridView/massActions/MassAction.php
Methods summary
abstract public string
# getLabel( )

Returns

string
label to display in the dropdown list
abstract public
# execute( array $gvSelection )

Parameters

$gvSelection
array
$gvSelection array of ids of records to perform mass action on
public
# renderDialog( mixed $gridId, mixed $modelName )
public
# beforeExecute( )
public static array
# getMassActionObjects( array $classNames, X2GridViewBase $owner )

Instantiates mass action classes

Instantiates mass action classes

Returns

array
public
# getFormModel( )
public
# getModelClass( )
public
# getModelDisplayName( mixed $plural = true )
public
# registerPackages( )
public
# getJSClassParams( )
public
# getPackages( )
public static
# echoResponse( )

Echoes flashes in the flashes arrays

Echoes flashes in the flashes arrays

protected static
# getResponse( )
public
# getDialogId( string $gridId )

Parameters

$gridId
string
$gridId id of grid view
public
# renderButton( )

Renders the mass action button, if applicable

Renders the mass action button, if applicable

public
# renderListItem( )

Renders the list item for the mass action dropdown

Renders the list item for the mass action dropdown

public static
# superMassActionPasswordConfirmation( )

Check user password and echo either an error message or a unique id which gets used on subsequent requests to ensure that the user confirmed the action with their password

Check user password and echo either an error message or a unique id which gets used on subsequent requests to ensure that the user confirmed the action with their password

protected
# renderForm( )
protected boolean
# isValidAttribute( mixed $className, mixed $attr )

Returns

boolean
true if attribute is a valid filter or sort attribute for given model, false otherwise
protected array
# getIdsFromSearchResults( string $modelClass )

Helper method for superExecute. Returns array of ids of records in search results.

Helper method for superExecute. Returns array of ids of records in search results.

Parameters

$modelClass
string
$modelClass

Returns

array
array of ids and their checksum
public
# superExecute( string $uid, integer $totalItemCount, string $expectedIdChecksum )

Execute mass action on next batch of records

Execute mass action on next batch of records

Parameters

$uid
string
$uid unique id
$totalItemCount
integer
$totalItemCount total number of records to operate on
$expectedIdChecksum
string
$expectedIdChecksum checksum of ids of records in data provider used to generate the grid view
protected array
# generateSuperMassActionResponse( integer $successes, array $selectedRecords, mixed $uid )

Parameters

$successes
integer
$successes number of records for which mass action was successful
$selectedRecords
array
records yet to be acted upon
$uid

Returns

array
response data for super mass action request
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 SESSION_KEY_PREFIX 'superMassAction'
#
string SESSION_KEY_PREFIX_PASS_CONFIRM 'superMassActionPassConfirm'
#
integer BAD_CHECKSUM 1
#
integer BAD_ITEM_COUNT 2
#
integer BAD_COUNT_AND_CHECKSUM 3
#
Properties summary
protected static string $responseForm ''
#
public boolean $hasButton false
#

$hasButton If true, mass action has a button, otherwise it is assumed that the
mass action can only be accessed from the dropdown list

$hasButton If true, mass action has a button, otherwise it is assumed that the mass action can only be accessed from the dropdown list

public boolean $allowMultiple true
#

$allowMultiple whether or not mass action should be allowed for multiple records

$allowMultiple whether or not mass action should be allowed for multiple records

public X2GridViewBase|null $owner null
#

$owner

$owner

protected boolean $requiresPasswordConfirmation false
#

If true, user must enter their password before super mass action can proceed

If true, user must enter their password before super mass action can proceed

protected mixed $_label
#
protected static array $successFlashes array ()
#
protected static array $noticeFlashes array ()
#
protected static array $errorFlashes array ()
#
X2CRM Documentation API documentation generated by ApiGen 2.8.0