1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-13 01:54:12 +02:00

Custom Tab Label for Custom Fields Form.

This commit is contained in:
Cameron
2017-01-31 09:37:08 -08:00
parent ef543ee370
commit b7d701917f
2 changed files with 42 additions and 8 deletions

View File

@@ -24,12 +24,15 @@
private $_field_limit = 20;
private $_tab = array('additional'=>'Additional FieldsXX');
private $_tab = array();
private $_tab_default = 'additional';
function __construct()
{
asort($this->_fieldTypes);
$this->_tab = array($this->_tab_default => "Additional");
}
@@ -39,6 +42,16 @@
return $this->_fieldTypes;
}
public function getTabId()
{
return $this->_tab_default;
}
public function getTabLabel()
{
return $this->_tab[$this->_tab_default];
}
/**
* Load the configuration for all custom fields
@@ -62,6 +75,13 @@
if($arr = $tp->isJSON($data))
{
if(!empty($arr['__tabs__']))
{
$this->_tab = $arr['__tabs__'];
unset($arr['__tabs__']);
}
$this->_config = $arr;
}
@@ -239,7 +259,11 @@
}
$text = "<table class='table table-striped table-bordered'>
$text = "
<div class='form-group'>
".$frm->text('__e_customfields_tabs__', $this->_tab[$this->_tab_default], 30, array('placeholder'=>"Tab label",'size'=>'medium', 'required'=>1))."
</div>
<table class='table table-striped table-bordered'>
<colgroup>
<col />
<col />
@@ -397,8 +421,19 @@
$new = array();
if(!empty($postData['__e_customfields_tabs__']))
{
$new['__tabs__'] = array($this->_tab_default => $postData['__e_customfields_tabs__']);
unset($postData['__e_customfields_tabs__']);
}
foreach($postData[$fieldname] as $fields)
{
if(empty($fields['key']) || empty($fields['type']))
{
continue;