mirror of
https://github.com/e107inc/e107.git
synced 2025-07-31 03:40:37 +02:00
Issue #3103 Default custom-fields page example added to bootstrap3 install. Custom-fields class tweaked.
This commit is contained in:
@@ -138,6 +138,11 @@
|
||||
|
||||
$fieldType = $this->_config[$key]['type'];
|
||||
|
||||
if($value === null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
switch($fieldType)
|
||||
{
|
||||
case "dropdown":
|
||||
@@ -147,6 +152,12 @@
|
||||
break;
|
||||
|
||||
case "video":
|
||||
|
||||
if(empty($value))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return ($raw) ? 'https://www.youtube.com/watch?v='.str_replace(".youtube", '', $value) : $tp->toVideo($value);
|
||||
break;
|
||||
|
||||
@@ -195,7 +206,12 @@
|
||||
break;
|
||||
|
||||
case "progressbar":
|
||||
return ($raw) ? $value.'%' : e107::getForm()->progressBar($key,$value,$this->_config[$key]);
|
||||
if($raw)
|
||||
{
|
||||
return (strpos($value, '/') === false) ? $value.'%' : $value;
|
||||
}
|
||||
|
||||
return e107::getForm()->progressBar($key,$value,$this->_config[$key]);
|
||||
break;
|
||||
|
||||
case "textarea":
|
||||
@@ -204,6 +220,29 @@
|
||||
break;
|
||||
|
||||
|
||||
case "boolean":
|
||||
if($raw)
|
||||
{
|
||||
return $value;
|
||||
}
|
||||
|
||||
return empty($value) ? $tp->toGlyph('fa-times') : $tp->toGlyph('fa-check');
|
||||
break;
|
||||
|
||||
case "checkbox":
|
||||
if($raw)
|
||||
{
|
||||
return $value;
|
||||
}
|
||||
|
||||
if(is_numeric($value))
|
||||
{
|
||||
return empty($value) ? $tp->toGlyph('fa-times') : $tp->toGlyph('fa-check');
|
||||
}
|
||||
|
||||
return $value;
|
||||
break;
|
||||
|
||||
default:
|
||||
return $tp->toHtml($value);
|
||||
}
|
||||
|
Reference in New Issue
Block a user