1
0
mirror of https://github.com/e107inc/e107.git synced 2025-04-20 12:41:51 +02:00

Admin-UI: Added inline editing option for type=language

This commit is contained in:
Cameron 2014-11-19 13:03:30 -08:00
parent f88f3f5494
commit d9caa009d4
3 changed files with 17 additions and 11 deletions

View File

@ -678,7 +678,7 @@ class media_admin_ui extends e_admin_ui
'media_dimensions' => array('title'=> "Dimensions", 'type' => 'text', 'data'=> 'str', 'width' => '5%', 'readonly'=>TRUE, 'class'=>'nowrap','noedit'=>TRUE),
'media_userclass' => array('title'=> LAN_USERCLASS, 'type' => 'userclass', 'data'=> 'str', 'inline'=>true, 'width' => '10%', 'thclass' => 'center','filter'=>TRUE,'batch'=>TRUE ),
'media_tags' => array('title'=> "Tags/Keywords", 'type' => 'tags', 'data'=> 'str', 'width' => '10%', 'filter'=>TRUE,'batch'=>TRUE ),
'media_usedby' => array('title'=> 'Used by', 'type' => '', 'data'=> 'text', 'width' => 'auto', 'thclass' => 'center', 'class'=>'center', 'nolist'=>true, 'readonly'=>TRUE ),
'media_usedby' => array('title'=> 'Used by', 'type' => 'hidden', 'data'=> 'text', 'width' => 'auto', 'thclass' => 'center', 'class'=>'center', 'nolist'=>true, 'readonly'=>TRUE ),
'options' => array('title'=> LAN_OPTIONS, 'type' => 'method', 'data'=> null, 'forced'=>TRUE, 'width' => '10%', 'thclass' => 'center last', 'class' => 'center', 'batch'=>true, 'noedit'=>true)
);

View File

@ -5737,6 +5737,7 @@ class e_admin_form_ui extends e_form
}
break;
case 'language': // full list of
case 'lanlist': // use the array $parm;
if(!is_array(varset($parms['__options']))) parse_str($parms['__options'], $parms['__options']);
$opts = $parms['__options'];
@ -5745,7 +5746,7 @@ class e_admin_form_ui extends e_form
// no batch support for multiple, should have some for filters soon
continue;
}
$options = e107::getLanguage()->getLanSelectArray();
$options = ($val['type'] === 'language') ? e107::getLanguage()->getList() : e107::getLanguage()->getLanSelectArray();
foreach($options as $code => $name)
{
$option[$key.'__'.$code] = $name;

View File

@ -3393,19 +3393,24 @@ class e_form
break;
case 'language': // All Known Languages.
if(!empty($value))
{
if(strlen($value) === 2)
{
return e107::getLanguage()->convert($value);
}
else
{
return $value;
}
$_value = $value;
if(strlen($value) === 2)
{
$value = e107::getLanguage()->convert($value);
}
}
if(!vartrue($attributes['noedit']) && vartrue($parms['editable']))
{
$wparms = e107::getLanguage()->getList();
return $this->renderInline($field, $id, $attributes['title'], $_value, $value, 'select', $wparms);
}
return $value;
break;
case 'lanlist': // installed languages.