FUEL CMS User Guide : Version 1.5.2


Fuel Admin Class

The class is in charge of rendering the admin views.

This class extends the Fuel_base_library class.

Properties Reference

Property Default Value Description
protected
main_layout N/A The main layout file for the FUEL admin
validate N/A Whether to check that the user is logged in or not before rendering page
is_inline N/A Determines whether the page being displayed is the inline view or now
last_page N/A The last page rendered by the admin
panels N/A The names of panels displayed in the admin
display_mode N/A The name of the currently set display mode
_display_modes N/A An array of available display modes
titlebar N/A The title bar breadcrumb area in the admin
titlebar_icon N/A The title bar icon to display
_notifications N/A Stores notifications messages to be displayed

Function Reference [+]

$this->fuel->admin->initialize([$params=array()])

Initialize the FUEL admin object. Accepts an associative array as input for setting properties.

Returns

void

Parameters

(array) $params Config preferences (optional)

$this->fuel->admin->render('$view', [$vars=array()], ['$mode'=''], ['$module'=NULL])

Renders a page in the admin.

Returns

void

Parameters

(string) $view The name of the view file to display
(array) $vars Variables to pass to the view file (optional)
(string) $mode The display mode to use (can be the class constant Fuel_admin::DISPLAY_NO_ACTION, DISPLAY_COMPACT, DISPLAY_COMPACT_NO_ACTION, DISPLAY_COMPACT_TITLEBAR, DISPLAY_DEFAULT) (optional)
(array) $module The module to pull the view file from (optional)

$this->fuel->admin->check_login()

Checks that the user is logged in to FUEL and if not will redirect to the login.

Returns

void

$this->fuel->admin->validate_user('$permission', ['$type'='edit'], ['$show_error'=TRUE])

Will validate that the user has the proper permission.

Returns

void

Parameters

(string) $permission Permission name
(string) $type Type of permission (edit, publish, delete... etc)  (optional)
(boolean) $show_error Whether to display the error page or simply exit the script (optional)

$this->fuel->admin->get_model_errors()

Returns an array of the errors from a module's model.

Returns

array Will return FALSE if no errors

$this->fuel->admin->set_last_page(['$page'=NULL])

Sets the last page that was visited in the admin.

Returns

void

Parameters

(string) $page The URI path of a page (optional)

$this->fuel->admin->last_page()

Returns the last page that was visited in the admin.

Returns

void

$this->fuel->admin->add_recent_page('$link', '$name', '$type')

Adds to the recent page array.

Returns

void

Parameters

(string) $link The URI path of a page
(string) $name The name to display
(string) $type The type of page

$this->fuel->admin->nav()

The left menu navigation array.

Returns

array

$this->fuel->admin->nav_selected()

Returns the selected navigation.

Returns

string

$this->fuel->admin->set_nav_selected('$selected')

Sets the selected navigation.

Returns

void

Parameters

(string) $selected The name of the selected nav item

$this->fuel->admin->load_css()

Returns an array of CSS files for the admin including FUEL "xtra_css" parameter.

Returns

array

$this->fuel->admin->set_language('$language')

Sets the logged in users display language.

Returns

void

Parameters

(string) $language The language folder to set

$this->fuel->admin->language()

Returs the logged in users display language.

Returns

string

$this->fuel->admin->load_languages()

Loads the language files from the allowed modules.

Returns

array

$this->fuel->admin->load_js_localized([$js_localized=array()], ['$load'=TRUE])

Loads the localized language files used for javascript (e.g. markItUp!).

Returns

array

Parameters

(array) $js_localized An array of javascript languange files (optional)
(boolean) $load "Private" parameter so that the file will only be loaded once (optional)

$this->fuel->admin->page_title([$segs=array()], ['$humanize'=TRUE])

Sets the Fuel admin page title based on the module name if set or uri segments.

Returns

string

Parameters

(array) $segs An array of page segments to be parsed into a cookie crumb type page title
(boolean) $humanize Whether to run the humanize inflector helper function for the page title

$this->fuel->admin->reset_page_state()

Resets the page state of a list view page (e.g. searching/sorting ).

Returns

void

$this->fuel->admin->save_page_state($vars)

Saves the page state.

Returns

void

Parameters

(array) $vars An array of page state variables

$this->fuel->admin->get_page_state(['$state_key'=NULL])

Returns the page state of either the specified page. If or current page.

Returns

array

Parameters

(string) $state_key The key to associate with page state (optional)

$this->fuel->admin->get_state_key()

Returns the state key.

Returns

string

Returns the UI cookie values.

Returns

mixed

Parameters

(string) $key The key value to return. If none provided, it will return all (optional)

Returns the UI cookie values.

Returns

void

Parameters

(string) $key The key value to set. If none provided, it will set the entire cookie

$this->fuel->admin->no_cache()

Sets the no cache header.

Returns

void

$this->fuel->admin->is_inline()

Returns whether the page is in inline editing mode.

Returns

boolean

$this->fuel->admin->set_inline('$inline')

Sets whether the page is in inline editing mode or not.

Returns

void

Parameters

(boolean) $inline 

$this->fuel->admin->set_main_layout('$layout')

Sets the main layout for the admin.

Returns

void

Parameters

(string) $layout The name of the layout

$this->fuel->admin->main_layout()

Returns the main layout for the admin.

Returns

void

$this->fuel->admin->panel_display('$key')

Returns whether a panel is displayed or not.

Returns

void

Parameters

(string) $key The panels name

$this->fuel->admin->set_panel_display('$key', '$value')

Returns whether a panel is displayed or not.

Returns

void

Parameters

(string) $key The panels name
(boolean) $value Whether to display the panel or not

$this->fuel->admin->has_panel('$key')

Returns whether a panel exists or not in the admin.

Returns

boolean

Parameters

(string) $key The panel name you want to determine exists in the admin

$this->fuel->admin->init_display_modes()

Initializes different display modes.

Returns

void

$this->fuel->admin->register_display_mode('$name', [$panels=array()])

Registers a display mode with the admin.

Returns

void

Parameters

(string) $name A name to associate with the display mode
(array) $panels An array of panels to associate with the display mode

$this->fuel->admin->display_mode()

Returns the different registered display modes.

Returns

boolean

$this->fuel->admin->set_display_mode('$mode')

Sets the display mode for the admin.

Returns

void

Parameters

(string) $mode 

$this->fuel->admin->set_titlebar('$title', ['$icon'=''])

Sets the top titlebar (breadcrumb/icon area).

Returns

void

Parameters

(string) $title The text to display in the titlebar
(string) $icon The icon to dislpay to the left of the title bar breadcrumb (optional)

$this->fuel->admin->titlebar()

Returns the text for the title bar (breadcrumb/icon area).

Returns

void

$this->fuel->admin->set_titlebar_icon(['$icon'=''])

Sets the title bar icon.

Returns

void

Parameters

(string) $icon The icon to dislpay to the left of the title bar breadcrumb (optional)

$this->fuel->admin->titlebar_icon()

Returns the title bar icon.

Returns

string

$this->fuel->admin->notification(['$type'=''])

Returns a nofication flash message to display.

Returns

string

Parameters

(type) $type The type of message to display. Options are error, success and info. (optional)

$this->fuel->admin->set_notification('$msg', ['$type'=''])

Sets the nofication flash message to display.

Returns

string

Parameters

(string) $msg Notification message to display
(type) $type The type of message to display. Options are error, success and info. (optional)

$this->fuel->admin->has_notification(['$type'=''])

Returns a boolean value based on if a notification has been set per a given type.

Returns

boolean

Parameters

(type) $type The type of message to display. Options are error, success and info. (optional)

$this->fuel->admin->dashboards()

Returns an array of advanced module names that have dashboards to display (dashboard controllers) on the dashboard page.

Returns

array

$this->fuel->admin->add_dashboard('$dashboard')

Adds a dashboard to the FUEL configuration settings which will be displayed on the dashboard page.

Returns

void

$this->fuel->admin->toolbar_tools()

Returns an array of toolbar tools to display in hte toolbar.

Returns

array

$this->fuel->admin->toolbar()

Returns the inline editing toolbar HTML.

Returns

void