Autodoc
  • Namespace
  • Class
  • Tree

Namespaces

  • BlueTihi
    • Context
  • Brickrouge
    • Element
      • Nodes
    • Renderer
    • Widget
  • ICanBoogie
    • ActiveRecord
    • AutoConfig
    • CLDR
    • Composer
    • Core
    • Event
    • Exception
    • HTTP
      • Dispatcher
      • Request
    • I18n
      • Translator
    • Mailer
    • Modules
      • Taxonomy
        • Support
      • Thumbnailer
        • Versions
    • Object
    • Operation
      • Dispatcher
    • Prototype
    • Routes
    • Routing
      • Dispatcher
    • Session
  • Icybee
    • ActiveRecord
      • Model
    • ConfigOperation
    • Document
    • EditBlock
    • Element
      • ActionbarContextual
      • ActionbarSearch
      • ActionbarToolbar
    • FormBlock
    • Installer
    • ManageBlock
    • Modules
      • Articles
      • Cache
        • Collection
        • ManageBlock
      • Comments
        • ManageBlock
      • Contents
        • ManageBlock
      • Dashboard
      • Editor
        • Collection
      • Files
        • File
        • ManageBlock
      • Forms
        • Form
        • ManageBlock
      • I18n
      • Images
        • ManageBlock
      • Members
      • Modules
        • ManageBlock
      • Nodes
        • ManageBlock
        • Module
      • Pages
        • BreadcrumbElement
        • LanguagesElement
        • ManageBlock
        • NavigationBranchElement
        • NavigationElement
        • Page
        • PageController
      • Registry
      • Search
      • Seo
      • Sites
        • ManageBlock
      • Taxonomy
        • Terms
          • ManageBlock
        • Vocabulary
          • ManageBlock
      • Users
        • ManageBlock
        • NonceLogin
        • Roles
      • Views
        • ActiveRecordProvider
        • Collection
        • View
    • Operation
      • ActiveRecord
      • Constructor
      • Module
      • Widget
    • Rendering
  • None
  • Patron
  • PHP

Classes

  • AdminDecorator
  • AdminIndexController
  • BlockController
  • BlockDecorator
  • ConfigBlock
  • ConfigController
  • ConfigOperation
  • Core
  • DeleteBlock
  • DeleteController
  • Document
  • DocumentDecorator
  • EditBlock
  • EditController
  • FormBlock
  • Hooks
  • InterlockBlock
  • Kses
  • ManageBlock
  • Module
  • Modules
  • StatsDecorator

Constants

  • OPERATION_SAVE_MODE
  • OPERATION_SAVE_MODE_CONTINUE
  • OPERATION_SAVE_MODE_DISPLAY
  • OPERATION_SAVE_MODE_LIST
  • OPERATION_SAVE_MODE_NEW

Functions

  • slugize
  • start
  • strip_stopwords

Class ManageBlock

An element to manage the records of a module.

ICanBoogie\Object implements ICanBoogie\ToArrayRecursive uses ICanBoogie\ToArrayRecursiveTrait, ICanBoogie\PrototypeTrait
Extended by Brickrouge\Element implements ArrayAccess, IteratorAggregate, Brickrouge\HTMLStringInterface
Extended by Icybee\ManageBlock

Direct known subclasses

Icybee\Modules\Comments\ManageBlock, Icybee\Modules\Nodes\ManageBlock, Icybee\Modules\Sites\ManageBlock, Icybee\Modules\Taxonomy\Terms\ManageBlock, Icybee\Modules\Taxonomy\Vocabulary\ManageBlock, Icybee\Modules\Users\ManageBlock

Indirect known subclasses

Icybee\Modules\Contents\ManageBlock, Icybee\Modules\Files\ManageBlock, Icybee\Modules\Forms\ManageBlock, Icybee\Modules\Images\GalleryBlock, Icybee\Modules\Images\ManageBlock, Icybee\Modules\Members\ManageBlock, Icybee\Modules\Pages\ManageBlock

Namespace: Icybee
Changes-20130622: - All extend_column* methods are removed. - alter_range_query() signature changed, $options is now an instance of Options an not an array. - AlterColumnsEvent has been redesigned, records is removed.
TODO-20130626:: - [filters][options] -> [filter_options] - throw error when COLUMNS_ORDER use an undefined column.
Located at vendor/icybee/icybee/lib/blocks/manage.php

Methods summary

protected static
# add_assets( Brickrouge\Document $document )

Adds assets to the document.

Adds assets to the document.

Parameters

$document
Icybee\Document
$document

Overrides

Brickrouge\Element::add_assets
protected ICanBoogie\ActiveRecord\Model
# get_model( )

Returns the Icybee\ManageBlock::$model property.

Returns the Icybee\ManageBlock::$model property.

Returns

ICanBoogie\ActiveRecord\Model
protected
# get_primary_key( )

Returns the primary key of the records.

Returns the primary key of the records.

Var

string
protected ICanBoogie\I18n\Translator\Proxi
# get_t( )

Returns the Icybee\ManageBlock::$t property.

Returns the Icybee\ManageBlock::$t property.

Returns

ICanBoogie\I18n\Translator\Proxi
protected Icybee\ManageBlock\Options
# get_options( )

Returns the Icybee\ManageBlock::$options property.

Returns the Icybee\ManageBlock::$options property.

Returns

Icybee\ManageBlock\Options
public
# __construct( Icybee\Module $module, array $attributes )

Parameters

$module
string
$type Type of the element, it can be one of the custom types (TYPE_*) or any HTML type.
$attributes
array
$attributes HTML and custom attributes.

Overrides

Brickrouge\Element::__construct
protected array[string]mixed
# get_available_columns( )

Returns the available columns.

Returns the available columns.

Returns

array[string]mixed
protected
# get_columns( )
protected
# resolve_columns( array $columns )
protected array[string]mixed
# get_available_jobs( )

Returns the available jobs.

Returns the available jobs.

Returns

array[string]mixed
protected array[string]mixed
# get_jobs( )

Returns the jobs.

Returns the jobs.

Returns

array[string]mixed
protected array
# resolve_jobs( array $jobs )

Resolves the available jobs.

Resolves the available jobs.

Parameters

$jobs
array
$jobs

Returns

array
protected array
# update_filters( array $filters, array $modifiers )

Update filters with the specified modifiers.

Update filters with the specified modifiers.

The extended schema of the model is used to automatically handle booleans, integers, dates (date, datetime and timestamp) and strings (char, varchar).

Parameters

$filters
array
$filters
$modifiers
array
$modifiers

Returns

array
Updated filters.
protected array
# update_options( Icybee\ManageBlock\Options $options, array $modifiers )

Updates options with the provided modifiers.

Updates options with the provided modifiers.

The method updates the order, start, limit, search and filters options.

The start options is reset to 1 when the order, search or filters options change.

Parameters

$options
array
$options Previous options.
$modifiers
array
$modifiers Options modifiers.

Returns

array
Updated options.
protected array
# resolve_order( string|null $order_by, string|integer|null $order_direction )

Resolves the display order of the records according to the default options and the available columns.

Resolves the display order of the records according to the default options and the available columns.

If the column that should be used to order the records does not exists, the order is reseted.

If the order direction if not defined, the default direction of the column if used instead.

Parameters

$order_by
string|null
$order_by The identifier of the column used to order the records.
$order_direction
string|integer|null
$order_direction The direction of the ordering. One of: "asc", "desc", 1, -1 or null.

Returns

array
Returns an array made of the column identifier and the order direction.
protected Icybee\ManageBlock\Options
# resolve_options( array $name, array $modifiers )

Returns the options for the element.

Returns the options for the element.

Options are restored from the storing backend and updated according to the supplied modifiers.

Parameters

$name
array
$modifiers
$modifiers

Returns

Icybee\ManageBlock\Options
public string
# render( )

Renders the element.

Renders the element.

If an error occurd while creating the query or fecthing the records, the filters and the order are reseted.

Returns

string
The HTML representation of the object

Overrides

Brickrouge\Element::render
protected string|null
# render_inner_html( )

Renders the object into a HTML string.

Renders the object into a HTML string.

Returns

string|null
The content of the element. The element is to be considered _self-closing_ if null is returned.

Overrides

Brickrouge\Element::render_inner_html
protected string
# render_outer_html( )

Wraps the listview in a form element.

Wraps the listview in a form element.

Returns

string

Overrides

Brickrouge\Element::render_outer_html
protected ICanBoogie\ActiveRecord\Query
# resolve_query( Icybee\ManageBlock\Options $options )

Resolve ActiveRecord query according to the supplied options.

Resolve ActiveRecord query according to the supplied options.

Note: The method updates the Icybee\ManageBlock::$count property with the number of records matching the query, before a range is applied.

Parameters

$options
Icybee\ManageBlock\Options
$options

Returns

ICanBoogie\ActiveRecord\Query
protected ICanBoogie\ActiveRecord\Query
# alter_query( ICanBoogie\ActiveRecord\Query $query, array $filters )

Alters the initial query with the specified filters.

Alters the initial query with the specified filters.

The alter_query method of each column is invoked in turn to alter the query.

Parameters

$query
ICanBoogie\ActiveRecord\Query
$query
$filters
array
$filters

Returns

ICanBoogie\ActiveRecord\Query
The altered query.
protected ICanBoogie\ActiveRecord\Query
# alter_query_with_search( ICanBoogie\ActiveRecord\Query $query, string $search )

Alters the query according to a search string.

Alters the query according to a search string.

Parameters

$query
ICanBoogie\ActiveRecord\Query
$query
$search
string
$search

Returns

ICanBoogie\ActiveRecord\Query
protected ICanBoogie\ActiveRecord\Query
# alter_query_with_range( ICanBoogie\ActiveRecord\Query $query, integer $offset, integer $limit )

Alters query with range (offset and limit).

Alters query with range (offset and limit).

Parameters

$query
ICanBoogie\ActiveRecord\Query
$query
$offset
integer
$offset The offset of the record to return.
$limit
integer
$limit The maximum number of records to return.

Returns

ICanBoogie\ActiveRecord\Query
protected
# fetch_records( ICanBoogie\ActiveRecord\Query $query )

Fetches the records matching the query.

Fetches the records matching the query.

Parameters

$query
ICanBoogie\ActiveRecord\Query
$query
protected array
# alter_records( array $records )

Alters records.

Alters records.

The function return the records _as is_ but subclasses can implement the method to load all the dependencies of the records in a single step.

Parameters

$records
array
$records

Returns

array
protected string
# render_head( )

Renders the THEAD element.

Renders the THEAD element.

Returns

string
The rendered THEAD element.
protected string
# render_column( Icybee\ManageBlock\Column $column, string $id )

Renders a column header.

Renders a column header.

Parameters

$column
array
$cell
$id
string
$id

Returns

string
The rendered THEAD cell.
protected array[string]mixed
# render_columns_cells( array $columns )

Renders the cells of the columns.

Renders the cells of the columns.

The method returns an array with the following layout:
[<column_id>][] => <cell_content>

Parameters

$columns
array
$columns The columns to render.

Returns

array[string]mixed
protected array[string]mixed
# apply_discreet_filter( array $rendered_columns_cells )

Replaces repeating values of a column with the discreet placeholder.

Replaces repeating values of a column with the discreet placeholder.

Parameters

$rendered_columns_cells
array
$rendered_columns_cells

Returns

array[string]mixed
protected array[]array
# columns_to_rows( array $rendered_columns_cells )

Convert rendered columns cells to rows.

Convert rendered columns cells to rows.

Parameters

$rendered_columns_cells
array
$rendered_columns_cells

Returns

array[]array
protected array[]Element
# render_rows( array $rows )

Renders the specified rows.

Renders the specified rows.

The rows are rendered as an array of Brickrouge\Element instances representing TR elements.

Parameters

$rows
array
$rows

Returns

array[]Element
protected string
# render_body( )

Renders table body.

Renders table body.

Returns

string
protected Brickrouge\Alert
# render_empty_body( )

Renders an alternate body when there is no record to display.

Renders an alternate body when there is no record to display.

Returns

Brickrouge\Alert
protected Brickrouge\Form
# render_search( )

Renders the "search" element to be injected in the document.

Renders the "search" element to be injected in the document.

Returns

Brickrouge\Form
protected string
# render_controls( )

Renders listview controls.

Renders listview controls.

Returns

string
protected Brickrouge\Element\null
# render_jobs( array $jobs )

Renders jobs as an HTML element.

Renders jobs as an HTML element.

Parameters

$jobs
array
$jobs

Returns

Brickrouge\Element\null
protected string
# render_foot( )

Renders the element's footer.

Renders the element's footer.

Returns

string
public boolean
# is_filtering( string $column_id = null )

Checks if the view is filtered.

Checks if the view is filtered.

Parameters

$column_id
string
$column_id This optional parameter can be used to check if the filter is applied to a specific column.

Returns

boolean
protected
# get_is_filtering( )

Methods inherited from Brickrouge\Element

__toString(), add_class(), adopt(), alter_attributes(), alter_class_names(), alter_dataset(), auto_element_id(), decorate(), decorate_with_description(), decorate_with_inline_help(), decorate_with_label(), decorate_with_legend(), getIterator(), get_attributes(), get_class(), get_dataset(), get_ordered_children(), handle_assets(), has_class(), lazy_get_id(), offsetExists(), offsetGet(), offsetSet(), offsetUnset(), remove_class(), render_attributes(), render_child(), render_children(), render_class(), render_dataset(), render_inner_html_for_checkbox_group(), render_inner_html_for_radio_group(), render_inner_html_for_select(), render_inner_html_for_textarea(), set_class(), set_dataset(), validate()

Methods inherited from ICanBoogie\Object

from(), resolve_facade_properties(), resolve_private_properties(), to_array(), to_json()

Methods inherited from ICanBoogie\ToArrayRecursive

to_array_recursive()

Methods used from ICanBoogie\ToArrayRecursiveTrait

to_array_recursive()

Methods used from ICanBoogie\PrototypeTrait

__call(), __get(), __set(), __sleep(), __wakeup(), get_prototype(), has_method(), has_property(), last_chance_get(), last_chance_set()

Magic methods summary

Constants summary

string DISCREET_PLACEHOLDER '<span class="lighter">―</span>'
#
string T_BLOCK '#manager-block'
#
string T_COLUMNS_ORDER '#manager-columns-order'
#
string T_ORDER_BY '#manager-order-by'
#
string ORDER_ASC 'asc'
#
string ORDER_DESC 'desc'
#

Constants inherited from Brickrouge\Element

CHILDREN, DEFAULT_VALUE, DESCRIPTION, GROUP, GROUPS, INLINE_HELP, INNER_HTML, LABEL, LABEL_MISSING, LABEL_POSITION, LEGEND, OPTIONS, OPTIONS_DISABLED, REQUIRED, STATE, TYPE_CHECKBOX, TYPE_CHECKBOX_GROUP, TYPE_RADIO, TYPE_RADIO_GROUP, VALIDATOR, VALIDATOR_OPTIONS, WEIGHT, WIDGET_CONSTRUCTOR

Properties summary

public ICanBoogie\Module $module
#

Currently used module.

Currently used module.

protected ICanBoogie\ActiveRecord\Model $model
#

Currently used model.

Currently used model.

protected array[string]Column $columns
#

The columns of the element.

The columns of the element.

protected array[]ActiveRecord $records
#

The records to display.

The records to display.

protected integer $count
#

The total number of records matching the filters.

The total number of records matching the filters.

protected array[string]mixed $jobs
#

Jobs that can be applied to the records.

Jobs that can be applied to the records.

protected mixed $browse
#
protected ICanBoogie\I18n\Translator\Proxi $t
#

Proxis translator with the following scope: "manager.<module_flat_id>"

Proxis translator with the following scope: "manager.<module_flat_id>"

protected Icybee\ManageBlock\Options $options
#

Display options.

Display options.

Properties inherited from Brickrouge\Element

$auto_element_id, $children, $class_names, $inner_html, $tag_name, $tags, $type

Magic properties

public read-only ICanBoogie\ActiveRecord\Model $model
#
public read-only string $primary_key
#

The primary key of the records.

The primary key of the records.

public read-only Icybee\ManageBlock\Options $options
#

The display options.

The display options.

public read-only boolean $is_filtering
#

true if records are filtered.

true if records are filtered.

public read-only Icybee\ManageBlock\Translator $t
#

The translator used by the element.

The translator used by the element.

Magic properties inherited from Brickrouge\Element

$class, $dataset, $id

Magic properties inherited from ICanBoogie\Object

$prototype

Autodoc API documentation generated by ApiGen 2.8.0