diff --git a/bl-kernel/admin/views/editor.php b/bl-kernel/admin/views/editor.php index 674c6c8e..5ad58fbe 100644 --- a/bl-kernel/admin/views/editor.php +++ b/bl-kernel/admin/views/editor.php @@ -135,12 +135,21 @@ // Ctrl+S or Command+S if ((event.ctrlKey || event.metaKey) && event.which == 83) { event.preventDefault(); + + // Parse all custom fields inputs var customFields = {} $('input[name^="custom"]').each(function() { var field = $(this).data('field') var value = $(this).val() customFields[field] = value }); + $('select[name^="custom"]').each(function() { + var field = $(this).data('field'); + var value = $(this).val(); + customFields[field] = value; + }); + + // Create array with all inputs var args = { slug: $('#friendlyURL').val(), title: $('#title').val(), @@ -190,12 +199,20 @@ }); $('#btnSave').on('click', function() { + // Parse all custom fields inputs var customFields = {} $('input[name^="custom"]').each(function() { var field = $(this).data('field') var value = $(this).val() customFields[field] = value }); + $('select[name^="custom"]').each(function() { + var field = $(this).data('field'); + var value = $(this).val(); + customFields[field] = value; + }); + + // Create array with all inputs var args = { slug: $('#friendlyURL').val(), title: $('#title').val(), @@ -393,13 +410,20 @@ return false; } + // Parse all custom fields inputs var customFields = {} $('input[name^="custom"]').each(function() { var field = $(this).data('field') var value = $(this).val() customFields[field] = value }); + $('select[name^="custom"]').each(function() { + var field = $(this).data('field'); + var value = $(this).val(); + customFields[field] = value; + }); + // Create array with all inputs var args = { slug: $('#friendlyURL').val(), title: $('#title').val(), @@ -697,12 +721,12 @@ 'data' => array('field' => $field) )); } elseif ($options['type']=="bool") { - echo Bootstrap::formCheckbox(array( - 'name'=>'custom['.$field.']', - 'label'=>(isset($options['label'])?$options['label']:''), - 'placeholder'=>(isset($options['placeholder'])?$options['placeholder']:''), - 'checked'=>(($pageKey && $page->custom($field))?true:false), - 'labelForCheckbox'=>(isset($options['tip'])?$options['tip']:''), + echo Bootstrap::formSelectBlock(array( + 'name' => 'custom['.$field.']', + 'label' => (isset($options['label'])?$options['label']:''), + 'options' => array('true' => $L->g('Enabled'), 'false' => $L->g('Disabled')), + 'selected' => (($pageKey && $page->custom($field))?'true':'false'), + 'tip' => (isset($options['tip'])?$options['tip']:''), 'data' => array('field' => $field) )); } @@ -732,12 +756,12 @@ 'data' => array('field' => $field) )); } elseif ($options['type']=="bool") { - echo Bootstrap::formCheckbox(array( - 'name'=>'custom['.$field.']', - 'label'=>(isset($options['label'])?$options['label']:''), - 'placeholder'=>(isset($options['placeholder'])?$options['placeholder']:''), - 'checked'=>(($pageKey && $page->custom($field))?true:false), - 'labelForCheckbox'=>(isset($options['tip'])?$options['tip']:''), + echo Bootstrap::formSelectBlock(array( + 'name' => 'custom['.$field.']', + 'label' => (isset($options['label'])?$options['label']:''), + 'options' => array('true' => $L->g('Enabled'), 'false' => $L->g('Disabled')), + 'selected' => (($pageKey && $page->custom($field))?'true':'false'), + 'tip' => (isset($options['tip'])?$options['tip']:''), 'data' => array('field' => $field) )); } @@ -810,6 +834,37 @@ + + + customFields(); + foreach ($customFields as $field=>$options) { + if ( isset($options['position']) && ($options['position']=='menu') ) { + if ($options['type']=="string") { + echo '
Thanks for chose Bludit and welcome to our community, we are growing up everyday and is awesome.
-Follow Bludit in different social networks:
+'Thank you for choosing Bludit and welcome to our community, we are growing every day and it\'s amazing.
+Follow Bludit on different social networks:
-Take a look to the plugins and themes:
+Take a look at the plugins and themes:
-Do you need support or you want to read about Bludit, check our official documentation or participate in our forum.
+Do you need support? or want to read about Bludit, consult our official documentation or participate in our forum
Improve your site information and metadata. Include a site description to refine your ranking on the search engines, add social networks, include a site logo with your brand.
+Improve your site information and metadata. Include a site description to refine your ranking on the search engines, add social networks, and include a site logo with your brand.
Bludit supports a variety of languages and time zones. Choose the option that best suits you and your visitors.
Bludit supports Markdown, you just need to enable the right editor to work with it.