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

New feature: (work-in-progress) Allow plugins to hook into the batch-dropdown options in AdminUI list mode.

This commit is contained in:
Cameron
2016-11-05 17:09:39 -07:00
parent 0156dd58f7
commit 6939f7b3eb
2 changed files with 33 additions and 2 deletions

View File

@@ -4357,6 +4357,22 @@ class e_admin_ui extends e_admin_controller_ui
}
if(!empty($config['batchOptions']))
{
$opts = array();
foreach($config['batchOptions'] as $k=>$v)
{
$fieldName = 'batch_'.$plug.'_'.$k;
$opts[$fieldName] = $v; // ie. x_plugin_key
}
$batchCat = deftrue('LAN_PLUGIN_'.strtoupper($plug).'_NAME', $plug);
$this->batchOptions[$batchCat] = $opts;
}
if(!empty($config['tabs']))
@@ -6266,7 +6282,22 @@ class e_admin_form_ui extends e_form
{
foreach($customBatchOptions as $key=>$val)
{
$text .= $this->option($val, $key, false, array('class' => 'ui-batch-option class', 'other' => 'style="padding-left: 15px"'));
if(is_array($val))
{
$text .= $this->optgroup_open($key);
foreach($val as $k=>$v)
{
$text .= $this->option($v, $k, false, array('class' => 'ui-batch-option class', 'other' => 'style="padding-left: 15px"'));
}
$text .= $this->optgroup_close();
}
else
{
$text .= $this->option($val, $key, false, array('class' => 'ui-batch-option class', 'other' => 'style="padding-left: 15px"'));
}
}
}

View File

@@ -3923,7 +3923,7 @@ class e_form
if(!$value) $value = '0';
if($parms)
{
if(!isset($parms['sep'])) $value = number_format($value, $parms['decimals']);
if(!isset($parms['sep'])) $value = number_format($value, varset($parms['decimals'],0));
else $value = number_format($value, $parms['decimals'], vartrue($parms['point'], '.'), vartrue($parms['sep'], ' '));
}