e107 Core Code: e107 Admin UI

Images
Images
Images
Images
e107 Core Code: e107 Admin UI

Fields settings

'tab'=>1,

the field is displayed on tab with this index (0, 1...  1 - second tab)

Tab names are set in protected $tabs = array(LAN_GENERAL, LAN_ADVANCED);

It is good to have at least one tab set for e_admin (dynamically added tabs) working correctly. 

'nolist'=>true,
the field is not displayed in Read mode, no option to select in Columns display option, very often with 'type' => 'hidden',
'batch'=>1
the field is added to batch options and multiple rows change is possible

Field types

'type' => null,
'type' => 'number',
'type' => 'boolean',

Default generated value by plugin builder:

'redirection_status' => array ( 'title' => 'Statust', 'type' => 'boolean',
'data' => 'int', 'width' => 'auto', 'help' => '', 'readParms' => array (),
'writeParms' => array (), 'class' => 'left', 'thclass' => 'left',),

The result is ON/OFF switcher

The parameter to change the text to YES/NO

'redirection_status' => array ( 'title' => 'Status', 'type' => 'boolean',
'data' => 'int', 'width' => 'auto', 'help' => '', 'readParms' => array (), 'writeParms' => 'label=yesno',
'class' => 'left', 'thclass' => 'left',),

Custom labels

'writeParms'=>'enabled=IMALAN_15&disabled=IMALAN_14'

'type' => 'text',
'type' => 'user',
'type' => 'userclass',
'type' => 'url',
'type' => 'datestamp',

Minimal settings:

'date_added' => array ( 'title' => 'Added', 'type' => 'datestamp', 'data' => 'int' ),

Read only:

'date_added' => array ( 'title' => 'Added', 'type' => 'datestamp', 'data' => 'int', 'readonly' => true ),

'type' => 'file',
'type' => 'media',
'type' => 'icon',
'type' => 'image',

SEF-URL field

SEF-URL field

the field, when the button that generates SEF-URL code, is added. 'sef' is field that is used for generating value of this field. The way of the result is set in preferences under URL Configuration settings. 

Basic settings:

'sef' => array ( 'title' => LAN_SEFURL, 'type' => 'text', 'data' => 'str', 'writeParms' => 'size=xxlarge&sef=title' ),

Batch option: 

'news_sef' => array('title' => LAN_SEFURL, 'batch'=>1,  (....)  'writeParms'=>array('size'=>'xxlarge', 'show'=>1, 'sef'=>'news_title'))

 

ID field

 The ID field is a field set in protected $pid = "category_id";

By default is not displayed as a column. To display it you need to set 'forced' true.

'forced'=>true

Display this field, otherwise it is hidden, you can't select it with columns

'type'=>'number',

Correct fix how to display this field (as column), not always displayed

'category_id' => array('title'=> LAN_ID, 'type' => 'number', 'width' =>'5%', 'forced'=> TRUE, 'readonly'=>TRUE),
 

Admin UI Title

 Plugin title for Admin UI

It is done from 2 parts:

$pluginTitle

and menu caption  

'caption'=> _LINKSWAITINGVAL,

Example how to build your own title that looks similar like core one if you want it a different way for edit mode (if edit mode is not in the menu):

public function __construct($request, $response, $params = array()) {

$action = $_GET['action'];
$this->pluginTitle = _WEBLINKSADMIN;
if($action == 'edit') 
{
$this->pluginTitle .= ' <span class="fa fa-angle-double-right e-breadcrumb"></span> '._LINKVALIDATION;
}
parent::__construct($request, $response, $params = array());
}

Custom options

Change 

'type' => 'method',

Add

function options($parms, $value, $id, $attributes) {

For more info look at githubSync plugin.

10 Years

GLORIOUS YEARS

100%

SATISFACTION RATE

20+

e107 THEMES

10+

e107 PLUGINS

Images