mirror of
https://github.com/e107inc/e107.git
synced 2025-07-31 11:50:30 +02:00
Support for admin-ui multiple images in a single field.
Usage: 'type' => 'images', 'data' => 'array'
This commit is contained in:
@@ -3198,11 +3198,28 @@ class e_admin_controller_ui extends e_admin_controller
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'images':
|
case 'images':
|
||||||
//XXX FIXME - entities in stored result.
|
case 'files':
|
||||||
|
|
||||||
|
// XXX Cam @ SecretR: didn't work here. See model_class.php line 2046.
|
||||||
|
// if(!is_array($value))
|
||||||
|
// {
|
||||||
|
// $value = e107::unserialize($value);
|
||||||
|
// }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
if($attributes['serialize'] == true)
|
||||||
|
{
|
||||||
|
$attributes['data'] = 'array';
|
||||||
|
}
|
||||||
|
|
||||||
|
if($attributes['data'] != 'array')
|
||||||
|
{
|
||||||
|
$value = e107::unserialize($value);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
if(vartrue($attributes['dataPath']))
|
if(vartrue($attributes['dataPath']))
|
||||||
{
|
{
|
||||||
|
@@ -3358,18 +3358,20 @@ class e_form
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'images':
|
case 'images':
|
||||||
|
// return print_a($value, true);
|
||||||
$value = str_replace(''',"'",html_entity_decode($value)); //FIXME @SecretR Horrible workaround to Line 3203 of admin_ui.php
|
|
||||||
$ival = e107::unserialize($value);
|
|
||||||
|
|
||||||
for ($i=0; $i < 5; $i++)
|
for ($i=0; $i < 5; $i++)
|
||||||
{
|
{
|
||||||
$k = $key.'[path]['.$i.']';
|
$k = $key.'['.$i.'][path]';
|
||||||
$ret .= $this->imagepicker($k, $ival['path'][$i], defset($label, $label), $parms);
|
$ival = $value[$i]['path'];
|
||||||
|
|
||||||
|
$ret .= $this->imagepicker($k, $ival, defset($label, $label), $parms);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
//TODO 'files'
|
||||||
|
|
||||||
case 'file': //TODO - thumb, image list shortcode, js tooltip...
|
case 'file': //TODO - thumb, image list shortcode, js tooltip...
|
||||||
$label = varset($parms['label'], 'LAN_EDIT');
|
$label = varset($parms['label'], 'LAN_EDIT');
|
||||||
unset($parms['label']);
|
unset($parms['label']);
|
||||||
|
@@ -2041,6 +2041,13 @@ class e_front_model extends e_model
|
|||||||
*/
|
*/
|
||||||
public function getIfPosted($key, $default = '', $index = null)
|
public function getIfPosted($key, $default = '', $index = null)
|
||||||
{
|
{
|
||||||
|
$d = $this->getDataFields();
|
||||||
|
|
||||||
|
if($d[$key] == 'array')
|
||||||
|
{
|
||||||
|
return e107::unserialize($this->getData((string) $key, $default, $index));
|
||||||
|
}
|
||||||
|
|
||||||
$posted = $this->getPostedData((string) $key, null, $index);
|
$posted = $this->getPostedData((string) $key, null, $index);
|
||||||
if(null !== $posted)
|
if(null !== $posted)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user