Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Database/Seeds/DatabaseTableSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ class DatabaseTableSeeder extends Seeder
public function run()
{
$this->seedFields();
$file = __DIR__ . '/json/content_types.json';
CmsSeeder::contentTypes($file);
}

//---------------------------------------------------------------
Expand Down
39 changes: 39 additions & 0 deletions Database/Seeds/json/content_types.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
[
{
"content": {
"name": "Pages",
"slug": "pages",
"plural": "Pages",
"plural_slug": "Pages",
"singular": "Page",
"singular_slug": "page",
"excerpt": "Web Pages",
"is_published": 1,
"is_commentable": null,
"content_statuses": [
"draft",
"published"
]
},
"groups": [
{
"name": "Default",
"slug": "default",
"fields": [
{
"name": "Content",
"type": {
"slug": "editor"
}
},
{
"name": "SEO Meta Tags",
"type": {
"slug": "seo-meta-tags"
}
}
]
}
]
}
]
8 changes: 4 additions & 4 deletions Entities/Content.php
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,7 @@ public static function postStore($request,$id)

}
//-------------------------------------------------
public static function storeFormGroups(Content $content, $groups)
public static function storeFormGroups(Content $content, $groups, $type = null)
{

$i = 0;
Expand All @@ -786,7 +786,7 @@ public static function storeFormGroups(Content $content, $groups)
$stored_field = ContentFormField::where('vh_cms_form_group_id', $field['vh_cms_form_group_id'])
->where('vh_cms_form_field_id', $field['id'])
->where('vh_cms_content_id', $content->id)
->where('vh_cms_form_group_index', $key)
->where('vh_cms_form_group_index', $type?0:$key)
->first();

}
Expand All @@ -797,7 +797,7 @@ public static function storeFormGroups(Content $content, $groups)
$stored_field->vh_cms_content_id = $content->id;
$stored_field->vh_cms_form_group_id = $group['id'];
$stored_field->vh_cms_form_field_id = $field['id'];
$stored_field->vh_cms_form_group_index = $key;
$stored_field->vh_cms_form_group_index = $type?0:$key;

$stored_field->save();
}
Expand Down Expand Up @@ -869,7 +869,7 @@ public static function storeFormGroups(Content $content, $groups)

if(count($row_to_delete_ids) > 0)
{
ContentFormRelation::where('vh_cms_content_form_field_id', $related_item->id)
ContentFormRelation::where('vh_cms_content_form_field_id', $related_item->id)
->whereIn('relatable_id', $row_to_delete_ids)
->forceDelete();

Expand Down
16 changes: 14 additions & 2 deletions Helpers/cms.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ function get_group(Content $content, $group_slug='default', $type='content',
}
//-----------------------------------------------------------------------------------
function get_the_group(Content $content, $group_slug='default', $type='content',
$group_index = null )
$group_index = null )
{
if($type=='content')
{
Expand Down Expand Up @@ -469,7 +469,7 @@ function get_all_group_field(Content $content, $type,
}
//-----------------------------------------------------------------------------------
function get_template_content_field(Content $content, $group_slug='default',
$group_index = null , $return_html=true)
$group_index = null , $return_html=true)
{

if(!$return_html){
Expand Down Expand Up @@ -743,6 +743,18 @@ function setReturnValue($field,$field_index = null,

break;

case 'image':

if($field['meta']->is_hidden){
return null;
}

$value .= $field['meta']->opening_tag."\n";
$value .= '<img class="image" src="'.$field['content'].'"/>'."\n";
$value .= $field['meta']->closing_tag."\n";

break;

case 'list':

if($field['meta']->is_hidden){
Expand Down
49 changes: 49 additions & 0 deletions Http/Controllers/Backend/ExtendController.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,5 +143,54 @@ public static function sidebarMenu()
return $response;
}
//----------------------------------------------------------
public function getDashboardItems()
{

$data = array();

$data['next_steps'] = [
[
'name' => 'View Pages',
'icon' => 'eye',
'link' => self::$link."contents/pages/list"
],
[
'name' => 'Add Pages',
'icon' => 'plus',
'link' => self::$link."contents/pages/list/create"
],
[
'name' => 'Add a Content Type',
'icon' => 'edit',
'link' => self::$link."content-types/create"
]
];


$data['actions'] = [
[
'name' => 'Manage Menus',
'icon' => 'bars',
'link' => self::$link."menus/"
],
[
'name' => 'Manage Blocks',
'icon' => 'th-large',
'link' => self::$link."blocks/"
],
[
'name' => 'Learn more about CMS',
'icon' => 'graduation-cap',
'open_in_new_tab' => true,
'link' => "https://docs.vaah.dev/vaahcms/cms/introduction.html"
]
];

$response['status'] = 'success';
$response['data'] = $data;

return $response;
}
//----------------------------------------------------------

}
4 changes: 2 additions & 2 deletions Libraries/CmsSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -355,8 +355,8 @@ public static function createSampleField($theme_slug, $file_path, $content_type_
$content_groups = self::fillFields($content_type['groups'],$json_content);
$template_groups = self::fillFields($template['groups'],$json_template);

Content::storeFormGroups($content, [$content_groups]);
Content::storeFormGroups($content, [$template_groups]);
Content::storeFormGroups($content, [$content_groups], 'seeds');
Content::storeFormGroups($content, [$template_groups] , 'seeds');

}

Expand Down
2 changes: 1 addition & 1 deletion Resources/assets/build/app.js

Large diffs are not rendered by default.

16 changes: 4 additions & 12 deletions Resources/assets/build/app.js.LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*/

/*!
* FilePond 4.29.0
* FilePond 4.30.3
* Licensed under MIT, https://opensource.org/licenses/MIT/
* Please visit https://pqina.nl/filepond/ for details.
*/
Expand All @@ -35,7 +35,7 @@
*/

/*!
* FilePondPluginFileValidateSize 2.2.4
* FilePondPluginFileValidateSize 2.2.5
* Licensed under MIT, https://opensource.org/licenses/MIT/
* Please visit https://pqina.nl/filepond/ for details.
*/
Expand All @@ -59,7 +59,7 @@
*/

/*!
* FilePondPluginImagePreview 4.6.8
* FilePondPluginImagePreview 4.6.10
* Licensed under MIT, https://opensource.org/licenses/MIT/
* Please visit https://pqina.nl/filepond/ for details.
*/
Expand Down Expand Up @@ -109,14 +109,6 @@
* Date: 2021-03-02T17:08Z
*/

/*!
* jodit - Jodit is awesome and usefully wysiwyg editor with filebrowser
* Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/)
* Version: v3.7.2
* Url: https://xdsoft.net/jodit/
* License(s): MIT
*/

/*!
* jsoneditor.js
*
Expand Down Expand Up @@ -190,4 +182,4 @@

//! moment.js locale configuration

//! version : 0.5.33
//! version : 0.5.34
1 change: 1 addition & 0 deletions Vue/pages/contents/partials/ContentFields.vue
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
:key="f_index">

<div v-if="!field.content || typeof field.content === 'string'
|| typeof field.content === 'number'
|| assets.non_repeatable_fields.includes(field.type.slug)"
class="columns is-gapless">
<div class="column" >
Expand Down
15 changes: 0 additions & 15 deletions Vue/pages/contents/partials/ContentFieldsJs.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,27 +66,12 @@ export default {
if(field_index == null){
if(group_index === 0){
code = "{!! get_field($data, '"+field.slug+"', '"+group.slug+"') !!}";

if(field.type.slug == 'image')
{
code = "<img src='{{get_field($data, '"+field.slug+"', '"+group.slug+"')'/>";
}
}else{
code = "{!! get_field($data, '"+field.slug+"', '"+group.slug+"','content' , "+group_index+") !!}";

if(field.type.slug == 'image')
{
code = "<img src='{{get_field($data, '"+field.slug+"', '"+group.slug+"','content' , "+group_index+")'/>";
}
}

}else{
code = "{!! get_field($data, '"+field.slug+"', '"+group.slug+"','content' , "+group_index+", "+field_index+") !!}";

if(field.type.slug == 'image')
{
code = "<img src='{{get_field($data, '"+field.slug+"', '"+group.slug+"','content' , "+group_index+", "+field_index+")'/>";
}
}

copy(code);
Expand Down
1 change: 1 addition & 0 deletions Vue/pages/contents/partials/TemplateFields.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
:key="f_index">

<div v-if="!field.content || typeof field.content === 'string'
|| typeof field.content === 'number'
|| assets.non_repeatable_fields.includes(field.type.slug)"
class="columns is-gapless">
<div class="column" >
Expand Down
18 changes: 2 additions & 16 deletions Vue/pages/contents/partials/TemplateFieldsJs.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export default {
props:['groups'],
computed: {
root() {return this.$store.getters['root/state']},
assets() {return this.$store.getters[namespace+'/state'].assets},
ajax_url() {return this.$store.getters[namespace+'/state'].ajax_url},
},
components:{
Expand Down Expand Up @@ -49,27 +50,12 @@ export default {
if(field_index == null){
if(group_index === 0){
code = "{!! get_field($data, '"+field.slug+"', '"+group.slug+"','template') !!}";

if(field.type.slug == 'image')
{
code = "<img src='{{get_field($data, '"+field.slug+"', '"+group.slug+"','template')'/>";
}
}else{
code = "{!! get_field($data, '"+field.slug+"', '"+group.slug+"','template' , "+group_index+") !!}";

if(field.type.slug == 'image')
{
code = "<img src='{{get_field($data, '"+field.slug+"', '"+group.slug+"','template' , "+group_index+")'/>";
}
}

}else{
code = "{!! get_field($data, '"+field.slug+"', '"+group.slug+"','template' , "+group_index+", "+field_index+") !!}";

if(field.type.slug == 'image')
{
code = "<img src='{{get_field($data, '"+field.slug+"', '"+group.slug+"','template' , "+group_index+", "+field_index+")'/>";
}
}


Expand Down Expand Up @@ -156,7 +142,7 @@ export default {
removeGroupAfter: function (data,res) {
this.$Progress.finish();
},
//---------------------------------------------------------------------
//---------------------------------------------------------------------
copyGroupCode: function (group,group_index = null)
{

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vaahcms/cms",
"description": "Cms",
"version": "0.1.7",
"version": "0.1.8",
"authors": [
{
"name": "vaah",
Expand Down