From a242cd880445c6030c7a9c830923983bb42ef6cf Mon Sep 17 00:00:00 2001 From: Awilum Date: Mon, 17 Feb 2014 20:42:38 +0200 Subject: [PATCH] Pages Plugin: add tags field #4 --- plugins/box/pages/pages.admin.php | 12 ++++++- plugins/box/pages/views/backend/add.view.php | 31 ++++++++++++++----- plugins/box/pages/views/backend/edit.view.php | 29 +++++++++++++---- 3 files changed, 58 insertions(+), 14 deletions(-) diff --git a/plugins/box/pages/pages.admin.php b/plugins/box/pages/pages.admin.php index a3b4d46..3392852 100755 --- a/plugins/box/pages/pages.admin.php +++ b/plugins/box/pages/pages.admin.php @@ -102,6 +102,7 @@ class PagesAdmin extends Backend 'title' => $rand_page_title, 'description' => $orig_page['description'], 'keywords' => $orig_page['keywords'], + 'tags' => $orig_page['tags'], 'date' => $orig_page['date'], 'author' => $orig_page['author']))) { @@ -173,6 +174,7 @@ class PagesAdmin extends Backend 'title' => Request::post('page_title'), 'description' => Request::post('page_description'), 'keywords' => Request::post('page_keywords'), + 'tags' => Request::post('page_tags'), 'date' => $date, 'author' => $author))) { @@ -219,6 +221,7 @@ class PagesAdmin extends Backend if (Request::post('page_title')) $post_title = Request::post('page_title'); else $post_title = ''; if (Request::post('page_keywords')) $post_keywords = Request::post('page_keywords'); else $post_keywords = ''; if (Request::post('page_description')) $post_description = Request::post('page_description'); else $post_description = ''; + if (Request::post('page_tags')) $post_tags = Request::post('page_tags'); else $post_tags = ''; if (Request::post('editor')) $post_content = Request::post('editor'); else $post_content = ''; if (Request::post('templates')) $post_template = Request::post('templates'); else $post_template = 'index'; if (Request::post('status')) $post_status = Request::post('status'); else $post_status = 'published'; @@ -240,6 +243,7 @@ class PagesAdmin extends Backend ->assign('post_title', $post_title) ->assign('post_description', $post_description) ->assign('post_keywords', $post_keywords) + ->assign('post_tags', $post_tags) ->assign('post_content', $post_content) ->assign('pages_array', $pages_array) ->assign('parent_page', $parent_page) @@ -286,6 +290,7 @@ class PagesAdmin extends Backend if (Request::post('page_title')) $post_title = Request::post('page_title'); else $post_title = ''; if (Request::post('page_keywords')) $post_keywords = Request::post('page_keywords'); else $post_keywords = ''; if (Request::post('page_description')) $post_description = Request::post('page_description'); else $post_description = ''; + if (Request::post('page_tags')) $post_tags = Request::post('page_tags'); else $post_tags = ''; if (Request::post('editor')) $post_content = Request::post('editor'); else $post_content = ''; if (Request::post('templates')) $post_template = Request::post('templates'); else $post_template = 'index'; if (Request::post('status')) $post_status = Request::post('status'); else $post_status = 'published'; @@ -324,6 +329,7 @@ class PagesAdmin extends Backend 'title' => Request::post('page_title'), 'description' => Request::post('page_description'), 'keywords' => Request::post('page_keywords'), + 'tags' => Request::post('page_tags'), 'robots_index' => $robots_index, 'robots_follow'=> $robots_follow, 'status' => Request::post('status'), @@ -347,6 +353,7 @@ class PagesAdmin extends Backend 'title' => Request::post('page_title'), 'description' => Request::post('page_description'), 'keywords' => Request::post('page_keywords'), + 'tags' => Request::post('page_tags'), 'robots_index' => $robots_index, 'robots_follow'=> $robots_follow, 'status' => Request::post('status'), @@ -408,6 +415,7 @@ class PagesAdmin extends Backend if (Request::post('page_title')) $title_to_edit = Request::post('page_title'); else $title_to_edit = $page['title']; if (Request::post('page_description')) $description_to_edit = Request::post('page_description'); else $description_to_edit = $page['description']; if (Request::post('page_keywords')) $keywords_to_edit = Request::post('page_keywords'); else $keywords_to_edit = $page['keywords']; + if (Request::post('page_tags')) $tags_to_edit = Request::post('page_tags'); else $tags_to_edit = $page['tags']; if (Request::post('editor')) $to_edit = Request::post('editor'); else $to_edit = Text::toHtml($page_content); if (Request::post('robots_index')) $post_robots_index = true; else if ($page['robots_index'] == 'noindex') $post_robots_index = true; else $post_robots_index = false; @@ -440,6 +448,7 @@ class PagesAdmin extends Backend ->assign('title_to_edit', $title_to_edit) ->assign('description_to_edit', $description_to_edit) ->assign('keywords_to_edit', $keywords_to_edit) + ->assign('tags_to_edit', $tags_to_edit) ->assign('page', $page) ->assign('to_edit', $to_edit) ->assign('pages_array', $pages_array) @@ -559,7 +568,7 @@ class PagesAdmin extends Backend $count = 0; // Get pages - $pages_list = $pages->select(null, 'all', null, array('slug', 'title', 'status', 'date', 'author', 'expand', 'access', 'parent', 'template')); + $pages_list = $pages->select(null, 'all', null, array('slug', 'title', 'status', 'date', 'author', 'expand', 'access', 'parent', 'template', 'tags')); // Loop foreach ($pages_list as $page) { @@ -574,6 +583,7 @@ class PagesAdmin extends Backend $pages_array[$count]['author'] = $page['author']; $pages_array[$count]['expand'] = $page['expand']; $pages_array[$count]['slug'] = $page['slug']; + $pages_array[$count]['tags'] = $page['tags']; $pages_array[$count]['template']= $page['template']; if (isset($page['parent'])) { diff --git a/plugins/box/pages/views/backend/add.view.php b/plugins/box/pages/views/backend/add.view.php index 6550c61..ad2aea8 100644 --- a/plugins/box/pages/views/backend/add.view.php +++ b/plugins/box/pages/views/backend/add.view.php @@ -13,7 +13,7 @@
  • class="active">
  • -
    +
    -
    +
    +
    + +
    +
    - +
    +
    +
    +
    + 'form-control')) + ); + ?> + + + +
    +
    +
    +
    -
    - -
    +
    -
    +
    \ No newline at end of file diff --git a/plugins/box/pages/views/backend/edit.view.php b/plugins/box/pages/views/backend/edit.view.php index 76e8212..4cdca60 100644 --- a/plugins/box/pages/views/backend/edit.view.php +++ b/plugins/box/pages/views/backend/edit.view.php @@ -16,7 +16,7 @@
  • class="active">
  • -
    +
    -
    +
    +
    + +
    +
    - +
    +
    +
    +
    + 'form-control')) + ); + ?> + + + +
    +
    +
    +
    -
    - -
    +