From 3fda57bbb4b3506f4f71396756c4c005d80810c3 Mon Sep 17 00:00:00 2001 From: Awilum Date: Sun, 11 Nov 2012 22:37:09 +0200 Subject: [PATCH] Pages Plugin: clone action improvements. --- plugins/box/pages/pages.admin.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/box/pages/pages.admin.php b/plugins/box/pages/pages.admin.php index 0cf2227..70e53fb 100755 --- a/plugins/box/pages/pages.admin.php +++ b/plugins/box/pages/pages.admin.php @@ -123,6 +123,9 @@ // Get original page $orig_page = $pages->select('[slug="'.Request::get('name').'"]', null); + // Generate rand page title + $rand_page_title = $orig_page['title'].' [copy]'; + // Clone page if ($pages->insert(array('slug' => $rand_page_name, 'template' => $orig_page['template'], @@ -130,8 +133,9 @@ 'robots_index' => $orig_page['robots_index'], 'robots_follow'=> $orig_page['robots_follow'], 'status' => $orig_page['status'], - 'access' => $orig_page['access'], - 'title' => $rand_page_name, + 'access' => (isset($orig_page['access'])) ? $orig_page['access'] : 'public', + 'expand' => (isset($orig_page['expand'])) ? $orig_page['expand'] : '0', + 'title' => $rand_page_title, 'description' => $orig_page['description'], 'keywords' => $orig_page['keywords'], 'date' => $orig_page['date'],