diff --git a/bl-kernel/admin/themes/booty/init.php b/bl-kernel/admin/themes/booty/init.php index 00a3463a..80aeb2c0 100644 --- a/bl-kernel/admin/themes/booty/init.php +++ b/bl-kernel/admin/themes/booty/init.php @@ -113,18 +113,23 @@ EOF; } $tip = ''; - if (isset($args['tip'])) { + if (!empty($args['tip'])) { $tip = ''.$args['tip'].''; } - $label = ''; - if (isset($args['label'])) { - $label = ''; + $class = 'form-group m-0'; + if (isset($args['class'])) { + $class = $args['class']; } - $class = 'form-control'; - if (isset($args['class'])) { - $class = $class.' '.$args['class']; + $labelClass = 'mt-4 mb-2 pb-2 border-bottom text-uppercase w-100'; + if (isset($args['labelClass'])) { + $labelClass = $args['labelClass']; + } + + $label = ''; + if (!empty($args['label'])) { + $label = ''; } $type = 'text'; @@ -133,9 +138,9 @@ EOF; } return << +
$label - + $tip
EOF; @@ -275,7 +280,12 @@ EOF; $class = 'form-group m-0'; if (isset($args['class'])) { - $class = $class.' '.$args['class']; + $class = $args['class']; + } + + $labelClass = 'mt-4 mb-2 pb-2 border-bottom text-uppercase w-100'; + if (isset($args['labelClass'])) { + $labelClass = $args['labelClass']; } $type = 'text'; @@ -285,7 +295,7 @@ EOF; $label = ''; if (!empty($args['label'])) { - $label = ''; + $label = ''; } $checked = $args['checked']?'checked':''; diff --git a/bl-kernel/admin/views/edit-content.php b/bl-kernel/admin/views/edit-content.php index cd0a6b26..61987ee9 100644 --- a/bl-kernel/admin/views/edit-content.php +++ b/bl-kernel/admin/views/edit-content.php @@ -53,7 +53,7 @@ echo Bootstrap::formOpen(array( ?> -
+
@@ -292,24 +292,26 @@ echo Bootstrap::formOpen(array(
+ +customFields(); + foreach ($customFields as $field=>$options) { + if ( isset($options['position']) && ($options['position']=='top') ) { + if ($options['type']=="string") { + echo Bootstrap::formInputTextBlock(array( + 'name'=>'custom['.$field.']', + 'label'=>(isset($options['label'])?$options['label']:''), + 'value'=>$page->custom($field), + 'tip'=>(isset($options['tip'])?$options['tip']:''), + 'placeholder'=>(isset($options['placeholder'])?$options['placeholder']:''), + 'class'=>'mb-2', + 'labelClass'=>'mb-2 pb-2 border-bottom text-uppercase w-100' + + )); + } elseif ($options['type']=="bool") { + echo Bootstrap::formCheckbox(array( + 'name'=>'custom['.$field.']', + 'label'=>(isset($options['label'])?$options['label']:''), + 'placeholder'=>(isset($options['placeholder'])?$options['placeholder']:''), + 'checked'=>$page->custom($field), + 'labelForCheckbox'=>(isset($options['tip'])?$options['tip']:''), + 'class'=>'mb-2', + 'labelClass'=>'mb-2 pb-2 border-bottom text-uppercase w-100' + )); + } + } + } +?> + -
+
+ +customFields(); + foreach ($customFields as $field=>$options) { + if ( isset($options['position']) && ($options['position']=='bottom') ) { + if ($options['type']=="string") { + echo Bootstrap::formInputTextBlock(array( + 'name'=>'custom['.$field.']', + 'label'=>(isset($options['label'])?$options['label']:''), + 'value'=>$page->custom($field), + 'tip'=>(isset($options['tip'])?$options['tip']:''), + 'placeholder'=>(isset($options['placeholder'])?$options['placeholder']:''), + 'class'=>'mt-2', + 'labelClass'=>'mb-2 pb-2 border-bottom text-uppercase w-100' + + )); + } elseif ($options['type']=="bool") { + echo Bootstrap::formCheckbox(array( + 'name'=>'custom['.$field.']', + 'label'=>(isset($options['label'])?$options['label']:''), + 'placeholder'=>(isset($options['placeholder'])?$options['placeholder']:''), + 'checked'=>$page->custom($field), + 'labelForCheckbox'=>(isset($options['tip'])?$options['tip']:''), + 'class'=>'mt-2', + 'labelClass'=>'mb-2 pb-2 border-bottom text-uppercase w-100' + )); + } + } + } +?> + diff --git a/bl-kernel/admin/views/new-content.php b/bl-kernel/admin/views/new-content.php index fd1aa61a..83c727d9 100644 --- a/bl-kernel/admin/views/new-content.php +++ b/bl-kernel/admin/views/new-content.php @@ -47,7 +47,7 @@ echo Bootstrap::formOpen(array( ?> -
+
@@ -267,23 +267,25 @@ echo Bootstrap::formOpen(array(
+ +customFields(); + foreach ($customFields as $field=>$options) { + if ( isset($options['position']) && ($options['position']=='top') ) { + if ($options['type']=="string") { + echo Bootstrap::formInputTextBlock(array( + 'name'=>'custom['.$field.']', + 'label'=>(isset($options['label'])?$options['label']:''), + 'value'=>(isset($options['default'])?$options['default']:''), + 'tip'=>(isset($options['tip'])?$options['tip']:''), + 'placeholder'=>(isset($options['placeholder'])?$options['placeholder']:''), + 'class'=>'mb-2', + 'labelClass'=>'mb-2 pb-2 border-bottom text-uppercase w-100' + + )); + } elseif ($options['type']=="bool") { + echo Bootstrap::formCheckbox(array( + 'name'=>'custom['.$field.']', + 'label'=>(isset($options['label'])?$options['label']:''), + 'placeholder'=>(isset($options['placeholder'])?$options['placeholder']:''), + 'checked'=>(isset($options['checked'])?true:false), + 'labelForCheckbox'=>(isset($options['tip'])?$options['tip']:''), + 'class'=>'mb-2', + 'labelClass'=>'mb-2 pb-2 border-bottom text-uppercase w-100' + )); + } + } + } +?> + -
+
+ +customFields(); + foreach ($customFields as $field=>$options) { + if ( isset($options['position']) && ($options['position']=='bottom') ) { + if ($options['type']=="string") { + echo Bootstrap::formInputTextBlock(array( + 'name'=>'custom['.$field.']', + 'label'=>(isset($options['label'])?$options['label']:''), + 'value'=>(isset($options['default'])?$options['default']:''), + 'tip'=>(isset($options['tip'])?$options['tip']:''), + 'placeholder'=>(isset($options['placeholder'])?$options['placeholder']:''), + 'class'=>'mt-2', + 'labelClass'=>'mb-2 pb-2 border-bottom text-uppercase w-100' + + )); + } elseif ($options['type']=="bool") { + echo Bootstrap::formCheckbox(array( + 'name'=>'custom['.$field.']', + 'label'=>(isset($options['label'])?$options['label']:''), + 'placeholder'=>(isset($options['placeholder'])?$options['placeholder']:''), + 'checked'=>(isset($options['checked'])?true:false), + 'labelForCheckbox'=>(isset($options['tip'])?$options['tip']:''), + 'class'=>'mt-2', + 'labelClass'=>'mb-2 pb-2 border-bottom text-uppercase w-100' + )); + } + } + } +?> +