Dotclear 2.24
Loading...
Searching...
No Matches
dcActions Class Reference
Inheritance diagram for dcActions:
dcActionsPage dcBlogsActions dcCommentsActions dcPostsActions dcBlogsActionsPage dcCommentsActionsPage dcPagesActions dcPostsActionsPage dcPagesActionsPage

Public Member Functions

 __construct (?string $uri, array $redirect_args=[])
 
 setEnableRedirSelection (bool $enable)
 
 addAction (array $actions, $callback)
 
 getCombo ()
 
 getIDs ()
 
 getIDsHidden ()
 
 getHiddenFields (bool $with_ids=false)
 
 getRS ()
 
 getRedirection (bool $with_selected_entries=false, array $params=[])
 
 redirect (bool $with_selected_entries=false, array $params=[])
 
 getURI ()
 
 getCallerTitle ()
 
 getAction ()
 
 process ()
 
 getCheckboxes ()
 
 beginPage (string $breadcrumb='', string $head='')
 
 endPage ()
 

Protected Member Functions

 setupRedir ($from)
 
 fetchEntries (ArrayObject $from)
 

Protected Attributes

 $uri
 
 $combo = []
 
 $actions
 
 $entries = []
 
 $rs
 
 $redir_args
 
 $redirect_fields = []
 
 $redir_anchor = ''
 
 $action = ''
 
 $from
 
 $field_entries
 
 $cb_title
 
 $caller_title
 
 $in_plugin = false
 
 $enable_redir_selection = true
 

Constructor & Destructor Documentation

◆ __construct()

__construct ( ?string  $uri,
array  $redirect_args = [] 
)

Constructs a new instance.

Parameters
null | string$uriThe form uri
array$redirect_argsThe redirect arguments

Reimplemented in dcBlogsActions, dcCommentsActions, dcPostsActions, and dcPagesActions.

References $uri.

Member Function Documentation

◆ setEnableRedirSelection()

setEnableRedirSelection ( bool  $enable)

Define whether to keep selection when redirecting Can be usefull to be disabled to preserve some compatibility.

Parameters
boolean$enabletrue to enable, false otherwise

◆ addAction()

addAction ( array  $actions,
  $callback 
)

Adds an action

Parameters
array$actionsthe actions names as if it was a standalone combo array. It will be merged with other actions. Can be bound to multiple values, if the same callback is to be called
callable | array$callbackthe callback for the action.
Returns
dcActions the actions page itself, enabling to chain addAction().

References $actions.

Referenced by dcDefaultBlogActions\adminBlogsActionsPage(), dcDefaultCommentActions\adminCommentsActionsPage(), dcDefaultPageActions\adminPagesActionsPage(), tagsBehaviors\adminPostsActions(), and dcDefaultPostActions\adminPostsActionsPage().

◆ getCombo()

getCombo ( )

Returns the actions combo Useable through form::combo/formOption (see addAction() method)

Returns
array the actions combo

References $combo.

◆ getIDs()

◆ getIDsHidden()

getIDsHidden ( )

Returns the list of selected entries as HTML hidden fields string

Returns
string the HTML code for hidden fields

References $ret.

Referenced by getHiddenFields().

◆ getHiddenFields()

getHiddenFields ( bool  $with_ids = false)

Returns all redirection parameters as HTML hidden fields

Parameters
boolean$with_idsif true, also include ids in HTML code
Returns
string the HTML code for hidden fields

References $ret, and getIDsHidden().

Referenced by tagsBehaviors\adminAddTags(), tagsBehaviors\adminRemoveTags(), dcDefaultPostActions\doChangePostAuthor(), dcDefaultPostActions\doChangePostCategory(), and dcDefaultPostActions\doChangePostLang().

◆ getRS()

getRS ( )

◆ setupRedir()

setupRedir (   $from)
protected

Setup redirection arguments

by default, $_POST fields as defined in redirect_fields attributes are set into redirect_args.

Parameters
array | ArrayObject$frominput to parse fields from (usually $_POST)

References $from.

Referenced by process().

◆ getRedirection()

getRedirection ( bool  $with_selected_entries = false,
array  $params = [] 
)

Returns redirection URL

Parameters
boolean$with_selected_entriesif true, add selected entries in url
array$paramsextra parameters to append to redirection must be an array : each key is the name, each value is the wanted value
Returns
string the redirection url

References $field_entries, $redir_anchor, and $redir_args.

Referenced by tagsBehaviors\adminAddTags(), dcBlogsActions\beginPage(), dcCommentsActions\beginPage(), dcPostsActions\beginPage(), dcPagesActions\beginPage(), dcDefaultPostActions\doChangePostAuthor(), dcDefaultPostActions\doChangePostCategory(), dcDefaultPostActions\doChangePostLang(), dcPagesActions\error(), and redirect().

◆ redirect()

redirect ( bool  $with_selected_entries = false,
array  $params = [] 
)

◆ getURI()

◆ getCallerTitle()

getCallerTitle ( )

Returns current form URI, if any

Returns
string the form URI

References $caller_title.

Referenced by dcDefaultPostActions\doChangePostAuthor(), dcDefaultPostActions\doChangePostCategory(), and dcDefaultPostActions\doChangePostLang().

◆ getAction()

◆ process()

process ( )

Proceeds action handling, if any

This method may issue an exit() if an action is being processed. If it returns, no action has been performed

Reimplemented in dcPagesActions.

References $action, fetchEntries(), and setupRedir().

◆ getCheckboxes()

getCheckboxes ( )

Returns HTML code for selected entries as a table containing entries checkboxes

Returns
string the HTML code for checkboxes

Reimplemented in dcBlogsActions, and dcCommentsActions.

References $ret, and form\checkbox().

Referenced by tagsBehaviors\adminAddTags(), tagsBehaviors\adminRemoveTags(), dcDefaultPostActions\doChangePostAuthor(), dcDefaultPostActions\doChangePostCategory(), and dcDefaultPostActions\doChangePostLang().

◆ beginPage()

beginPage ( string  $breadcrumb = '',
string  $head = '' 
)
abstract

Displays the beginning of a page, if action does not redirects dirtectly

This method is called from the actions themselves.

Parameters
string$breadcrumbbreadcrumb to display
string$headpage header to include

Reimplemented in dcBlogsActions, dcCommentsActions, dcPostsActions, and dcPagesActions.

◆ endPage()

endPage ( )
abstract

Displays the ending of a page, if action does not redirects dirtectly

This method is called from the actions themselves.

Reimplemented in dcBlogsActions, dcCommentsActions, dcPostsActions, and dcPagesActions.

◆ fetchEntries()

fetchEntries ( ArrayObject  $from)
abstractprotected

Fills-in information by requesting into db This method may setup the following attributes

  • entries : list of entries (checked against permissions) entries ids are array keys, values contain entry description (if relevant)
  • rs : dcRecord given by db request
Parameters
ArrayObject$from

Reimplemented in dcBlogsActions, dcCommentsActions, and dcPostsActions.

Referenced by process().

Field Documentation

◆ $uri

◆ $combo

$combo = []
protected

Referenced by getCombo().

◆ $actions

$actions
protected

Referenced by addAction().

◆ $entries

$entries = []
protected

◆ $rs

◆ $redir_args

$redir_args
protected

Referenced by getRedirection().

◆ $redirect_fields

$redirect_fields = []
protected

◆ $redir_anchor

$redir_anchor = ''
protected

Referenced by getRedirection().

◆ $action

$action = ''
protected

Referenced by getAction(), and process().

◆ $from

◆ $field_entries

$field_entries
protected

Referenced by getRedirection().

◆ $cb_title

$cb_title
protected

◆ $caller_title

$caller_title
protected

Referenced by getCallerTitle().

◆ $in_plugin

$in_plugin = false
protected

◆ $enable_redir_selection

$enable_redir_selection = true
protected

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