PHP Class AliasController

显示文件 Open project: opensolutions/vimbadmin Class Usage Examples

Public Methods

Method Description
addAction ( ) Add an alias.
ajaxToggleActiveAction ( ) Toggles the active property of an alias. Prints 'ok' on success or 'ko' otherwise to stdout.
deleteAction ( ) Deletes an alias. Prints 'ok' on success or 'ko' otherwise to stdout.
editAction ( ) Edit an alias.
getAliasForm ( ) : ViMbAdmin_Form_Mailbox_AddEdit Instantiate / get the alias add-edit form
indexAction ( ) The index action. Just jumps to list action.
listAction ( ) Lists the aliases available to the admin and/or domain. Superadmin can see all.
listSearchAction ( ) This action is used then server side pagination is turned on. It will look for alias data by filter passed and return json_array if aliases was found or ko if it was not successful. Return array max size is also defined in application.ini.
preDispatch ( ) Most actions in this object will require a domain object to edit / act on.

Private Methods

Method Description
_autocompleteArray ( ) The Ajax function providing JSON data for the jQuery UI Autocomplete on adding/editing aliases.
_setAddress ( ViMbAdmin_Form_Alias_AddEdit $form ) : boolean Sets address to alias
_setGotos ( ViMbAdmin_Form_Alias_AddEdit $form ) : boolean Sets goto to alias

Method Details

addAction() public method

Add an alias.
public addAction ( )

ajaxToggleActiveAction() public method

Toggles the active property of an alias. Prints 'ok' on success or 'ko' otherwise to stdout.

deleteAction() public method

Deletes an alias. Prints 'ok' on success or 'ko' otherwise to stdout.
public deleteAction ( )

editAction() public method

Edit an alias.
public editAction ( )

getAliasForm() public method

Instantiate / get the alias add-edit form
public getAliasForm ( ) : ViMbAdmin_Form_Mailbox_AddEdit
return ViMbAdmin_Form_Mailbox_AddEdit

indexAction() public method

The index action. Just jumps to list action.
public indexAction ( )

listAction() public method

$this->view->alias_actions allow to append aliases list action buttons. %id% will be replaced by alias id form the list. below is example array which creates edit alias button, and another button with drop down options for edit alias. Only one drop down button can be defined per button group, and it always be appended at the end. $actions = [ [ //Simple link button 'tagName' => 'a', //Mandatory parameter for element type. 'href' => OSS_Utils::genUrl( "alias", "edit" ) . "/alid/%id%", //Url for action 'title' => "Edit", 'class' => "btn btn-mini have-tooltip", //Class for css options. 'id' => "test-%id%", //If setting id id must have %id% which will be replaced by original mailbox id to avoid same ids. 'child' => [ //Mandatory element if is not array it will be shown as text. 'tagName' => "i", //Mandatory option if child is array to define element type 'class' => "icon-pencil" //Icon class ], ], [ //Drop down button 'tagName' => 'span', //Mandatory parameter for element type 'title' => "Settings", 'class' => "btn btn-mini have-tooltip dropdown-toggle", //Class dropdown-toggle is mandatory for drop down button 'data-toggle' => "dropdown", //data-toggle attribute is mandatory for drop down button 'id' => "cog-%id%", 'style' => "max-height: 15px;", 'child' => [ 'tagName' => "i", 'class' => "icon-cog" ], 'menu' => [ //menu array is mandatory then defining drop down button [ 'id' => "menu-edit-%id%", //Not mandatory attribute but if is set %id% should be use to avoid same ids. 'text' => " Edit", //Mandatory for display action text 'url' => OSS_Utils::genUrl( "alias", "edit" ) . "/alid/%id%" //Mandatory to redirect the action. ] ] ] ];
public listAction ( )

listSearchAction() public method

This action is used then server side pagination is turned on. It will look for alias data by filter passed and return json_array if aliases was found or ko if it was not successful. Return array max size is also defined in application.ini.
public listSearchAction ( )

preDispatch() public method

This method will look for an 'id' parameter and, if set, will try to load the domain model and authorise the user to edit / act on it.
See also: Zend_Controller_Action::preDispatch()
public preDispatch ( )