mirror of
https://github.com/e107inc/e107.git
synced 2025-06-09 12:35:03 +02:00
Admin-ui: When type='image' and optArray has been set, will render a set selection of inline images.
This commit is contained in:
parent
1c77e12454
commit
a80e6c52f0
@ -5384,6 +5384,14 @@ class e_form
|
|||||||
case 'video':
|
case 'video':
|
||||||
case 'image': //TODO - thumb, image list shortcode, js tooltip...
|
case 'image': //TODO - thumb, image list shortcode, js tooltip...
|
||||||
$label = varset($parms['label'], 'LAN_EDIT');
|
$label = varset($parms['label'], 'LAN_EDIT');
|
||||||
|
|
||||||
|
if(!empty($parms['optArray']))
|
||||||
|
{
|
||||||
|
|
||||||
|
return $this->imageradio($key,$value,$parms);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
unset($parms['label']);
|
unset($parms['label']);
|
||||||
|
|
||||||
if($attributes['type'] === 'video')
|
if($attributes['type'] === 'video')
|
||||||
@ -5392,6 +5400,7 @@ class e_form
|
|||||||
$parms['w'] = 280;
|
$parms['w'] = 280;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$ret = $this->imagepicker($key, $value, defset($label, $label), $parms);
|
$ret = $this->imagepicker($key, $value, defset($label, $label), $parms);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -5733,6 +5742,46 @@ class e_form
|
|||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private function imageradio($name,$value,$parms)
|
||||||
|
{
|
||||||
|
|
||||||
|
if(!empty($parms['path']))
|
||||||
|
{
|
||||||
|
$parms['legacy'] = $parms['path'];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$text = '<div class="clearfix">';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
foreach($parms['optArray'] as $key=>$val)
|
||||||
|
{
|
||||||
|
$thumbnail = e107::getParser()->toImage($val,$parms);
|
||||||
|
|
||||||
|
// $thumbnail = "<img class='img-responsive img-fluid thumbnail' src='".$preview ."' alt='".$val."' />";
|
||||||
|
|
||||||
|
|
||||||
|
$selected = ($val == $value) ? " checked" : "";
|
||||||
|
|
||||||
|
$text .= "
|
||||||
|
<div class='col-md-2 e-image-radio' >
|
||||||
|
<label class='theme-selection' title=\"".$key."\"><input type='radio' name='".$name."' value='{$val}' required='required' $selected />
|
||||||
|
<div>".$thumbnail."</div>
|
||||||
|
</label>
|
||||||
|
</div>";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
$text .= "</div>";
|
||||||
|
|
||||||
|
return $text;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generic List Form, used internally by admin UI
|
* Generic List Form, used internally by admin UI
|
||||||
* Expected options array format:
|
* Expected options array format:
|
||||||
|
@ -95,6 +95,16 @@ cursor: help;
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.e-image-radio { padding-left:0;}
|
||||||
|
|
||||||
|
.e-image-radio label > input { visibility: hidden; position: absolute; }
|
||||||
|
.e-image-radio label > input + div{ cursor:pointer; border:2px solid transparent; border-radius:4px;height: 60px; padding: 5px; vertical-align: middle; }
|
||||||
|
.e-image-radio label > input:checked + div { border:2px solid #337ab7; }
|
||||||
|
.e-image-radio label > input + div span { visibility: hidden; float:right; margin-right:10px; color:#337ab7 }
|
||||||
|
.e-image-radio label > input:checked + div span { visibility: initial; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* TODO - use col-xx-x markup where core-mainpanel-block occurs. ? */
|
/* TODO - use col-xx-x markup where core-mainpanel-block occurs. ? */
|
||||||
@media (max-width: 1700px){
|
@media (max-width: 1700px){
|
||||||
.core-mainpanel-block { width:25%; }
|
.core-mainpanel-block { width:25%; }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user