1
0
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:
Cameron
2018-08-14 17:06:02 -07:00
parent a7ab8a7a62
commit 5a31146fcc
4 changed files with 250 additions and 9 deletions

View File

@@ -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);
}