Nested Pages - Version 1.3.0

Version Description

  • All public post types are now supported, both hierarchical and non-hierarchical. To enabled the Nested Pages interface for additional post types, visit Settings > Nested Pages and select the "Post Types" tab. The generated nav menu is tied to the pages type, which is enabled by default.
  • New interface for adding top-level posts/pages in bulk
  • New "Empty Trash" link for quickly emptying trash on enabled post types
  • Dutch translation (Provided by Arno Vije)
Download this release

Release Info

Developer kylephillips
Plugin Icon 128x128 Nested Pages
Version 1.3.0
Comparing to
See all releases

Code changes from version 1.2.1 to 1.3.0

Files changed (107) hide show
  1. app/Activation/Dependencies.php +16 -3
  2. app/Activation/Updates/Updates.php +17 -0
  3. app/Bootstrap.php +2 -13
  4. app/Config/Settings.php +9 -5
  5. app/Controllers/AdminMenuController.php +0 -103
  6. app/Controllers/AdminSubmenuController.php +0 -59
  7. app/Controllers/PageListingController.php +0 -341
  8. app/Entities/AdminMenu/AdminMenu.php +35 -0
  9. app/Entities/AdminMenu/AdminSubmenu.php +89 -0
  10. app/Entities/AdminMenu/AdminSubmenuDefault.php +61 -0
  11. app/Entities/AdminMenu/AdminSubmenuExpander.php +101 -0
  12. app/Entities/AdminMenu/EnabledMenus.php +148 -0
  13. app/Entities/Confirmation/TrashConfirmation.php +1 -1
  14. app/Entities/DefaultList/DefaultListFactory.php +39 -0
  15. app/Entities/DefaultList/NestedViewLink.php +53 -0
  16. app/Entities/Listing/Listing.php +282 -0
  17. app/Entities/Listing/ListingRepository.php +15 -0
  18. app/Entities/{NavMenu.php → NavMenu/NavMenu.php} +1 -1
  19. app/Entities/Post/PostDataFactory.php +96 -0
  20. app/Entities/Post/PostFactory.php +22 -9
  21. app/Entities/Post/PostRepository.php +46 -345
  22. app/Entities/Post/PostUpdateRepository.php +344 -0
  23. app/Entities/PostType/PostTypeRepository.php +147 -6
  24. app/Entities/User/UserRepository.php +31 -0
  25. app/Form/FormActionFactory.php +5 -2
  26. app/Form/Handlers/BaseHandler.php +25 -8
  27. app/Form/Handlers/EmptyTrashHandler.php +22 -0
  28. app/Form/Handlers/ListingSortHandler.php +74 -0
  29. app/Form/Handlers/NestToggleHandler.php +4 -6
  30. app/Form/Handlers/NewChildHandler.php +1 -1
  31. app/Form/Handlers/NewLinkHandler.php +1 -1
  32. app/Form/Handlers/QuickEditHandler.php +1 -1
  33. app/Form/Handlers/QuickEditLinkHandler.php +1 -1
  34. app/Form/Handlers/SortHandler.php +1 -1
  35. app/Helpers.php +2 -2
  36. app/NestedPages.php +1 -1
  37. app/Redirects.php +1 -14
  38. app/Views/forms/bulk-add.php +13 -0
  39. app/Views/{link-form.php → forms/link-form.php} +0 -0
  40. app/Views/{new-child.php → forms/new-child.php} +19 -5
  41. app/Views/{quickedit-redirect.php → forms/quickedit-link.php} +0 -0
  42. app/Views/{quickedit.php → forms/quickedit-post.php} +7 -2
  43. app/Views/{pages.php → listing.php} +22 -26
  44. app/Views/partials/row-link.php +64 -0
  45. app/Views/{row.php → partials/row.php} +46 -28
  46. app/Views/partials/tool-list.php +100 -0
  47. app/Views/row-redirect.php +0 -64
  48. app/Views/settings-posttypes.php +0 -5
  49. app/Views/{settings-general.php → settings/settings-general.php} +1 -12
  50. app/Views/settings/settings-posttypes.php +51 -0
  51. app/Views/{settings.php → settings/settings.php} +7 -5
  52. assets/css/nestedpages.css +1 -1
  53. assets/js/lib/nestedpages.js +204 -31
  54. assets/js/nestedpages.min.js +1 -1
  55. assets/screenshot-1.png +0 -0
  56. assets/screenshot-2.png +0 -0
  57. assets/screenshot-3.gif +0 -0
  58. assets/screenshot-4.gif +0 -0
  59. assets/screenshot-5.png +0 -0
  60. languages/nestedpages-nl_NL.mo +0 -0
  61. languages/nestedpages-nl_NL.po +342 -0
  62. languages/nestedpages.mo +0 -0
  63. languages/nestedpages.pot +277 -141
  64. nestedpages.php +1 -1
  65. readme.txt +27 -16
  66. vendor/autoload.php +1 -1
  67. vendor/composer/autoload_namespaces.php +1 -0
  68. vendor/composer/autoload_real.php +4 -4
  69. vendor/composer/installed.json +77 -0
  70. vendor/composer/installers/.editorconfig +10 -0
  71. vendor/composer/installers/.gitignore +2 -0
  72. vendor/composer/installers/.travis.yml +11 -0
  73. vendor/composer/installers/LICENSE +19 -0
  74. vendor/composer/installers/README.md +162 -0
  75. vendor/composer/installers/composer.json +38 -0
  76. vendor/composer/installers/phpunit.xml.dist +25 -0
  77. vendor/composer/installers/src/Composer/Installers/AglInstaller.php +21 -0
  78. vendor/composer/installers/src/Composer/Installers/AnnotateCmsInstaller.php +11 -0
  79. vendor/composer/installers/src/Composer/Installers/BaseInstaller.php +130 -0
  80. vendor/composer/installers/src/Composer/Installers/CakePHPInstaller.php +21 -0
  81. vendor/composer/installers/src/Composer/Installers/CodeIgniterInstaller.php +11 -0
  82. vendor/composer/installers/src/Composer/Installers/CroogoInstaller.php +21 -0
  83. vendor/composer/installers/src/Composer/Installers/DrupalInstaller.php +12 -0
  84. vendor/composer/installers/src/Composer/Installers/FuelInstaller.php +10 -0
  85. vendor/composer/installers/src/Composer/Installers/Installer.php +128 -0
  86. vendor/composer/installers/src/Composer/Installers/JoomlaInstaller.php +15 -0
  87. vendor/composer/installers/src/Composer/Installers/KohanaInstaller.php +9 -0
  88. vendor/composer/installers/src/Composer/Installers/LaravelInstaller.php +9 -0
  89. vendor/composer/installers/src/Composer/Installers/LithiumInstaller.php +10 -0
  90. vendor/composer/installers/src/Composer/Installers/MODULEWorkInstaller.php +9 -0
  91. vendor/composer/installers/src/Composer/Installers/MagentoInstaller.php +11 -0
  92. vendor/composer/installers/src/Composer/Installers/MakoInstaller.php +9 -0
  93. vendor/composer/installers/src/Composer/Installers/MediaWikiInstaller.php +21 -0
  94. vendor/composer/installers/src/Composer/Installers/OxidInstaller.php +9 -0
  95. vendor/composer/installers/src/Composer/Installers/PPIInstaller.php +9 -0
  96. vendor/composer/installers/src/Composer/Installers/PhpBBInstaller.php +11 -0
  97. vendor/composer/installers/src/Composer/Installers/SilverStripeInstaller.php +36 -0
  98. vendor/composer/installers/src/Composer/Installers/Symfony1Installer.php +26 -0
  99. vendor/composer/installers/src/Composer/Installers/TYPO3CmsInstaller.php +14 -0
  100. vendor/composer/installers/src/Composer/Installers/TYPO3FlowInstaller.php +33 -0
  101. vendor/composer/installers/src/Composer/Installers/WordPressInstaller.php +11 -0
  102. vendor/composer/installers/src/Composer/Installers/ZendInstaller.php +10 -0
  103. vendor/composer/installers/src/bootstrap.php +13 -0
  104. vendor/composer/installers/tests/Composer/Installers/Test/CakePHPInstallerTest.php +61 -0
  105. vendor/composer/installers/tests/Composer/Installers/Test/InstallerTest.php +309 -0
  106. vendor/composer/installers/tests/Composer/Installers/Test/TestCase.php +64 -0
  107. vendor/composer/installers/tests/bootstrap.php +4 -0
app/Activation/Dependencies.php CHANGED
@@ -1,4 +1,6 @@
1
  <?php namespace NestedPages\Activation;
 
 
2
  /**
3
  * Plugin JS & CSS Dependencies
4
  */
@@ -13,10 +15,16 @@ class Dependencies {
13
  * Plugin Version
14
  */
15
  private $plugin_version;
 
 
 
 
 
16
 
17
 
18
  public function __construct()
19
  {
 
20
  $this->setPluginVersion();
21
  add_action( 'admin_enqueue_scripts', array($this, 'styles') );
22
  add_action( 'admin_enqueue_scripts', array($this, 'scripts') );
@@ -95,8 +103,8 @@ class Dependencies {
95
  }
96
  $localized_data = array(
97
  'np_nonce' => wp_create_nonce( 'nestedpages-nonce' ),
98
- 'expand_text' => __('Expand Pages', 'nestedpages'),
99
- 'collapse_text' => __('Collapse Pages', 'nestedpages'),
100
  'show_hidden' => __('Show Hidden', 'nestedpages'),
101
  'hide_hidden' => __('Hide Hidden', 'nestedpages'),
102
  'add_link' => __('Add Link', 'nestedpages'),
@@ -108,11 +116,15 @@ class Dependencies {
108
  'add_child_short' => __('Add Child', 'nestedpages'),
109
  'add_child' => __('Add Child Page', 'nestedpages'),
110
  'add_child_pages' => __('Add Child Pages', 'nestedpages'),
 
111
  'add_page' => __('Add Page', 'nestedpages'),
112
- 'add_pages' => __('Add Pages', 'nestedpages')
 
 
113
  );
114
  $syncmenu = ( get_option('nestedpages_menusync') == 'sync' ) ? true : false;
115
  $localized_data['syncmenu'] = $syncmenu;
 
116
  wp_localize_script(
117
  'nestedpages',
118
  'nestedpages',
@@ -121,4 +133,5 @@ class Dependencies {
121
  endif;
122
  }
123
 
 
124
  }
1
  <?php namespace NestedPages\Activation;
2
+
3
+ use NestedPages\Entities\PostType\PostTypeRepository;
4
  /**
5
  * Plugin JS & CSS Dependencies
6
  */
15
  * Plugin Version
16
  */
17
  private $plugin_version;
18
+
19
+ /**
20
+ * Post Type Repository
21
+ */
22
+ private $post_type_repo;
23
 
24
 
25
  public function __construct()
26
  {
27
+ $this->post_type_repo = new PostTypeRepository;
28
  $this->setPluginVersion();
29
  add_action( 'admin_enqueue_scripts', array($this, 'styles') );
30
  add_action( 'admin_enqueue_scripts', array($this, 'scripts') );
103
  }
104
  $localized_data = array(
105
  'np_nonce' => wp_create_nonce( 'nestedpages-nonce' ),
106
+ 'expand_text' => __('Expand All', 'nestedpages'),
107
+ 'collapse_text' => __('Collapse All', 'nestedpages'),
108
  'show_hidden' => __('Show Hidden', 'nestedpages'),
109
  'hide_hidden' => __('Hide Hidden', 'nestedpages'),
110
  'add_link' => __('Add Link', 'nestedpages'),
116
  'add_child_short' => __('Add Child', 'nestedpages'),
117
  'add_child' => __('Add Child Page', 'nestedpages'),
118
  'add_child_pages' => __('Add Child Pages', 'nestedpages'),
119
+ 'add' => __('Add', 'nestedpages'),
120
  'add_page' => __('Add Page', 'nestedpages'),
121
+ 'add_pages' => __('Add Pages', 'nestedpages'),
122
+ 'add_multiple' => __('Add Multiple', 'nestedpages'),
123
+ 'trash_confirm' => __('Are you sure you would like to empty the trash? This action is not reversable.', 'nestedpages')
124
  );
125
  $syncmenu = ( get_option('nestedpages_menusync') == 'sync' ) ? true : false;
126
  $localized_data['syncmenu'] = $syncmenu;
127
+ $localized_data['post_types'] = $this->post_type_repo->getPostTypesObject();
128
  wp_localize_script(
129
  'nestedpages',
130
  'nestedpages',
133
  endif;
134
  }
135
 
136
+
137
  }
app/Activation/Updates/Updates.php CHANGED
@@ -24,6 +24,7 @@ class Updates {
24
  $this->setCurrentVersion();
25
  $this->addMenu();
26
  $this->convertMenuToID();
 
27
  }
28
 
29
 
@@ -71,4 +72,20 @@ class Updates {
71
  }
72
 
73
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
74
  }
24
  $this->setCurrentVersion();
25
  $this->addMenu();
26
  $this->convertMenuToID();
27
+ $this->enablePagePostType();
28
  }
29
 
30
 
72
  }
73
 
74
 
75
+ /**
76
+ * Make Page Post Type Enabled by Default
77
+ * @since 1.2.1
78
+ */
79
+ private function enablePagePostType()
80
+ {
81
+ if ( version_compare( $this->current_version, '1.3.0', '<' ) ){
82
+ $enabled = get_option('nestedpages_posttypes');
83
+ $default = array('page' => array(
84
+ 'replace_menu' => true
85
+ ));
86
+ if ( !$enabled ) update_option('nestedpages_posttypes', $default);
87
+ }
88
+ }
89
+
90
+
91
  }
app/Bootstrap.php CHANGED
@@ -31,23 +31,12 @@ class Bootstrap {
31
  */
32
  public function initializeWordPress()
33
  {
34
- $this->listPages();
 
35
  $this->addLocalization();
36
  }
37
 
38
 
39
- /**
40
- * Page Listing & Menus
41
- * @since 1.1.6 - Moved into init due to Multisite bug
42
- */
43
- public function listPages()
44
- {
45
- new Controllers\AdminMenuController;
46
- new Controllers\AdminSubmenuController;
47
- new Controllers\PageListingController;
48
- }
49
-
50
-
51
  /**
52
  * Localization Domain
53
  */
31
  */
32
  public function initializeWordPress()
33
  {
34
+ new Entities\AdminMenu\AdminMenu;
35
+ new Entities\DefaultList\DefaultListFactory;
36
  $this->addLocalization();
37
  }
38
 
39
 
 
 
 
 
 
 
 
 
 
 
 
 
40
  /**
41
  * Localization Domain
42
  */
app/Config/Settings.php CHANGED
@@ -37,6 +37,7 @@ class Settings {
37
 
38
  /**
39
  * Register the settings page
 
40
  */
41
  public function registerSettingsPage()
42
  {
@@ -52,18 +53,20 @@ class Settings {
52
 
53
  /**
54
  * Register the settings
 
55
  */
56
  public function registerSettings()
57
  {
58
  register_setting( 'nestedpages-general', 'nestedpages_menu' );
59
  register_setting( 'nestedpages-general', 'nestedpages_menusync' );
60
- register_setting( 'nestedpages-general', 'nestedpages_hidedefault' );
61
  register_setting( 'nestedpages-general', 'nestedpages_allowsorting' );
 
62
  }
63
 
64
 
65
  /**
66
  * Update the menu name if option is updated
 
67
  * @since 1.1.5
68
  */
69
  public function updateMenuName($option, $old_value, $value)
@@ -96,23 +99,24 @@ class Settings {
96
 
97
  /**
98
  * Get Post Types
99
- * @since 1.2
100
  */
101
- public function getPostTypes()
102
  {
103
  $post_repo = new PostTypeRepository;
104
- return $post_repo->getPostTypeArray();
105
  }
106
 
107
 
108
  /**
109
  * Display the Settings Page
 
110
  */
111
  public function settingsPage()
112
  {
113
  $this->setMenu();
114
  $tab = ( isset($_GET['tab']) ) ? $_GET['tab'] : 'general';
115
- include( Helpers::view('settings') );
116
  }
117
 
118
  }
37
 
38
  /**
39
  * Register the settings page
40
+ * @see admin_menu
41
  */
42
  public function registerSettingsPage()
43
  {
53
 
54
  /**
55
  * Register the settings
56
+ * @see admin_init
57
  */
58
  public function registerSettings()
59
  {
60
  register_setting( 'nestedpages-general', 'nestedpages_menu' );
61
  register_setting( 'nestedpages-general', 'nestedpages_menusync' );
 
62
  register_setting( 'nestedpages-general', 'nestedpages_allowsorting' );
63
+ register_setting( 'nestedpages-posttypes', 'nestedpages_posttypes' );
64
  }
65
 
66
 
67
  /**
68
  * Update the menu name if option is updated
69
+ * @see updated_option in wp-includes/option.php
70
  * @since 1.1.5
71
  */
72
  public function updateMenuName($option, $old_value, $value)
99
 
100
  /**
101
  * Get Post Types
102
+ * @since 1.2.0
103
  */
104
+ private function getPostTypes()
105
  {
106
  $post_repo = new PostTypeRepository;
107
+ return $post_repo->getPostTypesObject();
108
  }
109
 
110
 
111
  /**
112
  * Display the Settings Page
113
+ * Callback for registerSettingsPage method
114
  */
115
  public function settingsPage()
116
  {
117
  $this->setMenu();
118
  $tab = ( isset($_GET['tab']) ) ? $_GET['tab'] : 'general';
119
+ include( Helpers::view('settings/settings') );
120
  }
121
 
122
  }
app/Controllers/AdminMenuController.php DELETED
@@ -1,103 +0,0 @@
1
- <?php namespace NestedPages\Controllers;
2
-
3
- use NestedPages\Controllers\PageListingController;
4
- use NestedPages\Helpers;
5
- use NestedPages\Entities\User\UserRepository;
6
-
7
- /**
8
- * Admin Menus
9
- * @since 1.2
10
- */
11
- class AdminMenuController {
12
-
13
- /**
14
- * Page Post Type
15
- */
16
- private $post_type;
17
-
18
- /**
19
- * User Repository
20
- */
21
- private $user;
22
-
23
-
24
- public function __construct()
25
- {
26
- add_action( 'admin_menu', array($this, 'adminMenu') );
27
- }
28
-
29
-
30
- /**
31
- * Add the admin menu items
32
- */
33
- public function adminMenu()
34
- {
35
- $this->user = new UserRepository;
36
- $this->pageMenu();
37
- }
38
-
39
-
40
- /**
41
- * Page Menu
42
- * @since 1.2
43
- */
44
- private function pageMenu()
45
- {
46
- $this->post_type = get_post_type_object('page');
47
- if ( (current_user_can('edit_pages')) || ($this->user->canSortPages()) ){
48
- add_menu_page(
49
- __($this->post_type->labels->name),
50
- __($this->post_type->labels->name),
51
- 'delete_pages',
52
- 'nestedpages',
53
- PageListingController::admin_menu(),
54
- 'dashicons-admin-page',
55
- 20
56
- );
57
- $this->pageSubmenu();
58
- }
59
- }
60
-
61
-
62
- /**
63
- * Page Submenus
64
- */
65
- private function pageSubmenu()
66
- {
67
- global $submenu;
68
- $submenu['nestedpages'][50] = array( __('All Pages','nestedpages'), 'publish_pages', esc_url(admin_url('admin.php?page=nestedpages')) );
69
- $c = $this->submenu();
70
- // Default Pages
71
- if ( get_option('nestedpages_hidedefault') !== 'hide' ){
72
- $submenu['nestedpages'][$c] = array( __('Default Pages','nestedpages'), 'publish_pages', Helpers::defaultPagesLink() );
73
- }
74
- }
75
-
76
-
77
- /**
78
- * Add Submenus
79
- */
80
- private function submenu()
81
- {
82
- global $submenu;
83
-
84
- // Get the right submenu and remove all pages link
85
- foreach($submenu as $key => $sub){
86
- if ($key == 'edit.php?post_type=' . $this->post_type->name){
87
- unset($sub['5']); // Remove "All Pages"
88
- $menu_items = $sub;
89
- }
90
- }
91
- if ( isset($menu_items) ){
92
- $c = 60;
93
- foreach($menu_items as $item){
94
- $submenu['nestedpages'][$c] = array( $item[0], $item[1], $item[2]);
95
- $c = $c + 10;
96
- }
97
- }
98
- return $c;
99
- }
100
-
101
-
102
-
103
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/Controllers/AdminSubmenuController.php DELETED
@@ -1,59 +0,0 @@
1
- <?php namespace NestedPages\Controllers;
2
- /**
3
- * Opens the Submenu on child admin pages and highlights the current item
4
- */
5
- class AdminSubmenuController {
6
-
7
- /**
8
- * Current Page Object
9
- */
10
- private $page;
11
-
12
- public function __construct()
13
- {
14
- add_action('admin_head', array($this, 'expandPagesMenu'));
15
- }
16
-
17
- /**
18
- * Expand the Pages submenu
19
- */
20
- public function expandPagesMenu()
21
- {
22
- $this->page = get_current_screen();
23
- $this->newPage();
24
- $this->editPage();
25
- $this->nestedPages();
26
- }
27
-
28
- /**
29
- * New Page Screen
30
- */
31
- private function newPage()
32
- {
33
- if ( ($this->page->id == 'page') && ($this->page->action == 'add') ){
34
- echo '<script>jQuery(document).ready(function(){jQuery("#toplevel_page_nestedpages").removeClass("wp-not-current-submenu").addClass("wp-has-current-submenu").addClass("wp-menu-open");jQuery("#toplevel_page_nestedpages a:first").addClass("wp-has-current-submenu");var addnew = jQuery("#toplevel_page_nestedpages ul li:nth-child(3)");jQuery(addnew).addClass("current");jQuery(addnew).children("a").addClass("current");});</script>';
35
- }
36
- }
37
-
38
- /**
39
- * Edit Page Screen
40
- */
41
- private function editPage()
42
- {
43
- if ( $this->page->id == 'edit-page' ){
44
- echo '<script>jQuery(document).ready(function(){jQuery("#toplevel_page_nestedpages").removeClass("wp-not-current-submenu").addClass("wp-has-current-submenu").addClass("wp-menu-open");jQuery("#toplevel_page_nestedpages a:first").addClass("wp-has-current-submenu");var addnew = jQuery("#toplevel_page_nestedpages ul li:nth-child(4)");});</script>';
45
- }
46
- }
47
-
48
- /**
49
- * Nested Pages View
50
- */
51
- private function nestedPages()
52
- {
53
- if ( $this->page->id == 'toplevel_page_nestedpages' ){
54
- echo '<script>jQuery(document).ready(function(){jQuery("#toplevel_page_nestedpages").removeClass("wp-not-current-submenu").addClass("wp-has-current-submenu").addClass("wp-menu-open");jQuery("#toplevel_page_nestedpages a:first").addClass("wp-has-current-submenu");var addnew = jQuery("#toplevel_page_nestedpages ul li:nth-child(2)");jQuery(addnew).addClass("current");jQuery(addnew).children("a").addClass("current");});</script>';
55
- }
56
- }
57
-
58
-
59
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/Controllers/PageListingController.php DELETED
@@ -1,341 +0,0 @@
1
- <?php namespace NestedPages\Controllers;
2
-
3
- use NestedPages\Helpers;
4
- use NestedPages\Entities\Confirmation\ConfirmationFactory;
5
- use NestedPages\Entities\Post\PostRepository;
6
- use NestedPages\Entities\User\UserRepository;
7
-
8
- /**
9
- * Primary Listing
10
- * Initiates Page Listing screen (overwriting default), and displays primary plugin view.
11
- */
12
- class PageListingController {
13
-
14
- /**
15
- * Post Type
16
- * @var object
17
- */
18
- private $post_type;
19
-
20
-
21
- /**
22
- * Hierarchical Taxonomies
23
- * @var array
24
- */
25
- private $h_taxonomies;
26
-
27
-
28
- /**
29
- * Flat Taxonomies
30
- * @var array
31
- */
32
- private $f_taxonomies;
33
-
34
-
35
- /**
36
- * Post Data
37
- * @var array
38
- */
39
- private $post_data;
40
-
41
-
42
- /**
43
- * Post Repository
44
- */
45
- private $post_repo;
46
-
47
-
48
- /**
49
- * Confirmation Factory
50
- */
51
- private $confirmation;
52
-
53
-
54
- /**
55
- * User Repository
56
- */
57
- private $user;
58
-
59
-
60
- public function __construct()
61
- {
62
- $this->post_repo = new PostRepository;
63
- $this->user = new UserRepository;
64
- $this->confirmation = new ConfirmationFactory;
65
- $this->setPostType();
66
-
67
- }
68
-
69
-
70
- /**
71
- * Called by Menu Class
72
- * @since 1.2
73
- */
74
- public static function admin_menu() {
75
- $class_name = get_class();
76
- $classinstance = new $class_name();
77
- return array(&$classinstance, "pageListing");
78
- }
79
-
80
-
81
- /**
82
- * Set the Post Type & verify it exists
83
- * @since 1.1.16
84
- */
85
- private function setPostType()
86
- {
87
- $this->post_type = get_post_type_object('page');
88
- }
89
-
90
-
91
- /**
92
- * Add New Page Link
93
- * @return string
94
- */
95
- private function addNewPageLink()
96
- {
97
- return esc_url( admin_url('post-new.php?post_type=page') );
98
- }
99
-
100
-
101
- /**
102
- * User's Toggled Pages
103
- */
104
- private function visiblePages()
105
- {
106
- $visible = unserialize(get_user_meta(get_current_user_id(), 'np_visible_pages', true));
107
- if ( !$visible ) $visible = array();
108
- return $visible;
109
- }
110
-
111
-
112
- /**
113
- * The Main View
114
- * Replaces Default Pages Listing
115
- */
116
- public function pageListing()
117
- {
118
- include( Helpers::view('pages') );
119
- }
120
-
121
-
122
- /**
123
- * Set the Taxonomies for Pages
124
- */
125
- private function setTaxonomies()
126
- {
127
- $taxonomy_names = get_object_taxonomies( $this->post_type->name );
128
- $hierarchical_taxonomies = array();
129
- $flat_taxonomies = array();
130
- foreach ( $taxonomy_names as $taxonomy_name ) {
131
- $taxonomy = get_taxonomy( $taxonomy_name );
132
- if ( !$taxonomy->show_ui )
133
- continue;
134
-
135
- if ( $taxonomy->hierarchical )
136
- $hierarchical_taxonomies[] = $taxonomy;
137
- else
138
- $flat_taxonomies[] = $taxonomy;
139
- }
140
- $this->h_taxonomies = $hierarchical_taxonomies;
141
- $this->f_taxonomies = $flat_taxonomies;
142
- }
143
-
144
-
145
- /**
146
- * Get Post Hierarchical Taxonomies
147
- */
148
- private function hierarchicalTaxonomies($page_id)
149
- {
150
- $out = '';
151
- if ( count($this->h_taxonomies) > 0 ) {
152
- foreach ( $this->h_taxonomies as $taxonomy ){
153
- $terms = wp_get_post_terms($page_id, $taxonomy->name);
154
- foreach ( $terms as $term ){
155
- $out .= 'in-' . $taxonomy->name . '-' . $term->term_id . ' ';
156
- }
157
- }
158
- }
159
- return $out;
160
- }
161
-
162
-
163
- /**
164
- * Get Post Flat Taxonomies
165
- */
166
- private function flatTaxonomies($page_id)
167
- {
168
- $out = '';
169
- if ( count($this->f_taxonomies) > 0 ) {
170
- foreach ( $this->f_taxonomies as $taxonomy ){
171
- $terms = wp_get_post_terms($page_id, $taxonomy->name);
172
- foreach ( $terms as $term ){
173
- $out .= 'inf-' . $taxonomy->name . '-nps-' . $term->term_id . ' ';
174
- }
175
- }
176
- }
177
- return $out;
178
- }
179
-
180
-
181
- /**
182
- * Opening list tag <ol>
183
- * @param array $pages - array of page objects from current query
184
- * @param int $count - current count in loop
185
- */
186
- private function listOpening($pages, $count)
187
- {
188
- // Get array of child pages
189
- $children = array();
190
- $all_children = $pages->posts;
191
- foreach($all_children as $child){
192
- array_push($children, $child->ID);
193
- }
194
- // Compare child pages with user's toggled pages
195
- $compared = array_intersect($this->visiblePages(), $children);
196
-
197
- if ( $count == 1 ) {
198
- echo ( $this->user->canSortPages() )
199
- ? '<ol class="sortable nplist visible">'
200
- : '<ol class="sortable no-sort nplist" visible>';
201
- } else {
202
- echo '<ol class="nplist';
203
- if ( count($compared) > 0 ) echo ' visible" style="display:block;';
204
- echo '">';
205
- }
206
- }
207
-
208
-
209
- /**
210
- * Set Post Data
211
- */
212
- private function setPostData($post)
213
- {
214
- $this->post_data['template'] = get_post_meta($post->ID, '_wp_page_template', true);
215
-
216
- // Show Hide in generated nav menu
217
- $ns = get_post_meta( get_the_id(), 'np_nav_status', true);
218
- $this->post_data['nav_status'] = ( $ns == 'hide' ) ? 'hide' : 'show';
219
-
220
- // Hidden in Nested Pages?
221
- $np_status = get_post_meta( get_the_id(), 'nested_pages_status', true );
222
- $this->post_data['np_status'] = ( $np_status == 'hide' ) ? 'hide' : 'show';
223
-
224
- // Menu Title
225
- $this->post_data['nav_title'] = get_post_meta(get_the_id(), 'np_nav_title', true);
226
-
227
- // Redirect Link Target
228
- $this->post_data['link_target'] = get_post_meta(get_the_id(), 'np_link_target', true);
229
-
230
- // Parent ID
231
- $this->post_data['parent_id'] = $post->post_parent;
232
-
233
- // Nav Title Attribute
234
- $this->post_data['nav_title_attr'] = get_post_meta(get_the_id(), 'np_title_attribute', true);
235
-
236
- // Nav CSS Classes
237
- $this->post_data['nav_css'] = get_post_meta(get_the_id(), 'np_nav_css_classes', true);
238
-
239
- // Post Password
240
- $this->post_data['password'] = $post->post_password;
241
-
242
- // Yoast Score
243
- if ( function_exists('wpseo_translate_score') ) {
244
- $yoast_score = get_post_meta(get_the_id(), '_yoast_wpseo_linkdex', true);
245
- $this->post_data['score'] = wpseo_translate_score($yoast_score);
246
- };
247
-
248
- // Date Vars
249
- $this->post_data['d'] = get_the_time('d');
250
- $this->post_data['month'] = get_the_time('m');
251
- $this->post_data['y'] = get_the_time('Y');
252
- $this->post_data['h'] = get_the_time('H');
253
- $this->post_data['m'] = get_the_time('i');
254
- }
255
-
256
-
257
- /**
258
- * Get count of published posts
259
- * @param object $pages
260
- */
261
- private function publishCount($pages)
262
- {
263
- $publish_count = 1;
264
- foreach ( $pages->posts as $p ){
265
- if ( $p->post_status !== 'trash' ) $publish_count++;
266
- }
267
- return $publish_count;
268
- }
269
-
270
-
271
- /**
272
- * Loop through all the pages and create the nested / sortable list
273
- * Recursive Method, called in page.php view
274
- */
275
- private function loopPages($parent_id = 0, $count = 0)
276
- {
277
- $this->setTaxonomies();
278
- $query_args = array(
279
- 'post_type' => array('page','np-redirect'),
280
- 'posts_per_page' => -1,
281
- 'orderby' => 'menu_order',
282
- 'post_status' => array('publish', 'pending', 'draft', 'private', 'future', 'trash'),
283
- 'post_parent' => $parent_id,
284
- 'order' => 'ASC'
285
- );
286
- $pages = new \WP_Query(apply_filters('nestedpages_page_listing', $query_args));
287
-
288
- if ( $pages->have_posts() ) :
289
- $count++;
290
-
291
- if ( $this->publishCount($pages) > 1 ){
292
- $this->listOpening($pages, $count);
293
- }
294
-
295
- while ( $pages->have_posts() ) : $pages->the_post();
296
-
297
- global $post;
298
- $this->setPostData($post);
299
- if ( get_post_status(get_the_id()) !== 'trash' ) :
300
-
301
- echo '<li id="menuItem_' . get_the_id() . '" class="page-row';
302
-
303
- // Published?
304
- if ( $post->post_status == 'publish' ) echo ' published';
305
-
306
- // Hidden in Nested Pages?
307
- if ( $this->post_data['np_status'] == 'hide' ) echo ' np-hide';
308
-
309
- // Taxonomies
310
- echo ' ' . $this->hierarchicalTaxonomies( get_the_id() );
311
- echo ' ' . $this->flatTaxonomies( get_the_id() );
312
-
313
- echo '">';
314
-
315
- $count++;
316
-
317
- if ( get_post_type() == 'page' ){
318
- include( Helpers::view('row') );
319
- } else {
320
- include( Helpers::view('row-redirect') );
321
- }
322
-
323
- endif; // trash status
324
-
325
- $this->loopPages(get_the_id(), $count);
326
-
327
- if ( get_post_status(get_the_id()) !== 'trash' ) {
328
- echo '</li>';
329
- }
330
-
331
- endwhile; // Loop
332
-
333
- if ( $this->publishCount($pages) > 1 ){
334
- echo '</ol>';
335
- }
336
-
337
- endif; wp_reset_postdata();
338
- }
339
-
340
-
341
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/Entities/AdminMenu/AdminMenu.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php namespace NestedPages\Entities\AdminMenu;
2
+
3
+ use NestedPages\Entities\AdminMenu\EnabledMenus;
4
+ use NestedPages\Entities\AdminMenu\AdminSubmenuExpander;
5
+
6
+ /**
7
+ * Admin Menus
8
+ * @since 1.2.1
9
+ */
10
+ class AdminMenu {
11
+
12
+ public function __construct()
13
+ {
14
+ add_action( 'admin_menu', array($this, 'setMenus') );
15
+ add_action( 'admin_head', array($this, 'expandSubMenus') );
16
+ }
17
+
18
+ /**
19
+ * Other Post Types
20
+ */
21
+ public function setMenus()
22
+ {
23
+ new EnabledMenus;
24
+ }
25
+
26
+ /**
27
+ * Expand Submenus
28
+ */
29
+ public function expandSubMenus()
30
+ {
31
+ new AdminSubmenuExpander;
32
+ }
33
+
34
+
35
+ }
app/Entities/AdminMenu/AdminSubmenu.php ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php namespace NestedPages\Entities\AdminMenu;
2
+
3
+ use NestedPages\Entities\PostType\PostTypeRepository;
4
+
5
+ /**
6
+ * Adds the submenu for a given menu
7
+ */
8
+ class AdminSubmenu {
9
+
10
+ /**
11
+ * Post Type
12
+ * @var string
13
+ */
14
+ private $post_type;
15
+
16
+ /**
17
+ * Post Type Repository
18
+ */
19
+ private $post_type_repo;
20
+
21
+ /**
22
+ * Slug
23
+ * @var string
24
+ */
25
+ private $slug;
26
+
27
+
28
+ public function __construct($post_type)
29
+ {
30
+ $this->post_type = $post_type;
31
+ $this->post_type_repo = new PostTypeRepository;
32
+ $this->setSlug();
33
+ }
34
+
35
+ /**
36
+ * Add the submenu
37
+ */
38
+ public function addSubmenu()
39
+ {
40
+ global $submenu;
41
+
42
+ // Get the right submenu and remove all pages link
43
+ foreach($submenu as $key => $sub){
44
+ if ($key == $this->post_type_repo->editSlug($this->post_type)){
45
+ // Add the "All Link"
46
+ $submenu[$this->slug][50] = array( $sub[5][0], 'publish_pages', esc_url(admin_url('admin.php?page=' . $this->slug)) );
47
+ unset($sub['5']); // Remove Top Level
48
+ $menu_items = $sub;
49
+ }
50
+ }
51
+
52
+ if ( isset($menu_items) ){
53
+ $c = 60;
54
+ foreach($menu_items as $item){
55
+ $submenu[$this->slug][$c] = array( $item[0], $item[1], $item[2]);
56
+ $c = $c + 10;
57
+ }
58
+ }
59
+ $this->defaultLink($c);
60
+
61
+ }
62
+
63
+
64
+ /**
65
+ * Show the default link if set to show
66
+ * @param int $c Menu Position Counter
67
+ */
68
+ private function defaultLink($c)
69
+ {
70
+ global $submenu;
71
+ if ( !$this->post_type_repo->hideDefault($this->post_type->name) ){
72
+ $submenu[$this->slug][$c] = array(
73
+ __('Default','nestedpages') . ' ' . $this->post_type->labels->name,
74
+ 'publish_pages',
75
+ $this->post_type_repo->editSlug($this->post_type)
76
+ );
77
+ }
78
+ }
79
+
80
+
81
+ /**
82
+ * Set the Menu Slug
83
+ */
84
+ private function setSlug()
85
+ {
86
+ $this->slug = $this->post_type_repo->getMenuSlug($this->post_type);
87
+ }
88
+
89
+ }
app/Entities/AdminMenu/AdminSubmenuDefault.php ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php namespace NestedPages\Entities\AdminMenu;
2
+
3
+ use NestedPages\Entities\PostType\PostTypeRepository;
4
+ use NestedPages\Entities\Listing\Listing;
5
+
6
+ /**
7
+ * Add a link to the default menu
8
+ */
9
+ class AdminSubmenuDefault {
10
+
11
+ /**
12
+ * Post Type
13
+ * @var object
14
+ */
15
+ private $post_type;
16
+
17
+ /**
18
+ * Post Type Repository
19
+ */
20
+ private $post_type_repo;
21
+
22
+
23
+ public function __construct($post_type)
24
+ {
25
+ $this->post_type = $post_type;
26
+ $this->post_type_repo = new PostTypeRepository;
27
+ $this->findMenu();
28
+ }
29
+
30
+
31
+ /**
32
+ * Add the submenu
33
+ */
34
+ public function findMenu()
35
+ {
36
+ global $submenu;
37
+ foreach($submenu as $key => $sub){
38
+ if ($key == $this->post_type_repo->editSlug($this->post_type)){
39
+ $this->addSubMenu($key);
40
+ }
41
+ }
42
+ }
43
+
44
+
45
+ /**
46
+ * Add the submenu item
47
+ * @param string parent page slug
48
+ */
49
+ private function addSubMenu($parent_slug)
50
+ {
51
+ add_submenu_page(
52
+ $parent_slug,
53
+ $this->post_type_repo->getSubmenuText($this->post_type),
54
+ $this->post_type_repo->getSubmenuText($this->post_type),
55
+ 'edit_posts',
56
+ $this->post_type_repo->getMenuSlug($this->post_type),
57
+ Listing::admin_menu($this->post_type->name)
58
+ );
59
+ }
60
+
61
+ }
app/Entities/AdminMenu/AdminSubmenuExpander.php ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php namespace NestedPages\Entities\AdminMenu;
2
+
3
+ use NestedPages\Entities\PostType\PostTypeRepository;
4
+
5
+ /**
6
+ * Opens the Submenu on child admin pages and highlights the current item
7
+ */
8
+ class AdminSubmenuExpander {
9
+
10
+ /**
11
+ * Current Page Object
12
+ */
13
+ private $page;
14
+
15
+ /**
16
+ * Post Type Repository
17
+ */
18
+ private $post_type_repo;
19
+
20
+
21
+ public function __construct()
22
+ {
23
+ $this->post_type_repo = new PostTypeRepository;
24
+ $this->page = get_current_screen();
25
+ $this->addHighlighting();
26
+ }
27
+
28
+
29
+ /**
30
+ * Add Highlighting to enabled Post Types who's menus are being overwritten
31
+ */
32
+ private function addHighlighting()
33
+ {
34
+ foreach($this->post_type_repo->getPostTypesObject() as $type){
35
+ if ( $type->replace_menu ){
36
+ $this->newPage($type);
37
+ $this->nestedPagesAll($type);
38
+ $this->topLevelPostType($type);
39
+ $this->defaultLink($type);
40
+ $this->defaultPagesLink($type);
41
+ }
42
+ }
43
+ }
44
+
45
+
46
+ /**
47
+ * New Page Screen
48
+ */
49
+ private function newPage($type)
50
+ {
51
+ $name = ( $type->name == 'page' ) ? '' : '-' . $type->name;
52
+ if ( ($this->page->id == $type->name) && ($this->page->action == 'add') ){
53
+ echo '<script>jQuery(document).ready(function(){jQuery("#toplevel_page_nestedpages' . $name . '").removeClass("wp-not-current-submenu").addClass("wp-has-current-submenu").addClass("wp-menu-open");jQuery("#toplevel_page_nestedpages' . $name . ' a:first").addClass("wp-has-current-submenu");var addnew = jQuery("#toplevel_page_nestedpages ul li:nth-child(3)");jQuery(addnew).addClass("current");jQuery(addnew).children("a").addClass("current");});</script>';
54
+ }
55
+ }
56
+
57
+
58
+ /**
59
+ * Nested Pages View
60
+ */
61
+ private function nestedPagesAll($type)
62
+ {
63
+ if ( $this->page->id == 'toplevel_page_nestedpages' ){
64
+ echo '<script>jQuery(document).ready(function(){jQuery("#toplevel_page_nestedpages").removeClass("wp-not-current-submenu").addClass("wp-has-current-submenu").addClass("wp-menu-open");jQuery("#toplevel_page_nestedpages a:first").addClass("wp-has-current-submenu");var addnew = jQuery("#toplevel_page_nestedpages ul li:nth-child(2)");jQuery(addnew).addClass("current");jQuery(addnew).children("a").addClass("current");});</script>';
65
+ }
66
+ }
67
+
68
+
69
+ /**
70
+ * Top Level Page for Post Type
71
+ */
72
+ private function topLevelPostType($type)
73
+ {
74
+ if ( $this->page->id == 'toplevel_page_nestedpages-' . $type->name ){
75
+ echo '<script>jQuery(document).ready(function(){jQuery("#toplevel_page_nestedpages-' . $type->name . '").removeClass("wp-not-current-submenu").addClass("wp-has-current-submenu").addClass("wp-menu-open");jQuery("#toplevel_page_nestedpages-' . $type->name . ' a:first").addClass("wp-has-current-submenu");var addnew = jQuery("#toplevel_page_nestedpages-' . $type->name . ' ul li:nth-child(2)");jQuery(addnew).addClass("current");jQuery(addnew).children("a").addClass("current");});</script>';
76
+ }
77
+ }
78
+
79
+
80
+ /**
81
+ * Default Link
82
+ */
83
+ private function defaultLink($type)
84
+ {
85
+ if ( $this->page->id == 'edit-' . $type->name ){
86
+ echo '<script>jQuery(document).ready(function(){jQuery("#toplevel_page_nestedpages-' . $type->name . '").removeClass("wp-not-current-submenu").addClass("wp-has-current-submenu").addClass("wp-menu-open");jQuery("#toplevel_page_nestedpages-' . $type->name . ' a:first").addClass("wp-has-current-submenu");});</script>';
87
+ }
88
+ }
89
+
90
+
91
+ /**
92
+ * Default Pages Link
93
+ */
94
+ private function defaultPagesLink($type)
95
+ {
96
+ if ( $this->page->id == 'edit-page' ){
97
+ echo '<script>jQuery(document).ready(function(){jQuery("#toplevel_page_nestedpages").removeClass("wp-not-current-submenu").addClass("wp-has-current-submenu").addClass("wp-menu-open");jQuery("#toplevel_page_nestedpages a:first").addClass("wp-has-current-submenu");});</script>';
98
+ }
99
+ }
100
+
101
+ }
app/Entities/AdminMenu/EnabledMenus.php ADDED
@@ -0,0 +1,148 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php namespace NestedPages\Entities\AdminMenu;
2
+
3
+ use NestedPages\Entities\PostType\PostTypeRepository;
4
+ use NestedPages\Entities\Listing\Listing;
5
+ use NestedPages\Entities\AdminMenu\AdminSubmenu;
6
+ use NestedPages\Entities\AdminMenu\AdminSubmenuDefault;
7
+ use NestedPages\Entities\User\UserRepository;
8
+
9
+ /**
10
+ * Other User-Enabled Post Types
11
+ */
12
+ class EnabledMenus {
13
+
14
+ /**
15
+ * Post Type
16
+ */
17
+ private $post_type;
18
+
19
+ /**
20
+ * Post Type Repository
21
+ * @var object
22
+ */
23
+ private $post_type_repo;
24
+
25
+ /**
26
+ * Enabled Post Types
27
+ */
28
+ private $enabled_types;
29
+
30
+ /**
31
+ * User Repository
32
+ */
33
+ private $user;
34
+
35
+
36
+ public function __construct()
37
+ {
38
+ $this->post_type_repo = new PostTypeRepository;
39
+ $this->user = new UserRepository;
40
+ $this->setEnabled();
41
+ $this->loopEnabledTypes();
42
+ }
43
+
44
+ /**
45
+ * Set Enabled Post Types
46
+ */
47
+ private function setEnabled()
48
+ {
49
+ $this->enabled_types = $this->post_type_repo->getPostTypesObject();
50
+ }
51
+
52
+
53
+ /**
54
+ * Set the Menus for each of the enabled post types
55
+ */
56
+ private function loopEnabledTypes()
57
+ {
58
+ $c = 1; // Counter for position
59
+ foreach($this->enabled_types as $key => $type){
60
+ //var_dump($type);
61
+ if ( $type->np_enabled !== true ) continue;
62
+ if ( $type->replace_menu ) {
63
+ $this->post_type = get_post_type_object($key);
64
+ if ( (current_user_can($this->post_type->cap->edit_posts)) || ($this->user->canSortPages()) ){
65
+ $this->addMenu($c);
66
+ $this->addSubmenu();
67
+ $this->removeExistingMenu();
68
+ }
69
+ } else {
70
+ $default = new AdminSubmenuDefault($type);
71
+ }
72
+ $c++;
73
+ }
74
+ }
75
+
76
+
77
+ /**
78
+ * Add the primary top-level menu item
79
+ * @param int counter
80
+ */
81
+ private function addMenu($c)
82
+ {
83
+ add_menu_page(
84
+ __($this->post_type->labels->name),
85
+ __($this->post_type->labels->name),
86
+ $this->post_type->cap->edit_posts,
87
+ $this->getSlug(),
88
+ Listing::admin_menu($this->post_type->name),
89
+ $this->menuIcon(),
90
+ $this->menuPosition($c)
91
+ );
92
+ }
93
+
94
+ /**
95
+ * Add Submenus
96
+ */
97
+ private function addSubmenu()
98
+ {
99
+ $submenu = new AdminSubmenu($this->post_type);
100
+ $submenu->addSubmenu();
101
+ }
102
+
103
+ /**
104
+ * Remove Default Menus
105
+ */
106
+ private function removeExistingMenu()
107
+ {
108
+ remove_menu_page('edit.php?post_type=' . $this->post_type->name);
109
+ if (in_array('post', $this->enabled_types)) remove_menu_page('edit.php');
110
+ }
111
+
112
+
113
+ /**
114
+ * Get the correct icon to use in menu
115
+ * @return string
116
+ */
117
+ private function menuIcon()
118
+ {
119
+ if ( $this->post_type->name == 'page' ) return 'dashicons-admin-page';
120
+ if ( $this->post_type->menu_icon ) return $this->post_type->menu_icon;
121
+ return 'dashicons-admin-post';
122
+ }
123
+
124
+
125
+ /**
126
+ * Get the correct menu position for item
127
+ * @param int counter
128
+ */
129
+ private function menuPosition($c)
130
+ {
131
+ global $_wp_last_object_menu;
132
+ if ( $this->post_type->name == 'post' ) return 5;
133
+ if ( $this->post_type->name == 'page') return 20;
134
+ if ( $this->post_type->menu_position ) return $this->post_type->menu_position + 1;
135
+ return $_wp_last_object_menu + $c;
136
+ }
137
+
138
+
139
+ /**
140
+ * Get the Edit Slug for post type
141
+ */
142
+ private function getSlug()
143
+ {
144
+ return $this->post_type_repo->getMenuSlug($this->post_type);
145
+ }
146
+
147
+
148
+ }
app/Entities/Confirmation/TrashConfirmation.php CHANGED
@@ -11,7 +11,7 @@ class TrashConfirmation implements ConfirmationInterface {
11
  if ( count($trashed) > 1 ){
12
  $out .= count($trashed) . ' ' . __('pages moved to the Trash', 'nestedpages');
13
  } else {
14
- $out .= '<strong>' . get_the_title($trashed[0]) . ' </strong>' . __('page moved to the Trash', 'nestedpages');
15
 
16
  // Undo Link
17
  if ( current_user_can('delete_pages') ) {
11
  if ( count($trashed) > 1 ){
12
  $out .= count($trashed) . ' ' . __('pages moved to the Trash', 'nestedpages');
13
  } else {
14
+ $out .= '<strong>' . get_the_title($trashed[0]) . ' </strong>' . __('moved to the Trash', 'nestedpages');
15
 
16
  // Undo Link
17
  if ( current_user_can('delete_pages') ) {
app/Entities/DefaultList/DefaultListFactory.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php namespace NestedPages\Entities\DefaultList;
2
+
3
+ use NestedPages\Entities\PostType\PostTypeRepository;
4
+ use NestedPages\Entities\DefaultList\NestedViewLink;
5
+
6
+ /**
7
+ * Add the Nested Pages link to default table subsubsub
8
+ */
9
+ class DefaultListFactory {
10
+
11
+ /**
12
+ * Post Type Repository
13
+ */
14
+ private $post_type_repo;
15
+
16
+ /**
17
+ * Post Type
18
+ */
19
+ private $post_type;
20
+
21
+
22
+ public function __construct()
23
+ {
24
+ $this->post_type_repo = new PostTypeRepository;
25
+ $this->addNestedViewLinks();
26
+ }
27
+
28
+ /**
29
+ * Loop through Post Types & add link to activated types
30
+ */
31
+ private function addNestedViewLinks()
32
+ {
33
+ foreach($this->post_type_repo->getPostTypesObject() as $type){
34
+ if ( !$type->np_enabled ) continue;
35
+ new NestedViewLink($type);
36
+ }
37
+ }
38
+
39
+ }
app/Entities/DefaultList/NestedViewLink.php ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php namespace NestedPages\Entities\DefaultList;
2
+
3
+ use NestedPages\Entities\PostType\PostTypeRepository;
4
+
5
+ /**
6
+ * Adds "nested view/sort view" to default lists on enabled post types
7
+ */
8
+ class NestedViewLink {
9
+
10
+ /**
11
+ * Post Type
12
+ */
13
+ private $post_type;
14
+
15
+ /**
16
+ * Post Type Repository
17
+ */
18
+ private $post_type_repo;
19
+
20
+
21
+ public function __construct($post_type)
22
+ {
23
+ $this->post_type_repo = new PostTypeRepository;
24
+ $this->post_type = $post_type;
25
+ $this->addFilter();
26
+ }
27
+
28
+
29
+ /**
30
+ * Add the WP Filter
31
+ */
32
+ private function addFilter()
33
+ {
34
+ add_filter( 'views_edit-' . $this->post_type->name, array($this, 'addLink' ) );
35
+ }
36
+
37
+
38
+ /**
39
+ * Add a nested pages link to the subsub list (WP_List_Table class)
40
+ */
41
+ public function addLink($views)
42
+ {
43
+ $screen = get_current_screen();
44
+ if ( $screen->parent_file == $this->post_type_repo->editSlug($this->post_type) ){
45
+ $link_text = $this->post_type_repo->getSubmenuText($this->post_type);
46
+ $link_href = esc_url(admin_url('admin.php?page=' . $this->post_type_repo->getMenuSlug($this->post_type)));
47
+ $link = array($link_text => '<a href="' . $link_href . '">' . $link_text . '</a>');
48
+ $views = array_merge($views, $link);
49
+ }
50
+ return $views;
51
+ }
52
+
53
+ }
app/Entities/Listing/Listing.php ADDED
@@ -0,0 +1,282 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php namespace NestedPages\Entities\Listing;
2
+
3
+ use NestedPages\Helpers;
4
+ use NestedPages\Entities\Confirmation\ConfirmationFactory;
5
+ use NestedPages\Entities\Post\PostDataFactory;
6
+ use NestedPages\Entities\Post\PostRepository;
7
+ use NestedPages\Entities\User\UserRepository;
8
+ use NestedPages\Entities\PostType\PostTypeRepository;
9
+ use NestedPages\Entities\Listing\ListingRepository;
10
+
11
+ /**
12
+ * Primary Post Listing
13
+ */
14
+ class Listing {
15
+
16
+ /**
17
+ * Post Type
18
+ * @var object WP Post Type Object
19
+ */
20
+ private $post_type;
21
+
22
+ /**
23
+ * Hierarchical Taxonomies
24
+ * @var array
25
+ */
26
+ private $h_taxonomies;
27
+
28
+ /**
29
+ * Flat Taxonomies
30
+ * @var array
31
+ */
32
+ private $f_taxonomies;
33
+
34
+ /**
35
+ * Post Data Factory
36
+ */
37
+ private $post_data_factory;
38
+
39
+ /**
40
+ * Post Data
41
+ * @var object
42
+ */
43
+ private $post;
44
+
45
+ /**
46
+ * Post Repository
47
+ */
48
+ private $post_repo;
49
+
50
+ /**
51
+ * Post Type Repository
52
+ */
53
+ private $post_type_repo;
54
+
55
+ /**
56
+ * Listing Repository
57
+ */
58
+ private $listing_repo;
59
+
60
+ /**
61
+ * Confirmation Factory
62
+ */
63
+ private $confirmation;
64
+
65
+ /**
66
+ * User Repository
67
+ */
68
+ private $user;
69
+
70
+ /**
71
+ * Sorting Options
72
+ * @var array
73
+ */
74
+ private $sort_options;
75
+
76
+
77
+ public function __construct($post_type)
78
+ {
79
+ $this->setPostType($post_type);
80
+ $this->post_repo = new PostRepository;
81
+ $this->user = new UserRepository;
82
+ $this->confirmation = new ConfirmationFactory;
83
+ $this->post_type_repo = new PostTypeRepository;
84
+ $this->listing_repo = new ListingRepository;
85
+ $this->post_data_factory = new PostDataFactory;
86
+ }
87
+
88
+
89
+ /**
90
+ * Called by Menu Class
91
+ * Instantiates Listing Class
92
+ * @since 1.2.0
93
+ */
94
+ public static function admin_menu($post_type) {
95
+ $class_name = get_class();
96
+ $classinstance = new $class_name($post_type);
97
+ return array(&$classinstance, "listPosts");
98
+ }
99
+
100
+
101
+ /**
102
+ * Set the Sort Options
103
+ */
104
+ private function setSortOptions()
105
+ {
106
+ $this->sort_options = new \StdClass();
107
+ $this->sort_options->orderby = isset($_GET['orderby'])
108
+ ? sanitize_text_field($_GET['orderby'])
109
+ : 'menu_order';
110
+ $this->sort_options->order = isset($_GET['order'])
111
+ ? sanitize_text_field($_GET['order'])
112
+ : 'ASC';
113
+ $this->sort_options->author = isset($_GET['author'])
114
+ ? sanitize_text_field($_GET['author'])
115
+ : null;
116
+ }
117
+
118
+
119
+ /**
120
+ * Get the Current Page URL
121
+ */
122
+ private function pageURL()
123
+ {
124
+ $base = ( $this->post_type->name == 'post' ) ? admin_url('edit.php') : admin_url('admin.php');
125
+ return $base . '?page=' . $_GET['page'];
126
+ }
127
+
128
+
129
+ /**
130
+ * Set the Post Type
131
+ * @since 1.1.16
132
+ */
133
+ private function setPostType($post_type)
134
+ {
135
+ $this->post_type = get_post_type_object($post_type);
136
+ }
137
+
138
+
139
+ /**
140
+ * The Main View
141
+ * Replaces Default Post Listing
142
+ */
143
+ public function listPosts()
144
+ {
145
+ $this->setSortOptions();
146
+ include( Helpers::view('listing') );
147
+ }
148
+
149
+
150
+ /**
151
+ * Set the Taxonomies for Post Type
152
+ */
153
+ private function setTaxonomies()
154
+ {
155
+ $this->h_taxonomies = $this->post_type_repo->getTaxonomies($this->post_type->name, true);
156
+ $this->f_taxonomies = $this->post_type_repo->getTaxonomies($this->post_type->name, false);
157
+ }
158
+
159
+
160
+ /**
161
+ * Opening list tag <ol>
162
+ * @param array $pages - array of page objects from current query
163
+ * @param int $count - current count in loop
164
+ */
165
+ private function listOpening($pages, $count)
166
+ {
167
+ // Get array of child pages
168
+ $children = array();
169
+ $all_children = $pages->posts;
170
+ foreach($all_children as $child){
171
+ array_push($children, $child->ID);
172
+ }
173
+ // Compare child pages with user's toggled pages
174
+ $compared = array_intersect($this->listing_repo->visiblePages($this->post_type->name), $children);
175
+
176
+ if ( $count == 1 ) {
177
+ echo ( $this->user->canSortPages() )
178
+ ? '<ol class="sortable nplist visible" id="np-' . $this->post_type->name . '">'
179
+ : '<ol class="sortable no-sort nplist" visible" id="np-' . $this->post_type->name . '">';
180
+ } else {
181
+ echo '<ol class="nplist';
182
+ if ( count($compared) > 0 ) echo ' visible" style="display:block;';
183
+ echo '" id="np-' . $this->post_type->name . '">';
184
+ }
185
+ }
186
+
187
+
188
+ /**
189
+ * Set Post Data
190
+ * @param object post object
191
+ */
192
+ private function setPost($post)
193
+ {
194
+ $this->post = $this->post_data_factory->build($post);
195
+ }
196
+
197
+
198
+ /**
199
+ * Get count of published posts
200
+ * @param object $pages (WP Query object)
201
+ */
202
+ private function publishCount($pages)
203
+ {
204
+ $publish_count = 1;
205
+ foreach ( $pages->posts as $p ){
206
+ if ( $p->post_status !== 'trash' ) $publish_count++;
207
+ }
208
+ return $publish_count;
209
+ }
210
+
211
+
212
+ /**
213
+ * Loop through all the pages and create the nested / sortable list
214
+ * Recursive Method, called in page.php view
215
+ */
216
+ private function loopPosts($parent_id = 0, $count = 0)
217
+ {
218
+ $this->setTaxonomies();
219
+ $post_type = ( $this->post_type->name == 'page' ) ? array('page', 'np-redirect') : array($this->post_type->name);
220
+ $query_args = array(
221
+ 'post_type' => $post_type,
222
+ 'posts_per_page' => -1,
223
+ 'author' => $this->sort_options->author,
224
+ 'orderby' => $this->sort_options->orderby,
225
+ 'post_status' => array('publish', 'pending', 'draft', 'private', 'future', 'trash'),
226
+ 'post_parent' => $parent_id,
227
+ 'order' => $this->sort_options->order
228
+ );
229
+ $pages = new \WP_Query(apply_filters('nestedpages_page_listing', $query_args));
230
+
231
+ if ( $pages->have_posts() ) :
232
+ $count++;
233
+
234
+ if ( $this->publishCount($pages) > 1 ){
235
+ $this->listOpening($pages, $count);
236
+ }
237
+
238
+ while ( $pages->have_posts() ) : $pages->the_post();
239
+
240
+ global $post;
241
+ $this->setPost($post);
242
+
243
+ if ( $this->post->status !== 'trash' ) :
244
+
245
+ echo '<li id="menuItem_' . $this->post->id . '" class="page-row';
246
+
247
+ // Published?
248
+ if ( $this->post->status == 'publish' ) echo ' published';
249
+
250
+ // Hidden in Nested Pages?
251
+ if ( $this->post->np_status == 'hide' ) echo ' np-hide';
252
+
253
+ // Taxonomies
254
+ echo ' ' . $this->post_repo->getTaxonomyCSS($this->post->id, $this->h_taxonomies);
255
+ echo ' ' . $this->post_repo->getTaxonomyCSS($this->post->id, $this->f_taxonomies, false);
256
+
257
+ echo '">';
258
+
259
+ $count++;
260
+
261
+ $row_view = ( $this->post->type !== 'np-redirect' ) ? 'partials/row' : 'partials/row-link';
262
+ include( Helpers::view($row_view) );
263
+
264
+ endif; // trash status
265
+
266
+ $this->loopPosts($this->post->id, $count);
267
+
268
+ if ( $this->post->status !== 'trash' ) {
269
+ echo '</li>';
270
+ }
271
+
272
+ endwhile; // Loop
273
+
274
+ if ( $this->publishCount($pages) > 1 ){
275
+ echo '</ol>';
276
+ }
277
+
278
+ endif; wp_reset_postdata();
279
+ }
280
+
281
+
282
+ }
app/Entities/Listing/ListingRepository.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php namespace NestedPages\Entities\Listing;
2
+
3
+ class ListingRepository {
4
+
5
+ /**
6
+ * User's Toggled Pages
7
+ */
8
+ public function visiblePages($post_type)
9
+ {
10
+ $visible = unserialize(get_user_meta(get_current_user_id(), 'np_visible_posts', true));
11
+ if ( !isset($visible[$post_type]) ) $visible[$post_type] = array();
12
+ return $visible[$post_type];
13
+ }
14
+
15
+ }
app/Entities/{NavMenu.php → NavMenu/NavMenu.php} RENAMED
@@ -1,4 +1,4 @@
1
- <?php namespace NestedPages\Entities;
2
 
3
  use NestedPages\Helpers;
4
 
1
+ <?php namespace NestedPages\Entities\NavMenu;
2
 
3
  use NestedPages\Helpers;
4
 
app/Entities/Post/PostDataFactory.php ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php namespace NestedPages\Entities\Post;
2
+ /**
3
+ * Build Post Data Object
4
+ */
5
+ class PostDataFactory {
6
+
7
+ /**
8
+ * Post Data
9
+ * @var object
10
+ */
11
+ private $post_data;
12
+
13
+ /**
14
+ * Build the Object
15
+ */
16
+ public function build($post)
17
+ {
18
+ $this->post_data = new \stdClass();
19
+ $this->addPostVars($post);
20
+ $this->addPostMeta($post);
21
+ $this->addMenuOptions($post);
22
+ $this->addDate($post);
23
+ $this->author($post);
24
+
25
+ return $this->post_data;
26
+ }
27
+
28
+ /**
29
+ * Post Items
30
+ */
31
+ public function addPostVars($post)
32
+ {
33
+ $this->post_data->id = $post->ID;
34
+ $this->post_data->parent_id = $post->post_parent;
35
+ $this->post_data->title = $post->post_title;
36
+ $this->post_data->template = get_post_meta($post->ID, '_wp_page_template', true);
37
+ $this->post_data->password = $post->post_password;
38
+ $this->post_data->status = $post->post_status;
39
+ $this->post_data->type = $post->post_type;
40
+ $this->post_data->comment_status = $post->comment_status;
41
+ $this->post_data->content = $post->post_content;
42
+ $this->post_data->hierarchical = is_post_type_hierarchical($post->post_type);
43
+ }
44
+
45
+ /**
46
+ * Post Meta
47
+ */
48
+ public function addPostMeta($post)
49
+ {
50
+ // Hidden in Nested Pages?
51
+ $np_status = get_post_meta( $post->ID, 'nested_pages_status', true );
52
+ $this->post_data->np_status = ( $np_status == 'hide' ) ? 'hide' : 'show';
53
+
54
+ // Yoast Score
55
+ if ( function_exists('wpseo_translate_score') ) {
56
+ $yoast_score = get_post_meta($post->ID, '_yoast_wpseo_linkdex', true);
57
+ $this->post_data->score = wpseo_translate_score($yoast_score);
58
+ };
59
+ }
60
+
61
+ /**
62
+ * Menu Options
63
+ */
64
+ private function addMenuOptions($post)
65
+ {
66
+ $this->post_data->nav_title = get_post_meta($post->ID, 'np_nav_title', true);
67
+ $this->post_data->link_target = get_post_meta($post->ID, 'np_link_target', true);
68
+ $this->post_data->nav_title_attr = get_post_meta($post->ID, 'np_title_attribute', true);
69
+ $this->post_data->nav_css = get_post_meta($post->ID, 'np_nav_css_classes', true);
70
+ $nav_status = get_post_meta( $post->ID, 'np_nav_status', true);
71
+ $this->post_data->nav_status = ( $nav_status == 'hide' ) ? 'hide' : 'show';
72
+ }
73
+
74
+ /**
75
+ * Date Vars
76
+ */
77
+ private function addDate($post)
78
+ {
79
+ $this->post_data->date = new \stdClass();
80
+ $this->post_data->date->d = get_the_time('d', $post->ID);
81
+ $this->post_data->date->month = get_the_time('m', $post->ID);
82
+ $this->post_data->date->y = get_the_time('Y', $post->ID);
83
+ $this->post_data->date->h = get_the_time('H', $post->ID);
84
+ $this->post_data->date->m = get_the_time('i', $post->ID);
85
+ }
86
+
87
+ /**
88
+ * Add Author Info
89
+ */
90
+ private function author($post)
91
+ {
92
+ $this->post_data->author = get_the_author_meta('display_name', $post->post_author);
93
+ $this->post_data->author_link = admin_url('edit.php?post_type=' . $post->post_type . '&author=' . $post->post_author);
94
+ }
95
+
96
+ }
app/Entities/Post/PostFactory.php CHANGED
@@ -1,6 +1,7 @@
1
  <?php namespace NestedPages\Entities\Post;
2
 
3
  use NestedPages\Entities\Post\PostRepository;
 
4
 
5
  /**
6
  * Factory class for adding new posts
@@ -11,7 +12,13 @@ class PostFactory {
11
  * Post Repository
12
  * @var object
13
  */
14
- private $repo;
 
 
 
 
 
 
15
 
16
  /**
17
  * New Page IDs
@@ -22,37 +29,43 @@ class PostFactory {
22
 
23
  public function __construct()
24
  {
25
- $this->repo = new PostRepository;
 
26
  }
27
 
28
 
29
  /**
30
  * Create New Child Pages
31
  */
32
- public function createChildPages($data)
33
  {
34
  foreach($data['post_title'] as $key => $title){
 
35
  $post = array(
36
  'post_title' => sanitize_text_field($title),
37
- 'post_type' => 'page',
38
  'post_status' => sanitize_text_field($data['_status']),
39
  'post_author' => sanitize_text_field($data['post_author']),
40
- 'post_parent' => sanitize_text_field($data['parent_id'])
 
41
  );
42
  $new_page_id = wp_insert_post($post);
 
 
 
 
43
  $this->new_ids[$key] = $new_page_id;
44
  }
45
- return $this->getNewPages();
46
  }
47
 
48
 
49
  /**
50
  * Get Array of New Pages
51
  */
52
- private function getNewPages()
53
  {
54
- $new_pages = $this->repo->pageArray($this->new_ids);
55
- return $new_pages;
56
  }
57
 
58
 
1
  <?php namespace NestedPages\Entities\Post;
2
 
3
  use NestedPages\Entities\Post\PostRepository;
4
+ use NestedPages\Entities\Post\PostUpdateRepository;
5
 
6
  /**
7
  * Factory class for adding new posts
12
  * Post Repository
13
  * @var object
14
  */
15
+ private $post_repo;
16
+
17
+ /**
18
+ * Post Repository
19
+ * @var object
20
+ */
21
+ private $post_update_repo;
22
 
23
  /**
24
  * New Page IDs
29
 
30
  public function __construct()
31
  {
32
+ $this->post_repo = new PostRepository;
33
+ $this->post_update_repo = new PostUpdateRepository;
34
  }
35
 
36
 
37
  /**
38
  * Create New Child Pages
39
  */
40
+ public function createChildPosts($data)
41
  {
42
  foreach($data['post_title'] as $key => $title){
43
+ $post_type = sanitize_text_field($data['post_type']);
44
  $post = array(
45
  'post_title' => sanitize_text_field($title),
 
46
  'post_status' => sanitize_text_field($data['_status']),
47
  'post_author' => sanitize_text_field($data['post_author']),
48
+ 'post_parent' => sanitize_text_field($data['parent_id']),
49
+ 'post_type' => $post_type
50
  );
51
  $new_page_id = wp_insert_post($post);
52
+ $data['post_id'] = $new_page_id;
53
+ if ( isset($data['page_template']) ){
54
+ $this->post_update_repo->updateTemplate($data);
55
+ }
56
  $this->new_ids[$key] = $new_page_id;
57
  }
58
+ return $this->getNewPosts($post_type);
59
  }
60
 
61
 
62
  /**
63
  * Get Array of New Pages
64
  */
65
+ private function getNewPosts($post_type)
66
  {
67
+ $new_posts = $this->post_repo->postArray($this->new_ids, $post_type);
68
+ return $new_posts;
69
  }
70
 
71
 
app/Entities/Post/PostRepository.php CHANGED
@@ -1,352 +1,16 @@
1
  <?php namespace NestedPages\Entities\Post;
2
 
3
- use NestedPages\Form\Validation\Validation;
4
-
5
  class PostRepository {
6
 
7
  /**
8
- * Validation Class
9
- * @var object NP_Validation
10
- */
11
- protected $validation;
12
-
13
-
14
- /**
15
- * New Post ID
16
- */
17
- protected $new_id;
18
-
19
-
20
- public function __construct()
21
- {
22
- $this->validation = new Validation;
23
- }
24
-
25
-
26
- /**
27
- * Update Order
28
- * @param array posts
29
- * @param int parent
30
- * @since 1.0
31
- */
32
- public function updateOrder($posts, $parent = 0)
33
- {
34
- $this->validation->validatePostIDs($posts);
35
- foreach( $posts as $key => $post )
36
- {
37
- wp_update_post(array(
38
- 'ID' => sanitize_text_field($post['id']),
39
- 'menu_order' => $key,
40
- 'post_parent' => $parent
41
- ));
42
-
43
- if ( isset($post['children']) ){
44
- $this->updateOrder($post['children'], $post['id']);
45
- }
46
- }
47
- return true;
48
- }
49
-
50
-
51
- /**
52
- * Update Post
53
- * @param array data
54
- * @since 1.0
55
- */
56
- public function updatePost($data)
57
- {
58
- $this->validation->checkEmpty($data['post_title'], __('Title', 'nestedpages'));
59
- $date = $this->validation->validateDate($data);
60
- if ( !isset($_POST['comment_status']) ) $data['comment_status'] = 'closed';
61
-
62
- if ( isset($_POST['keep_private']) && $_POST['keep_private'] == 'private' ){
63
- $status = 'private';
64
- } else {
65
- $status = ( isset($data['_status']) ) ? sanitize_text_field($data['_status']) : 'publish';
66
- }
67
-
68
- $updated_post = array(
69
- 'ID' => sanitize_text_field($data['post_id']),
70
- 'post_title' => sanitize_text_field($data['post_title']),
71
- 'post_author' => sanitize_text_field($data['post_author']),
72
- 'post_name' => sanitize_text_field($data['post_name']),
73
- 'post_date' => $date,
74
- 'comment_status' => sanitize_text_field($data['comment_status']),
75
- 'post_status' => $status,
76
- 'post_password' => sanitize_text_field($data['post_password'])
77
- );
78
- wp_update_post($updated_post);
79
-
80
- $this->updateTemplate($data);
81
- $this->updateNestedPagesStatus($data);
82
-
83
- // Taxonomies
84
- $this->updateCategories($data);
85
- $this->updateTaxonomies($data);
86
-
87
- // Menu Options
88
- $this->updateNavStatus($data);
89
- $this->updateNavTitle($data);
90
- $this->updateLinkTarget($data);
91
- $this->updateTitleAttribute($data);
92
- $this->updateNavCSS($data);
93
-
94
- return true;
95
- }
96
-
97
-
98
- /**
99
- * Update Page Template
100
- * @param array data
101
- * @since 1.0
102
- */
103
- private function updateTemplate($data)
104
- {
105
- $template = sanitize_text_field($data['page_template']);
106
- update_post_meta(
107
- $data['post_id'],
108
- '_wp_page_template',
109
- $template
110
- );
111
- }
112
-
113
-
114
- /**
115
- * Update Nav Status (show/hide in nav menu)
116
- * @since 1.0
117
- * @param array data
118
- */
119
- private function updateNavStatus($data)
120
- {
121
- $status = ( isset($data['nav_status']) ) ? 'hide' : 'show';
122
- $id = ( isset($data['post_id']) ) ? $data['post_id'] : $this->new_id;
123
- update_post_meta(
124
- $id,
125
- 'np_nav_status',
126
- $status
127
- );
128
- }
129
-
130
-
131
- /**
132
- * Update Nested Pages Visibility (how/hide in Nested Pages interface)
133
- * @since 1.0
134
- * @param array data
135
- */
136
- private function updateNestedPagesStatus($data)
137
- {
138
- $status = ( isset($data['nested_pages_status']) ) ? 'hide' : 'show';
139
- $id = ( isset($data['post_id']) ) ? $data['post_id'] : $this->new_id;
140
- update_post_meta(
141
- $id,
142
- 'nested_pages_status',
143
- $status
144
- );
145
- }
146
-
147
-
148
- /**
149
- * Update Nested Pages Menu Navigation Label
150
- * @since 1.0
151
- * @param array data
152
- */
153
- private function updateNavTitle($data)
154
- {
155
- if ( isset($data['np_nav_title']) ){
156
- $title = sanitize_text_field($data['np_nav_title']);
157
- update_post_meta(
158
- $data['post_id'],
159
- 'np_nav_title',
160
- $title
161
- );
162
- }
163
- }
164
-
165
-
166
- /**
167
- * Update Nested Pages Menu Navigation CSS Classes
168
- * @since 1.0
169
- * @param array data
170
- */
171
- private function updateNavCSS($data)
172
- {
173
- if ( isset($data['np_nav_css_classes']) ){
174
- $css_classes = sanitize_text_field($data['np_nav_css_classes']);
175
- update_post_meta(
176
- $data['post_id'],
177
- 'np_nav_css_classes',
178
- $css_classes
179
- );
180
- }
181
- }
182
-
183
-
184
- /**
185
- * Update Nested Pages Menu Title Attribute
186
- * @since 1.0
187
- * @param array data
188
- */
189
- private function updateTitleAttribute($data)
190
- {
191
- if ( isset($data['np_title_attribute']) ){
192
- $title_attr = sanitize_text_field($data['np_title_attribute']);
193
- update_post_meta(
194
- $data['post_id'],
195
- 'np_title_attribute',
196
- $title_attr
197
- );
198
- }
199
- }
200
-
201
-
202
- /**
203
- * Update Categories
204
- * @since 1.0
205
- * @param array data
206
- */
207
- private function updateCategories($data)
208
- {
209
- if ( isset($data['post_category']) )
210
- {
211
- $this->validation->validateIntegerArray($data['post_category']);
212
- $cats = array();
213
- foreach($data['post_category'] as $cat) {
214
- if ( $cat !== 0 ) $cats[] = (int) $cat;
215
- }
216
- wp_set_post_terms($data['post_id'], $cats, 'category');
217
- }
218
- }
219
-
220
-
221
- /**
222
- * Update Hierarchical Taxonomy Terms
223
- * @since 1.0
224
- * @param array data
225
- */
226
- private function updateTaxonomies($data)
227
- {
228
- if ( isset($data['tax_input']) ) {
229
- foreach ( $data['tax_input'] as $taxonomy => $term_ids ){
230
- $tax = get_taxonomy($taxonomy);
231
- if ( $tax->hierarchical ){
232
- $this->validation->validateIntegerArray($term_ids);
233
- $this->updateHierarchicalTaxonomies($data, $taxonomy, $term_ids);
234
- } else {
235
- $this->updateFlatTaxonomy($data, $taxonomy, $term_ids);
236
- }
237
- }
238
- }
239
- }
240
-
241
-
242
- /**
243
- * Update Hierarchical Taxonomy Terms
244
- * @since 1.1.4
245
- * @param array data
246
- */
247
- private function updateHierarchicalTaxonomies($data, $taxonomy, $term_ids)
248
- {
249
- $terms = array();
250
- foreach ( $term_ids as $term ){
251
- if ( $term !== 0 ) $terms[] = (int) $term;
252
- }
253
- wp_set_post_terms($data['post_id'], $terms, $taxonomy);
254
- }
255
-
256
-
257
- /**
258
- * Update Flat Taxonomy Terms
259
  * @since 1.1.4
260
- * @param array data
261
  */
262
- private function updateFlatTaxonomy($data, $taxonomy, $terms)
263
- {
264
- $terms = explode(',', sanitize_text_field($terms));
265
- $new_terms = array();
266
- foreach($terms as $term)
267
- {
268
- if ( $term !== "" ) array_push($new_terms, $term);
269
- }
270
- wp_set_post_terms($data['post_id'], $new_terms, $taxonomy);
271
- }
272
-
273
-
274
- /**
275
- * Update Link Target for Redirects
276
- * @since 1.1
277
- * @param array data
278
- */
279
- private function updateLinkTarget($data)
280
- {
281
- $link_target = ( isset($data['link_target']) ) ? "_blank" : "";
282
- $id = ( isset($data['post_id']) ) ? $data['post_id'] : $this->new_id;
283
- update_post_meta(
284
- $id,
285
- 'np_link_target',
286
- $link_target
287
- );
288
- }
289
-
290
-
291
- /**
292
- * Update a Redirect
293
- * @since 1.1
294
- * @param array data
295
- */
296
- public function updateRedirect($data)
297
- {
298
- $this->validation->checkEmpty($data['post_title'], __('Label', 'nestedpages'));
299
- $updated_post = array(
300
- 'ID' => sanitize_text_field($data['post_id']),
301
- 'post_title' => sanitize_text_field($data['post_title']),
302
- 'post_status' => sanitize_text_field($data['_status']),
303
- 'post_content' => sanitize_text_field($data['post_content']),
304
- 'post_parent' => sanitize_text_field($data['parent_id'])
305
- );
306
- $this->new_id = wp_update_post($updated_post);
307
-
308
- $this->updateNavStatus($data);
309
- $this->updateNestedPagesStatus($data);
310
- $this->updateLinkTarget($data);
311
- $this->updateTitleAttribute($data);
312
- $this->updateNavCSS($data);
313
-
314
- return $this->new_id;
315
- }
316
-
317
-
318
- /**
319
- * Save a new Redirect
320
- * @since 1.1
321
- * @param array data
322
- */
323
- public function saveRedirect($data)
324
- {
325
- $this->validation->validateRedirect($data);
326
- $new_link = array(
327
- 'post_title' => sanitize_text_field($data['np_link_title']),
328
- 'post_status' => sanitize_text_field($data['_status']),
329
- 'post_content' => sanitize_text_field($data['np_link_content']),
330
- 'post_parent' => sanitize_text_field($data['parent_id']),
331
- 'post_type' => 'np-redirect'
332
- );
333
- $this->new_id = wp_insert_post($new_link);
334
-
335
- $this->updateNavStatus($data);
336
- $this->updateNestedPagesStatus($data);
337
- $this->updateLinkTarget($data);
338
- return $this->new_id;
339
- }
340
-
341
-
342
- /**
343
- * Get count of hidden pages
344
- * @since 1.1.4
345
- */
346
- public function getHiddenCount()
347
  {
 
348
  $hidden = new \WP_Query(array(
349
- 'post_type' => array('page', 'np-redirect'),
350
  'meta_key' => 'nested_pages_status',
351
  'meta_value' => 'hide',
352
  'perm' => 'readable'));
@@ -358,9 +22,9 @@ class PostRepository {
358
  * Get Trash Count (pages)
359
  * @since 1.1.4
360
  */
361
- public function trashedPagesCount()
362
  {
363
- $trashed = new \WP_Query(array('post_type'=>'page','post_status'=>'trash','posts_per_page'=>-1));
364
  return $trashed->found_posts;
365
  }
366
 
@@ -379,17 +43,40 @@ class PostRepository {
379
  }
380
 
381
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
382
  /**
383
  * Get an array of pages given an array of IDs
384
  * @since 1.1.8 (used in creation of new pages)
385
  * @param ids array
386
  * @return array
387
  */
388
- public function pageArray($ids)
389
  {
390
  $pages = array();
391
  $page_query = new \WP_Query(array(
392
- 'post_type' => 'page',
393
  'posts_per_page' => -1,
394
  'post__in' => $ids,
395
  'post_status' => array('publish', 'draft')
@@ -402,7 +89,7 @@ class PostRepository {
402
  $pages[$c]['slug'] = $post->post_name;
403
  $pages[$c]['author'] = get_the_author_meta('ID');
404
  $pages[$c]['status'] = ucfirst(get_post_status());
405
- $pages[$c]['template'] = get_page_template_slug();
406
  $pages[$c]['post_parent'] = $post->post_parent;
407
  $pages[$c]['edit_link'] = get_edit_post_link($post->ID);
408
  $pages[$c]['view_link'] = get_the_permalink();
@@ -422,4 +109,18 @@ class PostRepository {
422
  return $pages;
423
  }
424
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
425
  }
1
  <?php namespace NestedPages\Entities\Post;
2
 
 
 
3
  class PostRepository {
4
 
5
  /**
6
+ * Get count of hidden posts
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  * @since 1.1.4
 
8
  */
9
+ public function getHiddenCount($type)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  {
11
+ if ( in_array('page', $type) ) array_push($type, 'np-redirect');
12
  $hidden = new \WP_Query(array(
13
+ 'post_type' => $type,
14
  'meta_key' => 'nested_pages_status',
15
  'meta_value' => 'hide',
16
  'perm' => 'readable'));
22
  * Get Trash Count (pages)
23
  * @since 1.1.4
24
  */
25
+ public function trashedCount($post_type)
26
  {
27
+ $trashed = new \WP_Query(array('post_type'=>$post_type,'post_status'=>'trash','posts_per_page'=>-1));
28
  return $trashed->found_posts;
29
  }
30
 
43
  }
44
 
45
 
46
+ /**
47
+ * Return css class string of taxonomies
48
+ * @param int post_id
49
+ * @return string
50
+ */
51
+ public function getTaxonomyCSS($post_id, $taxonomies, $hierarchical = true)
52
+ {
53
+ $out = '';
54
+ if ( count($taxonomies) > 0 ) {
55
+ foreach ( $taxonomies as $taxonomy ){
56
+ $terms = wp_get_post_terms($post_id, $taxonomy->name);
57
+ foreach ( $terms as $term ){
58
+ $out .= ( $hierarchical ) ? 'in-' : 'inf-';
59
+ $out .= $taxonomy->name;
60
+ $out .= ( $hierarchical ) ? '-' : '-nps-';
61
+ $out .= $term->term_id . ' ';
62
+ }
63
+ }
64
+ }
65
+ return $out;
66
+ }
67
+
68
+
69
  /**
70
  * Get an array of pages given an array of IDs
71
  * @since 1.1.8 (used in creation of new pages)
72
  * @param ids array
73
  * @return array
74
  */
75
+ public function postArray($ids, $post_type)
76
  {
77
  $pages = array();
78
  $page_query = new \WP_Query(array(
79
+ 'post_type' => $post_type,
80
  'posts_per_page' => -1,
81
  'post__in' => $ids,
82
  'post_status' => array('publish', 'draft')
89
  $pages[$c]['slug'] = $post->post_name;
90
  $pages[$c]['author'] = get_the_author_meta('ID');
91
  $pages[$c]['status'] = ucfirst(get_post_status());
92
+ $pages[$c]['page_template'] = get_page_template_slug($post->ID);
93
  $pages[$c]['post_parent'] = $post->post_parent;
94
  $pages[$c]['edit_link'] = get_edit_post_link($post->ID);
95
  $pages[$c]['view_link'] = get_the_permalink();
109
  return $pages;
110
  }
111
 
112
+
113
+ /**
114
+ * Empty the Trash for a given post type
115
+ * @since 1.3.1
116
+ */
117
+ public function emptyTrash($post_type)
118
+ {
119
+ $posts_q = new \WP_Query(array('post_type'=>$post_type, 'post_status'=>'trash', 'posts_per_page'=>-1));
120
+ if ( $posts_q->have_posts() ) : while ( $posts_q->have_posts() ) : $posts_q->the_post();
121
+ wp_delete_post(get_the_id(), true);
122
+ endwhile; endif; wp_reset_postdata();
123
+ return true;
124
+ }
125
+
126
  }
app/Entities/Post/PostUpdateRepository.php ADDED
@@ -0,0 +1,344 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php namespace NestedPages\Entities\Post;
2
+
3
+ use NestedPages\Form\Validation\Validation;
4
+ /**
5
+ * Post Create/Update Methods
6
+ */
7
+ class PostUpdateRepository {
8
+
9
+ /**
10
+ * Validation Class
11
+ * @var object NP_Validation
12
+ */
13
+ protected $validation;
14
+
15
+ /**
16
+ * New Post ID
17
+ * @var int
18
+ */
19
+ protected $new_id;
20
+
21
+
22
+ public function __construct()
23
+ {
24
+ $this->validation = new Validation;
25
+ }
26
+
27
+
28
+ /**
29
+ * Update Order
30
+ * @param array posts
31
+ * @param int parent
32
+ * @since 1.0
33
+ */
34
+ public function updateOrder($posts, $parent = 0)
35
+ {
36
+ $this->validation->validatePostIDs($posts);
37
+ foreach( $posts as $key => $post )
38
+ {
39
+ wp_update_post(array(
40
+ 'ID' => sanitize_text_field($post['id']),
41
+ 'menu_order' => $key,
42
+ 'post_parent' => $parent
43
+ ));
44
+
45
+ if ( isset($post['children']) ){
46
+ $this->updateOrder($post['children'], $post['id']);
47
+ }
48
+ }
49
+ return true;
50
+ }
51
+
52
+ /**
53
+ * Update Post
54
+ * @param array data
55
+ * @since 1.0
56
+ */
57
+ public function updatePost($data)
58
+ {
59
+ $this->validation->checkEmpty($data['post_title'], __('Title', 'nestedpages'));
60
+ $date = $this->validation->validateDate($data);
61
+ if ( !isset($_POST['comment_status']) ) $data['comment_status'] = 'closed';
62
+
63
+ if ( isset($_POST['keep_private']) && $_POST['keep_private'] == 'private' ){
64
+ $status = 'private';
65
+ } else {
66
+ $status = ( isset($data['_status']) ) ? sanitize_text_field($data['_status']) : 'publish';
67
+ }
68
+
69
+ $updated_post = array(
70
+ 'ID' => sanitize_text_field($data['post_id']),
71
+ 'post_title' => sanitize_text_field($data['post_title']),
72
+ 'post_author' => sanitize_text_field($data['post_author']),
73
+ 'post_name' => sanitize_text_field($data['post_name']),
74
+ 'post_date' => $date,
75
+ 'comment_status' => sanitize_text_field($data['comment_status']),
76
+ 'post_status' => $status,
77
+ 'post_password' => sanitize_text_field($data['post_password'])
78
+ );
79
+ wp_update_post($updated_post);
80
+
81
+ $this->updateTemplate($data);
82
+ $this->updateNestedPagesStatus($data);
83
+
84
+ // Taxonomies
85
+ $this->updateCategories($data);
86
+ $this->updateTaxonomies($data);
87
+
88
+ // Menu Options
89
+ $this->updateNavStatus($data);
90
+ $this->updateNavTitle($data);
91
+ $this->updateLinkTarget($data);
92
+ $this->updateTitleAttribute($data);
93
+ $this->updateNavCSS($data);
94
+
95
+ return true;
96
+ }
97
+
98
+
99
+ /**
100
+ * Update Page Template
101
+ * @param array data
102
+ * @since 1.0
103
+ */
104
+ public function updateTemplate($data)
105
+ {
106
+ if ( isset($data['page_template']) ){
107
+ $template = sanitize_text_field($data['page_template']);
108
+ update_post_meta(
109
+ $data['post_id'],
110
+ '_wp_page_template',
111
+ $template
112
+ );
113
+ }
114
+ }
115
+
116
+
117
+ /**
118
+ * Update Nav Status (show/hide in nav menu)
119
+ * @since 1.0
120
+ * @param array data
121
+ */
122
+ private function updateNavStatus($data)
123
+ {
124
+ $status = ( isset($data['nav_status']) ) ? 'hide' : 'show';
125
+ $id = ( isset($data['post_id']) ) ? $data['post_id'] : $this->new_id;
126
+ update_post_meta(
127
+ $id,
128
+ 'np_nav_status',
129
+ $status
130
+ );
131
+ }
132
+
133
+
134
+ /**
135
+ * Update Nested Pages Visibility (how/hide in Nested Pages interface)
136
+ * @since 1.0
137
+ * @param array data
138
+ */
139
+ private function updateNestedPagesStatus($data)
140
+ {
141
+ $status = ( isset($data['nested_pages_status']) ) ? 'hide' : 'show';
142
+ $id = ( isset($data['post_id']) ) ? $data['post_id'] : $this->new_id;
143
+ update_post_meta(
144
+ $id,
145
+ 'nested_pages_status',
146
+ $status
147
+ );
148
+ }
149
+
150
+
151
+ /**
152
+ * Update Nested Pages Menu Navigation Label
153
+ * @since 1.0
154
+ * @param array data
155
+ */
156
+ private function updateNavTitle($data)
157
+ {
158
+ if ( isset($data['np_nav_title']) ){
159
+ $title = sanitize_text_field($data['np_nav_title']);
160
+ update_post_meta(
161
+ $data['post_id'],
162
+ 'np_nav_title',
163
+ $title
164
+ );
165
+ }
166
+ }
167
+
168
+
169
+ /**
170
+ * Update Nested Pages Menu Navigation CSS Classes
171
+ * @since 1.0
172
+ * @param array data
173
+ */
174
+ private function updateNavCSS($data)
175
+ {
176
+ if ( isset($data['np_nav_css_classes']) ){
177
+ $css_classes = sanitize_text_field($data['np_nav_css_classes']);
178
+ update_post_meta(
179
+ $data['post_id'],
180
+ 'np_nav_css_classes',
181
+ $css_classes
182
+ );
183
+ }
184
+ }
185
+
186
+
187
+ /**
188
+ * Update Nested Pages Menu Title Attribute
189
+ * @since 1.0
190
+ * @param array data
191
+ */
192
+ private function updateTitleAttribute($data)
193
+ {
194
+ if ( isset($data['np_title_attribute']) ){
195
+ $title_attr = sanitize_text_field($data['np_title_attribute']);
196
+ update_post_meta(
197
+ $data['post_id'],
198
+ 'np_title_attribute',
199
+ $title_attr
200
+ );
201
+ }
202
+ }
203
+
204
+
205
+ /**
206
+ * Update Categories
207
+ * @since 1.0
208
+ * @param array data
209
+ */
210
+ private function updateCategories($data)
211
+ {
212
+ if ( isset($data['post_category']) )
213
+ {
214
+ $this->validation->validateIntegerArray($data['post_category']);
215
+ $cats = array();
216
+ foreach($data['post_category'] as $cat) {
217
+ if ( $cat !== 0 ) $cats[] = (int) $cat;
218
+ }
219
+ wp_set_post_terms($data['post_id'], $cats, 'category');
220
+ }
221
+ }
222
+
223
+
224
+ /**
225
+ * Update Hierarchical Taxonomy Terms
226
+ * @since 1.0
227
+ * @param array data
228
+ */
229
+ private function updateTaxonomies($data)
230
+ {
231
+ if ( isset($data['tax_input']) ) {
232
+ foreach ( $data['tax_input'] as $taxonomy => $term_ids ){
233
+ $tax = get_taxonomy($taxonomy);
234
+ if ( $tax->hierarchical ){
235
+ $this->validation->validateIntegerArray($term_ids);
236
+ $this->updateHierarchicalTaxonomies($data, $taxonomy, $term_ids);
237
+ } else {
238
+ $this->updateFlatTaxonomy($data, $taxonomy, $term_ids);
239
+ }
240
+ }
241
+ }
242
+ }
243
+
244
+
245
+ /**
246
+ * Update Hierarchical Taxonomy Terms
247
+ * @since 1.1.4
248
+ * @param array data
249
+ */
250
+ private function updateHierarchicalTaxonomies($data, $taxonomy, $term_ids)
251
+ {
252
+ $terms = array();
253
+ foreach ( $term_ids as $term ){
254
+ if ( $term !== 0 ) $terms[] = (int) $term;
255
+ }
256
+ wp_set_post_terms($data['post_id'], $terms, $taxonomy);
257
+ }
258
+
259
+
260
+ /**
261
+ * Update Flat Taxonomy Terms
262
+ * @since 1.1.4
263
+ * @param array data
264
+ */
265
+ private function updateFlatTaxonomy($data, $taxonomy, $terms)
266
+ {
267
+ $terms = explode(',', sanitize_text_field($terms));
268
+ $new_terms = array();
269
+ foreach($terms as $term)
270
+ {
271
+ if ( $term !== "" ) array_push($new_terms, $term);
272
+ }
273
+ wp_set_post_terms($data['post_id'], $new_terms, $taxonomy);
274
+ }
275
+
276
+
277
+ /**
278
+ * Update Link Target for Redirects
279
+ * @since 1.1
280
+ * @param array data
281
+ */
282
+ private function updateLinkTarget($data)
283
+ {
284
+ $link_target = ( isset($data['link_target']) ) ? "_blank" : "";
285
+ $id = ( isset($data['post_id']) ) ? $data['post_id'] : $this->new_id;
286
+ update_post_meta(
287
+ $id,
288
+ 'np_link_target',
289
+ $link_target
290
+ );
291
+ }
292
+
293
+
294
+ /**
295
+ * Update a Redirect
296
+ * @since 1.1
297
+ * @param array data
298
+ */
299
+ public function updateRedirect($data)
300
+ {
301
+ $this->validation->checkEmpty($data['post_title'], __('Label', 'nestedpages'));
302
+ $updated_post = array(
303
+ 'ID' => sanitize_text_field($data['post_id']),
304
+ 'post_title' => sanitize_text_field($data['post_title']),
305
+ 'post_status' => sanitize_text_field($data['_status']),
306
+ 'post_content' => sanitize_text_field($data['post_content']),
307
+ 'post_parent' => sanitize_text_field($data['parent_id'])
308
+ );
309
+ $this->new_id = wp_update_post($updated_post);
310
+
311
+ $this->updateNavStatus($data);
312
+ $this->updateNestedPagesStatus($data);
313
+ $this->updateLinkTarget($data);
314
+ $this->updateTitleAttribute($data);
315
+ $this->updateNavCSS($data);
316
+
317
+ return $this->new_id;
318
+ }
319
+
320
+
321
+ /**
322
+ * Save a new Redirect
323
+ * @since 1.1
324
+ * @param array data
325
+ */
326
+ public function saveRedirect($data)
327
+ {
328
+ $this->validation->validateRedirect($data);
329
+ $new_link = array(
330
+ 'post_title' => sanitize_text_field($data['np_link_title']),
331
+ 'post_status' => sanitize_text_field($data['_status']),
332
+ 'post_content' => sanitize_text_field($data['np_link_content']),
333
+ 'post_parent' => sanitize_text_field($data['parent_id']),
334
+ 'post_type' => 'np-redirect'
335
+ );
336
+ $this->new_id = wp_insert_post($new_link);
337
+
338
+ $this->updateNavStatus($data);
339
+ $this->updateNestedPagesStatus($data);
340
+ $this->updateLinkTarget($data);
341
+ return $this->new_id;
342
+ }
343
+
344
+ }
app/Entities/PostType/PostTypeRepository.php CHANGED
@@ -5,31 +5,172 @@ class PostTypeRepository {
5
 
6
  /**
7
  * Get Available Post Types
 
8
  * @return array
9
  */
10
  public function getPostTypes($return = 'names')
11
  {
12
  $args = array(
13
  'public' => true,
14
- 'show_ui' => true,
15
- 'hierarchical' => true
16
  );
17
  return get_post_types($args, $return);
18
  }
19
 
20
 
21
  /**
22
- * Get an array of post types in name=>label format
 
 
23
  */
24
- public function getPostTypeArray($pages = false)
25
  {
26
  $all_types = $this->getPostTypes('objects');
27
  $post_types = array();
 
28
  foreach($all_types as $key => $type){
29
- if ( (!$pages) && ($key == 'page') ) continue;
30
- $post_types[$key] = $type->labels->name;
 
 
 
 
 
 
31
  }
32
  return $post_types;
33
  }
34
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  }
5
 
6
  /**
7
  * Get Available Post Types
8
+ * @since 1.2.1
9
  * @return array
10
  */
11
  public function getPostTypes($return = 'names')
12
  {
13
  $args = array(
14
  'public' => true,
15
+ 'show_ui' => true
 
16
  );
17
  return get_post_types($args, $return);
18
  }
19
 
20
 
21
  /**
22
+ * Get an object of non-page post types
23
+ * @since 1.2.1
24
+ * @return object
25
  */
26
+ public function getPostTypesObject($pages = false)
27
  {
28
  $all_types = $this->getPostTypes('objects');
29
  $post_types = array();
30
+ $enabled_types = $this->enabledPostTypes();
31
  foreach($all_types as $key => $type){
32
+ if ( (!$pages) && ($key == 'attachment') ) continue;
33
+ $post_types[$type->name] = new \stdClass();
34
+ $post_types[$type->name]->name = $type->name;
35
+ $post_types[$type->name]->label = $type->labels->name;
36
+ $post_types[$type->name]->hierarchical = $type->hierarchical;
37
+ $post_types[$type->name]->np_enabled = ( array_key_exists($type->name, $this->enabledPostTypes()) ) ? true : false;
38
+ $post_types[$type->name]->replace_menu = $this->overrideMenu($type->name);
39
+ $post_types[$type->name]->hide_default = $this->hideDefault($type->name);
40
  }
41
  return $post_types;
42
  }
43
 
44
+
45
+ /**
46
+ * Is the specified post type set to override the default menu?
47
+ * @param string post type name
48
+ * @return boolean
49
+ */
50
+ private function overrideMenu($post_type)
51
+ {
52
+ foreach($this->enabledPostTypes() as $key => $type){
53
+ if ( $key == $post_type ){
54
+ return ( isset($type['replace_menu']) && $type['replace_menu'] == 'true' )
55
+ ? true
56
+ : false;
57
+ }
58
+ }
59
+ }
60
+
61
+
62
+ /**
63
+ * Is the specified post type set to hide the default link?
64
+ * @param string post type name
65
+ * @return boolean
66
+ */
67
+ public function hideDefault($post_type)
68
+ {
69
+ foreach($this->enabledPostTypes() as $key => $type){
70
+ if ( $key == $post_type ){
71
+ return ( isset($type['hide_default']) && $type['hide_default'] == 'true' )
72
+ ? true
73
+ : false;
74
+ }
75
+ }
76
+ }
77
+
78
+
79
+ /**
80
+ * Get an array of NP enabled Post Types
81
+ * @since 1.2.1
82
+ * @return array
83
+ */
84
+ public function enabledPostTypes()
85
+ {
86
+ $types = get_option('nestedpages_posttypes');
87
+ if ( !$types ) $types = array();
88
+
89
+ return $types;
90
+ }
91
+
92
+
93
+ /**
94
+ * Add New Post Link
95
+ * @since 1.2.1
96
+ * @param string post_type
97
+ * @return string
98
+ */
99
+ public function addNewPostLink($post_type)
100
+ {
101
+ return esc_url( admin_url('post-new.php?post_type=' . $post_type) );
102
+ }
103
+
104
+
105
+ /**
106
+ * Trash Link
107
+ * @since 1.2.1
108
+ * @param string post_type
109
+ * @return string
110
+ */
111
+ public function trashLink($post_type)
112
+ {
113
+ return esc_url( admin_url('edit.php?post_status=trash&post_type=' . $post_type) );
114
+ }
115
+
116
+
117
+ /**
118
+ * Edit Post Link
119
+ * @since 1.2.1
120
+ * @param string post_type
121
+ * @return string
122
+ */
123
+ public function editSlug($post_type)
124
+ {
125
+ return ( $post_type->name == 'post' ) ? 'edit.php' : 'edit.php?post_type=' . $post_type->name;
126
+ }
127
+
128
+
129
+ /**
130
+ * Get Taxonomies enabled for post type
131
+ * @since 1.2.1
132
+ * @return array of taxonomy objects
133
+ * @param string post_type name
134
+ * @param boolean hierarchical
135
+ */
136
+ public function getTaxonomies($post_type, $hierarchical = true)
137
+ {
138
+ $taxonomy_names = get_object_taxonomies( $post_type );
139
+ $hierarchical_taxonomies = array();
140
+ $flat_taxonomies = array();
141
+ foreach ( $taxonomy_names as $taxonomy_name ) {
142
+ $taxonomy = get_taxonomy( $taxonomy_name );
143
+ if ( !$taxonomy->show_ui )
144
+ continue;
145
+
146
+ if ( $taxonomy->hierarchical )
147
+ $hierarchical_taxonomies[] = $taxonomy;
148
+ else
149
+ $flat_taxonomies[] = $taxonomy;
150
+ }
151
+ return ($hierarchical) ? $hierarchical_taxonomies : $flat_taxonomies;
152
+ }
153
+
154
+
155
+ /**
156
+ * Get the NP menu slug for a post type
157
+ * @param object WP Post Type Object
158
+ */
159
+ public function getMenuSlug($post_type)
160
+ {
161
+ return ( $post_type->name == 'page' ) ? 'nestedpages' : 'nestedpages-' . $post_type->name;
162
+ }
163
+
164
+
165
+ /**
166
+ * Set the Submenu Text
167
+ * "Nested View" for Hierarchical Post Types
168
+ * "Sort View" for Non-Hierarchical Post Types
169
+ */
170
+ public function getSubmenuText($post_type)
171
+ {
172
+ return ( $post_type->hierarchical ) ? __('Nested View', 'nestedpages') : __('Sort View', 'nestedpages');
173
+ }
174
+
175
+
176
  }
app/Entities/User/UserRepository.php CHANGED
@@ -17,6 +17,7 @@ class UserRepository {
17
  }
18
 
19
 
 
20
  /**
21
  * Get all roles that arent admin, contributor or subscriber
22
  * @return array
@@ -60,4 +61,34 @@ class UserRepository {
60
  return false;
61
  }
62
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
  }
17
  }
18
 
19
 
20
+
21
  /**
22
  * Get all roles that arent admin, contributor or subscriber
23
  * @return array
61
  return false;
62
  }
63
 
64
+
65
+ /**
66
+ * Get an array of all users/ids
67
+ * @since 1.3.0
68
+ * @return array
69
+ */
70
+ public function allUsers()
71
+ {
72
+ $users = get_users(array(
73
+ 'fields' => array('ID', 'display_name')
74
+ ));
75
+ return $users;
76
+ }
77
+
78
+
79
+ /**
80
+ * Update User's Visible Pages
81
+ */
82
+ public function updateVisiblePages($post_type, $ids)
83
+ {
84
+ $visible = unserialize(get_user_meta(get_current_user_id(), 'np_visible_posts', true));
85
+ $visible[$post_type] = $ids;
86
+ update_user_meta(
87
+ get_current_user_id(),
88
+ 'np_visible_posts',
89
+ serialize($visible)
90
+ );
91
+ }
92
+
93
+
94
  }
app/Form/FormActionFactory.php CHANGED
@@ -36,7 +36,9 @@ class FormActionFactory {
36
  'wp_ajax_npquickEditLink',
37
  'wp_ajax_npnewLink',
38
  'wp_ajax_npgetTaxonomies',
39
- 'wp_ajax_npnewChild'
 
 
40
  );
41
  $this->setHandlers();
42
  }
@@ -47,7 +49,8 @@ class FormActionFactory {
47
  public function setHandlers()
48
  {
49
  foreach($this->actions as $key => $action){
50
- $class = ucfirst(str_replace('wp_ajax_np', '', $action)) . 'Handler';
 
51
  $this->handlers[$key] = new \stdClass();
52
  $this->handlers[$key]->action = $action;
53
  $this->handlers[$key]->class = 'NestedPages\Form\Handlers\\' . $class;
36
  'wp_ajax_npquickEditLink',
37
  'wp_ajax_npnewLink',
38
  'wp_ajax_npgetTaxonomies',
39
+ 'wp_ajax_npnewChild',
40
+ 'admin_post_npListingSort',
41
+ 'wp_ajax_npEmptyTrash'
42
  );
43
  $this->setHandlers();
44
  }
49
  public function setHandlers()
50
  {
51
  foreach($this->actions as $key => $action){
52
+ $class = str_replace('admin_post_np', '', $action); // Non-AJAX forms
53
+ $class = ucfirst(str_replace('wp_ajax_np', '', $class)) . 'Handler'; // AJAX forms
54
  $this->handlers[$key] = new \stdClass();
55
  $this->handlers[$key]->action = $action;
56
  $this->handlers[$key]->class = 'NestedPages\Form\Handlers\\' . $class;
app/Form/Handlers/BaseHandler.php CHANGED
@@ -1,7 +1,9 @@
1
  <?php namespace NestedPages\Form\Handlers;
2
 
3
- use NestedPages\Entities\NavMenu;
4
  use NestedPages\Entities\Post\PostRepository;
 
 
5
 
6
  /**
7
  * Base Form Handler Class
@@ -26,6 +28,17 @@ abstract class BaseHandler {
26
  */
27
  protected $post_repo;
28
 
 
 
 
 
 
 
 
 
 
 
 
29
  /**
30
  * Response
31
  * @var array;
@@ -36,6 +49,8 @@ abstract class BaseHandler {
36
  public function __construct()
37
  {
38
  $this->post_repo = new PostRepository;
 
 
39
  $this->setData();
40
  $this->validateNonce();
41
  }
@@ -73,13 +88,15 @@ abstract class BaseHandler {
73
  */
74
  protected function syncMenu()
75
  {
76
- if ( $_POST['syncmenu'] == 'sync' ){
77
- $menu = new NavMenu;
78
- $menu->clearMenu();
79
- $menu->sync();
80
- update_option('nestedpages_menusync', 'sync');
81
- } else {
82
- update_option('nestedpages_menusync', 'nosync');
 
 
83
  }
84
  }
85
 
1
  <?php namespace NestedPages\Form\Handlers;
2
 
3
+ use NestedPages\Entities\NavMenu\NavMenu;
4
  use NestedPages\Entities\Post\PostRepository;
5
+ use NestedPages\Entities\Post\PostUpdateRepository;
6
+ use NestedPages\Entities\User\UserRepository;
7
 
8
  /**
9
  * Base Form Handler Class
28
  */
29
  protected $post_repo;
30
 
31
+ /**
32
+ * User Repo
33
+ * @var object
34
+ */
35
+ protected $user;
36
+
37
+ /**
38
+ * Post Update Repo
39
+ */
40
+ protected $post_update_repo;
41
+
42
  /**
43
  * Response
44
  * @var array;
49
  public function __construct()
50
  {
51
  $this->post_repo = new PostRepository;
52
+ $this->post_update_repo = new PostUpdateRepository;
53
+ $this->user = new UserRepository;
54
  $this->setData();
55
  $this->validateNonce();
56
  }
88
  */
89
  protected function syncMenu()
90
  {
91
+ if ( $_POST['post_type'] == 'page' ) {
92
+ if ( $_POST['syncmenu'] == 'sync' ){
93
+ $menu = new NavMenu;
94
+ $menu->clearMenu();
95
+ $menu->sync();
96
+ update_option('nestedpages_menusync', 'sync');
97
+ } else {
98
+ update_option('nestedpages_menusync', 'nosync');
99
+ }
100
  }
101
  }
102
 
app/Form/Handlers/EmptyTrashHandler.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php namespace NestedPages\Form\Handlers;
2
+
3
+ class EmptyTrashHandler extends BaseHandler {
4
+
5
+ public function __construct()
6
+ {
7
+ parent::__construct();
8
+ $this->emptyTrash();
9
+ }
10
+
11
+ private function emptyTrash()
12
+ {
13
+ if ( $this->post_repo->emptyTrash($_POST['posttype']) ){
14
+ return wp_send_json(array(
15
+ 'status'=>'success',
16
+ 'message'=> __('Trash successfully emptied.')
17
+ ));
18
+ }
19
+ $this->sendErrorResponse();
20
+ }
21
+
22
+ }
app/Form/Handlers/ListingSortHandler.php ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php namespace NestedPages\Form\Handlers;
2
+ /**
3
+ * Redirect to Listing with Specified Sorting Options Applied
4
+ */
5
+ class ListingSortHandler {
6
+
7
+ /**
8
+ * URL to redirect to
9
+ * @var string
10
+ */
11
+ private $url;
12
+
13
+
14
+ public function __construct()
15
+ {
16
+ $this->setURL();
17
+ $this->redirect();
18
+ }
19
+
20
+
21
+ /**
22
+ * Build the URL to Redirect to
23
+ */
24
+ private function setURL()
25
+ {
26
+ $this->url = sanitize_text_field($_POST['page']);
27
+ $this->setOrderBy();
28
+ $this->setOrder();
29
+ $this->setAuthor();
30
+ }
31
+
32
+
33
+ /**
34
+ * Set Order by parameters
35
+ */
36
+ private function setOrderBy()
37
+ {
38
+ $allowed = array('menu_order', 'date', 'title'); // prevent tomfoolery
39
+ if ( ($_POST['np_orderby'] !== "") && (!in_array($_POST['np_orderby'], $allowed)) ) $this->url .= '&orderby=menu_order';
40
+ $this->url .= '&orderby=' . sanitize_text_field($_POST['np_orderby']);
41
+ }
42
+
43
+
44
+ /**
45
+ * Set Order parameters
46
+ */
47
+ private function setOrder()
48
+ {
49
+ $allowed = array('ASC', 'DESC'); // prevent tomfoolery
50
+ if ( !in_array($_POST['np_order'], $allowed) ) $this->url .= '&order=DESC';
51
+ $this->url .= '&order=' . sanitize_text_field($_POST['np_order']);
52
+ }
53
+
54
+
55
+ /**
56
+ * Set Author parameters
57
+ */
58
+ private function setAuthor()
59
+ {
60
+ if ( (isset($_POST['np_author'])) && ($_POST['np_author'] !== "") ){
61
+ $this->url .= '&author=' . sanitize_text_field($_POST['np_author']);
62
+ }
63
+ }
64
+
65
+
66
+ /**
67
+ * Redirect to new URL
68
+ */
69
+ private function redirect()
70
+ {
71
+ header('Location:' . $this->url);
72
+ }
73
+
74
+ }
app/Form/Handlers/NestToggleHandler.php CHANGED
@@ -1,10 +1,12 @@
1
  <?php namespace NestedPages\Form\Handlers;
 
 
 
2
  /**
3
  * Syncs User's Visible/Toggled Pages
4
  */
5
  class NestToggleHandler extends BaseHandler {
6
 
7
-
8
  public function __construct()
9
  {
10
  parent::__construct();
@@ -29,11 +31,7 @@ class NestToggleHandler extends BaseHandler {
29
  */
30
  private function updateUserMeta()
31
  {
32
- update_user_meta(
33
- get_current_user_id(),
34
- 'np_visible_pages',
35
- serialize($this->data['ids'])
36
- );
37
  $this->response = array('status'=>'success', 'data'=>$this->data);
38
  $this->sendResponse();
39
  }
1
  <?php namespace NestedPages\Form\Handlers;
2
+
3
+ use NestedPages\Entities\User\UserRepository;
4
+
5
  /**
6
  * Syncs User's Visible/Toggled Pages
7
  */
8
  class NestToggleHandler extends BaseHandler {
9
 
 
10
  public function __construct()
11
  {
12
  parent::__construct();
31
  */
32
  private function updateUserMeta()
33
  {
34
+ $this->user->updateVisiblePages($this->data['posttype'], $this->data['ids']);
 
 
 
 
35
  $this->response = array('status'=>'success', 'data'=>$this->data);
36
  $this->sendResponse();
37
  }
app/Form/Handlers/NewChildHandler.php CHANGED
@@ -46,7 +46,7 @@ class NewChildHandler extends BaseHandler {
46
  private function savePages()
47
  {
48
  if ( $this->validates() ){
49
- $this->data['new_pages'] = $this->factory->createChildPages($this->data);
50
  $this->setResponse();
51
  return;
52
  }
46
  private function savePages()
47
  {
48
  if ( $this->validates() ){
49
+ $this->data['new_pages'] = $this->factory->createChildPosts($this->data);
50
  $this->setResponse();
51
  return;
52
  }
app/Form/Handlers/NewLinkHandler.php CHANGED
@@ -23,7 +23,7 @@ class NewLinkHandler extends BaseHandler {
23
  */
24
  private function saveRedirect()
25
  {
26
- $updated = $this->post_repo->saveRedirect($this->data);
27
  if ( !$updated ) $this->sendErrorResponse();
28
  $this->data['id'] = $updated;
29
  $this->addData();
23
  */
24
  private function saveRedirect()
25
  {
26
+ $updated = $this->post_update_repo->saveRedirect($this->data);
27
  if ( !$updated ) $this->sendErrorResponse();
28
  $this->data['id'] = $updated;
29
  $this->addData();
app/Form/Handlers/QuickEditHandler.php CHANGED
@@ -22,7 +22,7 @@ class QuickEditHandler extends BaseHandler {
22
  */
23
  private function updatePost()
24
  {
25
- $updated = $this->post_repo->updatePost($this->data);
26
  if ( !$updated ) $this->sendErrorResponse();
27
  if ( isset($this->data['tax_input']) ) $this->addFlatTaxonomies();
28
  $this->addData();
22
  */
23
  private function updatePost()
24
  {
25
+ $updated = $this->post_update_repo->updatePost($this->data);
26
  if ( !$updated ) $this->sendErrorResponse();
27
  if ( isset($this->data['tax_input']) ) $this->addFlatTaxonomies();
28
  $this->addData();
app/Form/Handlers/QuickEditLinkHandler.php CHANGED
@@ -20,7 +20,7 @@ class QuickEditLinkHandler extends BaseHandler {
20
  */
21
  private function updatePost()
22
  {
23
- $updated = $this->post_repo->updateRedirect($this->data);
24
  if ( !$updated ) $this->sendErrorResponse();
25
  $this->addData();
26
  $this->response = array(
20
  */
21
  private function updatePost()
22
  {
23
+ $updated = $this->post_update_repo->updateRedirect($this->data);
24
  if ( !$updated ) $this->sendErrorResponse();
25
  $this->addData();
26
  $this->response = array(
app/Form/Handlers/SortHandler.php CHANGED
@@ -23,7 +23,7 @@ class SortHandler extends BaseHandler {
23
  private function updateOrder()
24
  {
25
  $posts = $this->data['list'];
26
- $order = $this->post_repo->updateOrder($posts);
27
  if ( $order ){
28
  $this->response = array('status' => 'success', 'message' => __('Page order successfully updated.','nestedpages') );
29
  } else {
23
  private function updateOrder()
24
  {
25
  $posts = $this->data['list'];
26
+ $order = $this->post_update_repo->updateOrder($posts);
27
  if ( $order ){
28
  $this->response = array('status' => 'success', 'message' => __('Page order successfully updated.','nestedpages') );
29
  } else {
app/Helpers.php CHANGED
@@ -40,9 +40,9 @@ class Helpers {
40
  * @since 1.2
41
  * @return string
42
  */
43
- public static function defaultPagesLink()
44
  {
45
- $link = esc_url( admin_url('edit.php?post_type=page') );
46
  return $link;
47
  }
48
 
40
  * @since 1.2
41
  * @return string
42
  */
43
+ public static function defaultPagesLink($type = 'page')
44
  {
45
+ $link = esc_url( admin_url('edit.php?post_type=' . $type ) );
46
  return $link;
47
  }
48
 
app/NestedPages.php CHANGED
@@ -12,7 +12,7 @@ class NestedPages {
12
  $np_env = 'live';
13
 
14
  global $np_version;
15
- $np_version = '1.2.1';
16
 
17
  $app = new NestedPages\Bootstrap;
18
  }
12
  $np_env = 'live';
13
 
14
  global $np_version;
15
+ $np_version = '1.3.0';
16
 
17
  $app = new NestedPages\Bootstrap;
18
  }
app/Redirects.php CHANGED
@@ -9,8 +9,6 @@ class Redirects {
9
  {
10
  add_action('load-edit.php', array($this, 'pageTrashed'));
11
  add_action('load-edit.php', array($this, 'pageRestored'));
12
- add_action('load-edit.php', array($this, 'addNPLink'));
13
- add_filter( "views_edit-page", array($this, 'addNPLink' ));
14
  add_action('deleted_post', array($this, 'linkDeleted'), 10, 1);
15
  }
16
 
@@ -56,17 +54,6 @@ class Redirects {
56
  }
57
 
58
 
59
- /**
60
- * Add a nested pages link to the subsub list (WP_List_Table class)
61
- */
62
- public function addNPLink($views)
63
- {
64
- $screen = get_current_screen();
65
- if ( $screen->parent_file == 'edit.php?post_type=page' ){
66
- $link = array('Nested Pages' => '<a href="' . esc_url(admin_url('admin.php?page=nestedpages')) . '">' . __('Nested Pages', 'nestedpages') . '</a>');
67
- $views = array_merge($views, $link);
68
- }
69
- return $views;
70
- }
71
 
72
  }
9
  {
10
  add_action('load-edit.php', array($this, 'pageTrashed'));
11
  add_action('load-edit.php', array($this, 'pageRestored'));
 
 
12
  add_action('deleted_post', array($this, 'linkDeleted'), 10, 1);
13
  }
14
 
54
  }
55
 
56
 
57
+
 
 
 
 
 
 
 
 
 
 
 
58
 
59
  }
app/Views/forms/bulk-add.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Modal Form for adding posts in bulk
4
+ * Populated via JS function
5
+ */
6
+ ?>
7
+ <div class="np-modal fade nestedpages" id="np-bulk-modal">
8
+ <div class="modal-dialog">
9
+ <div class="modal-content">
10
+ <div class="modal-body new-child"></div>
11
+ </div><!-- /.modal-content -->
12
+ </div><!-- /.modal-dialog -->
13
+ </div><!-- /.modal -->
app/Views/{link-form.php → forms/link-form.php} RENAMED
File without changes
app/Views/{new-child.php → forms/new-child.php} RENAMED
@@ -2,9 +2,9 @@
2
  $post_type_object = get_post_type_object( 'page' );
3
  $can_publish = current_user_can( $post_type_object->cap->publish_posts );
4
  ?>
5
- <form method="get" action="">
6
  <div class="form-interior">
7
- <h3><strong><?php _e('Add Child Page'); ?></strong><span class="parent_name"></span></h3>
8
 
9
  <div class="np-quickedit-error" style="clear:both;display:none;"></div>
10
 
@@ -18,7 +18,7 @@
18
  <div class="form-control new-child-row">
19
  <label><?php _e( 'Title' ); ?></label>
20
  <div>
21
- <input type="text" name="post_title[]" class="np_title" placeholder="<?php _e('Page Title', 'nestedpages'); ?>" value="" />
22
  <a href="#" class="button-secondary np-remove-child">-</a>
23
  </div>
24
  </div>
@@ -66,6 +66,16 @@
66
  endif;
67
  ?>
68
 
 
 
 
 
 
 
 
 
 
 
69
  </div><!-- .right -->
70
 
71
  </div><!-- .fields -->
@@ -75,11 +85,15 @@
75
 
76
  <div class="buttons">
77
  <input type="hidden" name="parent_id" class="page_parent_id" />
 
78
  <a accesskey="c" href="#" class="button-secondary alignleft np-cancel-newchild">
79
  <?php _e( 'Cancel' ); ?>
80
  </a>
81
- <a accesskey="s" href="#" class="button-primary np-save-newchild alignright">
82
- <?php _e( 'Add Page' ); ?>
 
 
 
83
  </a>
84
  <span class="np-qe-loading"></span>
85
  </div>
2
  $post_type_object = get_post_type_object( 'page' );
3
  $can_publish = current_user_can( $post_type_object->cap->publish_posts );
4
  ?>
5
+ <form method="get" action="" class="np-new-child-form">
6
  <div class="form-interior">
7
+ <h3><strong><?php _e('Add Child', 'nestedpages'); ?></strong><span class="parent_name"></span></h3>
8
 
9
  <div class="np-quickedit-error" style="clear:both;display:none;"></div>
10
 
18
  <div class="form-control new-child-row">
19
  <label><?php _e( 'Title' ); ?></label>
20
  <div>
21
+ <input type="text" name="post_title[]" class="np_title" placeholder="<?php _e('Title', 'nestedpages'); ?>" value="" />
22
  <a href="#" class="button-secondary np-remove-child">-</a>
23
  </div>
24
  </div>
66
  endif;
67
  ?>
68
 
69
+ <?php if ( $this->post_type->hierarchical ) : ?>
70
+ <div class="form-control">
71
+ <label><?php _e( 'Template' ); ?></label>
72
+ <select name="page_template" class="np_template">
73
+ <option value="default"><?php _e( 'Default Template' ); ?></option>
74
+ <?php page_template_dropdown() ?>
75
+ </select>
76
+ </div>
77
+ <?php endif; ?>
78
+
79
  </div><!-- .right -->
80
 
81
  </div><!-- .fields -->
85
 
86
  <div class="buttons">
87
  <input type="hidden" name="parent_id" class="page_parent_id" />
88
+ <input type="hidden" name="post_type" value="<?php echo $this->post_type->name; ?>" />
89
  <a accesskey="c" href="#" class="button-secondary alignleft np-cancel-newchild">
90
  <?php _e( 'Cancel' ); ?>
91
  </a>
92
+ <a accesskey="s" href="#" class="button-primary np-save-newchild alignright" style="margin-left:10px;">
93
+ <?php _e( 'Add', 'nestedpages' ); ?>
94
+ </a>
95
+ <a href="#" class="button-secondary np-save-newchild add-edit alignright">
96
+ <?php _e( 'Add & Edit', 'nestedpages' ); ?>
97
  </a>
98
  <span class="np-qe-loading"></span>
99
  </div>
app/Views/{quickedit-redirect.php → forms/quickedit-link.php} RENAMED
File without changes
app/Views/{quickedit.php → forms/quickedit-post.php} RENAMED
@@ -69,6 +69,8 @@
69
  </div><!-- .left -->
70
 
71
  <div class="right">
 
 
72
  <div class="form-control">
73
  <label><?php _e( 'Template' ); ?></label>
74
  <select name="page_template" class="np_template">
@@ -76,6 +78,7 @@
76
  <?php page_template_dropdown() ?>
77
  </select>
78
  </div>
 
79
 
80
  <?php if ( $can_publish ) : ?>
81
  <div class="form-control password">
@@ -108,14 +111,16 @@
108
  <?php endif; // Edit theme options?>
109
 
110
 
111
- <?php if ( $this->user->canSortPages() ) : ?>
112
  <div class="form-control np-toggle-options">
 
113
  <a href="#" class="np-btn np-btn-half np-toggle-menuoptions"><?php _e('Menu Options', 'nestedpages'); ?></a>
 
 
114
  <?php if ( !empty($this->h_taxonomies) ) : ?>
115
  <a href="#" class="np-btn np-btn-half btn-right np-toggle-taxonomies"><?php _e('Taxonomies', 'nestedpages'); ?></a>
116
  <?php endif; ?>
117
  </div>
118
- <?php endif; ?>
119
 
120
  </div><!-- .right -->
121
 
69
  </div><!-- .left -->
70
 
71
  <div class="right">
72
+
73
+ <?php if ( $this->post_type->hierarchical ) : ?>
74
  <div class="form-control">
75
  <label><?php _e( 'Template' ); ?></label>
76
  <select name="page_template" class="np_template">
78
  <?php page_template_dropdown() ?>
79
  </select>
80
  </div>
81
+ <?php endif; ?>
82
 
83
  <?php if ( $can_publish ) : ?>
84
  <div class="form-control password">
111
  <?php endif; // Edit theme options?>
112
 
113
 
114
+
115
  <div class="form-control np-toggle-options">
116
+ <?php if ( $this->user->canSortPages() && $this->post_type->name == 'page' ) : ?>
117
  <a href="#" class="np-btn np-btn-half np-toggle-menuoptions"><?php _e('Menu Options', 'nestedpages'); ?></a>
118
+ <?php endif; ?>
119
+
120
  <?php if ( !empty($this->h_taxonomies) ) : ?>
121
  <a href="#" class="np-btn np-btn-half btn-right np-toggle-taxonomies"><?php _e('Taxonomies', 'nestedpages'); ?></a>
122
  <?php endif; ?>
123
  </div>
 
124
 
125
  </div><!-- .right -->
126
 
app/Views/{pages.php → listing.php} RENAMED
@@ -2,25 +2,36 @@
2
 
3
  <h2>
4
  <?php _e($this->post_type->labels->name); ?>
5
- <a href="<?php echo $this->addNewPageLink(); ?>" class="add-new-h2">
6
- <?php _e($this->post_type->labels->add_new_item); ?>
 
7
  </a>
 
8
  <?php if ( current_user_can('publish_pages') ) : ?>
 
 
 
 
 
 
9
  <a href="#" class="add-new-h2 open-redirect-modal" title="<?php _e('Add Link', 'nestedpages'); ?>" data-parentid="0">
10
  <?php _e('Add Link', 'nestedpages'); ?>
11
  </a>
12
  <?php endif; ?>
 
13
  </h2>
14
 
15
  <?php if ( $this->confirmation->getMessage() ) : ?>
16
  <div id="message" class="updated below-h2"><p><?php echo $this->confirmation->getMessage(); ?></p></div>
17
  <?php endif; ?>
18
 
 
19
  <ul class="nestedpages-toggleall" <?php if ( $this->confirmation->getMessage() ) echo 'style="margin-top:0"';?>>
20
- <li><a href="#" class="np-btn" data-toggle="closed"><?php _e('Expand Pages', 'nestedpages'); ?></a></li>
21
  </ul>
 
22
 
23
- <?php if ( current_user_can('edit_theme_options') ) : ?>
24
  <div class="np-sync-menu-cont" <?php if ( $this->confirmation->getMessage() ) echo 'style="margin-top:2px;"';?>>
25
  <label>
26
  <input type="checkbox" name="np_sync_menu" class="np-sync-menu" value="sync" <?php if ( get_option('nestedpages_menusync') == 'sync' ) echo 'checked'; ?>/> <?php _e('Sync Menu', 'nestedpages'); ?>
@@ -30,45 +41,30 @@
30
 
31
  <img src="<?php echo plugins_url(); ?>/wp-nested-pages/assets/images/loading.gif" alt="loading" id="nested-loading" />
32
 
33
- <div class="nestedpages-tools">
34
-
35
- <ul class="subsubsub">
36
- <li><a href="#all" class="np-toggle-publish active"><?php _e('All'); ?></a> | </li>
37
- <li><a href="#published" class="np-toggle-publish"><?php _e('Published'); ?></a> | </li>
38
- <li><a href="#show" class="np-toggle-hidden"><?php _e('Show Hidden', 'nestedpages'); ?> </a>
39
- <span class="count">(<?php echo $this->post_repo->getHiddenCount(); ?>)</span> | </li>
40
- <?php if ( current_user_can('delete_pages') ) : ?>
41
- <li><a href="edit.php?post_status=trash&post_type=page"><?php _e('Trash'); ?> </a>
42
- <span class="count">(<?php echo $this->post_repo->trashedPagesCount(); ?>)</span></li>
43
- <?php endif; ?>
44
- <?php if ( get_option('nestedpages_hidedefault') !== 'hide' ) : ?>
45
- <li> | <a href="<?php echo NestedPages\Helpers::defaultPagesLink(); ?>"><?php _e('Default'); ?> <?php _e($this->post_type->labels->name); ?></a></li>
46
- <?php endif; ?>
47
- </ul>
48
-
49
- </div><!-- .nestedpages-tools -->
50
 
51
  <div id="np-error" class="updated error" style="clear:both;display:none;"></div>
52
 
53
 
54
  <div class="nestedpages">
55
- <?php $this->loopPages(); ?>
56
 
57
  <div class="quick-edit quick-edit-form np-inline-modal" style="display:none;">
58
- <?php include( NestedPages\Helpers::view('quickedit') ); ?>
59
  </div>
60
 
61
  <?php if ( current_user_can('publish_pages') ) : ?>
62
  <div class="quick-edit quick-edit-form-redirect np-inline-modal" style="display:none;">
63
- <?php include( NestedPages\Helpers::view('quickedit-redirect') ); ?>
64
  </div>
65
 
66
  <div class="new-child new-child-form np-inline-modal" style="display:none;">
67
- <?php include( NestedPages\Helpers::view('new-child') ); ?>
68
  </div>
69
  <?php endif; ?>
70
  </div>
71
 
72
  </div><!-- .wrap -->
73
 
74
- <?php include( NestedPages\Helpers::view('link-form') ); ?>
 
2
 
3
  <h2>
4
  <?php _e($this->post_type->labels->name); ?>
5
+
6
+ <a href="<?php echo $this->post_type_repo->addNewPostLink($this->post_type->name); ?>" class="add-new-h2">
7
+ <?php _e($this->post_type->labels->add_new); ?>
8
  </a>
9
+
10
  <?php if ( current_user_can('publish_pages') ) : ?>
11
+ <a href="#" class="add-new-h2 open-bulk-modal" title="<?php _e('Add Multiple', 'nestedpages'); ?>" data-parentid="0">
12
+ <?php _e('Add Multiple', 'nestedpages'); ?>
13
+ </a>
14
+ <?php endif; ?>
15
+
16
+ <?php if ( current_user_can('publish_pages') && $this->post_type->name == 'page' ) : ?>
17
  <a href="#" class="add-new-h2 open-redirect-modal" title="<?php _e('Add Link', 'nestedpages'); ?>" data-parentid="0">
18
  <?php _e('Add Link', 'nestedpages'); ?>
19
  </a>
20
  <?php endif; ?>
21
+
22
  </h2>
23
 
24
  <?php if ( $this->confirmation->getMessage() ) : ?>
25
  <div id="message" class="updated below-h2"><p><?php echo $this->confirmation->getMessage(); ?></p></div>
26
  <?php endif; ?>
27
 
28
+ <?php if ( $this->post_type->hierarchical ) : ?>
29
  <ul class="nestedpages-toggleall" <?php if ( $this->confirmation->getMessage() ) echo 'style="margin-top:0"';?>>
30
+ <li><a href="#" class="np-btn" data-toggle="closed"><?php _e('Expand All', 'nestedpages'); ?></a></li>
31
  </ul>
32
+ <?php endif; ?>
33
 
34
+ <?php if ( current_user_can('edit_theme_options') && $this->post_type->name == 'page' ) : ?>
35
  <div class="np-sync-menu-cont" <?php if ( $this->confirmation->getMessage() ) echo 'style="margin-top:2px;"';?>>
36
  <label>
37
  <input type="checkbox" name="np_sync_menu" class="np-sync-menu" value="sync" <?php if ( get_option('nestedpages_menusync') == 'sync' ) echo 'checked'; ?>/> <?php _e('Sync Menu', 'nestedpages'); ?>
41
 
42
  <img src="<?php echo plugins_url(); ?>/wp-nested-pages/assets/images/loading.gif" alt="loading" id="nested-loading" />
43
 
44
+ <?php include(NestedPages\Helpers::view('partials/tool-list')); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
 
46
  <div id="np-error" class="updated error" style="clear:both;display:none;"></div>
47
 
48
 
49
  <div class="nestedpages">
50
+ <?php $this->loopPosts(); ?>
51
 
52
  <div class="quick-edit quick-edit-form np-inline-modal" style="display:none;">
53
+ <?php include( NestedPages\Helpers::view('forms/quickedit-post') ); ?>
54
  </div>
55
 
56
  <?php if ( current_user_can('publish_pages') ) : ?>
57
  <div class="quick-edit quick-edit-form-redirect np-inline-modal" style="display:none;">
58
+ <?php include( NestedPages\Helpers::view('forms/quickedit-link') ); ?>
59
  </div>
60
 
61
  <div class="new-child new-child-form np-inline-modal" style="display:none;">
62
+ <?php include( NestedPages\Helpers::view('forms/new-child') ); ?>
63
  </div>
64
  <?php endif; ?>
65
  </div>
66
 
67
  </div><!-- .wrap -->
68
 
69
+ <?php include( NestedPages\Helpers::view('forms/link-form') ); ?>
70
+ <?php include( NestedPages\Helpers::view('forms/bulk-add') ); ?>
app/Views/partials/row-link.php ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Redirect Page
4
+ */
5
+ ?>
6
+ <div class="row">
7
+ <div class="child-toggle"></div>
8
+ <div class="row-inner">
9
+ <i class="np-icon-sub-menu"></i>
10
+ <?php if ( current_user_can('edit_theme_options') ) : ?>
11
+ <i class="handle np-icon-menu"></i>
12
+ <?php endif; ?>
13
+ <a href="<?php echo NestedPages\Helpers::check_url($this->post->content); ?>" class="page-link page-title" target="_blank">
14
+ <span class="title"><?php echo $this->post->title ?> <i class="np-icon-link"></i></span>
15
+ <?php
16
+
17
+ // Post Status
18
+ if ( $this->post->status !== 'publish' ){
19
+ echo '<span class="status">(' . __(ucfirst($this->post->status)) . ')</span>';
20
+ } else {
21
+ echo '<span class="status"></span>';
22
+ }
23
+
24
+ // Nested Pages Status
25
+ if ( $this->post->np_status == 'hide' )
26
+ echo '<i class="np-icon-eye-blocked"></i>';
27
+
28
+ // Nav Status
29
+ if ( $this->post->nav_status == 'hide' ){
30
+ echo '<span class="nav-status">(' . __('Hidden', 'nestedpages') . ')</span>';
31
+ } else {
32
+ echo '<span class="nav-status"></span>';
33
+ }
34
+ ?>
35
+ </a>
36
+
37
+ <a href="#" class="np-toggle-edit"><i class="np-icon-pencil"></i></a>
38
+
39
+ <div class="action-buttons">
40
+
41
+ <a href="#"
42
+ class="np-btn np-quick-edit-redirect"
43
+ data-id="<?php echo $this->post->id; ?>"
44
+ data-parentid="<?php echo $this->post->parent_id; ?>"
45
+ data-title="<?php echo $this->post->title; ?>"
46
+ data-url="<?php echo NestedPages\Helpers::check_url($this->post->content); ?>"
47
+ data-status="<?php echo $this->post->status; ?>"
48
+ data-np-status="<?php echo $this->post->np_status; ?>"
49
+ data-navstatus="<?php echo $this->post->nav_status; ?>"
50
+ data-navtitleattr="<?php echo $this->post->nav_title_attr; ?>"
51
+ data-navcss="<?php echo $this->post->nav_css; ?>"
52
+ data-linktarget="<?php echo $this->post->link_target; ?>">
53
+ <?php _e('Quick Edit'); ?>
54
+ </a>
55
+
56
+ <?php if ( current_user_can('delete_pages') ) : ?>
57
+ <a href="<?php echo get_delete_post_link($this->post->id, '', true); ?>" class="np-btn np-btn-trash">
58
+ <i class="np-icon-remove"></i>
59
+ </a>
60
+ <?php endif; ?>
61
+
62
+ </div><!-- .action-buttons -->
63
+ </div><!-- .row-inner -->
64
+ </div><!-- .row -->
app/Views/{row.php → partials/row.php} RENAMED
@@ -3,40 +3,46 @@
3
  * Row represents a single page
4
  */
5
  ?>
6
- <div class="row">
 
 
7
  <div class="child-toggle"></div>
 
 
8
  <div class="row-inner">
9
  <i class="np-icon-sub-menu"></i>
 
10
  <?php if ( $this->user->canSortPages() ) : ?>
11
  <i class="handle np-icon-menu"></i>
12
  <?php endif; ?>
 
13
  <a href="<?php echo get_edit_post_link(); ?>" class="page-link page-title">
14
- <span class="title"><?php the_title(); ?></span>
15
  <?php
16
 
17
  if ( function_exists('wpseo_translate_score') ){
18
- echo '<span class="np-seo-indicator ' . $this->post_data['score'] . '"></span>';
19
  }
20
 
21
  // Post Status
22
  echo '<span class="status">';
23
- if ( $post->post_status !== 'publish' ) echo '(' . __(ucfirst($post->post_status)) . ')';
24
- if ( post_password_required($post->ID) ) echo ' <i class="np-icon-lock"></i>';
25
  echo '</span>';
26
 
27
  // Nested Pages Status
28
- if ( $this->post_data['np_status'] == 'hide' )
29
  echo '<i class="np-icon-eye-blocked"></i>';
30
 
31
  // Nav Status
32
- if ( $this->post_data['nav_status'] == 'hide' ){
33
  echo '<span class="nav-status">' . __('Hidden', 'nestedpages') . '</span>';
34
  } else {
35
  echo '<span class="nav-status"></span>';
36
  }
37
 
38
  // Post Lock
39
- if ( $user = wp_check_post_lock(get_the_id()) ){
40
  $u = get_userdata($user);
41
  echo '<span class="locked"><i class="np-icon-lock"></i><em> ' . $u->display_name . ' ' . __('currently editing', 'nestedpages') . '</em></span>';
42
  } else {
@@ -45,12 +51,24 @@
45
  ?>
46
  </a>
47
 
 
48
  <!-- Responsive Toggle Button -->
49
  <a href="#" class="np-toggle-edit"><i class="np-icon-pencil"></i></a>
50
 
 
 
 
 
 
 
 
 
 
 
 
51
  <div class="action-buttons">
52
 
53
- <?php if ( $post->comment_status == 'open' ) : $comments = wp_count_comments(get_the_id()); $cs = 'open' ?>
54
 
55
 
56
  <a href="<?php echo admin_url( 'edit-comments.php?p=' . get_the_id() ); ?>" class="np-btn">
@@ -60,38 +78,38 @@
60
  <?php else : $cs = 'closed'; endif; ?>
61
 
62
 
63
- <?php if ( current_user_can('publish_pages') ) : ?>
64
 
65
- <a href="#" class="np-btn open-redirect-modal" data-parentid="<?php echo get_the_id(); ?>"><i class="np-icon-link"></i></a>
66
 
67
- <a href="#" class="np-btn add-new-child" data-id="<?php echo get_the_id(); ?>" data-parentname="<?php the_title(); ?>"><?php _e('Add Child', 'nestedpages'); ?></a>
68
 
69
  <?php endif; ?>
70
 
71
- <?php if ( !$user = wp_check_post_lock(get_the_id()) ) : ?>
72
  <a href="#"
73
  class="np-btn np-quick-edit"
74
- data-id="<?php echo get_the_id(); ?>"
75
- data-template="<?php echo $this->post_data['template']; ?>"
76
- data-title="<?php the_title(); ?>"
77
  data-slug="<?php echo $post->post_name; ?>"
78
  data-commentstatus="<?php echo $cs; ?>"
79
- data-status="<?php echo get_post_status(); ?>"
80
- data-np-status="<?php echo $this->post_data['np_status']; ?>"
81
- data-navstatus="<?php echo $this->post_data['nav_status']; ?>"
82
- data-navtitleattr="<?php echo $this->post_data['nav_title_attr']; ?>"
83
- data-navcss="<?php echo $this->post_data['nav_css']; ?>"
84
- data-linktarget="<?php echo $this->post_data['link_target']; ?>"
85
- data-navtitle="<?php echo $this->post_data['nav_title']; ?>"
86
  data-author="<?php echo $post->post_author; ?>"
87
  <?php if ( current_user_can('publish_pages') ) : ?>
88
  data-password="<?php echo $post->post_password; ?>"
89
  <?php endif; ?>
90
- data-month="<?php echo $this->post_data['month']; ?>"
91
- data-day="<?php echo $this->post_data['d']; ?>"
92
- data-year="<?php echo $this->post_data['y']; ?>"
93
- data-hour="<?php echo $this->post_data['h']; ?>"
94
- data-minute="<?php echo $this->post_data['m']; ?>">
95
  <?php _e('Quick Edit'); ?>
96
  </a>
97
  <?php endif; ?>
3
  * Row represents a single page
4
  */
5
  ?>
6
+ <div class="row<?php if ( !$this->post_type->hierarchical ) echo ' non-hierarchical'; ?>">
7
+
8
+ <?php if ( $this->post_type->hierarchical ) : ?>
9
  <div class="child-toggle"></div>
10
+ <?php endif; ?>
11
+
12
  <div class="row-inner">
13
  <i class="np-icon-sub-menu"></i>
14
+
15
  <?php if ( $this->user->canSortPages() ) : ?>
16
  <i class="handle np-icon-menu"></i>
17
  <?php endif; ?>
18
+
19
  <a href="<?php echo get_edit_post_link(); ?>" class="page-link page-title">
20
+ <span class="title"><?php echo $this->post->title; ?></span>
21
  <?php
22
 
23
  if ( function_exists('wpseo_translate_score') ){
24
+ echo '<span class="np-seo-indicator ' . $this->post->score . '"></span>';
25
  }
26
 
27
  // Post Status
28
  echo '<span class="status">';
29
+ if ( $this->post->status !== 'publish' ) echo '(' . __(ucfirst($this->post->status)) . ')';
30
+ if ( post_password_required($this->post->id) ) echo ' <i class="np-icon-lock"></i>';
31
  echo '</span>';
32
 
33
  // Nested Pages Status
34
+ if ( $this->post->np_status == 'hide' )
35
  echo '<i class="np-icon-eye-blocked"></i>';
36
 
37
  // Nav Status
38
+ if ( $this->post->nav_status == 'hide' ){
39
  echo '<span class="nav-status">' . __('Hidden', 'nestedpages') . '</span>';
40
  } else {
41
  echo '<span class="nav-status"></span>';
42
  }
43
 
44
  // Post Lock
45
+ if ( $user = wp_check_post_lock($this->post->id) ){
46
  $u = get_userdata($user);
47
  echo '<span class="locked"><i class="np-icon-lock"></i><em> ' . $u->display_name . ' ' . __('currently editing', 'nestedpages') . '</em></span>';
48
  } else {
51
  ?>
52
  </a>
53
 
54
+
55
  <!-- Responsive Toggle Button -->
56
  <a href="#" class="np-toggle-edit"><i class="np-icon-pencil"></i></a>
57
 
58
+
59
+ <?php if ( !$this->post->hierarchical ) : echo $this->post->hierarchical; ?>
60
+ <div class="np-post-columns">
61
+ <ul class="np-post-info">
62
+ <li><?php echo $this->post->author; ?></li>
63
+ <li><?php echo get_the_date(); ?></li>
64
+ </ul>
65
+ </div>
66
+ <?php endif; ?>
67
+
68
+
69
  <div class="action-buttons">
70
 
71
+ <?php if ( $this->post->comment_status == 'open' ) : $comments = wp_count_comments($this->post->id); $cs = 'open' ?>
72
 
73
 
74
  <a href="<?php echo admin_url( 'edit-comments.php?p=' . get_the_id() ); ?>" class="np-btn">
78
  <?php else : $cs = 'closed'; endif; ?>
79
 
80
 
81
+ <?php if ( current_user_can('publish_pages') && $this->post_type->hierarchical ) : ?>
82
 
83
+ <a href="#" class="np-btn open-redirect-modal" data-parentid="<?php echo $this->post->id; ?>"><i class="np-icon-link"></i></a>
84
 
85
+ <a href="#" class="np-btn add-new-child" data-id="<?php echo get_the_id(); ?>" data-parentname="<?php echo $this->post->title; ?>"><?php _e('Add Child', 'nestedpages'); ?></a>
86
 
87
  <?php endif; ?>
88
 
89
+ <?php if ( !$user = wp_check_post_lock($this->post->id) ) : ?>
90
  <a href="#"
91
  class="np-btn np-quick-edit"
92
+ data-id="<?php echo $this->post->id; ?>"
93
+ data-template="<?php echo $this->post->template; ?>"
94
+ data-title="<?php echo $this->post->title; ?>"
95
  data-slug="<?php echo $post->post_name; ?>"
96
  data-commentstatus="<?php echo $cs; ?>"
97
+ data-status="<?php echo $this->post->status; ?>"
98
+ data-np-status="<?php echo $this->post->np_status; ?>"
99
+ data-navstatus="<?php echo $this->post->nav_status; ?>"
100
+ data-navtitleattr="<?php echo $this->post->nav_title_attr; ?>"
101
+ data-navcss="<?php echo $this->post->nav_css; ?>"
102
+ data-linktarget="<?php echo $this->post->link_target; ?>"
103
+ data-navtitle="<?php echo $this->post->nav_title; ?>"
104
  data-author="<?php echo $post->post_author; ?>"
105
  <?php if ( current_user_can('publish_pages') ) : ?>
106
  data-password="<?php echo $post->post_password; ?>"
107
  <?php endif; ?>
108
+ data-month="<?php echo $this->post->date->month; ?>"
109
+ data-day="<?php echo $this->post->date->d; ?>"
110
+ data-year="<?php echo $this->post->date->y; ?>"
111
+ data-hour="<?php echo $this->post->date->h; ?>"
112
+ data-minute="<?php echo $this->post->date->m; ?>">
113
  <?php _e('Quick Edit'); ?>
114
  </a>
115
  <?php endif; ?>
app/Views/partials/tool-list.php ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php $trashedCount = $this->post_repo->trashedCount($this->post_type->name); ?>
2
+ <div class="nestedpages-tools">
3
+
4
+ <ul class="subsubsub">
5
+ <li>
6
+ <a href="#all" class="np-toggle-publish active"><?php _e('All'); ?></a> |
7
+ </li>
8
+
9
+ <li>
10
+ <a href="#published" class="np-toggle-publish"><?php _e('Published'); ?></a> |
11
+ </li>
12
+
13
+ <li>
14
+ <a href="#show" class="np-toggle-hidden"><?php _e('Show Hidden', 'nestedpages'); ?> </a>
15
+ <span class="count">(<?php echo $this->post_repo->getHiddenCount(array($this->post_type->name)); ?>)</span> |
16
+ </li>
17
+
18
+ <?php if ( current_user_can('delete_pages') && $trashedCount > 0) : ?>
19
+ <li class="np-trash-links">
20
+ <a href="<?php echo $this->post_type_repo->trashLink($this->post_type->name); ?>"><?php _e('Trash'); ?> </a>
21
+ <span class="count">(<a href="#" class="np-empty-trash" data-posttype="<?php echo $this->post_type->name; ?>"><?php _e('Empty', 'nestedpages'); ?></a> <?php echo $trashedCount; ?>)</span>
22
+ |
23
+ </li>
24
+ <?php endif; ?>
25
+
26
+ <?php if ( !$this->post_type_repo->hideDefault($this->post_type->name) ) : ?>
27
+ <li>
28
+ <a href="<?php echo NestedPages\Helpers::defaultPagesLink($this->post_type->name); ?>">
29
+ <?php _e('Default'); ?> <?php _e($this->post_type->labels->name); ?>
30
+ </a>
31
+ </li>
32
+ <?php endif; ?>
33
+ </ul>
34
+
35
+
36
+ <?php if ( !$this->post_type->hierarchical ) : ?>
37
+ <div class="np-tools-primary">
38
+ <form action="<?php echo admin_url('admin-post.php'); ?>" method="post" class="np-tools-sort">
39
+ <input type="hidden" name="action" value="npListingSort">
40
+ <input type="hidden" name="page" value="<?php echo $this->pageURL(); ?>">
41
+ <div class="select first">
42
+ <select id="np_sortauthor" name="np_author" class="nestedpages-sort">
43
+ <?php
44
+ $out = '<option value="all">' . __('All Authors', 'nestedpages') . '</option>';
45
+ $users = $this->user->allUsers();
46
+ foreach( $users as $user ){
47
+ $out .= '<option value="' . $user->ID . '"';
48
+ if ( isset($_GET['author']) && ($_GET['author'] == $user->ID) ) $out .= ' selected';
49
+ $out .= '>' . $user->display_name . '</option>';
50
+ }
51
+ echo $out;
52
+ ?>
53
+ </select>
54
+ </div>
55
+ <div class="select">
56
+ <select id="np_orderby" name="np_orderby" class="nestedpages-sort">
57
+ <?php
58
+ $options = array(
59
+ 'menu_order' => __('Menu Order', 'nestedpages'),
60
+ 'date' => __('Date', 'nestedpages'),
61
+ 'title' => __('Title', 'nestedpages')
62
+ );
63
+ $out = '<option value="">' . __('Order By', 'nestedpages') . '</option>';
64
+ foreach ( $options as $key => $option ){
65
+ $out .= '<option value="' . $key . '"';
66
+ if ( isset($_GET['orderby']) && ($_GET['orderby'] == $key) ) $out .= ' selected';
67
+ $out .= '>' . $option . '</option>';
68
+ }
69
+ echo $out;
70
+ ?>
71
+ </select>
72
+ </div>
73
+ <div class="select">
74
+ <select id="np_order" name="np_order" class="nestedpages-sort">
75
+ <?php
76
+ $options = array(
77
+ 'ASC' => __('Ascending', 'nestedpages'),
78
+ 'DESC' => __('Decending', 'nestedpages')
79
+ );
80
+ $out = '';
81
+ foreach ( $options as $key => $option ){
82
+ $out .= '<option value="' . $key . '"';
83
+ if ( isset($_GET['order']) && ($_GET['order'] == $key) ) $out .= ' selected';
84
+ $out .= '>' . $option . '</option>';
85
+ }
86
+ echo $out;
87
+ ?>
88
+ </select>
89
+ </div>
90
+ <div class="select">
91
+ <input type="submit" id="nestedpages-sort" class="button" value="Apply">
92
+ </div>
93
+ </form>
94
+ <div class="np-tools-search">
95
+ <input type="search" id="nestedpages-search" placeholder="<?php echo $this->post_type->labels->search_items; ?>">
96
+ </div><!-- .np-tools-search -->
97
+ </div>
98
+ <?php endif; ?>
99
+
100
+ </div><!-- .nestedpages-tools -->
app/Views/row-redirect.php DELETED
@@ -1,64 +0,0 @@
1
- <?php
2
- /**
3
- * Redirect Page
4
- */
5
- ?>
6
- <div class="row">
7
- <div class="child-toggle"></div>
8
- <div class="row-inner">
9
- <i class="np-icon-sub-menu"></i>
10
- <?php if ( current_user_can('edit_theme_options') ) : ?>
11
- <i class="handle np-icon-menu"></i>
12
- <?php endif; ?>
13
- <a href="<?php echo NestedPages\Helpers::check_url(get_the_content()); ?>" class="page-link page-title" target="_blank">
14
- <span class="title"><?php the_title(); ?> <i class="np-icon-link"></i></span>
15
- <?php
16
-
17
- // Post Status
18
- if ( $post->post_status !== 'publish' ){
19
- echo '<span class="status">(' . __(ucfirst($post->post_status)) . ')</span>';
20
- } else {
21
- echo '<span class="status"></span>';
22
- }
23
-
24
- // Nested Pages Status
25
- if ( $this->post_data['np_status'] == 'hide' )
26
- echo '<i class="np-icon-eye-blocked"></i>';
27
-
28
- // Nav Status
29
- if ( $this->post_data['nav_status'] == 'hide' ){
30
- echo '<span class="nav-status">(' . __('Hidden', 'nestedpages') . ')</span>';
31
- } else {
32
- echo '<span class="nav-status"></span>';
33
- }
34
- ?>
35
- </a>
36
-
37
- <a href="#" class="np-toggle-edit"><i class="np-icon-pencil"></i></a>
38
-
39
- <div class="action-buttons">
40
-
41
- <a href="#"
42
- class="np-btn np-quick-edit-redirect"
43
- data-id="<?php echo get_the_id(); ?>"
44
- data-parentid="<?php echo $this->post_data['parent_id']; ?>"
45
- data-title="<?php the_title(); ?>"
46
- data-url="<?php echo NestedPages\Helpers::check_url(get_the_content()); ?>"
47
- data-status="<?php echo get_post_status(); ?>"
48
- data-np-status="<?php echo $this->post_data['np_status']; ?>"
49
- data-navstatus="<?php echo $this->post_data['nav_status']; ?>"
50
- data-navtitleattr="<?php echo $this->post_data['nav_title_attr']; ?>"
51
- data-navcss="<?php echo $this->post_data['nav_css']; ?>"
52
- data-linktarget="<?php echo $this->post_data['link_target']; ?>">
53
- <?php _e('Quick Edit'); ?>
54
- </a>
55
-
56
- <?php if ( current_user_can('delete_pages') ) : ?>
57
- <a href="<?php echo get_delete_post_link(get_the_id(), '', true); ?>" class="np-btn np-btn-trash">
58
- <i class="np-icon-remove"></i>
59
- </a>
60
- <?php endif; ?>
61
-
62
- </div><!-- .action-buttons -->
63
- </div><!-- .row-inner -->
64
- </div><!-- .row -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/Views/settings-posttypes.php DELETED
@@ -1,5 +0,0 @@
1
- <?php
2
-
3
-
4
- //var_dump($this->getPostTypes());
5
- ?>
 
 
 
 
 
app/Views/{settings-general.php → settings/settings-general.php} RENAMED
@@ -1,10 +1,8 @@
1
  <?php
2
  $allowsorting = get_option('nestedpages_allowsorting', array());
3
  if ( $allowsorting == "" ) $allowsorting = array();
4
-
5
  settings_fields( 'nestedpages-general' );
6
  ?>
7
-
8
  <tr valign="top">
9
  <th scope="row"><?php _e('Nested Pages Version', 'nestedpages'); ?></th>
10
  <td><strong><?php echo get_option('nestedpages_version'); ?></strong></td>
@@ -16,15 +14,6 @@ settings_fields( 'nestedpages-general' );
16
  <p><em><?php _e('Important: Once the menu name has changed, theme files should be updated to reference the new name.', 'nestedpages'); ?></em></p>
17
  </td>
18
  </tr>
19
- <tr valign="top">
20
- <th scope="row"><?php _e('Hide Default Pages', 'nestedpages'); ?></th>
21
- <td>
22
- <label>
23
- <input type="checkbox" id="nestedpages_hidedefault" name="nestedpages_hidedefault" <?php if ( get_option('nestedpages_hidedefault') == 'hide') echo 'checked'; ?> value="hide" >
24
- <?php _e('Hide Default Pages', 'nestedpages'); ?>
25
- </label>
26
- </td>
27
- </tr>
28
  <tr valign="top">
29
  <th scope="row"><?php _e('Allow Page Sorting', 'nestedpages'); ?></th>
30
  <td>
@@ -36,6 +25,6 @@ settings_fields( 'nestedpages-general' );
36
  <br />
37
  <?php endforeach; ?>
38
  <input type="hidden" name="nestedpages_menusync" value="<?php echo get_option('nestedpages_menusync'); ?>">
39
- <p><em><?php _e('Admins always have sorting ability. Only roles with access to the pages screen will be able to view/edit the Nested Pages interface.', 'nestedpages'); ?></em></p>
40
  </td>
41
  </tr>
1
  <?php
2
  $allowsorting = get_option('nestedpages_allowsorting', array());
3
  if ( $allowsorting == "" ) $allowsorting = array();
 
4
  settings_fields( 'nestedpages-general' );
5
  ?>
 
6
  <tr valign="top">
7
  <th scope="row"><?php _e('Nested Pages Version', 'nestedpages'); ?></th>
8
  <td><strong><?php echo get_option('nestedpages_version'); ?></strong></td>
14
  <p><em><?php _e('Important: Once the menu name has changed, theme files should be updated to reference the new name.', 'nestedpages'); ?></em></p>
15
  </td>
16
  </tr>
 
 
 
 
 
 
 
 
 
17
  <tr valign="top">
18
  <th scope="row"><?php _e('Allow Page Sorting', 'nestedpages'); ?></th>
19
  <td>
25
  <br />
26
  <?php endforeach; ?>
27
  <input type="hidden" name="nestedpages_menusync" value="<?php echo get_option('nestedpages_menusync'); ?>">
28
+ <p><em><?php _e('Admins always have sorting ability.', 'nestedpages'); ?></em></p>
29
  </td>
30
  </tr>
app/Views/settings/settings-posttypes.php ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $types = $this->getPostTypes();
3
+ settings_fields( 'nestedpages-posttypes' );
4
+ ?>
5
+ <tr valign="top">
6
+ <td colspan="2" style="padding:0px;">
7
+ <h3 style="margin-bottom:10px;"><?php _e('Enable Nested Pages for:', 'nestedpages'); ?></h3>
8
+ </td>
9
+ </tr>
10
+ <tr valign="top">
11
+ <td colspan="2" style="padding:0;">
12
+ <table width="100%" class="nestedpages-settings-table">
13
+ <thead>
14
+ <th><?php _e('Post Type', 'nestedpages'); ?></th>
15
+ <th><?php _e('Hierarchical', 'nestedpages'); ?></th>
16
+ <th><?php _e('Enabled', 'nestedpages'); ?></th>
17
+ <th><?php _e('Replace Default Menu', 'nestedpages'); ?>*</th>
18
+ <th><?php _e('Hide Default Link', 'nestedpages'); ?>*</th>
19
+ </thead>
20
+ <?php foreach ($types as $type) : ?>
21
+ <tr>
22
+ <td><?php echo $type->label; ?></td>
23
+ <td>
24
+ <?php if ( $type->hierarchical ) : ?>
25
+ <i class="np-icon-yes"></i>
26
+ <?php endif; ?>
27
+ </td>
28
+ <td>
29
+ <input type="checkbox" name="nestedpages_posttypes[<?php echo $type->name; ?>]" value="<?php echo $type->name; ?>" <?php if ( $type->np_enabled ) echo 'checked'; ?> />
30
+ </td>
31
+ <td>
32
+ <input type="checkbox" name="nestedpages_posttypes[<?php echo $type->name; ?>][replace_menu]" value="true" <?php if ( $type->replace_menu ) echo 'checked'; ?> />
33
+ </td>
34
+ <td>
35
+ <input type="checkbox" name="nestedpages_posttypes[<?php echo $type->name; ?>][hide_default]" value="true" <?php if ( $type->hide_default ) echo 'checked'; ?> />
36
+ </td>
37
+ </tr>
38
+ <?php endforeach; ?>
39
+ </table>
40
+ </td>
41
+ </tr>
42
+ <tr valign="top">
43
+ <td colspan="2" style="padding:10px 0px;">
44
+ <p style="font-style:oblique;font-size:13px;">
45
+ <?php _e('Note: Nesting features not enabled for non-hierarchical post types.', 'nestedpages'); ?>
46
+ </p>
47
+ <p style="font-style:oblique;font-size:13px;">
48
+ *<?php _e('If default menu is not replaced, an additional submenu item will be added for "Nested/Sort View"', 'nestedpages'); ?>
49
+ </p>
50
+ </td>
51
+ </tr>
app/Views/{settings.php → settings/settings.php} RENAMED
@@ -2,17 +2,19 @@
2
  <h1><?php _e('Nested Pages Settings', 'nestedpages'); ?></h1>
3
 
4
  <h2 class="nav-tab-wrapper">
5
- <a class="nav-tab <?php if ( $tab == 'general' ) echo 'nav-tab-active'; ?>" href="options-general.php?page=nested-pages-settings"><?php _e('General', 'nestedpages'); ?></a>
 
 
6
  <?php if ( count($this->getPostTypes()) > 0 ) : ?>
7
- <?php /*
8
- <a class="nav-tab <?php if ( $tab == 'posttypes' ) echo 'nav-tab-active'; ?>" href="options-general.php?page=nested-pages-settings&tab=posttypes"><?php _e('Post Types', 'nestedpages'); ?></a>
9
- */ ?>
10
  <?php endif; ?>
11
  </h2>
12
 
13
  <form method="post" enctype="multipart/form-data" action="options.php">
14
  <table class="form-table">
15
- <?php include NestedPages\Helpers::view('settings-' . $tab); ?>
16
  </table>
17
  <?php submit_button(); ?>
18
  </form>
2
  <h1><?php _e('Nested Pages Settings', 'nestedpages'); ?></h1>
3
 
4
  <h2 class="nav-tab-wrapper">
5
+ <a class="nav-tab <?php if ( $tab == 'general' ) echo 'nav-tab-active'; ?>" href="options-general.php?page=nested-pages-settings">
6
+ <?php _e('General', 'nestedpages'); ?>
7
+ </a>
8
  <?php if ( count($this->getPostTypes()) > 0 ) : ?>
9
+ <a class="nav-tab <?php if ( $tab == 'posttypes' ) echo 'nav-tab-active'; ?>" href="options-general.php?page=nested-pages-settings&tab=posttypes">
10
+ <?php _e('Post Types', 'nestedpages'); ?>
11
+ </a>
12
  <?php endif; ?>
13
  </h2>
14
 
15
  <form method="post" enctype="multipart/form-data" action="options.php">
16
  <table class="form-table">
17
+ <?php include(NestedPages\Helpers::view('settings/settings-' . $tab)); ?>
18
  </table>
19
  <?php submit_button(); ?>
20
  </form>
assets/css/nestedpages.css CHANGED
@@ -1 +1 @@
1
- body{-webkit-animation-delay:0.1s;-webkit-animation-name:fontfix;-webkit-animation-duration:0.1s;-webkit-animation-iteration-count:1;-webkit-animation-timing-function:linear;}@-webkit-keyframes fontfix{from{opacity:1;}to{opacity:1;}}@font-face{font-family:'nestedpages';src:url('fonts/nestedpages.eot');}@font-face{font-family:'nestedpages';src:url(data:application/x-font-ttf;charset=utf-8;base64,AAEAAAALAIAAAwAwT1MvMggjB2gAAAC8AAAAYGNtYXDw7eamAAABHAAAAFRnYXNwAAAAEAAAAXAAAAAIZ2x5ZrIqLaoAAAF4AAARNGhlYWQCOg/3AAASrAAAADZoaGVhA+IB+QAAEuQAAAAkaG10eCkAA2cAABMIAAAAYGxvY2EhfhzgAAATaAAAADJtYXhwACAA8QAAE5wAAAAgbmFtZXH7qkgAABO8AAABaXBvc3QAAwAAAAAVKAAAACAAAwIAAZAABQAAAUwBZgAAAEcBTAFmAAAA9QAZAIQAAAAAAAAAAAAAAAAAAAABEAAAAAAAAAAAAAAAAAAAAABAAADwsgHg/+D/4AHgACAAAAABAAAAAAAAAAAAAAAgAAAAAAACAAAAAwAAABQAAwABAAAAFAAEAEAAAAAMAAgAAgAEAAEAIOYS8LL//f//AAAAAAAg5gDwsv/9//8AAf/jGgQPZQADAAEAAAAAAAAAAAAAAAAAAQAB//8ADwABAAAAAAAAAAAAAgAANzkBAAAAAAEAAAAAAAAAAAACAAA3OQEAAAAAAQAAAAAAAAAAAAIAADc5AQAAAAABADMARgHNAXoACQAANzM1Fwc1ITUzFWbngID+5jPGTWZnTee0AAAAAQBtAE0BkwF0AAsAACUHJwcnNyc3FzcXBwGOOFhdNF1YOFhdNF2BNF1YOFhdNV1XOFgAAAEAmgB8AZMBUwAGAAABFwcjJzcXAXAjiiJNIjwBUxi/ZyAwAAMATQBgAbMBYAAEAAkADgAAATUhFSEVNSEVIRU1IRUhAbP+mgFm/poBZv6aAWYBLTMzZzQ0ZjMzAAAAAAEAswB6AYABEwADAAABByczAYBnZs0BE5mZAAABAM0AegFmAUYAAwAAExcHNc2ZmQFGZ2XMAAAAAwAgACAB4AGAAAMABwALAAATIRUhFSEVIRUhFSEgAcD+QAHA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gAgAB4AAAAAgAAgAAAAAAAAABAAAB4P/gAAACAAAAAAACAAABAAAAAAAAAAAAAAAAAAAAGAAAAAAAAAAAAAAAAAEAAAACAAAzAgAAbQIAAJoCAABNAgAAswIAAM0CAAAgAgAAAAIAAAACAAAAAgAAQAIAAAACAAAAAgAAAAIAAAACAAAAAgAAAAIAAAACAAAAAgAAAAAAAAAACgAUAB4AMgBMAF4AfACKAJgAsgD6ATgBsAI+Au4DxARIBKAF/Ab6B4AILAiaAAAAAQAAABgA7wAHAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAA4ArgABAAAAAAABABYAAAABAAAAAAACAA4AYwABAAAAAAADABYALAABAAAAAAAEABYAcQABAAAAAAAFABYAFgABAAAAAAAGAAsAQgABAAAAAAAKADQAhwADAAEECQABABYAAAADAAEECQACAA4AYwADAAEECQADABYALAADAAEECQAEABYAcQADAAEECQAFABYAFgADAAEECQAGABYATQADAAEECQAKADQAhwBuAGUAcwB0AGUAZABwAGEAZwBlAHMAVgBlAHIAcwBpAG8AbgAgADEALgAwAG4AZQBzAHQAZQBkAHAAYQBnAGUAc25lc3RlZHBhZ2VzAG4AZQBzAHQAZQBkAHAAYQBnAGUAcwBSAGUAZwB1AGwAYQByAG4AZQBzAHQAZQBkAHAAYQBnAGUAcwBGAG8AbgB0ACAAZwBlAG4AZQByAGEAdABlAGQAIABiAHkAIABJAGMAbwBNAG8AbwBuAC4AAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==) format('woff');font-weight:normal;font-style:normal;}[class^="np-icon-"],[class*=" np-icon-"]{font-family:'nestedpages';speak:none;font-style:normal;font-weight:normal;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;}.np-icon-no:before{content:"\e601";}.np-icon-yes:before{content:"\e602";}.np-icon-menu:before{content:"\e603";}.np-icon-arrow-down:before{content:"\e604";}.np-icon-arrow-right:before{content:"\e605";}.np-icon-sub-menu:before{content:"\e600";}.np-icon-arrows-alt:before{content:"\f0b2";}.np-icon-pencil:before{content:"\e608";}.np-icon-bubble:before{content:"\e607";}.np-icon-lock:before{content:"\e609";}.np-icon-remove:before{content:"\e60a";}.np-icon-list:before{content:"\e60d";}.np-icon-menu2:before{content:"\e606";}.np-icon-link:before{content:"\e612";}.np-icon-eye:before{content:"\e60b";}.np-icon-eye-blocked:before{content:"\e60c";}.np-icon-mail:before{content:"\e60e";}.np-icon-github:before{content:"\e60f";}.np-icon-wordpress:before{content:"\e610";}.np-icon-linkedin:before{content:"\e611";}.np-btn,.np-toggle-edit{text-decoration:none;color:#555;display:inline-block;background-color:#f7f7f7;border:1px solid #e1e1e1;padding:3px 8px;-webkit-box-shadow:inset 0 1px 0 #fff,0 1px 0 rgba(0, 0, 0, 0.08);box-shadow:inset 0 1px 0 #fff,0 1px 0 rgba(0, 0, 0, 0.08);-webkit-transition:all 200ms ease;-o-transition:all 200ms ease;transition:all 200ms ease;}.np-btn:hover,.np-toggle-edit:hover{background-color:#0074a2;color:#ffffff;-webkit-transition:all 200ms ease;-o-transition:all 200ms ease;transition:all 200ms ease;-webkit-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.25),0 1px 0 rgba(0, 0, 0, 0.08);box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.25),0 1px 0 rgba(0, 0, 0, 0.08);border-color:#0074a2;-webkit-transition:all 200ms ease;-o-transition:all 200ms ease;transition:all 200ms ease;}.np-btn-half{float:left;width:47%;padding:3px 0px;text-align:center;}.np-btn-half.btn-right{float:right;}.np-btn-trash{background-color:#e14d43;border-color:#e14d43;-webkit-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.3),0 1px 0 rgba(0, 0, 0, 0.08);box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.3),0 1px 0 rgba(0, 0, 0, 0.08);color:#ffffff;}.np-btn-trash:hover{background-color:#ba251e;border-color:#ba251e;}.np-toggle-edit{display:none;float:right;margin-right:10px;}.np-toggle-edit.active{background-color:#0074a2;color:#ffffff;-webkit-box-shadow:none;box-shadow:none;border-color:#0074a2;}@media (max-width: 767px){.np-toggle-edit{display:inline-block;}}.np-quickedit-error{border-left:4px solid #dd3d36;padding:4px 0 4px 8px;margin-bottom:10px;background-color:#f9f9f9;}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background-color:#000;opacity:0.85;}.modal-open{overflow:hidden;}.np-modal{display:none;overflow:hidden;position:fixed;top:0;right:0;bottom:0;left:0;z-index:99999;-webkit-overflow-scrolling:touch;outline:0;}.np-modal.fade .modal-dialog{-webkit-transform:translate(0, -25%);-ms-transform:translate(0, -25%);-o-transform:translate(0, -25%);transform:translate(0, -25%);-webkit-transition:-webkit-transform 0.3s ease-out;-o-transition:-o-transform 0.3s ease-out;transition:transform 0.3s ease-out;}.np-modal.in .modal-dialog{-webkit-transform:translate(0, 0);-ms-transform:translate(0, 0);-o-transform:translate(0, 0);transform:translate(0, 0);}.np-modal .modal-open .modal{overflow-x:hidden;overflow-y:auto;}.np-modal .modal-dialog{position:relative;width:auto;margin:10px auto 0px auto;max-width:500px;}.np-modal .modal-content{position:relative;background-color:#ffffff;-webkit-box-shadow:0 3px 9px rgba(0, 0, 0, 0.5);box-shadow:0 3px 9px rgba(0, 0, 0, 0.5);-webkit-background-clip:padding-box;background-clip:padding-box;outline:0;}.np-modal .modal-header{padding:8px;background-color:#ebebeb;}.np-modal .modal-header .sr-only{display:none;}.np-modal .modal-header .close{margin-top:-2px;}.np-modal .modal-title{margin:0;}.np-modal .modal-body{position:relative;padding:10px;}.np-modal .modal-footer{padding:10px;text-align:right;background-color:#404040;zoom:1;}.np-modal .modal-footer:before,.np-modal .modal-footer:after{content:" ";display:table;}.np-modal .modal-footer:after{clear:both;}.np-modal .modal-footer .modal-close{float:left;}.np-modal .modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll;}.np-inline-overlay{position:fixed;width:100%;height:100%;background-color:rgba(0, 0, 0, 0.4);z-index:998;top:0;right:0;bottom:0;left:0;opacity:0;-webkit-transition:opacity 200ms ease;-o-transition:opacity 200ms ease;transition:opacity 200ms ease;}.np-inline-overlay.active{opacity:1;-webkit-transition:opacity 200ms ease;-o-transition:opacity 200ms ease;transition:opacity 200ms ease;}.np-inline-modal{position:relative;z-index:999;background-color:#ffffff;-webkit-border-radius:0;border-radius:0;-webkit-box-shadow:0px 0px 4px 0px rgba(0, 0, 0, 0.5);box-shadow:0px 0px 4px 0px rgba(0, 0, 0, 0.5);}.nestedpages-toggleall{float:right;margin-top:-30px;}.np-toggle-publish{color:#999999;}.np-toggle-publish.active{color:#333;font-weight:bold;}.np-sync-menu-cont{float:right;margin:-27px 15px 0px 0px;}#nested-loading{display:none;float:right;width:30px;margin:-31px 120px 0 0;}.np-tabs{background-color:#ebebeb;padding:0px;}.np-tabs ul{text-align:left;list-style-type:none;margin:0;padding:0;}.np-tabs ul li{display:inline-block;margin:0;}.np-tabs ul li a{display:block;text-decoration:none;padding:5px 10px;}.np-tabs ul li a.active{position:relative;color:#333;background-color:#ffffff;}.wppages-top-tools{margin-bottom:20px;padding-top:10px;}.wppages-top-tools a{text-decoration:none;}.wppages-handle-expand{float:left;background-color:#f2f2f2;font-size:18px;width:46px;height:46px;margin-right:5px;text-align:center;border-right:1px solid #e1e1e1;}.wppages-handle-expand div{background-color:#ffffff;border:1px solid #e1e1e1;width:24px;height:24px;line-height:24px;-webkit-border-radius:15px;border-radius:15px;margin-top:9px;cursor:pointer;-webkit-transition:all 200ms ease;-o-transition:all 200ms ease;transition:all 200ms ease;}.wppages-handle-expand div:hover{background-color:#0074a2;border-color:#0074a2;color:#ffffff;-webkit-transition:all 200ms ease;-o-transition:all 200ms ease;transition:all 200ms ease;}.nestedpages{clear:both;-webkit-border-radius:4px;border-radius:4px;}.nestedpages .ui-sortable-placeholder{display:block !important;position:relative;min-height:46px;border:0;border:1px dashed #0074a2 !important;background-color:#effaff;margin:0;}.nestedpages .ui-sortable-helper{opacity:0.8;-webkit-box-shadow:2px 2px 3px 0px rgba(0, 0, 0, 0.5);box-shadow:2px 2px 3px 0px rgba(0, 0, 0, 0.5);}.nestedpages ol{list-style-type:none;clear:both;margin:0;-webkit-box-shadow:0 1px 1px rgba(0, 0, 0, 0.06);box-shadow:0 1px 1px rgba(0, 0, 0, 0.06);border:1px solid #e5e5e5;-webkit-border-radius:3px;border-radius:3px;}.nestedpages ol a{text-decoration:none;}.nestedpages ol .page-link{line-height:26px;}.nestedpages ol .page-link .edit-indicator{margin-left:10px;display:none;}.nestedpages ol .page-link .edit-indicator i{font-size:12px;margin-right:3px;}.nestedpages ol .page-link:hover .edit-indicator{display:inline-block;}.nestedpages ol .locked{color:#333;margin-left:20px;}.nestedpages ol .locked em{font-style:normal;}.nestedpages ol .status{color:#999999;margin:0px 10px;}.nestedpages ol .np-icon-eye-blocked{color:#999999;}.nestedpages ol .nav-status{color:#b3b3b3;}.nestedpages ol .np-hide{display:none;}.nestedpages ol .np-seo-indicator{display:block;float:right;width:12px;height:12px;-webkit-border-radius:8px;border-radius:8px;background-color:#999999;margin:6px 10px 0 0;}.nestedpages ol .np-seo-indicator.good{background-color:#7ad03a;}.nestedpages ol .np-seo-indicator.ok{background-color:#ffba00;}.nestedpages ol .np-seo-indicator.poor{background-color:#ee7c1b;}.nestedpages ol .np-seo-indicator.bad{background-color:#dd3d36;}.nestedpages ol .np-seo-indicator.warn{background-color:maroon;}.nestedpages ol .np-seo-indicator.wrong{background-color:red;}.nestedpages ol li{margin:0;border-top:1px solid #e1e1e1;background-color:#0074a2;}.nestedpages ol li.first{border:0;}.nestedpages ol li:first-child{border:0;}.nestedpages ol li.no-border{border:0;}.nestedpages ol ol{display:none;-webkit-border-radius:0;border-radius:0;list-style-type:none;border:0;-webkit-box-shadow:none;box-shadow:none;border-top:1px solid #e1e1e1;}.nestedpages .child-toggle{float:left;margin:-10px 10px 0 0;width:46px;height:46px;background-color:#f0f0f0;text-align:center;}.nestedpages .child-toggle a{display:inline-block;margin-top:7px;width:28px;height:28px;background-color:#ffffff;border:1px solid #e1e1e1;-webkit-border-radius:20px;border-radius:20px;font-size:20px;line-height:30px;color:#333;-webkit-box-shadow:none;box-shadow:none;-webkit-transition:all 200ms ease;-o-transition:all 200ms ease;transition:all 200ms ease;}.nestedpages .child-toggle a i{line-height:26px;}.nestedpages .child-toggle a:hover{background-color:#0074a2;color:#ffffff;border-color:#0074a2;}.nestedpages .handle{display:inline-block;cursor:move;font-size:20px;color:#b3b3b3;-webkit-transition:all 200ms ease;-o-transition:all 200ms ease;transition:all 200ms ease;position:relative;top:3px;}.nestedpages .handle:hover{-webkit-transition:all 200ms ease;-o-transition:all 200ms ease;transition:all 200ms ease;color:#0074a2;}.nestedpages .np-icon-sub-menu{display:none;color:#999999;position:relative;left:2px;}.nestedpages .handle,.nestedpages .np-icon-sub-menu{width:30px;height:46px;line-height:36px;margin-top:-10px;}.nestedpages li ol .row .np-icon-sub-menu{display:inline-block;}.nestedpages li ol .row .handle{display:none;}.nestedpages li ol .row:hover .np-icon-sub-menu{display:none;}.nestedpages li ol .row:hover .handle{display:inline-block;}.nestedpages .row{background-color:#ffffff;display:block;padding:10px 0px 0px 0px;height:36px;zoom:1;}.nestedpages .row:before,.nestedpages .row:after{content:" ";display:table;}.nestedpages .row:after{clear:both;}.nestedpages .row:hover{background-color:#f0f0f0;}.nestedpages .row.np-updated{background-color:#e9f7df;-webkit-transition:background-color 400ms ease;-o-transition:background-color 400ms ease;transition:background-color 400ms ease;}.nestedpages .row.np-updated-show{background-color:#ffffff;-webkit-transition:background-color 400ms ease;-o-transition:background-color 400ms ease;transition:background-color 400ms ease;}.nestedpages ol li ol .row-inner{padding-left:76px;}.nestedpages ol li ol li ol .row-inner{padding-left:96px;}.nestedpages ol li ol li ol li ol .row-inner{padding-left:116px;}.nestedpages ol li ol li ol li ol li ol .row-inner{padding-left:136px;}.nestedpages ol li ol li ol li ol li ol li ol .row-inner{padding-left:156px;}.nestedpages .action-buttons{display:none;float:right;margin:0 10px 0 0;}.nestedpages .action-buttons a{margin:0 0 0 -5px;}.nestedpages .action-buttons a.np-btn-trash{margin-left:4px;}.nestedpages-tools{zoom:1;clear:both;margin-bottom:10px;}.nestedpages-tools:before,.nestedpages-tools:after{content:" ";display:table;}.nestedpages-tools:after{clear:both;}.nestedpages-tools .subsubsub{margin:0;}.np-search{float:right;}@media (min-width: 768px){.nestedpages .row:hover .action-buttons{display:block;}}@media (max-width: 767px){.nestedpages ol .page-link{line-height:24px;}.nestedpages ol .page-link:hover span{display:none;}.nestedpages ol .locked em{display:none;}.nestedpages .child-toggle{background:transparent;}.nestedpages .row{height:auto;}.nestedpages .action-buttons{display:none;background-color:#0074a2;float:none;margin:0;padding:8px;}.nestedpages .action-buttons a{margin-left:5px;}}.nestedpages .quick-edit .form-interior,.nestedpages .new-child .form-interior{padding:10px;}.nestedpages .quick-edit h3,.nestedpages .new-child h3{margin:0 0 8px 0;font-size:14px;}.nestedpages .quick-edit h3 span,.nestedpages .new-child h3 span{float:right;font-size:12px;}.nestedpages .quick-edit h3 span em,.nestedpages .new-child h3 span em{font-weight:normal;font-style:normal;color:#808080;}.nestedpages .quick-edit .fields,.nestedpages .new-child .fields{margin-bottom:10px;background:url('../images/border.png') repeat-y;background-position:center;zoom:1;}.nestedpages .quick-edit .fields:before,.nestedpages .quick-edit .fields:after,.nestedpages .new-child .fields:before,.nestedpages .new-child .fields:after{content:" ";display:table;}.nestedpages .quick-edit .fields:after,.nestedpages .new-child .fields:after{clear:both;}.nestedpages .quick-edit .left,.nestedpages .new-child .left{float:left;width:48%;}.nestedpages .quick-edit .right,.nestedpages .new-child .right{float:right;width:48%;}.nestedpages .quick-edit label,.nestedpages .new-child label{font-style:oblique;}.nestedpages .quick-edit .buttons,.nestedpages .new-child .buttons{clear:both;zoom:1;background-color:#404040;padding:8px;}.nestedpages .quick-edit .buttons:before,.nestedpages .quick-edit .buttons:after,.nestedpages .new-child .buttons:before,.nestedpages .new-child .buttons:after{content:" ";display:table;}.nestedpages .quick-edit .buttons:after,.nestedpages .new-child .buttons:after{clear:both;}.nestedpages .quick-edit .form-control,.nestedpages .new-child .form-control{clear:both;zoom:1;margin-bottom:5px;}.nestedpages .quick-edit .form-control:before,.nestedpages .quick-edit .form-control:after,.nestedpages .new-child .form-control:before,.nestedpages .new-child .form-control:after{content:" ";display:table;}.nestedpages .quick-edit .form-control:after,.nestedpages .new-child .form-control:after{clear:both;}.nestedpages .quick-edit .form-control input[type='text'],.nestedpages .quick-edit .form-control input[type='password'],.nestedpages .quick-edit .form-control select,.nestedpages .new-child .form-control input[type='text'],.nestedpages .new-child .form-control input[type='password'],.nestedpages .new-child .form-control select{float:right;width:75%;}.nestedpages .quick-edit .form-control label,.nestedpages .new-child .form-control label{float:left;width:20%;}.nestedpages .quick-edit .form-control.password label,.nestedpages .new-child .form-control.password label{width:25%;}.nestedpages .quick-edit .form-control.password input[type="text"],.nestedpages .new-child .form-control.password input[type="text"]{float:left;width:35%;}.nestedpages .quick-edit .form-control.password .private,.nestedpages .new-child .form-control.password .private{float:right;width:35%;margin-top:4px;}.nestedpages .quick-edit .form-control.password .private label,.nestedpages .new-child .form-control.password .private label{width:auto;float:none;}.nestedpages .quick-edit .comments,.nestedpages .new-child .comments{float:right;width:75%;margin-bottom:10px;zoom:1;}.nestedpages .quick-edit .comments:before,.nestedpages .quick-edit .comments:after,.nestedpages .new-child .comments:before,.nestedpages .new-child .comments:after{content:" ";display:table;}.nestedpages .quick-edit .comments:after,.nestedpages .new-child .comments:after{clear:both;}.nestedpages .quick-edit .dates,.nestedpages .new-child .dates{float:right;width:75%;margin-bottom:6px;}.nestedpages .quick-edit .dates select,.nestedpages .new-child .dates select{width:25%;}.nestedpages .quick-edit .dates input,.nestedpages .new-child .dates input{width:12%;}.nestedpages .quick-edit .np-toggle-options,.nestedpages .new-child .np-toggle-options{background-color:#f2f2f2;padding:5px;}.nestedpages .quick-edit .np-taxonomies,.nestedpages .quick-edit .np-menuoptions,.nestedpages .new-child .np-taxonomies,.nestedpages .new-child .np-menuoptions{display:none;clear:both;background-color:#f9f9f9;padding:8px;zoom:1;margin-top:5px;}.nestedpages .quick-edit .np-taxonomies:before,.nestedpages .quick-edit .np-taxonomies:after,.nestedpages .quick-edit .np-menuoptions:before,.nestedpages .quick-edit .np-menuoptions:after,.nestedpages .new-child .np-taxonomies:before,.nestedpages .new-child .np-taxonomies:after,.nestedpages .new-child .np-menuoptions:before,.nestedpages .new-child .np-menuoptions:after{content:" ";display:table;}.nestedpages .quick-edit .np-taxonomies:after,.nestedpages .quick-edit .np-menuoptions:after,.nestedpages .new-child .np-taxonomies:after,.nestedpages .new-child .np-menuoptions:after{clear:both;}.nestedpages .quick-edit .np-taxonomy,.nestedpages .new-child .np-taxonomy{float:left;width:30%;margin-right:3.33%;}.nestedpages .quick-edit .np-taxonomy .title,.nestedpages .new-child .np-taxonomy .title{font-weight:bold;margin-bottom:4px;display:block;}.nestedpages .quick-edit .np-taxonomy li,.nestedpages .new-child .np-taxonomy li{background-color:#ffffff;border:0;}.nestedpages .quick-edit .np-taxonomy textarea,.nestedpages .new-child .np-taxonomy textarea{width:100%;height:6.5em;}.nestedpages .quick-edit .np-menuoptions,.nestedpages .new-child .np-menuoptions{padding:15px;}.nestedpages .quick-edit .np-menuoptions label,.nestedpages .quick-edit .np-menuoptions input[type="text"],.nestedpages .new-child .np-menuoptions label,.nestedpages .new-child .np-menuoptions input[type="text"]{display:block;float:none;width:100%;}.nestedpages .quick-edit .np-menuoptions .menuoptions-left,.nestedpages .new-child .np-menuoptions .menuoptions-left{float:left;width:47%;}.nestedpages .quick-edit .np-menuoptions .menuoptions-right,.nestedpages .new-child .np-menuoptions .menuoptions-right{float:right;width:47%;padding-top:18px;}.nestedpages .quick-edit .np-menuoptions .menuoptions-right label,.nestedpages .new-child .np-menuoptions .menuoptions-right label{margin-bottom:10px;}.nestedpages .quick-edit .np-hide-options,.nestedpages .new-child .np-hide-options{display:none;background-color:#f0f0f0;-webkit-border-radius:3px;border-radius:3px;clear:both;padding:6px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;}.nestedpages .quick-edit .np-hide-options p,.nestedpages .new-child .np-hide-options p{margin:0;}.nestedpages .quick-edit .np-hide-options label,.nestedpages .new-child .np-hide-options label{display:block;margin-top:4px;font-style:normal;}.nestedpages .quick-edit .new-page-titles,.nestedpages .new-child .new-page-titles{display:block;border:0;}.nestedpages .quick-edit .new-page-titles li,.nestedpages .new-child .new-page-titles li{background:transparent;border:0;padding:4px;zoom:1;}.nestedpages .quick-edit .new-page-titles li:before,.nestedpages .quick-edit .new-page-titles li:after,.nestedpages .new-child .new-page-titles li:before,.nestedpages .new-child .new-page-titles li:after{content:" ";display:table;}.nestedpages .quick-edit .new-page-titles li:after,.nestedpages .new-child .new-page-titles li:after{clear:both;}.nestedpages .quick-edit .new-page-titles li:nth-child(even),.nestedpages .new-child .new-page-titles li:nth-child(even){background-color:#f0f0f0;}.nestedpages .quick-edit .new-page-titles li label,.nestedpages .new-child .new-page-titles li label{margin-top:7px;}.nestedpages .quick-edit .new-page-titles .form-control,.nestedpages .new-child .new-page-titles .form-control{float:right;width:90%;clear:none;}.nestedpages .quick-edit .new-page-titles .np-icon-menu,.nestedpages .new-child .new-page-titles .np-icon-menu{float:left;margin-top:0px;height:auto;line-height:26px;}.nestedpages .quick-edit .new-page-titles .new-child-row div,.nestedpages .new-child .new-page-titles .new-child-row div{float:right;width:75%;margin:2px;zoom:1;}.nestedpages .quick-edit .new-page-titles .new-child-row div:before,.nestedpages .quick-edit .new-page-titles .new-child-row div:after,.nestedpages .new-child .new-page-titles .new-child-row div:before,.nestedpages .new-child .new-page-titles .new-child-row div:after{content:" ";display:table;}.nestedpages .quick-edit .new-page-titles .new-child-row div:after,.nestedpages .new-child .new-page-titles .new-child-row div:after{clear:both;}.nestedpages .quick-edit .new-page-titles .new-child-row div input[type='text'],.nestedpages .new-child .new-page-titles .new-child-row div input[type='text']{float:left;width:80%;}.nestedpages .quick-edit .new-page-titles .new-child-row div a,.nestedpages .new-child .new-page-titles .new-child-row div a{float:right;}.np-qe-loading{display:none;float:right;width:25px;height:25px;margin:2px 10px 0 0;background:url('../images/loading-white.gif') no-repeat;}@media (max-width: 767px){.nestedpages .quick-edit .fields{background:transparent;}.nestedpages .quick-edit .left,.nestedpages .quick-edit .right{float:none;width:100%;}.nestedpages .quick-edit .form-control{margin-bottom:10px;}.nestedpages .quick-edit .form-control input[type='text'],.nestedpages .quick-edit .form-control input[type='password'],.nestedpages .quick-edit .form-control select{float:none;width:100%;}.nestedpages .quick-edit .form-control label{display:block;float:none;width:100%;margin-bottom:4px;}.nestedpages .quick-edit .comments{float:none;width:100%;}.nestedpages .quick-edit .dates{float:none;width:100%;margin-bottom:6px;}}.np-modal-form .form-interior{zoom:1;background:url('../images/border.png') repeat-y;background-position:center;padding:5px 0;}.np-modal-form .form-interior:before,.np-modal-form .form-interior:after{content:" ";display:table;}.np-modal-form .form-interior:after{clear:both;}.np-modal-form .form-control{zoom:1;margin-bottom:10px;}.np-modal-form .form-control:before,.np-modal-form .form-control:after{content:" ";display:table;}.np-modal-form .form-control:after{clear:both;}.np-modal-form .checkbox{margin-bottom:10px;}.np-modal-form .left{float:left;width:45%;}.np-modal-form .right{float:right;width:45%;padding-top:18px;}.np-modal-form label{display:block;}.np-modal-form input[type="text"],.np-modal-form select{width:100%;}.np-modal-form .buttons{clear:both;}
1
+ body{-webkit-animation-delay:0.1s;-webkit-animation-name:fontfix;-webkit-animation-duration:0.1s;-webkit-animation-iteration-count:1;-webkit-animation-timing-function:linear;}@-webkit-keyframes fontfix{from{opacity:1;}to{opacity:1;}}@font-face{font-family:'nestedpages';src:url('fonts/nestedpages.eot');}@font-face{font-family:'nestedpages';src:url(data:application/x-font-ttf;charset=utf-8;base64,AAEAAAALAIAAAwAwT1MvMggjB2gAAAC8AAAAYGNtYXDw7eamAAABHAAAAFRnYXNwAAAAEAAAAXAAAAAIZ2x5ZrIqLaoAAAF4AAARNGhlYWQCOg/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Au4DxARIBKAF/Ab6B4AILAiaAAAAAQAAABgA7wAHAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAA4ArgABAAAAAAABABYAAAABAAAAAAACAA4AYwABAAAAAAADABYALAABAAAAAAAEABYAcQABAAAAAAAFABYAFgABAAAAAAAGAAsAQgABAAAAAAAKADQAhwADAAEECQABABYAAAADAAEECQACAA4AYwADAAEECQADABYALAADAAEECQAEABYAcQADAAEECQAFABYAFgADAAEECQAGABYATQADAAEECQAKADQAhwBuAGUAcwB0AGUAZABwAGEAZwBlAHMAVgBlAHIAcwBpAG8AbgAgADEALgAwAG4AZQBzAHQAZQBkAHAAYQBnAGUAc25lc3RlZHBhZ2VzAG4AZQBzAHQAZQBkAHAAYQBnAGUAcwBSAGUAZwB1AGwAYQByAG4AZQBzAHQAZQBkAHAAYQBnAGUAcwBGAG8AbgB0ACAAZwBlAG4AZQByAGEAdABlAGQAIABiAHkAIABJAGMAbwBNAG8AbwBuAC4AAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==) format('woff');font-weight:normal;font-style:normal;}[class^="np-icon-"],[class*=" np-icon-"]{font-family:'nestedpages';speak:none;font-style:normal;font-weight:normal;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;}.np-icon-no:before{content:"\e601";}.np-icon-yes:before{content:"\e602";}.np-icon-menu:before{content:"\e603";}.np-icon-arrow-down:before{content:"\e604";}.np-icon-arrow-right:before{content:"\e605";}.np-icon-sub-menu:before{content:"\e600";}.np-icon-arrows-alt:before{content:"\f0b2";}.np-icon-pencil:before{content:"\e608";}.np-icon-bubble:before{content:"\e607";}.np-icon-lock:before{content:"\e609";}.np-icon-remove:before{content:"\e60a";}.np-icon-list:before{content:"\e60d";}.np-icon-menu2:before{content:"\e606";}.np-icon-link:before{content:"\e612";}.np-icon-eye:before{content:"\e60b";}.np-icon-eye-blocked:before{content:"\e60c";}.np-icon-mail:before{content:"\e60e";}.np-icon-github:before{content:"\e60f";}.np-icon-wordpress:before{content:"\e610";}.np-icon-linkedin:before{content:"\e611";}.np-btn,.np-toggle-edit{text-decoration:none;color:#555;display:inline-block;background-color:#f7f7f7;border:1px solid #e1e1e1;padding:3px 8px;-webkit-box-shadow:inset 0 1px 0 #fff,0 1px 0 rgba(0, 0, 0, 0.08);box-shadow:inset 0 1px 0 #fff,0 1px 0 rgba(0, 0, 0, 0.08);-webkit-transition:all 200ms ease;-o-transition:all 200ms ease;transition:all 200ms ease;}.np-btn:hover,.np-toggle-edit:hover{background-color:#0074a2;color:#ffffff;-webkit-transition:all 200ms ease;-o-transition:all 200ms ease;transition:all 200ms ease;-webkit-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.25),0 1px 0 rgba(0, 0, 0, 0.08);box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.25),0 1px 0 rgba(0, 0, 0, 0.08);border-color:#0074a2;-webkit-transition:all 200ms ease;-o-transition:all 200ms ease;transition:all 200ms ease;}.np-btn-half{float:left;width:47%;padding:3px 0px;text-align:center;}.np-btn-half.btn-right{float:right;}.np-btn-trash{background-color:#e14d43;border-color:#e14d43;-webkit-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.3),0 1px 0 rgba(0, 0, 0, 0.08);box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.3),0 1px 0 rgba(0, 0, 0, 0.08);color:#ffffff;}.np-btn-trash:hover{background-color:#ba251e;border-color:#ba251e;}.np-toggle-edit{display:none;float:right;margin-right:10px;}.np-toggle-edit.active{background-color:#0074a2;color:#ffffff;-webkit-box-shadow:none;box-shadow:none;border-color:#0074a2;}@media (max-width: 767px){.np-toggle-edit{display:inline-block;}}.np-quickedit-error{border-left:4px solid #dd3d36;padding:4px 0 4px 8px;margin-bottom:10px;background-color:#f9f9f9;}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background-color:#000;opacity:0.85;}.modal-open{overflow:hidden;}.np-modal{display:none;overflow:hidden;position:fixed;top:0;right:0;bottom:0;left:0;z-index:99999;-webkit-overflow-scrolling:touch;outline:0;}.np-modal.fade .modal-dialog{-webkit-transform:translate(0, -25%);-ms-transform:translate(0, -25%);-o-transform:translate(0, -25%);transform:translate(0, -25%);-webkit-transition:-webkit-transform 0.3s ease-out;-o-transition:-o-transform 0.3s ease-out;transition:transform 0.3s ease-out;}.np-modal.in .modal-dialog{-webkit-transform:translate(0, 0);-ms-transform:translate(0, 0);-o-transform:translate(0, 0);transform:translate(0, 0);}.np-modal .modal-open .modal{overflow-x:hidden;overflow-y:auto;}.np-modal .modal-dialog{position:relative;width:auto;margin:10px auto 0px auto;max-width:500px;}.np-modal .modal-content{position:relative;background-color:#ffffff;-webkit-box-shadow:0 3px 9px rgba(0, 0, 0, 0.5);box-shadow:0 3px 9px rgba(0, 0, 0, 0.5);-webkit-background-clip:padding-box;background-clip:padding-box;outline:0;}.np-modal .modal-header{padding:8px;background-color:#ebebeb;}.np-modal .modal-header .sr-only{display:none;}.np-modal .modal-header .close{margin-top:-2px;}.np-modal .modal-title{margin:0;}.np-modal .modal-body{position:relative;padding:10px;}.np-modal .modal-body.new-child{padding:0;}.np-modal .modal-footer{padding:10px;text-align:right;background-color:#404040;zoom:1;}.np-modal .modal-footer:before,.np-modal .modal-footer:after{content:" ";display:table;}.np-modal .modal-footer:after{clear:both;}.np-modal .modal-footer .modal-close{float:left;}.np-modal .modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll;}.np-inline-overlay{position:fixed;width:100%;height:100%;background-color:rgba(0, 0, 0, 0.4);z-index:998;top:0;right:0;bottom:0;left:0;opacity:0;-webkit-transition:opacity 200ms ease;-o-transition:opacity 200ms ease;transition:opacity 200ms ease;}.np-inline-overlay.active{opacity:1;-webkit-transition:opacity 200ms ease;-o-transition:opacity 200ms ease;transition:opacity 200ms ease;}.np-inline-modal{position:relative;z-index:999;background-color:#ffffff;-webkit-border-radius:0;border-radius:0;-webkit-box-shadow:0px 0px 4px 0px rgba(0, 0, 0, 0.5);box-shadow:0px 0px 4px 0px rgba(0, 0, 0, 0.5);}.nestedpages-toggleall{float:right;margin-top:-30px;}.np-toggle-publish{color:#999999;}.np-toggle-publish.active{color:#333;font-weight:bold;}.np-sync-menu-cont{float:right;margin:-27px 15px 0px 0px;}#nested-loading{display:none;float:right;width:30px;margin:-31px 120px 0 0;}.np-tabs{background-color:#ebebeb;padding:0px;}.np-tabs ul{text-align:left;list-style-type:none;margin:0;padding:0;}.np-tabs ul li{display:inline-block;margin:0;}.np-tabs ul li a{display:block;text-decoration:none;padding:5px 10px;}.np-tabs ul li a.active{position:relative;color:#333;background-color:#ffffff;}.nestedpages-tools{zoom:1;clear:both;margin-bottom:5px;}.nestedpages-tools:before,.nestedpages-tools:after{content:" ";display:table;}.nestedpages-tools:after{clear:both;}.nestedpages-tools .subsubsub{margin:0;}.nestedpages-tools .np-tools-primary{clear:left;padding-top:8px;}.nestedpages-tools .select{float:left;margin-left:5px;}.nestedpages-tools .select.first{margin-left:0;}.nestedpages-tools .np-tools-sort{float:left;}.nestedpages-tools .np-tools-search{float:right;}.wppages-handle-expand{float:left;background-color:#f2f2f2;font-size:18px;width:46px;height:46px;margin-right:5px;text-align:center;border-right:1px solid #e1e1e1;}.wppages-handle-expand div{background-color:#ffffff;border:1px solid #e1e1e1;width:24px;height:24px;line-height:24px;-webkit-border-radius:15px;border-radius:15px;margin-top:9px;cursor:pointer;-webkit-transition:all 200ms ease;-o-transition:all 200ms ease;transition:all 200ms ease;}.wppages-handle-expand div:hover{background-color:#0074a2;border-color:#0074a2;color:#ffffff;-webkit-transition:all 200ms ease;-o-transition:all 200ms ease;transition:all 200ms ease;}.nestedpages{clear:both;-webkit-border-radius:4px;border-radius:4px;}.nestedpages .ui-sortable-placeholder{display:block !important;position:relative;min-height:46px;border:0;border:1px dashed #0074a2 !important;background-color:#effaff;margin:0;}.nestedpages .ui-sortable-helper{opacity:0.8;-webkit-box-shadow:2px 2px 3px 0px rgba(0, 0, 0, 0.5);box-shadow:2px 2px 3px 0px rgba(0, 0, 0, 0.5);}.nestedpages ol{list-style-type:none;clear:both;margin:0;-webkit-box-shadow:0 1px 1px rgba(0, 0, 0, 0.06);box-shadow:0 1px 1px rgba(0, 0, 0, 0.06);border:1px solid #e5e5e5;-webkit-border-radius:3px;border-radius:3px;}.nestedpages ol a{text-decoration:none;}.nestedpages ol .page-link{line-height:26px;}.nestedpages ol .page-link .edit-indicator{margin-left:10px;display:none;}.nestedpages ol .page-link .edit-indicator i{font-size:12px;margin-right:3px;}.nestedpages ol .page-link:hover .edit-indicator{display:inline-block;}.nestedpages ol .locked{color:#333;margin-left:20px;}.nestedpages ol .locked em{font-style:normal;}.nestedpages ol .status{color:#999999;margin:0px 10px;}.nestedpages ol .np-icon-eye-blocked{color:#999999;}.nestedpages ol .nav-status{color:#b3b3b3;}.nestedpages ol .np-hide{display:none;}.nestedpages ol .np-seo-indicator{display:block;float:right;width:12px;height:12px;-webkit-border-radius:8px;border-radius:8px;background-color:#999999;margin:6px 10px 0 0;}.nestedpages ol .np-seo-indicator.good{background-color:#7ad03a;}.nestedpages ol .np-seo-indicator.ok{background-color:#ffba00;}.nestedpages ol .np-seo-indicator.poor{background-color:#ee7c1b;}.nestedpages ol .np-seo-indicator.bad{background-color:#dd3d36;}.nestedpages ol .np-seo-indicator.warn{background-color:maroon;}.nestedpages ol .np-seo-indicator.wrong{background-color:red;}.nestedpages ol li{margin:0;border-top:1px solid #e1e1e1;background-color:#0074a2;}.nestedpages ol li.first{border:0;}.nestedpages ol li:first-child{border:0;}.nestedpages ol li.no-border{border:0;}.nestedpages ol ol{display:none;-webkit-border-radius:0;border-radius:0;list-style-type:none;border:0;-webkit-box-shadow:none;box-shadow:none;border-top:1px solid #e1e1e1;}.nestedpages .child-toggle{float:left;margin:-10px 10px 0 0;width:46px;height:46px;background-color:#f0f0f0;text-align:center;}.nestedpages .child-toggle a{display:inline-block;margin-top:7px;width:28px;height:28px;background-color:#ffffff;border:1px solid #e1e1e1;-webkit-border-radius:20px;border-radius:20px;font-size:20px;line-height:30px;color:#333;-webkit-box-shadow:none;box-shadow:none;-webkit-transition:all 200ms ease;-o-transition:all 200ms ease;transition:all 200ms ease;}.nestedpages .child-toggle a i{line-height:26px;}.nestedpages .child-toggle a:hover{background-color:#0074a2;color:#ffffff;border-color:#0074a2;}.nestedpages .handle{display:inline-block;cursor:move;font-size:20px;color:#b3b3b3;-webkit-transition:all 200ms ease;-o-transition:all 200ms ease;transition:all 200ms ease;position:relative;top:3px;}.nestedpages .handle:hover{-webkit-transition:all 200ms ease;-o-transition:all 200ms ease;transition:all 200ms ease;color:#0074a2;}.nestedpages .np-icon-sub-menu{display:none;color:#999999;position:relative;left:2px;}.nestedpages .handle,.nestedpages .np-icon-sub-menu{width:30px;height:46px;line-height:36px;margin-top:-10px;}.nestedpages li ol .row .np-icon-sub-menu{display:inline-block;}.nestedpages li ol .row .handle{display:none;}.nestedpages li ol .row:hover .np-icon-sub-menu{display:none;}.nestedpages li ol .row:hover .handle{display:inline-block;}.nestedpages .row{background-color:#ffffff;display:block;padding:10px 0px 0px 0px;height:36px;zoom:1;}.nestedpages .row:before,.nestedpages .row:after{content:" ";display:table;}.nestedpages .row:after{clear:both;}.nestedpages .row:hover{background-color:#f0f0f0;}.nestedpages .row.np-updated{background-color:#e9f7df;-webkit-transition:background-color 400ms ease;-o-transition:background-color 400ms ease;transition:background-color 400ms ease;}.nestedpages .row.np-updated-show{background-color:#ffffff;-webkit-transition:background-color 400ms ease;-o-transition:background-color 400ms ease;transition:background-color 400ms ease;}.nestedpages .row.non-hierarchical{padding-left:15px;}.nestedpages ol li ol .row-inner{padding-left:76px;}.nestedpages ol li ol li ol .row-inner{padding-left:96px;}.nestedpages ol li ol li ol li ol .row-inner{padding-left:116px;}.nestedpages ol li ol li ol li ol li ol .row-inner{padding-left:136px;}.nestedpages ol li ol li ol li ol li ol li ol .row-inner{padding-left:156px;}.nestedpages .np-post-columns{float:right;margin:3px 20px 0px 0px;zoom:1;}.nestedpages .np-post-columns:before,.nestedpages .np-post-columns:after{content:" ";display:table;}.nestedpages .np-post-columns:after{clear:both;}.nestedpages .np-post-columns ul li{background:transparent;color:#808080;border:0;float:left;margin-left:8px;padding-left:8px;border-left:1px solid #cccccc;}.nestedpages .np-post-columns ul li:first-child{margin-left:0;padding-left:0;border:0;}.nestedpages .action-buttons{display:none;float:right;margin:0 10px 0 0;}.nestedpages .action-buttons a{margin:0 0 0 -5px;}.nestedpages .action-buttons a.np-btn-trash{margin-left:4px;}.np-search{float:right;}@media (min-width: 768px){.nestedpages .row:hover .action-buttons{display:block;}.nestedpages .row:hover .np-post-columns{display:none;}}@media (max-width: 767px){.nestedpages ol .page-link{line-height:24px;}.nestedpages ol .page-link:hover span{display:none;}.nestedpages ol .locked em{display:none;}.nestedpages .child-toggle{background:transparent;}.nestedpages .row{height:auto;}.nestedpages .action-buttons{display:none;background-color:#0074a2;float:none;margin:0;padding:8px;}.nestedpages .action-buttons a{margin-left:5px;}}.nestedpages .quick-edit .form-interior,.nestedpages .new-child .form-interior{padding:10px;}.nestedpages .quick-edit h3,.nestedpages .new-child h3{margin:0 0 8px 0;font-size:14px;}.nestedpages .quick-edit h3 span,.nestedpages .new-child h3 span{float:right;font-size:12px;}.nestedpages .quick-edit h3 span em,.nestedpages .new-child h3 span em{font-weight:normal;font-style:normal;color:#808080;}.nestedpages .quick-edit .fields,.nestedpages .new-child .fields{margin-bottom:10px;background:url('../images/border.png') repeat-y;background-position:center;zoom:1;}.nestedpages .quick-edit .fields:before,.nestedpages .quick-edit .fields:after,.nestedpages .new-child .fields:before,.nestedpages .new-child .fields:after{content:" ";display:table;}.nestedpages .quick-edit .fields:after,.nestedpages .new-child .fields:after{clear:both;}.nestedpages .quick-edit .left,.nestedpages .new-child .left{float:left;width:48%;}.nestedpages .quick-edit .right,.nestedpages .new-child .right{float:right;width:48%;}.nestedpages .quick-edit label,.nestedpages .new-child label{font-style:oblique;}.nestedpages .quick-edit .buttons,.nestedpages .new-child .buttons{clear:both;zoom:1;background-color:#404040;padding:8px;}.nestedpages .quick-edit .buttons:before,.nestedpages .quick-edit .buttons:after,.nestedpages .new-child .buttons:before,.nestedpages .new-child .buttons:after{content:" ";display:table;}.nestedpages .quick-edit .buttons:after,.nestedpages .new-child .buttons:after{clear:both;}.nestedpages .quick-edit .form-control,.nestedpages .new-child .form-control{clear:both;zoom:1;margin-bottom:5px;}.nestedpages .quick-edit .form-control:before,.nestedpages .quick-edit .form-control:after,.nestedpages .new-child .form-control:before,.nestedpages .new-child .form-control:after{content:" ";display:table;}.nestedpages .quick-edit .form-control:after,.nestedpages .new-child .form-control:after{clear:both;}.nestedpages .quick-edit .form-control input[type='text'],.nestedpages .quick-edit .form-control input[type='password'],.nestedpages .quick-edit .form-control select,.nestedpages .new-child .form-control input[type='text'],.nestedpages .new-child .form-control input[type='password'],.nestedpages .new-child .form-control select{float:right;width:75%;}.nestedpages .quick-edit .form-control label,.nestedpages .new-child .form-control label{float:left;width:20%;}.nestedpages .quick-edit .form-control.password label,.nestedpages .new-child .form-control.password label{width:25%;}.nestedpages .quick-edit .form-control.password input[type="text"],.nestedpages .new-child .form-control.password input[type="text"]{float:left;width:35%;}.nestedpages .quick-edit .form-control.password .private,.nestedpages .new-child .form-control.password .private{float:right;width:35%;margin-top:4px;}.nestedpages .quick-edit .form-control.password .private label,.nestedpages .new-child .form-control.password .private label{width:auto;float:none;}.nestedpages .quick-edit .comments,.nestedpages .new-child .comments{float:right;width:75%;margin-bottom:10px;zoom:1;}.nestedpages .quick-edit .comments:before,.nestedpages .quick-edit .comments:after,.nestedpages .new-child .comments:before,.nestedpages .new-child .comments:after{content:" ";display:table;}.nestedpages .quick-edit .comments:after,.nestedpages .new-child .comments:after{clear:both;}.nestedpages .quick-edit .dates,.nestedpages .new-child .dates{float:right;width:75%;margin-bottom:6px;}.nestedpages .quick-edit .dates select,.nestedpages .new-child .dates select{width:25%;}.nestedpages .quick-edit .dates input,.nestedpages .new-child .dates input{width:12%;}.nestedpages .quick-edit .np-toggle-options,.nestedpages .new-child .np-toggle-options{background-color:#f2f2f2;padding:5px;}.nestedpages .quick-edit .np-taxonomies,.nestedpages .quick-edit .np-menuoptions,.nestedpages .new-child .np-taxonomies,.nestedpages .new-child .np-menuoptions{display:none;clear:both;background-color:#f9f9f9;padding:8px;zoom:1;margin-top:5px;}.nestedpages .quick-edit .np-taxonomies:before,.nestedpages .quick-edit .np-taxonomies:after,.nestedpages .quick-edit .np-menuoptions:before,.nestedpages .quick-edit .np-menuoptions:after,.nestedpages .new-child .np-taxonomies:before,.nestedpages .new-child .np-taxonomies:after,.nestedpages .new-child .np-menuoptions:before,.nestedpages .new-child .np-menuoptions:after{content:" ";display:table;}.nestedpages .quick-edit .np-taxonomies:after,.nestedpages .quick-edit .np-menuoptions:after,.nestedpages .new-child .np-taxonomies:after,.nestedpages .new-child .np-menuoptions:after{clear:both;}.nestedpages .quick-edit .np-taxonomy,.nestedpages .new-child .np-taxonomy{float:left;width:30%;margin-right:3.33%;}.nestedpages .quick-edit .np-taxonomy .title,.nestedpages .new-child .np-taxonomy .title{font-weight:bold;margin-bottom:4px;display:block;}.nestedpages .quick-edit .np-taxonomy li,.nestedpages .new-child .np-taxonomy li{background-color:#ffffff;border:0;}.nestedpages .quick-edit .np-taxonomy textarea,.nestedpages .new-child .np-taxonomy textarea{width:100%;height:6.5em;}.nestedpages .quick-edit .np-menuoptions,.nestedpages .new-child .np-menuoptions{padding:15px;}.nestedpages .quick-edit .np-menuoptions label,.nestedpages .quick-edit .np-menuoptions input[type="text"],.nestedpages .new-child .np-menuoptions label,.nestedpages .new-child .np-menuoptions input[type="text"]{display:block;float:none;width:100%;}.nestedpages .quick-edit .np-menuoptions .menuoptions-left,.nestedpages .new-child .np-menuoptions .menuoptions-left{float:left;width:47%;}.nestedpages .quick-edit .np-menuoptions .menuoptions-right,.nestedpages .new-child .np-menuoptions .menuoptions-right{float:right;width:47%;padding-top:18px;}.nestedpages .quick-edit .np-menuoptions .menuoptions-right label,.nestedpages .new-child .np-menuoptions .menuoptions-right label{margin-bottom:10px;}.nestedpages .quick-edit .np-hide-options,.nestedpages .new-child .np-hide-options{display:none;background-color:#f0f0f0;-webkit-border-radius:3px;border-radius:3px;clear:both;padding:6px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;}.nestedpages .quick-edit .np-hide-options p,.nestedpages .new-child .np-hide-options p{margin:0;}.nestedpages .quick-edit .np-hide-options label,.nestedpages .new-child .np-hide-options label{display:block;margin-top:4px;font-style:normal;}.nestedpages .quick-edit .new-page-titles,.nestedpages .new-child .new-page-titles{display:block;border:0;}.nestedpages .quick-edit .new-page-titles li,.nestedpages .new-child .new-page-titles li{background:transparent;border:0;padding:4px;zoom:1;}.nestedpages .quick-edit .new-page-titles li:before,.nestedpages .quick-edit .new-page-titles li:after,.nestedpages .new-child .new-page-titles li:before,.nestedpages .new-child .new-page-titles li:after{content:" ";display:table;}.nestedpages .quick-edit .new-page-titles li:after,.nestedpages .new-child .new-page-titles li:after{clear:both;}.nestedpages .quick-edit .new-page-titles li:nth-child(even),.nestedpages .new-child .new-page-titles li:nth-child(even){background-color:#f0f0f0;}.nestedpages .quick-edit .new-page-titles li label,.nestedpages .new-child .new-page-titles li label{margin-top:7px;}.nestedpages .quick-edit .new-page-titles .form-control,.nestedpages .new-child .new-page-titles .form-control{float:right;width:90%;clear:none;}.nestedpages .quick-edit .new-page-titles .np-icon-menu,.nestedpages .new-child .new-page-titles .np-icon-menu{float:left;margin-top:0px;height:auto;line-height:26px;}.nestedpages .quick-edit .new-page-titles .new-child-row div,.nestedpages .new-child .new-page-titles .new-child-row div{float:right;width:75%;margin:2px;zoom:1;}.nestedpages .quick-edit .new-page-titles .new-child-row div:before,.nestedpages .quick-edit .new-page-titles .new-child-row div:after,.nestedpages .new-child .new-page-titles .new-child-row div:before,.nestedpages .new-child .new-page-titles .new-child-row div:after{content:" ";display:table;}.nestedpages .quick-edit .new-page-titles .new-child-row div:after,.nestedpages .new-child .new-page-titles .new-child-row div:after{clear:both;}.nestedpages .quick-edit .new-page-titles .new-child-row div input[type='text'],.nestedpages .new-child .new-page-titles .new-child-row div input[type='text']{float:left;width:80%;}.nestedpages .quick-edit .new-page-titles .new-child-row div a,.nestedpages .new-child .new-page-titles .new-child-row div a{float:right;}.np-modal.nestedpages .new-child .right .form-control input[type='text'],.np-modal.nestedpages .new-child .right .form-control input[type='password'],.np-modal.nestedpages .new-child .right .form-control select{float:none;width:100%;}.np-modal.nestedpages .new-child .right .form-control label{float:none;width:100%;}.np-modal.nestedpages .new-child .new-page-titles .form-control{width:85%;}.np-modal.nestedpages .new-child .new-page-titles .form-control div{width:100%;}.np-modal.nestedpages .new-child .left label{display:none;}.np-qe-loading{display:none;float:right;width:25px;height:25px;margin:2px 10px 0 0;background:url('../images/loading-white.gif') no-repeat;}@media (max-width: 767px){.nestedpages .quick-edit .fields{background:transparent;}.nestedpages .quick-edit .left,.nestedpages .quick-edit .right{float:none;width:100%;}.nestedpages .quick-edit .form-control{margin-bottom:10px;}.nestedpages .quick-edit .form-control input[type='text'],.nestedpages .quick-edit .form-control input[type='password'],.nestedpages .quick-edit .form-control select{float:none;width:100%;}.nestedpages .quick-edit .form-control label{display:block;float:none;width:100%;margin-bottom:4px;}.nestedpages .quick-edit .comments{float:none;width:100%;}.nestedpages .quick-edit .dates{float:none;width:100%;margin-bottom:6px;}}.np-modal-form .form-interior{zoom:1;background:url('../images/border.png') repeat-y;background-position:center;padding:5px 0;}.np-modal-form .form-interior:before,.np-modal-form .form-interior:after{content:" ";display:table;}.np-modal-form .form-interior:after{clear:both;}.np-modal-form .form-control{zoom:1;margin-bottom:10px;}.np-modal-form .form-control:before,.np-modal-form .form-control:after{content:" ";display:table;}.np-modal-form .form-control:after{clear:both;}.np-modal-form .checkbox{margin-bottom:10px;}.np-modal-form .left{float:left;width:45%;}.np-modal-form .right{float:right;width:45%;padding-top:18px;}.np-modal-form label{display:block;}.np-modal-form input[type="text"],.np-modal-form select{width:100%;}.np-modal-form .buttons{clear:both;}.nestedpages-settings-table{border:1px solid #d9d9d9;border-collapse:collapse;}.nestedpages-settings-table thead th{background-color:#d9d9d9;padding:5px;}.nestedpages-settings-table tbody tr td{padding:5px;border-left:1px solid #e0e0e0;}.nestedpages-settings-table tbody tr td:first-child{border:0;}.nestedpages-settings-table tbody tr:nth-child(odd) td{background-color:#ffffff;}.nestedpages-settings-table i{font-size:20px;}
assets/js/lib/nestedpages.js CHANGED
@@ -123,6 +123,15 @@ jQuery(function($){
123
  });
124
  }
125
 
 
 
 
 
 
 
 
 
 
126
  /**
127
  * Toggle between showing published pages and all
128
  */
@@ -176,11 +185,11 @@ jQuery(function($){
176
  */
177
  $(document).ready(function(){
178
  $('.sortable').not('.no-sort').nestedSortable({
179
- items : 'li',
180
  toleranceElement: '> .row',
181
  handle: '.handle',
182
  placeholder: "ui-sortable-placeholder",
183
- maxLevels: 0,
184
  start: function(e, ui){
185
  ui.placeholder.height(ui.item.height());
186
  },
@@ -197,21 +206,35 @@ jQuery(function($){
197
  );
198
  submit_sortable_form();
199
  },
200
- update: function(e, ui){
201
- }
202
  });
203
  });
204
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
205
  /**
206
  * Update the width of the placeholder
207
  */
208
  function update_placeholder_width(ui)
209
  {
210
- var parentCount = $(ui.placeholder).parents('ol').length;
211
- var listWidth = $('.sortable').width();
212
- var offset = ( parentCount * 40 ) - 40;
213
- var newWidth = listWidth - offset;
214
- $(ui.placeholder).width(newWidth).css('margin-left', offset + 'px');
 
 
215
  update_list_visibility(ui);
216
  }
217
 
@@ -266,6 +289,7 @@ jQuery(function($){
266
  action : 'npsort',
267
  nonce : nestedpages.np_nonce,
268
  list : list,
 
269
  syncmenu : syncmenu
270
  },
271
  success: function(data){
@@ -313,6 +337,7 @@ jQuery(function($){
313
  data: {
314
  action : 'npsyncMenu',
315
  nonce : nestedpages.np_nonce,
 
316
  syncmenu : setting
317
  },
318
  success: function(data){
@@ -330,7 +355,7 @@ jQuery(function($){
330
 
331
  /**
332
  * ------------------------------------------------------------------------
333
- * Quick Edit - Pages
334
  * ------------------------------------------------------------------------
335
  **/
336
 
@@ -446,12 +471,11 @@ jQuery(function($){
446
  */
447
  function populate_quick_edit(form, data)
448
  {
449
- $(form).find('.page_id').html('<em>Page ID:</em> ' + data.id);
450
  $(form).find('.np_id').val(data.id);
451
  $(form).find('.np_title').val(data.title);
452
  $(form).find('.np_slug').val(data.slug);
453
  $(form).find('.np_author select').val(data.author);
454
- $(form).find('.np_template').val(data.template);
455
  $(form).find('.np_status').val(data.status);
456
  $(form).find('.np_nav_title').val(data.navtitle);
457
  $(form).find('.np_title_attribute').val(data.navtitleattr);
@@ -459,6 +483,12 @@ jQuery(function($){
459
  $(form).find('.post_password').val(data.password);
460
  if ( data.cs === 'open' ) $(form).find('.np_cs').prop('checked', 'checked');
461
 
 
 
 
 
 
 
462
  if ( data.status === 'private' ){
463
  $(form).find('.post_password').prop('readonly', true);
464
  $(form).find('.keep_private').prop('checked', true);
@@ -638,7 +668,7 @@ jQuery(function($){
638
  url: ajaxurl,
639
  type: 'post',
640
  datatype: 'json',
641
- data: $(form).serialize() + '&action=npquickEdit&nonce=' + nestedpages.np_nonce + '&syncmenu=' + syncmenu,
642
  success: function(data){
643
  if (data.status === 'error'){
644
  np_remove_qe_loading(form);
@@ -648,6 +678,9 @@ jQuery(function($){
648
  np_update_qe_data(form, data.post_data);
649
  np_qe_update_animate(form);
650
  }
 
 
 
651
  }
652
  });
653
  }
@@ -936,7 +969,7 @@ jQuery(function($){
936
  url: ajaxurl,
937
  type: 'post',
938
  datatype: 'json',
939
- data: $(form).serialize() + '&action=npquickEditLink&nonce=' + nestedpages.np_nonce + '&syncmenu=' + syncmenu,
940
  success: function(data){
941
  if (data.status === 'error'){
942
  np_remove_qe_loading(form);
@@ -1053,7 +1086,7 @@ jQuery(function($){
1053
  url: ajaxurl,
1054
  type: 'post',
1055
  datatype: 'json',
1056
- data: data + '&action=npnewLink&nonce=' + nestedpages.np_nonce + '&syncmenu=' + syncmenu,
1057
  success: function(data){
1058
  if (data.status === 'error'){
1059
  np_remove_link_loading();
@@ -1188,6 +1221,7 @@ jQuery(function($){
1188
  function np_sync_user_toggles()
1189
  {
1190
  var ids = np_get_visible_rows();
 
1191
  $.ajax({
1192
  url: ajaxurl,
1193
  type: 'post',
@@ -1195,7 +1229,8 @@ jQuery(function($){
1195
  data: {
1196
  action : 'npnestToggle',
1197
  nonce : nestedpages.np_nonce,
1198
- ids : ids
 
1199
  },
1200
  success: function(data){
1201
  if ( data.status !== 'success' ){
@@ -1222,13 +1257,22 @@ jQuery(function($){
1222
  {
1223
  $('.np-newchild-error').hide();
1224
  remove_quick_edit_overlay();
 
1225
  $('.sortable .new-child').remove();
1226
  $('.row').show();
1227
  }
1228
 
 
 
 
 
 
 
 
1229
  $(document).on('click', '.np-cancel-newchild', function(e){
1230
  e.preventDefault();
1231
  revert_new_child();
 
1232
  });
1233
 
1234
  /**
@@ -1239,6 +1283,19 @@ jQuery(function($){
1239
  populate_new_child($(this));
1240
  });
1241
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1242
 
1243
  /**
1244
  * Set the Form Data for adding new child & Show it
@@ -1250,9 +1307,9 @@ jQuery(function($){
1250
  // Append the form to the list item
1251
  if ( $(parent_li).children('ol').length > 0 ){
1252
  var child_ol = $(parent_li).children('ol');
1253
- var newform = $('.new-child-form').clone().insertBefore(child_ol);
1254
  } else {
1255
- var newform = $('.new-child-form').clone().appendTo(parent_li);
1256
  }
1257
 
1258
  var row = $(newform).siblings('.row').hide();
@@ -1280,7 +1337,7 @@ jQuery(function($){
1280
  */
1281
  function add_new_title_field(item)
1282
  {
1283
- var html = '<li><i class="handle np-icon-menu"></i><div class="form-control new-child-row"><label>' + nestedpages.title + '</label><div><input type="text" name="post_title[]" class="np_title" placeholder="' + nestedpages.page_title + '" value="" /><a href="#" class="button-secondary np-remove-child">-</a></div></div></li>';
1284
  var container = $(item).siblings('.new-page-titles').append(html);
1285
  // Make sortable
1286
  $('.new-page-titles').sortable({
@@ -1297,11 +1354,13 @@ jQuery(function($){
1297
  {
1298
  var count = $(form).find($('.new-child-row')).length;
1299
  if ( count > 1 ){
 
1300
  $(form).find('h3 strong').text(nestedpages.add_child_pages);
1301
- $(form).find('.np-save-newchild').text(nestedpages.add_pages + ' (' + count + ')');
1302
  } else {
 
1303
  $(form).find('h3 strong').text(nestedpages.add_child);
1304
- $(form).find('.np-save-newchild').text(nestedpages.add_page);
1305
  }
1306
  }
1307
 
@@ -1316,6 +1375,14 @@ jQuery(function($){
1316
  });
1317
 
1318
 
 
 
 
 
 
 
 
 
1319
  /**
1320
  * Submit the new child page form
1321
  */
@@ -1324,14 +1391,15 @@ jQuery(function($){
1324
  $(this).prop('disabled', 'disabled');
1325
  var form = $(this).parents('form');
1326
  $(form).find('.np-qe-loading').show();
1327
- submit_new_child_form(form);
 
1328
  });
1329
 
1330
 
1331
  /**
1332
  * Process New Child Form
1333
  */
1334
- function submit_new_child_form(form)
1335
  {
1336
  $('.np-quickedit-error').hide();
1337
  var syncmenu = ( $('.np-sync-menu').is(':checked') ) ? 'sync' : 'nosync';
@@ -1339,14 +1407,21 @@ jQuery(function($){
1339
  url: ajaxurl,
1340
  type: 'post',
1341
  datatype: 'json',
1342
- data: $(form).serialize() + '&action=npnewChild&nonce=' + nestedpages.np_nonce + '&syncmenu=' + syncmenu,
1343
  success: function(data){
 
1344
  if (data.status === 'error'){
1345
  np_remove_qe_loading(form);
1346
  $(form).find('.np-quickedit-error').text(data.message).show();
1347
  } else {
1348
- np_remove_qe_loading(form);
1349
- add_new_child_pages(form, data);
 
 
 
 
 
 
1350
  }
1351
  },
1352
  error: function(){
@@ -1369,7 +1444,12 @@ jQuery(function($){
1369
  if ( $(parent_li).children('ol').length === 0 ){
1370
  $(parent_li).append('<ol class="nplist"></ol>');
1371
  }
1372
- var appendto = $(parent_li).children('ol');
 
 
 
 
 
1373
 
1374
  for (i = 0; i < pages.length; i++){
1375
  append_new_child_row(appendto, pages[i]);
@@ -1378,6 +1458,8 @@ jQuery(function($){
1378
  // Show the child page list and reset submenu toggles
1379
  $(appendto).show();
1380
  add_remove_submenu_toggles();
 
 
1381
  np_qe_update_animate(form);
1382
  }
1383
 
@@ -1390,8 +1472,14 @@ jQuery(function($){
1390
  var html = '<li id="menuItem_' + page.id + '" class="page-row';
1391
  if ( page.status === 'publish' ) html += ' published';
1392
  html += '">';
1393
- html += '<div class="row">';
1394
- html += '<div class="child-toggle"></div>';
 
 
 
 
 
 
1395
  html += '<div class="row-inner">';
1396
  html += '<i class="np-icon-sub-menu"></i><i class="handle np-icon-menu"></i>';
1397
  html += '<a href="' + page.edit_link + '" class="page-link page-title">';
@@ -1413,7 +1501,7 @@ jQuery(function($){
1413
  html += '<a href="#" class="np-btn add-new-child" data-id="' + page.id + '" data-parentname="' + page.title + '">' + nestedpages.add_child_short + '</a>';
1414
 
1415
  // Quick Edit (data attrs)
1416
- html += '<a href="#" class="np-btn np-quick-edit" data-id="' + page.id + '" data-template="' + page.template + '" data-title="' + page.title + '" data-slug="' + page.slug + '" data-commentstatus="closed" data-status="' + page.status.toLowerCase() + '" data-np-status="show" data-navstatus="show" data-author="' + page.author + '" data-month="' + page.month + '" data-day="' + page.day + '" data-year="' + page.year + '" data-hour="' + page.hour + '" data-minute="' + page.minute + '">' + nestedpages.quick_edit + '</a>';
1417
 
1418
  html += '<a href="' + page.view_link + '" class="np-btn" target="_blank">' + nestedpages.view + '</a>';
1419
  html += '<a href="' + page.delete_link + '" class="np-btn np-btn-trash"><i class="np-icon-remove"></i></a>';
@@ -1422,7 +1510,92 @@ jQuery(function($){
1422
  html += '</div><!-- .row-inner --></div><!-- .row -->';
1423
  html += '</li>';
1424
 
1425
- $(appendto).append(html);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1426
  }
1427
 
1428
 
123
  });
124
  }
125
 
126
+ /**
127
+ * Get Post Type from List ID
128
+ */
129
+ function np_get_post_type()
130
+ {
131
+ var sortableID = $('.sortable').attr('id');
132
+ return sortableID.substring(3);
133
+ }
134
+
135
  /**
136
  * Toggle between showing published pages and all
137
  */
185
  */
186
  $(document).ready(function(){
187
  $('.sortable').not('.no-sort').nestedSortable({
188
+ items : '.page-row',
189
  toleranceElement: '> .row',
190
  handle: '.handle',
191
  placeholder: "ui-sortable-placeholder",
192
+ maxLevels: max_levels(np_get_post_type()),
193
  start: function(e, ui){
194
  ui.placeholder.height(ui.item.height());
195
  },
206
  );
207
  submit_sortable_form();
208
  },
 
 
209
  });
210
  });
211
 
212
+ /**
213
+ * Is Post Type Nestable?
214
+ */
215
+ function max_levels(post_type)
216
+ {
217
+ var levels = 1;
218
+ $.each(nestedpages.post_types, function(i, v){
219
+ if ( v.name === post_type ){
220
+ if ( v.hierarchical === true ) levels = 0;
221
+ }
222
+ });
223
+ return levels;
224
+ }
225
+
226
  /**
227
  * Update the width of the placeholder
228
  */
229
  function update_placeholder_width(ui)
230
  {
231
+ if ( max_levels(np_get_post_type()) === 0 ){
232
+ var parentCount = $(ui.placeholder).parents('ol').length;
233
+ var listWidth = $('.sortable').width();
234
+ var offset = ( parentCount * 40 ) - 40;
235
+ var newWidth = listWidth - offset;
236
+ $(ui.placeholder).width(newWidth).css('margin-left', offset + 'px');
237
+ }
238
  update_list_visibility(ui);
239
  }
240
 
289
  action : 'npsort',
290
  nonce : nestedpages.np_nonce,
291
  list : list,
292
+ post_type : np_get_post_type(),
293
  syncmenu : syncmenu
294
  },
295
  success: function(data){
337
  data: {
338
  action : 'npsyncMenu',
339
  nonce : nestedpages.np_nonce,
340
+ post_type : np_get_post_type(),
341
  syncmenu : setting
342
  },
343
  success: function(data){
355
 
356
  /**
357
  * ------------------------------------------------------------------------
358
+ * Quick Edit - Posts
359
  * ------------------------------------------------------------------------
360
  **/
361
 
471
  */
472
  function populate_quick_edit(form, data)
473
  {
474
+ $(form).find('.page_id').html('<em>ID:</em> ' + data.id);
475
  $(form).find('.np_id').val(data.id);
476
  $(form).find('.np_title').val(data.title);
477
  $(form).find('.np_slug').val(data.slug);
478
  $(form).find('.np_author select').val(data.author);
 
479
  $(form).find('.np_status').val(data.status);
480
  $(form).find('.np_nav_title').val(data.navtitle);
481
  $(form).find('.np_title_attribute').val(data.navtitleattr);
483
  $(form).find('.post_password').val(data.password);
484
  if ( data.cs === 'open' ) $(form).find('.np_cs').prop('checked', 'checked');
485
 
486
+ if ( data.template !== '' ){
487
+ $(form).find('.np_template').val(data.template);
488
+ } else {
489
+ $(form).find('.np_template').val('default');
490
+ }
491
+
492
  if ( data.status === 'private' ){
493
  $(form).find('.post_password').prop('readonly', true);
494
  $(form).find('.keep_private').prop('checked', true);
668
  url: ajaxurl,
669
  type: 'post',
670
  datatype: 'json',
671
+ data: $(form).serialize() + '&action=npquickEdit&nonce=' + nestedpages.np_nonce + '&syncmenu=' + syncmenu + '&post_type=' + np_get_post_type(),
672
  success: function(data){
673
  if (data.status === 'error'){
674
  np_remove_qe_loading(form);
678
  np_update_qe_data(form, data.post_data);
679
  np_qe_update_animate(form);
680
  }
681
+ },
682
+ error: function(data){
683
+ console.log(data);
684
  }
685
  });
686
  }
969
  url: ajaxurl,
970
  type: 'post',
971
  datatype: 'json',
972
+ data: $(form).serialize() + '&action=npquickEditLink&nonce=' + nestedpages.np_nonce + '&syncmenu=' + syncmenu + '&post_type=' + np_get_post_type(),
973
  success: function(data){
974
  if (data.status === 'error'){
975
  np_remove_qe_loading(form);
1086
  url: ajaxurl,
1087
  type: 'post',
1088
  datatype: 'json',
1089
+ data: data + '&action=npnewLink&nonce=' + nestedpages.np_nonce + '&syncmenu=' + syncmenu + '&post_type=' + np_get_post_type(),
1090
  success: function(data){
1091
  if (data.status === 'error'){
1092
  np_remove_link_loading();
1221
  function np_sync_user_toggles()
1222
  {
1223
  var ids = np_get_visible_rows();
1224
+ var posttype = np_get_post_type();
1225
  $.ajax({
1226
  url: ajaxurl,
1227
  type: 'post',
1229
  data: {
1230
  action : 'npnestToggle',
1231
  nonce : nestedpages.np_nonce,
1232
+ ids : ids,
1233
+ posttype : posttype
1234
  },
1235
  success: function(data){
1236
  if ( data.status !== 'success' ){
1257
  {
1258
  $('.np-newchild-error').hide();
1259
  remove_quick_edit_overlay();
1260
+ $('#np-bulk-modal .modal-body').empty();
1261
  $('.sortable .new-child').remove();
1262
  $('.row').show();
1263
  }
1264
 
1265
+ /**
1266
+ * Reset the bulk modal on close
1267
+ */
1268
+ $('#np-bulk-modal').on('hide.bs.modal', function(){
1269
+ revert_new_child();
1270
+ });
1271
+
1272
  $(document).on('click', '.np-cancel-newchild', function(e){
1273
  e.preventDefault();
1274
  revert_new_child();
1275
+ $('#np-bulk-modal').modal('hide');
1276
  });
1277
 
1278
  /**
1283
  populate_new_child($(this));
1284
  });
1285
 
1286
+ /**
1287
+ * Show the Add Bulk Modal Form
1288
+ */
1289
+ $(document).on('click', '.open-bulk-modal', function(e){
1290
+ e.preventDefault();
1291
+ var newform = $('.new-child-form').clone().find('.np-new-child-form').addClass('in-modal');
1292
+ $('#np-bulk-modal .modal-body').html(newform);
1293
+ $('#np-bulk-modal .new-child-form').show();
1294
+ $('#np-bulk-modal').find('h3').text(nestedpages.add_multiple);
1295
+ $('#np-bulk-modal').find('.page_parent_id').val('0');
1296
+ $('#np-bulk-modal').modal('show');
1297
+ });
1298
+
1299
 
1300
  /**
1301
  * Set the Form Data for adding new child & Show it
1307
  // Append the form to the list item
1308
  if ( $(parent_li).children('ol').length > 0 ){
1309
  var child_ol = $(parent_li).children('ol');
1310
+ var newform = $('.new-child-form').not('.np-modal .new-child-form').clone().insertBefore(child_ol);
1311
  } else {
1312
+ var newform = $('.new-child-form').not('.np-modal .new-child-form').clone().appendTo(parent_li);
1313
  }
1314
 
1315
  var row = $(newform).siblings('.row').hide();
1337
  */
1338
  function add_new_title_field(item)
1339
  {
1340
+ var html = '<li><i class="handle np-icon-menu"></i><div class="form-control new-child-row"><label>' + nestedpages.title + '</label><div><input type="text" name="post_title[]" class="np_title" placeholder="' + nestedpages.title + '" value="" /><a href="#" class="button-secondary np-remove-child">-</a></div></div></li>';
1341
  var container = $(item).siblings('.new-page-titles').append(html);
1342
  // Make sortable
1343
  $('.new-page-titles').sortable({
1354
  {
1355
  var count = $(form).find($('.new-child-row')).length;
1356
  if ( count > 1 ){
1357
+ $(form).find('.add-edit').hide();
1358
  $(form).find('h3 strong').text(nestedpages.add_child_pages);
1359
+ $(form).find('.np-save-newchild').text(nestedpages.add + ' (' + count + ')');
1360
  } else {
1361
+ $(form).find('.add-edit').show();
1362
  $(form).find('h3 strong').text(nestedpages.add_child);
1363
+ $(form).find('.np-save-newchild').text(nestedpages.add);
1364
  }
1365
  }
1366
 
1375
  });
1376
 
1377
 
1378
+ /**
1379
+ * Prevent New Child Page form Submission
1380
+ */
1381
+ $(document).on('submit', '.np-new-child-form', function(e){
1382
+ e.preventDefault();
1383
+ });
1384
+
1385
+
1386
  /**
1387
  * Submit the new child page form
1388
  */
1391
  $(this).prop('disabled', 'disabled');
1392
  var form = $(this).parents('form');
1393
  $(form).find('.np-qe-loading').show();
1394
+ var addedit = ( $(this).hasClass('add-edit') ) ? true : false;
1395
+ submit_new_child_form(form, addedit);
1396
  });
1397
 
1398
 
1399
  /**
1400
  * Process New Child Form
1401
  */
1402
+ function submit_new_child_form(form, addedit)
1403
  {
1404
  $('.np-quickedit-error').hide();
1405
  var syncmenu = ( $('.np-sync-menu').is(':checked') ) ? 'sync' : 'nosync';
1407
  url: ajaxurl,
1408
  type: 'post',
1409
  datatype: 'json',
1410
+ data: $(form).serialize() + '&action=npnewChild&nonce=' + nestedpages.np_nonce + '&syncmenu=' + syncmenu + '&post_type=' + np_get_post_type(),
1411
  success: function(data){
1412
+ console.log(data);
1413
  if (data.status === 'error'){
1414
  np_remove_qe_loading(form);
1415
  $(form).find('.np-quickedit-error').text(data.message).show();
1416
  } else {
1417
+ if ( addedit === true ){ // Redirect to Edit Screen
1418
+ var link = data.new_pages[0].edit_link;
1419
+ link = link.replace(/&amp;/g, '&');
1420
+ window.location.replace(link);
1421
+ } else {
1422
+ np_remove_qe_loading(form);
1423
+ add_new_child_pages(form, data);
1424
+ }
1425
  }
1426
  },
1427
  error: function(){
1444
  if ( $(parent_li).children('ol').length === 0 ){
1445
  $(parent_li).append('<ol class="nplist"></ol>');
1446
  }
1447
+
1448
+ if ( $(form).hasClass('in-modal') ){
1449
+ var appendto = $('.nplist.sortable li.page-row:first');
1450
+ } else {
1451
+ var appendto = $(parent_li).children('ol');
1452
+ }
1453
 
1454
  for (i = 0; i < pages.length; i++){
1455
  append_new_child_row(appendto, pages[i]);
1458
  // Show the child page list and reset submenu toggles
1459
  $(appendto).show();
1460
  add_remove_submenu_toggles();
1461
+ revert_new_child();
1462
+ $('#np-bulk-modal').modal('hide');
1463
  np_qe_update_animate(form);
1464
  }
1465
 
1472
  var html = '<li id="menuItem_' + page.id + '" class="page-row';
1473
  if ( page.status === 'publish' ) html += ' published';
1474
  html += '">';
1475
+
1476
+ if ( max_levels(np_get_post_type()) === 0 ){
1477
+ html += '<div class="row">';
1478
+ html += '<div class="child-toggle"></div>';
1479
+ } else {
1480
+ html += '<div class="row non-hierarchical">';
1481
+ }
1482
+
1483
  html += '<div class="row-inner">';
1484
  html += '<i class="np-icon-sub-menu"></i><i class="handle np-icon-menu"></i>';
1485
  html += '<a href="' + page.edit_link + '" class="page-link page-title">';
1501
  html += '<a href="#" class="np-btn add-new-child" data-id="' + page.id + '" data-parentname="' + page.title + '">' + nestedpages.add_child_short + '</a>';
1502
 
1503
  // Quick Edit (data attrs)
1504
+ html += '<a href="#" class="np-btn np-quick-edit" data-id="' + page.id + '" data-template="' + page.page_template + '" data-title="' + page.title + '" data-slug="' + page.slug + '" data-commentstatus="closed" data-status="' + page.status.toLowerCase() + '" data-np-status="show" data-navstatus="show" data-author="' + page.author + '" data-template="' + page.template + '" data-month="' + page.month + '" data-day="' + page.day + '" data-year="' + page.year + '" data-hour="' + page.hour + '" data-minute="' + page.minute + '">' + nestedpages.quick_edit + '</a>';
1505
 
1506
  html += '<a href="' + page.view_link + '" class="np-btn" target="_blank">' + nestedpages.view + '</a>';
1507
  html += '<a href="' + page.delete_link + '" class="np-btn np-btn-trash"><i class="np-icon-remove"></i></a>';
1510
  html += '</div><!-- .row-inner --></div><!-- .row -->';
1511
  html += '</li>';
1512
 
1513
+ $(appendto).after(html);
1514
+ }
1515
+
1516
+
1517
+
1518
+
1519
+
1520
+ /**
1521
+ * ------------------------------------------------------------------------
1522
+ * Empty Trash
1523
+ * ------------------------------------------------------------------------
1524
+ **/
1525
+ $('.np-empty-trash').on('click', function(e){
1526
+ e.preventDefault();
1527
+ $('#nested-loading').show();
1528
+ $('#np-error').hide();
1529
+ var posttype = $(this).attr('data-posttype');
1530
+ if (window.confirm(nestedpages.trash_confirm)){
1531
+ empty_trash(posttype);
1532
+ }
1533
+ });
1534
+
1535
+ /**
1536
+ * Empty the trash for a given post type
1537
+ */
1538
+ function empty_trash(posttype)
1539
+ {
1540
+ $.ajax({
1541
+ url: ajaxurl,
1542
+ type: 'post',
1543
+ datatype: 'json',
1544
+ data: {
1545
+ action : 'npEmptyTrash',
1546
+ nonce : nestedpages.np_nonce,
1547
+ posttype : posttype
1548
+ },
1549
+ success: function(data){
1550
+ console.log(data);
1551
+ $('#nested-loading').hide();
1552
+ if (data.status === 'error'){
1553
+ $('#np-error').text(data.message).show();
1554
+ } else {
1555
+ $('.np-trash-links').hide();
1556
+ }
1557
+ }
1558
+ });
1559
+ }
1560
+
1561
+
1562
+
1563
+
1564
+ /**
1565
+ * ------------------------------------------------------------------------
1566
+ * Search Filter (Non-Hierarchical)
1567
+ * ------------------------------------------------------------------------
1568
+ **/
1569
+ $(document).on('keyup', '#nestedpages-search', function(){
1570
+ var search = $(this).val().toLowerCase();
1571
+ if ( search.length > 2 ){
1572
+ search_filter_list(search);
1573
+ return;
1574
+ }
1575
+ reset_search_filter();
1576
+ });
1577
+
1578
+ /**
1579
+ * Filter the list based on search input
1580
+ */
1581
+ function search_filter_list(value)
1582
+ {
1583
+ var titles = $('.page-row .title');
1584
+ $('.page-row').hide();
1585
+ $.each(titles, function(i, v){
1586
+ var text = $(this).text().toLowerCase();
1587
+ if ( text.indexOf(value) > -1 ){
1588
+ $(this).parents('.page-row').show();
1589
+ }
1590
+ });
1591
+ }
1592
+
1593
+ /**
1594
+ * Reset the list back to show all
1595
+ */
1596
+ function reset_search_filter()
1597
+ {
1598
+ $('.page-row').show();
1599
  }
1600
 
1601
 
assets/js/nestedpages.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(function(t){function a(){var a=t(".nplist");t(".page-row").removeClass("no-border"),t.each(a,function(){t(this).find(".page-row:visible:first").addClass("no-border")})}function e(){var a=t(".nestedpages").find(".nplist");t.each(a,function(){var a=t(this).parents(".nplist").length,e=56;if(a>0){var e=20*a+e;t(this).find(".row-inner").css("padding-left",e+"px")}else t(this).find(".row-inner").css("padding-left","0px")})}function n(a){var e=t(a.placeholder).parents("ol").length,n=t(".sortable").width(),i=40*e-40,o=n-i;t(a.placeholder).width(o).css("margin-left",i+"px"),s(a)}function s(a){var e=t(a.placeholder).parent("ol");t(e).is(":visible")||(t(e).addClass("nplist"),t(e).show())}function o(){t(".child-toggle").each(function(){var a=t(this).parent(".row").parent("li");if(t(a).children("ol").length>0){var e=t(a).children("ol:visible").length>0?"np-icon-arrow-down":"np-icon-arrow-right";t(this).html('<a href="#"><i class="'+e+'"></i></a>')}else t(this).empty()})}function d(){t("#np-error").hide(),t("#nested-loading").show();var a=t(".np-sync-menu").is(":checked")?"sync":"nosync";list=t("ol.sortable").nestedSortable("toHierarchy",{startDepthCount:0}),t.ajax({url:ajaxurl,type:"post",datatype:"json",data:{action:"npsort",nonce:nestedpages.np_nonce,list:list,syncmenu:a},success:function(a){"error"===a.status?(t("#np-error").text(a.message).show(),t("#nested-loading").hide()):t("#nested-loading").hide()}})}function r(a){t.ajax({url:ajaxurl,type:"post",datatype:"json",data:{action:"npsyncMenu",nonce:nestedpages.np_nonce,syncmenu:a},success:function(t){"error"===t.status&&alert("There was an error saving the sync setting.")}})}function l(a){var e={id:t(a).attr("data-id"),title:t(a).attr("data-title"),slug:t(a).attr("data-slug"),author:t(a).attr("data-author"),cs:t(a).attr("data-commentstatus"),status:t(a).attr("data-status"),template:t(a).attr("data-template"),month:t(a).attr("data-month"),day:t(a).attr("data-day"),year:t(a).attr("data-year"),hour:t(a).attr("data-hour"),minute:t(a).attr("data-minute"),navstatus:t(a).attr("data-navstatus"),npstatus:t(a).attr("data-np-status"),navtitle:t(a).attr("data-navtitle"),navtitleattr:t(a).attr("data-navtitleattr"),navcss:t(a).attr("data-navcss"),linktarget:t(a).attr("data-linktarget"),password:t(a).attr("data-password")},n=t(a).closest(".row").parent("li");e.h_taxonomies=[],e.f_taxonomies=[];var s=t(n).attr("class").split(/\s+/);for(i=0;i<s.length;i++)"in-"===s[i].substring(0,3)&&e.h_taxonomies.push(s[i]),"inf-"===s[i].substring(0,4)&&e.f_taxonomies.push(s[i]);if(t(n).children("ol").length>0)var o=t(n).children("ol"),d=t(".quick-edit-form").clone().insertBefore(o);else var d=t(".quick-edit-form").clone().appendTo(n);t(d).siblings(".row").hide();c(d,e)}function c(a,e){if(t(a).find(".page_id").html("<em>Page ID:</em> "+e.id),t(a).find(".np_id").val(e.id),t(a).find(".np_title").val(e.title),t(a).find(".np_slug").val(e.slug),t(a).find(".np_author select").val(e.author),t(a).find(".np_template").val(e.template),t(a).find(".np_status").val(e.status),t(a).find(".np_nav_title").val(e.navtitle),t(a).find(".np_title_attribute").val(e.navtitleattr),t(a).find(".np_nav_css_classes").val(e.navcss),t(a).find(".post_password").val(e.password),"open"===e.cs&&t(a).find(".np_cs").prop("checked","checked"),"private"===e.status&&(t(a).find(".post_password").prop("readonly",!0),t(a).find(".keep_private").prop("checked",!0)),"hide"===e.npstatus?t(a).find(".np_status").prop("checked","checked"):t(a).find(".np_status").removeAttr("checked"),"hide"===e.navstatus?t(a).find(".np_nav_status").prop("checked","checked"):t(a).find(".np_nav_status").removeAttr("checked"),"_blank"===e.linktarget?t(a).find(".link_target").prop("checked","checked"):t(a).find(".link_target").removeAttr("checked"),"private"===e.status&&t(a).find(".np_status").val("publish"),t(a).find('select[name="mm"]').val(e.month),t(a).find('input[name="jj"]').val(e.day),t(a).find('input[name="aa"]').val(e.year),t(a).find('input[name="hh"]').val(e.hour),t(a).find('input[name="mn"]').val(e.minute),e.hasOwnProperty("h_taxonomies")){var n=e.h_taxonomies;for(i=0;i<n.length;i++){var s="#"+n[i];t(a).find(s).prop("checked","checked")}}m(),t(a).show(),e.hasOwnProperty("f_taxonomies")&&(p(e.f_taxonomies),v(a))}function p(t){var a={};for(i=0;i<t.length;i++){var e=t[i].split("-"),n=e.indexOf("nps"),s=e.splice(n+1);s=s.join("-");var o=t[i].split("-").splice(0,n);o.shift("inf");var d=o.join("-");d in a||(a[d]=[]);var r=a[d];r.push(s)}u(a)}function u(a){t.ajax({url:ajaxurl,type:"post",datatype:"json",data:{action:"npgetTaxonomies",nonce:nestedpages.np_nonce,terms:a},success:function(t){h(t.terms)}})}function h(a){a&&t.each(a,function(a,e){var n=t("#"+a);t(n).val(e.join(","))})}function v(a){var e=t(a).find("[data-autotag]");t.each(e,function(){var a=t(this).attr("data-taxonomy");t(this).suggest(ajaxurl+"?action=ajax-tag-search&tax="+a,{multiple:!0,multipleSep:","})})}function f(){t(".np-quickedit-error").hide(),g(),t(".sortable .quick-edit").remove(),t(".row").show()}function m(){t("body").append('<div class="np-inline-overlay"></div>'),setTimeout(function(){t(".np-inline-overlay").addClass("active")},50)}function g(){t(".np-inline-overlay").removeClass("active").remove()}function _(a){t(".np-quickedit-error").hide();var e=t(".np-sync-menu").is(":checked")?"sync":"nosync";t.ajax({url:ajaxurl,type:"post",datatype:"json",data:t(a).serialize()+"&action=npquickEdit&nonce="+nestedpages.np_nonce+"&syncmenu="+e,success:function(e){"error"===e.status?(C(a),t(a).find(".np-quickedit-error").text(e.message).show()):(C(a),k(a,e.post_data),q(a))}})}function k(a,e){var n=t(a).parent(".quick-edit").siblings(".row");t(n).find(".title").text(e.post_title);var i=t(n).find(".status");if(t(i).text("publish"!==e._status&&"future"!==e._status?"("+e._status+")":"private"===e.keep_private?"("+e.keep_private+")":""),""!==e.post_password){var s=t(i).text();s+=' <i class="np-icon-lock"></i>',t(i).html(s)}var o=t(n).find(".nav-status");t(o).text("hide"==e.nav_status?"(Hidden)":"");var d=t(n).parent("li");"hide"==e.np_status?(t(d).addClass("np-hide"),t(n).find(".status").after('<i class="np-icon-eye-blocked"></i>')):(t(d).removeClass("np-hide"),t(n).find(".np-icon-eye-blocked").remove());var r=t(n).find(".np-quick-edit");t(r).attr("data-id",e.post_id),t(r).attr("data-template",e.page_template),t(r).attr("data-title",e.post_title),t(r).attr("data-slug",e.post_name),t(r).attr("data-commentstatus",e.comment_status),t(r).attr("data-status",e._status),"private"===e.keep_private&&t(r).attr("data-status","private"),t(r).attr("data-author",e.post_author),t(r).attr("data-np-status",e.np_status),t(r).attr("data-password",e.post_password),t(r).attr("data-navstatus",e.nav_status),t(r).attr("data-navtitle",e.np_nav_title),t(r).attr("data-linktarget",e.link_target),t(r).attr("data-navtitleattr",e.np_title_attribute),t(r).attr("data-navcss",e.np_nav_css_classes),t(r).attr("data-month",e.mm),t(r).attr("data-day",e.jj),t(r).attr("data-year",e.aa),t(r).attr("data-hour",e.hh),t(r).attr("data-minute",e.mn),w(d),b(d,e),y(d,e),x(d,e)}function w(a){taxonomies=[];var e=t(a).attr("class").split(/\s+/);for(i=0;i<e.length;i++)"in-"===e[i].substring(0,3)&&t(a).removeClass(e[i]),"inf-"===e[i].substring(0,4)&&t(a).removeClass(e[i])}function b(a,e){if(e.hasOwnProperty("post_category")){var n=e.post_category;for(i=0;i<n.length;i++){var s="in-category-"+n[i];t(a).addClass(s)}}}function y(a,e){if(e.hasOwnProperty("tax_input")){var n=e.tax_input;t.each(n,function(e,n){for(i=0;i<n.length;i++){var s="in-"+e+"-"+n[i];t(a).addClass(s)}})}}function x(a,e){if(e.hasOwnProperty("flat_tax")){var n=e.flat_tax;t.each(n,function(e,n){for(i=0;i<n.length;i++){var s="inf-"+e+"-nps-"+n[i];t(a).addClass(s)}})}}function C(a){t(a).find(".np-save-quickedit, .np-save-quickedit-redirect, .np-save-newchild").removeAttr("disabled"),t(a).find(".np-qe-loading").hide()}function q(e){var n=t(e).parent(".quick-edit, .new-child").siblings(".row");t(n).addClass("np-updated"),t(n).show(),t(e).parent(".quick-edit, .new-child").remove(),g(),a(),setTimeout(function(){t(n).addClass("np-updated-show")},1500)}function j(a){var e={id:t(a).attr("data-id"),url:t(a).attr("data-url"),title:t(a).attr("data-title"),status:t(a).attr("data-status"),navstatus:t(a).attr("data-navstatus"),npstatus:t(a).attr("data-np-status"),linktarget:t(a).attr("data-linktarget"),parentid:t(a).attr("data-parentid"),navtitleattr:t(a).attr("data-navtitleattr"),navcss:t(a).attr("data-navcss")},n=t(a).closest(".row").parent("li");if(t(n).children("ol").length>0)var i=t(n).children("ol"),s=t(".quick-edit-form-redirect").clone().insertBefore(i);else var s=t(".quick-edit-form-redirect").clone().appendTo(n);t(s).siblings(".row").hide();t(s).show(),D(s,e)}function D(a,e){t(a).find(".np_id").val(e.id),t(a).find(".np_title").val(e.title),t(a).find(".np_author select").val(e.author),t(a).find(".np_status").val(e.status),t(a).find(".np_content").val(e.url),t(a).find(".np_parent_id").val(e.parentid),t(a).find(".np_title_attribute").val(e.navtitleattr),t(a).find(".np_nav_css_classes").val(e.navcss),"hide"===e.npstatus?t(a).find(".np_status").prop("checked","checked"):t(a).find(".np_status").removeAttr("checked"),"hide"===e.navstatus?t(a).find(".np_nav_status").prop("checked","checked"):t(a).find(".np_nav_status").removeAttr("checked"),"_blank"===e.linktarget?t(a).find(".link_target").prop("checked","checked"):t(a).find(".link_target").removeAttr("checked"),m(),t(a).show()}function T(a){t(".np-quickedit-error").hide();var e=t(".np-sync-menu").is(":checked")?"sync":"nosync";t.ajax({url:ajaxurl,type:"post",datatype:"json",data:t(a).serialize()+"&action=npquickEditLink&nonce="+nestedpages.np_nonce+"&syncmenu="+e,success:function(e){"error"===e.status?(C(a),t(a).find(".np-quickedit-error").text(e.message).show()):(C(a),A(a,e.post_data),q(a))},error:function(){C(a),t(a).find(".np-quickedit-error").text("The form could not be saved at this time.").show()}})}function A(a,e){var n=t(a).parent(".quick-edit").siblings(".row");t(n).find(".title").html(e.post_title+' <i class="np-icon-link"></i>');var i=t(n).find(".status");t(i).text("publish"!==e._status&&"future"!==e._status?"("+e._status+")":"");var s=t(n).find(".nav-status");t(s).text("hide"==e.nav_status?"(Hidden)":"");var o=t(n).parent("li");"hide"==e.np_status?(t(o).addClass("np-hide"),t(n).find(".status").after('<i class="np-icon-eye-blocked"></i>')):(t(o).removeClass("np-hide"),t(n).find(".np-icon-eye-blocked").remove());var d=t(n).find(".np-quick-edit-redirect");t(d).attr("data-id",e.post_id),t(d).attr("data-title",e.post_title),t(d).attr("data-url",e.post_content),t(d).attr("data-status",e._status),t(d).attr("data-navstatus",e.nav_status),t(d).attr("data-np-status",e.np_status),t(d).attr("data-linktarget",e.link_target),t(d).attr("data-navtitleattr",e.np_title_attribute),t(d).attr("data-navcss",e.np_nav_css_classes)}function P(){t(".np-link-loading").hide(),t(".np-save-link").removeAttr("disabled")}function I(){t(".np-new-link-error").hide();var a=t(".np-new-link-form").serialize(),e=t(".np-sync-menu").is(":checked")?"sync":"nosync";t.ajax({url:ajaxurl,type:"post",datatype:"json",data:a+"&action=npnewLink&nonce="+nestedpages.np_nonce+"&syncmenu="+e,success:function(a){"error"===a.status?(P(),t(".np-new-link-error").text(a.message).show()):(P(),O(a.post_data))}})}function O(a){var e='<li id="menuItem_'+a.id+'" class="page-row';"publish"===a._status&&(e+=" published"),e+='">',e+='<div class="row"><div class="child-toggle"></div><div class="row-inner"><i class="np-icon-sub-menu"></i><i class="handle np-icon-menu"></i><a href="'+a.np_link_content+'" class="page-link page-title" target="_blank"><span class="title">'+a.np_link_title+' <i class="np-icon-link"></i></span>',e+="publish"!==a._status?'<span class="status">'+a._status+"</span>":'<span class="status"></span>',"hide"===a.np_status&&(e+='<i class="np-icon-eye-blocked"></i>'),e+="hide"===a.nav_status?'<span class="nav-status">(Hidden)</span>':'<span class="nav-status"></span>',e+='</a><a href="#" class="np-toggle-edit"><i class="np-icon-pencil"></i></a><div class="action-buttons"><a href="#" class="np-btn np-quick-edit-redirect" ',e+='data-id="'+a.id+'"',e+='data-parentid="'+a.parent_id+'"',e+='data-title="'+a.np_link_title+'" ',e+='data-url="'+a.np_link_content+'" ',e+='data-status="'+a._status+'" ',e+='data-np-status="'+a.np_status+'" ',e+='data-navstatus="'+a.nav_status+'" ',e+='data-linktarget="'+a.link_target+'">',e+="Quick Edit</a>",e+='<a href="'+a.delete_link+'" class="np-btn np-btn-trash"><i class="np-icon-remove"></i></a>',e+="</div></div></div></li>","0"===a.parent_id?t(".nplist:first li:first").after(e):z(e,a),t("#np-link-modal").modal("hide");var n=t("#menuItem_"+a.id).find(".row");E(n)}function z(a,e){var n=t("#menuItem_"+e.parent_id);0===t(n).children("ol").length?(a='<ol class="sortable nplist" style="display:block;">'+a+"</ol>",t(n).append(a)):t(n).find("ol:first").prepend(a),o(),L()}function E(e){t(e).addClass("np-updated"),a(),setTimeout(function(){t(e).addClass("np-updated-show")},1500)}function H(){var a=[],e=t(".page-row:visible");return t.each(e,function(){var e=t(this).attr("id");a.push(e.replace("menuItem_",""))}),a}function L(){var a=H();t.ajax({url:ajaxurl,type:"post",datatype:"json",data:{action:"npnestToggle",nonce:nestedpages.np_nonce,ids:a},success:function(t){"success"!==t.status&&console.log("There was an error saving toggled pages.")}})}function B(){t(".np-newchild-error").hide(),g(),t(".sortable .new-child").remove(),t(".row").show()}function S(a){var e=t(a).closest(".row").parent("li");if(t(e).children("ol").length>0)var n=t(e).children("ol"),i=t(".new-child-form").clone().insertBefore(n);else var i=t(".new-child-form").clone().appendTo(e);t(i).siblings(".row").hide();m(),t(i).find(".parent_name").html("<em>Parent:</em> "+t(a).attr("data-parentname")),t(i).find(".page_parent_id").val(t(a).attr("data-id")),t(i).show()}function Q(a){{var e='<li><i class="handle np-icon-menu"></i><div class="form-control new-child-row"><label>'+nestedpages.title+'</label><div><input type="text" name="post_title[]" class="np_title" placeholder="'+nestedpages.page_title+'" value="" /><a href="#" class="button-secondary np-remove-child">-</a></div></div></li>';t(a).siblings(".new-page-titles").append(e)}t(".new-page-titles").sortable({items:"li",handle:".handle"})}function M(a){var e=t(a).find(t(".new-child-row")).length;e>1?(t(a).find("h3 strong").text(nestedpages.add_child_pages),t(a).find(".np-save-newchild").text(nestedpages.add_pages+" ("+e+")")):(t(a).find("h3 strong").text(nestedpages.add_child),t(a).find(".np-save-newchild").text(nestedpages.add_page))}function F(a){t(".np-quickedit-error").hide();var e=t(".np-sync-menu").is(":checked")?"sync":"nosync";t.ajax({url:ajaxurl,type:"post",datatype:"json",data:t(a).serialize()+"&action=npnewChild&nonce="+nestedpages.np_nonce+"&syncmenu="+e,success:function(e){"error"===e.status?(C(a),t(a).find(".np-quickedit-error").text(e.message).show()):(C(a),G(a,e))},error:function(){C(a),t(a).find(".np-quickedit-error").text("The form could not be saved at this time.").show()}})}function G(a,e){var n=e.new_pages,s=t(a).parent(".new-child").parent(".page-row");0===t(s).children("ol").length&&t(s).append('<ol class="nplist"></ol>');var d=t(s).children("ol");for(i=0;i<n.length;i++)J(d,n[i]);t(d).show(),o(),q(a)}function J(a,e){var n='<li id="menuItem_'+e.id+'" class="page-row';"publish"===e.status&&(n+=" published"),n+='">',n+='<div class="row">',n+='<div class="child-toggle"></div>',n+='<div class="row-inner">',n+='<i class="np-icon-sub-menu"></i><i class="handle np-icon-menu"></i>',n+='<a href="'+e.edit_link+'" class="page-link page-title">',n+='<span class="title">'+e.title+"</span>",n+="Publish"!==e.status?'<span class="status">('+e.status+")</span>":'<span class="status"></span>',n+='<span class="nav-status"></span><span class="edit-indicator"><i class="np-icon-pencil"></i>Edit</span>',n+="</a>",n+='<div class="action-buttons">',n+='<a href="#" class="np-btn open-redirect-modal" data-parentid="'+e.id+'"><i class="np-icon-link"></i></a>',n+='<a href="#" class="np-btn add-new-child" data-id="'+e.id+'" data-parentname="'+e.title+'">'+nestedpages.add_child_short+"</a>",n+='<a href="#" class="np-btn np-quick-edit" data-id="'+e.id+'" data-template="'+e.template+'" data-title="'+e.title+'" data-slug="'+e.slug+'" data-commentstatus="closed" data-status="'+e.status.toLowerCase()+'" data-np-status="show" data-navstatus="show" data-author="'+e.author+'" data-month="'+e.month+'" data-day="'+e.day+'" data-year="'+e.year+'" data-hour="'+e.hour+'" data-minute="'+e.minute+'">'+nestedpages.quick_edit+"</a>",n+='<a href="'+e.view_link+'" class="np-btn" target="_blank">'+nestedpages.view+"</a>",n+='<a href="'+e.delete_link+'" class="np-btn np-btn-trash"><i class="np-icon-remove"></i></a>',n+="</div><!-- .action-buttons -->",n+="</div><!-- .row-inner --></div><!-- .row -->",n+="</li>",t(a).append(n)}t(document).ready(function(){o(),a(),e()}),t(document).on("click",".child-toggle a",function(n){n.preventDefault();var i=t(this).parent(".child-toggle").parent(".row").siblings("ol");t(this).find("i").toggleClass("np-icon-arrow-down").toggleClass("np-icon-arrow-right"),t(i).toggle(),a(),L(),e()}),t(document).on("click",".nestedpages-toggleall a",function(e){e.preventDefault(),"closed"==t(this).attr("data-toggle")?(t(".nestedpages ol li ol").show(),t(this).attr("data-toggle","opened"),t(this).text(nestedpages.collapse_text),t(".child-toggle i").removeClass("np-icon-arrow-right").addClass("np-icon-arrow-down"),f(),a()):(t(".nestedpages ol li ol").hide(),t(this).attr("data-toggle","closed"),t(this).text(nestedpages.expand_text),t(".child-toggle i").removeClass("np-icon-arrow-down").addClass("np-icon-arrow-right"),f(),a()),L()}),t(document).on("click",".np-toggle-hidden",function(e){e.preventDefault();var n=t(this).attr("href");"show"===n?(t(this).attr("href","hide"),t(this).text(nestedpages.show_hidden),t(".np-hide").removeClass("shown").hide(),a()):(t(this).attr("href","show"),t(this).text(nestedpages.hide_hidden),t(".np-hide").addClass("shown").show(),a())}),t(".np-tabs a").on("click",function(a){a.preventDefault(),t(".np-tabs a").removeClass("active"),t(this).addClass("active");var e=t(this).attr("href");t(".np-tabbed-content").hide(),t(e).show()}),t(document).on("click",".np-toggle-publish",function(a){a.preventDefault();var e=t(this).attr("href");t(".np-toggle-publish").removeClass("active"),t(this).addClass("active"),"#published"==e?(t(".nplist .page-row").hide(),t(".nplist .published").show()):t(".nplist .page-row").show()}),t(document).on("click",".np-toggle-edit",function(a){a.preventDefault();var e=t(this).siblings(".action-buttons");t(e).is(":visible")?(t(this).removeClass("active"),t(e).hide()):(t(this).addClass("active"),t(e).show())});var K=function(){var t=0;return function(a,e){clearTimeout(t),t=setTimeout(a,e)}}();t(window).resize(function(){K(function(){t(".action-buttons").removeAttr("style"),t(".np-toggle-edit").removeClass("active")},500)}),t(document).ready(function(){t(".sortable").not(".no-sort").nestedSortable({items:"li",toleranceElement:"> .row",handle:".handle",placeholder:"ui-sortable-placeholder",maxLevels:0,start:function(t,a){a.placeholder.height(a.item.height())},sort:function(t,a){n(a)},stop:function(){setTimeout(function(){o(),a(),e()},100),d()},update:function(){}})}),t(document).ready(function(){"1"===nestedpages.syncmenu&&r("sync")}),t(".np-sync-menu").on("change",function(){var a=t(this).is(":checked")?"sync":"nosync";r(a)}),t(document).on("click",".np-quick-edit",function(a){a.preventDefault(),f(),l(t(this))}),t(document).on("click",".np-inline-overlay",function(){f(),B()}),t(document).on("click",".np-cancel-quickedit",function(a){var e=t(this).parents(".page-row");f(e),a.preventDefault()}),t(document).on("click",".np-save-quickedit",function(a){a.preventDefault(),t(".row").removeClass("np-updated").removeClass("np-updated-show");var e=t(this).parents("form");t(this).attr("disabled","disabled"),t(e).find(".np-qe-loading").show(),_(e)}),t(document).on("click",".np-toggle-taxonomies",function(a){t(this).parents("form").find(".np-taxonomies").toggle(),a.preventDefault()}),t(document).on("click",".np-toggle-menuoptions",function(a){a.preventDefault(),t(this).parents("form").find(".np-menuoptions").toggle()}),t(document).on("change",".keep_private",function(){this.checked?t(".post_password").val("").prop("readonly",!0):t(".post_password").prop("readonly",!1)}),t(document).on("click",".np-quick-edit-redirect",function(a){a.preventDefault(),f(),j(t(this))}),t(document).on("click",".np-save-quickedit-redirect",function(a){a.preventDefault(),t(".row").removeClass("np-updated").removeClass("np-updated-show");var e=t(this).parents("form");t(this).attr("disabled","disabled"),t(e).find(".np-qe-loading").show(),T(e)}),t(document).on("click",".open-redirect-modal",function(a){a.preventDefault();var e=t(this).attr("data-parentid");t("#np-link-modal").find("input").val(""),t("#np-link-modal .parent_id").val(e),t("#np-add-link-title").text("0"===e?nestedpages.add_link:nestedpages.add_child_link),t("#np-link-modal").modal("show")}),t(document).on("click",".np-save-link",function(a){a.preventDefault(),t(".np-new-link-error").hide(),t(".np-link-loading").show(),t(this).attr("disabled","disabled"),I()}),t(document).on("click",".np-cancel-newchild",function(t){t.preventDefault(),B()}),t(document).on("click",".add-new-child",function(a){a.preventDefault(),S(t(this))}),t(document).on("click",".add-new-child-row",function(a){a.preventDefault(),Q(t(this));var e=t(this).parents("form");M(e)}),t(document).on("click",".np-remove-child",function(a){a.preventDefault();var e=t(this).parents("form");t(this).parents(".new-child-row").parent("li").remove(),M(e)}),t(document).on("click",".np-save-newchild",function(a){a.preventDefault(),t(this).prop("disabled","disabled");var e=t(this).parents("form");t(e).find(".np-qe-loading").show(),F(e)})});
1
+ jQuery(function(t){function a(){var a=t(".nplist");t(".page-row").removeClass("no-border"),t.each(a,function(){t(this).find(".page-row:visible:first").addClass("no-border")})}function e(){var a=t(".nestedpages").find(".nplist");t.each(a,function(){var a=t(this).parents(".nplist").length,e=56;if(a>0){var e=20*a+e;t(this).find(".row-inner").css("padding-left",e+"px")}else t(this).find(".row-inner").css("padding-left","0px")})}function n(){var a=t(".sortable").attr("id");return a.substring(3)}function s(a){var e=1;return t.each(nestedpages.post_types,function(t,n){n.name===a&&n.hierarchical===!0&&(e=0)}),e}function o(a){if(0===s(n())){var e=t(a.placeholder).parents("ol").length,i=t(".sortable").width(),o=40*e-40,r=i-o;t(a.placeholder).width(r).css("margin-left",o+"px")}d(a)}function d(a){var e=t(a.placeholder).parent("ol");t(e).is(":visible")||(t(e).addClass("nplist"),t(e).show())}function r(){t(".child-toggle").each(function(){var a=t(this).parent(".row").parent("li");if(t(a).children("ol").length>0){var e=t(a).children("ol:visible").length>0?"np-icon-arrow-down":"np-icon-arrow-right";t(this).html('<a href="#"><i class="'+e+'"></i></a>')}else t(this).empty()})}function l(){t("#np-error").hide(),t("#nested-loading").show();var a=t(".np-sync-menu").is(":checked")?"sync":"nosync";list=t("ol.sortable").nestedSortable("toHierarchy",{startDepthCount:0}),t.ajax({url:ajaxurl,type:"post",datatype:"json",data:{action:"npsort",nonce:nestedpages.np_nonce,list:list,post_type:n(),syncmenu:a},success:function(a){"error"===a.status?(t("#np-error").text(a.message).show(),t("#nested-loading").hide()):t("#nested-loading").hide()}})}function c(a){t.ajax({url:ajaxurl,type:"post",datatype:"json",data:{action:"npsyncMenu",nonce:nestedpages.np_nonce,post_type:n(),syncmenu:a},success:function(t){"error"===t.status&&alert("There was an error saving the sync setting.")}})}function p(a){var e={id:t(a).attr("data-id"),title:t(a).attr("data-title"),slug:t(a).attr("data-slug"),author:t(a).attr("data-author"),cs:t(a).attr("data-commentstatus"),status:t(a).attr("data-status"),template:t(a).attr("data-template"),month:t(a).attr("data-month"),day:t(a).attr("data-day"),year:t(a).attr("data-year"),hour:t(a).attr("data-hour"),minute:t(a).attr("data-minute"),navstatus:t(a).attr("data-navstatus"),npstatus:t(a).attr("data-np-status"),navtitle:t(a).attr("data-navtitle"),navtitleattr:t(a).attr("data-navtitleattr"),navcss:t(a).attr("data-navcss"),linktarget:t(a).attr("data-linktarget"),password:t(a).attr("data-password")},n=t(a).closest(".row").parent("li");e.h_taxonomies=[],e.f_taxonomies=[];var s=t(n).attr("class").split(/\s+/);for(i=0;i<s.length;i++)"in-"===s[i].substring(0,3)&&e.h_taxonomies.push(s[i]),"inf-"===s[i].substring(0,4)&&e.f_taxonomies.push(s[i]);if(t(n).children("ol").length>0)var o=t(n).children("ol"),d=t(".quick-edit-form").clone().insertBefore(o);else var d=t(".quick-edit-form").clone().appendTo(n);t(d).siblings(".row").hide();u(d,e)}function u(a,e){if(t(a).find(".page_id").html("<em>ID:</em> "+e.id),t(a).find(".np_id").val(e.id),t(a).find(".np_title").val(e.title),t(a).find(".np_slug").val(e.slug),t(a).find(".np_author select").val(e.author),t(a).find(".np_status").val(e.status),t(a).find(".np_nav_title").val(e.navtitle),t(a).find(".np_title_attribute").val(e.navtitleattr),t(a).find(".np_nav_css_classes").val(e.navcss),t(a).find(".post_password").val(e.password),"open"===e.cs&&t(a).find(".np_cs").prop("checked","checked"),t(a).find(".np_template").val(""!==e.template?e.template:"default"),"private"===e.status&&(t(a).find(".post_password").prop("readonly",!0),t(a).find(".keep_private").prop("checked",!0)),"hide"===e.npstatus?t(a).find(".np_status").prop("checked","checked"):t(a).find(".np_status").removeAttr("checked"),"hide"===e.navstatus?t(a).find(".np_nav_status").prop("checked","checked"):t(a).find(".np_nav_status").removeAttr("checked"),"_blank"===e.linktarget?t(a).find(".link_target").prop("checked","checked"):t(a).find(".link_target").removeAttr("checked"),"private"===e.status&&t(a).find(".np_status").val("publish"),t(a).find('select[name="mm"]').val(e.month),t(a).find('input[name="jj"]').val(e.day),t(a).find('input[name="aa"]').val(e.year),t(a).find('input[name="hh"]').val(e.hour),t(a).find('input[name="mn"]').val(e.minute),e.hasOwnProperty("h_taxonomies")){var n=e.h_taxonomies;for(i=0;i<n.length;i++){var s="#"+n[i];t(a).find(s).prop("checked","checked")}}_(),t(a).show(),e.hasOwnProperty("f_taxonomies")&&(h(e.f_taxonomies),m(a))}function h(t){var a={};for(i=0;i<t.length;i++){var e=t[i].split("-"),n=e.indexOf("nps"),s=e.splice(n+1);s=s.join("-");var o=t[i].split("-").splice(0,n);o.shift("inf");var d=o.join("-");d in a||(a[d]=[]);var r=a[d];r.push(s)}f(a)}function f(a){t.ajax({url:ajaxurl,type:"post",datatype:"json",data:{action:"npgetTaxonomies",nonce:nestedpages.np_nonce,terms:a},success:function(t){v(t.terms)}})}function v(a){a&&t.each(a,function(a,e){var n=t("#"+a);t(n).val(e.join(","))})}function m(a){var e=t(a).find("[data-autotag]");t.each(e,function(){var a=t(this).attr("data-taxonomy");t(this).suggest(ajaxurl+"?action=ajax-tag-search&tax="+a,{multiple:!0,multipleSep:","})})}function g(){t(".np-quickedit-error").hide(),w(),t(".sortable .quick-edit").remove(),t(".row").show()}function _(){t("body").append('<div class="np-inline-overlay"></div>'),setTimeout(function(){t(".np-inline-overlay").addClass("active")},50)}function w(){t(".np-inline-overlay").removeClass("active").remove()}function k(a){t(".np-quickedit-error").hide();var e=t(".np-sync-menu").is(":checked")?"sync":"nosync";t.ajax({url:ajaxurl,type:"post",datatype:"json",data:t(a).serialize()+"&action=npquickEdit&nonce="+nestedpages.np_nonce+"&syncmenu="+e+"&post_type="+n(),success:function(e){"error"===e.status?(q(a),t(a).find(".np-quickedit-error").text(e.message).show()):(q(a),b(a,e.post_data),D(a))},error:function(t){console.log(t)}})}function b(a,e){var n=t(a).parent(".quick-edit").siblings(".row");t(n).find(".title").text(e.post_title);var i=t(n).find(".status");if(t(i).text("publish"!==e._status&&"future"!==e._status?"("+e._status+")":"private"===e.keep_private?"("+e.keep_private+")":""),""!==e.post_password){var s=t(i).text();s+=' <i class="np-icon-lock"></i>',t(i).html(s)}var o=t(n).find(".nav-status");t(o).text("hide"==e.nav_status?"(Hidden)":"");var d=t(n).parent("li");"hide"==e.np_status?(t(d).addClass("np-hide"),t(n).find(".status").after('<i class="np-icon-eye-blocked"></i>')):(t(d).removeClass("np-hide"),t(n).find(".np-icon-eye-blocked").remove());var r=t(n).find(".np-quick-edit");t(r).attr("data-id",e.post_id),t(r).attr("data-template",e.page_template),t(r).attr("data-title",e.post_title),t(r).attr("data-slug",e.post_name),t(r).attr("data-commentstatus",e.comment_status),t(r).attr("data-status",e._status),"private"===e.keep_private&&t(r).attr("data-status","private"),t(r).attr("data-author",e.post_author),t(r).attr("data-np-status",e.np_status),t(r).attr("data-password",e.post_password),t(r).attr("data-navstatus",e.nav_status),t(r).attr("data-navtitle",e.np_nav_title),t(r).attr("data-linktarget",e.link_target),t(r).attr("data-navtitleattr",e.np_title_attribute),t(r).attr("data-navcss",e.np_nav_css_classes),t(r).attr("data-month",e.mm),t(r).attr("data-day",e.jj),t(r).attr("data-year",e.aa),t(r).attr("data-hour",e.hh),t(r).attr("data-minute",e.mn),y(d),x(d,e),C(d,e),j(d,e)}function y(a){taxonomies=[];var e=t(a).attr("class").split(/\s+/);for(i=0;i<e.length;i++)"in-"===e[i].substring(0,3)&&t(a).removeClass(e[i]),"inf-"===e[i].substring(0,4)&&t(a).removeClass(e[i])}function x(a,e){if(e.hasOwnProperty("post_category")){var n=e.post_category;for(i=0;i<n.length;i++){var s="in-category-"+n[i];t(a).addClass(s)}}}function C(a,e){if(e.hasOwnProperty("tax_input")){var n=e.tax_input;t.each(n,function(e,n){for(i=0;i<n.length;i++){var s="in-"+e+"-"+n[i];t(a).addClass(s)}})}}function j(a,e){if(e.hasOwnProperty("flat_tax")){var n=e.flat_tax;t.each(n,function(e,n){for(i=0;i<n.length;i++){var s="inf-"+e+"-nps-"+n[i];t(a).addClass(s)}})}}function q(a){t(a).find(".np-save-quickedit, .np-save-quickedit-redirect, .np-save-newchild").removeAttr("disabled"),t(a).find(".np-qe-loading").hide()}function D(e){var n=t(e).parent(".quick-edit, .new-child").siblings(".row");t(n).addClass("np-updated"),t(n).show(),t(e).parent(".quick-edit, .new-child").remove(),w(),a(),setTimeout(function(){t(n).addClass("np-updated-show")},1500)}function T(a){var e={id:t(a).attr("data-id"),url:t(a).attr("data-url"),title:t(a).attr("data-title"),status:t(a).attr("data-status"),navstatus:t(a).attr("data-navstatus"),npstatus:t(a).attr("data-np-status"),linktarget:t(a).attr("data-linktarget"),parentid:t(a).attr("data-parentid"),navtitleattr:t(a).attr("data-navtitleattr"),navcss:t(a).attr("data-navcss")},n=t(a).closest(".row").parent("li");if(t(n).children("ol").length>0)var i=t(n).children("ol"),s=t(".quick-edit-form-redirect").clone().insertBefore(i);else var s=t(".quick-edit-form-redirect").clone().appendTo(n);t(s).siblings(".row").hide();t(s).show(),A(s,e)}function A(a,e){t(a).find(".np_id").val(e.id),t(a).find(".np_title").val(e.title),t(a).find(".np_author select").val(e.author),t(a).find(".np_status").val(e.status),t(a).find(".np_content").val(e.url),t(a).find(".np_parent_id").val(e.parentid),t(a).find(".np_title_attribute").val(e.navtitleattr),t(a).find(".np_nav_css_classes").val(e.navcss),"hide"===e.npstatus?t(a).find(".np_status").prop("checked","checked"):t(a).find(".np_status").removeAttr("checked"),"hide"===e.navstatus?t(a).find(".np_nav_status").prop("checked","checked"):t(a).find(".np_nav_status").removeAttr("checked"),"_blank"===e.linktarget?t(a).find(".link_target").prop("checked","checked"):t(a).find(".link_target").removeAttr("checked"),_(),t(a).show()}function O(a){t(".np-quickedit-error").hide();var e=t(".np-sync-menu").is(":checked")?"sync":"nosync";t.ajax({url:ajaxurl,type:"post",datatype:"json",data:t(a).serialize()+"&action=npquickEditLink&nonce="+nestedpages.np_nonce+"&syncmenu="+e+"&post_type="+n(),success:function(e){"error"===e.status?(q(a),t(a).find(".np-quickedit-error").text(e.message).show()):(q(a),P(a,e.post_data),D(a))},error:function(){q(a),t(a).find(".np-quickedit-error").text("The form could not be saved at this time.").show()}})}function P(a,e){var n=t(a).parent(".quick-edit").siblings(".row");t(n).find(".title").html(e.post_title+' <i class="np-icon-link"></i>');var i=t(n).find(".status");t(i).text("publish"!==e._status&&"future"!==e._status?"("+e._status+")":"");var s=t(n).find(".nav-status");t(s).text("hide"==e.nav_status?"(Hidden)":"");var o=t(n).parent("li");"hide"==e.np_status?(t(o).addClass("np-hide"),t(n).find(".status").after('<i class="np-icon-eye-blocked"></i>')):(t(o).removeClass("np-hide"),t(n).find(".np-icon-eye-blocked").remove());var d=t(n).find(".np-quick-edit-redirect");t(d).attr("data-id",e.post_id),t(d).attr("data-title",e.post_title),t(d).attr("data-url",e.post_content),t(d).attr("data-status",e._status),t(d).attr("data-navstatus",e.nav_status),t(d).attr("data-np-status",e.np_status),t(d).attr("data-linktarget",e.link_target),t(d).attr("data-navtitleattr",e.np_title_attribute),t(d).attr("data-navcss",e.np_nav_css_classes)}function E(){t(".np-link-loading").hide(),t(".np-save-link").removeAttr("disabled")}function I(){t(".np-new-link-error").hide();var a=t(".np-new-link-form").serialize(),e=t(".np-sync-menu").is(":checked")?"sync":"nosync";t.ajax({url:ajaxurl,type:"post",datatype:"json",data:a+"&action=npnewLink&nonce="+nestedpages.np_nonce+"&syncmenu="+e+"&post_type="+n(),success:function(a){"error"===a.status?(E(),t(".np-new-link-error").text(a.message).show()):(E(),L(a.post_data))}})}function L(a){var e='<li id="menuItem_'+a.id+'" class="page-row';"publish"===a._status&&(e+=" published"),e+='">',e+='<div class="row"><div class="child-toggle"></div><div class="row-inner"><i class="np-icon-sub-menu"></i><i class="handle np-icon-menu"></i><a href="'+a.np_link_content+'" class="page-link page-title" target="_blank"><span class="title">'+a.np_link_title+' <i class="np-icon-link"></i></span>',e+="publish"!==a._status?'<span class="status">'+a._status+"</span>":'<span class="status"></span>',"hide"===a.np_status&&(e+='<i class="np-icon-eye-blocked"></i>'),e+="hide"===a.nav_status?'<span class="nav-status">(Hidden)</span>':'<span class="nav-status"></span>',e+='</a><a href="#" class="np-toggle-edit"><i class="np-icon-pencil"></i></a><div class="action-buttons"><a href="#" class="np-btn np-quick-edit-redirect" ',e+='data-id="'+a.id+'"',e+='data-parentid="'+a.parent_id+'"',e+='data-title="'+a.np_link_title+'" ',e+='data-url="'+a.np_link_content+'" ',e+='data-status="'+a._status+'" ',e+='data-np-status="'+a.np_status+'" ',e+='data-navstatus="'+a.nav_status+'" ',e+='data-linktarget="'+a.link_target+'">',e+="Quick Edit</a>",e+='<a href="'+a.delete_link+'" class="np-btn np-btn-trash"><i class="np-icon-remove"></i></a>',e+="</div></div></div></li>","0"===a.parent_id?t(".nplist:first li:first").after(e):z(e,a),t("#np-link-modal").modal("hide");var n=t("#menuItem_"+a.id).find(".row");H(n)}function z(a,e){var n=t("#menuItem_"+e.parent_id);0===t(n).children("ol").length?(a='<ol class="sortable nplist" style="display:block;">'+a+"</ol>",t(n).append(a)):t(n).find("ol:first").prepend(a),r(),S()}function H(e){t(e).addClass("np-updated"),a(),setTimeout(function(){t(e).addClass("np-updated-show")},1500)}function B(){var a=[],e=t(".page-row:visible");return t.each(e,function(){var e=t(this).attr("id");a.push(e.replace("menuItem_",""))}),a}function S(){var a=B(),e=n();t.ajax({url:ajaxurl,type:"post",datatype:"json",data:{action:"npnestToggle",nonce:nestedpages.np_nonce,ids:a,posttype:e},success:function(t){"success"!==t.status&&console.log("There was an error saving toggled pages.")}})}function Q(){t(".np-newchild-error").hide(),w(),t("#np-bulk-modal .modal-body").empty(),t(".sortable .new-child").remove(),t(".row").show()}function M(a){var e=t(a).closest(".row").parent("li");if(t(e).children("ol").length>0)var n=t(e).children("ol"),i=t(".new-child-form").not(".np-modal .new-child-form").clone().insertBefore(n);else var i=t(".new-child-form").not(".np-modal .new-child-form").clone().appendTo(e);t(i).siblings(".row").hide();_(),t(i).find(".parent_name").html("<em>Parent:</em> "+t(a).attr("data-parentname")),t(i).find(".page_parent_id").val(t(a).attr("data-id")),t(i).show()}function F(a){{var e='<li><i class="handle np-icon-menu"></i><div class="form-control new-child-row"><label>'+nestedpages.title+'</label><div><input type="text" name="post_title[]" class="np_title" placeholder="'+nestedpages.title+'" value="" /><a href="#" class="button-secondary np-remove-child">-</a></div></div></li>';t(a).siblings(".new-page-titles").append(e)}t(".new-page-titles").sortable({items:"li",handle:".handle"})}function G(a){var e=t(a).find(t(".new-child-row")).length;e>1?(t(a).find(".add-edit").hide(),t(a).find("h3 strong").text(nestedpages.add_child_pages),t(a).find(".np-save-newchild").text(nestedpages.add+" ("+e+")")):(t(a).find(".add-edit").show(),t(a).find("h3 strong").text(nestedpages.add_child),t(a).find(".np-save-newchild").text(nestedpages.add))}function J(a,e){t(".np-quickedit-error").hide();var i=t(".np-sync-menu").is(":checked")?"sync":"nosync";t.ajax({url:ajaxurl,type:"post",datatype:"json",data:t(a).serialize()+"&action=npnewChild&nonce="+nestedpages.np_nonce+"&syncmenu="+i+"&post_type="+n(),success:function(n){if(console.log(n),"error"===n.status)q(a),t(a).find(".np-quickedit-error").text(n.message).show();else if(e===!0){var i=n.new_pages[0].edit_link;i=i.replace(/&amp;/g,"&"),window.location.replace(i)}else q(a),K(a,n)},error:function(){q(a),t(a).find(".np-quickedit-error").text("The form could not be saved at this time.").show()}})}function K(a,e){var n=e.new_pages,s=t(a).parent(".new-child").parent(".page-row");if(0===t(s).children("ol").length&&t(s).append('<ol class="nplist"></ol>'),t(a).hasClass("in-modal"))var o=t(".nplist.sortable li.page-row:first");else var o=t(s).children("ol");for(i=0;i<n.length;i++)N(o,n[i]);t(o).show(),r(),Q(),t("#np-bulk-modal").modal("hide"),D(a)}function N(a,e){var i='<li id="menuItem_'+e.id+'" class="page-row';"publish"===e.status&&(i+=" published"),i+='">',0===s(n())?(i+='<div class="row">',i+='<div class="child-toggle"></div>'):i+='<div class="row non-hierarchical">',i+='<div class="row-inner">',i+='<i class="np-icon-sub-menu"></i><i class="handle np-icon-menu"></i>',i+='<a href="'+e.edit_link+'" class="page-link page-title">',i+='<span class="title">'+e.title+"</span>",i+="Publish"!==e.status?'<span class="status">('+e.status+")</span>":'<span class="status"></span>',i+='<span class="nav-status"></span><span class="edit-indicator"><i class="np-icon-pencil"></i>Edit</span>',i+="</a>",i+='<div class="action-buttons">',i+='<a href="#" class="np-btn open-redirect-modal" data-parentid="'+e.id+'"><i class="np-icon-link"></i></a>',i+='<a href="#" class="np-btn add-new-child" data-id="'+e.id+'" data-parentname="'+e.title+'">'+nestedpages.add_child_short+"</a>",i+='<a href="#" class="np-btn np-quick-edit" data-id="'+e.id+'" data-template="'+e.page_template+'" data-title="'+e.title+'" data-slug="'+e.slug+'" data-commentstatus="closed" data-status="'+e.status.toLowerCase()+'" data-np-status="show" data-navstatus="show" data-author="'+e.author+'" data-template="'+e.template+'" data-month="'+e.month+'" data-day="'+e.day+'" data-year="'+e.year+'" data-hour="'+e.hour+'" data-minute="'+e.minute+'">'+nestedpages.quick_edit+"</a>",i+='<a href="'+e.view_link+'" class="np-btn" target="_blank">'+nestedpages.view+"</a>",i+='<a href="'+e.delete_link+'" class="np-btn np-btn-trash"><i class="np-icon-remove"></i></a>',i+="</div><!-- .action-buttons -->",i+="</div><!-- .row-inner --></div><!-- .row -->",i+="</li>",t(a).after(i)}function R(a){t.ajax({url:ajaxurl,type:"post",datatype:"json",data:{action:"npEmptyTrash",nonce:nestedpages.np_nonce,posttype:a},success:function(a){console.log(a),t("#nested-loading").hide(),"error"===a.status?t("#np-error").text(a.message).show():t(".np-trash-links").hide()}})}function U(a){var e=t(".page-row .title");t(".page-row").hide(),t.each(e,function(){var e=t(this).text().toLowerCase();e.indexOf(a)>-1&&t(this).parents(".page-row").show()})}function V(){t(".page-row").show()}t(document).ready(function(){r(),a(),e()}),t(document).on("click",".child-toggle a",function(n){n.preventDefault();var i=t(this).parent(".child-toggle").parent(".row").siblings("ol");t(this).find("i").toggleClass("np-icon-arrow-down").toggleClass("np-icon-arrow-right"),t(i).toggle(),a(),S(),e()}),t(document).on("click",".nestedpages-toggleall a",function(e){e.preventDefault(),"closed"==t(this).attr("data-toggle")?(t(".nestedpages ol li ol").show(),t(this).attr("data-toggle","opened"),t(this).text(nestedpages.collapse_text),t(".child-toggle i").removeClass("np-icon-arrow-right").addClass("np-icon-arrow-down"),g(),a()):(t(".nestedpages ol li ol").hide(),t(this).attr("data-toggle","closed"),t(this).text(nestedpages.expand_text),t(".child-toggle i").removeClass("np-icon-arrow-down").addClass("np-icon-arrow-right"),g(),a()),S()}),t(document).on("click",".np-toggle-hidden",function(e){e.preventDefault();var n=t(this).attr("href");"show"===n?(t(this).attr("href","hide"),t(this).text(nestedpages.show_hidden),t(".np-hide").removeClass("shown").hide(),a()):(t(this).attr("href","show"),t(this).text(nestedpages.hide_hidden),t(".np-hide").addClass("shown").show(),a())}),t(".np-tabs a").on("click",function(a){a.preventDefault(),t(".np-tabs a").removeClass("active"),t(this).addClass("active");var e=t(this).attr("href");t(".np-tabbed-content").hide(),t(e).show()}),t(document).on("click",".np-toggle-publish",function(a){a.preventDefault();var e=t(this).attr("href");t(".np-toggle-publish").removeClass("active"),t(this).addClass("active"),"#published"==e?(t(".nplist .page-row").hide(),t(".nplist .published").show()):t(".nplist .page-row").show()}),t(document).on("click",".np-toggle-edit",function(a){a.preventDefault();var e=t(this).siblings(".action-buttons");t(e).is(":visible")?(t(this).removeClass("active"),t(e).hide()):(t(this).addClass("active"),t(e).show())});var W=function(){var t=0;return function(a,e){clearTimeout(t),t=setTimeout(a,e)}}();t(window).resize(function(){W(function(){t(".action-buttons").removeAttr("style"),t(".np-toggle-edit").removeClass("active")},500)}),t(document).ready(function(){t(".sortable").not(".no-sort").nestedSortable({items:".page-row",toleranceElement:"> .row",handle:".handle",placeholder:"ui-sortable-placeholder",maxLevels:s(n()),start:function(t,a){a.placeholder.height(a.item.height())},sort:function(t,a){o(a)},stop:function(){setTimeout(function(){r(),a(),e()},100),l()}})}),t(document).ready(function(){"1"===nestedpages.syncmenu&&c("sync")}),t(".np-sync-menu").on("change",function(){var a=t(this).is(":checked")?"sync":"nosync";c(a)}),t(document).on("click",".np-quick-edit",function(a){a.preventDefault(),g(),p(t(this))}),t(document).on("click",".np-inline-overlay",function(){g(),Q()}),t(document).on("click",".np-cancel-quickedit",function(a){var e=t(this).parents(".page-row");g(e),a.preventDefault()}),t(document).on("click",".np-save-quickedit",function(a){a.preventDefault(),t(".row").removeClass("np-updated").removeClass("np-updated-show");var e=t(this).parents("form");t(this).attr("disabled","disabled"),t(e).find(".np-qe-loading").show(),k(e)}),t(document).on("click",".np-toggle-taxonomies",function(a){t(this).parents("form").find(".np-taxonomies").toggle(),a.preventDefault()}),t(document).on("click",".np-toggle-menuoptions",function(a){a.preventDefault(),t(this).parents("form").find(".np-menuoptions").toggle()}),t(document).on("change",".keep_private",function(){this.checked?t(".post_password").val("").prop("readonly",!0):t(".post_password").prop("readonly",!1)}),t(document).on("click",".np-quick-edit-redirect",function(a){a.preventDefault(),g(),T(t(this))}),t(document).on("click",".np-save-quickedit-redirect",function(a){a.preventDefault(),t(".row").removeClass("np-updated").removeClass("np-updated-show");var e=t(this).parents("form");t(this).attr("disabled","disabled"),t(e).find(".np-qe-loading").show(),O(e)}),t(document).on("click",".open-redirect-modal",function(a){a.preventDefault();var e=t(this).attr("data-parentid");t("#np-link-modal").find("input").val(""),t("#np-link-modal .parent_id").val(e),t("#np-add-link-title").text("0"===e?nestedpages.add_link:nestedpages.add_child_link),t("#np-link-modal").modal("show")}),t(document).on("click",".np-save-link",function(a){a.preventDefault(),t(".np-new-link-error").hide(),t(".np-link-loading").show(),t(this).attr("disabled","disabled"),I()}),t("#np-bulk-modal").on("hide.bs.modal",function(){Q()}),t(document).on("click",".np-cancel-newchild",function(a){a.preventDefault(),Q(),t("#np-bulk-modal").modal("hide")}),t(document).on("click",".add-new-child",function(a){a.preventDefault(),M(t(this))}),t(document).on("click",".open-bulk-modal",function(a){a.preventDefault();var e=t(".new-child-form").clone().find(".np-new-child-form").addClass("in-modal");t("#np-bulk-modal .modal-body").html(e),t("#np-bulk-modal .new-child-form").show(),t("#np-bulk-modal").find("h3").text(nestedpages.add_multiple),t("#np-bulk-modal").find(".page_parent_id").val("0"),t("#np-bulk-modal").modal("show")}),t(document).on("click",".add-new-child-row",function(a){a.preventDefault(),F(t(this));var e=t(this).parents("form");G(e)}),t(document).on("click",".np-remove-child",function(a){a.preventDefault();var e=t(this).parents("form");t(this).parents(".new-child-row").parent("li").remove(),G(e)}),t(document).on("submit",".np-new-child-form",function(t){t.preventDefault()}),t(document).on("click",".np-save-newchild",function(a){a.preventDefault(),t(this).prop("disabled","disabled");var e=t(this).parents("form");t(e).find(".np-qe-loading").show();var n=t(this).hasClass("add-edit")?!0:!1;J(e,n)}),t(".np-empty-trash").on("click",function(a){a.preventDefault(),t("#nested-loading").show(),t("#np-error").hide();var e=t(this).attr("data-posttype");window.confirm(nestedpages.trash_confirm)&&R(e)}),t(document).on("keyup","#nestedpages-search",function(){var a=t(this).val().toLowerCase();return a.length>2?void U(a):void V()})});
assets/screenshot-1.png DELETED
Binary file
assets/screenshot-2.png DELETED
Binary file
assets/screenshot-3.gif DELETED
Binary file
assets/screenshot-4.gif DELETED
Binary file
assets/screenshot-5.png DELETED
Binary file
languages/nestedpages-nl_NL.mo ADDED
Binary file
languages/nestedpages-nl_NL.po ADDED
@@ -0,0 +1,342 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Nested Pages\n"
4
+ "POT-Creation-Date: 2014-11-20 20:17-0500\n"
5
+ "PO-Revision-Date: 2014-12-23 08:44+0100\n"
6
+ "Last-Translator: \n"
7
+ "Language-Team: \n"
8
+ "MIME-Version: 1.0\n"
9
+ "Content-Type: text/plain; charset=UTF-8\n"
10
+ "Content-Transfer-Encoding: 8bit\n"
11
+ "X-Generator: Poedit 1.7.1\n"
12
+ "X-Poedit-Basepath: ..\n"
13
+ "X-Poedit-SourceCharset: UTF-8\n"
14
+ "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
15
+ "esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;"
16
+ "_n_noop:1,2;_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
17
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
18
+ "Language: nl\n"
19
+ "X-Poedit-SearchPath-0: .\n"
20
+
21
+ #: includes/class-nestedpages.php:85
22
+ msgid "Settings"
23
+ msgstr "Instellingen"
24
+
25
+ #: includes/class-np-confirmation.php:58
26
+ msgid "pages moved to the Trash"
27
+ msgstr "Pagina's verwijderd naar de prullenbak"
28
+
29
+ #: includes/class-np-confirmation.php:60
30
+ msgid "page moved to the Trash"
31
+ msgstr "Pagina verplaatst naar de prullenbak"
32
+
33
+ #: includes/class-np-confirmation.php:65
34
+ msgid "Undo"
35
+ msgstr "Ongedaan maken"
36
+
37
+ #: includes/class-np-confirmation.php:80
38
+ msgid "pages"
39
+ msgstr "pagina's"
40
+
41
+ #: includes/class-np-confirmation.php:80
42
+ msgid "page"
43
+ msgstr "pagina"
44
+
45
+ #: includes/class-np-confirmation.php:81
46
+ msgid "restored from trash"
47
+ msgstr "teruggezet uit de prullenbak"
48
+
49
+ #: includes/class-np-confirmation.php:90
50
+ msgid "Link successfully deleted."
51
+ msgstr "Link succesvol verwijderd."
52
+
53
+ #: includes/class-np-dependencies.php:77 views/pages.php:18
54
+ msgid "Expand Pages"
55
+ msgstr "Pagina's uitklappen"
56
+
57
+ #: includes/class-np-dependencies.php:78
58
+ msgid "Collapse Pages"
59
+ msgstr "Pagina's inklappen"
60
+
61
+ #: includes/class-np-dependencies.php:79 views/pages.php:34
62
+ msgid "Show Hidden"
63
+ msgstr "Toon verborgen"
64
+
65
+ #: includes/class-np-dependencies.php:80
66
+ msgid "Hide Hidden"
67
+ msgstr "Verberg verborgen"
68
+
69
+ #: includes/class-np-dependencies.php:81 views/link-form.php:14
70
+ #: views/pages.php:9 views/pages.php:10
71
+ msgid "Add Link"
72
+ msgstr "Link toevoegen"
73
+
74
+ #: includes/class-np-dependencies.php:82
75
+ msgid "Add Child Link"
76
+ msgstr "Onderliggende link toevoegen"
77
+
78
+ #: includes/class-np-handler-base.php:64
79
+ msgid "Incorrect Form Field"
80
+ msgstr "Veld niet correct"
81
+
82
+ #: includes/class-np-handler-base.php:94
83
+ msgid "There was an error updating the page."
84
+ msgstr "Er is een probleem opgetreden bij het bijwerken van de pagina."
85
+
86
+ #: includes/class-np-handler-newredirect.php:40
87
+ #: includes/class-np-handler-quickedit-redirect.php:36
88
+ msgid "Link successfully updated"
89
+ msgstr "Link succesvol bijgewerkt"
90
+
91
+ #: includes/class-np-handler-quickedit.php:38
92
+ msgid "Post successfully updated"
93
+ msgstr "Bericht succesvol bijgewerkt"
94
+
95
+ #: includes/class-np-handler-sort.php:36
96
+ msgid "Page order successfully updated."
97
+ msgstr "Pagina volgorde succesvol aangepast"
98
+
99
+ #: includes/class-np-handler-sort.php:38
100
+ msgid "There was an order updating the page order."
101
+ msgstr "Er is een fout opgetreden bij het bijwerken van de paginavolgorde"
102
+
103
+ #: includes/class-np-handler-syncmenu.php:32
104
+ msgid "Menu sync enabled."
105
+ msgstr "Menu synchronisatie ingeschakeld."
106
+
107
+ #: includes/class-np-handler-syncmenu.php:35
108
+ msgid "Menu sync disabled."
109
+ msgstr "Menu synchronisatie uitgeschakeld."
110
+
111
+ #: includes/class-np-newpage.php:42
112
+ msgid "Adding child page under:"
113
+ msgstr "Pagina toevoegen onder:"
114
+
115
+ #: includes/class-np-pagelisting.php:79
116
+ msgid "All Pages"
117
+ msgstr "Alle pagina's"
118
+
119
+ #: includes/class-np-pagelisting.php:80
120
+ msgid "Add New"
121
+ msgstr "Nieuwe toevoegen"
122
+
123
+ #: includes/class-np-pagelisting.php:81
124
+ msgid "Default Pages"
125
+ msgstr "Standaard pagina's"
126
+
127
+ #: includes/class-np-posttypes.php:21
128
+ msgid "Redirects"
129
+ msgstr "Doorverwijzingen"
130
+
131
+ #: includes/class-np-posttypes.php:22
132
+ msgid "Redirect"
133
+ msgstr "Doorverwijzing"
134
+
135
+ #: includes/class-np-redirects.php:65
136
+ msgid "Nested Pages"
137
+ msgstr "Nested Pages"
138
+
139
+ #: includes/class-np-repository-post.php:58 views/quickedit.php:20
140
+ msgid "Title"
141
+ msgstr "Titel"
142
+
143
+ #: includes/class-np-repository-post.php:298
144
+ msgid "Label"
145
+ msgstr "Label"
146
+
147
+ #: includes/class-np-validation.php:49 includes/class-np-validation.php:64
148
+ msgid "Please provide a valid date."
149
+ msgstr "Graag een geldige datum invullen."
150
+
151
+ #: includes/class-np-validation.php:76
152
+ msgid "Please provide a menu title."
153
+ msgstr "Graag een menutitel invullen."
154
+
155
+ #: includes/class-np-validation.php:79
156
+ msgid "Please provide a valid URL."
157
+ msgstr "Graag een geldige URL invullen."
158
+
159
+ #: includes/class-np-validation.php:90
160
+ msgid "Please provide a "
161
+ msgstr "Vul een "
162
+
163
+ #: views/link-form.php:31 views/quickedit-redirect.php:17
164
+ #: views/quickedit.php:148
165
+ msgid "Navigation Label"
166
+ msgstr "Navigatie label"
167
+
168
+ #: views/link-form.php:36 views/quickedit-redirect.php:22
169
+ msgid "URL"
170
+ msgstr "URL"
171
+
172
+ #: views/link-form.php:41 views/quickedit-redirect.php:27
173
+ #: views/quickedit.php:58
174
+ msgid "Status"
175
+ msgstr "Status"
176
+
177
+ #: views/link-form.php:44 views/pages.php:33 views/quickedit-redirect.php:30
178
+ #: views/quickedit.php:61
179
+ msgid "Published"
180
+ msgstr "Gepubliceerd"
181
+
182
+ #: views/link-form.php:45 views/quickedit-redirect.php:31
183
+ #: views/quickedit.php:62
184
+ msgid "Scheduled"
185
+ msgstr "Ingepland"
186
+
187
+ #: views/link-form.php:47 views/quickedit-redirect.php:33
188
+ #: views/quickedit.php:64
189
+ msgid "Pending Review"
190
+ msgstr "Wacht op beoordeling"
191
+
192
+ #: views/link-form.php:48 views/quickedit-redirect.php:34
193
+ #: views/quickedit.php:65
194
+ msgid "Draft"
195
+ msgstr "Concept"
196
+
197
+ #: views/link-form.php:59 views/quickedit-redirect.php:54
198
+ #: views/quickedit.php:164
199
+ msgid "Hide in Nav Menu"
200
+ msgstr "Verbergen in navigatie menu"
201
+
202
+ #: views/link-form.php:64 views/quickedit-redirect.php:60
203
+ #: views/quickedit.php:105
204
+ msgid "Hide in Nested Pages"
205
+ msgstr "Verbergen in Nested Pages"
206
+
207
+ #: views/link-form.php:69 views/quickedit-redirect.php:66
208
+ #: views/quickedit.php:170
209
+ msgid "Open link in a new window/tab"
210
+ msgstr "Open link in een nieuw venster/tab"
211
+
212
+ #: views/link-form.php:80
213
+ msgid "Close"
214
+ msgstr "Sluiten"
215
+
216
+ #: views/link-form.php:83
217
+ msgid "Save Link"
218
+ msgstr "Link opslaan"
219
+
220
+ #: views/pages.php:24
221
+ msgid "Sync Menu"
222
+ msgstr "Menu synchroniseren"
223
+
224
+ #: views/pages.php:32
225
+ msgid "All"
226
+ msgstr "Alles"
227
+
228
+ #: views/pages.php:37
229
+ msgid "Trash"
230
+ msgstr "Prullenbak"
231
+
232
+ #: views/pages.php:40
233
+ msgid "Default"
234
+ msgstr "Standaard"
235
+
236
+ #: views/quickedit-redirect.php:8
237
+ msgid "Link"
238
+ msgstr "Link"
239
+
240
+ #: views/quickedit-redirect.php:44 views/quickedit.php:152
241
+ msgid "Title Attribute"
242
+ msgstr "Titel attribuut"
243
+
244
+ #: views/quickedit-redirect.php:48 views/quickedit.php:156
245
+ msgid "CSS Classes"
246
+ msgstr "CSS classes"
247
+
248
+ #: views/quickedit-redirect.php:81 views/quickedit.php:184
249
+ msgid "Cancel"
250
+ msgstr "Annuleren"
251
+
252
+ #: views/quickedit-redirect.php:84 views/quickedit.php:187
253
+ msgid "Update"
254
+ msgstr "Bijwerken"
255
+
256
+ #: views/quickedit.php:11 views/row-redirect.php:53 views/row.php:94
257
+ msgid "Quick Edit"
258
+ msgstr "Snel bewerken"
259
+
260
+ #: views/quickedit.php:24
261
+ msgid "Slug"
262
+ msgstr "Slug"
263
+
264
+ #: views/quickedit.php:28
265
+ msgid "Date"
266
+ msgstr "Datum"
267
+
268
+ #: views/quickedit.php:49
269
+ msgid "Author"
270
+ msgstr "Auteur"
271
+
272
+ #: views/quickedit.php:73
273
+ msgid "Template"
274
+ msgstr "Sjabloon"
275
+
276
+ #: views/quickedit.php:75
277
+ msgid "Default Template"
278
+ msgstr "Standaard sjabloon"
279
+
280
+ #: views/quickedit.php:82
281
+ msgid "Password"
282
+ msgstr "Wachtwoord"
283
+
284
+ #: views/quickedit.php:85
285
+ msgid "&ndash;OR&ndash;"
286
+ msgstr "&ndash;OF&ndash;"
287
+
288
+ #: views/quickedit.php:88
289
+ msgid "Private"
290
+ msgstr "Privé"
291
+
292
+ #: views/quickedit.php:97
293
+ msgid "Allow Comments"
294
+ msgstr "Reactie's toestaan"
295
+
296
+ #: views/quickedit.php:113
297
+ msgid "Menu Options"
298
+ msgstr "Menu opties"
299
+
300
+ #: views/quickedit.php:115
301
+ msgid "Taxonomies"
302
+ msgstr "Taxanomieën"
303
+
304
+ #: views/row-redirect.php:30 views/row.php:33
305
+ msgid "Hidden"
306
+ msgstr "Verborgen"
307
+
308
+ #: views/row.php:41
309
+ msgid "currently editing"
310
+ msgstr "nu aan het bewerken"
311
+
312
+ #: views/row.php:43
313
+ msgid "Edit"
314
+ msgstr "Bewerken"
315
+
316
+ #: views/row.php:66
317
+ msgid "Add Child"
318
+ msgstr "Onderliggende pagina toevoegen"
319
+
320
+ #: views/row.php:98
321
+ msgid "View"
322
+ msgstr "Bekijken"
323
+
324
+ #: views/settings.php:2
325
+ msgid "Nested Pages Settings"
326
+ msgstr "Nested Pages Instellingen"
327
+
328
+ #: views/settings.php:8
329
+ msgid "Nested Pages Version"
330
+ msgstr "Nested Pages Versie"
331
+
332
+ #: views/settings.php:12
333
+ msgid "Menu Name"
334
+ msgstr "Menu naam"
335
+
336
+ #: views/settings.php:15
337
+ msgid ""
338
+ "Important: Once the menu name has changed, theme files should be updated to "
339
+ "reference the new name."
340
+ msgstr ""
341
+ "Belangrijk: Wanneer de menu naam is gewijzigd moeten thema-bestanden "
342
+ "bijgewerkt worden met een verwijzing naar de nieuwe naam."
languages/nestedpages.mo CHANGED
Binary file
languages/nestedpages.pot CHANGED
@@ -1,8 +1,8 @@
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Nested Pages\n"
4
- "POT-Creation-Date: 2014-11-20 20:17-0500\n"
5
- "PO-Revision-Date: 2014-11-20 20:17-0500\n"
6
  "Last-Translator: \n"
7
  "Language-Team: \n"
8
  "MIME-Version: 1.0\n"
@@ -16,323 +16,459 @@ msgstr ""
16
  "_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
17
  "X-Poedit-SearchPath-0: .\n"
18
 
19
- #: includes/class-nestedpages.php:85
20
- msgid "Settings"
21
  msgstr ""
22
 
23
- #: includes/class-np-confirmation.php:58
24
- msgid "pages moved to the Trash"
25
  msgstr ""
26
 
27
- #: includes/class-np-confirmation.php:60
28
- msgid "page moved to the Trash"
29
  msgstr ""
30
 
31
- #: includes/class-np-confirmation.php:65
32
- msgid "Undo"
33
  msgstr ""
34
 
35
- #: includes/class-np-confirmation.php:80
36
- msgid "pages"
 
37
  msgstr ""
38
 
39
- #: includes/class-np-confirmation.php:80
40
- msgid "page"
41
  msgstr ""
42
 
43
- #: includes/class-np-confirmation.php:81
44
- msgid "restored from trash"
 
 
 
45
  msgstr ""
46
 
47
- #: includes/class-np-confirmation.php:90
48
- msgid "Link successfully deleted."
 
49
  msgstr ""
50
 
51
- #: includes/class-np-dependencies.php:77 views/pages.php:18
52
- msgid "Expand Pages"
53
  msgstr ""
54
 
55
- #: includes/class-np-dependencies.php:78
56
- msgid "Collapse Pages"
57
  msgstr ""
58
 
59
- #: includes/class-np-dependencies.php:79 views/pages.php:34
60
- msgid "Show Hidden"
 
61
  msgstr ""
62
 
63
- #: includes/class-np-dependencies.php:80
64
- msgid "Hide Hidden"
65
  msgstr ""
66
 
67
- #: includes/class-np-dependencies.php:81 views/link-form.php:14
68
- #: views/pages.php:9 views/pages.php:10
69
- msgid "Add Link"
70
  msgstr ""
71
 
72
- #: includes/class-np-dependencies.php:82
73
- msgid "Add Child Link"
74
  msgstr ""
75
 
76
- #: includes/class-np-handler-base.php:64
77
- msgid "Incorrect Form Field"
78
  msgstr ""
79
 
80
- #: includes/class-np-handler-base.php:94
81
- msgid "There was an error updating the page."
82
  msgstr ""
83
 
84
- #: includes/class-np-handler-newredirect.php:40
85
- #: includes/class-np-handler-quickedit-redirect.php:36
86
- msgid "Link successfully updated"
87
  msgstr ""
88
 
89
- #: includes/class-np-handler-quickedit.php:38
90
- msgid "Post successfully updated"
 
 
91
  msgstr ""
92
 
93
- #: includes/class-np-handler-sort.php:36
94
- msgid "Page order successfully updated."
95
  msgstr ""
96
 
97
- #: includes/class-np-handler-sort.php:38
98
- msgid "There was an order updating the page order."
99
  msgstr ""
100
 
101
- #: includes/class-np-handler-syncmenu.php:32
102
- msgid "Menu sync enabled."
103
  msgstr ""
104
 
105
- #: includes/class-np-handler-syncmenu.php:35
106
- msgid "Menu sync disabled."
 
 
 
 
 
 
 
 
 
107
  msgstr ""
108
 
109
- #: includes/class-np-newpage.php:42
110
- msgid "Adding child page under:"
111
  msgstr ""
112
 
113
- #: includes/class-np-pagelisting.php:79
114
- msgid "All Pages"
 
 
 
 
 
 
 
 
115
  msgstr ""
116
 
117
- #: includes/class-np-pagelisting.php:80
118
- msgid "Add New"
119
  msgstr ""
120
 
121
- #: includes/class-np-pagelisting.php:81
122
- msgid "Default Pages"
123
  msgstr ""
124
 
125
- #: includes/class-np-posttypes.php:21
 
 
 
 
 
 
 
 
126
  msgid "Redirects"
127
  msgstr ""
128
 
129
- #: includes/class-np-posttypes.php:22
130
  msgid "Redirect"
131
  msgstr ""
132
 
133
- #: includes/class-np-redirects.php:65
134
- msgid "Nested Pages"
135
  msgstr ""
136
 
137
- #: includes/class-np-repository-post.php:58 views/quickedit.php:20
138
- msgid "Title"
139
  msgstr ""
140
 
141
- #: includes/class-np-repository-post.php:298
142
- msgid "Label"
143
  msgstr ""
144
 
145
- #: includes/class-np-validation.php:49 includes/class-np-validation.php:64
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
146
  msgid "Please provide a valid date."
147
  msgstr ""
148
 
149
- #: includes/class-np-validation.php:76
150
  msgid "Please provide a menu title."
151
  msgstr ""
152
 
153
- #: includes/class-np-validation.php:79
154
  msgid "Please provide a valid URL."
155
  msgstr ""
156
 
157
- #: includes/class-np-validation.php:90
158
  msgid "Please provide a "
159
  msgstr ""
160
 
161
- #: views/link-form.php:31 views/quickedit-redirect.php:17
162
- #: views/quickedit.php:148
 
 
 
 
 
 
 
 
 
 
 
 
163
  msgid "Navigation Label"
164
  msgstr ""
165
 
166
- #: views/link-form.php:36 views/quickedit-redirect.php:22
167
  msgid "URL"
168
  msgstr ""
169
 
170
- #: views/link-form.php:41 views/quickedit-redirect.php:27
171
- #: views/quickedit.php:58
172
  msgid "Status"
173
  msgstr ""
174
 
175
- #: views/link-form.php:44 views/pages.php:33 views/quickedit-redirect.php:30
176
- #: views/quickedit.php:61
 
177
  msgid "Published"
178
  msgstr ""
179
 
180
- #: views/link-form.php:45 views/quickedit-redirect.php:31
181
- #: views/quickedit.php:62
182
  msgid "Scheduled"
183
  msgstr ""
184
 
185
- #: views/link-form.php:47 views/quickedit-redirect.php:33
186
- #: views/quickedit.php:64
187
  msgid "Pending Review"
188
  msgstr ""
189
 
190
- #: views/link-form.php:48 views/quickedit-redirect.php:34
191
- #: views/quickedit.php:65
192
  msgid "Draft"
193
  msgstr ""
194
 
195
- #: views/link-form.php:59 views/quickedit-redirect.php:54
196
- #: views/quickedit.php:164
197
  msgid "Hide in Nav Menu"
198
  msgstr ""
199
 
200
- #: views/link-form.php:64 views/quickedit-redirect.php:60
201
- #: views/quickedit.php:105
202
  msgid "Hide in Nested Pages"
203
  msgstr ""
204
 
205
- #: views/link-form.php:69 views/quickedit-redirect.php:66
206
- #: views/quickedit.php:170
207
  msgid "Open link in a new window/tab"
208
  msgstr ""
209
 
210
- #: views/link-form.php:80
211
  msgid "Close"
212
  msgstr ""
213
 
214
- #: views/link-form.php:83
215
  msgid "Save Link"
216
  msgstr ""
217
 
218
- #: views/pages.php:24
219
- msgid "Sync Menu"
220
  msgstr ""
221
 
222
- #: views/pages.php:32
223
- msgid "All"
224
  msgstr ""
225
 
226
- #: views/pages.php:37
227
- msgid "Trash"
228
  msgstr ""
229
 
230
- #: views/pages.php:40
231
- msgid "Default"
232
  msgstr ""
233
 
234
- #: views/quickedit-redirect.php:8
235
- msgid "Link"
 
236
  msgstr ""
237
 
238
- #: views/quickedit-redirect.php:44 views/quickedit.php:152
239
- msgid "Title Attribute"
240
  msgstr ""
241
 
242
- #: views/quickedit-redirect.php:48 views/quickedit.php:156
243
- msgid "CSS Classes"
244
  msgstr ""
245
 
246
- #: views/quickedit-redirect.php:81 views/quickedit.php:184
247
- msgid "Cancel"
 
248
  msgstr ""
249
 
250
- #: views/quickedit-redirect.php:84 views/quickedit.php:187
251
- msgid "Update"
 
252
  msgstr ""
253
 
254
- #: views/quickedit.php:11 views/row-redirect.php:53 views/row.php:94
255
- msgid "Quick Edit"
 
256
  msgstr ""
257
 
258
- #: views/quickedit.php:24
259
  msgid "Slug"
260
  msgstr ""
261
 
262
- #: views/quickedit.php:28
263
  msgid "Date"
264
  msgstr ""
265
 
266
- #: views/quickedit.php:49
267
- msgid "Author"
268
- msgstr ""
269
-
270
- #: views/quickedit.php:73
271
- msgid "Template"
272
- msgstr ""
273
-
274
- #: views/quickedit.php:75
275
- msgid "Default Template"
276
- msgstr ""
277
-
278
- #: views/quickedit.php:82
279
  msgid "Password"
280
  msgstr ""
281
 
282
- #: views/quickedit.php:85
283
  msgid "&ndash;OR&ndash;"
284
  msgstr ""
285
 
286
- #: views/quickedit.php:88
287
  msgid "Private"
288
  msgstr ""
289
 
290
- #: views/quickedit.php:97
291
  msgid "Allow Comments"
292
  msgstr ""
293
 
294
- #: views/quickedit.php:113
295
  msgid "Menu Options"
296
  msgstr ""
297
 
298
- #: views/quickedit.php:115
299
  msgid "Taxonomies"
300
  msgstr ""
301
 
302
- #: views/row-redirect.php:30 views/row.php:33
 
 
 
 
303
  msgid "Hidden"
304
  msgstr ""
305
 
306
- #: views/row.php:41
307
  msgid "currently editing"
308
  msgstr ""
309
 
310
- #: views/row.php:43
311
  msgid "Edit"
312
  msgstr ""
313
 
314
- #: views/row.php:66
315
- msgid "Add Child"
316
  msgstr ""
317
 
318
- #: views/row.php:98
319
- msgid "View"
320
  msgstr ""
321
 
322
- #: views/settings.php:2
323
- msgid "Nested Pages Settings"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
324
  msgstr ""
325
 
326
- #: views/settings.php:8
 
 
 
 
327
  msgid "Nested Pages Version"
328
  msgstr ""
329
 
330
- #: views/settings.php:12
331
  msgid "Menu Name"
332
  msgstr ""
333
 
334
- #: views/settings.php:15
335
  msgid ""
336
  "Important: Once the menu name has changed, theme files should be updated to "
337
  "reference the new name."
338
  msgstr ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Nested Pages\n"
4
+ "POT-Creation-Date: 2014-12-26 14:28-0500\n"
5
+ "PO-Revision-Date: 2014-12-26 14:28-0500\n"
6
  "Last-Translator: \n"
7
  "Language-Team: \n"
8
  "MIME-Version: 1.0\n"
16
  "_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
17
  "X-Poedit-SearchPath-0: .\n"
18
 
19
+ #: app/Activation/Dependencies.php:106 app/Views/listing.php:30
20
+ msgid "Expand All"
21
  msgstr ""
22
 
23
+ #: app/Activation/Dependencies.php:107
24
+ msgid "Collapse All"
25
  msgstr ""
26
 
27
+ #: app/Activation/Dependencies.php:108 app/Views/partials/tool-list.php:14
28
+ msgid "Show Hidden"
29
  msgstr ""
30
 
31
+ #: app/Activation/Dependencies.php:109
32
+ msgid "Hide Hidden"
33
  msgstr ""
34
 
35
+ #: app/Activation/Dependencies.php:110 app/Views/forms/link-form.php:14
36
+ #: app/Views/listing.php:17 app/Views/listing.php:18
37
+ msgid "Add Link"
38
  msgstr ""
39
 
40
+ #: app/Activation/Dependencies.php:111
41
+ msgid "Add Child Link"
42
  msgstr ""
43
 
44
+ #: app/Activation/Dependencies.php:112
45
+ #: app/Entities/Post/PostUpdateRepository.php:59
46
+ #: app/Views/forms/new-child.php:19 app/Views/forms/new-child.php:21
47
+ #: app/Views/forms/quickedit-post.php:20 app/Views/partials/tool-list.php:61
48
+ msgid "Title"
49
  msgstr ""
50
 
51
+ #: app/Activation/Dependencies.php:113 app/Views/forms/quickedit-post.php:11
52
+ #: app/Views/partials/row-link.php:53 app/Views/partials/row.php:113
53
+ msgid "Quick Edit"
54
  msgstr ""
55
 
56
+ #: app/Activation/Dependencies.php:114
57
+ msgid "Page Title"
58
  msgstr ""
59
 
60
+ #: app/Activation/Dependencies.php:115 app/Views/partials/row.php:117
61
+ msgid "View"
62
  msgstr ""
63
 
64
+ #: app/Activation/Dependencies.php:116 app/Views/forms/new-child.php:7
65
+ #: app/Views/partials/row.php:85
66
+ msgid "Add Child"
67
  msgstr ""
68
 
69
+ #: app/Activation/Dependencies.php:117
70
+ msgid "Add Child Page"
71
  msgstr ""
72
 
73
+ #: app/Activation/Dependencies.php:118
74
+ msgid "Add Child Pages"
 
75
  msgstr ""
76
 
77
+ #: app/Activation/Dependencies.php:119 app/Views/forms/new-child.php:93
78
+ msgid "Add"
79
  msgstr ""
80
 
81
+ #: app/Activation/Dependencies.php:120
82
+ msgid "Add Page"
83
  msgstr ""
84
 
85
+ #: app/Activation/Dependencies.php:121
86
+ msgid "Add Pages"
87
  msgstr ""
88
 
89
+ #: app/Activation/Dependencies.php:122 app/Views/listing.php:11
90
+ #: app/Views/listing.php:12
91
+ msgid "Add Multiple"
92
  msgstr ""
93
 
94
+ #: app/Activation/Dependencies.php:123
95
+ msgid ""
96
+ "Are you sure you would like to empty the trash? This action is not "
97
+ "reversable."
98
  msgstr ""
99
 
100
+ #: app/Bootstrap.php:59
101
+ msgid "Settings"
102
  msgstr ""
103
 
104
+ #: app/Config/Settings.php:45 app/Views/settings/settings.php:2
105
+ msgid "Nested Pages Settings"
106
  msgstr ""
107
 
108
+ #: app/Config/Settings.php:46
109
+ msgid "Nested Pages"
110
  msgstr ""
111
 
112
+ #: app/Entities/AdminMenu/AdminSubmenu.php:73
113
+ #: app/Views/partials/tool-list.php:29
114
+ msgid "Default"
115
+ msgstr ""
116
+
117
+ #: app/Entities/Confirmation/LinkDeletedConfirmation.php:9
118
+ msgid "Link successfully deleted."
119
+ msgstr ""
120
+
121
+ #: app/Entities/Confirmation/TrashConfirmation.php:12
122
+ msgid "pages moved to the Trash"
123
  msgstr ""
124
 
125
+ #: app/Entities/Confirmation/TrashConfirmation.php:14
126
+ msgid "moved to the Trash"
127
  msgstr ""
128
 
129
+ #: app/Entities/Confirmation/TrashConfirmation.php:19
130
+ msgid "Undo"
131
+ msgstr ""
132
+
133
+ #: app/Entities/Confirmation/TrashRestoredConfirmation.php:10
134
+ msgid "pages"
135
+ msgstr ""
136
+
137
+ #: app/Entities/Confirmation/TrashRestoredConfirmation.php:10
138
+ msgid "page"
139
  msgstr ""
140
 
141
+ #: app/Entities/Confirmation/TrashRestoredConfirmation.php:11
142
+ msgid "restored from trash"
143
  msgstr ""
144
 
145
+ #: app/Entities/Post/PostUpdateRepository.php:301
146
+ msgid "Label"
147
  msgstr ""
148
 
149
+ #: app/Entities/PostType/PostTypeRepository.php:172
150
+ msgid "Nested View"
151
+ msgstr ""
152
+
153
+ #: app/Entities/PostType/PostTypeRepository.php:172
154
+ msgid "Sort View"
155
+ msgstr ""
156
+
157
+ #: app/Entities/PostType/RegisterPostTypes.php:20
158
  msgid "Redirects"
159
  msgstr ""
160
 
161
+ #: app/Entities/PostType/RegisterPostTypes.php:21
162
  msgid "Redirect"
163
  msgstr ""
164
 
165
+ #: app/Form/Handlers/BaseHandler.php:79
166
+ msgid "Incorrect Form Field"
167
  msgstr ""
168
 
169
+ #: app/Form/Handlers/BaseHandler.php:111
170
+ msgid "There was an error updating the page."
171
  msgstr ""
172
 
173
+ #: app/Form/Handlers/EmptyTrashHandler.php:16
174
+ msgid "Trash successfully emptied."
175
  msgstr ""
176
 
177
+ #: app/Form/Handlers/NewLinkHandler.php:33
178
+ #: app/Form/Handlers/QuickEditLinkHandler.php:28
179
+ msgid "Link successfully updated"
180
+ msgstr ""
181
+
182
+ #: app/Form/Handlers/QuickEditHandler.php:31
183
+ msgid "Post successfully updated"
184
+ msgstr ""
185
+
186
+ #: app/Form/Handlers/SortHandler.php:28
187
+ msgid "Page order successfully updated."
188
+ msgstr ""
189
+
190
+ #: app/Form/Handlers/SortHandler.php:30
191
+ msgid "There was an error updating the page order."
192
+ msgstr ""
193
+
194
+ #: app/Form/Handlers/SyncMenuHandler.php:25
195
+ msgid "Menu sync enabled."
196
+ msgstr ""
197
+
198
+ #: app/Form/Handlers/SyncMenuHandler.php:28
199
+ msgid "Menu sync disabled."
200
+ msgstr ""
201
+
202
+ #: app/Form/Validation/Validation.php:48 app/Form/Validation/Validation.php:63
203
  msgid "Please provide a valid date."
204
  msgstr ""
205
 
206
+ #: app/Form/Validation/Validation.php:75
207
  msgid "Please provide a menu title."
208
  msgstr ""
209
 
210
+ #: app/Form/Validation/Validation.php:78
211
  msgid "Please provide a valid URL."
212
  msgstr ""
213
 
214
+ #: app/Form/Validation/Validation.php:89
215
  msgid "Please provide a "
216
  msgstr ""
217
 
218
+ #: app/Form/Validation/Validation.php:103
219
+ msgid "A valid parent page was not provided."
220
+ msgstr ""
221
+
222
+ #: app/Form/Validation/Validation.php:110
223
+ msgid "Please provide at least one page title."
224
+ msgstr ""
225
+
226
+ #: app/Form/Validation/Validation.php:118
227
+ msgid "Page titles cannot be blank."
228
+ msgstr ""
229
+
230
+ #: app/Views/forms/link-form.php:31 app/Views/forms/quickedit-link.php:17
231
+ #: app/Views/forms/quickedit-post.php:153
232
  msgid "Navigation Label"
233
  msgstr ""
234
 
235
+ #: app/Views/forms/link-form.php:36 app/Views/forms/quickedit-link.php:22
236
  msgid "URL"
237
  msgstr ""
238
 
239
+ #: app/Views/forms/link-form.php:41 app/Views/forms/new-child.php:35
240
+ #: app/Views/forms/quickedit-link.php:27 app/Views/forms/quickedit-post.php:58
241
  msgid "Status"
242
  msgstr ""
243
 
244
+ #: app/Views/forms/link-form.php:44 app/Views/forms/new-child.php:38
245
+ #: app/Views/forms/quickedit-link.php:30 app/Views/forms/quickedit-post.php:61
246
+ #: app/Views/partials/tool-list.php:10
247
  msgid "Published"
248
  msgstr ""
249
 
250
+ #: app/Views/forms/link-form.php:45 app/Views/forms/quickedit-link.php:31
251
+ #: app/Views/forms/quickedit-post.php:62
252
  msgid "Scheduled"
253
  msgstr ""
254
 
255
+ #: app/Views/forms/link-form.php:47 app/Views/forms/quickedit-link.php:33
256
+ #: app/Views/forms/quickedit-post.php:64
257
  msgid "Pending Review"
258
  msgstr ""
259
 
260
+ #: app/Views/forms/link-form.php:48 app/Views/forms/new-child.php:40
261
+ #: app/Views/forms/quickedit-link.php:34 app/Views/forms/quickedit-post.php:65
262
  msgid "Draft"
263
  msgstr ""
264
 
265
+ #: app/Views/forms/link-form.php:59 app/Views/forms/quickedit-link.php:54
266
+ #: app/Views/forms/quickedit-post.php:169
267
  msgid "Hide in Nav Menu"
268
  msgstr ""
269
 
270
+ #: app/Views/forms/link-form.php:64 app/Views/forms/quickedit-link.php:60
271
+ #: app/Views/forms/quickedit-post.php:108
272
  msgid "Hide in Nested Pages"
273
  msgstr ""
274
 
275
+ #: app/Views/forms/link-form.php:69 app/Views/forms/quickedit-link.php:66
276
+ #: app/Views/forms/quickedit-post.php:175
277
  msgid "Open link in a new window/tab"
278
  msgstr ""
279
 
280
+ #: app/Views/forms/link-form.php:80
281
  msgid "Close"
282
  msgstr ""
283
 
284
+ #: app/Views/forms/link-form.php:83
285
  msgid "Save Link"
286
  msgstr ""
287
 
288
+ #: app/Views/forms/new-child.php:28
289
+ msgid "+"
290
  msgstr ""
291
 
292
+ #: app/Views/forms/new-child.php:61 app/Views/forms/quickedit-post.php:49
293
+ msgid "Author"
294
  msgstr ""
295
 
296
+ #: app/Views/forms/new-child.php:71 app/Views/forms/quickedit-post.php:75
297
+ msgid "Template"
298
  msgstr ""
299
 
300
+ #: app/Views/forms/new-child.php:73 app/Views/forms/quickedit-post.php:77
301
+ msgid "Default Template"
302
  msgstr ""
303
 
304
+ #: app/Views/forms/new-child.php:90 app/Views/forms/quickedit-link.php:81
305
+ #: app/Views/forms/quickedit-post.php:189
306
+ msgid "Cancel"
307
  msgstr ""
308
 
309
+ #: app/Views/forms/new-child.php:96
310
+ msgid "Add & Edit"
311
  msgstr ""
312
 
313
+ #: app/Views/forms/quickedit-link.php:8
314
+ msgid "Link"
315
  msgstr ""
316
 
317
+ #: app/Views/forms/quickedit-link.php:44
318
+ #: app/Views/forms/quickedit-post.php:157
319
+ msgid "Title Attribute"
320
  msgstr ""
321
 
322
+ #: app/Views/forms/quickedit-link.php:48
323
+ #: app/Views/forms/quickedit-post.php:161
324
+ msgid "CSS Classes"
325
  msgstr ""
326
 
327
+ #: app/Views/forms/quickedit-link.php:84
328
+ #: app/Views/forms/quickedit-post.php:192
329
+ msgid "Update"
330
  msgstr ""
331
 
332
+ #: app/Views/forms/quickedit-post.php:24
333
  msgid "Slug"
334
  msgstr ""
335
 
336
+ #: app/Views/forms/quickedit-post.php:28 app/Views/partials/tool-list.php:60
337
  msgid "Date"
338
  msgstr ""
339
 
340
+ #: app/Views/forms/quickedit-post.php:85
 
 
 
 
 
 
 
 
 
 
 
 
341
  msgid "Password"
342
  msgstr ""
343
 
344
+ #: app/Views/forms/quickedit-post.php:88
345
  msgid "&ndash;OR&ndash;"
346
  msgstr ""
347
 
348
+ #: app/Views/forms/quickedit-post.php:91
349
  msgid "Private"
350
  msgstr ""
351
 
352
+ #: app/Views/forms/quickedit-post.php:100
353
  msgid "Allow Comments"
354
  msgstr ""
355
 
356
+ #: app/Views/forms/quickedit-post.php:117
357
  msgid "Menu Options"
358
  msgstr ""
359
 
360
+ #: app/Views/forms/quickedit-post.php:121
361
  msgid "Taxonomies"
362
  msgstr ""
363
 
364
+ #: app/Views/listing.php:37
365
+ msgid "Sync Menu"
366
+ msgstr ""
367
+
368
+ #: app/Views/partials/row-link.php:30 app/Views/partials/row.php:39
369
  msgid "Hidden"
370
  msgstr ""
371
 
372
+ #: app/Views/partials/row.php:47
373
  msgid "currently editing"
374
  msgstr ""
375
 
376
+ #: app/Views/partials/row.php:49
377
  msgid "Edit"
378
  msgstr ""
379
 
380
+ #: app/Views/partials/tool-list.php:6
381
+ msgid "All"
382
  msgstr ""
383
 
384
+ #: app/Views/partials/tool-list.php:20
385
+ msgid "Trash"
386
  msgstr ""
387
 
388
+ #: app/Views/partials/tool-list.php:21
389
+ msgid "Empty"
390
+ msgstr ""
391
+
392
+ #: app/Views/partials/tool-list.php:44
393
+ msgid "All Authors"
394
+ msgstr ""
395
+
396
+ #: app/Views/partials/tool-list.php:59
397
+ msgid "Menu Order"
398
+ msgstr ""
399
+
400
+ #: app/Views/partials/tool-list.php:63
401
+ msgid "Order By"
402
+ msgstr ""
403
+
404
+ #: app/Views/partials/tool-list.php:77
405
+ msgid "Ascending"
406
  msgstr ""
407
 
408
+ #: app/Views/partials/tool-list.php:78
409
+ msgid "Decending"
410
+ msgstr ""
411
+
412
+ #: app/Views/settings/settings-general.php:7
413
  msgid "Nested Pages Version"
414
  msgstr ""
415
 
416
+ #: app/Views/settings/settings-general.php:11
417
  msgid "Menu Name"
418
  msgstr ""
419
 
420
+ #: app/Views/settings/settings-general.php:14
421
  msgid ""
422
  "Important: Once the menu name has changed, theme files should be updated to "
423
  "reference the new name."
424
  msgstr ""
425
+
426
+ #: app/Views/settings/settings-general.php:18
427
+ msgid "Allow Page Sorting"
428
+ msgstr ""
429
+
430
+ #: app/Views/settings/settings-general.php:28
431
+ msgid "Admins always have sorting ability."
432
+ msgstr ""
433
+
434
+ #: app/Views/settings/settings-posttypes.php:7
435
+ msgid "Enable Nested Pages for:"
436
+ msgstr ""
437
+
438
+ #: app/Views/settings/settings-posttypes.php:14
439
+ msgid "Post Type"
440
+ msgstr ""
441
+
442
+ #: app/Views/settings/settings-posttypes.php:15
443
+ msgid "Hierarchical"
444
+ msgstr ""
445
+
446
+ #: app/Views/settings/settings-posttypes.php:16
447
+ msgid "Enabled"
448
+ msgstr ""
449
+
450
+ #: app/Views/settings/settings-posttypes.php:17
451
+ msgid "Replace Default Menu"
452
+ msgstr ""
453
+
454
+ #: app/Views/settings/settings-posttypes.php:18
455
+ msgid "Hide Default Link"
456
+ msgstr ""
457
+
458
+ #: app/Views/settings/settings-posttypes.php:45
459
+ msgid "Note: Nesting features not enabled for non-hierarchical post types."
460
+ msgstr ""
461
+
462
+ #: app/Views/settings/settings-posttypes.php:48
463
+ msgid ""
464
+ "If default menu is not replaced, an additional submenu item will be added "
465
+ "for \"Nested/Sort View\""
466
+ msgstr ""
467
+
468
+ #: app/Views/settings/settings.php:6
469
+ msgid "General"
470
+ msgstr ""
471
+
472
+ #: app/Views/settings/settings.php:10
473
+ msgid "Post Types"
474
+ msgstr ""
nestedpages.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Nested Pages
4
  Plugin URI: http://nestedpages.com
5
  Description: Provides an intuitive drag and drop interface for managing pages in the Wordpress admin, while maintaining quick edit functionality.
6
- Version: 1.2.1
7
  Author: Kyle Phillips
8
  Author URI: https://github.com/kylephillips
9
  Text Domain: nestedpages
3
  Plugin Name: Nested Pages
4
  Plugin URI: http://nestedpages.com
5
  Description: Provides an intuitive drag and drop interface for managing pages in the Wordpress admin, while maintaining quick edit functionality.
6
+ Version: 1.3.0
7
  Author: Kyle Phillips
8
  Author URI: https://github.com/kylephillips
9
  Text Domain: nestedpages
readme.txt CHANGED
@@ -4,23 +4,24 @@ Donate link: http://nestedpages.com/
4
  Tags: pages, admin, nested, tree view, page tree, sort, quick edit
5
  Requires at least: 3.8
6
  Tested up to: 4.1
7
- Stable tag: 1.2.0
8
 
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
12
- Nested Pages provides an intuitive drag and drop interface for managing pages in the WordPress admin, while maintaining quick edit functionality.
13
 
14
  == Description ==
15
 
16
- **Nested Pages offers**
17
 
18
- * A drag and drop interface for managing your pages - simple and intuitive
19
- * Quick edit functionality
20
- * An expandable, sortable tree view of your site's page structure
21
- * A native WordPress menu, automatically generated to match your Nested Pages screen
22
- * A way to quickly add child pages (ideal for development)
23
- * A touch-friendly interface
 
24
 
25
  For more information visit [nestedpages.com](http://nestedpages.com).
26
 
@@ -29,6 +30,7 @@ For more information visit [nestedpages.com](http://nestedpages.com).
29
  **Languages:**
30
 
31
  * Danish (Thomas Blomberg)
 
32
  * English
33
  * Finnish (Roni Laukkarinen)
34
  * French (Nico Mollet)
@@ -46,19 +48,19 @@ For more information visit [nestedpages.com](http://nestedpages.com).
46
  == Frequently Asked Questions ==
47
 
48
  = Can I use Nested Pages with other post types? =
49
- Nested Pages is currently limited to the WordPress “Page” post type.
50
 
51
  = How do I access the WordPress “Pages” screen? =
52
- Click the “Default Pages” link in the page subnav, or on the Nested Pages screen. This item may be optionally hidden under the Nested Pages settings.
53
 
54
  = How do I save the order I create? =
55
- Page sorting and nesting is saved in the background after changes are made to the structure.
56
 
57
  = How do I edit in bulk? =
58
- Bulk quick edits are not currently supported by Nested Pages. To edit in bulk, click on Default Pages” to use the native interface.
59
 
60
  = What about custom columns? =
61
- Custom columns are not currently supported by Nested Pages. To view custom columns, click on Default Pages” to view the native interface. If you are using WordPress SEO by Yoast, a page analysis indicator is shown.
62
 
63
  = What are those dots in my page rows? =
64
  If you have WordPress SEO by Yoast installed, your page score indicators are shown along with the pages.
@@ -74,10 +76,16 @@ If you have WordPress SEO by Yoast installed, your page score indicators are sho
74
 
75
  4. Toggle nested child pages for a clutter-free tree
76
 
77
- 5. Quickly add child pages without leaving the page tree
78
 
79
  == Changelog ==
80
 
 
 
 
 
 
 
81
  = 1.2.1 =
82
  * Bug fixes when using custom roles (Thanks to Luis Martins for troubleshooting help)
83
 
@@ -140,10 +148,13 @@ If you have WordPress SEO by Yoast installed, your page score indicators are sho
140
 
141
  == Upgrade Notice ==
142
 
 
 
 
143
  = 1.2.1 =
144
  Bug fix when using custom roles.
145
 
146
- = 1.2.0 =
147
  PHP 5.3.2 now required – Nested Pages will not install on older versions of PHP. If you are running less than 5.3.2, continue to use Nested Pages version 1.1.9.
148
 
149
  = 1.1.9 =
4
  Tags: pages, admin, nested, tree view, page tree, sort, quick edit
5
  Requires at least: 3.8
6
  Tested up to: 4.1
7
+ Stable tag: 1.2.1
8
 
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
12
+ Nested Pages provides a drag and drop interface for managing pages & posts in the WordPress admin, while maintaining quick edit functionality.
13
 
14
  == Description ==
15
 
16
+ **Why use Nested Pages?**
17
 
18
+ * Provides a simple & intuitive drag and drop interface for managing your page structure and post ordering
19
+ * Enhanced quick edit functionality
20
+ * Adds an editable, sortable tree view of your site's page structure
21
+ * Automatically generates a native WordPress menu that matches your page structure
22
+ * A way to quickly add multiple pages & posts (ideal for development)
23
+ * Works with any post type
24
+ * Works on touch-enabled devices
25
 
26
  For more information visit [nestedpages.com](http://nestedpages.com).
27
 
30
  **Languages:**
31
 
32
  * Danish (Thomas Blomberg)
33
+ * Dutch (Arno Vije)
34
  * English
35
  * Finnish (Roni Laukkarinen)
36
  * French (Nico Mollet)
48
  == Frequently Asked Questions ==
49
 
50
  = Can I use Nested Pages with other post types? =
51
+ As of Nested Pages version 1.3.0, all post types are supported. To enable the Nested Pages interface for post types, update your settings under Settings > Nested Pages.
52
 
53
  = How do I access the WordPress “Pages” screen? =
54
+ Click the “Default link in the page subnav, or on the Nested Pages screen. This item may be optionally hidden under the Nested Pages settings.
55
 
56
  = How do I save the order I create? =
57
+ Post sorting and nesting is saved in the background after changes are made to the structure.
58
 
59
  = How do I edit in bulk? =
60
+ Bulk quick edits are not currently supported by Nested Pages. To edit in bulk, click on the "Default" link to use the native interface.
61
 
62
  = What about custom columns? =
63
+ Custom columns are not currently supported by Nested Pages. To view custom columns, click on the "Default" link to view the native interface. If you are using WordPress SEO by Yoast, a page analysis indicator is shown.
64
 
65
  = What are those dots in my page rows? =
66
  If you have WordPress SEO by Yoast installed, your page score indicators are shown along with the pages.
76
 
77
  4. Toggle nested child pages for a clutter-free tree
78
 
79
+ 5. Quickly add posts without leaving the page tree
80
 
81
  == Changelog ==
82
 
83
+ = 1.3.0 =
84
+ * All public post types are now supported, both hierarchical and non-hierarchical. To enabled the Nested Pages interface for additional post types, visit Settings > Nested Pages and select the "Post Types" tab. The generated nav menu is tied to the pages type, which is enabled by default.
85
+ * New interface for adding top-level posts/pages in bulk
86
+ * New "Empty Trash" link for quickly emptying trash on enabled post types
87
+ * Dutch translation (Provided by Arno Vije)
88
+
89
  = 1.2.1 =
90
  * Bug fixes when using custom roles (Thanks to Luis Martins for troubleshooting help)
91
 
148
 
149
  == Upgrade Notice ==
150
 
151
+ = 1.3.0 =
152
+ All post types are now supported. Also includes minor bug fixes and UI improvements.
153
+
154
  = 1.2.1 =
155
  Bug fix when using custom roles.
156
 
157
+ = 1.2 =
158
  PHP 5.3.2 now required – Nested Pages will not install on older versions of PHP. If you are running less than 5.3.2, continue to use Nested Pages version 1.1.9.
159
 
160
  = 1.1.9 =
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer' . '/autoload_real.php';
6
 
7
- return ComposerAutoloaderInitdf5efd6cdd1f1603d7c6384432ca8791::getLoader();
4
 
5
  require_once __DIR__ . '/composer' . '/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit3f8df92aae5dae035770adbf1d2e621e::getLoader();
vendor/composer/autoload_namespaces.php CHANGED
@@ -6,4 +6,5 @@ $vendorDir = dirname(dirname(__FILE__));
6
  $baseDir = dirname($vendorDir);
7
 
8
  return array(
 
9
  );
6
  $baseDir = dirname($vendorDir);
7
 
8
  return array(
9
+ 'Composer\\Installers\\' => array($vendorDir . '/composer/installers/src'),
10
  );
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInitdf5efd6cdd1f1603d7c6384432ca8791
6
  {
7
  private static $loader;
8
 
@@ -19,9 +19,9 @@ class ComposerAutoloaderInitdf5efd6cdd1f1603d7c6384432ca8791
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInitdf5efd6cdd1f1603d7c6384432ca8791', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInitdf5efd6cdd1f1603d7c6384432ca8791', 'loadClassLoader'));
25
 
26
  $map = require __DIR__ . '/autoload_namespaces.php';
27
  foreach ($map as $namespace => $path) {
@@ -44,7 +44,7 @@ class ComposerAutoloaderInitdf5efd6cdd1f1603d7c6384432ca8791
44
  }
45
  }
46
 
47
- function composerRequiredf5efd6cdd1f1603d7c6384432ca8791($file)
48
  {
49
  require $file;
50
  }
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInit3f8df92aae5dae035770adbf1d2e621e
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInit3f8df92aae5dae035770adbf1d2e621e', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInit3f8df92aae5dae035770adbf1d2e621e', 'loadClassLoader'));
25
 
26
  $map = require __DIR__ . '/autoload_namespaces.php';
27
  foreach ($map as $namespace => $path) {
44
  }
45
  }
46
 
47
+ function composerRequire3f8df92aae5dae035770adbf1d2e621e($file)
48
  {
49
  require $file;
50
  }
vendor/composer/installed.json ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "name": "composer/installers",
4
+ "version": "v1.0.6",
5
+ "version_normalized": "1.0.6.0",
6
+ "source": {
7
+ "type": "git",
8
+ "url": "https://github.com/composer/installers.git",
9
+ "reference": "b3bd071ea114a57212c75aa6a2eef5cfe0cc798f"
10
+ },
11
+ "dist": {
12
+ "type": "zip",
13
+ "url": "https://api.github.com/repos/composer/installers/zipball/b3bd071ea114a57212c75aa6a2eef5cfe0cc798f",
14
+ "reference": "b3bd071ea114a57212c75aa6a2eef5cfe0cc798f",
15
+ "shasum": ""
16
+ },
17
+ "replace": {
18
+ "shama/baton": "*"
19
+ },
20
+ "require-dev": {
21
+ "composer/composer": "1.0.*@dev",
22
+ "phpunit/phpunit": "3.7.*"
23
+ },
24
+ "time": "2013-08-20 04:37:09",
25
+ "type": "composer-installer",
26
+ "extra": {
27
+ "class": "Composer\\Installers\\Installer",
28
+ "branch-alias": {
29
+ "dev-master": "1.0-dev"
30
+ }
31
+ },
32
+ "installation-source": "dist",
33
+ "autoload": {
34
+ "psr-0": {
35
+ "Composer\\Installers\\": "src/"
36
+ }
37
+ },
38
+ "notification-url": "https://packagist.org/downloads/",
39
+ "license": [
40
+ "MIT"
41
+ ],
42
+ "authors": [
43
+ {
44
+ "name": "Kyle Robinson Young",
45
+ "email": "kyle@dontkry.com",
46
+ "homepage": "https://github.com/shama",
47
+ "role": "Developer"
48
+ }
49
+ ],
50
+ "description": "A multi-framework Composer library installer",
51
+ "homepage": "http://composer.github.com/installers/",
52
+ "keywords": [
53
+ "TYPO3 CMS",
54
+ "TYPO3 Flow",
55
+ "TYPO3 Neos",
56
+ "agl",
57
+ "cakephp",
58
+ "codeigniter",
59
+ "drupal",
60
+ "fuelphp",
61
+ "installer",
62
+ "joomla",
63
+ "kohana",
64
+ "laravel",
65
+ "li3",
66
+ "lithium",
67
+ "mako",
68
+ "modulework",
69
+ "phpbb",
70
+ "ppi",
71
+ "silverstripe",
72
+ "symfony",
73
+ "wordpress",
74
+ "zend"
75
+ ]
76
+ }
77
+ ]
vendor/composer/installers/.editorconfig ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ ; top-most EditorConfig file
2
+ root = true
3
+
4
+ ; Unix-style newlines
5
+ [*]
6
+ end_of_line = LF
7
+
8
+ [*.php]
9
+ indent_style = space
10
+ indent_size = 4
vendor/composer/installers/.gitignore ADDED
@@ -0,0 +1,2 @@
 
 
1
+ vendor/
2
+ composer.lock
vendor/composer/installers/.travis.yml ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ language: php
2
+
3
+ php:
4
+ - 5.3
5
+ - 5.4
6
+
7
+ before_script:
8
+ - curl -s http://getcomposer.org/installer | php -- --quiet
9
+ - php composer.phar install --dev
10
+
11
+ script: phpunit
vendor/composer/installers/LICENSE ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Copyright (c) 2012 Kyle Robinson Young
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is furnished
8
+ to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ THE SOFTWARE.
vendor/composer/installers/README.md ADDED
@@ -0,0 +1,162 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # A Multi-Framework [Composer](http://getcomposer.org) Library Installer
2
+
3
+ [![Build Status](https://secure.travis-ci.org/composer/installers.png)](http://travis-ci.org/composer/installers)
4
+
5
+ This is for PHP package authors to require in their `composer.json`. It will
6
+ install their package to the correct location based on the specified package
7
+ type.
8
+
9
+ The goal of `installers` is to be a simple package type to install path map.
10
+ Users can also customize the install path per package and package authors can
11
+ modify the package name upon installing.
12
+
13
+ `installers` isn't intended on replacing all custom installers. If your
14
+ package requires special installation handling then by all means, create a
15
+ custom installer to handle it.
16
+
17
+ **Natively Supported Frameworks**:
18
+
19
+ The following frameworks natively work with Composer and will be
20
+ installed to the default `vendor` directory. `composer/installers`
21
+ is not needed to install packages with these frameworks:
22
+
23
+ * Aura
24
+ * Symfony2
25
+ * Yii
26
+
27
+ **Current Supported Package Types**:
28
+
29
+ > Stable types are marked as **bold**, this means that installation paths
30
+ > for those type will not be change. Any adjustment for those types would
31
+ > require creation of brand new type that will cover required changes.
32
+
33
+ | Framework | Types
34
+ | --------- | -----
35
+ | AGL | `agl-module`
36
+ | AnnotateCms | `annotatecms-module`<br>`annotatecms-component`<br>`annotatecms-service`
37
+ | CakePHP 2+ | **`cakephp-plugin`**
38
+ | CodeIgniter | `codeigniter-library`<br>`codeigniter-third-party`<br>`codeigniter-module`
39
+ | Croogo | `croogo-plugin`<br>`croogo-theme`
40
+ | Drupal | <b>`drupal-module`<br>`drupal-theme`</b><br>`drupal-profile`<br>`drupal-drush`
41
+ | FuelPHP v1.x | `fuel-module`<br>`fuel-package`
42
+ | Joomla | `joomla-component`<br>`joomla-module`<br>`joomla-template`<br>`joomla-plugin`<br>`joomla-library`
43
+ | Kohana | **`kohana-module`**
44
+ | Laravel | `laravel-library`
45
+ | Lithium | **`lithium-library`<br>`lithium-source`**
46
+ | Magento | `magento-library`<br>`magento-skin`<br>`magento-theme`
47
+ | Mako | `mako-package`
48
+ | MediaWiki | `mediawiki-extension`
49
+ | OXID | `oxid-module`
50
+ | MODULEWork | `modulework-module`
51
+ | phpBB | `phpbb-extension`<br>`phpbb-style`<br>`phpbb-language`
52
+ | PPI | **`ppi-module`**
53
+ | SilverStripe | `silverstripe-module`<br>`silverstripe-theme`
54
+ | symfony1 | **`symfony1-plugin`**
55
+ | TYPO3 Flow | `typo3-flow-package`<br>`typo3-flow-framework`<br>`typo3-flow-plugin`<br>`typo3-flow-site`<br>`typo3-flow-boilerplate`<br>`typo3-flow-build`
56
+ | TYPO3 CMS | `typo3-cms-extension`
57
+ | WordPress | <b>`wordpress-plugin`<br>`wordpress-theme`</b><br>`wordpress-muplugin`
58
+ | Zend | `zend-library`<br>`zend-extra`
59
+
60
+ ## Example `composer.json` File
61
+
62
+ This is an example for a CakePHP plugin. The only important parts to set in your
63
+ composer.json file are `"type": "cakephp-plugin"` which describes what your
64
+ package is and `"require": { "composer/installers": "~1.0" }` which tells composer
65
+ to load the custom installers.
66
+
67
+ ```json
68
+ {
69
+ "name": "you/ftp",
70
+ "type": "cakephp-plugin",
71
+ "require": {
72
+ "composer/installers": "~1.0"
73
+ }
74
+ }
75
+ ```
76
+
77
+ This would install your package to the `Plugin/Ftp/` folder of a CakePHP app
78
+ when a user runs `php composer.phar install`.
79
+
80
+ So submit your packages to [packagist.org](http://packagist.org)!
81
+
82
+ ## Custom Install Paths
83
+
84
+ If you are consuming a package that uses the `composer/installers` you can
85
+ override the install path with the following extra in your `composer.json`:
86
+
87
+ ```json
88
+ {
89
+ "extra": {
90
+ "installer-paths": {
91
+ "your/custom/path/{$name}/": ["shama/ftp", "vendor/package"]
92
+ }
93
+ }
94
+ }
95
+ ```
96
+
97
+ A package type can have a custom installation path with a `type:` prefix.
98
+
99
+ ``` json
100
+ {
101
+ "extra": {
102
+ "installer-paths": {
103
+ "your/custom/path/{$name}/": ["type:wordpress-plugin"]
104
+ }
105
+ }
106
+ }
107
+ ```
108
+
109
+ This would use your custom path for each of the listed packages. The available
110
+ variables to use in your paths are: `{$name}`, `{$vendor}`, `{$type}`.
111
+
112
+ ## Custom Install Names
113
+
114
+ If you're a package author and need your package to be named differently when
115
+ installed consider using the `installer-name` extra.
116
+
117
+ For example you have a package named `shama/cakephp-ftp` with the type
118
+ `cakephp-plugin`. Installing with `composer/installers` would install to the
119
+ path `Plugin/CakephpFtp`. Due to the strict naming conventions, you as a
120
+ package author actually need the package to be named and installed to
121
+ `Plugin/Ftp`. Using the following config within your **package** `composer.json`
122
+ will allow this:
123
+
124
+ ```json
125
+ {
126
+ "name": "shama/cakephp-ftp",
127
+ "type": "cakephp-plugin",
128
+ "extra": {
129
+ "installer-name": "Ftp"
130
+ }
131
+ }
132
+ ```
133
+
134
+ Please note the name entered into `installer-name` will be the final and will
135
+ not be inflected.
136
+
137
+ ## Contribute!
138
+
139
+ * [Fork and clone](https://help.github.com/articles/fork-a-repo).
140
+ * Run the command `php composer.phar install --dev` to install the dev
141
+ dependencies. See [Composer](https://github.com/composer/composer#installation--usage).
142
+ * Use the command `phpunit` to run the tests. See [PHPUnit](http://phpunit.de).
143
+ * Create a branch, commit, push and send us a
144
+ [pull request](https://help.github.com/articles/using-pull-requests).
145
+
146
+ To ensure a consistent code base, you should make sure the code follows the
147
+ [Coding Standards](http://symfony.com/doc/2.0/contributing/code/standards.html)
148
+ which we borrowed from Symfony.
149
+
150
+ If you would like to help, please take a look at the list of
151
+ [issues](https://github.com/composer/installers/issues).
152
+
153
+ ### Should we allow dynamic package types or paths? No.
154
+ What are they? The ability for a package author to determine where a package
155
+ will be installed either through setting the path directly in their
156
+ `composer.json` or through a dynamic package type: `"type":
157
+ "framework-install-here"`.
158
+
159
+ It has been proposed many times. Even implemented once early on and then
160
+ removed. `installers` won't do this because it would allow a single package
161
+ author to wipe out entire folders without the user's consent. That user would
162
+ then come here to yell at us.
vendor/composer/installers/composer.json ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "composer/installers",
3
+ "type": "composer-installer",
4
+ "license": "MIT",
5
+ "description": "A multi-framework Composer library installer",
6
+ "keywords": [
7
+ "installer", "cakephp", "laravel", "kohana",
8
+ "li3", "lithium", "mako","fuelphp",
9
+ "codeigniter", "symfony", "phpbb", "ppi",
10
+ "joomla", "wordpress", "drupal", "zend",
11
+ "silverstripe", "agl", "TYPO3 Flow", "TYPO3 Neos", "modulework",
12
+ "TYPO3 CMS"
13
+ ],
14
+ "homepage": "http://composer.github.com/installers/",
15
+ "authors": [
16
+ {
17
+ "name": "Kyle Robinson Young",
18
+ "email": "kyle@dontkry.com",
19
+ "homepage": "https://github.com/shama"
20
+ }
21
+ ],
22
+ "autoload": {
23
+ "psr-0": { "Composer\\Installers\\": "src/" }
24
+ },
25
+ "extra": {
26
+ "class": "Composer\\Installers\\Installer",
27
+ "branch-alias": {
28
+ "dev-master": "1.0-dev"
29
+ }
30
+ },
31
+ "replace": {
32
+ "shama/baton": "*"
33
+ },
34
+ "require-dev": {
35
+ "composer/composer": "1.0.*@dev",
36
+ "phpunit/phpunit": "3.7.*"
37
+ }
38
+ }
vendor/composer/installers/phpunit.xml.dist ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+
3
+ <phpunit backupGlobals="false"
4
+ backupStaticAttributes="false"
5
+ colors="true"
6
+ convertErrorsToExceptions="true"
7
+ convertNoticesToExceptions="true"
8
+ convertWarningsToExceptions="true"
9
+ processIsolation="false"
10
+ stopOnFailure="false"
11
+ syntaxCheck="false"
12
+ bootstrap="tests/bootstrap.php"
13
+ >
14
+ <testsuites>
15
+ <testsuite name="Installers Test Suite">
16
+ <directory>tests/Composer/Installers</directory>
17
+ </testsuite>
18
+ </testsuites>
19
+
20
+ <filter>
21
+ <whitelist>
22
+ <directory>src/Composer/Installers</directory>
23
+ </whitelist>
24
+ </filter>
25
+ </phpunit>
vendor/composer/installers/src/Composer/Installers/AglInstaller.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class AglInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'module' => 'More/{$name}/',
8
+ );
9
+
10
+ /**
11
+ * Format package name to CamelCase
12
+ */
13
+ public function inflectPackageVars($vars)
14
+ {
15
+ $vars['name'] = preg_replace_callback('/(?:^|_|-)(.?)/', function($matches) {
16
+ return strtoupper($matches[1]);
17
+ }, $vars['name']);
18
+
19
+ return $vars;
20
+ }
21
+ }
vendor/composer/installers/src/Composer/Installers/AnnotateCmsInstaller.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class AnnotateCmsInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'module' => 'addons/modules/{$name}/',
8
+ 'component' => 'addons/components/{$name}/',
9
+ 'service' => 'addons/services/{$name}/',
10
+ );
11
+ }
vendor/composer/installers/src/Composer/Installers/BaseInstaller.php ADDED
@@ -0,0 +1,130 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ use Composer\Composer;
5
+ use Composer\Package\PackageInterface;
6
+
7
+ abstract class BaseInstaller
8
+ {
9
+ protected $locations = array();
10
+ protected $composer;
11
+ protected $package;
12
+
13
+ /**
14
+ * Initializes base installer.
15
+ *
16
+ * @param PackageInterface $package
17
+ * @param Composer $composer
18
+ */
19
+ public function __construct(PackageInterface $package = null, Composer $composer = null)
20
+ {
21
+ $this->composer = $composer;
22
+ $this->package = $package;
23
+ }
24
+
25
+ /**
26
+ * Return the install path based on package type.
27
+ *
28
+ * @param PackageInterface $package
29
+ * @param string $frameworkType
30
+ * @return string
31
+ */
32
+ public function getInstallPath(PackageInterface $package, $frameworkType = '')
33
+ {
34
+ $type = $this->package->getType();
35
+
36
+ $prettyName = $this->package->getPrettyName();
37
+ if (strpos($prettyName, '/') !== false) {
38
+ list($vendor, $name) = explode('/', $prettyName);
39
+ } else {
40
+ $vendor = '';
41
+ $name = $prettyName;
42
+ }
43
+
44
+ $availableVars = $this->inflectPackageVars(compact('name', 'vendor', 'type'));
45
+
46
+ $extra = $package->getExtra();
47
+ if (!empty($extra['installer-name'])) {
48
+ $availableVars['name'] = $extra['installer-name'];
49
+ }
50
+
51
+ if ($this->composer->getPackage()) {
52
+ $extra = $this->composer->getPackage()->getExtra();
53
+ if (!empty($extra['installer-paths'])) {
54
+ $customPath = $this->mapCustomInstallPaths($extra['installer-paths'], $prettyName, $type);
55
+ if ($customPath !== false) {
56
+ return $this->templatePath($customPath, $availableVars);
57
+ }
58
+ }
59
+ }
60
+
61
+ $packageType = substr($type, strlen($frameworkType) + 1);
62
+ if (!isset($this->locations[$packageType])) {
63
+ throw new \InvalidArgumentException(sprintf('Package type "%s" is not supported', $type));
64
+ }
65
+
66
+ return $this->templatePath($this->locations[$packageType], $availableVars);
67
+ }
68
+
69
+ /**
70
+ * For an installer to override to modify the vars per installer.
71
+ *
72
+ * @param array $vars
73
+ * @return array
74
+ */
75
+ public function inflectPackageVars($vars)
76
+ {
77
+ return $vars;
78
+ }
79
+
80
+ /**
81
+ * Gets the installer's locations
82
+ *
83
+ * @return array
84
+ */
85
+ public function getLocations()
86
+ {
87
+ return $this->locations;
88
+ }
89
+
90
+ /**
91
+ * Replace vars in a path
92
+ *
93
+ * @param string $path
94
+ * @param array $vars
95
+ * @return string
96
+ */
97
+ protected function templatePath($path, array $vars = array())
98
+ {
99
+ if (strpos($path, '{') !== false) {
100
+ extract($vars);
101
+ preg_match_all('@\{\$([A-Za-z0-9_]*)\}@i', $path, $matches);
102
+ if (!empty($matches[1])) {
103
+ foreach ($matches[1] as $var) {
104
+ $path = str_replace('{$' . $var . '}', $$var, $path);
105
+ }
106
+ }
107
+ }
108
+
109
+ return $path;
110
+ }
111
+
112
+ /**
113
+ * Search through a passed paths array for a custom install path.
114
+ *
115
+ * @param array $paths
116
+ * @param string $name
117
+ * @param string $type
118
+ * @return string
119
+ */
120
+ protected function mapCustomInstallPaths(array $paths, $name, $type)
121
+ {
122
+ foreach ($paths as $path => $names) {
123
+ if (in_array($name, $names) || in_array('type:' . $type, $names)) {
124
+ return $path;
125
+ }
126
+ }
127
+
128
+ return false;
129
+ }
130
+ }
vendor/composer/installers/src/Composer/Installers/CakePHPInstaller.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class CakePHPInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'plugin' => 'Plugin/{$name}/',
8
+ );
9
+
10
+ /**
11
+ * Format package name to CamelCase
12
+ */
13
+ public function inflectPackageVars($vars)
14
+ {
15
+ $vars['name'] = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
16
+ $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
17
+ $vars['name'] = str_replace(' ', '', ucwords($vars['name']));
18
+
19
+ return $vars;
20
+ }
21
+ }
vendor/composer/installers/src/Composer/Installers/CodeIgniterInstaller.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class CodeIgniterInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'library' => 'application/libraries/{$name}/',
8
+ 'third-party' => 'application/third_party/{$name}/',
9
+ 'module' => 'application/modules/{$name}/',
10
+ );
11
+ }
vendor/composer/installers/src/Composer/Installers/CroogoInstaller.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class CroogoInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'plugin' => 'Plugin/{$name}/',
8
+ 'theme' => 'View/Themed/{$name}/',
9
+ );
10
+
11
+ /**
12
+ * Format package name to CamelCase
13
+ */
14
+ public function inflectPackageVars($vars)
15
+ {
16
+ $vars['name'] = strtolower(str_replace(array('-', '_'), ' ', $vars['name']));
17
+ $vars['name'] = str_replace(' ', '', ucwords($vars['name']));
18
+
19
+ return $vars;
20
+ }
21
+ }
vendor/composer/installers/src/Composer/Installers/DrupalInstaller.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class DrupalInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'module' => 'modules/{$name}/',
8
+ 'theme' => 'themes/{$name}/',
9
+ 'profile' => 'profiles/{$name}/',
10
+ 'drush' => 'drush/{$name}/',
11
+ );
12
+ }
vendor/composer/installers/src/Composer/Installers/FuelInstaller.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class FuelInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'module' => 'fuel/app/modules/{$name}/',
8
+ 'package' => 'fuel/packages/{$name}/',
9
+ );
10
+ }
vendor/composer/installers/src/Composer/Installers/Installer.php ADDED
@@ -0,0 +1,128 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ use Composer\Installer\LibraryInstaller;
5
+ use Composer\Package\PackageInterface;
6
+ use Composer\Repository\InstalledRepositoryInterface;
7
+
8
+ class Installer extends LibraryInstaller
9
+ {
10
+ /**
11
+ * Package types to installer class map
12
+ *
13
+ * @var array
14
+ */
15
+ private $supportedTypes = array(
16
+ 'agl' => 'AglInstaller',
17
+ 'annotatecms' => 'AnnotateCmsInstaller',
18
+ 'cakephp' => 'CakePHPInstaller',
19
+ 'codeigniter' => 'CodeIgniterInstaller',
20
+ 'croogo' => 'CroogoInstaller',
21
+ 'drupal' => 'DrupalInstaller',
22
+ 'fuel' => 'FuelInstaller',
23
+ 'joomla' => 'JoomlaInstaller',
24
+ 'kohana' => 'KohanaInstaller',
25
+ 'laravel' => 'LaravelInstaller',
26
+ 'lithium' => 'LithiumInstaller',
27
+ 'magento' => 'MagentoInstaller',
28
+ 'mako' => 'MakoInstaller',
29
+ 'mediawiki' => 'MediaWikiInstaller',
30
+ 'modulework' => 'MODULEWorkInstaller',
31
+ 'oxid' => 'OxidInstaller',
32
+ 'phpbb' => 'PhpBBInstaller',
33
+ 'ppi' => 'PPIInstaller',
34
+ 'silverstripe' => 'SilverStripeInstaller',
35
+ 'symfony1' => 'Symfony1Installer',
36
+ 'wordpress' => 'WordPressInstaller',
37
+ 'zend' => 'ZendInstaller',
38
+ 'typo3-flow' => 'TYPO3FlowInstaller',
39
+ 'typo3-cms' => 'TYPO3CmsInstaller',
40
+ );
41
+
42
+ /**
43
+ * {@inheritDoc}
44
+ */
45
+ public function getInstallPath(PackageInterface $package)
46
+ {
47
+ $type = $package->getType();
48
+ $frameworkType = $this->findFrameworkType($type);
49
+
50
+ if ($frameworkType === false) {
51
+ throw new \InvalidArgumentException(
52
+ 'Sorry the package type of this package is not yet supported.'
53
+ );
54
+ }
55
+
56
+ $class = 'Composer\\Installers\\' . $this->supportedTypes[$frameworkType];
57
+ $installer = new $class($package, $this->composer);
58
+
59
+ return $installer->getInstallPath($package, $frameworkType);
60
+ }
61
+
62
+ public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
63
+ {
64
+ if (!$repo->hasPackage($package)) {
65
+ throw new \InvalidArgumentException('Package is not installed: '.$package);
66
+ }
67
+
68
+ $repo->removePackage($package);
69
+
70
+ $installPath = $this->getInstallPath($package);
71
+ $this->io->write(sprintf('Deleting %s - %s', $installPath, $this->filesystem->removeDirectory($installPath) ? '<comment>deleted</comment>' : '<error>not deleted</error>'));
72
+ }
73
+
74
+ /**
75
+ * {@inheritDoc}
76
+ */
77
+ public function supports($packageType)
78
+ {
79
+ $frameworkType = $this->findFrameworkType($packageType);
80
+
81
+ if ($frameworkType === false) {
82
+ return false;
83
+ }
84
+
85
+ $locationPattern = $this->getLocationPattern($frameworkType);
86
+ return preg_match('#' . $frameworkType . '-' . $locationPattern . '#', $packageType, $matches) === 1;
87
+ }
88
+
89
+ /**
90
+ * Finds a supported framework type if it exists and returns it
91
+ *
92
+ * @param string $type
93
+ * @return string
94
+ */
95
+ protected function findFrameworkType($type)
96
+ {
97
+ $frameworkType = false;
98
+
99
+ foreach ($this->supportedTypes as $key => $val) {
100
+ if ($key === substr($type, 0, strlen($key))) {
101
+ $frameworkType = substr($type, 0, strlen($key));
102
+ break;
103
+ }
104
+ }
105
+
106
+ return $frameworkType;
107
+ }
108
+
109
+ /**
110
+ * Get the second part of the regular expression to check for support of a
111
+ * package type
112
+ *
113
+ * @param string $frameworkType
114
+ * @return string
115
+ */
116
+ protected function getLocationPattern($frameworkType)
117
+ {
118
+ $pattern = false;
119
+ if (!empty($this->supportedTypes[$frameworkType])) {
120
+ $frameworkClass = 'Composer\\Installers\\' . $this->supportedTypes[$frameworkType];
121
+ /** @var BaseInstaller $framework */
122
+ $framework = new $frameworkClass;
123
+ $locations = array_keys($framework->getLocations());
124
+ $pattern = $locations ? '(' . implode('|', $locations) . ')' : false;
125
+ }
126
+ return $pattern ? : '(\w+)';
127
+ }
128
+ }
vendor/composer/installers/src/Composer/Installers/JoomlaInstaller.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class JoomlaInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'component' => 'components/{$name}/',
8
+ 'module' => 'modules/{$name}/',
9
+ 'template' => 'templates/{$name}/',
10
+ 'plugin' => 'plugins/{$name}/',
11
+ 'library' => 'libraries/{$name}/',
12
+ );
13
+
14
+ // TODO: Add inflector for mod_ and com_ names
15
+ }
vendor/composer/installers/src/Composer/Installers/KohanaInstaller.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class KohanaInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'module' => 'modules/{$name}/',
8
+ );
9
+ }
vendor/composer/installers/src/Composer/Installers/LaravelInstaller.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class LaravelInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'library' => 'libraries/{$name}/',
8
+ );
9
+ }
vendor/composer/installers/src/Composer/Installers/LithiumInstaller.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class LithiumInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'library' => 'libraries/{$name}/',
8
+ 'source' => 'libraries/_source/{$name}/',
9
+ );
10
+ }
vendor/composer/installers/src/Composer/Installers/MODULEWorkInstaller.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class MODULEWorkInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'module' => 'modules/{$name}/',
8
+ );
9
+ }
vendor/composer/installers/src/Composer/Installers/MagentoInstaller.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class MagentoInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'theme' => 'app/design/frontend/{$name}/',
8
+ 'skin' => 'skin/frontend/default/{$name}/',
9
+ 'library' => 'lib/{$name}/',
10
+ );
11
+ }
vendor/composer/installers/src/Composer/Installers/MakoInstaller.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class MakoInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'package' => 'app/packages/{$name}/',
8
+ );
9
+ }
vendor/composer/installers/src/Composer/Installers/MediaWikiInstaller.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class MediaWikiInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'extension' => 'extensions/{$name}/',
8
+ );
9
+
10
+ /**
11
+ * Format package name to CamelCase keeping existing uppercase chars.
12
+ */
13
+ public function inflectPackageVars($vars)
14
+ {
15
+ $vars['name'] = str_replace('-', ' ', $vars['name']);
16
+ $vars['name'] = str_replace(' ', '', ucwords($vars['name']));
17
+
18
+ return $vars;
19
+ }
20
+
21
+ }
vendor/composer/installers/src/Composer/Installers/OxidInstaller.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class OxidInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'module' => 'modules/{$name}/',
8
+ );
9
+ }
vendor/composer/installers/src/Composer/Installers/PPIInstaller.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class PPIInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'module' => 'modules/{$name}/',
8
+ );
9
+ }
vendor/composer/installers/src/Composer/Installers/PhpBBInstaller.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class PhpBBInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'extension' => 'ext/{$vendor}/{$name}/',
8
+ 'language' => 'language/{$name}/',
9
+ 'style' => 'styles/{$name}/',
10
+ );
11
+ }
vendor/composer/installers/src/Composer/Installers/SilverStripeInstaller.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ use Composer\Package\PackageInterface;
5
+
6
+ class SilverStripeInstaller extends BaseInstaller
7
+ {
8
+ protected $locations = array(
9
+ 'module' => '{$name}/',
10
+ 'theme' => 'themes/{$name}/',
11
+ );
12
+
13
+ /**
14
+ * Return the install path based on package type.
15
+ *
16
+ * Relies on built-in BaseInstaller behaviour with one exception: silverstripe/framework
17
+ * must be installed to 'sapphire' and not 'framework' if the version is <3.0.0
18
+ *
19
+ * @param PackageInterface $package
20
+ * @param string $frameworkType
21
+ * @return string
22
+ */
23
+ public function getInstallPath(PackageInterface $package, $frameworkType = '')
24
+ {
25
+ if (
26
+ $package->getName() == 'silverstripe/framework'
27
+ && preg_match('/^\d+\.\d+\.\d+/', $package->getVersion())
28
+ && version_compare($package->getVersion(), '2.999.999') < 0
29
+ ) {
30
+ return $this->templatePath($this->locations['module'], array('name' => 'sapphire'));
31
+ } else {
32
+ return parent::getInstallPath($package, $frameworkType);
33
+ }
34
+
35
+ }
36
+ }
vendor/composer/installers/src/Composer/Installers/Symfony1Installer.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ /**
5
+ * Plugin installer for symfony 1.x
6
+ *
7
+ * @author Jérôme Tamarelle <jerome@tamarelle.net>
8
+ */
9
+ class Symfony1Installer extends BaseInstaller
10
+ {
11
+ protected $locations = array(
12
+ 'plugin' => 'plugins/{$name}/',
13
+ );
14
+
15
+ /**
16
+ * Format package name to CamelCase
17
+ */
18
+ public function inflectPackageVars($vars)
19
+ {
20
+ $vars['name'] = preg_replace_callback('/(-[a-z])/', function ($matches) {
21
+ return strtoupper($matches[0][1]);
22
+ }, $vars['name']);
23
+
24
+ return $vars;
25
+ }
26
+ }
vendor/composer/installers/src/Composer/Installers/TYPO3CmsInstaller.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ /**
5
+ * Extension installer for TYPO3 CMS
6
+ *
7
+ * @author Sascha Egerer <sascha.egerer@dkd.de>
8
+ */
9
+ class TYPO3CmsInstaller extends BaseInstaller
10
+ {
11
+ protected $locations = array(
12
+ 'extension' => 'typo3conf/ext/{$name}/',
13
+ );
14
+ }
vendor/composer/installers/src/Composer/Installers/TYPO3FlowInstaller.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ /**
5
+ * An installer to handle TYPO3 Flow specifics when installing packages.
6
+ */
7
+ class TYPO3FlowInstaller extends BaseInstaller
8
+ {
9
+ protected $locations = array(
10
+ 'package' => 'Packages/Application/{$name}/',
11
+ 'framework' => 'Packages/Framework/{$name}/',
12
+ 'plugin' => 'Packages/Plugins/{$name}/',
13
+ 'site' => 'Packages/Sites/{$name}/',
14
+ 'boilerplate' => 'Packages/Boilerplates/{$name}/',
15
+ 'build' => 'Build/{$name}/',
16
+ );
17
+
18
+ /**
19
+ * Modify the package name to be a TYPO3 Flow style key.
20
+ *
21
+ * @param array $vars
22
+ * @return array
23
+ */
24
+ public function inflectPackageVars($vars)
25
+ {
26
+ $autoload = $this->package->getAutoload();
27
+ if (isset($autoload['psr-0']) && is_array($autoload['psr-0'])) {
28
+ $namespace = key($autoload['psr-0']);
29
+ $vars['name'] = str_replace('\\', '.', $namespace);
30
+ }
31
+ return $vars;
32
+ }
33
+ }
vendor/composer/installers/src/Composer/Installers/WordPressInstaller.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class WordPressInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'plugin' => 'wp-content/plugins/{$name}/',
8
+ 'theme' => 'wp-content/themes/{$name}/',
9
+ 'muplugin' => 'wp-content/mu-plugins/{$name}/',
10
+ );
11
+ }
vendor/composer/installers/src/Composer/Installers/ZendInstaller.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class ZendInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'library' => 'library/{$name}/',
8
+ 'extra' => 'extras/library/{$name}/',
9
+ );
10
+ }
vendor/composer/installers/src/bootstrap.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ function includeIfExists($file)
3
+ {
4
+ if (file_exists($file)) {
5
+ return include $file;
6
+ }
7
+ }
8
+ if ((!$loader = includeIfExists(__DIR__ . '/../vendor/autoload.php')) && (!$loader = includeIfExists(__DIR__ . '/../../../autoload.php'))) {
9
+ die('You must set up the project dependencies, run the following commands:'.PHP_EOL.
10
+ 'curl -s http://getcomposer.org/installer | php'.PHP_EOL.
11
+ 'php composer.phar install'.PHP_EOL);
12
+ }
13
+ return $loader;
vendor/composer/installers/tests/Composer/Installers/Test/CakePHPInstallerTest.php ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers\Test;
3
+
4
+ use Composer\Package\Package;
5
+ use Composer\Composer;
6
+ use Composer\Config;
7
+
8
+ class CakePHPInstallerTest extends TestCase
9
+ {
10
+ private $composer;
11
+ private $config;
12
+ private $vendorDir;
13
+ private $binDir;
14
+ private $dm;
15
+ private $repository;
16
+ private $io;
17
+ private $fs;
18
+
19
+ /**
20
+ * setUp
21
+ *
22
+ * @return void
23
+ */
24
+ public function setUp()
25
+ {
26
+ $this->package = new Package('CamelCased', '1.0', '1.0');
27
+ $this->io = $this->getMock('Composer\IO\PackageInterface');
28
+ $this->composer = new Composer();
29
+ }
30
+
31
+ /**
32
+ * tearDown
33
+ *
34
+ * @return void
35
+ */
36
+ public function tearDown()
37
+ {
38
+
39
+ }
40
+
41
+ /**
42
+ * testInflectPackageVars
43
+ *
44
+ * @return void
45
+ */
46
+ public function testInflectPackageVars()
47
+ {
48
+ $installer = new \Composer\Installers\CakePHPInstaller($this->package, $this->composer);
49
+ $result = $installer->inflectPackageVars(array('name' => 'CamelCased'));
50
+ $this->assertEquals($result, array('name' => 'CamelCased'));
51
+
52
+ $installer = new \Composer\Installers\CakePHPInstaller($this->package, $this->composer);
53
+ $result = $installer->inflectPackageVars(array('name' => 'with-dash'));
54
+ $this->assertEquals($result, array('name' => 'WithDash'));
55
+
56
+ $installer = new \Composer\Installers\CakePHPInstaller($this->package, $this->composer);
57
+ $result = $installer->inflectPackageVars(array('name' => 'with_underscore'));
58
+ $this->assertEquals($result, array('name' => 'WithUnderscore'));
59
+ }
60
+
61
+ }
vendor/composer/installers/tests/Composer/Installers/Test/InstallerTest.php ADDED
@@ -0,0 +1,309 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers\Test;
3
+
4
+ use Composer\Installers\Installer;
5
+ use Composer\Util\Filesystem;
6
+ use Composer\Package\Package;
7
+ use Composer\Package\RootPackage;
8
+ use Composer\Composer;
9
+ use Composer\Config;
10
+
11
+ class InstallerTest extends TestCase
12
+ {
13
+ private $composer;
14
+ private $config;
15
+ private $vendorDir;
16
+ private $binDir;
17
+ private $dm;
18
+ private $repository;
19
+ private $io;
20
+ private $fs;
21
+
22
+ /**
23
+ * setUp
24
+ *
25
+ * @return void
26
+ */
27
+ public function setUp()
28
+ {
29
+ $this->fs = new Filesystem;
30
+
31
+ $this->composer = new Composer();
32
+ $this->config = new Config();
33
+ $this->composer->setConfig($this->config);
34
+
35
+ $this->vendorDir = realpath(sys_get_temp_dir()) . DIRECTORY_SEPARATOR . 'baton-test-vendor';
36
+ $this->ensureDirectoryExistsAndClear($this->vendorDir);
37
+
38
+ $this->binDir = realpath(sys_get_temp_dir()) . DIRECTORY_SEPARATOR . 'baton-test-bin';
39
+ $this->ensureDirectoryExistsAndClear($this->binDir);
40
+
41
+ $this->config->merge(array(
42
+ 'config' => array(
43
+ 'vendor-dir' => $this->vendorDir,
44
+ 'bin-dir' => $this->binDir,
45
+ ),
46
+ ));
47
+
48
+ $this->dm = $this->getMockBuilder('Composer\Downloader\DownloadManager')
49
+ ->disableOriginalConstructor()
50
+ ->getMock();
51
+ $this->composer->setDownloadManager($this->dm);
52
+
53
+ $this->repository = $this->getMock('Composer\Repository\InstalledRepositoryInterface');
54
+ $this->io = $this->getMock('Composer\IO\IOInterface');
55
+ }
56
+
57
+ /**
58
+ * tearDown
59
+ *
60
+ * @return void
61
+ */
62
+ public function tearDown()
63
+ {
64
+ $this->fs->removeDirectory($this->vendorDir);
65
+ $this->fs->removeDirectory($this->binDir);
66
+ }
67
+
68
+ /**
69
+ * testSupports
70
+ *
71
+ * @return void
72
+ *
73
+ * @dataProvider dataForTestSupport
74
+ */
75
+ public function testSupports($type, $expected)
76
+ {
77
+ $installer = new Installer($this->io, $this->composer);
78
+ $this->assertSame($expected, $installer->supports($type), sprintf('Failed to show support for %s', $type));
79
+ }
80
+
81
+ /**
82
+ * dataForTestSupport
83
+ */
84
+ public function dataForTestSupport()
85
+ {
86
+ return array(
87
+ array('agl-module', true),
88
+ array('annotatecms-module', true),
89
+ array('annotatecms-component', true),
90
+ array('annotatecms-service', true),
91
+ array('cakephp', false),
92
+ array('cakephp-', false),
93
+ array('cakephp-app', false),
94
+ array('cakephp-plugin', true),
95
+ array('codeigniter-app', false),
96
+ array('codeigniter-library', true),
97
+ array('codeigniter-third-party', true),
98
+ array('codeigniter-module', true),
99
+ array('croogo-plugin', true),
100
+ array('croogo-theme', true),
101
+ array('drupal-module', true),
102
+ array('fuel-module', true),
103
+ array('fuel-package', true),
104
+ array('joomla-library', true),
105
+ array('kohana-module', true),
106
+ array('laravel-library', true),
107
+ array('lithium-library', true),
108
+ array('magento-library', true),
109
+ array('mako-package', true),
110
+ array('mediawiki-extension', true),
111
+ array('modulework-module', true),
112
+ array('phpbb-extension', true),
113
+ array('ppi-module', true),
114
+ array('silverstripe-module', true),
115
+ array('silverstripe-theme', true),
116
+ array('symfony1-plugin', true),
117
+ array('typo3-flow-plugin', true),
118
+ array('typo3-cms-extension', true),
119
+ array('wordpress-plugin', true),
120
+ array('wordpress-core', false),
121
+ array('zend-library', true),
122
+ );
123
+ }
124
+
125
+ /**
126
+ * testInstallPath
127
+ *
128
+ * @dataProvider dataForTestInstallPath
129
+ */
130
+ public function testInstallPath($type, $path, $name, $version = '1.0.0')
131
+ {
132
+ $installer = new Installer($this->io, $this->composer);
133
+ $package = new Package($name, $version, $version);
134
+
135
+ $package->setType($type);
136
+ $result = $installer->getInstallPath($package);
137
+ $this->assertEquals($path, $result);
138
+ }
139
+
140
+ /**
141
+ * dataFormTestInstallPath
142
+ */
143
+ public function dataForTestInstallPath()
144
+ {
145
+ return array(
146
+ array('agl-module', 'More/MyTestPackage/', 'agl/my_test-package'),
147
+ array('annotatecms-module', 'addons/modules/my_module/', 'vysinsky/my_module'),
148
+ array('annotatecms-component', 'addons/components/my_component/', 'vysinsky/my_component'),
149
+ array('annotatecms-service', 'addons/services/my_service/', 'vysinsky/my_service'),
150
+ array('cakephp-plugin', 'Plugin/Ftp/', 'shama/ftp'),
151
+ array('codeigniter-library', 'application/libraries/my_package/', 'shama/my_package'),
152
+ array('codeigniter-module', 'application/modules/my_package/', 'shama/my_package'),
153
+ array('croogo-plugin', 'Plugin/Sitemaps/', 'fahad19/sitemaps'),
154
+ array('croogo-theme', 'View/Themed/Readable/', 'rchavik/readable'),
155
+ array('drupal-module', 'modules/my_module/', 'shama/my_module'),
156
+ array('drupal-theme', 'themes/my_module/', 'shama/my_module'),
157
+ array('drupal-profile', 'profiles/my_module/', 'shama/my_module'),
158
+ array('drupal-drush', 'drush/my_module/', 'shama/my_module'),
159
+ array('fuel-module', 'fuel/app/modules/module/', 'fuel/module'),
160
+ array('fuel-package', 'fuel/packages/orm/', 'fuel/orm'),
161
+ array('joomla-plugin', 'plugins/my_plugin/', 'shama/my_plugin'),
162
+ array('kohana-module', 'modules/my_package/', 'shama/my_package'),
163
+ array('laravel-library', 'libraries/my_package/', 'shama/my_package'),
164
+ array('lithium-library', 'libraries/li3_test/', 'user/li3_test'),
165
+ array('magento-library', 'lib/foo/', 'test/foo'),
166
+ array('mako-package', 'app/packages/my_package/', 'shama/my_package'),
167
+ array('mediawiki-extension', 'extensions/APC/', 'author/APC' ),
168
+ array('mediawiki-extension', 'extensions/UploadWizard/', 'author/upload-wizard' ),
169
+ array('mediawiki-extension', 'extensions/SyntaxHighlight_GeSHi/', 'author/syntax-highlight_GeSHi' ),
170
+ array('modulework-module', 'modules/my_package/', 'shama/my_package'),
171
+ array('phpbb-extension', 'ext/test/foo/', 'test/foo'),
172
+ array('phpbb-style', 'styles/foo/', 'test/foo'),
173
+ array('phpbb-language', 'language/foo/', 'test/foo'),
174
+ array('ppi-module', 'modules/foo/', 'test/foo'),
175
+ array('silverstripe-module', 'my_module/', 'shama/my_module'),
176
+ array('silverstripe-module', 'sapphire/', 'silverstripe/framework', '2.4.0'),
177
+ array('silverstripe-module', 'framework/', 'silverstripe/framework', '3.0.0'),
178
+ array('silverstripe-module', 'framework/', 'silverstripe/framework', '3.0.0-rc1'),
179
+ array('silverstripe-module', 'framework/', 'silverstripe/framework', 'my/branch'),
180
+ array('silverstripe-theme', 'themes/my_theme/', 'shama/my_theme'),
181
+ array('symfony1-plugin', 'plugins/sfShamaPlugin/', 'shama/sfShamaPlugin'),
182
+ array('symfony1-plugin', 'plugins/sfShamaPlugin/', 'shama/sf-shama-plugin'),
183
+ array('typo3-flow-package', 'Packages/Application/my_package/', 'shama/my_package'),
184
+ array('typo3-flow-build', 'Build/my_package/', 'shama/my_package'),
185
+ array('typo3-cms-extension', 'typo3conf/ext/my_extension/', 'shama/my_extension'),
186
+ array('wordpress-plugin', 'wp-content/plugins/my_plugin/', 'shama/my_plugin'),
187
+ array('wordpress-muplugin', 'wp-content/mu-plugins/my_plugin/', 'shama/my_plugin'),
188
+ array('zend-extra', 'extras/library/zend_test/', 'shama/zend_test'),
189
+ );
190
+ }
191
+
192
+ /**
193
+ * testGetCakePHPInstallPathException
194
+ *
195
+ * @return void
196
+ *
197
+ * @expectedException \InvalidArgumentException
198
+ */
199
+ public function testGetCakePHPInstallPathException()
200
+ {
201
+ $installer = new Installer($this->io, $this->composer);
202
+ $package = new Package('shama/ftp', '1.0.0', '1.0.0');
203
+
204
+ $package->setType('cakephp-whoops');
205
+ $result = $installer->getInstallPath($package);
206
+ }
207
+
208
+ /**
209
+ * testCustomInstallPath
210
+ */
211
+ public function testCustomInstallPath()
212
+ {
213
+ $installer = new Installer($this->io, $this->composer);
214
+ $package = new Package('shama/ftp', '1.0.0', '1.0.0');
215
+ $package->setType('cakephp-plugin');
216
+ $consumerPackage = new RootPackage('foo/bar', '1.0.0', '1.0.0');
217
+ $this->composer->setPackage($consumerPackage);
218
+ $consumerPackage->setExtra(array(
219
+ 'installer-paths' => array(
220
+ 'my/custom/path/{$name}/' => array(
221
+ 'shama/ftp',
222
+ 'foo/bar',
223
+ ),
224
+ ),
225
+ ));
226
+ $result = $installer->getInstallPath($package);
227
+ $this->assertEquals('my/custom/path/Ftp/', $result);
228
+ }
229
+
230
+ /**
231
+ * testCustomInstallerName
232
+ */
233
+ public function testCustomInstallerName() {
234
+ $installer = new Installer($this->io, $this->composer);
235
+ $package = new Package('shama/cakephp-ftp-plugin', '1.0.0', '1.0.0');
236
+ $package->setType('cakephp-plugin');
237
+ $package->setExtra(array(
238
+ 'installer-name' => 'FTP',
239
+ ));
240
+ $result = $installer->getInstallPath($package);
241
+ $this->assertEquals('Plugin/FTP/', $result);
242
+ }
243
+
244
+ /**
245
+ * testCustomTypePath
246
+ */
247
+ public function testCustomTypePath() {
248
+ $installer = new Installer($this->io, $this->composer);
249
+ $package = new Package('slbmeh/my_plugin', '1.0.0', '1.0.0');
250
+ $package->setType('wordpress-plugin');
251
+ $consumerPackage = new RootPackage('foo/bar', '1.0.0', '1.0.0');
252
+ $this->composer->setPackage($consumerPackage);
253
+ $consumerPackage->setExtra(array(
254
+ 'installer-paths' => array(
255
+ 'my/custom/path/{$name}/' => array(
256
+ 'type:wordpress-plugin'
257
+ ),
258
+ ),
259
+ ));
260
+ $result = $installer->getInstallPath($package);
261
+ $this->assertEquals('my/custom/path/my_plugin/', $result);
262
+ }
263
+
264
+ /**
265
+ * testNoVendorName
266
+ */
267
+ public function testNoVendorName()
268
+ {
269
+ $installer = new Installer($this->io, $this->composer);
270
+ $package = new Package('sfPhpunitPlugin', '1.0.0', '1.0.0');
271
+
272
+ $package->setType('symfony1-plugin');
273
+ $result = $installer->getInstallPath($package);
274
+ $this->assertEquals('plugins/sfPhpunitPlugin/', $result);
275
+ }
276
+
277
+ /**
278
+ * testTypo3Inflection
279
+ */
280
+ public function testTypo3Inflection()
281
+ {
282
+ $installer = new Installer($this->io, $this->composer);
283
+ $package = new Package('typo3/fluid', '1.0.0', '1.0.0');
284
+
285
+ $package->setAutoload(array(
286
+ 'psr-0' => array(
287
+ 'TYPO3\\Fluid' => 'Classes',
288
+ ),
289
+ ));
290
+
291
+ $package->setType('typo3-flow-package');
292
+ $result = $installer->getInstallPath($package);
293
+ $this->assertEquals('Packages/Application/TYPO3.Fluid/', $result);
294
+ }
295
+
296
+ public function testUninstallAndDeletePackageFromLocalRepo()
297
+ {
298
+ $package = new Package('foo', '1.0.0', '1.0.0');
299
+
300
+ $installer = $this->getMock('Composer\Installers\Installer', array('getInstallPath'), array($this->io, $this->composer));
301
+ $installer->expects($this->once())->method('getInstallPath')->with($package)->will($this->returnValue(sys_get_temp_dir().'/foo'));
302
+
303
+ $repo = $this->getMock('Composer\Repository\InstalledRepositoryInterface');
304
+ $repo->expects($this->once())->method('hasPackage')->with($package)->will($this->returnValue(true));
305
+ $repo->expects($this->once())->method('removePackage')->with($package);
306
+
307
+ $installer->uninstall($repo, $package);
308
+ }
309
+ }
vendor/composer/installers/tests/Composer/Installers/Test/TestCase.php ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * This file is part of Composer.
5
+ *
6
+ * (c) Nils Adermann <naderman@naderman.de>
7
+ * Jordi Boggiano <j.boggiano@seld.be>
8
+ *
9
+ * For the full copyright and license information, please view the LICENSE
10
+ * file that was distributed with this source code.
11
+ */
12
+
13
+ namespace Composer\Installers\Test;
14
+
15
+ use Composer\Package\Version\VersionParser;
16
+ use Composer\Package\Package;
17
+ use Composer\Package\AliasPackage;
18
+ use Composer\Package\LinkConstraint\VersionConstraint;
19
+ use Composer\Util\Filesystem;
20
+
21
+ abstract class TestCase extends \PHPUnit_Framework_TestCase
22
+ {
23
+ private static $parser;
24
+
25
+ protected static function getVersionParser()
26
+ {
27
+ if (!self::$parser) {
28
+ self::$parser = new VersionParser();
29
+ }
30
+
31
+ return self::$parser;
32
+ }
33
+
34
+ protected function getVersionConstraint($operator, $version)
35
+ {
36
+ return new VersionConstraint(
37
+ $operator,
38
+ self::getVersionParser()->normalize($version)
39
+ );
40
+ }
41
+
42
+ protected function getPackage($name, $version)
43
+ {
44
+ $normVersion = self::getVersionParser()->normalize($version);
45
+
46
+ return new Package($name, $normVersion, $version);
47
+ }
48
+
49
+ protected function getAliasPackage($package, $version)
50
+ {
51
+ $normVersion = self::getVersionParser()->normalize($version);
52
+
53
+ return new AliasPackage($package, $normVersion, $version);
54
+ }
55
+
56
+ protected function ensureDirectoryExistsAndClear($directory)
57
+ {
58
+ $fs = new Filesystem();
59
+ if (is_dir($directory)) {
60
+ $fs->removeDirectory($directory);
61
+ }
62
+ mkdir($directory, 0777, true);
63
+ }
64
+ }
vendor/composer/installers/tests/bootstrap.php ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <?php
2
+
3
+ $loader = require __DIR__ . '/../src/bootstrap.php';
4
+ $loader->add('Composer\Installers\Test', __DIR__);