Nested Pages - Version 1.5.0

Version Description

  • Links now include all taxonomies/post types, enabling full control over the primary site menu from the Nested Pages interface. Start adding menu items by selecting "Add Link" from the top, or the link button on a specific row to add a child item.
  • Escape key closing of modal windows added.
  • Category filtering added to pages if categories enabled
Download this release

Release Info

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

Code changes from version 1.4.1 to 1.5.0

Files changed (84) hide show
  1. app/Activation/Activate.php +5 -9
  2. app/Activation/Dependencies.php +5 -7
  3. app/Activation/Updates/Updates.php +5 -9
  4. app/Bootstrap.php +6 -7
  5. app/Config/Settings.php +6 -9
  6. app/Config/SettingsRepository.php +16 -2
  7. app/Entities/AdminMenu/AdminMenu.php +5 -3
  8. app/Entities/AdminMenu/AdminSubmenu.php +5 -4
  9. app/Entities/AdminMenu/AdminSubmenuDefault.php +5 -5
  10. app/Entities/AdminMenu/AdminSubmenuExpander.php +5 -8
  11. app/Entities/AdminMenu/EnabledMenus.php +5 -8
  12. app/Entities/Confirmation/ConfirmationFactory.php +5 -6
  13. app/Entities/Confirmation/ConfirmationInterface.php +5 -2
  14. app/Entities/Confirmation/LinkDeletedConfirmation.php +6 -3
  15. app/Entities/Confirmation/TrashConfirmation.php +6 -2
  16. app/Entities/Confirmation/TrashRestoredConfirmation.php +6 -2
  17. app/Entities/DefaultList/DefaultListFactory.php +5 -2
  18. app/Entities/DefaultList/NestedViewLink.php +5 -4
  19. app/Entities/Listing/Listing.php +32 -16
  20. app/Entities/Listing/ListingActions.php +4 -3
  21. app/Entities/Listing/ListingRepository.php +51 -2
  22. app/Entities/NavMenu/NavMenuActions.php +5 -2
  23. app/Entities/NavMenu/NavMenuRemoveItem.php +5 -2
  24. app/Entities/NavMenu/NavMenuRepository.php +17 -61
  25. app/Entities/NavMenu/NavMenuSync.php +5 -6
  26. app/Entities/NavMenu/NavMenuSyncInterface.php +0 -10
  27. app/Entities/NavMenu/NavMenuSyncListing.php +36 -51
  28. app/Entities/NavMenu/NavMenuSyncMenu.php +15 -12
  29. app/Entities/NavMenu/NavMenuTrashActions.php +5 -2
  30. app/Entities/PluginIntegration/EditorialAccessManager.php +5 -5
  31. app/Entities/PluginIntegration/IntegrationFactory.php +5 -2
  32. app/Entities/Post/PostDataFactory.php +41 -22
  33. app/Entities/Post/PostFactory.php +5 -5
  34. app/Entities/Post/PostRepository.php +6 -8
  35. app/Entities/Post/PostTrashActions.php +7 -6
  36. app/Entities/Post/PostUpdateRepository.php +41 -34
  37. app/Entities/PostType/PostTypeRepository.php +18 -12
  38. app/Entities/PostType/RegisterPostTypes.php +5 -3
  39. app/Entities/User/UserRepository.php +6 -9
  40. app/Form/{FormActionFactory.php → Events.php} +13 -9
  41. app/Form/Handlers/NewLinkHandler.php +0 -59
  42. app/Form/{Handlers → Listeners}/BaseHandler.php +5 -7
  43. app/Form/Listeners/CategoryFilter.php +48 -0
  44. app/Form/{Handlers/ClonePostHandler.php → Listeners/ClonePost.php} +2 -2
  45. app/Form/{Handlers/EmptyTrashHandler.php → Listeners/EmptyTrash.php} +5 -2
  46. app/Form/{Handlers/GetTaxonomiesHandler.php → Listeners/GetTaxonomies.php} +6 -6
  47. app/Form/{Handlers/ListingSortHandler.php → Listeners/ListingSort.php} +6 -8
  48. app/Form/Listeners/MenuSearch.php +84 -0
  49. app/Form/{Handlers/NestToggleHandler.php → Listeners/NestToggle.php} +5 -4
  50. app/Form/{Handlers/NewChildHandler.php → Listeners/NewChild.php} +6 -8
  51. app/Form/Listeners/NewMenuItem.php +77 -0
  52. app/Form/{Handlers/QuickEditHandler.php → Listeners/QuickEdit.php} +5 -6
  53. app/Form/{Handlers/QuickEditLinkHandler.php → Listeners/QuickEditLink.php} +7 -6
  54. app/Form/{Handlers/SearchHandler.php → Listeners/Search.php} +5 -2
  55. app/Form/{Handlers/SortHandler.php → Listeners/Sort.php} +6 -6
  56. app/Form/{Handlers/SyncMenuHandler.php → Listeners/SyncMenu.php} +5 -3
  57. app/Form/Validation/Validation.php +5 -14
  58. app/Helpers.php +6 -5
  59. app/NestedPages.php +3 -3
  60. app/Redirects.php +6 -9
  61. app/Views/forms/link-form.php +91 -86
  62. app/Views/forms/quickedit-link.php +7 -4
  63. app/Views/listing.php +2 -2
  64. app/Views/partials/row-link.php +9 -1
  65. app/Views/partials/row.php +8 -2
  66. app/Views/partials/tool-list.php +28 -0
  67. app/Views/settings/settings-general.php +12 -0
  68. assets/css/nestedpages.css +1 -1
  69. assets/js/lib/nestedpages-factory.js +19 -3
  70. assets/js/lib/nestedpages-old.js +0 -1563
  71. assets/js/lib/nestedpages.menu-links.js +272 -0
  72. assets/js/lib/nestedpages.menu-search.js +131 -0
  73. assets/js/lib/nestedpages.nesting.js +1 -3
  74. assets/js/lib/nestedpages.new-link.js +2 -2
  75. assets/js/lib/nestedpages.new-page.js +1 -2
  76. assets/js/lib/nestedpages.quickedit-link.js +30 -7
  77. assets/js/lib/nestedpages.quickedit-post.js +4 -2
  78. assets/js/lib/nestedpages.sync-menu-setting.js +8 -3
  79. assets/js/lib/nestedpages.tabs.js +42 -0
  80. assets/js/nestedpages.min.js +508 -177
  81. languages/nestedpages.mo +0 -0
  82. languages/nestedpages.pot +145 -109
  83. nestedpages.php +2 -2
  84. readme.txt +9 -4
app/Activation/Activate.php CHANGED
@@ -1,12 +1,14 @@
1
- <?php namespace NestedPages\Activation;
 
 
2
 
3
  use NestedPages\Activation\Updates\Updates;
4
 
5
  /**
6
  * Plugin Activation
7
  */
8
- class Activate {
9
-
10
  /**
11
  * Plugin Version
12
  */
@@ -18,7 +20,6 @@ class Activate {
18
  */
19
  private $updates;
20
 
21
-
22
  public function __construct()
23
  {
24
  $this->setVersion();
@@ -26,7 +27,6 @@ class Activate {
26
  $this->install();
27
  }
28
 
29
-
30
  /**
31
  * Activation Hook
32
  */
@@ -47,7 +47,6 @@ class Activate {
47
  $this->version = $np_version;
48
  }
49
 
50
-
51
  /**
52
  * Set the Plugin Version
53
  */
@@ -56,7 +55,6 @@ class Activate {
56
  update_option('nestedpages_version', $this->version);
57
  }
58
 
59
-
60
  /**
61
  * Set Default Options
62
  */
@@ -67,6 +65,4 @@ class Activate {
67
  }
68
  }
69
 
70
-
71
-
72
  }
1
+ <?php
2
+
3
+ namespace NestedPages\Activation;
4
 
5
  use NestedPages\Activation\Updates\Updates;
6
 
7
  /**
8
  * Plugin Activation
9
  */
10
+ class Activate
11
+ {
12
  /**
13
  * Plugin Version
14
  */
20
  */
21
  private $updates;
22
 
 
23
  public function __construct()
24
  {
25
  $this->setVersion();
27
  $this->install();
28
  }
29
 
 
30
  /**
31
  * Activation Hook
32
  */
47
  $this->version = $np_version;
48
  }
49
 
 
50
  /**
51
  * Set the Plugin Version
52
  */
55
  update_option('nestedpages_version', $this->version);
56
  }
57
 
 
58
  /**
59
  * Set Default Options
60
  */
65
  }
66
  }
67
 
 
 
68
  }
app/Activation/Dependencies.php CHANGED
@@ -1,10 +1,13 @@
1
- <?php namespace NestedPages\Activation;
 
 
2
 
3
  use NestedPages\Entities\PostType\PostTypeRepository;
4
  /**
5
  * Plugin JS & CSS Dependencies
6
  */
7
- class Dependencies {
 
8
 
9
  /**
10
  * Plugin Directory
@@ -21,7 +24,6 @@ class Dependencies {
21
  */
22
  private $post_type_repo;
23
 
24
-
25
  public function __construct()
26
  {
27
  $this->post_type_repo = new PostTypeRepository;
@@ -31,7 +33,6 @@ class Dependencies {
31
  $this->plugin_dir = plugins_url() . '/wp-nested-pages';
32
  }
33
 
34
-
35
  /**
36
  * Set the Plugin Version
37
  */
@@ -41,7 +42,6 @@ class Dependencies {
41
  $this->plugin_version = $np_version;
42
  }
43
 
44
-
45
  /**
46
  * Admin Styles
47
  */
@@ -55,7 +55,6 @@ class Dependencies {
55
  );
56
  }
57
 
58
-
59
  /**
60
  * Admin Scripts required by plugin
61
  * Only Loads on the Nested Pages screen
@@ -135,5 +134,4 @@ class Dependencies {
135
  endif;
136
  }
137
 
138
-
139
  }
1
+ <?php
2
+
3
+ namespace NestedPages\Activation;
4
 
5
  use NestedPages\Entities\PostType\PostTypeRepository;
6
  /**
7
  * Plugin JS & CSS Dependencies
8
  */
9
+ class Dependencies
10
+ {
11
 
12
  /**
13
  * Plugin Directory
24
  */
25
  private $post_type_repo;
26
 
 
27
  public function __construct()
28
  {
29
  $this->post_type_repo = new PostTypeRepository;
33
  $this->plugin_dir = plugins_url() . '/wp-nested-pages';
34
  }
35
 
 
36
  /**
37
  * Set the Plugin Version
38
  */
42
  $this->plugin_version = $np_version;
43
  }
44
 
 
45
  /**
46
  * Admin Styles
47
  */
55
  );
56
  }
57
 
 
58
  /**
59
  * Admin Scripts required by plugin
60
  * Only Loads on the Nested Pages screen
134
  endif;
135
  }
136
 
 
137
  }
app/Activation/Updates/Updates.php CHANGED
@@ -1,11 +1,14 @@
1
- <?php namespace NestedPages\Activation\Updates;
 
 
2
 
3
  use NestedPages\Entities\NavMenu\NavMenuRepository;
4
 
5
  /**
6
  * Required Version Upgrades
7
  */
8
- class Updates {
 
9
 
10
  /**
11
  * New Version
@@ -37,7 +40,6 @@ class Updates {
37
  $this->enabledDatepicker();
38
  }
39
 
40
-
41
  /**
42
  * Set the plugin version
43
  */
@@ -47,7 +49,6 @@ class Updates {
47
  ? get_option('nestedpages_version') : $this->new_version;
48
  }
49
 
50
-
51
  /**
52
  * Add an empty Nested Pages menu if there isn't one
53
  * @since 1.1.5
@@ -60,7 +61,6 @@ class Updates {
60
  update_option('nestedpages_menu', $menu_id);
61
  }
62
  }
63
-
64
 
65
  /**
66
  * Convert existing nestedpages_menu option to menu ID rather than string/name
@@ -82,7 +82,6 @@ class Updates {
82
  }
83
  }
84
 
85
-
86
  /**
87
  * Make Page Post Type Enabled by Default
88
  * Option can be blank, using get_option returns false if blank
@@ -102,7 +101,6 @@ class Updates {
102
  ));
103
  }
104
 
105
-
106
  /**
107
  * Enable the Datepicker
108
  */
@@ -117,6 +115,4 @@ class Updates {
117
  }
118
  }
119
 
120
-
121
-
122
  }
1
+ <?php
2
+
3
+ namespace NestedPages\Activation\Updates;
4
 
5
  use NestedPages\Entities\NavMenu\NavMenuRepository;
6
 
7
  /**
8
  * Required Version Upgrades
9
  */
10
+ class Updates
11
+ {
12
 
13
  /**
14
  * New Version
40
  $this->enabledDatepicker();
41
  }
42
 
 
43
  /**
44
  * Set the plugin version
45
  */
49
  ? get_option('nestedpages_version') : $this->new_version;
50
  }
51
 
 
52
  /**
53
  * Add an empty Nested Pages menu if there isn't one
54
  * @since 1.1.5
61
  update_option('nestedpages_menu', $menu_id);
62
  }
63
  }
 
64
 
65
  /**
66
  * Convert existing nestedpages_menu option to menu ID rather than string/name
82
  }
83
  }
84
 
 
85
  /**
86
  * Make Page Post Type Enabled by Default
87
  * Option can be blank, using get_option returns false if blank
101
  ));
102
  }
103
 
 
104
  /**
105
  * Enable the Datepicker
106
  */
115
  }
116
  }
117
 
 
 
118
  }
app/Bootstrap.php CHANGED
@@ -1,9 +1,12 @@
1
- <?php namespace NestedPages;
 
 
2
 
3
  /**
4
  * Primary Plugin Bootstrap
5
  */
6
- class Bootstrap {
 
7
 
8
  public function __construct()
9
  {
@@ -24,11 +27,10 @@ class Bootstrap {
24
  new Entities\Listing\ListingActions;
25
  new Entities\NavMenu\NavMenuActions;
26
  new Entities\NavMenu\NavMenuTrashActions;
27
- new Form\FormActionFactory;
28
  new Config\Settings;
29
  }
30
 
31
-
32
  /**
33
  * Wordpress Initialization Actions
34
  */
@@ -39,7 +41,6 @@ class Bootstrap {
39
  $this->addLocalization();
40
  }
41
 
42
-
43
  /**
44
  * Localization Domain
45
  */
@@ -51,7 +52,6 @@ class Bootstrap {
51
  dirname( dirname( plugin_basename( __FILE__ ) ) ) . '/languages' );
52
  }
53
 
54
-
55
  /**
56
  * Add a link to the settings on the plugin page
57
  */
@@ -62,5 +62,4 @@ class Bootstrap {
62
  return $links;
63
  }
64
 
65
-
66
  }
1
+ <?php
2
+
3
+ namespace NestedPages;
4
 
5
  /**
6
  * Primary Plugin Bootstrap
7
  */
8
+ class Bootstrap
9
+ {
10
 
11
  public function __construct()
12
  {
27
  new Entities\Listing\ListingActions;
28
  new Entities\NavMenu\NavMenuActions;
29
  new Entities\NavMenu\NavMenuTrashActions;
30
+ new Form\Events;
31
  new Config\Settings;
32
  }
33
 
 
34
  /**
35
  * Wordpress Initialization Actions
36
  */
41
  $this->addLocalization();
42
  }
43
 
 
44
  /**
45
  * Localization Domain
46
  */
52
  dirname( dirname( plugin_basename( __FILE__ ) ) ) . '/languages' );
53
  }
54
 
 
55
  /**
56
  * Add a link to the settings on the plugin page
57
  */
62
  return $links;
63
  }
64
 
 
65
  }
app/Config/Settings.php CHANGED
@@ -1,4 +1,6 @@
1
- <?php namespace NestedPages\Config;
 
 
2
 
3
  use NestedPages\Helpers;
4
  use NestedPages\Entities\User\UserRepository;
@@ -8,7 +10,8 @@ use NestedPages\Config\SettingsRepository;
8
  /**
9
  * Plugin Settings
10
  */
11
- class Settings {
 
12
 
13
  /**
14
  * Nested Pages Menu
@@ -31,7 +34,6 @@ class Settings {
31
  */
32
  private $settings;
33
 
34
-
35
  public function __construct()
36
  {
37
  add_action( 'admin_menu', array( $this, 'registerSettingsPage' ) );
@@ -41,7 +43,6 @@ class Settings {
41
  $this->settings = new SettingsRepository;
42
  }
43
 
44
-
45
  /**
46
  * Register the settings page
47
  * @see admin_menu
@@ -57,7 +58,6 @@ class Settings {
57
  );
58
  }
59
 
60
-
61
  /**
62
  * Register the settings
63
  * @see admin_init
@@ -66,12 +66,12 @@ class Settings {
66
  {
67
  register_setting( 'nestedpages-general', 'nestedpages_menu' );
68
  register_setting( 'nestedpages-general', 'nestedpages_menusync' );
 
69
  register_setting( 'nestedpages-general', 'nestedpages_ui' );
70
  register_setting( 'nestedpages-general', 'nestedpages_allowsorting' );
71
  register_setting( 'nestedpages-posttypes', 'nestedpages_posttypes' );
72
  }
73
 
74
-
75
  /**
76
  * Update the menu name if option is updated
77
  * @see updated_option in wp-includes/option.php
@@ -93,7 +93,6 @@ class Settings {
93
  }
94
  }
95
 
96
-
97
  /**
98
  * Set the Menu Object
99
  * @since 1.1.5
@@ -104,7 +103,6 @@ class Settings {
104
  $this->menu = get_term_by('id', $menu_id, 'nav_menu');
105
  }
106
 
107
-
108
  /**
109
  * Get Post Types
110
  * @since 1.2.0
@@ -115,7 +113,6 @@ class Settings {
115
  return $post_repo->getPostTypesObject();
116
  }
117
 
118
-
119
  /**
120
  * Display the Settings Page
121
  * Callback for registerSettingsPage method
1
+ <?php
2
+
3
+ namespace NestedPages\Config;
4
 
5
  use NestedPages\Helpers;
6
  use NestedPages\Entities\User\UserRepository;
10
  /**
11
  * Plugin Settings
12
  */
13
+ class Settings
14
+ {
15
 
16
  /**
17
  * Nested Pages Menu
34
  */
35
  private $settings;
36
 
 
37
  public function __construct()
38
  {
39
  add_action( 'admin_menu', array( $this, 'registerSettingsPage' ) );
43
  $this->settings = new SettingsRepository;
44
  }
45
 
 
46
  /**
47
  * Register the settings page
48
  * @see admin_menu
58
  );
59
  }
60
 
 
61
  /**
62
  * Register the settings
63
  * @see admin_init
66
  {
67
  register_setting( 'nestedpages-general', 'nestedpages_menu' );
68
  register_setting( 'nestedpages-general', 'nestedpages_menusync' );
69
+ register_setting( 'nestedpages-general', 'nestedpages_disable_menu' );
70
  register_setting( 'nestedpages-general', 'nestedpages_ui' );
71
  register_setting( 'nestedpages-general', 'nestedpages_allowsorting' );
72
  register_setting( 'nestedpages-posttypes', 'nestedpages_posttypes' );
73
  }
74
 
 
75
  /**
76
  * Update the menu name if option is updated
77
  * @see updated_option in wp-includes/option.php
93
  }
94
  }
95
 
 
96
  /**
97
  * Set the Menu Object
98
  * @since 1.1.5
103
  $this->menu = get_term_by('id', $menu_id, 'nav_menu');
104
  }
105
 
 
106
  /**
107
  * Get Post Types
108
  * @since 1.2.0
113
  return $post_repo->getPostTypesObject();
114
  }
115
 
 
116
  /**
117
  * Display the Settings Page
118
  * Callback for registerSettingsPage method
app/Config/SettingsRepository.php CHANGED
@@ -1,6 +1,9 @@
1
- <?php namespace NestedPages\Config;
2
 
3
- class SettingsRepository {
 
 
 
4
 
5
  /**
6
  * Is the Datepicker UI option enabled
@@ -32,4 +35,15 @@ class SettingsRepository {
32
  return ( $option == 'sync' ) ? true : false;
33
  }
34
 
 
 
 
 
 
 
 
 
 
 
 
35
  }
1
+ <?php
2
 
3
+ namespace NestedPages\Config;
4
+
5
+ class SettingsRepository
6
+ {
7
 
8
  /**
9
  * Is the Datepicker UI option enabled
35
  return ( $option == 'sync' ) ? true : false;
36
  }
37
 
38
+ /**
39
+ * Are menus completely disabled?
40
+ * @return boolean
41
+ */
42
+ public function menusDisabled()
43
+ {
44
+ $option = get_option('nestedpages_disable_menu');
45
+ if ( $option && $option == 'true' ) return true;
46
+ return false;
47
+ }
48
+
49
  }
app/Entities/AdminMenu/AdminMenu.php CHANGED
@@ -1,4 +1,6 @@
1
- <?php namespace NestedPages\Entities\AdminMenu;
 
 
2
 
3
  use NestedPages\Entities\AdminMenu\EnabledMenus;
4
  use NestedPages\Entities\AdminMenu\AdminSubmenuExpander;
@@ -7,7 +9,8 @@ use NestedPages\Entities\AdminMenu\AdminSubmenuExpander;
7
  * Admin Menus
8
  * @since 1.2.1
9
  */
10
- class AdminMenu {
 
11
 
12
  public function __construct()
13
  {
@@ -31,5 +34,4 @@ class AdminMenu {
31
  new AdminSubmenuExpander;
32
  }
33
 
34
-
35
  }
1
+ <?php
2
+
3
+ namespace NestedPages\Entities\AdminMenu;
4
 
5
  use NestedPages\Entities\AdminMenu\EnabledMenus;
6
  use NestedPages\Entities\AdminMenu\AdminSubmenuExpander;
9
  * Admin Menus
10
  * @since 1.2.1
11
  */
12
+ class AdminMenu
13
+ {
14
 
15
  public function __construct()
16
  {
34
  new AdminSubmenuExpander;
35
  }
36
 
 
37
  }
app/Entities/AdminMenu/AdminSubmenu.php CHANGED
@@ -1,11 +1,14 @@
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
@@ -60,7 +63,6 @@ class AdminSubmenu {
60
 
61
  }
62
 
63
-
64
  /**
65
  * Show the default link if set to show
66
  * @param int $c Menu Position Counter
@@ -77,7 +79,6 @@ class AdminSubmenu {
77
  }
78
  }
79
 
80
-
81
  /**
82
  * Set the Menu Slug
83
  */
1
+ <?php
2
+
3
+ namespace NestedPages\Entities\AdminMenu;
4
 
5
  use NestedPages\Entities\PostType\PostTypeRepository;
6
 
7
  /**
8
  * Adds the submenu for a given menu
9
  */
10
+ class AdminSubmenu
11
+ {
12
 
13
  /**
14
  * Post Type
63
 
64
  }
65
 
 
66
  /**
67
  * Show the default link if set to show
68
  * @param int $c Menu Position Counter
79
  }
80
  }
81
 
 
82
  /**
83
  * Set the Menu Slug
84
  */
app/Entities/AdminMenu/AdminSubmenuDefault.php CHANGED
@@ -1,4 +1,6 @@
1
- <?php namespace NestedPages\Entities\AdminMenu;
 
 
2
 
3
  use NestedPages\Entities\PostType\PostTypeRepository;
4
  use NestedPages\Entities\Listing\Listing;
@@ -6,7 +8,8 @@ use NestedPages\Entities\Listing\Listing;
6
  /**
7
  * Add a link to the default menu
8
  */
9
- class AdminSubmenuDefault {
 
10
 
11
  /**
12
  * Post Type
@@ -19,7 +22,6 @@ class AdminSubmenuDefault {
19
  */
20
  private $post_type_repo;
21
 
22
-
23
  public function __construct($post_type)
24
  {
25
  $this->post_type = $post_type;
@@ -27,7 +29,6 @@ class AdminSubmenuDefault {
27
  $this->findMenu();
28
  }
29
 
30
-
31
  /**
32
  * Add the submenu
33
  */
@@ -41,7 +42,6 @@ class AdminSubmenuDefault {
41
  }
42
  }
43
 
44
-
45
  /**
46
  * Add the submenu item
47
  * @param string parent page slug
1
+ <?php
2
+
3
+ namespace NestedPages\Entities\AdminMenu;
4
 
5
  use NestedPages\Entities\PostType\PostTypeRepository;
6
  use NestedPages\Entities\Listing\Listing;
8
  /**
9
  * Add a link to the default menu
10
  */
11
+ class AdminSubmenuDefault
12
+ {
13
 
14
  /**
15
  * Post Type
22
  */
23
  private $post_type_repo;
24
 
 
25
  public function __construct($post_type)
26
  {
27
  $this->post_type = $post_type;
29
  $this->findMenu();
30
  }
31
 
 
32
  /**
33
  * Add the submenu
34
  */
42
  }
43
  }
44
 
 
45
  /**
46
  * Add the submenu item
47
  * @param string parent page slug
app/Entities/AdminMenu/AdminSubmenuExpander.php CHANGED
@@ -1,11 +1,14 @@
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
@@ -25,7 +28,6 @@ class AdminSubmenuExpander {
25
  $this->addHighlighting();
26
  }
27
 
28
-
29
  /**
30
  * Add Highlighting to enabled Post Types who's menus are being overwritten
31
  */
@@ -42,7 +44,6 @@ class AdminSubmenuExpander {
42
  }
43
  }
44
 
45
-
46
  /**
47
  * New Page Screen
48
  */
@@ -54,7 +55,6 @@ class AdminSubmenuExpander {
54
  }
55
  }
56
 
57
-
58
  /**
59
  * Nested Pages View
60
  */
@@ -65,7 +65,6 @@ class AdminSubmenuExpander {
65
  }
66
  }
67
 
68
-
69
  /**
70
  * Top Level Page for Post Type
71
  */
@@ -76,7 +75,6 @@ class AdminSubmenuExpander {
76
  }
77
  }
78
 
79
-
80
  /**
81
  * Default Link
82
  */
@@ -87,7 +85,6 @@ class AdminSubmenuExpander {
87
  }
88
  }
89
 
90
-
91
  /**
92
  * Default Pages Link
93
  */
1
+ <?php
2
+
3
+ namespace NestedPages\Entities\AdminMenu;
4
 
5
  use NestedPages\Entities\PostType\PostTypeRepository;
6
 
7
  /**
8
  * Opens the Submenu on child admin pages and highlights the current item
9
  */
10
+ class AdminSubmenuExpander
11
+ {
12
 
13
  /**
14
  * Current Page Object
28
  $this->addHighlighting();
29
  }
30
 
 
31
  /**
32
  * Add Highlighting to enabled Post Types who's menus are being overwritten
33
  */
44
  }
45
  }
46
 
 
47
  /**
48
  * New Page Screen
49
  */
55
  }
56
  }
57
 
 
58
  /**
59
  * Nested Pages View
60
  */
65
  }
66
  }
67
 
 
68
  /**
69
  * Top Level Page for Post Type
70
  */
75
  }
76
  }
77
 
 
78
  /**
79
  * Default Link
80
  */
85
  }
86
  }
87
 
 
88
  /**
89
  * Default Pages Link
90
  */
app/Entities/AdminMenu/EnabledMenus.php CHANGED
@@ -1,4 +1,6 @@
1
- <?php namespace NestedPages\Entities\AdminMenu;
 
 
2
 
3
  use NestedPages\Entities\PostType\PostTypeRepository;
4
  use NestedPages\Entities\Listing\Listing;
@@ -9,7 +11,8 @@ use NestedPages\Entities\User\UserRepository;
9
  /**
10
  * Other User-Enabled Post Types
11
  */
12
- class EnabledMenus {
 
13
 
14
  /**
15
  * Post Type
@@ -49,7 +52,6 @@ class EnabledMenus {
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
  */
@@ -73,7 +75,6 @@ class EnabledMenus {
73
  }
74
  }
75
 
76
-
77
  /**
78
  * Add the primary top-level menu item
79
  * @param int counter
@@ -109,7 +110,6 @@ class EnabledMenus {
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
@@ -121,7 +121,6 @@ class EnabledMenus {
121
  return 'dashicons-admin-post';
122
  }
123
 
124
-
125
  /**
126
  * Get the correct menu position for item
127
  * @param int counter
@@ -135,7 +134,6 @@ class EnabledMenus {
135
  return $_wp_last_object_menu + $c;
136
  }
137
 
138
-
139
  /**
140
  * Get the Edit Slug for post type
141
  */
@@ -144,5 +142,4 @@ class EnabledMenus {
144
  return $this->post_type_repo->getMenuSlug($this->post_type);
145
  }
146
 
147
-
148
  }
1
+ <?php
2
+
3
+ namespace NestedPages\Entities\AdminMenu;
4
 
5
  use NestedPages\Entities\PostType\PostTypeRepository;
6
  use NestedPages\Entities\Listing\Listing;
11
  /**
12
  * Other User-Enabled Post Types
13
  */
14
+ class EnabledMenus
15
+ {
16
 
17
  /**
18
  * Post Type
52
  $this->enabled_types = $this->post_type_repo->getPostTypesObject();
53
  }
54
 
 
55
  /**
56
  * Set the Menus for each of the enabled post types
57
  */
75
  }
76
  }
77
 
 
78
  /**
79
  * Add the primary top-level menu item
80
  * @param int counter
110
  if (in_array('post', $this->enabled_types)) remove_menu_page('edit.php');
111
  }
112
 
 
113
  /**
114
  * Get the correct icon to use in menu
115
  * @return string
121
  return 'dashicons-admin-post';
122
  }
123
 
 
124
  /**
125
  * Get the correct menu position for item
126
  * @param int counter
134
  return $_wp_last_object_menu + $c;
135
  }
136
 
 
137
  /**
138
  * Get the Edit Slug for post type
139
  */
142
  return $this->post_type_repo->getMenuSlug($this->post_type);
143
  }
144
 
 
145
  }
app/Entities/Confirmation/ConfirmationFactory.php CHANGED
@@ -1,10 +1,13 @@
1
- <?php namespace NestedPages\Entities\Confirmation;
 
 
2
 
3
  /**
4
  * Confirmation Message
5
  * @since 1.2
6
  */
7
- class ConfirmationFactory {
 
8
 
9
  /**
10
  * Message Output
@@ -18,13 +21,11 @@ class ConfirmationFactory {
18
  */
19
  private $type;
20
 
21
-
22
  public function __construct()
23
  {
24
  $this->build();
25
  }
26
 
27
-
28
  /**
29
  * Set the Type of confirmation
30
  */
@@ -36,7 +37,6 @@ class ConfirmationFactory {
36
  if ( $this->type ) $this->createClass();
37
  }
38
 
39
-
40
  /**
41
  * Set the confirmation message
42
  */
@@ -47,7 +47,6 @@ class ConfirmationFactory {
47
  $this->message = $confirm->setMessage();
48
  }
49
 
50
-
51
  /**
52
  * Get the Message
53
  */
1
+ <?php
2
+
3
+ namespace NestedPages\Entities\Confirmation;
4
 
5
  /**
6
  * Confirmation Message
7
  * @since 1.2
8
  */
9
+ class ConfirmationFactory
10
+ {
11
 
12
  /**
13
  * Message Output
21
  */
22
  private $type;
23
 
 
24
  public function __construct()
25
  {
26
  $this->build();
27
  }
28
 
 
29
  /**
30
  * Set the Type of confirmation
31
  */
37
  if ( $this->type ) $this->createClass();
38
  }
39
 
 
40
  /**
41
  * Set the confirmation message
42
  */
47
  $this->message = $confirm->setMessage();
48
  }
49
 
 
50
  /**
51
  * Get the Message
52
  */
app/Entities/Confirmation/ConfirmationInterface.php CHANGED
@@ -1,6 +1,9 @@
1
- <?php namespace NestedPages\Entities\Confirmation;
2
 
3
- interface ConfirmationInterface {
 
 
 
4
 
5
  /**
6
  * Display the Confirmation Message
1
+ <?php
2
 
3
+ namespace NestedPages\Entities\Confirmation;
4
+
5
+ interface ConfirmationInterface
6
+ {
7
 
8
  /**
9
  * Display the Confirmation Message
app/Entities/Confirmation/LinkDeletedConfirmation.php CHANGED
@@ -1,9 +1,12 @@
1
- <?php namespace NestedPages\Entities\Confirmation;
 
 
 
2
  /**
3
  * Confirm Link has been deleted
4
  */
5
- class LinkDeletedConfirmation implements ConfirmationInterface {
6
-
7
  public function setMessage()
8
  {
9
  $out = __('Link successfully deleted.', 'nestedpages');
1
+ <?php
2
+
3
+ namespace NestedPages\Entities\Confirmation;
4
+
5
  /**
6
  * Confirm Link has been deleted
7
  */
8
+ class LinkDeletedConfirmation implements ConfirmationInterface
9
+ {
10
  public function setMessage()
11
  {
12
  $out = __('Link successfully deleted.', 'nestedpages');
app/Entities/Confirmation/TrashConfirmation.php CHANGED
@@ -1,8 +1,12 @@
1
- <?php namespace NestedPages\Entities\Confirmation;
 
 
 
2
  /**
3
  * Confirm page(s) moved to trash
4
  */
5
- class TrashConfirmation implements ConfirmationInterface {
 
6
 
7
  public function setMessage()
8
  {
1
+ <?php
2
+
3
+ namespace NestedPages\Entities\Confirmation;
4
+
5
  /**
6
  * Confirm page(s) moved to trash
7
  */
8
+ class TrashConfirmation implements ConfirmationInterface
9
+ {
10
 
11
  public function setMessage()
12
  {
app/Entities/Confirmation/TrashRestoredConfirmation.php CHANGED
@@ -1,8 +1,12 @@
1
- <?php namespace NestedPages\Entities\Confirmation;
 
 
 
2
  /**
3
  * Confirm page(s) restored from trash
4
  */
5
- class TrashRestoredConfirmation implements ConfirmationInterface {
 
6
 
7
  public function setMessage()
8
  {
1
+ <?php
2
+
3
+ namespace NestedPages\Entities\Confirmation;
4
+
5
  /**
6
  * Confirm page(s) restored from trash
7
  */
8
+ class TrashRestoredConfirmation implements ConfirmationInterface
9
+ {
10
 
11
  public function setMessage()
12
  {
app/Entities/DefaultList/DefaultListFactory.php CHANGED
@@ -1,4 +1,6 @@
1
- <?php namespace NestedPages\Entities\DefaultList;
 
 
2
 
3
  use NestedPages\Entities\PostType\PostTypeRepository;
4
  use NestedPages\Entities\DefaultList\NestedViewLink;
@@ -6,7 +8,8 @@ use NestedPages\Entities\DefaultList\NestedViewLink;
6
  /**
7
  * Add the Nested Pages link to default table subsubsub
8
  */
9
- class DefaultListFactory {
 
10
 
11
  /**
12
  * Post Type Repository
1
+ <?php
2
+
3
+ namespace NestedPages\Entities\DefaultList;
4
 
5
  use NestedPages\Entities\PostType\PostTypeRepository;
6
  use NestedPages\Entities\DefaultList\NestedViewLink;
8
  /**
9
  * Add the Nested Pages link to default table subsubsub
10
  */
11
+ class DefaultListFactory
12
+ {
13
 
14
  /**
15
  * Post Type Repository
app/Entities/DefaultList/NestedViewLink.php CHANGED
@@ -1,11 +1,14 @@
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
@@ -25,7 +28,6 @@ class NestedViewLink {
25
  $this->addFilter();
26
  }
27
 
28
-
29
  /**
30
  * Add the WP Filter
31
  */
@@ -34,7 +36,6 @@ class NestedViewLink {
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
  */
1
+ <?php
2
+
3
+ namespace NestedPages\Entities\DefaultList;
4
 
5
  use NestedPages\Entities\PostType\PostTypeRepository;
6
 
7
  /**
8
  * Adds "nested view/sort view" to default lists on enabled post types
9
  */
10
+ class NestedViewLink
11
+ {
12
 
13
  /**
14
  * Post Type
28
  $this->addFilter();
29
  }
30
 
 
31
  /**
32
  * Add the WP Filter
33
  */
36
  add_filter( 'views_edit-' . $this->post_type->name, array($this, 'addLink' ) );
37
  }
38
 
 
39
  /**
40
  * Add a nested pages link to the subsub list (WP_List_Table class)
41
  */
app/Entities/Listing/Listing.php CHANGED
@@ -1,4 +1,6 @@
1
- <?php namespace NestedPages\Entities\Listing;
 
 
2
 
3
  use NestedPages\Helpers;
4
  use NestedPages\Entities\Confirmation\ConfirmationFactory;
@@ -13,7 +15,8 @@ use NestedPages\Entities\PluginIntegration\IntegrationFactory;
13
  /**
14
  * Primary Post Listing
15
  */
16
- class Listing {
 
17
 
18
  /**
19
  * Post Type
@@ -99,19 +102,18 @@ class Listing {
99
  $this->settings = new SettingsRepository;
100
  }
101
 
102
-
103
  /**
104
  * Called by Menu Class
105
  * Instantiates Listing Class
106
  * @since 1.2.0
107
  */
108
- public static function admin_menu($post_type) {
 
109
  $class_name = get_class();
110
  $classinstance = new $class_name($post_type);
111
  return array(&$classinstance, "listPosts");
112
  }
113
 
114
-
115
  /**
116
  * Set the Sort Options
117
  */
@@ -129,7 +131,6 @@ class Listing {
129
  : null;
130
  }
131
 
132
-
133
  /**
134
  * Get the Current Page URL
135
  */
@@ -139,7 +140,6 @@ class Listing {
139
  return $base . '?page=' . $_GET['page'];
140
  }
141
 
142
-
143
  /**
144
  * Set the Post Type
145
  * @since 1.1.16
@@ -149,7 +149,6 @@ class Listing {
149
  $this->post_type = get_post_type_object($post_type);
150
  }
151
 
152
-
153
  /**
154
  * The Main View
155
  * Replaces Default Post Listing
@@ -160,7 +159,6 @@ class Listing {
160
  include( Helpers::view('listing') );
161
  }
162
 
163
-
164
  /**
165
  * Set the Taxonomies for Post Type
166
  */
@@ -170,7 +168,6 @@ class Listing {
170
  $this->f_taxonomies = $this->post_type_repo->getTaxonomies($this->post_type->name, false);
171
  }
172
 
173
-
174
  /**
175
  * Opening list tag <ol>
176
  * @param array $pages - array of page objects from current query
@@ -206,7 +203,6 @@ class Listing {
206
 
207
  }
208
 
209
-
210
  /**
211
  * Set Post Data
212
  * @param object post object
@@ -216,7 +212,6 @@ class Listing {
216
  $this->post = $this->post_data_factory->build($post);
217
  }
218
 
219
-
220
  /**
221
  * Get count of published posts
222
  * @param object $pages (WP Query object)
@@ -231,7 +226,6 @@ class Listing {
231
  return $publish_count;
232
  }
233
 
234
-
235
  /**
236
  * Is this a search
237
  * @return boolean
@@ -241,6 +235,13 @@ class Listing {
241
  return ( isset($_GET['search']) && $_GET['search'] !== "" ) ? true : false;
242
  }
243
 
 
 
 
 
 
 
 
244
 
245
  /**
246
  * Loop through all the pages and create the nested / sortable list
@@ -249,7 +250,14 @@ class Listing {
249
  private function loopPosts($parent_id = 0, $count = 0)
250
  {
251
  $this->setTaxonomies();
252
- $post_type = ( $this->post_type->name == 'page' ) ? array('page', 'np-redirect') : array($this->post_type->name);
 
 
 
 
 
 
 
253
  $query_args = array(
254
  'post_type' => $post_type,
255
  'posts_per_page' => -1,
@@ -261,6 +269,7 @@ class Listing {
261
  );
262
 
263
  if ( $this->isSearch() ) $query_args = $this->searchParams($query_args);
 
264
 
265
  $pages = new \WP_Query(apply_filters('nestedpages_page_listing', $query_args));
266
 
@@ -315,7 +324,6 @@ class Listing {
315
  endif; wp_reset_postdata();
316
  }
317
 
318
-
319
  /**
320
  * Search Posts
321
  */
@@ -326,6 +334,15 @@ class Listing {
326
  return $query_args;
327
  }
328
 
 
 
 
 
 
 
 
 
 
329
 
330
  /**
331
  * Parent Trash Status
@@ -340,5 +357,4 @@ class Listing {
340
 
341
  }
342
 
343
-
344
  }
1
+ <?php
2
+
3
+ namespace NestedPages\Entities\Listing;
4
 
5
  use NestedPages\Helpers;
6
  use NestedPages\Entities\Confirmation\ConfirmationFactory;
15
  /**
16
  * Primary Post Listing
17
  */
18
+ class Listing
19
+ {
20
 
21
  /**
22
  * Post Type
102
  $this->settings = new SettingsRepository;
103
  }
104
 
 
105
  /**
106
  * Called by Menu Class
107
  * Instantiates Listing Class
108
  * @since 1.2.0
109
  */
110
+ public static function admin_menu($post_type)
111
+ {
112
  $class_name = get_class();
113
  $classinstance = new $class_name($post_type);
114
  return array(&$classinstance, "listPosts");
115
  }
116
 
 
117
  /**
118
  * Set the Sort Options
119
  */
131
  : null;
132
  }
133
 
 
134
  /**
135
  * Get the Current Page URL
136
  */
140
  return $base . '?page=' . $_GET['page'];
141
  }
142
 
 
143
  /**
144
  * Set the Post Type
145
  * @since 1.1.16
149
  $this->post_type = get_post_type_object($post_type);
150
  }
151
 
 
152
  /**
153
  * The Main View
154
  * Replaces Default Post Listing
159
  include( Helpers::view('listing') );
160
  }
161
 
 
162
  /**
163
  * Set the Taxonomies for Post Type
164
  */
168
  $this->f_taxonomies = $this->post_type_repo->getTaxonomies($this->post_type->name, false);
169
  }
170
 
 
171
  /**
172
  * Opening list tag <ol>
173
  * @param array $pages - array of page objects from current query
203
 
204
  }
205
 
 
206
  /**
207
  * Set Post Data
208
  * @param object post object
212
  $this->post = $this->post_data_factory->build($post);
213
  }
214
 
 
215
  /**
216
  * Get count of published posts
217
  * @param object $pages (WP Query object)
226
  return $publish_count;
227
  }
228
 
 
229
  /**
230
  * Is this a search
231
  * @return boolean
235
  return ( isset($_GET['search']) && $_GET['search'] !== "" ) ? true : false;
236
  }
237
 
238
+ /**
239
+ * Is the list filtered?
240
+ */
241
+ private function isFiltered()
242
+ {
243
+ return ( isset($_GET['category']) && $_GET['category'] !== "all" ) ? true : false;
244
+ }
245
 
246
  /**
247
  * Loop through all the pages and create the nested / sortable list
250
  private function loopPosts($parent_id = 0, $count = 0)
251
  {
252
  $this->setTaxonomies();
253
+
254
+ if ( $this->post_type->name == 'page' ) {
255
+ $post_type = array('page');
256
+ if ( !$this->settings->menusDisabled() ) $post_type[] = 'np-redirect';
257
+ } else {
258
+ $post_type = array($this->post_type->name);
259
+ }
260
+
261
  $query_args = array(
262
  'post_type' => $post_type,
263
  'posts_per_page' => -1,
269
  );
270
 
271
  if ( $this->isSearch() ) $query_args = $this->searchParams($query_args);
272
+ if ( $this->isFiltered() ) $query_args = $this->filterParams($query_args);
273
 
274
  $pages = new \WP_Query(apply_filters('nestedpages_page_listing', $query_args));
275
 
324
  endif; wp_reset_postdata();
325
  }
326
 
 
327
  /**
328
  * Search Posts
329
  */
334
  return $query_args;
335
  }
336
 
337
+ /**
338
+ * Filter Posts
339
+ */
340
+ private function filterParams($query_args)
341
+ {
342
+ if ( !isset($_GET['category']) ) return $query_args;
343
+ $query_args['cat'] = sanitize_text_field($_GET['category']);
344
+ return $query_args;
345
+ }
346
 
347
  /**
348
  * Parent Trash Status
357
 
358
  }
359
 
 
360
  }
app/Entities/Listing/ListingActions.php CHANGED
@@ -1,14 +1,15 @@
1
- <?php namespace NestedPages\Entities\Listing;
2
 
3
- class ListingActions {
4
 
 
 
5
 
6
  public function __construct()
7
  {
8
  add_filter( 'posts_where', array($this, 'titleSearch'), 10, 2 );
9
  }
10
 
11
-
12
  /**
13
  * For performing search query on titles
14
  */
1
+ <?php
2
 
3
+ namespace NestedPages\Entities\Listing;
4
 
5
+ class ListingActions
6
+ {
7
 
8
  public function __construct()
9
  {
10
  add_filter( 'posts_where', array($this, 'titleSearch'), 10, 2 );
11
  }
12
 
 
13
  /**
14
  * For performing search query on titles
15
  */
app/Entities/Listing/ListingRepository.php CHANGED
@@ -1,6 +1,9 @@
1
- <?php namespace NestedPages\Entities\Listing;
2
 
3
- class ListingRepository {
 
 
 
4
 
5
  /**
6
  * User's Toggled Pages
@@ -12,4 +15,50 @@ class ListingRepository {
12
  return $visible[$post_type];
13
  }
14
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  }
1
+ <?php
2
 
3
+ namespace NestedPages\Entities\Listing;
4
+
5
+ class ListingRepository
6
+ {
7
 
8
  /**
9
  * User's Toggled Pages
15
  return $visible[$post_type];
16
  }
17
 
18
+ /**
19
+ * Taxonomies
20
+ */
21
+ public function taxonomies()
22
+ {
23
+ $taxonomies = get_taxonomies(array(
24
+ 'public' => true,
25
+ ), 'objects');
26
+ return $taxonomies;
27
+ }
28
+
29
+ /**
30
+ * Get all non-empty Terms for a given taxonomy
31
+ */
32
+ public function terms($taxonomy)
33
+ {
34
+ return get_terms($taxonomy);
35
+ }
36
+
37
+ /**
38
+ * Post Types
39
+ */
40
+ public function postTypes()
41
+ {
42
+ $types = get_post_types(array(
43
+ 'public' => true
44
+ ), 'objects');
45
+ return $types;
46
+ }
47
+
48
+ /**
49
+ * Recent Posts for a given post type
50
+ */
51
+ public function recentPosts($post_type)
52
+ {
53
+ $pq = new \WP_Query(array(
54
+ 'post_type' => $post_type,
55
+ 'posts_per_page' => 10
56
+ ));
57
+ if ( $pq->have_posts() ) :
58
+ return $pq->posts;
59
+ else :
60
+ return false;
61
+ endif; wp_reset_postdata();
62
+ }
63
+
64
  }
app/Entities/NavMenu/NavMenuActions.php CHANGED
@@ -1,10 +1,13 @@
1
- <?php namespace NestedPages\Entities\NavMenu;
 
 
2
 
3
  use NestedPages\Entities\NavMenu\NavMenuSyncMenu;
4
  /**
5
  * Hook into WP actions for necessary tasks related to nav menus
6
  */
7
- class NavMenuActions {
 
8
 
9
  public function __construct()
10
  {
1
+ <?php
2
+
3
+ namespace NestedPages\Entities\NavMenu;
4
 
5
  use NestedPages\Entities\NavMenu\NavMenuSyncMenu;
6
  /**
7
  * Hook into WP actions for necessary tasks related to nav menus
8
  */
9
+ class NavMenuActions
10
+ {
11
 
12
  public function __construct()
13
  {
app/Entities/NavMenu/NavMenuRemoveItem.php CHANGED
@@ -1,9 +1,12 @@
1
- <?php namespace NestedPages\Entities\NavMenu;
 
 
2
 
3
  /**
4
  * Service Class for removing a single menu item
5
  */
6
- class NavMenuRemoveItem {
 
7
 
8
  /**
9
  * Item ID to Remove
1
+ <?php
2
+
3
+ namespace NestedPages\Entities\NavMenu;
4
 
5
  /**
6
  * Service Class for removing a single menu item
7
  */
8
+ class NavMenuRemoveItem
9
+ {
10
 
11
  /**
12
  * Item ID to Remove
app/Entities/NavMenu/NavMenuRepository.php CHANGED
@@ -1,6 +1,9 @@
1
- <?php namespace NestedPages\Entities\NavMenu;
2
 
3
- class NavMenuRepository {
 
 
 
4
 
5
  /**
6
  * Get the Menu ID
@@ -13,68 +16,27 @@ class NavMenuRepository {
13
  return $term->term_id;
14
  }
15
 
16
-
17
  /**
18
  * Get Menu Item ID
19
  * @since 1.3.4
20
  * @param int $id - Post ID
 
21
  * @return int
22
  */
23
- public function getMenuItemID($id)
24
  {
25
- $meta_query = new \WP_Query(array(
26
- 'post_type' => 'nav_menu_item',
27
- 'posts_per_page' => 1,
28
- 'meta_key' => '_menu_item_object_id',
29
- 'meta_value' => $id,
30
- 'tax_query' => array(
31
- array(
32
- 'taxonomy' => 'nav_menu',
33
- 'field' => 'id',
34
- 'terms' => $this->getMenuID(),
35
- ),
36
- ),
37
- ));
38
- return ( $meta_query->have_posts() ) ?
39
- $meta_query->posts[0]->ID :
40
- $this->getLinkMenuItemXFN($id);
41
- }
42
-
43
-
44
- /**
45
- * Get Link from XFN field
46
- * Using XFN field to store original post ID
47
- * Hack way of doing it, but no other way to tie custom menu items to post type and retain custom functionality
48
- * @param int $id - Post ID
49
- */
50
- public function getLinkMenuItemXFN($id)
51
- {
52
- $meta_query = new \WP_Query(array(
53
- 'post_type' => 'nav_menu_item',
54
- 'posts_per_page' => 1,
55
- 'meta_key' => '_menu_item_xfn',
56
- 'meta_value' => $id,
57
- ));
58
- return ( $meta_query->have_posts() ) ? $meta_query->posts[0]->ID : $this->getLinkMenuItemID($id);
59
- }
60
-
61
-
62
- /**
63
- * Get Link Nav Menu from post ID using title
64
- * Supporting legacy NP versions before XFN was saved
65
- * @since 1.3.4
66
- * @param int $id
67
- * @return int
68
- */
69
- public function getLinkMenuItemID($id)
70
- {
71
- $post = get_page_by_title( get_the_title($id), OBJECT, 'nav_menu_item');
72
- if ( !$post ) return 0;
73
- return $post->ID;
74
  }
75
 
76
-
77
-
78
  /**
79
  * Get the Menu Term Object
80
  * @since 1.3.4
@@ -91,7 +53,6 @@ class NavMenuRepository {
91
  return $this->getMenuTermObject();
92
  }
93
 
94
-
95
  /**
96
  * Get the Menu ID from the title
97
  * @since 1.3.5
@@ -103,7 +64,6 @@ class NavMenuRepository {
103
  return ( $term ) ? $term->term_id : false;
104
  }
105
 
106
-
107
  /**
108
  * Create Empty Menu if one doesn't exist
109
  * @since 1.3.4
@@ -114,7 +74,6 @@ class NavMenuRepository {
114
  update_option('nestedpages_menu', $menu_id);
115
  }
116
 
117
-
118
  /**
119
  * Clear out the menu
120
  */
@@ -126,7 +85,6 @@ class NavMenuRepository {
126
  }
127
  }
128
 
129
-
130
  /**
131
  * Is the provided post a nav menu item
132
  * @return boolean
@@ -138,7 +96,6 @@ class NavMenuRepository {
138
  return false;
139
  }
140
 
141
-
142
  /**
143
  * Get the Link post id from a title
144
  */
@@ -148,7 +105,6 @@ class NavMenuRepository {
148
  return $post->ID;
149
  }
150
 
151
-
152
  /**
153
  * Get an array of pages not hidden in nav menu
154
  * WP_Query won't return pages with empty meta values, so sql is used
1
+ <?php
2
 
3
+ namespace NestedPages\Entities\NavMenu;
4
+
5
+ class NavMenuRepository
6
+ {
7
 
8
  /**
9
  * Get the Menu ID
16
  return $term->term_id;
17
  }
18
 
 
19
  /**
20
  * Get Menu Item ID
21
  * @since 1.3.4
22
  * @param int $id - Post ID
23
+ * @param string $query - xfn/object_id
24
  * @return int
25
  */
26
+ public function getMenuItem($id, $query = 'xfn')
27
  {
28
+ global $wpdb;
29
+ $prefix = $wpdb->prefix;
30
+ $meta_table = $prefix . 'postmeta';
31
+ if ( $query == 'xfn' ){
32
+ $sql = "SELECT post_id FROM $meta_table WHERE meta_value = $id AND meta_key = '_menu_item_xfn'";
33
+ } else {
34
+ $sql = "SELECT post_id FROM $meta_table WHERE meta_value = $id AND meta_key = '_menu_item_object_id'";
35
+ }
36
+ $post_id = $wpdb->get_var($sql);
37
+ return $post_id;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  }
39
 
 
 
40
  /**
41
  * Get the Menu Term Object
42
  * @since 1.3.4
53
  return $this->getMenuTermObject();
54
  }
55
 
 
56
  /**
57
  * Get the Menu ID from the title
58
  * @since 1.3.5
64
  return ( $term ) ? $term->term_id : false;
65
  }
66
 
 
67
  /**
68
  * Create Empty Menu if one doesn't exist
69
  * @since 1.3.4
74
  update_option('nestedpages_menu', $menu_id);
75
  }
76
 
 
77
  /**
78
  * Clear out the menu
79
  */
85
  }
86
  }
87
 
 
88
  /**
89
  * Is the provided post a nav menu item
90
  * @return boolean
96
  return false;
97
  }
98
 
 
99
  /**
100
  * Get the Link post id from a title
101
  */
105
  return $post->ID;
106
  }
107
 
 
108
  /**
109
  * Get an array of pages not hidden in nav menu
110
  * WP_Query won't return pages with empty meta values, so sql is used
app/Entities/NavMenu/NavMenuSync.php CHANGED
@@ -1,11 +1,14 @@
1
- <?php namespace NestedPages\Entities\NavMenu;
 
 
2
 
3
  use NestedPages\Entities\NavMenu\NavMenuRepository;
4
 
5
  /**
6
  * Base Nav Menu Sync class
7
  */
8
- abstract class NavMenuSync {
 
9
 
10
  /**
11
  * Nav Menu Repository
@@ -19,7 +22,6 @@ abstract class NavMenuSync {
19
  */
20
  protected $id;
21
 
22
-
23
  public function __construct()
24
  {
25
  if ( get_option('nestedpages_menusync') !== 'sync' ) return;
@@ -27,7 +29,6 @@ abstract class NavMenuSync {
27
  $this->setMenuID();
28
  }
29
 
30
-
31
  /**
32
  * Menu ID Setter
33
  */
@@ -36,7 +37,6 @@ abstract class NavMenuSync {
36
  $this->id = $this->nav_menu_repo->getMenuID();
37
  }
38
 
39
-
40
  /**
41
  * Remove a Menu Item
42
  * @since 1.3.4
@@ -47,5 +47,4 @@ abstract class NavMenuSync {
47
  wp_delete_post($id, true);
48
  }
49
 
50
-
51
  }
1
+ <?php
2
+
3
+ namespace NestedPages\Entities\NavMenu;
4
 
5
  use NestedPages\Entities\NavMenu\NavMenuRepository;
6
 
7
  /**
8
  * Base Nav Menu Sync class
9
  */
10
+ abstract class NavMenuSync
11
+ {
12
 
13
  /**
14
  * Nav Menu Repository
22
  */
23
  protected $id;
24
 
 
25
  public function __construct()
26
  {
27
  if ( get_option('nestedpages_menusync') !== 'sync' ) return;
29
  $this->setMenuID();
30
  }
31
 
 
32
  /**
33
  * Menu ID Setter
34
  */
37
  $this->id = $this->nav_menu_repo->getMenuID();
38
  }
39
 
 
40
  /**
41
  * Remove a Menu Item
42
  * @since 1.3.4
47
  wp_delete_post($id, true);
48
  }
49
 
 
50
  }
app/Entities/NavMenu/NavMenuSyncInterface.php DELETED
@@ -1,10 +0,0 @@
1
- <?php namespace NestedPages\Entities\NavMenu;
2
-
3
- /**
4
- * Contract for Nav Menu Sync Classes
5
- */
6
- interface NavMenuSyncInterface {
7
-
8
- public function sync();
9
-
10
- }
 
 
 
 
 
 
 
 
 
 
app/Entities/NavMenu/NavMenuSyncListing.php CHANGED
@@ -1,4 +1,6 @@
1
- <?php namespace NestedPages\Entities\NavMenu;
 
 
2
 
3
  use NestedPages\Entities\NavMenu\NavMenuSync;
4
  use NestedPages\Helpers;
@@ -7,8 +9,8 @@ use NestedPages\Entities\Post\PostDataFactory;
7
  /**
8
  * Syncs the Generated Menu to Match the Listing
9
  */
10
- class NavMenuSyncListing extends NavMenuSync implements NavMenuSyncInterface {
11
-
12
 
13
  /**
14
  * Individual Post
@@ -27,16 +29,14 @@ class NavMenuSyncListing extends NavMenuSync implements NavMenuSyncInterface {
27
  */
28
  private $post_factory;
29
 
30
-
31
  public function __construct()
32
  {
33
  parent::__construct();
34
  $this->post_factory = new PostDataFactory;
35
  }
36
 
37
-
38
  /**
39
- * Create the menu with nested pages
40
  */
41
  public function sync($parent = 0, $menu_parent = 0)
42
  {
@@ -52,76 +52,61 @@ class NavMenuSyncListing extends NavMenuSync implements NavMenuSyncInterface {
52
  if ( $page_q->have_posts() ) : while ( $page_q->have_posts() ) : $page_q->the_post();
53
  global $post;
54
  $this->post = $this->post_factory->build($post);
55
- $this->syncItem($menu_parent);
56
  endwhile; endif; wp_reset_postdata();
57
  }
58
 
59
-
60
  /**
61
  * Sync an individual item
62
  * @since 1.3.4
63
  */
64
- private function syncItem($menu_parent)
65
  {
66
- // Get the Menu Item ID using the post ID
67
- $menu_item_id = $this->nav_menu_repo->getMenuItemID($this->post->id);
68
-
 
69
  if ( $this->post->nav_status == 'hide' ) return $this->removeItem($menu_item_id);
70
-
71
- $menu = ( $this->post->type == 'page' )
72
- ? $this->syncPageItem($menu_parent, $menu_item_id)
73
- : $this->syncLinkItem($menu_parent, $menu_item_id);
74
-
75
  $this->sync( $this->post->id, $menu );
76
  }
77
 
78
-
79
-
80
- /**
81
- * Sync Page Menu Item
82
- * @since 1.1.4
83
- */
84
- private function syncPageItem($menu_parent, $menu_item_id)
85
- {
86
- $menu = wp_update_nav_menu_item($this->id, $menu_item_id, array(
87
- 'menu-item-title' => $this->post->nav_title,
88
- 'menu-item-position' => $this->count,
89
- 'menu-item-url' => $this->post->link,
90
- 'menu-item-attr-title' => $this->post->nav_title_attr,
91
- 'menu-item-status' => 'publish',
92
- 'menu-item-classes' => $this->post->nav_css,
93
- 'menu-item-type' => 'post_type',
94
- 'menu-item-object' => 'page',
95
- 'menu-item-object-id' => $this->post->id,
96
- 'menu-item-parent-id' => $menu_parent,
97
- 'menu-item-target' => $this->post->link_target
98
- ));
99
- return $menu;
100
- }
101
-
102
-
103
  /**
104
  * Sync Link Menu Item
105
  * @since 1.1.4
106
  */
107
- private function syncLinkItem($menu_parent, $menu_item_id)
108
  {
109
- $menu = wp_update_nav_menu_item($this->id, $menu_item_id, array(
 
 
 
 
 
 
 
 
 
 
 
 
 
 
110
  'menu-item-title' => $this->post->title,
111
  'menu-item-position' => $this->count,
112
- 'menu-item-url' => Helpers::check_url(get_the_content($this->post->id)),
113
  'menu-item-attr-title' => $this->post->nav_title_attr,
114
  'menu-item-status' => 'publish',
115
  'menu-item-classes' => $this->post->nav_css,
116
- 'menu-item-type' => 'custom',
117
- 'menu-item-object' => 'np-redirect',
118
- 'menu-item-object-id' => $this->post->id,
119
  'menu-item-parent-id' => $menu_parent,
120
- 'menu-item-xfn' => $this->post->id,
121
  'menu-item-target' => $this->post->link_target
122
- ));
 
123
  return $menu;
124
  }
125
 
126
-
127
  }
1
+ <?php
2
+
3
+ namespace NestedPages\Entities\NavMenu;
4
 
5
  use NestedPages\Entities\NavMenu\NavMenuSync;
6
  use NestedPages\Helpers;
9
  /**
10
  * Syncs the Generated Menu to Match the Listing
11
  */
12
+ class NavMenuSyncListing extends NavMenuSync
13
+ {
14
 
15
  /**
16
  * Individual Post
29
  */
30
  private $post_factory;
31
 
 
32
  public function __construct()
33
  {
34
  parent::__construct();
35
  $this->post_factory = new PostDataFactory;
36
  }
37
 
 
38
  /**
39
+ * Recursive function loops through pages/links and their children
40
  */
41
  public function sync($parent = 0, $menu_parent = 0)
42
  {
52
  if ( $page_q->have_posts() ) : while ( $page_q->have_posts() ) : $page_q->the_post();
53
  global $post;
54
  $this->post = $this->post_factory->build($post);
55
+ $this->syncPost($menu_parent);
56
  endwhile; endif; wp_reset_postdata();
57
  }
58
 
 
59
  /**
60
  * Sync an individual item
61
  * @since 1.3.4
62
  */
63
+ private function syncPost($menu_parent)
64
  {
65
+ // Get the Menu Item
66
+ $query_type = ( $this->post->type == 'np-redirect' ) ? 'xfn' : 'object_id';
67
+ $menu_item_id = $this->nav_menu_repo->getMenuItem($this->post->id, $query_type);
68
+
69
  if ( $this->post->nav_status == 'hide' ) return $this->removeItem($menu_item_id);
70
+ $menu = $this->syncMenuItem($menu_parent, $menu_item_id);
 
 
 
 
71
  $this->sync( $this->post->id, $menu );
72
  }
73
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
74
  /**
75
  * Sync Link Menu Item
76
  * @since 1.1.4
77
  */
78
+ private function syncMenuItem($menu_parent, $menu_item_id)
79
  {
80
+ $type = ( $this->post->nav_type ) ? $this->post->nav_type : 'custom';
81
+ $object = ( $this->post->nav_object ) ? $this->post->nav_object : 'custom';
82
+ $object_id = ( $this->post->nav_object_id ) ? $this->post->nav_object_id : null;
83
+ $url = ( $type == 'custom' ) ? esc_url($this->post->content) : null;
84
+ $xfn = $this->post->id;
85
+
86
+ // Compatibility for 1.4.1 - Reset Page links
87
+ if ( $this->post->type == 'page' ){
88
+ $type = 'post_type';
89
+ $object = 'page';
90
+ $object_id = $this->post->id;
91
+ $xfn = 'page';
92
+ }
93
+
94
+ $args = array(
95
  'menu-item-title' => $this->post->title,
96
  'menu-item-position' => $this->count,
97
+ 'menu-item-url' => $url,
98
  'menu-item-attr-title' => $this->post->nav_title_attr,
99
  'menu-item-status' => 'publish',
100
  'menu-item-classes' => $this->post->nav_css,
101
+ 'menu-item-type' => $type,
102
+ 'menu-item-object' => $object,
103
+ 'menu-item-object-id' => $object_id,
104
  'menu-item-parent-id' => $menu_parent,
105
+ 'menu-item-xfn' => $xfn,
106
  'menu-item-target' => $this->post->link_target
107
+ );
108
+ $menu = wp_update_nav_menu_item($this->id, $menu_item_id, $args);
109
  return $menu;
110
  }
111
 
 
112
  }
app/Entities/NavMenu/NavMenuSyncMenu.php CHANGED
@@ -1,4 +1,6 @@
1
- <?php namespace NestedPages\Entities\NavMenu;
 
 
2
 
3
  use NestedPages\Entities\NavMenu\NavMenuSync;
4
  use NestedPages\Helpers;
@@ -9,7 +11,8 @@ use NestedPages\Entities\NavMenu\NavMenuRepository;
9
  /**
10
  * Syncs the Listing to Match the Menu
11
  */
12
- class NavMenuSyncMenu extends NavMenuSync implements NavMenuSyncInterface {
 
13
 
14
  /**
15
  * Menu Items
@@ -46,7 +49,6 @@ class NavMenuSyncMenu extends NavMenuSync implements NavMenuSyncInterface {
46
  return true;
47
  }
48
 
49
-
50
  /**
51
  * Get the menu items from menu and set them
52
  */
@@ -55,7 +57,6 @@ class NavMenuSyncMenu extends NavMenuSync implements NavMenuSyncInterface {
55
  $this->menu_items = wp_get_nav_menu_items($this->id);
56
  }
57
 
58
-
59
  /**
60
  * Loop through the menu items and sync depending on type
61
  */
@@ -64,7 +65,6 @@ class NavMenuSyncMenu extends NavMenuSync implements NavMenuSyncInterface {
64
  if ( get_option('nestedpages_menusync') !== 'sync' ) return;
65
  $this->setMenuIndex();
66
  $this->updatePagesNavStatus();
67
- // var_dump($this->menu_items); die();
68
  foreach($this->menu_items as $key => $item){
69
  $this->updatePost($item);
70
  }
@@ -83,7 +83,6 @@ class NavMenuSyncMenu extends NavMenuSync implements NavMenuSyncInterface {
83
  }
84
  }
85
 
86
-
87
  /**
88
  * Update the WP Post with Menu Data
89
  */
@@ -95,7 +94,7 @@ class NavMenuSyncMenu extends NavMenuSync implements NavMenuSyncInterface {
95
  $parent_id = $this->nav_menu_repo->getLinkfromTitle($this->index[$item->menu_item_parent]['title']);
96
  }
97
 
98
- $post_id = ( $item->object == 'custom' )
99
  ? $item->xfn
100
  : $item->object_id;
101
 
@@ -120,25 +119,29 @@ class NavMenuSyncMenu extends NavMenuSync implements NavMenuSyncInterface {
120
  }
121
  }
122
 
123
-
124
  /**
125
  * Sync a new Link
126
  */
127
  private function syncNewLink($item, $parent_id)
128
  {
129
  $post_data = array(
 
130
  'np_link_title' => $item->title,
131
  '_status' => 'publish',
132
  'np_link_content' => $item->url,
133
  'parent_id' => $parent_id,
134
  'post_type' => 'np-redirect',
135
  'link_target' => $item->target,
136
- 'menu_order'=> $item->menu_order
 
 
 
 
137
  );
138
- $this->post_update_repo->saveRedirect($post_data);
 
139
  }
140
 
141
-
142
  /**
143
  * Update NP Nav Status for Pages
144
  * If a menu item is removed, it's nav status needs to be set to hide
@@ -158,4 +161,4 @@ class NavMenuSyncMenu extends NavMenuSync implements NavMenuSyncInterface {
158
  }
159
  }
160
 
161
- }
1
+ <?php
2
+
3
+ namespace NestedPages\Entities\NavMenu;
4
 
5
  use NestedPages\Entities\NavMenu\NavMenuSync;
6
  use NestedPages\Helpers;
11
  /**
12
  * Syncs the Listing to Match the Menu
13
  */
14
+ class NavMenuSyncMenu extends NavMenuSync
15
+ {
16
 
17
  /**
18
  * Menu Items
49
  return true;
50
  }
51
 
 
52
  /**
53
  * Get the menu items from menu and set them
54
  */
57
  $this->menu_items = wp_get_nav_menu_items($this->id);
58
  }
59
 
 
60
  /**
61
  * Loop through the menu items and sync depending on type
62
  */
65
  if ( get_option('nestedpages_menusync') !== 'sync' ) return;
66
  $this->setMenuIndex();
67
  $this->updatePagesNavStatus();
 
68
  foreach($this->menu_items as $key => $item){
69
  $this->updatePost($item);
70
  }
83
  }
84
  }
85
 
 
86
  /**
87
  * Update the WP Post with Menu Data
88
  */
94
  $parent_id = $this->nav_menu_repo->getLinkfromTitle($this->index[$item->menu_item_parent]['title']);
95
  }
96
 
97
+ $post_id = ( $item->xfn !== 'page' )
98
  ? $item->xfn
99
  : $item->object_id;
100
 
119
  }
120
  }
121
 
 
122
  /**
123
  * Sync a new Link
124
  */
125
  private function syncNewLink($item, $parent_id)
126
  {
127
  $post_data = array(
128
+ 'menuTitle' => $item->title,
129
  'np_link_title' => $item->title,
130
  '_status' => 'publish',
131
  'np_link_content' => $item->url,
132
  'parent_id' => $parent_id,
133
  'post_type' => 'np-redirect',
134
  'link_target' => $item->target,
135
+ 'menu_order'=> $item->menu_order,
136
+ 'menuType' => $item->type,
137
+ 'objectType' => $item->object,
138
+ 'objectId' => $item->object_id,
139
+ 'titleAttribute' => $item->attr_title
140
  );
141
+ $post_id = $this->post_update_repo->saveRedirect($post_data);
142
+ update_post_meta($item->ID, '_menu_item_xfn', $post_id);
143
  }
144
 
 
145
  /**
146
  * Update NP Nav Status for Pages
147
  * If a menu item is removed, it's nav status needs to be set to hide
161
  }
162
  }
163
 
164
+ }
app/Entities/NavMenu/NavMenuTrashActions.php CHANGED
@@ -1,11 +1,14 @@
1
- <?php namespace NestedPages\Entities\NavMenu;
 
 
2
 
3
  use NestedPages\Entities\NavMenu\NavMenuRepository;
4
 
5
  /**
6
  * Performs necessary actions when a menu item is trashed
7
  */
8
- class NavMenuTrashActions {
 
9
 
10
  /**
11
  * Nav Menu Repository
1
+ <?php
2
+
3
+ namespace NestedPages\Entities\NavMenu;
4
 
5
  use NestedPages\Entities\NavMenu\NavMenuRepository;
6
 
7
  /**
8
  * Performs necessary actions when a menu item is trashed
9
  */
10
+ class NavMenuTrashActions
11
+ {
12
 
13
  /**
14
  * Nav Menu Repository
app/Entities/PluginIntegration/EditorialAccessManager.php CHANGED
@@ -1,12 +1,14 @@
1
- <?php namespace NestedPages\Entities\PluginIntegration;
 
 
2
 
3
  /**
4
  * Editorial Access Manager Integration
5
  * @link https://wordpress.org/plugins/editorial-access-manager/
6
  */
7
 
8
- class EditorialAccessManager {
9
-
10
  /**
11
  * Installed
12
  * @var boolean
@@ -27,7 +29,6 @@ class EditorialAccessManager {
27
  }
28
  }
29
 
30
-
31
  /**
32
  * Does the current user have access to the specified post id?
33
  * @return boolean
@@ -52,7 +53,6 @@ class EditorialAccessManager {
52
  return true;
53
  }
54
 
55
-
56
  /**
57
  * Abort Role Check?
58
  * @return boolean
1
+ <?php
2
+
3
+ namespace NestedPages\Entities\PluginIntegration;
4
 
5
  /**
6
  * Editorial Access Manager Integration
7
  * @link https://wordpress.org/plugins/editorial-access-manager/
8
  */
9
 
10
+ class EditorialAccessManager
11
+ {
12
  /**
13
  * Installed
14
  * @var boolean
29
  }
30
  }
31
 
 
32
  /**
33
  * Does the current user have access to the specified post id?
34
  * @return boolean
53
  return true;
54
  }
55
 
 
56
  /**
57
  * Abort Role Check?
58
  * @return boolean
app/Entities/PluginIntegration/IntegrationFactory.php CHANGED
@@ -1,8 +1,11 @@
1
- <?php namespace NestedPages\Entities\PluginIntegration;
 
 
2
 
3
  use NestedPages\Entities\PluginIntegration\EditorialAccessManager;
4
 
5
- class IntegrationFactory {
 
6
 
7
  /**
8
  * Integration Classes
1
+ <?php
2
+
3
+ namespace NestedPages\Entities\PluginIntegration;
4
 
5
  use NestedPages\Entities\PluginIntegration\EditorialAccessManager;
6
 
7
+ class IntegrationFactory
8
+ {
9
 
10
  /**
11
  * Integration Classes
app/Entities/Post/PostDataFactory.php CHANGED
@@ -1,10 +1,12 @@
1
- <?php namespace NestedPages\Entities\Post;
2
 
 
3
 
4
  /**
5
  * Build Post Data Object
6
  */
7
- class PostDataFactory {
 
8
 
9
  /**
10
  * Post Data
@@ -20,10 +22,9 @@ class PostDataFactory {
20
  $this->post_data = new \stdClass();
21
  $this->addPostVars($post);
22
  $this->addPostMeta($post);
23
- $this->addMenuOptions($post);
24
  $this->addDate($post);
25
  $this->author($post);
26
-
27
  return $this->post_data;
28
  }
29
 
@@ -35,7 +36,6 @@ class PostDataFactory {
35
  $this->post_data->id = $post->ID;
36
  $this->post_data->parent_id = $post->post_parent;
37
  $this->post_data->title = $post->post_title;
38
- $this->post_data->template = get_post_meta($post->ID, '_wp_page_template', true);
39
  $this->post_data->password = $post->post_password;
40
  $this->post_data->status = $post->post_status;
41
  $this->post_data->type = $post->post_type;
@@ -50,9 +50,17 @@ class PostDataFactory {
50
  */
51
  public function addPostMeta($post)
52
  {
53
- // Hidden in Nested Pages?
54
- $np_status = get_post_meta( $post->ID, 'nested_pages_status', true );
55
- $this->post_data->np_status = ( $np_status == 'hide' ) ? 'hide' : 'show';
 
 
 
 
 
 
 
 
56
 
57
  // Yoast Score
58
  if ( function_exists('wpseo_auto_load') ) {
@@ -67,16 +75,26 @@ class PostDataFactory {
67
  }
68
 
69
  /**
70
- * Menu Options
71
  */
72
- private function addMenuOptions($post)
73
  {
74
- $this->post_data->nav_title = get_post_meta($post->ID, 'np_nav_title', true);
75
- $this->post_data->link_target = get_post_meta($post->ID, 'np_link_target', true);
76
- $this->post_data->nav_title_attr = get_post_meta($post->ID, 'np_title_attribute', true);
77
- $this->post_data->nav_css = get_post_meta($post->ID, 'np_nav_css_classes', true);
78
- $nav_status = get_post_meta( $post->ID, 'np_nav_status', true);
79
- $this->post_data->nav_status = ( $nav_status == 'hide' ) ? 'hide' : 'show';
 
 
 
 
 
 
 
 
 
 
80
  }
81
 
82
  /**
@@ -85,12 +103,13 @@ class PostDataFactory {
85
  private function addDate($post)
86
  {
87
  $this->post_data->date = new \stdClass();
88
- $this->post_data->date->d = get_the_time('d', $post->ID);
89
- $this->post_data->date->month = get_the_time('m', $post->ID);
90
- $this->post_data->date->y = get_the_time('Y', $post->ID);
91
- $this->post_data->date->h = get_the_time('H', $post->ID);
92
- $this->post_data->date->m = get_the_time('i', $post->ID);
93
- $this->post_data->date->datepicker = get_the_time('U', $post->ID);
 
94
  }
95
 
96
  /**
1
+ <?php
2
 
3
+ namespace NestedPages\Entities\Post;
4
 
5
  /**
6
  * Build Post Data Object
7
  */
8
+ class PostDataFactory
9
+ {
10
 
11
  /**
12
  * Post Data
22
  $this->post_data = new \stdClass();
23
  $this->addPostVars($post);
24
  $this->addPostMeta($post);
25
+ $this->addOriginalLink($post);
26
  $this->addDate($post);
27
  $this->author($post);
 
28
  return $this->post_data;
29
  }
30
 
36
  $this->post_data->id = $post->ID;
37
  $this->post_data->parent_id = $post->post_parent;
38
  $this->post_data->title = $post->post_title;
 
39
  $this->post_data->password = $post->post_password;
40
  $this->post_data->status = $post->post_status;
41
  $this->post_data->type = $post->post_type;
50
  */
51
  public function addPostMeta($post)
52
  {
53
+ $meta = get_metadata('post', $post->ID);
54
+ $this->post_data->nav_title = ( isset($meta['np_nav_title'][0]) ) ? $meta['np_nav_title'][0] : null;
55
+ $this->post_data->link_target = ( isset($meta['np_link_target'][0]) ) ? $meta['np_link_target'][0] : null;
56
+ $this->post_data->nav_title_attr = ( isset($meta['np_title_attribute'][0]) ) ? $meta['np_title_attribute'][0] : null;
57
+ $this->post_data->nav_css = ( isset($meta['np_nav_css_classes'][0]) ) ? $meta['np_nav_css_classes'][0] : null;
58
+ $this->post_data->nav_object = ( isset($meta['np_nav_menu_item_object'][0]) ) ? $meta['np_nav_menu_item_object'][0] : null;
59
+ $this->post_data->nav_object_id = ( isset($meta['np_nav_menu_item_object_id'][0]) ) ? $meta['np_nav_menu_item_object_id'][0] : null;
60
+ $this->post_data->nav_type = ( isset($meta['np_nav_menu_item_type'][0]) ) ? $meta['np_nav_menu_item_type'][0] : null;
61
+ $this->post_data->nav_status = ( isset($meta['np_nav_status'][0]) && $meta['np_nav_status'][0] == 'hide' ) ? 'hide' : 'show';
62
+ $this->post_data->np_status = ( isset($meta['nested_pages_status'][0]) && $meta['nested_pages_status'][0] == 'hide' ) ? 'hide' : 'show';
63
+ $this->post_data->template = ( isset($meta['_wp_page_template'][0]) ) ? $meta['_wp_page_template'][0] : false;
64
 
65
  // Yoast Score
66
  if ( function_exists('wpseo_auto_load') ) {
75
  }
76
 
77
  /**
78
+ * Add original item/link to link
79
  */
80
+ private function addOriginalLink($post)
81
  {
82
+ if ( $post->post_type !== 'np-redirect' ) {
83
+ $this->post_data->nav_original_link = null;
84
+ $this->post_data->nav_original_type = null;
85
+ return;
86
+ }
87
+
88
+ if ( $this->post_data->nav_type && $this->post_data->nav_type == 'taxonomy' ){
89
+ $term = get_term_by('id', $this->post_data->nav_object_id, $this->post_data->nav_object);
90
+ $this->post_data->nav_original_link = get_term_link($term);
91
+ $this->post_data->nav_original_title = $term->name;
92
+ return;
93
+ }
94
+
95
+ $id = $this->post_data->nav_object_id;
96
+ $this->post_data->nav_original_link = get_the_permalink($id);
97
+ $this->post_data->nav_original_title = get_the_title($id);
98
  }
99
 
100
  /**
103
  private function addDate($post)
104
  {
105
  $this->post_data->date = new \stdClass();
106
+ $time = get_the_time('U', $post->ID);
107
+ $this->post_data->date->d = date('d', $time);
108
+ $this->post_data->date->month = date('m', $time);
109
+ $this->post_data->date->y = date('Y', $time);
110
+ $this->post_data->date->h = date('H', $time);
111
+ $this->post_data->date->m = date('i', $time);
112
+ $this->post_data->date->datepicker = $time;
113
  }
114
 
115
  /**
app/Entities/Post/PostFactory.php CHANGED
@@ -1,4 +1,6 @@
1
- <?php namespace NestedPages\Entities\Post;
 
 
2
 
3
  use NestedPages\Entities\Post\PostRepository;
4
  use NestedPages\Entities\Post\PostUpdateRepository;
@@ -6,7 +8,8 @@ use NestedPages\Entities\Post\PostUpdateRepository;
6
  /**
7
  * Factory class for adding new posts
8
  */
9
- class PostFactory {
 
10
 
11
  /**
12
  * Post Repository
@@ -32,7 +35,6 @@ class PostFactory {
32
  $this->post_repo = new PostRepository;
33
  $this->post_update_repo = new PostUpdateRepository;
34
  }
35
-
36
 
37
  /**
38
  * Create New Child Pages
@@ -58,7 +60,6 @@ class PostFactory {
58
  return $this->getNewPosts($post_type);
59
  }
60
 
61
-
62
  /**
63
  * Get Array of New Pages
64
  */
@@ -68,5 +69,4 @@ class PostFactory {
68
  return $new_posts;
69
  }
70
 
71
-
72
  }
1
+ <?php
2
+
3
+ namespace NestedPages\Entities\Post;
4
 
5
  use NestedPages\Entities\Post\PostRepository;
6
  use NestedPages\Entities\Post\PostUpdateRepository;
8
  /**
9
  * Factory class for adding new posts
10
  */
11
+ class PostFactory
12
+ {
13
 
14
  /**
15
  * Post Repository
35
  $this->post_repo = new PostRepository;
36
  $this->post_update_repo = new PostUpdateRepository;
37
  }
 
38
 
39
  /**
40
  * Create New Child Pages
60
  return $this->getNewPosts($post_type);
61
  }
62
 
 
63
  /**
64
  * Get Array of New Pages
65
  */
69
  return $new_posts;
70
  }
71
 
 
72
  }
app/Entities/Post/PostRepository.php CHANGED
@@ -1,6 +1,9 @@
1
- <?php namespace NestedPages\Entities\Post;
2
 
3
- class PostRepository {
 
 
 
4
 
5
  /**
6
  * Get count of hidden posts
@@ -17,7 +20,6 @@ class PostRepository {
17
  return $hidden->found_posts;
18
  }
19
 
20
-
21
  /**
22
  * Get Trash Count (pages)
23
  * @since 1.1.4
@@ -28,7 +30,6 @@ class PostRepository {
28
  return $trashed->found_posts;
29
  }
30
 
31
-
32
  /**
33
  * Get count of published posts
34
  * @param object $pages
@@ -42,7 +43,6 @@ class PostRepository {
42
  return $publish_count;
43
  }
44
 
45
-
46
  /**
47
  * Return css class string of taxonomies
48
  * @param int post_id
@@ -65,7 +65,6 @@ class PostRepository {
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)
@@ -113,7 +112,6 @@ class PostRepository {
113
  return $pages;
114
  }
115
 
116
-
117
  /**
118
  * Empty the Trash for a given post type
119
  * @since 1.3.1
@@ -128,4 +126,4 @@ class PostRepository {
128
  return true;
129
  }
130
 
131
- }
1
+ <?php
2
 
3
+ namespace NestedPages\Entities\Post;
4
+
5
+ class PostRepository
6
+ {
7
 
8
  /**
9
  * Get count of hidden posts
20
  return $hidden->found_posts;
21
  }
22
 
 
23
  /**
24
  * Get Trash Count (pages)
25
  * @since 1.1.4
30
  return $trashed->found_posts;
31
  }
32
 
 
33
  /**
34
  * Get count of published posts
35
  * @param object $pages
43
  return $publish_count;
44
  }
45
 
 
46
  /**
47
  * Return css class string of taxonomies
48
  * @param int post_id
65
  return $out;
66
  }
67
 
 
68
  /**
69
  * Get an array of pages given an array of IDs
70
  * @since 1.1.8 (used in creation of new pages)
112
  return $pages;
113
  }
114
 
 
115
  /**
116
  * Empty the Trash for a given post type
117
  * @since 1.3.1
126
  return true;
127
  }
128
 
129
+ }
app/Entities/Post/PostTrashActions.php CHANGED
@@ -1,4 +1,6 @@
1
- <?php namespace NestedPages\Entities\Post;
 
 
2
 
3
  use NestedPages\Entities\User\UserRepository;
4
  use NestedPages\Entities\NavMenu\NavMenuSyncListing;
@@ -8,7 +10,8 @@ use NestedPages\Entities\NavMenu\NavMenuRepository;
8
  /**
9
  * WP Actions tied to a Post
10
  */
11
- class PostTrashActions {
 
12
 
13
  /**
14
  * User Repository
@@ -29,7 +32,6 @@ class PostTrashActions {
29
  add_action( 'trashed_post', array( $this, 'trashHook' ) );
30
  add_action( 'delete_post', array( $this, 'removeLinkNavItem'), 10 );
31
  }
32
-
33
 
34
  /**
35
  * Trash hook - make sure child pages of trashed page are visible
@@ -58,17 +60,16 @@ class PostTrashActions {
58
  if ( $post_type == 'np-redirect' ) $this->removeNavMenuItem($post_id);
59
  }
60
 
61
-
62
  /**
63
  * Remove the nav menu item
64
  */
65
  private function removeNavMenuItem($post_id)
66
  {
67
- $nav_item_id = $this->nav_menu_repo->getMenuItemID($post_id);
 
68
  if ( $nav_item_id ) new NavMenuRemoveItem($nav_item_id);
69
  }
70
 
71
-
72
  /**
73
  * Make sure children of trashed pages are viewable in Nested Pages
74
  */
1
+ <?php
2
+
3
+ namespace NestedPages\Entities\Post;
4
 
5
  use NestedPages\Entities\User\UserRepository;
6
  use NestedPages\Entities\NavMenu\NavMenuSyncListing;
10
  /**
11
  * WP Actions tied to a Post
12
  */
13
+ class PostTrashActions
14
+ {
15
 
16
  /**
17
  * User Repository
32
  add_action( 'trashed_post', array( $this, 'trashHook' ) );
33
  add_action( 'delete_post', array( $this, 'removeLinkNavItem'), 10 );
34
  }
 
35
 
36
  /**
37
  * Trash hook - make sure child pages of trashed page are visible
60
  if ( $post_type == 'np-redirect' ) $this->removeNavMenuItem($post_id);
61
  }
62
 
 
63
  /**
64
  * Remove the nav menu item
65
  */
66
  private function removeNavMenuItem($post_id)
67
  {
68
+ $query_type = ( get_post_type($post_id) == 'np-redirect' ) ? 'xfn' : 'object_id';
69
+ $nav_item_id = $this->nav_menu_repo->getMenuItem($post_id, $query_type);
70
  if ( $nav_item_id ) new NavMenuRemoveItem($nav_item_id);
71
  }
72
 
 
73
  /**
74
  * Make sure children of trashed pages are viewable in Nested Pages
75
  */
app/Entities/Post/PostUpdateRepository.php CHANGED
@@ -1,13 +1,15 @@
1
- <?php namespace NestedPages\Entities\Post;
 
 
2
 
3
  use NestedPages\Form\Validation\Validation;
4
  use NestedPages\Entities\NavMenu\NavMenuRepository;
5
- use NestedPages\Helpers;
6
 
7
  /**
8
  * Post Create/Update Methods
9
  */
10
- class PostUpdateRepository {
 
11
 
12
  /**
13
  * Validation Class
@@ -33,7 +35,6 @@ class PostUpdateRepository {
33
  $this->nav_menu_repo = new NavMenuRepository;
34
  }
35
 
36
-
37
  /**
38
  * Update Order
39
  * @param array posts
@@ -104,7 +105,6 @@ class PostUpdateRepository {
104
  return true;
105
  }
106
 
107
-
108
  /**
109
  * Update Page Template
110
  * @param array data
@@ -122,7 +122,6 @@ class PostUpdateRepository {
122
  }
123
  }
124
 
125
-
126
  /**
127
  * Update Nav Status (show/hide in nav menu)
128
  * @since 1.0
@@ -139,7 +138,6 @@ class PostUpdateRepository {
139
  );
140
  }
141
 
142
-
143
  /**
144
  * Update Nested Pages Visibility (how/hide in Nested Pages interface)
145
  * @since 1.0
@@ -156,7 +154,6 @@ class PostUpdateRepository {
156
  );
157
  }
158
 
159
-
160
  /**
161
  * Update Nested Pages Menu Navigation Label
162
  * @since 1.0
@@ -174,7 +171,6 @@ class PostUpdateRepository {
174
  }
175
  }
176
 
177
-
178
  /**
179
  * Update Nested Pages Menu Navigation CSS Classes
180
  * @since 1.0
@@ -192,7 +188,6 @@ class PostUpdateRepository {
192
  }
193
  }
194
 
195
-
196
  /**
197
  * Update Nested Pages Menu Title Attribute
198
  * @since 1.0
@@ -210,7 +205,6 @@ class PostUpdateRepository {
210
  }
211
  }
212
 
213
-
214
  /**
215
  * Update Categories
216
  * @since 1.0
@@ -229,7 +223,6 @@ class PostUpdateRepository {
229
  }
230
  }
231
 
232
-
233
  /**
234
  * Update Hierarchical Taxonomy Terms
235
  * @since 1.0
@@ -250,7 +243,6 @@ class PostUpdateRepository {
250
  }
251
  }
252
 
253
-
254
  /**
255
  * Update Hierarchical Taxonomy Terms
256
  * @since 1.1.4
@@ -265,7 +257,6 @@ class PostUpdateRepository {
265
  wp_set_post_terms($data['post_id'], $terms, $taxonomy);
266
  }
267
 
268
-
269
  /**
270
  * Update Flat Taxonomy Terms
271
  * @since 1.1.4
@@ -282,7 +273,6 @@ class PostUpdateRepository {
282
  wp_set_post_terms($data['post_id'], $new_terms, $taxonomy);
283
  }
284
 
285
-
286
  /**
287
  * Update Link Target for Redirects
288
  * @since 1.1
@@ -299,6 +289,31 @@ class PostUpdateRepository {
299
  );
300
  }
301
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
302
 
303
  /**
304
  * Update a Redirect
@@ -307,28 +322,24 @@ class PostUpdateRepository {
307
  */
308
  public function updateRedirect($data)
309
  {
310
- $this->validation->checkEmpty($data['post_title'], __('Label', 'nestedpages'));
311
  $menu_order = isset($data['menu_order']) ? $data['menu_order'] : 0;
312
  $updated_post = array(
313
  'ID' => sanitize_text_field($data['post_id']),
314
  'post_title' => sanitize_text_field($data['post_title']),
315
  'post_status' => sanitize_text_field($data['_status']),
316
- 'post_content' => Helpers::check_url($data['post_content']),
317
  'post_parent' => sanitize_text_field($data['parent_id']),
318
  'menu_order' => $menu_order
319
  );
320
- $this->new_id = wp_update_post($updated_post);
321
 
322
- $this->updateNavStatus($data);
323
- $this->updateNestedPagesStatus($data);
324
- $this->updateLinkTarget($data);
325
- $this->updateTitleAttribute($data);
326
- $this->updateNavCSS($data);
327
 
 
 
328
  return $this->new_id;
329
  }
330
 
331
-
332
  /**
333
  * Save a new Redirect
334
  * @since 1.1
@@ -336,25 +347,21 @@ class PostUpdateRepository {
336
  */
337
  public function saveRedirect($data)
338
  {
339
- $this->validation->validateRedirect($data);
340
  $new_link = array(
341
- 'post_title' => sanitize_text_field($data['np_link_title']),
342
- 'post_status' => sanitize_text_field($data['_status']),
343
- 'post_content' => Helpers::check_url($data['np_link_content']),
344
  'post_parent' => sanitize_text_field($data['parent_id']),
345
  'post_type' => 'np-redirect',
346
  'post_excerpt' => ''
347
  );
 
 
 
348
  $this->new_id = wp_insert_post($new_link);
349
-
350
- $this->updateNavStatus($data);
351
- $this->updateNestedPagesStatus($data);
352
- $this->updateLinkTarget($data);
353
  return $this->new_id;
354
  }
355
 
356
-
357
-
358
  /**
359
  * Update a Post to Match Nav menu
360
  * @since 1.3.4
1
+ <?php
2
+
3
+ namespace NestedPages\Entities\Post;
4
 
5
  use NestedPages\Form\Validation\Validation;
6
  use NestedPages\Entities\NavMenu\NavMenuRepository;
 
7
 
8
  /**
9
  * Post Create/Update Methods
10
  */
11
+ class PostUpdateRepository
12
+ {
13
 
14
  /**
15
  * Validation Class
35
  $this->nav_menu_repo = new NavMenuRepository;
36
  }
37
 
 
38
  /**
39
  * Update Order
40
  * @param array posts
105
  return true;
106
  }
107
 
 
108
  /**
109
  * Update Page Template
110
  * @param array data
122
  }
123
  }
124
 
 
125
  /**
126
  * Update Nav Status (show/hide in nav menu)
127
  * @since 1.0
138
  );
139
  }
140
 
 
141
  /**
142
  * Update Nested Pages Visibility (how/hide in Nested Pages interface)
143
  * @since 1.0
154
  );
155
  }
156
 
 
157
  /**
158
  * Update Nested Pages Menu Navigation Label
159
  * @since 1.0
171
  }
172
  }
173
 
 
174
  /**
175
  * Update Nested Pages Menu Navigation CSS Classes
176
  * @since 1.0
188
  }
189
  }
190
 
 
191
  /**
192
  * Update Nested Pages Menu Title Attribute
193
  * @since 1.0
205
  }
206
  }
207
 
 
208
  /**
209
  * Update Categories
210
  * @since 1.0
223
  }
224
  }
225
 
 
226
  /**
227
  * Update Hierarchical Taxonomy Terms
228
  * @since 1.0
243
  }
244
  }
245
 
 
246
  /**
247
  * Update Hierarchical Taxonomy Terms
248
  * @since 1.1.4
257
  wp_set_post_terms($data['post_id'], $terms, $taxonomy);
258
  }
259
 
 
260
  /**
261
  * Update Flat Taxonomy Terms
262
  * @since 1.1.4
273
  wp_set_post_terms($data['post_id'], $new_terms, $taxonomy);
274
  }
275
 
 
276
  /**
277
  * Update Link Target for Redirects
278
  * @since 1.1
289
  );
290
  }
291
 
292
+ /**
293
+ * Update Menu Related Meta
294
+ * @since 1.4.1
295
+ * @param array $data
296
+ */
297
+ private function updateMenuMeta($data)
298
+ {
299
+ $id = ( isset($data['post_id']) ) ? $data['post_id'] : $this->new_id;
300
+ $link_target = ( isset($data['linkTarget']) ) ? "_blank" : "";
301
+ update_post_meta($id, 'np_link_target', $link_target);
302
+ update_post_meta($id, 'np_nav_menu_item_type', sanitize_text_field($data['menuType']));
303
+ update_post_meta($id, 'np_nav_menu_item_object', sanitize_text_field($data['objectType']));
304
+ update_post_meta($id, 'np_nav_menu_item_object_id', sanitize_text_field($data['objectId']));
305
+ if ( isset($data['cssClasses']) ){
306
+ update_post_meta($id, 'np_nav_css_classes', sanitize_text_field($data['cssClasses']));
307
+ }
308
+ if ( isset($data['titleAttribute']) ){
309
+ $title_attr = sanitize_text_field($data['titleAttribute']);
310
+ update_post_meta($id, 'np_title_attribute', $title_attr);
311
+ }
312
+ if ( isset($data['navigationLabel']) ){
313
+ $title = sanitize_text_field($data['navigationLabel']);
314
+ update_post_meta($id, 'np_nav_title', $title);
315
+ }
316
+ }
317
 
318
  /**
319
  * Update a Redirect
322
  */
323
  public function updateRedirect($data)
324
  {
 
325
  $menu_order = isset($data['menu_order']) ? $data['menu_order'] : 0;
326
  $updated_post = array(
327
  'ID' => sanitize_text_field($data['post_id']),
328
  'post_title' => sanitize_text_field($data['post_title']),
329
  'post_status' => sanitize_text_field($data['_status']),
 
330
  'post_parent' => sanitize_text_field($data['parent_id']),
331
  'menu_order' => $menu_order
332
  );
 
333
 
334
+ if ( isset($data['post_content']) && $data['post_content'] !== "" ){
335
+ $updated_post['post_content'] = esc_url($data['post_content']);
336
+ }
 
 
337
 
338
+ $this->new_id = wp_update_post($updated_post);
339
+ $this->updateMenuMeta($data);
340
  return $this->new_id;
341
  }
342
 
 
343
  /**
344
  * Save a new Redirect
345
  * @since 1.1
347
  */
348
  public function saveRedirect($data)
349
  {
 
350
  $new_link = array(
351
+ 'post_title' => sanitize_text_field($data['menuTitle']),
352
+ 'post_status' => sanitize_text_field('publish'),
 
353
  'post_parent' => sanitize_text_field($data['parent_id']),
354
  'post_type' => 'np-redirect',
355
  'post_excerpt' => ''
356
  );
357
+ if ( isset($data['url']) && $data['url'] !== "" ){
358
+ $new_link['post_content'] = esc_url($data['url']);
359
+ }
360
  $this->new_id = wp_insert_post($new_link);
361
+ $this->updateMenuMeta($data);
 
 
 
362
  return $this->new_id;
363
  }
364
 
 
 
365
  /**
366
  * Update a Post to Match Nav menu
367
  * @since 1.3.4
app/Entities/PostType/PostTypeRepository.php CHANGED
@@ -1,7 +1,9 @@
1
- <?php namespace NestedPages\Entities\PostType;
2
 
3
- class PostTypeRepository {
4
 
 
 
5
 
6
  /**
7
  * Get Available Post Types
@@ -13,7 +15,6 @@ class PostTypeRepository {
13
  return get_post_types(array('show_ui'=>true), $return);
14
  }
15
 
16
-
17
  /**
18
  * Get an object of non-page post types
19
  * @since 1.2.1
@@ -38,7 +39,6 @@ class PostTypeRepository {
38
  return $post_types;
39
  }
40
 
41
-
42
  /**
43
  * Is the specified post type set to override the default menu?
44
  * @param string post type name
@@ -55,7 +55,6 @@ class PostTypeRepository {
55
  }
56
  }
57
 
58
-
59
  /**
60
  * Is the specified post type set to hide the default link?
61
  * @param string post type name
@@ -88,7 +87,6 @@ class PostTypeRepository {
88
  }
89
  }
90
 
91
-
92
  /**
93
  * Get an array of NP enabled Post Types
94
  * @since 1.2.1
@@ -100,7 +98,6 @@ class PostTypeRepository {
100
  return ( !$types ) ? array() : $types;
101
  }
102
 
103
-
104
  /**
105
  * Add New Post Link
106
  * @since 1.2.1
@@ -112,7 +109,6 @@ class PostTypeRepository {
112
  return esc_url( admin_url('post-new.php?post_type=' . $post_type) );
113
  }
114
 
115
-
116
  /**
117
  * Trash Link
118
  * @since 1.2.1
@@ -124,7 +120,6 @@ class PostTypeRepository {
124
  return esc_url( admin_url('edit.php?post_status=trash&post_type=' . $post_type) );
125
  }
126
 
127
-
128
  /**
129
  * Edit Post Link
130
  * @since 1.2.1
@@ -136,7 +131,6 @@ class PostTypeRepository {
136
  return ( $post_type->name == 'post' ) ? 'edit.php' : 'edit.php?post_type=' . $post_type->name;
137
  }
138
 
139
-
140
  /**
141
  * Get Taxonomies enabled for post type
142
  * @since 1.2.1
@@ -161,6 +155,20 @@ class PostTypeRepository {
161
  return ($hierarchical) ? $hierarchical_taxonomies : $flat_taxonomies;
162
  }
163
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
164
 
165
  /**
166
  * Get the NP menu slug for a post type
@@ -171,7 +179,6 @@ class PostTypeRepository {
171
  return ( $post_type->name == 'page' ) ? 'nestedpages' : 'nestedpages-' . $post_type->name;
172
  }
173
 
174
-
175
  /**
176
  * Set the Submenu Text
177
  * "Nested View" for Hierarchical Post Types
@@ -182,5 +189,4 @@ class PostTypeRepository {
182
  return ( $post_type->hierarchical ) ? __('Nested View', 'nestedpages') : __('Sort View', 'nestedpages');
183
  }
184
 
185
-
186
  }
1
+ <?php
2
 
3
+ namespace NestedPages\Entities\PostType;
4
 
5
+ class PostTypeRepository
6
+ {
7
 
8
  /**
9
  * Get Available Post Types
15
  return get_post_types(array('show_ui'=>true), $return);
16
  }
17
 
 
18
  /**
19
  * Get an object of non-page post types
20
  * @since 1.2.1
39
  return $post_types;
40
  }
41
 
 
42
  /**
43
  * Is the specified post type set to override the default menu?
44
  * @param string post type name
55
  }
56
  }
57
 
 
58
  /**
59
  * Is the specified post type set to hide the default link?
60
  * @param string post type name
87
  }
88
  }
89
 
 
90
  /**
91
  * Get an array of NP enabled Post Types
92
  * @since 1.2.1
98
  return ( !$types ) ? array() : $types;
99
  }
100
 
 
101
  /**
102
  * Add New Post Link
103
  * @since 1.2.1
109
  return esc_url( admin_url('post-new.php?post_type=' . $post_type) );
110
  }
111
 
 
112
  /**
113
  * Trash Link
114
  * @since 1.2.1
120
  return esc_url( admin_url('edit.php?post_status=trash&post_type=' . $post_type) );
121
  }
122
 
 
123
  /**
124
  * Edit Post Link
125
  * @since 1.2.1
131
  return ( $post_type->name == 'post' ) ? 'edit.php' : 'edit.php?post_type=' . $post_type->name;
132
  }
133
 
 
134
  /**
135
  * Get Taxonomies enabled for post type
136
  * @since 1.2.1
155
  return ($hierarchical) ? $hierarchical_taxonomies : $flat_taxonomies;
156
  }
157
 
158
+ /**
159
+ * Are Categories Enabled for a post type?
160
+ * @since 1.5.0
161
+ * @return boolean
162
+ */
163
+ public function categoriesEnabled($post_type)
164
+ {
165
+ $taxonomies = $this->getTaxonomies($post_type, true);
166
+ $enabled = false;
167
+ foreach($taxonomies as $taxonomy){
168
+ if ( $taxonomy->name == 'category' ) $enabled = true;
169
+ }
170
+ return $enabled;
171
+ }
172
 
173
  /**
174
  * Get the NP menu slug for a post type
179
  return ( $post_type->name == 'page' ) ? 'nestedpages' : 'nestedpages-' . $post_type->name;
180
  }
181
 
 
182
  /**
183
  * Set the Submenu Text
184
  * "Nested View" for Hierarchical Post Types
189
  return ( $post_type->hierarchical ) ? __('Nested View', 'nestedpages') : __('Sort View', 'nestedpages');
190
  }
191
 
 
192
  }
app/Entities/PostType/RegisterPostTypes.php CHANGED
@@ -1,16 +1,18 @@
1
- <?php namespace NestedPages\Entities\PostType;
 
 
2
 
3
  /**
4
  * Post Types required by Nested Pages
5
  */
6
- class RegisterPostTypes {
 
7
 
8
  public function __construct()
9
  {
10
  add_action( 'init', array( $this, 'registerRedirects') );
11
  }
12
 
13
-
14
  /**
15
  * Redirects Post Type
16
  */
1
+ <?php
2
+
3
+ namespace NestedPages\Entities\PostType;
4
 
5
  /**
6
  * Post Types required by Nested Pages
7
  */
8
+ class RegisterPostTypes
9
+ {
10
 
11
  public function __construct()
12
  {
13
  add_action( 'init', array( $this, 'registerRedirects') );
14
  }
15
 
 
16
  /**
17
  * Redirects Post Type
18
  */
app/Entities/User/UserRepository.php CHANGED
@@ -1,9 +1,13 @@
1
- <?php namespace NestedPages\Entities\User;
 
 
 
2
  /**
3
  * User Repository
4
  * @since 1.1.7
5
  */
6
- class UserRepository {
 
7
 
8
  /**
9
  * Return Current User's Roles
@@ -16,8 +20,6 @@ class UserRepository {
16
  return $current_user->roles;
17
  }
18
 
19
-
20
-
21
  /**
22
  * Get all roles that arent admin, contributor or subscriber
23
  * @return array
@@ -42,7 +44,6 @@ class UserRepository {
42
  return $roles;
43
  }
44
 
45
-
46
  /**
47
  * Can current user sort pages
48
  * @return boolean
@@ -61,7 +62,6 @@ class UserRepository {
61
  return false;
62
  }
63
 
64
-
65
  /**
66
  * Get an array of all users/ids
67
  * @since 1.3.0
@@ -75,7 +75,6 @@ class UserRepository {
75
  return $users;
76
  }
77
 
78
-
79
  /**
80
  * Get User's Visible Pages
81
  * @since 1.3.4
@@ -86,7 +85,6 @@ class UserRepository {
86
  return unserialize(get_user_meta(get_current_user_id(), 'np_visible_posts', true));
87
  }
88
 
89
-
90
  /**
91
  * Update User's Visible Pages
92
  */
@@ -101,5 +99,4 @@ class UserRepository {
101
  );
102
  }
103
 
104
-
105
  }
1
+ <?php
2
+
3
+ namespace NestedPages\Entities\User;
4
+
5
  /**
6
  * User Repository
7
  * @since 1.1.7
8
  */
9
+ class UserRepository
10
+ {
11
 
12
  /**
13
  * Return Current User's Roles
20
  return $current_user->roles;
21
  }
22
 
 
 
23
  /**
24
  * Get all roles that arent admin, contributor or subscriber
25
  * @return array
44
  return $roles;
45
  }
46
 
 
47
  /**
48
  * Can current user sort pages
49
  * @return boolean
62
  return false;
63
  }
64
 
 
65
  /**
66
  * Get an array of all users/ids
67
  * @since 1.3.0
75
  return $users;
76
  }
77
 
 
78
  /**
79
  * Get User's Visible Pages
80
  * @since 1.3.4
85
  return unserialize(get_user_meta(get_current_user_id(), 'np_visible_posts', true));
86
  }
87
 
 
88
  /**
89
  * Update User's Visible Pages
90
  */
99
  );
100
  }
101
 
 
102
  }
app/Form/{FormActionFactory.php → Events.php} RENAMED
@@ -1,9 +1,12 @@
1
- <?php namespace NestedPages\Form;
 
 
2
 
3
  /**
4
  * Registers the WP Actions/Handlers
5
  */
6
- class FormActionFactory {
 
7
 
8
  /**
9
  * Actions
@@ -17,16 +20,15 @@ class FormActionFactory {
17
  */
18
  private $handlers;
19
 
20
-
21
  public function __construct()
22
  {
23
- $this->setActions();
24
  }
25
 
26
  /**
27
  * Set the Form Actions
28
  */
29
- public function setActions()
30
  {
31
  $this->actions = array(
32
  'wp_ajax_npsort',
@@ -34,13 +36,15 @@ class FormActionFactory {
34
  'wp_ajax_npsyncMenu',
35
  'wp_ajax_npnestToggle',
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
  'admin_post_npSearch',
43
- 'wp_ajax_npclonePost'
 
 
 
44
  );
45
  $this->setHandlers();
46
  }
@@ -52,10 +56,10 @@ class FormActionFactory {
52
  {
53
  foreach($this->actions as $key => $action){
54
  $class = str_replace('admin_post_np', '', $action); // Non-AJAX forms
55
- $class = ucfirst(str_replace('wp_ajax_np', '', $class)) . 'Handler'; // AJAX forms
56
  $this->handlers[$key] = new \stdClass();
57
  $this->handlers[$key]->action = $action;
58
- $this->handlers[$key]->class = 'NestedPages\Form\Handlers\\' . $class;
59
  }
60
  $this->build();
61
  }
1
+ <?php
2
+
3
+ namespace NestedPages\Form;
4
 
5
  /**
6
  * Registers the WP Actions/Handlers
7
  */
8
+ class Events
9
+ {
10
 
11
  /**
12
  * Actions
20
  */
21
  private $handlers;
22
 
 
23
  public function __construct()
24
  {
25
+ $this->registerEvents();
26
  }
27
 
28
  /**
29
  * Set the Form Actions
30
  */
31
+ public function registerEvents()
32
  {
33
  $this->actions = array(
34
  'wp_ajax_npsort',
36
  'wp_ajax_npsyncMenu',
37
  'wp_ajax_npnestToggle',
38
  'wp_ajax_npquickEditLink',
 
39
  'wp_ajax_npgetTaxonomies',
40
  'wp_ajax_npnewChild',
41
  'admin_post_npListingSort',
42
  'wp_ajax_npEmptyTrash',
43
  'admin_post_npSearch',
44
+ 'wp_ajax_npclonePost',
45
+ 'wp_ajax_npmenuSearch',
46
+ 'wp_ajax_npnewMenuItem',
47
+ 'admin_post_npCategoryFilter'
48
  );
49
  $this->setHandlers();
50
  }
56
  {
57
  foreach($this->actions as $key => $action){
58
  $class = str_replace('admin_post_np', '', $action); // Non-AJAX forms
59
+ $class = ucfirst(str_replace('wp_ajax_np', '', $class)); // AJAX forms
60
  $this->handlers[$key] = new \stdClass();
61
  $this->handlers[$key]->action = $action;
62
+ $this->handlers[$key]->class = 'NestedPages\Form\Listeners\\' . $class;
63
  }
64
  $this->build();
65
  }
app/Form/Handlers/NewLinkHandler.php DELETED
@@ -1,59 +0,0 @@
1
- <?php namespace NestedPages\Form\Handlers;
2
-
3
- use NestedPages\Helpers;
4
- /**
5
- * Creates new Redirect/Link
6
- * @return json response
7
- */
8
- class NewLinkHandler extends BaseHandler {
9
-
10
-
11
- public function __construct()
12
- {
13
- parent::__construct();
14
- $this->saveRedirect();
15
- $this->syncMenu();
16
- $this->sendResponse();
17
- }
18
-
19
-
20
- /**
21
- * Update the Post
22
- * @todo update taxonomies
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();
30
- $this->formatLink();
31
- $this->response = array(
32
- 'status' => 'success',
33
- 'message' => __('Link successfully updated', 'nestedpages'),
34
- 'post_data' => $this->data
35
- );
36
- }
37
-
38
-
39
- /**
40
- * Format the new link for AJAX response
41
- */
42
- private function formatLink()
43
- {
44
- $this->data['np_link_content'] = Helpers::check_url($this->data['np_link_content']);
45
- }
46
-
47
-
48
- /**
49
- * Add additional data to the response object
50
- */
51
- private function addData()
52
- {
53
- $this->data['delete_link'] = get_delete_post_link($this->data['id'],'', true);
54
- $this->data['nav_status'] = ( isset($this->data['nav_status']) ) ? 'hide' : 'show';
55
- $this->data['np_status'] = ( isset($this->data['nested_pages_status']) ) ? 'hide' : 'show';
56
- $this->data['link_target'] = ( isset($this->data['link_target']) ) ? '_blank' : 'none';
57
- }
58
-
59
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/Form/{Handlers → Listeners}/BaseHandler.php RENAMED
@@ -1,4 +1,6 @@
1
- <?php namespace NestedPages\Form\Handlers;
 
 
2
 
3
  use NestedPages\Entities\NavMenu\NavMenuSyncListing;
4
  use NestedPages\Entities\Post\PostRepository;
@@ -8,7 +10,8 @@ use NestedPages\Entities\User\UserRepository;
8
  /**
9
  * Base Form Handler Class
10
  */
11
- abstract class BaseHandler {
 
12
 
13
  /**
14
  * Nonce
@@ -55,7 +58,6 @@ abstract class BaseHandler {
55
  $this->validateNonce();
56
  }
57
 
58
-
59
  /**
60
  * Set the Form Data
61
  */
@@ -69,7 +71,6 @@ abstract class BaseHandler {
69
  $this->data = $data;
70
  }
71
 
72
-
73
  /**
74
  * Validate the Nonce
75
  */
@@ -82,7 +83,6 @@ abstract class BaseHandler {
82
  }
83
  }
84
 
85
-
86
  /**
87
  * Sync the Nav Menu
88
  */
@@ -99,7 +99,6 @@ abstract class BaseHandler {
99
  }
100
  }
101
 
102
-
103
  /**
104
  * Send a Generic Success Message
105
  */
@@ -112,7 +111,6 @@ abstract class BaseHandler {
112
  $this->sendResponse();
113
  }
114
 
115
-
116
  /**
117
  * Return Response
118
  */
1
+ <?php
2
+
3
+ namespace NestedPages\Form\Listeners;
4
 
5
  use NestedPages\Entities\NavMenu\NavMenuSyncListing;
6
  use NestedPages\Entities\Post\PostRepository;
10
  /**
11
  * Base Form Handler Class
12
  */
13
+ abstract class BaseHandler
14
+ {
15
 
16
  /**
17
  * Nonce
58
  $this->validateNonce();
59
  }
60
 
 
61
  /**
62
  * Set the Form Data
63
  */
71
  $this->data = $data;
72
  }
73
 
 
74
  /**
75
  * Validate the Nonce
76
  */
83
  }
84
  }
85
 
 
86
  /**
87
  * Sync the Nav Menu
88
  */
99
  }
100
  }
101
 
 
102
  /**
103
  * Send a Generic Success Message
104
  */
111
  $this->sendResponse();
112
  }
113
 
 
114
  /**
115
  * Return Response
116
  */
app/Form/Listeners/CategoryFilter.php ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace NestedPages\Form\Listeners;
4
+
5
+ /**
6
+ * Filter Pages by Category
7
+ */
8
+ class CategoryFilter
9
+ {
10
+
11
+ /**
12
+ * URL to redirect to
13
+ * @var string
14
+ */
15
+ private $url;
16
+
17
+ public function __construct()
18
+ {
19
+ $this->setURL();
20
+ $this->redirect();
21
+ }
22
+
23
+ /**
24
+ * Build the URL to Redirect to
25
+ */
26
+ private function setURL()
27
+ {
28
+ $this->url = sanitize_text_field($_POST['page']);
29
+ $this->setCategories();
30
+ }
31
+
32
+ /**
33
+ * Set Order parameters
34
+ */
35
+ private function setCategories()
36
+ {
37
+ $this->url .= '&category=' . sanitize_text_field($_POST['np_category']);
38
+ }
39
+
40
+
41
+ /**
42
+ * Redirect to new URL
43
+ */
44
+ private function redirect()
45
+ {
46
+ header('Location:' . $this->url);
47
+ }
48
+ }
app/Form/{Handlers/ClonePostHandler.php → Listeners/ClonePost.php} RENAMED
@@ -1,13 +1,13 @@
1
  <?php
2
 
3
- namespace NestedPages\Form\Handlers;
4
 
5
  use NestedPages\Entities\Post\PostCloner;
6
 
7
  /**
8
  * Clone an existing post
9
  */
10
- class ClonePostHandler extends BaseHandler
11
  {
12
  /**
13
  * Post ID/status/author to Clone
1
  <?php
2
 
3
+ namespace NestedPages\Form\Listeners;
4
 
5
  use NestedPages\Entities\Post\PostCloner;
6
 
7
  /**
8
  * Clone an existing post
9
  */
10
+ class ClonePost extends BaseHandler
11
  {
12
  /**
13
  * Post ID/status/author to Clone
app/Form/{Handlers/EmptyTrashHandler.php → Listeners/EmptyTrash.php} RENAMED
@@ -1,6 +1,9 @@
1
- <?php namespace NestedPages\Form\Handlers;
2
 
3
- class EmptyTrashHandler extends BaseHandler {
 
 
 
4
 
5
  public function __construct()
6
  {
1
+ <?php
2
 
3
+ namespace NestedPages\Form\Listeners;
4
+
5
+ class EmptyTrash extends BaseHandler
6
+ {
7
 
8
  public function __construct()
9
  {
app/Form/{Handlers/GetTaxonomiesHandler.php → Listeners/GetTaxonomies.php} RENAMED
@@ -1,10 +1,13 @@
1
- <?php namespace NestedPages\Form\Handlers;
 
 
2
 
3
  /**
4
  * Gets term names
5
  * @return json response
6
  */
7
- class GetTaxonomiesHandler extends BaseHandler {
 
8
 
9
  /**
10
  * Terms to return
@@ -12,7 +15,6 @@ class GetTaxonomiesHandler extends BaseHandler {
12
  */
13
  private $terms;
14
 
15
-
16
  public function __construct()
17
  {
18
  parent::__construct();
@@ -21,19 +23,18 @@ class GetTaxonomiesHandler extends BaseHandler {
21
  $this->sendResponse();
22
  }
23
 
24
-
25
  /**
26
  * Loop through the taxonomies
27
  */
28
  private function loopTaxonomies()
29
  {
 
30
  $terms = $this->data['terms'];
31
  foreach ($terms as $taxonomy => $tax_terms){
32
  $this->setTermNames($taxonomy, $tax_terms);
33
  }
34
  }
35
 
36
-
37
  /**
38
  * Get the Term names for each taxonomy
39
  */
@@ -47,7 +48,6 @@ class GetTaxonomiesHandler extends BaseHandler {
47
  }
48
  }
49
 
50
-
51
  /**
52
  * Prepare Response
53
  */
1
+ <?php
2
+
3
+ namespace NestedPages\Form\Listeners;
4
 
5
  /**
6
  * Gets term names
7
  * @return json response
8
  */
9
+ class GetTaxonomies extends BaseHandler
10
+ {
11
 
12
  /**
13
  * Terms to return
15
  */
16
  private $terms;
17
 
 
18
  public function __construct()
19
  {
20
  parent::__construct();
23
  $this->sendResponse();
24
  }
25
 
 
26
  /**
27
  * Loop through the taxonomies
28
  */
29
  private function loopTaxonomies()
30
  {
31
+ if ( !isset($this->data['terms']) ) return;
32
  $terms = $this->data['terms'];
33
  foreach ($terms as $taxonomy => $tax_terms){
34
  $this->setTermNames($taxonomy, $tax_terms);
35
  }
36
  }
37
 
 
38
  /**
39
  * Get the Term names for each taxonomy
40
  */
48
  }
49
  }
50
 
 
51
  /**
52
  * Prepare Response
53
  */
app/Form/{Handlers/ListingSortHandler.php → Listeners/ListingSort.php} RENAMED
@@ -1,8 +1,12 @@
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
@@ -10,14 +14,12 @@ class ListingSortHandler {
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
  */
@@ -29,7 +31,6 @@ class ListingSortHandler {
29
  $this->setAuthor();
30
  }
31
 
32
-
33
  /**
34
  * Set Order by parameters
35
  */
@@ -40,7 +41,6 @@ class ListingSortHandler {
40
  $this->url .= '&orderby=' . sanitize_text_field($_POST['np_orderby']);
41
  }
42
 
43
-
44
  /**
45
  * Set Order parameters
46
  */
@@ -51,7 +51,6 @@ class ListingSortHandler {
51
  $this->url .= '&order=' . sanitize_text_field($_POST['np_order']);
52
  }
53
 
54
-
55
  /**
56
  * Set Author parameters
57
  */
@@ -62,7 +61,6 @@ class ListingSortHandler {
62
  }
63
  }
64
 
65
-
66
  /**
67
  * Redirect to new URL
68
  */
1
+ <?php
2
+
3
+ namespace NestedPages\Form\Listeners;
4
+
5
  /**
6
  * Redirect to Listing with Specified Sorting Options Applied
7
  */
8
+ class ListingSort
9
+ {
10
 
11
  /**
12
  * URL to redirect to
14
  */
15
  private $url;
16
 
 
17
  public function __construct()
18
  {
19
  $this->setURL();
20
  $this->redirect();
21
  }
22
 
 
23
  /**
24
  * Build the URL to Redirect to
25
  */
31
  $this->setAuthor();
32
  }
33
 
 
34
  /**
35
  * Set Order by parameters
36
  */
41
  $this->url .= '&orderby=' . sanitize_text_field($_POST['np_orderby']);
42
  }
43
 
 
44
  /**
45
  * Set Order parameters
46
  */
51
  $this->url .= '&order=' . sanitize_text_field($_POST['np_order']);
52
  }
53
 
 
54
  /**
55
  * Set Author parameters
56
  */
61
  }
62
  }
63
 
 
64
  /**
65
  * Redirect to new URL
66
  */
app/Form/Listeners/MenuSearch.php ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace NestedPages\Form\Listeners;
4
+
5
+ class MenuSearch extends BaseHandler
6
+ {
7
+ /**
8
+ * Form Data
9
+ */
10
+ protected $data;
11
+
12
+ /**
13
+ * Search Results
14
+ */
15
+ private $results;
16
+
17
+ public function __construct()
18
+ {
19
+ parent::__construct();
20
+ $this->setFormData();
21
+ $this->search();
22
+ return wp_send_json(array('status' => 'success', 'results' => $this->results));
23
+ }
24
+
25
+ /**
26
+ * Set the search-specific form data
27
+ */
28
+ private function setFormData()
29
+ {
30
+ $this->data['term'] = sanitize_text_field($_POST['term']);
31
+ $this->data['searchType'] = sanitize_text_field($_POST['searchType']);
32
+ $this->data['searchObject'] = sanitize_text_field($_POST['searchObject']);
33
+ }
34
+
35
+ /**
36
+ * Perform the search
37
+ */
38
+ private function search()
39
+ {
40
+ if ( $this->data['searchType'] == 'post_type' ) $this->searchPosts();
41
+ if ( $this->data['searchType'] == 'taxonomy' ) $this->searchTaxonomies();
42
+ }
43
+
44
+ /**
45
+ * Perform a search on posts
46
+ */
47
+ private function searchPosts()
48
+ {
49
+ $sq = new \WP_Query(array(
50
+ 'post_type' => $this->data['searchObject'],
51
+ 's' => $this->data['term']
52
+ ));
53
+ if ( $sq->have_posts() ) :
54
+ $this->results = $sq->posts;
55
+ $pt = get_post_type_object($this->data['searchObject']);
56
+
57
+ foreach($sq->posts as $key => $post){
58
+ $this->results[$key]->permalink = get_the_permalink($post->ID);
59
+ $this->results[$key]->singular_name = $pt->labels->singular_name;
60
+ }
61
+ else :
62
+ $this->results = null;
63
+ endif; wp_reset_postdata();
64
+ }
65
+
66
+ /**
67
+ * Perform a taxonomy search
68
+ */
69
+ private function searchTaxonomies()
70
+ {
71
+ $terms = get_terms($this->data['searchObject'], array(
72
+ 'name__like' => $this->data['term']
73
+ ));
74
+ if ( $terms ){
75
+ $this->results = $terms;
76
+ foreach($terms as $key => $term){
77
+ $this->results[$key]->permalink = get_term_link($term);
78
+ }
79
+ return;
80
+ }
81
+ $this->results = null;
82
+ }
83
+
84
+ }
app/Form/{Handlers/NestToggleHandler.php → Listeners/NestToggle.php} RENAMED
@@ -1,11 +1,14 @@
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
  {
@@ -13,7 +16,6 @@ class NestToggleHandler extends BaseHandler {
13
  $this->updateUserMeta();
14
  }
15
 
16
-
17
  /**
18
  * Make sure this is an array of integers
19
  */
@@ -25,7 +27,6 @@ class NestToggleHandler extends BaseHandler {
25
  }
26
  }
27
 
28
-
29
  /**
30
  * Update the user meta with the array of IDs
31
  */
1
+ <?php
2
+
3
+ namespace NestedPages\Form\Listeners;
4
 
5
  use NestedPages\Entities\User\UserRepository;
6
 
7
  /**
8
  * Syncs User's Visible/Toggled Pages
9
  */
10
+ class NestToggle extends BaseHandler
11
+ {
12
 
13
  public function __construct()
14
  {
16
  $this->updateUserMeta();
17
  }
18
 
 
19
  /**
20
  * Make sure this is an array of integers
21
  */
27
  }
28
  }
29
 
 
30
  /**
31
  * Update the user meta with the array of IDs
32
  */
app/Form/{Handlers/NewChildHandler.php → Listeners/NewChild.php} RENAMED
@@ -1,4 +1,6 @@
1
- <?php namespace NestedPages\Form\Handlers;
 
 
2
 
3
  use NestedPages\Form\Validation\Validation;
4
  use NestedPages\Entities\Post\PostFactory;
@@ -7,7 +9,8 @@ use NestedPages\Entities\Post\PostFactory;
7
  * Handles processing the quick edit form
8
  * @return json response
9
  */
10
- class NewChildHandler extends BaseHandler {
 
11
 
12
  /**
13
  * Post Factory
@@ -19,7 +22,6 @@ class NewChildHandler extends BaseHandler {
19
  */
20
  private $validation;
21
 
22
-
23
  public function __construct()
24
  {
25
  parent::__construct();
@@ -30,7 +32,6 @@ class NewChildHandler extends BaseHandler {
30
  $this->sendResponse();
31
  }
32
 
33
-
34
  /**
35
  * Run Validation
36
  */
@@ -39,7 +40,6 @@ class NewChildHandler extends BaseHandler {
39
  return $this->validation->validateNewPages($this->data);
40
  }
41
 
42
-
43
  /**
44
  * Save the new page(s)
45
  */
@@ -53,7 +53,6 @@ class NewChildHandler extends BaseHandler {
53
  $this->sendErrorResponse();
54
  }
55
 
56
-
57
  /**
58
  * Set the Response
59
  */
@@ -65,5 +64,4 @@ class NewChildHandler extends BaseHandler {
65
  );
66
  }
67
 
68
- }
69
-
1
+ <?php
2
+
3
+ namespace NestedPages\Form\Listeners;
4
 
5
  use NestedPages\Form\Validation\Validation;
6
  use NestedPages\Entities\Post\PostFactory;
9
  * Handles processing the quick edit form
10
  * @return json response
11
  */
12
+ class NewChild extends BaseHandler
13
+ {
14
 
15
  /**
16
  * Post Factory
22
  */
23
  private $validation;
24
 
 
25
  public function __construct()
26
  {
27
  parent::__construct();
32
  $this->sendResponse();
33
  }
34
 
 
35
  /**
36
  * Run Validation
37
  */
40
  return $this->validation->validateNewPages($this->data);
41
  }
42
 
 
43
  /**
44
  * Save the new page(s)
45
  */
53
  $this->sendErrorResponse();
54
  }
55
 
 
56
  /**
57
  * Set the Response
58
  */
64
  );
65
  }
66
 
67
+ }
 
app/Form/Listeners/NewMenuItem.php ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace NestedPages\Form\Listeners;
4
+
5
+ use NestedPages\Helpers;
6
+
7
+ /**
8
+ * Creates new Menu item and saves redirect post
9
+ * @return json response
10
+ */
11
+ class NewMenuItem extends BaseHandler
12
+ {
13
+ public function __construct()
14
+ {
15
+ parent::__construct();
16
+ $this->validateFields();
17
+ $this->saveRedirect();
18
+ $this->syncMenu();
19
+ $this->sendResponse();
20
+ }
21
+
22
+ /**
23
+ * Validate
24
+ */
25
+ private function validateFields()
26
+ {
27
+ if ( $_POST['menuType'] == 'custom' && $_POST['navigationLabel'] == "" ) return wp_send_json(array('status' => 'error', 'message' => __('Custom Links must have a label', 'nestedpages')));
28
+ if ( $_POST['menuType'] == 'custom' && $_POST['url'] == "" ) return wp_send_json(array('status' => 'error', 'message' => __('Please provide a valid URL', 'nestedpages')));
29
+ }
30
+
31
+ /**
32
+ * Save the item as a redirect post type
33
+ */
34
+ private function saveRedirect()
35
+ {
36
+ $new_link = $this->post_update_repo->saveRedirect($this->data);
37
+ if ( !$new_link ) $this->sendErrorResponse();
38
+
39
+ $this->data['post'] = $_POST;
40
+ $this->data['post']['id'] = $new_link;
41
+ $this->data['post']['content'] = esc_url($_POST['url']);
42
+ $this->data['post']['delete_link'] = get_delete_post_link($new_link, '', true);
43
+ $this->addExtras($new_link);
44
+
45
+ $this->response = array(
46
+ 'status' => 'success',
47
+ 'message' => __('Link successfully updated', 'nestedpages'),
48
+ 'post_data' => $this->data['post']
49
+ );
50
+ }
51
+
52
+ /**
53
+ * Add extra post data
54
+ */
55
+ private function addExtras($post)
56
+ {
57
+ $this->data['post']['link_target'] = ( isset($_POST['linkTarget']) && $_POST['linkTarget'] == "_blank" ) ? "_blank" : "";
58
+
59
+ // Add custom menu data
60
+ $type = $this->data['post']['menuType'];
61
+ if ( $type == 'custom' ){
62
+ $this->data['post']['original_link'] = null;
63
+ $this->data['post']['original_title'] = null;
64
+ return;
65
+ }
66
+ if ( $type == 'taxonomy' ){
67
+ $term = get_term_by('id', $this->data['post']['objectId'], $this->data['post']['objectType']);
68
+ $this->data['post']['original_link'] = get_term_link($term);
69
+ $this->data['post']['original_title'] = $term->name;
70
+ return;
71
+ }
72
+ $id = $this->data['post']['objectId'];
73
+ $this->data['post']['original_link'] = get_the_permalink($id);
74
+ $this->data['post']['original_title'] = get_the_title($id);
75
+ }
76
+
77
+ }
app/Form/{Handlers/QuickEditHandler.php → Listeners/QuickEdit.php} RENAMED
@@ -1,11 +1,13 @@
1
- <?php namespace NestedPages\Form\Handlers;
 
 
2
 
3
  /**
4
  * Handles processing the quick edit form
5
  * @return json response
6
  */
7
- class QuickEditHandler extends BaseHandler {
8
-
9
 
10
  public function __construct()
11
  {
@@ -15,7 +17,6 @@ class QuickEditHandler extends BaseHandler {
15
  $this->sendResponse();
16
  }
17
 
18
-
19
  /**
20
  * Update the Post
21
  * @todo update taxonomies
@@ -33,7 +34,6 @@ class QuickEditHandler extends BaseHandler {
33
  );
34
  }
35
 
36
-
37
  /**
38
  * Add Flat Taxonomy IDs
39
  */
@@ -55,7 +55,6 @@ class QuickEditHandler extends BaseHandler {
55
  }
56
  }
57
 
58
-
59
  /**
60
  * Add additional data to the response object
61
  */
1
+ <?php
2
+
3
+ namespace NestedPages\Form\Listeners;
4
 
5
  /**
6
  * Handles processing the quick edit form
7
  * @return json response
8
  */
9
+ class QuickEdit extends BaseHandler
10
+ {
11
 
12
  public function __construct()
13
  {
17
  $this->sendResponse();
18
  }
19
 
 
20
  /**
21
  * Update the Post
22
  * @todo update taxonomies
34
  );
35
  }
36
 
 
37
  /**
38
  * Add Flat Taxonomy IDs
39
  */
55
  }
56
  }
57
 
 
58
  /**
59
  * Add additional data to the response object
60
  */
app/Form/{Handlers/QuickEditLinkHandler.php → Listeners/QuickEditLink.php} RENAMED
@@ -1,10 +1,13 @@
1
- <?php namespace NestedPages\Form\Handlers;
 
 
 
2
  /**
3
  * Handles processing the quick edit form for redirects
4
  * @return json response
5
  */
6
- class QuickEditLinkHandler extends BaseHandler {
7
-
8
 
9
  public function __construct()
10
  {
@@ -14,7 +17,6 @@ class QuickEditLinkHandler extends BaseHandler {
14
  $this->sendResponse();
15
  }
16
 
17
-
18
  /**
19
  * Update the Post
20
  */
@@ -30,7 +32,6 @@ class QuickEditLinkHandler extends BaseHandler {
30
  );
31
  }
32
 
33
-
34
  /**
35
  * Add additional data to the response object
36
  */
@@ -38,7 +39,7 @@ class QuickEditLinkHandler extends BaseHandler {
38
  {
39
  $this->data['nav_status'] = ( isset($this->data['nav_status']) ) ? 'hide' : 'show';
40
  $this->data['np_status'] = ( isset($this->data['nested_pages_status']) ) ? 'hide' : 'show';
41
- $this->data['link_target'] = ( isset($this->data['link_target']) ) ? '_blank' : 'none';
42
  }
43
 
44
  }
1
+ <?php
2
+
3
+ namespace NestedPages\Form\Listeners;
4
+
5
  /**
6
  * Handles processing the quick edit form for redirects
7
  * @return json response
8
  */
9
+ class QuickEditLink extends BaseHandler
10
+ {
11
 
12
  public function __construct()
13
  {
17
  $this->sendResponse();
18
  }
19
 
 
20
  /**
21
  * Update the Post
22
  */
32
  );
33
  }
34
 
 
35
  /**
36
  * Add additional data to the response object
37
  */
39
  {
40
  $this->data['nav_status'] = ( isset($this->data['nav_status']) ) ? 'hide' : 'show';
41
  $this->data['np_status'] = ( isset($this->data['nested_pages_status']) ) ? 'hide' : 'show';
42
+ $this->data['linkTarget'] = ( isset($this->data['linkTarget']) ) ? '_blank' : 'none';
43
  }
44
 
45
  }
app/Form/{Handlers/SearchHandler.php → Listeners/Search.php} RENAMED
@@ -1,6 +1,9 @@
1
- <?php namespace NestedPages\Form\Handlers;
2
 
3
- class SearchHandler extends BaseHandler {
 
 
 
4
 
5
  /**
6
  * URL to redirect to
1
+ <?php
2
 
3
+ namespace NestedPages\Form\Listeners;
4
+
5
+ class Search extends BaseHandler
6
+ {
7
 
8
  /**
9
  * URL to redirect to
app/Form/{Handlers/SortHandler.php → Listeners/Sort.php} RENAMED
@@ -1,12 +1,14 @@
1
- <?php namespace NestedPages\Form\Handlers;
 
 
2
 
3
  /**
4
  * Handles processing sortable pages
5
  * updates menu order & page parents
6
  * @return json response
7
  */
8
- class SortHandler extends BaseHandler {
9
-
10
 
11
  public function __construct()
12
  {
@@ -16,7 +18,6 @@ class SortHandler extends BaseHandler {
16
  $this->sendResponse();
17
  }
18
 
19
-
20
  /**
21
  * Update Post Order
22
  */
@@ -31,5 +32,4 @@ class SortHandler extends BaseHandler {
31
  }
32
  }
33
 
34
-
35
- }
1
+ <?php
2
+
3
+ namespace NestedPages\Form\Listeners;
4
 
5
  /**
6
  * Handles processing sortable pages
7
  * updates menu order & page parents
8
  * @return json response
9
  */
10
+ class Sort extends BaseHandler
11
+ {
12
 
13
  public function __construct()
14
  {
18
  $this->sendResponse();
19
  }
20
 
 
21
  /**
22
  * Update Post Order
23
  */
32
  }
33
  }
34
 
35
+ }
 
app/Form/{Handlers/SyncMenuHandler.php → Listeners/SyncMenu.php} RENAMED
@@ -1,10 +1,13 @@
1
- <?php namespace NestedPages\Form\Handlers;
 
 
2
 
3
  /**
4
  * Turn on/off menu sync
5
  * @return json response
6
  */
7
- class SyncMenuHandler extends BaseHandler {
 
8
 
9
  public function __construct()
10
  {
@@ -13,7 +16,6 @@ class SyncMenuHandler extends BaseHandler {
13
  $this->sendResponse();
14
  }
15
 
16
-
17
  /**
18
  * Update the sync setting
19
  */
1
+ <?php
2
+
3
+ namespace NestedPages\Form\Listeners;
4
 
5
  /**
6
  * Turn on/off menu sync
7
  * @return json response
8
  */
9
+ class SyncMenu extends BaseHandler
10
+ {
11
 
12
  public function __construct()
13
  {
16
  $this->sendResponse();
17
  }
18
 
 
19
  /**
20
  * Update the sync setting
21
  */
app/Form/Validation/Validation.php CHANGED
@@ -1,11 +1,14 @@
1
- <?php namespace NestedPages\Form\Validation;
 
 
2
 
3
  use NestedPages\Config\SettingsRepository;
4
 
5
  /**
6
  * Nested Pages Form Validation
7
  */
8
- class Validation {
 
9
 
10
  /**
11
  * Settings Repository
@@ -17,7 +20,6 @@ class Validation {
17
  $this->settings = new SettingsRepository;
18
  }
19
 
20
-
21
  /**
22
  * Validate Post IDs in an array of posts
23
  */
@@ -31,7 +33,6 @@ class Validation {
31
  }
32
  }
33
 
34
-
35
  /**
36
  * Validate IDs in an array (tax ids)
37
  */
@@ -45,7 +46,6 @@ class Validation {
45
  }
46
  }
47
 
48
-
49
  /**
50
  * Validate Date Input whether default WP or NP Datepicker
51
  */
@@ -55,7 +55,6 @@ class Validation {
55
  return $this->validateWPDate($data);
56
  }
57
 
58
-
59
  /**
60
  * Validate Datepicker date and time
61
  * @since 1.3.1
@@ -74,7 +73,6 @@ class Validation {
74
  return $date;
75
  }
76
 
77
-
78
  /**
79
  * Validate Default WP Date Fields
80
  * @since 1.3.1
@@ -101,7 +99,6 @@ class Validation {
101
 
102
  }
103
 
104
-
105
  /**
106
  * Check valid date
107
  */
@@ -110,7 +107,6 @@ class Validation {
110
  if ( !wp_checkdate(intval($month), intval($day), intval($year), $year . '-' . $month . '-' . $day)) return $this->sendDateError();
111
  }
112
 
113
-
114
  /**
115
  * Check for Valid 24 hour Time
116
  */
@@ -127,7 +123,6 @@ class Validation {
127
  if (!preg_match("/^(1[0-2]|0?[1-9]):[0-5][0-9]/", $time)) return $this->sendDateError();
128
  }
129
 
130
-
131
  /**
132
  * Send Date Error
133
  * @return response
@@ -141,7 +136,6 @@ class Validation {
141
  die();
142
  }
143
 
144
-
145
  /**
146
  * Validate new redirect/link fields
147
  */
@@ -155,7 +149,6 @@ class Validation {
155
  }
156
  }
157
 
158
-
159
  /**
160
  * Validate a string isn't empty
161
  */
@@ -168,7 +161,6 @@ class Validation {
168
  }
169
  }
170
 
171
-
172
  /**
173
  * Validate New Pages
174
  */
@@ -200,5 +192,4 @@ class Validation {
200
  return true;
201
  }
202
 
203
-
204
  }
1
+ <?php
2
+
3
+ namespace NestedPages\Form\Validation;
4
 
5
  use NestedPages\Config\SettingsRepository;
6
 
7
  /**
8
  * Nested Pages Form Validation
9
  */
10
+ class Validation
11
+ {
12
 
13
  /**
14
  * Settings Repository
20
  $this->settings = new SettingsRepository;
21
  }
22
 
 
23
  /**
24
  * Validate Post IDs in an array of posts
25
  */
33
  }
34
  }
35
 
 
36
  /**
37
  * Validate IDs in an array (tax ids)
38
  */
46
  }
47
  }
48
 
 
49
  /**
50
  * Validate Date Input whether default WP or NP Datepicker
51
  */
55
  return $this->validateWPDate($data);
56
  }
57
 
 
58
  /**
59
  * Validate Datepicker date and time
60
  * @since 1.3.1
73
  return $date;
74
  }
75
 
 
76
  /**
77
  * Validate Default WP Date Fields
78
  * @since 1.3.1
99
 
100
  }
101
 
 
102
  /**
103
  * Check valid date
104
  */
107
  if ( !wp_checkdate(intval($month), intval($day), intval($year), $year . '-' . $month . '-' . $day)) return $this->sendDateError();
108
  }
109
 
 
110
  /**
111
  * Check for Valid 24 hour Time
112
  */
123
  if (!preg_match("/^(1[0-2]|0?[1-9]):[0-5][0-9]/", $time)) return $this->sendDateError();
124
  }
125
 
 
126
  /**
127
  * Send Date Error
128
  * @return response
136
  die();
137
  }
138
 
 
139
  /**
140
  * Validate new redirect/link fields
141
  */
149
  }
150
  }
151
 
 
152
  /**
153
  * Validate a string isn't empty
154
  */
161
  }
162
  }
163
 
 
164
  /**
165
  * Validate New Pages
166
  */
192
  return true;
193
  }
194
 
 
195
  }
app/Helpers.php CHANGED
@@ -1,8 +1,12 @@
1
- <?php namespace NestedPages;
 
 
 
2
  /**
3
  * Helper Functions
4
  */
5
- class Helpers {
 
6
 
7
  /**
8
  * Verify URL Format
@@ -14,7 +18,6 @@ class Helpers {
14
  return esc_url($url);
15
  }
16
 
17
-
18
  /**
19
  * Plugin Root Directory
20
  */
@@ -23,7 +26,6 @@ class Helpers {
23
  return plugins_url() . '/wp-simple-locator';
24
  }
25
 
26
-
27
  /**
28
  * View
29
  */
@@ -32,7 +34,6 @@ class Helpers {
32
  return dirname(__FILE__) . '/Views/' . $file . '.php';
33
  }
34
 
35
-
36
  /**
37
  * Link to the default WP Pages listing
38
  * @since 1.2
1
+ <?php
2
+
3
+ namespace NestedPages;
4
+
5
  /**
6
  * Helper Functions
7
  */
8
+ class Helpers
9
+ {
10
 
11
  /**
12
  * Verify URL Format
18
  return esc_url($url);
19
  }
20
 
 
21
  /**
22
  * Plugin Root Directory
23
  */
26
  return plugins_url() . '/wp-simple-locator';
27
  }
28
 
 
29
  /**
30
  * View
31
  */
34
  return dirname(__FILE__) . '/Views/' . $file . '.php';
35
  }
36
 
 
37
  /**
38
  * Link to the default WP Pages listing
39
  * @since 1.2
app/NestedPages.php CHANGED
@@ -3,8 +3,8 @@
3
  * Static Wrapper for Bootstrap Class
4
  * Prevents T_STRING error when checking for 5.3.2
5
  */
6
- class NestedPages {
7
-
8
  public static function init()
9
  {
10
  // dev/live
@@ -12,7 +12,7 @@ class NestedPages {
12
  $np_env = 'live';
13
 
14
  global $np_version;
15
- $np_version = '1.4.1';
16
 
17
  if ( is_admin() ) $app = new NestedPages\Bootstrap;
18
  }
3
  * Static Wrapper for Bootstrap Class
4
  * Prevents T_STRING error when checking for 5.3.2
5
  */
6
+ class NestedPages
7
+ {
8
  public static function init()
9
  {
10
  // dev/live
12
  $np_env = 'live';
13
 
14
  global $np_version;
15
+ $np_version = '1.5.0';
16
 
17
  if ( is_admin() ) $app = new NestedPages\Bootstrap;
18
  }
app/Redirects.php CHANGED
@@ -1,9 +1,12 @@
1
- <?php namespace NestedPages;
 
 
 
2
  /**
3
  * Page Redirects in admin
4
  */
5
- class Redirects {
6
-
7
 
8
  public function __construct()
9
  {
@@ -12,7 +15,6 @@ class Redirects {
12
  add_action('deleted_post', array($this, 'linkDeleted'), 10, 1);
13
  }
14
 
15
-
16
  /**
17
  * Redirect back to nested pages after pages moved to trashed
18
  */
@@ -26,7 +28,6 @@ class Redirects {
26
  }
27
  }
28
 
29
-
30
  /**
31
  * Redirect to nested pages after page moved out of trash
32
  */
@@ -40,7 +41,6 @@ class Redirects {
40
  }
41
  }
42
 
43
-
44
  /**
45
  * Add link trashed param to URL after delete (for notification)
46
  */
@@ -54,7 +54,4 @@ class Redirects {
54
  }
55
  }
56
 
57
-
58
-
59
-
60
  }
1
+ <?php
2
+
3
+ namespace NestedPages;
4
+
5
  /**
6
  * Page Redirects in admin
7
  */
8
+ class Redirects
9
+ {
10
 
11
  public function __construct()
12
  {
15
  add_action('deleted_post', array($this, 'linkDeleted'), 10, 1);
16
  }
17
 
 
18
  /**
19
  * Redirect back to nested pages after pages moved to trashed
20
  */
28
  }
29
  }
30
 
 
31
  /**
32
  * Redirect to nested pages after page moved out of trash
33
  */
41
  }
42
  }
43
 
 
44
  /**
45
  * Add link trashed param to URL after delete (for notification)
46
  */
54
  }
55
  }
56
 
 
 
 
57
  }
app/Views/forms/link-form.php CHANGED
@@ -9,102 +9,107 @@ $can_publish = current_user_can( $post_type_object->cap->publish_posts );
9
  <div class="modal-dialog">
10
  <div class="modal-content">
11
 
12
- <div class="np-tabs">
13
- <ul>
14
- <li><a href="#nplink" class="active"><?php _e('Add Link'); ?></a></li>
15
- <?php /* <li><a href="#npmenuitems"><?php _e('Add Menu Item', 'nestedpages'); ?></a></li> */ ?>
16
- </ul>
17
- </div>
18
-
19
- <div id="nplink" class="np-tabbed-content">
20
-
21
- <div class="modal-body">
22
-
23
- <form method="get" action="" class="np-modal-form np-new-link-form">
24
- <div class="form-interior">
25
-
26
- <div class="np-quickedit-error np-new-link-error" style="clear:both;display:none;"></div>
27
-
28
- <div class="left">
29
-
30
- <div class="form-control">
31
- <label><?php _e( 'Navigation Label' ); ?></label>
32
- <input type="text" name="np_link_title" class="np_link_title" value="" />
33
- </div>
34
-
35
- <div class="form-control">
36
- <label><?php _e( 'URL', 'nestedpages' ); ?></label>
37
- <input type="text" name="np_link_content" class="np_link_content" value="" />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  </div>
 
39
 
40
- <div class="form-control">
41
- <label><?php _e( 'Status' ); ?></label>
42
- <select name="_status" class="np_link_status">
43
- <?php if ( $can_publish ) : ?>
44
- <option value="publish"><?php _e( 'Published' ); ?></option>
45
- <option value="future"><?php _e( 'Scheduled' ); ?></option>
46
- <?php endif; ?>
47
- <option value="pending"><?php _e( 'Pending Review' ); ?></option>
48
- <option value="draft"><?php _e( 'Draft' ); ?></option>
49
- </select>
50
- </div>
51
-
52
- </div><!-- .left -->
53
-
54
- <div class="right">
55
-
56
- <?php if ( $this->user->canSortPages() ) : // Menu Options Button ?>
57
- <label class="checkbox">
58
- <input type="checkbox" name="nav_status" class="np_link_nav_status" value="hide" />
59
- <span class="checkbox-title"><?php _e( 'Hide in Nav Menu', 'nestedpages' ); ?></span>
60
- </label>
61
-
62
- <label class="checkbox">
63
- <input type="checkbox" name="nested_pages_status" class="np_link_status" value="hide" />
64
- <span class="checkbox-title"><?php _e( 'Hide in Nested Pages', 'nestedpages' ); ?></span>
65
- </label>
66
-
67
- <label class="checkbox">
68
- <input type="checkbox" name="link_target" class="new_link_target" value="_blank" />
69
- <span class="checkbox-title"><?php _e( 'Open link in a new window/tab' ); ?></span>
70
- </label>
71
- <?php endif; // Edit theme options ?>
72
-
73
- </div><!-- .right -->
74
-
75
- </div><!-- .form-interior -->
76
- </div>
77
  <div class="modal-footer">
 
 
 
 
78
  <input type="hidden" name="parent_id" class="parent_id" value="">
79
  <button type="button" class="button modal-close" data-dismiss="modal">
80
- <?php _e('Close'); ?>
81
  </button>
82
- <a accesskey="s" class="button-primary np-save-link alignright">
83
- <?php _e( 'Save Link', 'nestedpages' ); ?>
84
- </a>
85
- <span class="np-qe-loading np-link-loading"></span>
86
- </div>
87
- </form>
88
- </div><!-- #nplink -->
89
 
90
- <?php /*
91
- <div id="npmenuitems" class="np-tabbed-content" style="display:none;">
92
- <div class="modal-body">
93
- adf
94
- </div><!-- .modal-body -->
95
- <div class="modal-footer">
96
- <input type="hidden" name="parent_id" class="parent_id" value="">
97
- <button type="button" class="button modal-close" data-dismiss="modal">
98
- <?php _e('Close'); ?>
99
- </button>
100
- <a accesskey="s" class="button-primary np-save-link alignright">
101
- <?php _e( 'Add Item', 'nestedpages' ); ?>
102
  </a>
103
- <span class="np-qe-loading np-link-loading"></span>
 
104
  </div><!-- .modal-footer -->
 
105
  </div><!-- #npmenuitems -->
106
- */ ?>
107
-
108
  </div><!-- /.modal-content -->
109
  </div><!-- /.modal-dialog -->
110
  </div><!-- /.modal -->
9
  <div class="modal-dialog">
10
  <div class="modal-content">
11
 
12
+ <div id="npmenuitems" class="np-tabbed-content" data-np-tab-pane>
13
+ <form data-np-menu-item-form action="">
14
+ <div class="modal-body np-menu-item-form">
15
+ <div class="np-menu-type-selection">
16
+ <ul data-np-menu-accordion>
17
+
18
+ <li><a href="#" class="np-custom-link" data-np-menu-object="custom" data-np-menu-type="custom" data-np-menu-objectid="" data-np-permalink="" data-np-menu-selection><?php _e('Custom Link', 'nestedpages'); ?></a></li>
19
+
20
+ <?php
21
+ // Post Types
22
+ foreach ( $this->listing_repo->postTypes() as $name => $type ) {
23
+ $recent_posts = $this->listing_repo->recentPosts($name);
24
+ if ( !$recent_posts ) continue;
25
+ $out = '<li><a href="#" data-np-menu-accordion-item>' . $type->labels->name . '</a>';
26
+ $out .= '<ul>';
27
+ $out .= '<li class="np-menu-search"><input type="text" data-np-menu-search data-search-type="post_type" data-search-object="' . $name . '" placeholder="' . __('Search', 'nestedpages') . ' ' . $type->labels->name . '" /><div class="np-menu-search-loading"></div><div class="np-menu-search-noresults">' . __('No Results', 'nestedpages') . '</div></li>';
28
+ foreach ( $recent_posts as $post ){
29
+ $out .= '<li data-default-result><a href="#" data-np-menu-object="' . $name . '" data-np-menu-type="post_type" data-np-menu-objectid="' . $post->ID . '" data-np-permalink="' . get_the_permalink($post->ID) . '" data-np-object-name="' . $type->labels->singular_name . '" data-np-menu-selection>' . $post->post_title . '</a></li>';
30
+ }
31
+ $out .= '</ul>';
32
+ $out .= '</li>';
33
+ echo $out;
34
+ }
35
+ ?>
36
+
37
+ <?php
38
+ // Taxonomies
39
+ foreach ( $this->listing_repo->taxonomies() as $name => $taxonomy ) {
40
+ $terms = $this->listing_repo->terms($name);
41
+ if ( !$terms ) continue;
42
+ $out = '<li><a href="#" data-np-menu-accordion-item>' . $taxonomy->labels->name . '</a>';
43
+ $out .= '<ul>';
44
+ $out .= '<li class="np-menu-search"><input type="text" data-np-menu-search data-search-type="taxonomy" data-search-object="' . $name . '" placeholder="' . __('Search', 'nestedpages') . ' ' . $taxonomy->labels->name . '" /><div class="np-menu-search-loading"></div><div class="np-menu-search-noresults">' . __('No Results', 'nestedpages') . '</div></li>';
45
+ foreach ( $terms as $term ){
46
+ $out .= '<li data-default-result><a href="#" data-np-menu-object="' . $name . '" data-np-menu-type="taxonomy" data-np-menu-objectid="' . $term->term_id . '" data-np-permalink="' . get_term_link($term) . '" data-np-object-name="' . $taxonomy->labels->name . '" data-np-menu-selection>' . $term->name . '</a></li>';
47
+ }
48
+ $out .= '</ul>';
49
+ $out .= '</li>';
50
+ echo $out;
51
+ }
52
+ ?>
53
+
54
+ </ul>
55
+ </div><!-- .np-menu-type-selection -->
56
+ <div class="np-menu-link-object">
57
+ <div class="np-menu-link-object-placeholder">
58
+ <?php _e('Select an item', 'nestedpages'); ?>
59
+ </div>
60
+ <div class="np-menu-link-details" style="display:none;">
61
+ <h3><span data-np-menu-title></span> <em></em></h3>
62
+ <div class="original-link">
63
+ <?php _e('Original', 'nestedpages'); ?>: <span data-np-original-link></span>
64
+ </div>
65
+ <div class="np-quickedit-error" data-np-error style="clear:both;display:none;"></div>
66
+ <div class="fields">
67
+ <p data-np-menu-url-cont style="display:none;">
68
+ <label><?php _e('URL', 'nestedpages'); ?></label>
69
+ <input type="text" name="url" data-np-menu-url />
70
+ </p>
71
+ <p>
72
+ <label><?php _e('Navigation Label', 'nestedpages'); ?></label>
73
+ <input type="text" name="navigationLabel" data-np-menu-navigation-label />
74
+ </p>
75
+ <p>
76
+ <label><?php _e('Title Attribute', 'nestedpages'); ?></label>
77
+ <input type="text" name="titleAttribute" data-np-menu-title-attr />
78
+ </p>
79
+ <p>
80
+ <label><?php _e('CSS Classes (optional)', 'nestedpages'); ?></label>
81
+ <input type="text" name="cssClasses" data-np-menu-css-classes />
82
+ </p>
83
+ <?php if ( $this->user->canSortPages() ) : // Menu Options Button ?>
84
+ <label class="checkbox">
85
+ <input type="checkbox" name="linkTarget" class="link_target" data-np-menu-link-target />
86
+ <span class="checkbox-title"><?php _e( 'Open link in a new window/tab' ); ?></span>
87
+ </label>
88
+ <?php endif; ?>
89
+ </div><!-- .fields -->
90
+ </div><!-- .np-menu-link-details -->
91
  </div>
92
+ </div><!-- .modal-body -->
93
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
94
  <div class="modal-footer">
95
+ <input type="hidden" name="menuTitle" data-np-menu-title value="">
96
+ <input type="hidden" name="objectType" data-np-menu-object-input value="">
97
+ <input type="hidden" name="objectId" data-np-menu-objectid-input value="">
98
+ <input type="hidden" name="menuType" data-np-menu-type-input value="">
99
  <input type="hidden" name="parent_id" class="parent_id" value="">
100
  <button type="button" class="button modal-close" data-dismiss="modal">
101
+ <?php _e('Cancel'); ?>
102
  </button>
 
 
 
 
 
 
 
103
 
104
+ <a accesskey="s" class="button-primary" data-np-save-link style="display:none;float:right;">
105
+ <?php _e( 'Add', 'nestedpages' ); ?>
 
 
 
 
 
 
 
 
 
 
106
  </a>
107
+ <span class="np-qe-loading"></span>
108
+
109
  </div><!-- .modal-footer -->
110
+ </form>
111
  </div><!-- #npmenuitems -->
112
+
 
113
  </div><!-- /.modal-content -->
114
  </div><!-- /.modal-dialog -->
115
  </div><!-- /.modal -->
app/Views/forms/quickedit-link.php CHANGED
@@ -18,7 +18,7 @@
18
  <input type="text" name="post_title" class="np_title" value="" />
19
  </div>
20
 
21
- <div class="form-control">
22
  <label><?php _e( 'URL' ); ?></label>
23
  <input type="text" name="post_content" class="np_content" value="" />
24
  </div>
@@ -42,11 +42,11 @@
42
  <?php if ( $this->user->canSortPages() && !$this->isSearch() ) : // Menu Options Button ?>
43
  <div class="form-control">
44
  <label><?php _e( 'Title Attribute' ); ?></label>
45
- <input type="text" name="np_title_attribute" class="np_title_attribute" value="" />
46
  </div>
47
  <div class="form-control">
48
  <label><?php _e( 'CSS Classes' ); ?></label>
49
- <input type="text" name="np_nav_css_classes" class="np_nav_css_classes" value="" />
50
  </div>
51
  <div class="comments">
52
  <label>
@@ -62,7 +62,7 @@
62
  </div>
63
  <div class="comments">
64
  <label>
65
- <input type="checkbox" name="link_target" class="link_target" value="_blank" />
66
  <span class="checkbox-title"><?php _e( 'Open link in a new window/tab' ); ?></span>
67
  </label>
68
  </div>
@@ -75,6 +75,9 @@
75
  </div><!-- .form-interior -->
76
 
77
  <div class="buttons">
 
 
 
78
  <input type="hidden" name="post_id" class="np_id" value="<?php echo get_the_id(); ?>">
79
  <input type="hidden" name="parent_id" class="np_parent_id" value="">
80
  <a accesskey="c" href="#inline-edit" class="button-secondary alignleft np-cancel-quickedit">
18
  <input type="text" name="post_title" class="np_title" value="" />
19
  </div>
20
 
21
+ <div class="form-control" data-url-field>
22
  <label><?php _e( 'URL' ); ?></label>
23
  <input type="text" name="post_content" class="np_content" value="" />
24
  </div>
42
  <?php if ( $this->user->canSortPages() && !$this->isSearch() ) : // Menu Options Button ?>
43
  <div class="form-control">
44
  <label><?php _e( 'Title Attribute' ); ?></label>
45
+ <input type="text" name="titleAttribute" class="np_title_attribute" value="" />
46
  </div>
47
  <div class="form-control">
48
  <label><?php _e( 'CSS Classes' ); ?></label>
49
+ <input type="text" name="cssClasses" class="np_nav_css_classes" value="" />
50
  </div>
51
  <div class="comments">
52
  <label>
62
  </div>
63
  <div class="comments">
64
  <label>
65
+ <input type="checkbox" name="linkTarget" class="link_target" value="_blank" />
66
  <span class="checkbox-title"><?php _e( 'Open link in a new window/tab' ); ?></span>
67
  </label>
68
  </div>
75
  </div><!-- .form-interior -->
76
 
77
  <div class="buttons">
78
+ <input type="hidden" name="objectType" data-np-menu-object-input value="">
79
+ <input type="hidden" name="objectId" data-np-menu-objectid-input value="">
80
+ <input type="hidden" name="menuType" data-np-menu-type-input value="">
81
  <input type="hidden" name="post_id" class="np_id" value="<?php echo get_the_id(); ?>">
82
  <input type="hidden" name="parent_id" class="np_parent_id" value="">
83
  <a accesskey="c" href="#inline-edit" class="button-secondary alignleft np-cancel-quickedit">
app/Views/listing.php CHANGED
@@ -12,7 +12,7 @@
12
  </a>
13
  <?php endif; ?>
14
 
15
- <?php if ( current_user_can('publish_pages') && $this->post_type->name == 'page' && !$this->isSearch() ) : ?>
16
  <a href="#" class="add-new-h2 open-redirect-modal" title="<?php _e('Add Link', 'nestedpages'); ?>" data-parentid="0">
17
  <?php _e('Add Link', 'nestedpages'); ?>
18
  </a>
@@ -29,7 +29,7 @@
29
  <a href="#" class="np-btn nestedpages-toggleall" data-toggle="closed"><?php _e('Expand All', 'nestedpages'); ?></a>
30
  <?php endif; ?>
31
 
32
- <?php if ( $this->user->canSortPages() && $this->post_type->name == 'page' && !$this->isSearch() && !$this->settings->hideMenuSync() ) : ?>
33
  <div class="np-sync-menu-cont" <?php if ( $this->confirmation->getMessage() ) echo 'style="margin-top:2px;"';?>>
34
  <label>
35
  <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'); ?>
12
  </a>
13
  <?php endif; ?>
14
 
15
+ <?php if ( current_user_can('publish_pages') && $this->post_type->name == 'page' && !$this->isSearch() && !$this->settings->menusDisabled() ) : ?>
16
  <a href="#" class="add-new-h2 open-redirect-modal" title="<?php _e('Add Link', 'nestedpages'); ?>" data-parentid="0">
17
  <?php _e('Add Link', 'nestedpages'); ?>
18
  </a>
29
  <a href="#" class="np-btn nestedpages-toggleall" data-toggle="closed"><?php _e('Expand All', 'nestedpages'); ?></a>
30
  <?php endif; ?>
31
 
32
+ <?php if ( $this->user->canSortPages() && $this->post_type->name == 'page' && !$this->isSearch() && !$this->settings->hideMenuSync() && !$this->isFiltered() && !$this->settings->menusDisabled() ) : ?>
33
  <div class="np-sync-menu-cont" <?php if ( $this->confirmation->getMessage() ) echo 'style="margin-top:2px;"';?>>
34
  <label>
35
  <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'); ?>
app/Views/partials/row-link.php CHANGED
@@ -2,6 +2,9 @@
2
  /**
3
  * Redirect Page
4
  */
 
 
 
5
  ?>
6
  <div class="row" <?php if ( $this->isSearch() ) echo 'style="padding-left:10px;"';?>>
7
 
@@ -17,7 +20,7 @@
17
  <i class="handle np-icon-menu"></i>
18
  <?php endif; ?>
19
 
20
- <a href="<?php echo NestedPages\Helpers::check_url($this->post->content); ?>" class="page-link page-title" target="_blank">
21
  <span class="title"><?php echo $this->post->title ?> <i class="np-icon-link"></i></span>
22
  <?php
23
 
@@ -56,6 +59,11 @@
56
  data-navstatus="<?php echo $this->post->nav_status; ?>"
57
  data-navtitleattr="<?php echo $this->post->nav_title_attr; ?>"
58
  data-navcss="<?php echo $this->post->nav_css; ?>"
 
 
 
 
 
59
  data-linktarget="<?php echo $this->post->link_target; ?>">
60
  <?php _e('Quick Edit'); ?>
61
  </a>
2
  /**
3
  * Redirect Page
4
  */
5
+ $link = ( $this->post->nav_type && $this->post->nav_type !== 'custom' )
6
+ ? $this->post->nav_original_link
7
+ : esc_url($this->post->content);
8
  ?>
9
  <div class="row" <?php if ( $this->isSearch() ) echo 'style="padding-left:10px;"';?>>
10
 
20
  <i class="handle np-icon-menu"></i>
21
  <?php endif; ?>
22
 
23
+ <a href="<?php echo $link; ?>" class="page-link page-title" target="_blank">
24
  <span class="title"><?php echo $this->post->title ?> <i class="np-icon-link"></i></span>
25
  <?php
26
 
59
  data-navstatus="<?php echo $this->post->nav_status; ?>"
60
  data-navtitleattr="<?php echo $this->post->nav_title_attr; ?>"
61
  data-navcss="<?php echo $this->post->nav_css; ?>"
62
+ data-nav-type="<?php echo $this->post->nav_type; ?>"
63
+ data-nav-object="<?php echo $this->post->nav_object; ?>"
64
+ data-nav-object-id="<?php echo $this->post->nav_object_id; ?>"
65
+ data-nav-original-link="<?php echo $this->post->nav_original_link; ?>"
66
+ data-nav-original-title="<?php echo $this->post->nav_original_title; ?>"
67
  data-linktarget="<?php echo $this->post->link_target; ?>">
68
  <?php _e('Quick Edit'); ?>
69
  </a>
app/Views/partials/row.php CHANGED
@@ -17,7 +17,13 @@
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_auto_load') ){
@@ -81,7 +87,7 @@
81
  <?php else : $cs = 'closed'; endif; ?>
82
 
83
 
84
- <?php if ( current_user_can('publish_pages') && $this->post_type->hierarchical && !$this->isSearch() ) : ?>
85
 
86
  <a href="#" class="np-btn open-redirect-modal" data-parentid="<?php echo $this->post->id; ?>"><i class="np-icon-link"></i></a>
87
 
17
  <?php endif; ?>
18
 
19
  <a href="<?php echo get_edit_post_link(); ?>" class="page-link page-title">
20
+ <span class="title">
21
+ <?php
22
+ echo $this->post->title;
23
+ if ( $this->post->id == get_option('page_on_front') ) echo ' <em class="np-page-type"><strong>&ndash; ' . __('Front Page', 'nestedpages') . '</strong></em>';
24
+ if ( $this->post->id == get_option('page_for_posts') ) echo ' <em class="np-page-type"><strong>&ndash; ' . __('Posts Page', 'nestedpages') . '</strong></em>';
25
+ ?>
26
+ </span>
27
  <?php
28
 
29
  if ( function_exists('wpseo_auto_load') ){
87
  <?php else : $cs = 'closed'; endif; ?>
88
 
89
 
90
+ <?php if ( current_user_can('publish_pages') && $this->post_type->hierarchical && !$this->isSearch() && !$this->settings->menusDisabled() ) : ?>
91
 
92
  <a href="#" class="np-btn open-redirect-modal" data-parentid="<?php echo $this->post->id; ?>"><i class="np-icon-link"></i></a>
93
 
app/Views/partials/tool-list.php CHANGED
@@ -98,6 +98,34 @@
98
  <?php endif; ?>
99
 
100
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
101
  <div class="np-tools-search">
102
  <form action="<?php echo admin_url('admin-post.php'); ?>" method="post">
103
  <input type="hidden" name="action" value="npSearch">
98
  <?php endif; ?>
99
 
100
 
101
+ <?php if ( $this->post_type->name == 'page' && $this->post_type_repo->categoriesEnabled($this->post_type->name) ) : ?>
102
+ <div class="np-tools-primary">
103
+ <form action="<?php echo admin_url('admin-post.php'); ?>" method="post" class="np-tools-sort">
104
+ <input type="hidden" name="action" value="npCategoryFilter">
105
+ <input type="hidden" name="page" value="<?php echo $this->pageURL(); ?>">
106
+ <div class="select first">
107
+ <select id="np_category" name="np_category" class="nestedpages-sort">
108
+ <?php
109
+ $tax = get_taxonomy('category');
110
+ $out = '<option value="all">' . __('All ', 'nestedpages') . $tax->labels->name . '</option>';
111
+ $terms = get_terms('category');
112
+ foreach( $terms as $term ){
113
+ $out .= '<option value="' . $term->term_id . '"';
114
+ if ( isset($_GET['category']) && ($_GET['category'] == $term->term_id) ) $out .= ' selected';
115
+ $out .= '>' . $term->name . '</option>';
116
+ }
117
+ echo $out;
118
+ ?>
119
+ </select>
120
+ </div>
121
+ <div class="select">
122
+ <input type="submit" id="nestedpages-sort" class="button" value="Apply">
123
+ </div>
124
+ </form>
125
+ </div>
126
+ <?php endif; ?>
127
+
128
+
129
  <div class="np-tools-search">
130
  <form action="<?php echo admin_url('admin-post.php'); ?>" method="post">
131
  <input type="hidden" name="action" value="npSearch">
app/Views/settings/settings-general.php CHANGED
@@ -8,6 +8,7 @@ settings_fields( 'nestedpages-general' );
8
  <th scope="row"><?php _e('Nested Pages Version', 'nestedpages'); ?></th>
9
  <td><strong><?php echo get_option('nestedpages_version'); ?></strong></td>
10
  </tr>
 
11
  <tr valign="top">
12
  <th scope="row"><?php _e('Menu Name', 'nestedpages'); ?></th>
13
  <td>
@@ -15,6 +16,7 @@ settings_fields( 'nestedpages-general' );
15
  <p><em><?php _e('Important: Once the menu name has changed, theme files should be updated to reference the new name.', 'nestedpages'); ?></em></p>
16
  </td>
17
  </tr>
 
18
  <tr valign="top">
19
  <th scope="row"><?php _e('Display Options', 'nestedpages'); ?></th>
20
  <td>
@@ -27,10 +29,20 @@ settings_fields( 'nestedpages-general' );
27
  <tr valign="top">
28
  <th scope="row"><?php _e('Menu Sync', 'nestedpages'); ?></th>
29
  <td>
 
 
30
  <label>
31
  <input type="checkbox" name="nestedpages_ui[hide_menu_sync]" value="true" <?php if ( $this->settings->hideMenuSync() ) echo 'checked'; ?> />
32
  <?php _e('Hide Menu Sync Checkbox', 'nestedpages'); ?> (<?php echo $sync_status; ?>)
33
  </label>
 
 
 
 
 
 
 
 
34
  </td>
35
  </tr>
36
  <tr valign="top">
8
  <th scope="row"><?php _e('Nested Pages Version', 'nestedpages'); ?></th>
9
  <td><strong><?php echo get_option('nestedpages_version'); ?></strong></td>
10
  </tr>
11
+ <?php if ( !$this->settings->menusDisabled() ) : ?>
12
  <tr valign="top">
13
  <th scope="row"><?php _e('Menu Name', 'nestedpages'); ?></th>
14
  <td>
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
+ <?php endif; ?>
20
  <tr valign="top">
21
  <th scope="row"><?php _e('Display Options', 'nestedpages'); ?></th>
22
  <td>
29
  <tr valign="top">
30
  <th scope="row"><?php _e('Menu Sync', 'nestedpages'); ?></th>
31
  <td>
32
+ <?php if ( !$this->settings->menusDisabled() ) : ?>
33
+ <p>
34
  <label>
35
  <input type="checkbox" name="nestedpages_ui[hide_menu_sync]" value="true" <?php if ( $this->settings->hideMenuSync() ) echo 'checked'; ?> />
36
  <?php _e('Hide Menu Sync Checkbox', 'nestedpages'); ?> (<?php echo $sync_status; ?>)
37
  </label>
38
+ </p>
39
+ <?php endif; ?>
40
+ <p>
41
+ <label>
42
+ <input type="checkbox" name="nestedpages_disable_menu" value="true" <?php if ( $this->settings->menusDisabled() ) echo 'checked'; ?> />
43
+ <?php _e('Disable Menu Sync Completely', 'nestedpages'); ?>
44
+ </label>
45
+ </p>
46
  </td>
47
  </tr>
48
  <tr valign="top">
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+QAAEuQAAAAkaG10eCkAA2cAABMIAAAAYGxvY2EhfhzgAAATaAAAADJtYXhwACAA8QAAE5wAAAAgbmFtZXH7qkgAABO8AAAB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AADABYALAABAAAAAAAEABYAcQABAAAAAAAFABYAFgABAAAAAAAGAAsAQgABAAAAAAAKADQAhwADAAEECQABABYAAAADAAEECQACAA4AYwADAAEECQADABYALAADAAEECQAEABYAcQADAAEECQAFABYAFgADAAEECQAGABYATQADAAEECQAKADQAhwBuAGUAcwB0AGUAZABwAGEAZwBlAHMAVgBlAHIAcwBpAG8AbgAgADEALgAwAG4AZQBzAHQAZQBkAHAAYQBnAGUAc25lc3RlZHBhZ2VzAG4AZQBzAHQAZQBkAHAAYQBnAGUAcwBSAGUAZwB1AGwAYQByAG4AZQBzAHQAZQBkAHAAYQBnAGUAcwBGAG8AbgB0ACAAZwBlAG4AZQByAGEAdABlAGQAIABiAHkAIABJAGMAbwBNAG8AbwBuAC4AAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==) 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-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 .modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background-color:#000;opacity:0.85;z-index:9999;}.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;z-index:9999;}.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;}.clone-modal h3{margin:0;padding:8px;background-color:#e5e5e5;}.clone-modal .form-control{margin:0 !important;padding:5px 10px;}.np-trash-modal{text-align:center;}.np-trash-modal .modal-body{padding-bottom:30px;}.np-trash-modal .button-primary{margin-left:10px;}.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-listing-title{float:left;}.nestedpages .updated{clear:both;}.nestedpages-toggleall{float:right;}.np-toggle-publish{color:#999999;}.np-toggle-publish.active{color:#333;font-weight:bold;}.np-sync-menu-cont{float:right;margin:5px 15px 0px 0px;}#nested-loading{display:none;float:right;width:30px;margin:0px 20px 0 0;}.nestedpages-top-toggles{zoom:1;padding-top:10px;}.nestedpages-top-toggles:before,.nestedpages-top-toggles:after{content:" ";display:table;}.nestedpages-top-toggles:after{clear:both;}.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-datepicker.ui-datepicker{background-color:#ffffff;font-size:90%;-webkit-box-shadow:0px 0px 3px 0px rgba(0, 0, 0, 0.4);box-shadow:0px 0px 3px 0px rgba(0, 0, 0, 0.4);-webkit-border-radius:3px;border-radius:3px;padding:0;width:auto;}.nestedpages-datepicker.ui-datepicker .ui-datepicker-next,.nestedpages-datepicker.ui-datepicker .ui-datepicker-prev{position:absolute;color:#ffffff;top:0px;right:0px;cursor:pointer;display:block;width:35px;height:35px;font-size:0;background:url('../images/datepicker-arrow-next.png');background-position:center;opacity:1;-webkit-transition:opacity 200ms ease;-o-transition:opacity 200ms ease;transition:opacity 200ms ease;}.nestedpages-datepicker.ui-datepicker .ui-datepicker-next:hover,.nestedpages-datepicker.ui-datepicker .ui-datepicker-prev:hover{opacity:0.5;-webkit-transition:opacity 200ms ease;-o-transition:opacity 200ms ease;transition:opacity 200ms ease;}.nestedpages-datepicker.ui-datepicker .ui-datepicker-calendar{margin:0;}.nestedpages-datepicker.ui-datepicker .ui-datepicker-prev{right:auto;left:0px;background:url('../images/datepicker-arrow-prev.png');}.nestedpages-datepicker.ui-datepicker .ui-datepicker-header{padding:0;}.nestedpages-datepicker.ui-datepicker .ui-datepicker-title{background-color:#1a1a1a;text-align:center;color:#ffffff;height:35px;line-height:35px;-webkit-border-radius:3px 3px 0 0;border-radius:3px 3px 0 0;margin:0;}.nestedpages-datepicker.ui-datepicker .ui-datepicker-calendar{border-collapse:collapse;}.nestedpages-datepicker.ui-datepicker .ui-datepicker-calendar table{width:auto;}.nestedpages-datepicker.ui-datepicker .ui-datepicker-calendar th,.nestedpages-datepicker.ui-datepicker .ui-datepicker-calendar td{text-align:center;width:30px;height:30px;}.nestedpages-datepicker.ui-datepicker .ui-datepicker-calendar th{background-color:#e6e6e6;text-transform:uppercase;font-size:11px;letter-spacing:1px;padding:0;}.nestedpages-datepicker.ui-datepicker .ui-datepicker-calendar td{border-top:1px solid #ebebeb;border-left:1px solid #ebebeb;padding:0;}.nestedpages-datepicker.ui-datepicker .ui-datepicker-calendar td:first-child{border-left:0;}.nestedpages-datepicker.ui-datepicker .ui-datepicker-calendar a{text-align:center;padding:0;text-decoration:none;color:#333;display:block;background-color:#ffffff;-webkit-transition:all 200ms ease;-o-transition:all 200ms ease;transition:all 200ms ease;width:30px;height:30px;line-height:30px;}.nestedpages-datepicker.ui-datepicker .ui-datepicker-calendar a.ui-state-active{background-color:#1a1a1a;color:#ffffff;}.nestedpages-datepicker.ui-datepicker .ui-datepicker-calendar a:hover{background-color:#333;color:#ffffff;-webkit-transition:all 200ms ease;-o-transition:all 200ms ease;transition:all 200ms ease;}.nestedpages-tools{zoom:1;clear:both;clear:both;margin:20px 0px 5px 0px;}.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:50%;border-radius:50%;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 .np-seo-indicator.noindex{background-color:#1e8cbe;}.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:0px 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;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;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;padding-bottom:10px;}.nestedpages .row-inner{padding-top:10px;}.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 .form-control.np-datepicker-container .datetime,.nestedpages .new-child .form-control.np-datepicker-container .datetime{float:right;width:75%;}.nestedpages .quick-edit .form-control.np-datepicker-container .np-time-container,.nestedpages .new-child .form-control.np-datepicker-container .np-time-container{float:left;width:45%;margin:0;position:relative;}.nestedpages .quick-edit .form-control.np-datepicker-container .np-time-container input[type="text"],.nestedpages .new-child .form-control.np-datepicker-container .np-time-container input[type="text"]{float:left;width:55%;}.nestedpages .quick-edit .form-control.np-datepicker-container .np-time-container select,.nestedpages .new-child .form-control.np-datepicker-container .np-time-container select{float:right;width:35%;}.nestedpages .quick-edit .form-control.np-datepicker-container .np_datepicker,.nestedpages .new-child .form-control.np-datepicker-container .np_datepicker{float:left;width:45%;margin:0;}.nestedpages .quick-edit .form-control.np-datepicker-container span,.nestedpages .new-child .form-control.np-datepicker-container span{float:left;width:10%;display:block;text-align:center;padding-top:3px;}.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 .form-control.np-datepicker-container .datetime{float:none;width:100%;}.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;}
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+5jPGTW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AdABlAGQAcABhAGcAZQBzbmVzdGVkcGFnZXMAbgBlAHMAdABlAGQAcABhAGcAZQBzAFIAZQBnAHUAbABhAHIAbgBlAHMAdABlAGQAcABhAGcAZQBzAEYAbwBuAHQAIABnAGUAbgBlAHIAYQB0AGUAZAAgAGIAeQAgAEkAYwBvAE0AbwBvAG4ALgAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA) format('truetype'),url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAABWUAAsAAAAAFUgAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABPUy8yAAABCAAAAGAAAABgCCMHaGNtYXAAAAFoAAAAVAAAAFTw7eamZ2FzcAAAAbwAAAAIAAAACAAAABBnbHlmAAABxAAAETQAABE0siotqmhlYWQAABL4AAAANgAAADYCOg/3aGhlYQAAEzAAAAAkAAAAJAPiAflobXR4AAATVAAAAGAAAABgKQADZ2xvY2EAABO0AAAAMgAAADIhfhzgbWF4cAAAE+gAAAAgAAAAIAAgAPFuYW1lAAAUCAAAAWkAAAFpcfuqSHBvc3QAABV0AAAAIAAAACAAAwAAAAMCAAGQAAUAAAFMAWYAAABHAUwBZgAAAPUAGQCEAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAQAAA8LIB4P/g/+AB4AAgAAAAAQAAAAAAAAAAAAAAIAAAAAAAAgAAAAMAAAAUAAMAAQAAABQABABAAAAADAAIAAIABAABACDmEvCy//3//wAAAAAAIOYA8LL//f//AAH/4xoED2UAAwABAAAAAAAAAAAAAAAAAAEAAf//AA8AAQAAAAAAAAAAAAIAADc5AQAAAAABAAAAAAAAAAAAAgAANzkBAAAAAAEAAAAAAAAAAAACAAA3OQEAAAAAAQAzAEYBzQF6AAkAADczNRcHNSE1MxVm54CA/uYzxk1mZ03ntAAAAAEAbQBNAZMBdAALAAAlBycHJzcnNxc3FwcBjjhYXTRdWDhYXTRdgTRdWDhYXTVdVzhYAAABAJoAfAGTAVMABgAAAR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GMAbwBNAG8AbwBuAC4AAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==) 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-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 .modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background-color:#000;opacity:0.85;z-index:9999;}.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:90%;height:80%;margin:10px auto 0px auto;max-width:800px;z-index:9999;}.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;}.clone-modal h3{margin:0;padding:8px;background-color:#e5e5e5;}.clone-modal .form-control{margin:0 !important;padding:5px 10px;}.np-trash-modal{text-align:center;}.np-trash-modal .modal-body{padding-bottom:30px;}.np-trash-modal .button-primary{margin-left:10px;}.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-listing-title{float:left;}.nestedpages .updated{clear:both;}.nestedpages-toggleall{float:right;}.np-toggle-publish{color:#999999;}.np-toggle-publish.active{color:#333;font-weight:bold;}.np-sync-menu-cont{float:right;margin:5px 15px 0px 0px;}#nested-loading{display:none;float:right;width:30px;margin:0px 20px 0 0;}.nestedpages-top-toggles{zoom:1;padding-top:10px;}.nestedpages-top-toggles:before,.nestedpages-top-toggles:after{content:" ";display:table;}.nestedpages-top-toggles:after{clear:both;}.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;}.np-tabs ul li a:focus,.np-tabs ul li a:active{outline:none;-webkit-box-shadow:none;box-shadow:none;}.nestedpages-datepicker.ui-datepicker{background-color:#ffffff;font-size:90%;-webkit-box-shadow:0px 0px 3px 0px rgba(0, 0, 0, 0.4);box-shadow:0px 0px 3px 0px rgba(0, 0, 0, 0.4);-webkit-border-radius:3px;border-radius:3px;padding:0;width:auto;}.nestedpages-datepicker.ui-datepicker .ui-datepicker-next,.nestedpages-datepicker.ui-datepicker .ui-datepicker-prev{position:absolute;color:#ffffff;top:0px;right:0px;cursor:pointer;display:block;width:35px;height:35px;font-size:0;background:url('../images/datepicker-arrow-next.png');background-position:center;opacity:1;-webkit-transition:opacity 200ms ease;-o-transition:opacity 200ms ease;transition:opacity 200ms ease;}.nestedpages-datepicker.ui-datepicker .ui-datepicker-next:hover,.nestedpages-datepicker.ui-datepicker .ui-datepicker-prev:hover{opacity:0.5;-webkit-transition:opacity 200ms ease;-o-transition:opacity 200ms ease;transition:opacity 200ms ease;}.nestedpages-datepicker.ui-datepicker .ui-datepicker-calendar{margin:0;}.nestedpages-datepicker.ui-datepicker .ui-datepicker-prev{right:auto;left:0px;background:url('../images/datepicker-arrow-prev.png');}.nestedpages-datepicker.ui-datepicker .ui-datepicker-header{padding:0;}.nestedpages-datepicker.ui-datepicker .ui-datepicker-title{background-color:#1a1a1a;text-align:center;color:#ffffff;height:35px;line-height:35px;-webkit-border-radius:3px 3px 0 0;border-radius:3px 3px 0 0;margin:0;}.nestedpages-datepicker.ui-datepicker .ui-datepicker-calendar{border-collapse:collapse;}.nestedpages-datepicker.ui-datepicker .ui-datepicker-calendar table{width:auto;}.nestedpages-datepicker.ui-datepicker .ui-datepicker-calendar th,.nestedpages-datepicker.ui-datepicker .ui-datepicker-calendar td{text-align:center;width:30px;height:30px;}.nestedpages-datepicker.ui-datepicker .ui-datepicker-calendar th{background-color:#e6e6e6;text-transform:uppercase;font-size:11px;letter-spacing:1px;padding:0;}.nestedpages-datepicker.ui-datepicker .ui-datepicker-calendar td{border-top:1px solid #ebebeb;border-left:1px solid #ebebeb;padding:0;}.nestedpages-datepicker.ui-datepicker .ui-datepicker-calendar td:first-child{border-left:0;}.nestedpages-datepicker.ui-datepicker .ui-datepicker-calendar a{text-align:center;padding:0;text-decoration:none;color:#333;display:block;background-color:#ffffff;-webkit-transition:all 200ms ease;-o-transition:all 200ms ease;transition:all 200ms ease;width:30px;height:30px;line-height:30px;}.nestedpages-datepicker.ui-datepicker .ui-datepicker-calendar a.ui-state-active{background-color:#1a1a1a;color:#ffffff;}.nestedpages-datepicker.ui-datepicker .ui-datepicker-calendar a:hover{background-color:#333;color:#ffffff;-webkit-transition:all 200ms ease;-o-transition:all 200ms ease;transition:all 200ms ease;}.nestedpages-tools{zoom:1;clear:both;clear:both;margin:20px 0px 5px 0px;}.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 .np-page-type{color:#333;}.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:50%;border-radius:50%;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 .np-seo-indicator.noindex{background-color:#1e8cbe;}.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:0px 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;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;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;padding-bottom:10px;}.nestedpages .row-inner{padding-top:10px;}.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.original-link,.nestedpages .new-child .form-control.original-link{background-color:#f9f9f9;border:1px solid #e1e1e1;padding:5px;font-style:oblique;margin-bottom:8px;}.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 .form-control.np-datepicker-container .datetime,.nestedpages .new-child .form-control.np-datepicker-container .datetime{float:right;width:75%;}.nestedpages .quick-edit .form-control.np-datepicker-container .np-time-container,.nestedpages .new-child .form-control.np-datepicker-container .np-time-container{float:left;width:45%;margin:0;position:relative;}.nestedpages .quick-edit .form-control.np-datepicker-container .np-time-container input[type="text"],.nestedpages .new-child .form-control.np-datepicker-container .np-time-container input[type="text"]{float:left;width:55%;}.nestedpages .quick-edit .form-control.np-datepicker-container .np-time-container select,.nestedpages .new-child .form-control.np-datepicker-container .np-time-container select{float:right;width:35%;}.nestedpages .quick-edit .form-control.np-datepicker-container .np_datepicker,.nestedpages .new-child .form-control.np-datepicker-container .np_datepicker{float:left;width:45%;margin:0;}.nestedpages .quick-edit .form-control.np-datepicker-container span,.nestedpages .new-child .form-control.np-datepicker-container span{float:left;width:10%;display:block;text-align:center;padding-top:3px;}.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 .form-control.np-datepicker-container .datetime{float:none;width:100%;}.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;}.modal-body.np-menu-item-form{height:400px;padding:0;border-top:1px solid #e1e1e1;}.np-menu-type-selection{float:left;height:100%;overflow:auto;width:35%;padding:15px;background-color:#f9f9f9;border-right:1px solid #e1e1e1;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;}.np-menu-type-selection ul{list-style-type:none;margin:0;padding: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;border:0;}.np-menu-type-selection ul li{margin:0;border:1px solid #e5e5e5;border-top:0;}.np-menu-type-selection ul li a{background-color:#ffffff;display:block;text-decoration:none;padding:15px 10px;position:relative;color:#333333;font-weight:bold;-webkit-transition:all 200ms ease;-o-transition:all 200ms ease;transition:all 200ms ease;}.np-menu-type-selection ul li a:hover{background-color:#ebebeb;-webkit-transition:all 200ms ease;-o-transition:all 200ms ease;transition:all 200ms ease;}.np-menu-type-selection ul li a:after{position:absolute;font-family:"dashicons";content:"\f140";font-size:18px;right:10px;top:15px;color:#808080;}.np-menu-type-selection ul li a.active:after{content:"\f142";}.np-menu-type-selection ul li a.np-custom-link:after{content:"\f139";}.np-menu-type-selection ul li a.np-custom-link.active{background-color:#0074a2;color:#ffffff;}.np-menu-type-selection ul li a.np-custom-link.active:after{content:"\f335";color:#ffffff;}.np-menu-type-selection ul li a:active,.np-menu-type-selection ul li a:focus{-webkit-box-shadow:none;box-shadow:none;}.np-menu-type-selection ul li a.no-terms{color:#b3b3b3;}.np-menu-type-selection ul li a.no-terms span{float:right;font-weight:normal;font-style:oblique;}.np-menu-type-selection ul li a.no-terms:after{content:'';}.np-menu-type-selection ul li a.no-terms:hover{background-color:#ffffff;cursor:default;}.np-menu-type-selection ul li a.no-terms.section{padding:8px 10px;background-color:#333;color:#ffffff;}.np-menu-type-selection ul li:first-child{border-top:1px solid #e5e5e5;}.np-menu-type-selection ul li ul{display:none;-webkit-box-shadow:none;box-shadow:none;padding:10px;background-color:#ffffff;}.np-menu-type-selection ul li ul li{border-color:#e0e0e0;}.np-menu-type-selection ul li ul li a{padding:8px;background-color:#f9f9f9;font-weight:normal;}.np-menu-type-selection ul li ul li a:after{content:"\f139";top:8px;right:5px;}.np-menu-type-selection ul li ul li a.active{background-color:#0074a2;color:#ffffff;}.np-menu-type-selection ul li ul li a.active:after{content:"\f335";color:#ffffff;}.np-menu-link-object{width:65%;float:right;height:100%;overflow:auto;}.np-menu-link-object-placeholder{text-align:center;position:relative;top:50%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);-o-transform:translateY(-50%);transform:translateY(-50%);color:#b3b3b3;}.np-menu-search{padding:10px;background-color:#f9f9f9;}.np-menu-search input[type="text"]{width:100%;height:35px;}.np-menu-search .np-menu-search-loading{display:none;height:30px;background:url('../images/spinner.gif') no-repeat;background-position:center;}.np-menu-search .np-menu-search-noresults{display:none;text-align:center;padding-top:8px;font-style:oblique;}.np-menu-link-details{padding:20px;}.np-menu-link-details h3{margin-top:0;}.np-menu-link-details h3 em{float:right;font-size:13px;font-weight:normal;font-style:normal;color:#808080;}.np-menu-link-details .original-link{border:1px solid #e5e5e5;font-size:12px;margin-bottom:15px;padding:5px;font-style:oblique;}.np-menu-link-details .fields{background-color:#f9f9f9;padding:15px;}.np-menu-link-details p{margin-top:0;}.np-menu-link-details .checkbox{margin-bottom:10px;}.np-menu-link-details label{display:block;}.np-menu-link-details input[type="text"]{width:100%;}.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-factory.js CHANGED
@@ -78,6 +78,11 @@ NestedPages.selectors = {
78
  cloneQuantity : '[data-clone-quantity]', // Quantity to Clone
79
  cloneStatus : '[data-clone-status]', // Clone Status
80
  cloneAuthor : '[data-clone-author]', // Clone Author
 
 
 
 
 
81
  }
82
 
83
 
@@ -94,6 +99,7 @@ NestedPages.jsData = {
94
  ajaxurl : ajaxurl,
95
  nonce : nestedpages.np_nonce,
96
  allPostTypes : nestedpages.post_types, // Localized data with all post types
 
97
  posttype : '', // current Screen's post type
98
  nestable : true, // boolean - whether post type is nestable
99
  hierarchical : true, // boolean - whether post type is hierarchical
@@ -112,12 +118,13 @@ NestedPages.formActions = {
112
  syncToggles : 'npnestToggle',
113
  syncNesting : 'npsort',
114
  syncMenu : 'npsyncMenu',
115
- newLink : 'npnewLink',
116
  newPage : 'npnewChild',
117
  quickEditLink : 'npquickEditLink',
118
  getTaxonomies : 'npgetTaxonomies',
119
  quickEditPost : 'npquickEdit',
120
- clonePost : 'npclonePost'
 
 
121
  }
122
 
123
 
@@ -135,16 +142,18 @@ NestedPages.Factory = function()
135
  plugin.pageToggle = new NestedPages.PageToggle;
136
  plugin.nesting = new NestedPages.Nesting;
137
  plugin.syncMenuSetting = new NestedPages.SyncMenuSetting;
138
- plugin.newLink = new NestedPages.NewLink;
139
  plugin.newPage = new NestedPages.NewPage;
140
  plugin.quickEditLink = new NestedPages.QuickEditLink;
141
  plugin.quickEditPost = new NestedPages.QuickEditPost;
142
  plugin.clone = new NestedPages.Clone;
 
 
143
 
144
  plugin.init = function()
145
  {
146
  plugin.bindEvents();
147
  plugin.setPostType();
 
148
  plugin.setNestable();
149
  plugin.formatter.updateSubMenuToggle();
150
  plugin.formatter.setBorders();
@@ -183,5 +192,12 @@ NestedPages.Factory = function()
183
  }
184
 
185
 
 
 
 
 
 
 
 
186
  return plugin.init();
187
  }
78
  cloneQuantity : '[data-clone-quantity]', // Quantity to Clone
79
  cloneStatus : '[data-clone-status]', // Clone Status
80
  cloneAuthor : '[data-clone-author]', // Clone Author
81
+
82
+ // Tabs
83
+ tabButtonParent : '[data-np-tabs]', // Tab Parent
84
+ tabButton : '[data-np-tab]', // Tab Link
85
+ tabContent : '[data-np-tab-pane]', // Tab Pane
86
  }
87
 
88
 
99
  ajaxurl : ajaxurl,
100
  nonce : nestedpages.np_nonce,
101
  allPostTypes : nestedpages.post_types, // Localized data with all post types
102
+ syncmenu : 'nosync', // Whether to sync the menu
103
  posttype : '', // current Screen's post type
104
  nestable : true, // boolean - whether post type is nestable
105
  hierarchical : true, // boolean - whether post type is hierarchical
118
  syncToggles : 'npnestToggle',
119
  syncNesting : 'npsort',
120
  syncMenu : 'npsyncMenu',
 
121
  newPage : 'npnewChild',
122
  quickEditLink : 'npquickEditLink',
123
  getTaxonomies : 'npgetTaxonomies',
124
  quickEditPost : 'npquickEdit',
125
+ clonePost : 'npclonePost',
126
+ search : 'npmenuSearch',
127
+ newMenuItem : 'npnewMenuItem'
128
  }
129
 
130
 
142
  plugin.pageToggle = new NestedPages.PageToggle;
143
  plugin.nesting = new NestedPages.Nesting;
144
  plugin.syncMenuSetting = new NestedPages.SyncMenuSetting;
 
145
  plugin.newPage = new NestedPages.NewPage;
146
  plugin.quickEditLink = new NestedPages.QuickEditLink;
147
  plugin.quickEditPost = new NestedPages.QuickEditPost;
148
  plugin.clone = new NestedPages.Clone;
149
+ plugin.tabs = new NestedPages.Tabs;
150
+ plugin.menuLinks = new NestedPages.MenuLinks;
151
 
152
  plugin.init = function()
153
  {
154
  plugin.bindEvents();
155
  plugin.setPostType();
156
+ plugin.setMenuSync();
157
  plugin.setNestable();
158
  plugin.formatter.updateSubMenuToggle();
159
  plugin.formatter.setBorders();
192
  }
193
 
194
 
195
+ // Set menu sync
196
+ plugin.setMenuSync = function()
197
+ {
198
+ NestedPages.jsData.syncmenu = ( nestedpages.syncmenu === '1' ) ? 'sync' : 'nosync';
199
+ }
200
+
201
+
202
  return plugin.init();
203
  }
assets/js/lib/nestedpages-old.js DELETED
@@ -1,1563 +0,0 @@
1
- /**
2
- * Scripts Required by Nested Pages Plugin
3
- * @author Kyle Phillips
4
- */
5
- jQuery(function($){
6
-
7
- /**
8
- * ------------------------------------------------------------------------
9
- * Sortable and Toggline
10
- * ------------------------------------------------------------------------
11
- **/
12
-
13
-
14
- /**
15
- * Add the Submenu Toggles (using JS to prevent additional DB Queries)
16
- */
17
- $(document).ready(function(){
18
- add_remove_submenu_toggles();
19
- np_set_borders();
20
- set_nested_margins();
21
- np_make_nestable();
22
- });
23
-
24
- /**
25
- * Toggle the Submenus
26
- */
27
- $(document).on('click', '.child-toggle a', function(e){
28
- e.preventDefault();
29
- var submenu = $(this).parent('.child-toggle').parent('.row').siblings('ol');
30
- $(this).find('i').toggleClass('np-icon-arrow-down').toggleClass('np-icon-arrow-right');
31
- $(submenu).toggle();
32
- np_set_borders();
33
- np_sync_user_toggles();
34
- set_nested_margins();
35
- });
36
-
37
- /**
38
- * Toggle all pages (Expand All)
39
- */
40
- $(document).on('click', '.nestedpages-toggleall', function(e){
41
- e.preventDefault();
42
- if ( $(this).attr('data-toggle') == 'closed' )
43
- {
44
- $('.nestedpages ol li ol').show();
45
- $(this).attr('data-toggle', 'opened');
46
- $(this).text(nestedpages.collapse_text);
47
- $('.child-toggle i').removeClass('np-icon-arrow-right').addClass('np-icon-arrow-down');
48
- revert_quick_edit();
49
- np_set_borders();
50
- } else
51
- {
52
- $('.nestedpages ol li ol').hide();
53
- $(this).attr('data-toggle', 'closed');
54
- $(this).text(nestedpages.expand_text);
55
- $('.child-toggle i').removeClass('np-icon-arrow-down').addClass('np-icon-arrow-right');
56
- revert_quick_edit();
57
- np_set_borders();
58
- }
59
- np_sync_user_toggles();
60
- });
61
-
62
- /**
63
- * Toggle hidden pages
64
- */
65
- $(document).on('click', '.np-toggle-hidden', function(e){
66
- e.preventDefault();
67
- var action = $(this).attr('href');
68
- if ( action === 'show' ){
69
- $(this).attr('href', 'hide');
70
- $(this).text(nestedpages.show_hidden);
71
- $('.np-hide').removeClass('shown').hide();
72
- np_set_borders();
73
- } else {
74
- $(this).attr('href', 'show');
75
- $(this).text(nestedpages.hide_hidden);
76
- $('.np-hide').addClass('shown').show();
77
- np_set_borders();
78
- }
79
- });
80
-
81
- /**
82
- * Tabs
83
- */
84
- $('.np-tabs a').on('click', function(e){
85
- e.preventDefault();
86
- $('.np-tabs a').removeClass('active');
87
- $(this).addClass('active');
88
-
89
- var target = $(this).attr('href');
90
- $('.np-tabbed-content').hide();
91
- $(target).show();
92
- });
93
-
94
- /**
95
- * Fix :visible :first css limitation when toggling various options
96
- */
97
- function np_set_borders()
98
- {
99
- var lists = $('.nplist');
100
- $('.page-row').removeClass('no-border');
101
- $.each(lists, function(){
102
- $(this).find('.page-row:visible:first').addClass('no-border');
103
- });
104
- }
105
-
106
- /**
107
- * Adjust nested margins
108
- * @since 1.1.10
109
- */
110
- function set_nested_margins()
111
- {
112
- var lists = $('.nestedpages').find('.nplist');
113
- $.each(lists, function(i, v){
114
-
115
- var parent_count = $(this).parents('.nplist').length;
116
- var padding = 56;
117
- if ( parent_count > 0 ){
118
- var padding = ( parent_count * 20 ) + padding;
119
- $(this).find('.row-inner').css('padding-left', padding + 'px');
120
- } else {
121
- $(this).find('.row-inner').css('padding-left', '0px');
122
- }
123
-
124
- });
125
- }
126
-
127
- /**
128
- * Get Post Type from List ID
129
- */
130
- function np_get_post_type()
131
- {
132
- var sortableID = $('.sortable').attr('id');
133
- return sortableID.substring(3);
134
- }
135
-
136
- /**
137
- * Is the Post Type Hierarchical
138
- */
139
- function np_is_hierarchical()
140
- {
141
- var post_type = np_get_post_type();
142
- return ( max_levels(post_type) === 0 ) ? true : false;
143
- }
144
-
145
- /**
146
- * Toggle between showing published pages and all
147
- */
148
- $(document).on('click', '.np-toggle-publish', function(e){
149
- e.preventDefault();
150
- var target = $(this).attr('href');
151
- $('.np-toggle-publish').removeClass('active');
152
- $(this).addClass('active');
153
- if ( target == '#published' ){
154
- $('.nplist .page-row').hide();
155
- $('.nplist .published').show();
156
- } else {
157
- $('.nplist .page-row').show();
158
- }
159
- });
160
-
161
-
162
- /**
163
- * Toggle Responsive Action Buttons (Quick edit, add child, etc)
164
- */
165
- $(document).on('click', '.np-toggle-edit', function(e){
166
- e.preventDefault();
167
- var buttons = $(this).siblings('.action-buttons');
168
- if ( $(buttons).is(':visible') ){
169
- $(this).removeClass('active');
170
- $(buttons).hide();
171
- } else {
172
- $(this).addClass('active');
173
- $(buttons).show();
174
- }
175
- });
176
- /**
177
- * Remove display block on action buttons when sizing up
178
- */
179
- var actiondelay = (function(){
180
- var timer = 0;
181
- return function(callback, ms){
182
- clearTimeout (timer);
183
- timer = setTimeout(callback, ms);
184
- };
185
- })();
186
- $(window).resize(function() {
187
- actiondelay(function(){
188
- $('.action-buttons').removeAttr('style');
189
- $('.np-toggle-edit').removeClass('active');
190
- }, 500);
191
- });
192
-
193
-
194
- /**
195
- * Make the Menu sortable
196
- */
197
- function np_make_nestable()
198
- {
199
- $('.sortable').not('.no-sort').nestedSortable({
200
- items : '.page-row',
201
- toleranceElement: '> .row',
202
- handle: '.handle',
203
- placeholder: "ui-sortable-placeholder",
204
- maxLevels: max_levels(np_get_post_type()),
205
- start: function(e, ui){
206
- ui.placeholder.height(ui.item.height());
207
- },
208
- sort: function(e, ui){
209
- update_placeholder_width(ui);
210
- },
211
- stop: function(e, ui){
212
- setTimeout(
213
- function(){
214
- add_remove_submenu_toggles();
215
- np_set_borders();
216
- set_nested_margins();
217
- }, 100
218
- );
219
- submit_sortable_form();
220
- },
221
- });
222
- }
223
-
224
- /**
225
- * Disable Nesting
226
- */
227
- function np_disable_nesting()
228
- {
229
- $('.sortable').sortable('destroy');
230
- }
231
-
232
- /**
233
- * Is Post Type Nestable?
234
- */
235
- function max_levels(post_type)
236
- {
237
- var levels = 1;
238
- $.each(nestedpages.post_types, function(i, v){
239
- if ( v.name === post_type ){
240
- if ( v.hierarchical === true ) levels = 0;
241
- if ( v.disable_nesting === true ) levels = 1;
242
- }
243
- });
244
- return levels;
245
- }
246
-
247
- /**
248
- * Update the width of the placeholder
249
- */
250
- function update_placeholder_width(ui)
251
- {
252
- if ( max_levels(np_get_post_type()) === 0 ){
253
- var parentCount = $(ui.placeholder).parents('ol').length;
254
- var listWidth = $('.sortable').width();
255
- var offset = ( parentCount * 40 ) - 40;
256
- var newWidth = listWidth - offset;
257
- $(ui.placeholder).width(newWidth).css('margin-left', offset + 'px');
258
- }
259
- update_list_visibility(ui);
260
- }
261
-
262
- /**
263
- * Make new list items visible
264
- */
265
- function update_list_visibility(ui)
266
- {
267
- var parentList = $(ui.placeholder).parent('ol');
268
- if ( !$(parentList).is(':visible') ){
269
- $(parentList).addClass('nplist');
270
- $(parentList).show();
271
- }
272
- }
273
-
274
-
275
- /**
276
- * Add or Remove the submenu toggle after the list has changed
277
- */
278
- function add_remove_submenu_toggles()
279
- {
280
- $('.child-toggle').each(function(i, v){
281
- var row = $(this).parent('.row').parent('li');
282
-
283
- if ( $(row).children('ol').length > 0 ){
284
- var icon = ( $(row).children('ol:visible').length > 0 ) ? 'np-icon-arrow-down' : 'np-icon-arrow-right';
285
- $(this).html('<a href="#"><i class="' + icon + '"></i></a>');
286
- } else {
287
- $(this).empty();
288
- }
289
- });
290
- }
291
-
292
-
293
- /**
294
- * Submit Sortable Form
295
- * @todo add error div, pass message to it and show on error
296
- */
297
- function submit_sortable_form()
298
- {
299
- $('#np-error').hide();
300
- $('#nested-loading').show();
301
- var syncmenu = ( $('.np-sync-menu').is(':checked') ) ? 'sync' : 'nosync';
302
-
303
- list = $('ol.sortable').nestedSortable('toHierarchy', {startDepthCount: 0});
304
- np_disable_nesting();
305
-
306
- $.ajax({
307
- url: ajaxurl,
308
- type: 'post',
309
- datatype: 'json',
310
- data: {
311
- action : 'npsort',
312
- nonce : nestedpages.np_nonce,
313
- list : list,
314
- post_type : np_get_post_type(),
315
- syncmenu : syncmenu
316
- },
317
- success: function(data){
318
- np_make_nestable();
319
- if (data.status === 'error'){
320
- $('#np-error').text(data.message).show();
321
- $('#nested-loading').hide();
322
- } else {
323
- $('#nested-loading').hide();
324
- }
325
- }
326
- });
327
- }
328
-
329
-
330
-
331
-
332
-
333
- /**
334
- * ------------------------------------------------------------------------
335
- * Sync Menu
336
- * ------------------------------------------------------------------------
337
- **/
338
-
339
- /**
340
- * Sync menu to catch any trash updates
341
- */
342
- $(document).ready(function(){
343
- if ( nestedpages.syncmenu === '1' ) np_updated_sync_menu('sync');
344
- });
345
-
346
- /**
347
- * Sync Menu Checkbox Toggle
348
- */
349
- $('.np-sync-menu').on('change', function(){
350
- var setting = ( $(this).is(':checked') ) ? 'sync' : 'nosync';
351
- np_updated_sync_menu(setting);
352
- });
353
-
354
- function np_updated_sync_menu(setting)
355
- {
356
- $.ajax({
357
- url: ajaxurl,
358
- type: 'post',
359
- datatype: 'json',
360
- data: {
361
- action : 'npsyncMenu',
362
- nonce : nestedpages.np_nonce,
363
- post_type : np_get_post_type(),
364
- syncmenu : setting
365
- },
366
- success: function(data){
367
- if (data.status === 'error'){
368
- alert('There was an error saving the sync setting.')
369
- }
370
- }
371
- });
372
- }
373
-
374
-
375
-
376
-
377
-
378
-
379
- /**
380
- * ------------------------------------------------------------------------
381
- * Quick Edit - Posts
382
- * ------------------------------------------------------------------------
383
- **/
384
-
385
- // Show the form
386
- $(document).on('click', '.np-quick-edit', function(e){
387
- e.preventDefault();
388
- revert_quick_edit();
389
- set_quick_edit_data($(this));
390
- });
391
-
392
- // Hide the form when clicking modal overlay
393
- $(document).on('click', '.np-inline-overlay', function(e){
394
- revert_quick_edit();
395
- revert_new_child();
396
- });
397
-
398
- // Cancel the form
399
- $(document).on('click', '.np-cancel-quickedit', function(e){
400
- var row = $(this).parents('.page-row');
401
- revert_quick_edit(row);
402
- e.preventDefault();
403
- });
404
-
405
- // Submit the form
406
- $(document).on('click', '.np-save-quickedit', function(e){
407
- e.preventDefault();
408
- $('.row').removeClass('np-updated').removeClass('np-updated-show');
409
- var form = $(this).parents('form');
410
- $(this).attr('disabled', 'disabled');
411
- $(form).find('.np-qe-loading').show();
412
- submit_np_quickedit(form);
413
- });
414
-
415
- // Toggle the Taxonomies
416
- $(document).on('click', '.np-toggle-taxonomies', function(e){
417
- $(this).parents('form').find('.np-taxonomies').toggle();
418
- e.preventDefault();
419
- });
420
-
421
- // Toggle the Menu Options
422
- $(document).on('click', '.np-toggle-menuoptions', function(e){
423
- e.preventDefault();
424
- $(this).parents('form').find('.np-menuoptions').toggle();
425
- });
426
-
427
- // Toggle password/private
428
- $(document).on('change', '.keep_private', function(){
429
- if ( this.checked ){
430
- $('.post_password').val('').prop('readonly', true);
431
- } else {
432
- $('.post_password').prop('readonly', false);
433
- }
434
- });
435
-
436
-
437
- /**
438
- * Set Quick Edit data
439
- */
440
- function set_quick_edit_data(item)
441
- {
442
- var data = {
443
- id : $(item).attr('data-id'),
444
- title : $(item).attr('data-title'),
445
- slug : $(item).attr('data-slug'),
446
- author : $(item).attr('data-author'),
447
- cs : $(item).attr('data-commentstatus'),
448
- status : $(item).attr('data-status'),
449
- template : $(item).attr('data-template'),
450
- month : $(item).attr('data-month'),
451
- day : $(item).attr('data-day'),
452
- year : $(item).attr('data-year'),
453
- hour : $(item).attr('data-hour'),
454
- minute : $(item).attr('data-minute'),
455
- navstatus : $(item).attr('data-navstatus'),
456
- npstatus : $(item).attr('data-np-status'),
457
- navtitle : $(item).attr('data-navtitle'),
458
- navtitleattr : $(item).attr('data-navtitleattr'),
459
- navcss : $(item).attr('data-navcss'),
460
- linktarget : $(item).attr('data-linktarget'),
461
- password : $(item).attr('data-password'),
462
- datepicker : $(item).attr('data-datepicker'),
463
- time: $(item).attr('data-formattedtime'),
464
- ampm: $(item).attr('data-ampm')
465
- };
466
- var parent_li = $(item).closest('.row').parent('li');
467
-
468
- // Add Array of Taxonomies to the data object
469
- data.h_taxonomies = [];
470
- data.f_taxonomies = [];
471
-
472
- var classes = $(parent_li).attr('class').split(/\s+/);
473
- for ( i = 0; i < classes.length; i++ ){
474
- if ( classes[i].substring(0, 3) === 'in-'){
475
- data.h_taxonomies.push(classes[i]);
476
- }
477
- if ( classes[i].substring(0, 4) === 'inf-' ){
478
- data.f_taxonomies.push(classes[i]);
479
- }
480
- }
481
-
482
- // Append the form to the list item
483
- if ( $(parent_li).children('ol').length > 0 ){
484
- var child_ol = $(parent_li).children('ol');
485
- var newform = $('.quick-edit-form').clone().insertBefore(child_ol);
486
- } else {
487
- var newform = $('.quick-edit-form').clone().appendTo(parent_li);
488
- }
489
-
490
- var row = $(newform).siblings('.row').hide();
491
- populate_quick_edit(newform, data);
492
- }
493
-
494
-
495
- /**
496
- * Populate the Quick Edit Form and show it
497
- */
498
- function populate_quick_edit(form, data)
499
- {
500
- $(form).find('.page_id').html('<em>ID:</em> ' + data.id);
501
- $(form).find('.np_id').val(data.id);
502
- $(form).find('.np_title').val(data.title);
503
- $(form).find('.np_slug').val(data.slug);
504
- $(form).find('.np_author select').val(data.author);
505
- $(form).find('.np_status').val(data.status);
506
- $(form).find('.np_nav_title').val(data.navtitle);
507
- $(form).find('.np_title_attribute').val(data.navtitleattr);
508
- $(form).find('.np_nav_css_classes').val(data.navcss);
509
- $(form).find('.post_password').val(data.password);
510
- $(form).find('.np_datepicker').val(data.datepicker);
511
- $(form).find('.np_time').val(data.time);
512
- $(form).find('.np_ampm').val(data.ampm);
513
- if ( data.cs === 'open' ) $(form).find('.np_cs').prop('checked', 'checked');
514
-
515
- if ( data.template !== '' ){
516
- $(form).find('.np_template').val(data.template);
517
- } else {
518
- $(form).find('.np_template').val('default');
519
- }
520
-
521
- if ( data.status === 'private' ){
522
- $(form).find('.post_password').prop('readonly', true);
523
- $(form).find('.keep_private').prop('checked', true);
524
- }
525
-
526
- if ( data.npstatus === 'hide' ){
527
- $(form).find('.np_status').prop('checked', 'checked');
528
- } else {
529
- $(form).find('.np_status').removeAttr('checked');
530
- }
531
-
532
- if ( data.navstatus === 'hide' ) {
533
- $(form).find('.np_nav_status').prop('checked', 'checked');
534
- } else {
535
- $(form).find('.np_nav_status').removeAttr('checked');
536
- }
537
-
538
- if ( data.linktarget === "_blank" ) {
539
- $(form).find('.link_target').prop('checked', 'checked');
540
- } else {
541
- $(form).find('.link_target').removeAttr('checked');
542
- }
543
-
544
- if ( data.status === "private" ) {
545
- $(form).find('.np_status').val('publish');
546
- }
547
-
548
- // Date Fields
549
- $(form).find('select[name="mm"]').val(data.month);
550
- $(form).find('input[name="jj"]').val(data.day);
551
- $(form).find('input[name="aa"]').val(data.year);
552
- $(form).find('input[name="hh"]').val(data.hour);
553
- $(form).find('input[name="mn"]').val(data.minute);
554
-
555
- // Populate Hierarchical Taxonomy Checkboxes
556
- if ( data.hasOwnProperty('h_taxonomies') ){
557
- var taxonomies = data.h_taxonomies;
558
- for ( i = 0; i < taxonomies.length; i++ ){
559
- var tax = '#' + taxonomies[i];
560
- $(form).find(tax).prop('checked', 'checked');
561
- }
562
- }
563
-
564
- show_quick_edit_overlay();
565
-
566
- $(form).show();
567
- $(form).find('.np_datepicker').datepicker({
568
- beforeShow: function(input, inst) {
569
- $('#ui-datepicker-div').addClass('nestedpages-datepicker');
570
- }
571
- });
572
-
573
-
574
- // Populate Flat Taxonomies (makes ajax request, so do this after showing form)
575
- if ( data.hasOwnProperty('f_taxonomies') ){
576
- create_taxonomy_object(data.f_taxonomies);
577
- set_wp_suggest(form);
578
- }
579
- }
580
-
581
-
582
- /**
583
- * Create object of flat taxonomies out of class names
584
- */
585
- function create_taxonomy_object(taxonomies)
586
- {
587
- var out = "";
588
- var terms = {};
589
- for ( i = 0; i < taxonomies.length; i++ ){
590
- // Get the term
591
- var tax_array = taxonomies[i].split('-'); // split the string into an array
592
- var splitter = tax_array.indexOf('nps'); // find the index of the name splitter
593
- var term = tax_array.splice(splitter + 1); // Splice off the name
594
- term = term.join('-'); // Join the name back into a string
595
-
596
- // Get the taxonomy
597
- var tax = taxonomies[i].split('-').splice(0, splitter);
598
- tax.shift('inf');
599
- var taxonomy = tax.join('-');
600
-
601
- // Add taxonomy array to object
602
- if ( !(taxonomy in terms) ){
603
- terms[taxonomy] = [];
604
- }
605
- // push term to taxonomy array
606
- var term_array = terms[taxonomy];
607
- term_array.push(term);
608
- }
609
- get_taxonomy_names(terms);
610
- }
611
-
612
-
613
-
614
- /**
615
- * Get Taxonomy Names
616
- * @param array of term slugs
617
- */
618
- function get_taxonomy_names(taxonomies)
619
- {
620
- $.ajax({
621
- url: ajaxurl,
622
- type: 'post',
623
- datatype: 'json',
624
- data : {
625
- action : 'npgetTaxonomies',
626
- nonce : nestedpages.np_nonce,
627
- terms : taxonomies
628
- },
629
- success: function(data){
630
- populate_flat_taxonomies(data.terms);
631
- }
632
- });
633
- }
634
-
635
- /**
636
- * Populate flat taxonomy textareas
637
- * @param object
638
- */
639
- function populate_flat_taxonomies(terms)
640
- {
641
- if ( terms ){
642
- $.each(terms, function(i, v){
643
- var textarea = $('#' + i);
644
- $(textarea).val(v.join(','));
645
- });
646
- }
647
- }
648
-
649
-
650
- /**
651
- * Set WP Taxonomy Suggest (Flat taxonomies)
652
- */
653
- function set_wp_suggest(form)
654
- {
655
- var tagfields = $(form).find('[data-autotag]');
656
- $.each(tagfields, function(i, v){
657
- var taxonomy = $(this).attr('data-taxonomy');
658
- $(this).suggest(ajaxurl + '?action=ajax-tag-search&tax=' + taxonomy , {multiple:true, multipleSep: ","});
659
- });
660
- }
661
-
662
-
663
- /**
664
- * Remove the quick edit form and restore the row
665
- */
666
- function revert_quick_edit()
667
- {
668
- $('.np-quickedit-error').hide();
669
- remove_quick_edit_overlay();
670
- $('.sortable .quick-edit').remove();
671
- $('.row').show();
672
- }
673
-
674
- /**
675
- * Show the Quick edit overlay
676
- */
677
- function show_quick_edit_overlay()
678
- {
679
- $('body').append('<div class="np-inline-overlay"></div>');
680
- setTimeout(function(){
681
- $('.np-inline-overlay').addClass('active');
682
- }, 50);
683
- }
684
-
685
- /**
686
- * Remove the Quick edit overlay
687
- */
688
- function remove_quick_edit_overlay()
689
- {
690
- $('.np-inline-overlay').removeClass('active').remove();
691
- }
692
-
693
-
694
- /**
695
- * Submit the Quick Edit Form
696
- */
697
- function submit_np_quickedit(form)
698
- {
699
- $('.np-quickedit-error').hide();
700
- var syncmenu = ( $('.np-sync-menu').is(':checked') ) ? 'sync' : 'nosync';
701
-
702
- $.ajax({
703
- url: ajaxurl,
704
- type: 'post',
705
- datatype: 'json',
706
- data: $(form).serialize() + '&action=npquickEdit&nonce=' + nestedpages.np_nonce + '&syncmenu=' + syncmenu + '&post_type=' + np_get_post_type(),
707
- success: function(data){
708
- if (data.status === 'error'){
709
- np_remove_qe_loading(form);
710
- $(form).find('.np-quickedit-error').text(data.message).show();
711
- } else {
712
- np_remove_qe_loading(form);
713
- np_update_qe_data(form, data.post_data);
714
- np_qe_update_animate(form);
715
- }
716
- },
717
- error: function(data){
718
- console.log(data);
719
- }
720
- });
721
- }
722
-
723
-
724
- /**
725
- * Update Row Data after Quick Edit
726
- */
727
- function np_update_qe_data(form, data)
728
- {
729
- var row = $(form).parent('.quick-edit').siblings('.row');
730
- $(row).find('.title').text(data.post_title);
731
-
732
- var status = $(row).find('.status');
733
- if ( (data._status !== 'publish') && (data._status !== 'future') ){
734
- $(status).text('(' + data._status + ')');
735
- } else if (data.keep_private === 'private') {
736
- $(status).text('(' + data.keep_private + ')');
737
- } else {
738
- $(status).text('');
739
- }
740
-
741
- // Password Lock Icon
742
- if ( data.post_password !== "" ){
743
- var statustext = $(status).text();
744
- statustext += ' <i class="np-icon-lock"></i>';
745
- $(status).html(statustext);
746
- }
747
-
748
- // Hide / Show in Nav
749
- var nav_status = $(row).find('.nav-status');
750
- if ( (data.nav_status == 'hide') ){
751
- $(nav_status).text('(Hidden)');
752
- } else {
753
- $(nav_status).text('');
754
- }
755
-
756
- // Hide / Show in Nested Pages
757
- var li = $(row).parent('li');
758
- if ( (data.np_status == 'hide') ){
759
- $(li).addClass('np-hide');
760
- $(row).find('.status').after('<i class="np-icon-eye-blocked"></i>');
761
- } else {
762
- $(li).removeClass('np-hide');
763
- $(row).find('.np-icon-eye-blocked').remove();
764
- }
765
-
766
- // Author for Non-Hierarchical Types
767
- if ( !np_is_hierarchical() ){
768
- $(row).find('.np-author-display').text(data.author_name);
769
- }
770
-
771
- var button = $(row).find('.np-quick-edit');
772
-
773
- $(button).attr('data-id', data.post_id);
774
- $(button).attr('data-template', data.page_template);
775
- $(button).attr('data-title', data.post_title);
776
- $(button).attr('data-slug', data.post_name);
777
- $(button).attr('data-commentstatus', data.comment_status);
778
- $(button).attr('data-status', data._status);
779
-
780
- // Private Status
781
- if ( data.keep_private === 'private' ) {
782
- $(button).attr('data-status', 'private');
783
- }
784
-
785
- $(button).attr('data-author', data.post_author);
786
- $(button).attr('data-np-status', data.np_status);
787
- $(button).attr('data-password', data.post_password);
788
-
789
- $(button).attr('data-navstatus', data.nav_status);
790
- $(button).attr('data-navtitle', data.np_nav_title);
791
- $(button).attr('data-linktarget', data.link_target);
792
- $(button).attr('data-navtitleattr', data.np_title_attribute);
793
- $(button).attr('data-navcss', data.np_nav_css_classes);
794
-
795
- $(button).attr('data-month', data.mm);
796
- $(button).attr('data-day', data.jj);
797
- $(button).attr('data-year', data.aa);
798
- $(button).attr('data-hour', data.hh);
799
- $(button).attr('data-minute', data.mn);
800
- $(button).attr('data-datepicker', data.np_date);
801
- $(button).attr('data-time', data.np_time);
802
- $(button).attr('data-formattedtime', data.np_time);
803
- $(button).attr('data-ampm', data.np_ampm);
804
-
805
- np_remove_taxonomy_classes(li);
806
- np_add_category_classes(li, data);
807
- np_add_h_taxonomy_classes(li, data);
808
- np_add_f_taxonomy_classes(li, data);
809
-
810
- }
811
-
812
-
813
- /**
814
- * Remove taxonomy classes from the row
815
- */
816
- function np_remove_taxonomy_classes(row)
817
- {
818
- taxonomies = [];
819
- var classes = $(row).attr('class').split(/\s+/);
820
- for ( i = 0; i < classes.length; i++ ){
821
- if ( classes[i].substring(0, 3) === 'in-'){
822
- $(row).removeClass(classes[i]);
823
- }
824
- if ( classes[i].substring(0, 4) === 'inf-'){
825
- $(row).removeClass(classes[i]);
826
- }
827
- }
828
- }
829
-
830
-
831
- /**
832
- * Add category classes to the row
833
- */
834
- function np_add_category_classes(row, data)
835
- {
836
- if ( data.hasOwnProperty('post_category') ){
837
- var cats = data.post_category;
838
- for ( i = 0; i < cats.length; i++ ){
839
- var taxclass = 'in-category-' + cats[i];
840
- $(row).addClass(taxclass);
841
- }
842
- }
843
- }
844
-
845
-
846
- /**
847
- * Add Hierarchical Taxonomy Classes to the row
848
- */
849
- function np_add_h_taxonomy_classes(row, data)
850
- {
851
- if ( data.hasOwnProperty('tax_input') )
852
- {
853
- var taxonomies = data.tax_input;
854
- $.each(taxonomies, function(tax, terms){
855
- for (i = 0; i < terms.length; i++){
856
- var taxclass = 'in-' + tax + '-' + terms[i];
857
- $(row).addClass(taxclass);
858
- }
859
- });
860
-
861
- }
862
- }
863
-
864
-
865
- /**
866
- * Add Flat Taxonomy Classes to the row
867
- */
868
- function np_add_f_taxonomy_classes(row, data)
869
- {
870
- if ( data.hasOwnProperty('flat_tax') )
871
- {
872
- var taxonomies = data.flat_tax;
873
- $.each(taxonomies, function(tax, terms){
874
- for (i = 0; i < terms.length; i++){
875
- var taxclass = 'inf-' + tax + '-nps-' + terms[i];
876
- $(row).addClass(taxclass);
877
- }
878
- });
879
-
880
- }
881
- }
882
-
883
-
884
- /**
885
- * Remove loading state from Quick Edit form
886
- */
887
- function np_remove_qe_loading(form)
888
- {
889
- $(form).find('.np-save-quickedit, .np-save-quickedit-redirect, .np-save-newchild').removeAttr('disabled');
890
- $(form).find('.np-qe-loading').hide();
891
- }
892
-
893
- /**
894
- * Show quick edit update animation
895
- */
896
- function np_qe_update_animate(form)
897
- {
898
- var row = $(form).parent('.quick-edit, .new-child').siblings('.row');
899
- $(row).addClass('np-updated');
900
- $(row).show();
901
- $(form).parent('.quick-edit, .new-child').remove();
902
- remove_quick_edit_overlay();
903
- np_set_borders();
904
- setTimeout(function(){
905
- $(row).addClass('np-updated-show');
906
- }, 1500);
907
- }
908
-
909
-
910
-
911
-
912
-
913
- /**
914
- * ------------------------------------------------------------------------
915
- * Quick Edit - Redirect
916
- * ------------------------------------------------------------------------
917
- **/
918
- $(document).on('click', '.np-quick-edit-redirect', function(e){
919
- e.preventDefault();
920
- revert_quick_edit();
921
- set_redirect_quick_edit_data($(this));
922
- });
923
-
924
- // Submit the form
925
- $(document).on('click', '.np-save-quickedit-redirect', function(e){
926
- e.preventDefault();
927
- $('.row').removeClass('np-updated').removeClass('np-updated-show');
928
- var form = $(this).parents('form');
929
- $(this).attr('disabled', 'disabled');
930
- $(form).find('.np-qe-loading').show();
931
- submit_np_quickedit_redirect(form);
932
- });
933
-
934
- /**
935
- * Set the Redirect Quick edit data & create form
936
- */
937
- function set_redirect_quick_edit_data(item)
938
- {
939
- var data = {
940
- id : $(item).attr('data-id'),
941
- url : $(item).attr('data-url'),
942
- title : $(item).attr('data-title'),
943
- status : $(item).attr('data-status'),
944
- navstatus : $(item).attr('data-navstatus'),
945
- npstatus : $(item).attr('data-np-status'),
946
- linktarget : $(item).attr('data-linktarget'),
947
- parentid : $(item).attr('data-parentid'),
948
- navtitleattr : $(item).attr('data-navtitleattr'),
949
- navcss : $(item).attr('data-navcss')
950
- };
951
- var parent_li = $(item).closest('.row').parent('li');
952
-
953
- // Append the form to the list item
954
- if ( $(parent_li).children('ol').length > 0 ){
955
- var child_ol = $(parent_li).children('ol');
956
- var newform = $('.quick-edit-form-redirect').clone().insertBefore(child_ol);
957
- } else {
958
- var newform = $('.quick-edit-form-redirect').clone().appendTo(parent_li);
959
- }
960
-
961
- var row = $(newform).siblings('.row').hide();
962
- $(newform).show();
963
-
964
- populate_redirect_quick_edit(newform, data);
965
- }
966
-
967
- /**
968
- * Populate the Quick Edit Form
969
- */
970
- function populate_redirect_quick_edit(form, data)
971
- {
972
- $(form).find('.np_id').val(data.id);
973
- $(form).find('.np_title').val(data.title);
974
- $(form).find('.np_author select').val(data.author);
975
- $(form).find('.np_status').val(data.status);
976
- $(form).find('.np_content').val(data.url);
977
- $(form).find('.np_parent_id').val(data.parentid);
978
- $(form).find('.np_title_attribute').val(data.navtitleattr);
979
- $(form).find('.np_nav_css_classes').val(data.navcss);
980
-
981
- if ( data.npstatus === 'hide' ){
982
- $(form).find('.np_status').prop('checked', 'checked');
983
- } else {
984
- $(form).find('.np_status').removeAttr('checked');
985
- }
986
-
987
- if ( data.navstatus === 'hide' ) {
988
- $(form).find('.np_nav_status').prop('checked', 'checked');
989
- } else {
990
- $(form).find('.np_nav_status').removeAttr('checked');
991
- }
992
-
993
- if ( data.linktarget === "_blank" ) {
994
- $(form).find('.link_target').prop('checked', 'checked');
995
- } else {
996
- $(form).find('.link_target').removeAttr('checked');
997
- }
998
-
999
- show_quick_edit_overlay();
1000
-
1001
- $(form).show();
1002
- }
1003
-
1004
-
1005
- /**
1006
- * Submit the Quick Edit Form for Redirects
1007
- */
1008
- function submit_np_quickedit_redirect(form)
1009
- {
1010
- $('.np-quickedit-error').hide();
1011
- var syncmenu = ( $('.np-sync-menu').is(':checked') ) ? 'sync' : 'nosync';
1012
- $.ajax({
1013
- url: ajaxurl,
1014
- type: 'post',
1015
- datatype: 'json',
1016
- data: $(form).serialize() + '&action=npquickEditLink&nonce=' + nestedpages.np_nonce + '&syncmenu=' + syncmenu + '&post_type=' + np_get_post_type(),
1017
- success: function(data){
1018
- console.log(data);
1019
- if (data.status === 'error'){
1020
- np_remove_qe_loading(form);
1021
- $(form).find('.np-quickedit-error').text(data.message).show();
1022
- } else {
1023
- np_remove_qe_loading(form);
1024
- np_update_qe_redirect_data(form, data.post_data);
1025
- np_qe_update_animate(form);
1026
- }
1027
- },
1028
- error: function(){
1029
- np_remove_qe_loading(form);
1030
- $(form).find('.np-quickedit-error').text('The form could not be saved at this time.').show();
1031
- }
1032
- });
1033
- }
1034
-
1035
-
1036
- /**
1037
- * Update Row Data after Quick Edit (Redirect)
1038
- */
1039
- function np_update_qe_redirect_data(form, data)
1040
- {
1041
- var row = $(form).parent('.quick-edit').siblings('.row');
1042
- $(row).find('.title').html(data.post_title + ' <i class="np-icon-link"></i>');
1043
-
1044
- var status = $(row).find('.status');
1045
- if ( (data._status !== 'publish') && (data._status !== 'future') ){
1046
- $(status).text('(' + data._status + ')');
1047
- } else {
1048
- $(status).text('');
1049
- }
1050
-
1051
- // Hide / Show in Nav
1052
- var nav_status = $(row).find('.nav-status');
1053
- if ( (data.nav_status == 'hide') ){
1054
- $(nav_status).text('(Hidden)');
1055
- } else {
1056
- $(nav_status).text('');
1057
- }
1058
-
1059
- // Hide / Show in Nested Pages
1060
- var li = $(row).parent('li');
1061
- if ( (data.np_status == 'hide') ){
1062
- $(li).addClass('np-hide');
1063
- $(row).find('.status').after('<i class="np-icon-eye-blocked"></i>');
1064
- } else {
1065
- $(li).removeClass('np-hide');
1066
- $(row).find('.np-icon-eye-blocked').remove();
1067
- }
1068
-
1069
- var button = $(row).find('.np-quick-edit-redirect');
1070
-
1071
- $(button).attr('data-id', data.post_id);
1072
- $(button).attr('data-title', data.post_title);
1073
- $(button).attr('data-url', data.post_content);
1074
- $(button).attr('data-status', data._status);
1075
- $(button).attr('data-navstatus', data.nav_status);
1076
- $(button).attr('data-np-status', data.np_status);
1077
- $(button).attr('data-linktarget', data.link_target);
1078
- $(button).attr('data-navtitleattr', data.np_title_attribute);
1079
- $(button).attr('data-navcss', data.np_nav_css_classes);
1080
- }
1081
-
1082
-
1083
-
1084
-
1085
-
1086
- /**
1087
- * ------------------------------------------------------------------------
1088
- * Add new Redirect link (modal)
1089
- * ------------------------------------------------------------------------
1090
- **/
1091
- $(document).on('click', '.open-redirect-modal', function(e){
1092
- e.preventDefault();
1093
- var parent_id = $(this).attr('data-parentid');
1094
- $('#np-link-modal').find('input').val('');
1095
- $('#np-link-modal .parent_id').val(parent_id);
1096
- if (parent_id === '0'){
1097
- $('#np-add-link-title').text(nestedpages.add_link);
1098
- } else {
1099
- $('#np-add-link-title').text(nestedpages.add_child_link);
1100
- }
1101
- $('#np-link-modal').modal('show');
1102
- });
1103
-
1104
- $(document).on('click', '.np-save-link', function(e){
1105
- e.preventDefault();
1106
- $('.np-new-link-error').hide();
1107
- $('.np-link-loading').show();
1108
- $(this).attr('disabled', 'disabled');
1109
- np_save_new_link();
1110
- });
1111
-
1112
- /**
1113
- * Remove loading state from link form
1114
- */
1115
- function np_remove_link_loading()
1116
- {
1117
- $('.np-link-loading').hide();
1118
- $('.np-save-link').removeAttr('disabled');
1119
- }
1120
-
1121
- /**
1122
- * Set new link data
1123
- */
1124
- function np_save_new_link()
1125
- {
1126
- $('.np-new-link-error').hide();
1127
- var data = $('.np-new-link-form').serialize();
1128
- var syncmenu = ( $('.np-sync-menu').is(':checked') ) ? 'sync' : 'nosync';
1129
-
1130
- $.ajax({
1131
- url: ajaxurl,
1132
- type: 'post',
1133
- datatype: 'json',
1134
- data: data + '&action=npnewLink&nonce=' + nestedpages.np_nonce + '&syncmenu=' + syncmenu + '&post_type=' + np_get_post_type(),
1135
- success: function(data){
1136
- if (data.status === 'error'){
1137
- np_remove_link_loading();
1138
- $('.np-new-link-error').text(data.message).show();
1139
- } else {
1140
- np_remove_link_loading();
1141
- np_create_redirect_row(data.post_data);
1142
- }
1143
- }
1144
- });
1145
- }
1146
-
1147
- /**
1148
- * Create the new row and append where needed
1149
- */
1150
- function np_create_redirect_row(data)
1151
- {
1152
- var html = '<li id="menuItem_' + data.id + '" class="page-row';
1153
- if ( data._status === 'publish' ){
1154
- html += ' published';
1155
- }
1156
- html += '">'
1157
-
1158
- html += '<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="' + data.np_link_content + '" class="page-link page-title" target="_blank"><span class="title">' + data.np_link_title + ' <i class="np-icon-link"></i></span>';
1159
-
1160
- // Post Status
1161
- if ( data._status !== 'publish' ){
1162
- html += '<span class="status">' + data._status + '</span>';
1163
- } else {
1164
- html += '<span class="status"></span>';
1165
- }
1166
-
1167
- // Nested Pages Status
1168
- if ( data.np_status === "hide" ){
1169
- html += '<i class="np-icon-eye-blocked"></i>';
1170
- }
1171
-
1172
- // Nav Menu Status
1173
- if ( data.nav_status === "hide" ){
1174
- html += '<span class="nav-status">(Hidden)</span>';
1175
- } else {
1176
- html += '<span class="nav-status"></span>';
1177
- }
1178
-
1179
- // Quick Edit Button
1180
- html += '</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" ';
1181
- html += 'data-id="' + data.id + '"';
1182
- html += 'data-parentid="' + data.parent_id + '"';
1183
- html += 'data-title="' + data.np_link_title + '" ';
1184
- html += 'data-url="' + data.np_link_content + '" ';
1185
- html += 'data-status="' + data._status + '" ';
1186
- html += 'data-np-status="' + data.np_status + '" ';
1187
- html += 'data-navstatus="' + data.nav_status + '" ';
1188
- html += 'data-linktarget="' + data.link_target + '">'
1189
- html += 'Quick Edit</a>';
1190
-
1191
- // Delete Link
1192
- html += '<a href="' + data.delete_link + '" class="np-btn np-btn-trash"><i class="np-icon-remove"></i></a>';
1193
-
1194
- html += '</div></div></div></li>';
1195
-
1196
- if ( data.parent_id === "0" ){
1197
- $('.nplist:first li:first').after(html);
1198
- } else {
1199
- np_append_child_link(html, data);
1200
- }
1201
-
1202
- $('#np-link-modal').modal('hide');
1203
-
1204
- var row = $('#menuItem_' + data.id).find('.row');
1205
- np_qe_update_redirect_animate(row);
1206
- }
1207
-
1208
-
1209
- /**
1210
- * Append a child link
1211
- */
1212
- function np_append_child_link(html, data)
1213
- {
1214
- var parent_row = $('#menuItem_' + data.parent_id);
1215
- if ( $(parent_row).children('ol').length === 0 ){
1216
- html = '<ol class="sortable nplist" style="display:block;">' + html + '</ol>';
1217
- $(parent_row).append(html);
1218
- } else {
1219
- $(parent_row).find('ol:first').prepend(html);
1220
- }
1221
- add_remove_submenu_toggles();
1222
- np_sync_user_toggles();
1223
- }
1224
-
1225
-
1226
- /**
1227
- * Show quick edit update animation after adding redirect
1228
- */
1229
- function np_qe_update_redirect_animate(row)
1230
- {
1231
- $(row).addClass('np-updated');
1232
- np_set_borders();
1233
- setTimeout(function(){
1234
- $(row).addClass('np-updated-show');
1235
- }, 1500);
1236
- }
1237
-
1238
-
1239
-
1240
-
1241
-
1242
- /**
1243
- * ------------------------------------------------------------------------
1244
- * Sync User's Toggled Pages
1245
- * ------------------------------------------------------------------------
1246
- **/
1247
-
1248
- /**
1249
- * Get an array of visible pages' ids
1250
- * @return array
1251
- */
1252
- function np_get_visible_rows()
1253
- {
1254
- var visible_ids = [];
1255
- var visible = $('.page-row:visible');
1256
- $.each(visible, function(i, v){
1257
- var id = $(this).attr('id');
1258
- visible_ids.push(id.replace("menuItem_", ""));
1259
- });
1260
- return visible_ids;
1261
- }
1262
-
1263
- /**
1264
- * Sync the user's stored toggle status
1265
- */
1266
- function np_sync_user_toggles()
1267
- {
1268
- var ids = np_get_visible_rows();
1269
- var posttype = np_get_post_type();
1270
- $.ajax({
1271
- url: ajaxurl,
1272
- type: 'post',
1273
- datatype: 'json',
1274
- data: {
1275
- action : 'npnestToggle',
1276
- nonce : nestedpages.np_nonce,
1277
- ids : ids,
1278
- posttype : posttype
1279
- },
1280
- success: function(data){
1281
- if ( data.status !== 'success' ){
1282
- console.log('There was an error saving toggled pages.');
1283
- }
1284
- }
1285
- });
1286
- }
1287
-
1288
-
1289
-
1290
-
1291
-
1292
- /**
1293
- * ------------------------------------------------------------------------
1294
- * New Child Page(s)
1295
- * ------------------------------------------------------------------------
1296
- **/
1297
-
1298
- /**
1299
- * Remove the new page form and restore the row
1300
- */
1301
- function revert_new_child()
1302
- {
1303
- $('.np-newchild-error').hide();
1304
- remove_quick_edit_overlay();
1305
- $('#np-bulk-modal .modal-body').empty();
1306
- $('.sortable .new-child').remove();
1307
- $('.row').show();
1308
- }
1309
-
1310
- /**
1311
- * Reset the bulk modal on close
1312
- */
1313
- $('#np-bulk-modal').on('hide.bs.modal', function(){
1314
- revert_new_child();
1315
- });
1316
-
1317
- $(document).on('click', '.np-cancel-newchild', function(e){
1318
- e.preventDefault();
1319
- revert_new_child();
1320
- $('#np-bulk-modal').modal('hide');
1321
- });
1322
-
1323
- /**
1324
- * Show the New Page Form
1325
- */
1326
- $(document).on('click', '.add-new-child', function(e){
1327
- e.preventDefault();
1328
- populate_new_child($(this));
1329
- });
1330
-
1331
- /**
1332
- * Show the Add Bulk Modal Form
1333
- */
1334
- $(document).on('click', '.open-bulk-modal', function(e){
1335
- e.preventDefault();
1336
- var newform = $('.new-child-form').clone().find('.np-new-child-form').addClass('in-modal');
1337
- $('#np-bulk-modal .modal-body').html(newform);
1338
- $('#np-bulk-modal .new-child-form').show();
1339
- $('#np-bulk-modal').find('h3').text(nestedpages.add_multiple);
1340
- $('#np-bulk-modal').find('.page_parent_id').val('0');
1341
- $('#np-bulk-modal').modal('show');
1342
- });
1343
-
1344
-
1345
- /**
1346
- * Set the Form Data for adding new child & Show it
1347
- */
1348
- function populate_new_child(item)
1349
- {
1350
- var parent_li = $(item).closest('.row').parent('li');
1351
-
1352
- // Append the form to the list item
1353
- if ( $(parent_li).children('ol').length > 0 ){
1354
- var child_ol = $(parent_li).children('ol');
1355
- var newform = $('.new-child-form').not('.np-modal .new-child-form').clone().insertBefore(child_ol);
1356
- } else {
1357
- var newform = $('.new-child-form').not('.np-modal .new-child-form').clone().appendTo(parent_li);
1358
- }
1359
-
1360
- var row = $(newform).siblings('.row').hide();
1361
-
1362
- show_quick_edit_overlay();
1363
-
1364
- $(newform).find('.parent_name').html('<em>Parent:</em> ' + $(item).attr('data-parentname'));
1365
- $(newform).find('.page_parent_id').val($(item).attr('data-id'));
1366
- $(newform).show();
1367
- }
1368
-
1369
-
1370
- /**
1371
- * Add a Page Title Field
1372
- */
1373
- $(document).on('click', '.add-new-child-row', function(e){
1374
- e.preventDefault();
1375
- add_new_title_field($(this));
1376
- var form = $(this).parents('form');
1377
- update_pages_text(form);
1378
- });
1379
-
1380
- /**
1381
- * Add a new title field
1382
- */
1383
- function add_new_title_field(item)
1384
- {
1385
- 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>';
1386
- var container = $(item).siblings('.new-page-titles').append(html);
1387
- // Make sortable
1388
- $('.new-page-titles').sortable({
1389
- items : 'li',
1390
- handle: '.handle',
1391
- });
1392
- }
1393
-
1394
- /**
1395
- * Update Pages Text
1396
- * Toggle between singular and plural text for adding new page(s)
1397
- */
1398
- function update_pages_text(form)
1399
- {
1400
- var count = $(form).find($('.new-child-row')).length;
1401
- if ( count > 1 ){
1402
- $(form).find('.add-edit').hide();
1403
- $(form).find('h3 strong').text(nestedpages.add_child_pages);
1404
- $(form).find('.np-save-newchild').text(nestedpages.add + ' (' + count + ')');
1405
- } else {
1406
- $(form).find('.add-edit').show();
1407
- $(form).find('h3 strong').text(nestedpages.add_child);
1408
- $(form).find('.np-save-newchild').text(nestedpages.add);
1409
- }
1410
- }
1411
-
1412
- /**
1413
- * Remove New Child Page Field
1414
- */
1415
- $(document).on('click', '.np-remove-child', function(e){
1416
- e.preventDefault();
1417
- var form = $(this).parents('form');
1418
- $(this).parents('.new-child-row').parent('li').remove();
1419
- update_pages_text(form);
1420
- });
1421
-
1422
-
1423
- /**
1424
- * Prevent New Child Page form Submission
1425
- */
1426
- $(document).on('submit', '.np-new-child-form', function(e){
1427
- e.preventDefault();
1428
- });
1429
-
1430
-
1431
- /**
1432
- * Submit the new child page form
1433
- */
1434
- $(document).on('click', '.np-save-newchild', function(e){
1435
- e.preventDefault();
1436
- $(this).prop('disabled', 'disabled');
1437
- var form = $(this).parents('form');
1438
- $(form).find('.np-qe-loading').show();
1439
- var addedit = ( $(this).hasClass('add-edit') ) ? true : false;
1440
- submit_new_child_form(form, addedit);
1441
- });
1442
-
1443
-
1444
- /**
1445
- * Process New Child Form
1446
- */
1447
- function submit_new_child_form(form, addedit)
1448
- {
1449
- $('.np-quickedit-error').hide();
1450
- var syncmenu = ( $('.np-sync-menu').is(':checked') ) ? 'sync' : 'nosync';
1451
- $.ajax({
1452
- url: ajaxurl,
1453
- type: 'post',
1454
- datatype: 'json',
1455
- data: $(form).serialize() + '&action=npnewChild&nonce=' + nestedpages.np_nonce + '&syncmenu=' + syncmenu + '&post_type=' + np_get_post_type(),
1456
- success: function(data){
1457
- if (data.status === 'error'){
1458
- np_remove_qe_loading(form);
1459
- $(form).find('.np-quickedit-error').text(data.message).show();
1460
- } else {
1461
- if ( addedit === true ){ // Redirect to Edit Screen
1462
- var link = data.new_pages[0].edit_link;
1463
- link = link.replace(/&amp;/g, '&');
1464
- window.location.replace(link);
1465
- } else {
1466
- np_remove_qe_loading(form);
1467
- add_new_child_pages(form, data);
1468
- }
1469
- }
1470
- },
1471
- error: function(){
1472
- np_remove_qe_loading(form);
1473
- $(form).find('.np-quickedit-error').text('The form could not be saved at this time.').show();
1474
- }
1475
- });
1476
- }
1477
-
1478
-
1479
- /**
1480
- * Add the Child New Pages
1481
- */
1482
- function add_new_child_pages(form, data)
1483
- {
1484
- var pages = data.new_pages;
1485
- var parent_li = $(form).parent('.new-child').parent('.page-row');
1486
-
1487
- // If parent li doesn't have a child ol, add one
1488
- if ( $(parent_li).children('ol').length === 0 ){
1489
- $(parent_li).append('<ol class="nplist"></ol>');
1490
- }
1491
-
1492
- if ( $(form).hasClass('in-modal') ){
1493
- var appendto = $('.nplist.sortable li.page-row:first');
1494
- } else {
1495
- var appendto = $(parent_li).children('ol');
1496
- }
1497
-
1498
- for (i = 0; i < pages.length; i++){
1499
- append_new_child_row(appendto, pages[i]);
1500
- }
1501
-
1502
- // Show the child page list and reset submenu toggles
1503
- $(appendto).show();
1504
- add_remove_submenu_toggles();
1505
- revert_new_child();
1506
- $('#np-bulk-modal').modal('hide');
1507
- np_qe_update_animate(form);
1508
- submit_sortable_form();
1509
- }
1510
-
1511
-
1512
- /**
1513
- * Append the Row to the View
1514
- */
1515
- function append_new_child_row(appendto, page)
1516
- {
1517
- var html = '<li id="menuItem_' + page.id + '" class="page-row';
1518
- if ( page.status === 'publish' ) html += ' published';
1519
- html += '">';
1520
-
1521
- if ( max_levels(np_get_post_type()) === 0 ){
1522
- html += '<div class="row">';
1523
- html += '<div class="child-toggle"></div>';
1524
- } else {
1525
- html += '<div class="row non-hierarchical">';
1526
- }
1527
-
1528
- html += '<div class="row-inner">';
1529
- html += '<i class="np-icon-sub-menu"></i><i class="handle np-icon-menu"></i>';
1530
- html += '<a href="' + page.edit_link + '" class="page-link page-title">';
1531
- html += '<span class="title">' + page.title + '</span>';
1532
-
1533
- // Status
1534
- if ( page.status !== 'Publish' ){
1535
- html += '<span class="status">(' + page.status + ')</span>';
1536
- } else {
1537
- html += '<span class="status"></span>';
1538
- }
1539
-
1540
- html += '<span class="nav-status"></span><span class="edit-indicator"><i class="np-icon-pencil"></i>Edit</span>';
1541
- html += '</a>';
1542
-
1543
- // Action Buttons
1544
- html += '<div class="action-buttons">';
1545
- html += '<a href="#" class="np-btn open-redirect-modal" data-parentid="' + page.id + '"><i class="np-icon-link"></i></a>';
1546
- html += '<a href="#" class="np-btn add-new-child" data-id="' + page.id + '" data-parentname="' + page.title + '">' + nestedpages.add_child_short + '</a>';
1547
-
1548
- // Quick Edit (data attrs)
1549
- 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 + '" data-datepicker="' + page.datepicker + '" data-time="' + page.time + '" data-formattedtime="' + page.formattedtime + '" data-ampm="' + page.ampm + '">' + nestedpages.quick_edit + '</a>';
1550
-
1551
- html += '<a href="' + page.view_link + '" class="np-btn" target="_blank">' + nestedpages.view + '</a>';
1552
- html += '<a href="' + page.delete_link + '" class="np-btn np-btn-trash"><i class="np-icon-remove"></i></a>';
1553
- html += '</div><!-- .action-buttons -->';
1554
-
1555
- html += '</div><!-- .row-inner --></div><!-- .row -->';
1556
- html += '</li>';
1557
-
1558
- $(appendto).append(html);
1559
- }
1560
-
1561
-
1562
-
1563
- }); //$
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 
 
 
 
 
 
 
 
 
assets/js/lib/nestedpages.menu-links.js ADDED
@@ -0,0 +1,272 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ var NestedPages = NestedPages || {};
2
+
3
+ /**
4
+ * Menu Item Selection in Modal Link Form
5
+ * @package Nested Pages
6
+ * @author Kyle Phillips - https://github.com/kylephillips/wp-nested-pages
7
+ */
8
+ NestedPages.MenuLinks = function()
9
+ {
10
+ var plugin = this;
11
+ var $ = jQuery;
12
+
13
+ plugin.typeButton = ''; // The Link Type selected button
14
+ plugin.post = ''; // The new post created
15
+
16
+ plugin.formatter = new NestedPages.Formatter;
17
+
18
+ plugin.selectors = {
19
+ form : '[data-np-menu-item-form]', // The form element
20
+ typeSelect : '[data-np-menu-selection]', // Link in left column to choose type of link
21
+ accordion : '[data-np-menu-accordion]', // Accordion of objects
22
+ accordionItem : '[data-np-menu-accordion-item]', // Single item in the accordion
23
+ formPlaceholder : '.np-menu-link-object-placeholder', // Placeholder element
24
+ formDetails : '.np-menu-link-details', // Right pane form details
25
+ searchResults : '[data-np-search-result]', // Appended search result rows
26
+ defaultResults : '[data-default-result]', // Default results,
27
+ originalLink : '[data-np-original-link]', // Original Link Preview
28
+ saveButton : '[data-np-save-link]', // The Form Submit Button
29
+ urlInputCont : '[data-np-menu-url-cont]', // Container for URL input (only for custom links)
30
+ errorDiv : '[data-np-error]', // The error notification
31
+ }
32
+
33
+ plugin.fields = {
34
+ object : '[data-np-menu-object-input]', // The object (ex: post/category/custom)
35
+ objectid : '[data-np-menu-objectid-input]', // ex: term id, post id
36
+ itemType : '[data-np-menu-type-input]', // ex: post_type, taxonomy
37
+ url : '[data-np-menu-url]', // custom url
38
+ navigationLabel : '[data-np-menu-navigation-label]',
39
+ titleAttribute : '[data-np-menu-title-attr]',
40
+ cssClasses : '[data-np-menu-css-classes]',
41
+ npStatus : '[data-np-menu-np-status]',
42
+ linkTarget : '[data-np-menu-link-target]',
43
+ menuTitle : '[data-np-menu-title]'
44
+ }
45
+
46
+ plugin.search = new NestedPages.MenuSearch;
47
+
48
+ plugin.init = function()
49
+ {
50
+ plugin.bindEvents();
51
+ }
52
+
53
+ plugin.bindEvents = function()
54
+ {
55
+ $(document).on('click', NestedPages.selectors.openLinkModal, function(e){
56
+ e.preventDefault();
57
+ plugin.postParent = $(this).attr('data-parentid');
58
+ $(plugin.selectors.form).find('.parent_id').val($(this).attr('data-parentid'));
59
+ plugin.openModal();
60
+ });
61
+ $(document).on('click', plugin.selectors.accordionItem, function(e){
62
+ e.preventDefault();
63
+ plugin.accordion($(this));
64
+ });
65
+ $(document).on('click', plugin.selectors.typeSelect, function(e){
66
+ e.preventDefault();
67
+ plugin.typeButton = $(this);
68
+ plugin.setLinkType();
69
+ });
70
+ $(document).on('keyup', plugin.fields.navigationLabel, function(){
71
+ plugin.updateTitle();
72
+ });
73
+ $(document).on('click', plugin.selectors.saveButton, function(e){
74
+ e.preventDefault();
75
+ plugin.submitForm();
76
+ });
77
+ $(document).on('keydown', function(e){
78
+ if ( e.keyCode === 27 ) $('#np-link-modal').modal('hide');
79
+ });
80
+ }
81
+
82
+ // Open the Modal and Clear/Populate hidden fields
83
+ plugin.openModal = function()
84
+ {
85
+ $(NestedPages.selectors.linkErrorDiv).hide();
86
+ $(NestedPages.selectors.linkModal).find('input').val('');
87
+ $(NestedPages.selectors.linkModal).find('.parent_id').val(plugin.postParent);
88
+ plugin.clearForm();
89
+ $(plugin.selectors.accordion).find('ul').hide();
90
+ $(plugin.selectors.typeSelect).removeClass('active');
91
+ $(NestedPages.selectors.linkModal).modal('show');
92
+ }
93
+
94
+ // Accordion Menu
95
+ plugin.accordion = function(button)
96
+ {
97
+ plugin.clearForm();
98
+ var submenu = $(button).siblings('ul');
99
+ if ( $(submenu).is(':visible') ){
100
+ $(button).removeClass('active');
101
+ $(submenu).slideUp('fast');
102
+ return;
103
+ }
104
+ $(plugin.selectors.accordionItem).removeClass('active');
105
+ $(button).addClass('active');
106
+ $(button).parents(plugin.selectors.accordion).find('ul').slideUp('fast');
107
+ $(submenu).slideDown('fast');
108
+ }
109
+
110
+ // Set the link type
111
+ plugin.setLinkType = function()
112
+ {
113
+ if ( $(plugin.typeButton).hasClass('active') ){
114
+ plugin.clearForm();
115
+ return;
116
+ }
117
+ if ( $(plugin.typeButton).hasClass('np-custom-link') ){
118
+ $(plugin.selectors.accordionItem).removeClass('active');
119
+ $(plugin.selectors.accordion).find('ul').slideUp('fast');
120
+ }
121
+ $(plugin.selectors.formPlaceholder).hide();
122
+ plugin.populateForm();
123
+ }
124
+
125
+ // Populate the form
126
+ plugin.populateForm = function()
127
+ {
128
+ $(plugin.selectors.saveButton).show();
129
+ $(plugin.selectors.typeSelect).removeClass('active');
130
+ $(plugin.typeButton).addClass('active');
131
+ $(plugin.fields.menuTitle).text($(plugin.typeButton).text()).val($(plugin.typeButton).text());
132
+ $(plugin.selectors.form).find('h3').find('em').text($(plugin.typeButton).attr('data-np-object-name'));
133
+ if ( $(plugin.typeButton).attr('data-np-permalink') !== "" ){
134
+ $(plugin.selectors.form).find(plugin.selectors.urlInputCont).hide();
135
+ $(plugin.selectors.form).find(plugin.selectors.originalLink).html('<a href="' + $(plugin.typeButton).attr('data-np-permalink') + '">' + $(plugin.typeButton).text() + '</a>');
136
+ $(plugin.selectors.form).find(plugin.selectors.originalLink).parent('.original-link').show();
137
+ } else {
138
+ $(plugin.selectors.form).find(plugin.selectors.urlInputCont).show();
139
+ $(plugin.selectors.form).find(plugin.selectors.originalLink).parent('.original-link').hide();
140
+ }
141
+ $(plugin.fields.object).val($(plugin.typeButton).attr('data-np-menu-object'));
142
+ $(plugin.fields.objectid).val($(plugin.typeButton).attr('data-np-menu-objectid'));
143
+ $(plugin.fields.itemType).val($(plugin.typeButton).attr('data-np-menu-type'));
144
+ $(plugin.selectors.formDetails).show();
145
+ }
146
+
147
+ // Clear the form
148
+ plugin.clearForm = function()
149
+ {
150
+ $(plugin.selectors.form).find(plugin.selectors.errorDiv).hide();
151
+ $(plugin.selectors.saveButton).hide();
152
+ $(plugin.selectors.formDetails).hide();
153
+ $(plugin.selectors.formPlaceholder).show();
154
+ $(plugin.selectors.form).find('input').not('.parent_id').val('');
155
+ $(plugin.selectors.form).find(plugin.fields.linkTarget).val('_blank');
156
+ $(plugin.selectors.form).find('input[type="checkbox"]').attr('checked', false);
157
+ $(plugin.selectors.typeSelect).removeClass('active');
158
+ plugin.search.toggleLoading(false);
159
+ $(plugin.selectors.searchResults).remove();
160
+ $(plugin.selectors.defaultResults).show();
161
+ }
162
+
163
+ // Update the title text
164
+ plugin.updateTitle = function()
165
+ {
166
+ var value = $(plugin.fields.navigationLabel).val();
167
+ var title = $(plugin.selectors.form).find('h3').find('span');
168
+ if ( value !== "" ){
169
+ $(plugin.fields.menuTitle).val(value);
170
+ $(title).text(value);
171
+ } else {
172
+ $(plugin.fields.menuTitle).val($(plugin.typeButton).text());
173
+ $(title).text($(plugin.typeButton).text());
174
+ }
175
+ }
176
+
177
+ // Submit the Form
178
+ plugin.submitForm = function()
179
+ {
180
+ plugin.toggleLoading(true);
181
+ $.ajax({
182
+ url : NestedPages.jsData.ajaxurl,
183
+ type : 'post',
184
+ data: $(plugin.selectors.form).serialize() + '&action=' + NestedPages.formActions.newMenuItem + '&nonce=' + NestedPages.jsData.nonce + '&post_type=' + NestedPages.jsData.posttype + '&syncmenu=' + NestedPages.jsData.syncmenu,
185
+ success : function(data){
186
+ plugin.toggleLoading(false);
187
+ if ( data.status === 'error' ){
188
+ $(plugin.selectors.form).find(plugin.selectors.errorDiv).text(data.message).show();
189
+ return;
190
+ }
191
+ plugin.post = data.post_data;
192
+ plugin.createRow();
193
+ },
194
+ error : function(data){
195
+ console.log(data);
196
+ }
197
+ });
198
+ }
199
+
200
+ // Create the nested pages row for the new link
201
+ plugin.createRow = function()
202
+ {
203
+ var html = '<li id="menuItem_' + plugin.post.id + '" class="page-row published';
204
+ html += '">'
205
+
206
+ html += '<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="' + plugin.post.np_link_content + '" class="page-link page-title" target="_blank"><span class="title">' + plugin.post.menuTitle + ' <i class="np-icon-link"></i></span>';
207
+
208
+ // Quick Edit Button
209
+ html += '</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" ';
210
+ html += 'data-id="' + plugin.post.id + '"';
211
+ html += 'data-parentid="' + plugin.post.parent_id + '"';
212
+ html += 'data-title="' + plugin.post.menuTitle + '" ';
213
+ html += 'data-url="' + plugin.post.url + '" ';
214
+ html += 'data-status="publish" ';
215
+ html += 'data-np-status="show" ';
216
+ html += 'data-navstatus="show" ';
217
+ html += 'data-navcss="' + plugin.post.cssClasses + '" ';
218
+ html += 'data-navtitleattr="' + plugin.post.titleAttribute + '" ';
219
+ html += 'data-nav-type="' + plugin.post.menuType + '" ';
220
+ html += 'data-nav-object="' + plugin.post.objectType + '" ';
221
+ html += 'data-nav-object-id="' + plugin.post.objectId + '" ';
222
+ html += 'data-nav-original-link="' + plugin.post.original_link + '" ';
223
+ html += 'data-nav-original-title="' + plugin.post.original_title + '" ';
224
+ html += 'data-linktarget="' + plugin.post.link_target + '">';
225
+ html += NestedPages.jsData.quickEditText;
226
+ html += '</a>';
227
+
228
+ // Delete Link
229
+ html += '<a href="' + plugin.post.delete_link + '" class="np-btn np-btn-trash"><i class="np-icon-remove"></i></a>';
230
+
231
+ html += '</div></div></div></li>';
232
+
233
+ if ( plugin.post.parent_id === "0" ){
234
+ $('.nplist:first li:first').after(html);
235
+ } else {
236
+ plugin.appendChildRow(html);
237
+ }
238
+
239
+ $(NestedPages.selectors.linkModal).modal('hide');
240
+
241
+ plugin.row = $('#menuItem_' + plugin.post.id).find('.row');
242
+ plugin.formatter.flashRow(plugin.row);
243
+ }
244
+
245
+ // Append a new child link to the appropriate menu
246
+ plugin.appendChildRow = function(html)
247
+ {
248
+ var parent_row = $('#menuItem_' + plugin.post.parent_id);
249
+ if ( $(parent_row).children('ol').length === 0 ){
250
+ html = '<ol class="sortable nplist" style="display:block;">' + html + '</ol>';
251
+ $(parent_row).append(html);
252
+ } else {
253
+ $(parent_row).find('ol:first').prepend(html);
254
+ }
255
+ plugin.formatter.updateSubMenuToggle();
256
+ }
257
+
258
+ // Toggle Loading
259
+ plugin.toggleLoading = function(loading)
260
+ {
261
+ if ( loading ){
262
+ $(plugin.selectors.form).find(plugin.selectors.errorDiv).hide();
263
+ $(plugin.selectors.form).find(NestedPages.selectors.quickEditLoadingIndicator).show();
264
+ $(plugin.selectors.saveButton).attr('disabled', 'disabled');
265
+ return;
266
+ }
267
+ $(plugin.selectors.form).find(NestedPages.selectors.quickEditLoadingIndicator).hide();
268
+ $(plugin.selectors.saveButton).attr('disabled', false);
269
+ }
270
+
271
+ return plugin.init();
272
+ }
assets/js/lib/nestedpages.menu-search.js ADDED
@@ -0,0 +1,131 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ var NestedPages = NestedPages || {};
2
+
3
+ /**
4
+ * Menu Item Search in Modal Link Form
5
+ * @package Nested Pages
6
+ * @author Kyle Phillips - https://github.com/kylephillips/wp-nested-pages
7
+ */
8
+ NestedPages.MenuSearch = function()
9
+ {
10
+ var plugin = this;
11
+ var $ = jQuery;
12
+
13
+ plugin.selectors = {
14
+ searchForms : '*[data-np-menu-search]', // Search form selector
15
+ defaultResults : '[data-default-result]', // Default results list items
16
+ loadingIndicator : '.np-menu-search-loading', // loading indicator
17
+ noResults : '.np-menu-search-noresults', // No results
18
+ searchType : 'data-search-type', // The search object type (post_type, taxonomy)
19
+ searchObject : 'data-search-object', // The object to search (post, category, etc)
20
+ searchResults : '[data-np-search-result]', // Appended search result rows
21
+ }
22
+
23
+ plugin.activeForm = ''; // The active form
24
+ plugin.results = ''; // Search results
25
+ plugin.defaultResults = ''; // The default, loaded results
26
+ plugin.searchType = ''; // The type of search (post_type, taxonomy)
27
+ plugin.searchObject = ''; // The object being searched (post, category, post_tag, etc…)
28
+
29
+ plugin.init = function()
30
+ {
31
+ plugin.bindEvents();
32
+ }
33
+
34
+ plugin.bindEvents = function()
35
+ {
36
+ $(document).on('keyup', plugin.selectors.searchForms, function(){
37
+ plugin.activeForm = $(this);
38
+ $(plugin.selectors.searchResults).remove();
39
+ plugin.performSearch();
40
+ });
41
+ }
42
+
43
+
44
+ // Perform the search
45
+ plugin.performSearch = function()
46
+ {
47
+ plugin.defaultResults = $(plugin.activeForm).parent('li').siblings(plugin.selectors.defaultResults);
48
+ if ( $(plugin.activeForm).val().length > 2 ){
49
+ $(plugin.defaultResults).hide();
50
+ plugin.toggleLoading(true);
51
+ plugin.query();
52
+ return;
53
+ }
54
+ plugin.toggleLoading(false);
55
+ $(plugin.defaultResults).show();
56
+ }
57
+
58
+
59
+ // Query Search
60
+ plugin.query = function()
61
+ {
62
+ plugin.searchType = $(plugin.activeForm).attr(plugin.selectors.searchType);
63
+ plugin.searchObject = $(plugin.activeForm).attr(plugin.selectors.searchObject);
64
+ $.ajax({
65
+ url: NestedPages.jsData.ajaxurl,
66
+ type: 'post',
67
+ datatype: 'json',
68
+ data: {
69
+ action : NestedPages.formActions.search,
70
+ nonce : NestedPages.jsData.nonce,
71
+ term : $(plugin.activeForm).val(),
72
+ searchType : plugin.searchType,
73
+ searchObject : plugin.searchObject,
74
+ },
75
+ success: function(data){
76
+ console.log(data);
77
+ if ( data.results ){
78
+ plugin.results = data.results;
79
+ plugin.toggleLoading(false);
80
+ if ( plugin.searchType === 'post_type' ){
81
+ plugin.appendPosts();
82
+ } else {
83
+ plugin.appendTaxonomies();
84
+ }
85
+ } else {
86
+ plugin.toggleLoading(false);
87
+ $(plugin.activeForm).siblings(plugin.selectors.noResults).show();
88
+ }
89
+ }
90
+ });
91
+ }
92
+
93
+
94
+ // Append post type results
95
+ plugin.appendPosts = function()
96
+ {
97
+ var html = "";
98
+ $.each(plugin.results, function(i, v){
99
+ html += '<li data-np-search-result><a href="#" data-np-menu-object="' + plugin.searchObject + '" data-np-menu-type="post_type" data-np-menu-objectid="' + v.ID + '" data-np-permalink="' + v.permalink + '" data-np-object-name="' + v.singular_name + '" data-np-menu-selection>' + v.post_title + '</a></li>';
100
+ });
101
+ $(html).insertAfter($(plugin.activeForm).parent('li'));
102
+ plugin.toggleLoading(false);
103
+ }
104
+
105
+
106
+ // Append taxonomy results
107
+ plugin.appendTaxonomies = function()
108
+ {
109
+ var html = "";
110
+ $.each(plugin.results, function(i, v){
111
+ html += '<li data-np-search-result><a href="#" data-np-menu-object="' + plugin.searchObject + '" data-np-menu-type="post_type" data-np-menu-objectid="' + v.term_id + '" data-np-permalink="' + v.permalink + '" data-np-object-name="' + v.taxonomy + '" data-np-menu-selection>' + v.name + '</a></li>';
112
+ });
113
+ $(html).insertAfter($(plugin.activeForm).parent('li'));
114
+ plugin.toggleLoading(false);
115
+ }
116
+
117
+
118
+ // Toggle the loading indicator
119
+ plugin.toggleLoading = function(loading)
120
+ {
121
+ var loadingIndicator = $(plugin.activeForm).siblings(plugin.selectors.loadingIndicator);
122
+ $(plugin.selectors.noResults).hide();
123
+ if ( loading ){
124
+ $(loadingIndicator).show();
125
+ return;
126
+ }
127
+ $(loadingIndicator).hide();
128
+ }
129
+
130
+ return plugin.init();
131
+ }
assets/js/lib/nestedpages.nesting.js CHANGED
@@ -57,8 +57,6 @@ NestedPages.Nesting = function()
57
  $(NestedPages.selectors.errorDiv).hide();
58
  $(NestedPages.selectors.loadingIndicator).show();
59
 
60
- var syncmenu = ( $(NestedPages.selectors.syncCheckbox).is(':checked') ) ? 'sync' : 'nosync';
61
-
62
  list = $(NestedPages.selectors.sortable).nestedSortable('toHierarchy', {startDepthCount: 0});
63
  plugin.disableNesting();
64
 
@@ -71,7 +69,7 @@ NestedPages.Nesting = function()
71
  nonce : NestedPages.jsData.nonce,
72
  list : list,
73
  post_type : NestedPages.jsData.posttype,
74
- syncmenu : syncmenu
75
  },
76
  success: function(data){
77
  plugin.initializeSortable();
57
  $(NestedPages.selectors.errorDiv).hide();
58
  $(NestedPages.selectors.loadingIndicator).show();
59
 
 
 
60
  list = $(NestedPages.selectors.sortable).nestedSortable('toHierarchy', {startDepthCount: 0});
61
  plugin.disableNesting();
62
 
69
  nonce : NestedPages.jsData.nonce,
70
  list : list,
71
  post_type : NestedPages.jsData.posttype,
72
+ syncmenu : NestedPages.jsData.syncmenu
73
  },
74
  success: function(data){
75
  plugin.initializeSortable();
assets/js/lib/nestedpages.new-link.js CHANGED
@@ -4,6 +4,7 @@ var NestedPages = NestedPages || {};
4
  * Add a new Link (top level and child)
5
  * @package Nested Pages
6
  * @author Kyle Phillips - https://github.com/kylephillips/wp-nested-pages
 
7
  */
8
  NestedPages.NewLink = function()
9
  {
@@ -65,13 +66,12 @@ NestedPages.NewLink = function()
65
  {
66
  plugin.toggleLoading(true);
67
  var data = $(NestedPages.selectors.linkForm).serialize();
68
- var syncmenu = ( $(NestedPages.selectors.syncCheckbox).is(':checked') ) ? 'sync' : 'nosync';
69
 
70
  $.ajax({
71
  url: NestedPages.jsData.ajaxurl,
72
  type: 'POST',
73
  datatype: 'json',
74
- data: data + '&action=' + NestedPages.formActions.newLink + '&nonce=' + NestedPages.jsData.nonce + '&syncmenu=' + syncmenu + '&post_type=' + NestedPages.jsData.posttype,
75
  success: function(data){
76
  plugin.toggleLoading(false);
77
  if (data.status === 'error'){
4
  * Add a new Link (top level and child)
5
  * @package Nested Pages
6
  * @author Kyle Phillips - https://github.com/kylephillips/wp-nested-pages
7
+ * @todo - remove in 1.4.1
8
  */
9
  NestedPages.NewLink = function()
10
  {
66
  {
67
  plugin.toggleLoading(true);
68
  var data = $(NestedPages.selectors.linkForm).serialize();
 
69
 
70
  $.ajax({
71
  url: NestedPages.jsData.ajaxurl,
72
  type: 'POST',
73
  datatype: 'json',
74
+ data: data + '&action=' + NestedPages.formActions.newLink + '&nonce=' + NestedPages.jsData.nonce + '&syncmenu=' + NestedPages.jsData.syncmenu + '&post_type=' + NestedPages.jsData.posttype,
75
  success: function(data){
76
  plugin.toggleLoading(false);
77
  if (data.status === 'error'){
assets/js/lib/nestedpages.new-page.js CHANGED
@@ -131,13 +131,12 @@ NestedPages.NewPage = function()
131
  plugin.form = $(button).parents('form');
132
 
133
  var addedit = ( $(button).hasClass('add-edit') ) ? true : false;
134
- var syncmenu = ( $(NestedPages.selectors.syncCheckbox).is(':checked') ) ? 'sync' : 'nosync';
135
 
136
  $.ajax({
137
  url: NestedPages.jsData.ajaxurl,
138
  type: 'post',
139
  datatype: 'json',
140
- data: $(plugin.form).serialize() + '&action=' + NestedPages.formActions.newPage + '&nonce=' + NestedPages.jsData.nonce + '&syncmenu=' + syncmenu + '&post_type=' + NestedPages.jsData.posttype,
141
  success: function(data){
142
  if (data.status === 'error'){
143
  plugin.toggleLoading(false);
131
  plugin.form = $(button).parents('form');
132
 
133
  var addedit = ( $(button).hasClass('add-edit') ) ? true : false;
 
134
 
135
  $.ajax({
136
  url: NestedPages.jsData.ajaxurl,
137
  type: 'post',
138
  datatype: 'json',
139
+ data: $(plugin.form).serialize() + '&action=' + NestedPages.formActions.newPage + '&nonce=' + NestedPages.jsData.nonce + '&syncmenu=' + NestedPages.jsData.syncmenu + '&post_type=' + NestedPages.jsData.posttype,
140
  success: function(data){
141
  if (data.status === 'error'){
142
  plugin.toggleLoading(false);
assets/js/lib/nestedpages.quickedit-link.js CHANGED
@@ -35,6 +35,9 @@ NestedPages.QuickEditLink = function()
35
  e.preventDefault();
36
  plugin.submitForm();
37
  });
 
 
 
38
  }
39
 
40
 
@@ -60,7 +63,12 @@ NestedPages.QuickEditLink = function()
60
  linktarget : $(plugin.button).attr('data-linktarget'),
61
  parentid : $(plugin.button).attr('data-parentid'),
62
  navtitleattr : $(plugin.button).attr('data-navtitleattr'),
63
- navcss : $(plugin.button).attr('data-navcss')
 
 
 
 
 
64
  };
65
  }
66
 
@@ -113,6 +121,21 @@ NestedPages.QuickEditLink = function()
113
  $(plugin.form).find('.link_target').removeAttr('checked');
114
  }
115
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
116
  plugin.formatter.showQuickEdit();
117
  $(plugin.form).show();
118
  }
@@ -122,13 +145,12 @@ NestedPages.QuickEditLink = function()
122
  plugin.submitForm = function()
123
  {
124
  plugin.toggleLoading(true);
125
- var syncmenu = ( $(NestedPages.selectors.syncCheckbox).is(':checked') ) ? 'sync' : 'nosync';
126
 
127
  $.ajax({
128
  url: NestedPages.jsData.ajaxurl,
129
  type: 'post',
130
  datatype: 'json',
131
- data: $(plugin.form).find('form').serialize() + '&action=' + NestedPages.formActions.quickEditLink + '&nonce=' + NestedPages.jsData.nonce + '&syncmenu=' + syncmenu + '&post_type=' + NestedPages.jsData.posttype,
132
  success: function(data){
133
  if (data.status === 'error'){
134
  plugin.toggleLoading(false);
@@ -150,11 +172,12 @@ NestedPages.QuickEditLink = function()
150
  // Update the row after successfully saving quick edit data
151
  plugin.updateRow = function()
152
  {
 
153
  var row = $(plugin.form).siblings('.row');
154
  $(row).find('.title').html(plugin.newPostData.post_title + ' <i class="np-icon-link"></i>');
155
 
156
  var status = $(row).find('.status');
157
- if ( (plugin.newPostData._status !== 'publish') && (data._status !== 'future') ){
158
  $(status).text('(' + plugin.newPostData._status + ')');
159
  } else {
160
  $(status).text('');
@@ -186,9 +209,9 @@ NestedPages.QuickEditLink = function()
186
  $(button).attr('data-status', plugin.newPostData._status);
187
  $(button).attr('data-navstatus', plugin.newPostData.nav_status);
188
  $(button).attr('data-np-status', plugin.newPostData.np_status);
189
- $(button).attr('data-linktarget', plugin.newPostData.link_target);
190
- $(button).attr('data-navtitleattr', plugin.newPostData.np_title_attribute);
191
- $(button).attr('data-navcss', plugin.newPostData.np_nav_css_classes);
192
 
193
  plugin.formatter.removeQuickEdit();
194
  plugin.formatter.flashRow(row);
35
  e.preventDefault();
36
  plugin.submitForm();
37
  });
38
+ $(document).on('keydown', function(e){
39
+ if ( e.keyCode === 27 ) plugin.formatter.removeQuickEdit();
40
+ });
41
  }
42
 
43
 
63
  linktarget : $(plugin.button).attr('data-linktarget'),
64
  parentid : $(plugin.button).attr('data-parentid'),
65
  navtitleattr : $(plugin.button).attr('data-navtitleattr'),
66
+ navcss : $(plugin.button).attr('data-navcss'),
67
+ navtype : $(plugin.button).attr('data-nav-type'),
68
+ navobject : $(plugin.button).attr('data-nav-object'),
69
+ navobjectid : $(plugin.button).attr('data-nav-object-id'),
70
+ navoriginallink : $(plugin.button).attr('data-nav-original-link'),
71
+ navoriginaltitle : $(plugin.button).attr('data-nav-original-title')
72
  };
73
  }
74
 
121
  $(plugin.form).find('.link_target').removeAttr('checked');
122
  }
123
 
124
+ // Relationship Links
125
+ if ( plugin.postData.navobject !== 'custom' && plugin.postData.navobject !== '' ){
126
+ var html = '<div class="form-control original-link">Original: <a href="' + plugin.postData.navoriginallink + '" target="_blank">' + plugin.postData.navoriginaltitle + '</a></div>';
127
+ $(plugin.form).find('[data-url-field]').remove();
128
+ $(html).insertAfter($(plugin.form).find('h3'));
129
+ $(plugin.form).find('[data-np-menu-object-input]').val(plugin.postData.navobject);
130
+ $(plugin.form).find('[data-np-menu-objectid-input]').val(plugin.postData.navobjectid);
131
+ $(plugin.form).find('[data-np-menu-type-input]').val(plugin.postData.navtype);
132
+ $(plugin.form).find('h3').text('Link: ' + plugin.postData.navoriginaltitle);
133
+ } else {
134
+ $(plugin.form).find('h3').text('Link');
135
+ $(plugin.form).find('[data-np-menu-object-input]').val('custom');
136
+ $(plugin.form).find('[data-np-menu-type-input]').val('custom');
137
+ }
138
+
139
  plugin.formatter.showQuickEdit();
140
  $(plugin.form).show();
141
  }
145
  plugin.submitForm = function()
146
  {
147
  plugin.toggleLoading(true);
 
148
 
149
  $.ajax({
150
  url: NestedPages.jsData.ajaxurl,
151
  type: 'post',
152
  datatype: 'json',
153
+ data: $(plugin.form).find('form').serialize() + '&action=' + NestedPages.formActions.quickEditLink + '&nonce=' + NestedPages.jsData.nonce + '&syncmenu=' + NestedPages.jsData.syncmenu + '&post_type=' + NestedPages.jsData.posttype,
154
  success: function(data){
155
  if (data.status === 'error'){
156
  plugin.toggleLoading(false);
172
  // Update the row after successfully saving quick edit data
173
  plugin.updateRow = function()
174
  {
175
+ console.log(plugin.newPostData);
176
  var row = $(plugin.form).siblings('.row');
177
  $(row).find('.title').html(plugin.newPostData.post_title + ' <i class="np-icon-link"></i>');
178
 
179
  var status = $(row).find('.status');
180
+ if ( (plugin.newPostData._status !== 'publish') && (plugin.newPostData._status !== 'future') ){
181
  $(status).text('(' + plugin.newPostData._status + ')');
182
  } else {
183
  $(status).text('');
209
  $(button).attr('data-status', plugin.newPostData._status);
210
  $(button).attr('data-navstatus', plugin.newPostData.nav_status);
211
  $(button).attr('data-np-status', plugin.newPostData.np_status);
212
+ $(button).attr('data-linkTarget', plugin.newPostData.linkTarget);
213
+ $(button).attr('data-navtitleattr', plugin.newPostData.titleAttribute);
214
+ $(button).attr('data-navcss', plugin.newPostData.cssClasses);
215
 
216
  plugin.formatter.removeQuickEdit();
217
  plugin.formatter.flashRow(row);
assets/js/lib/nestedpages.quickedit-post.js CHANGED
@@ -59,6 +59,9 @@ NestedPages.QuickEditPost = function()
59
  plugin.saveButton = $(this);
60
  plugin.save();
61
  });
 
 
 
62
  }
63
 
64
 
@@ -298,13 +301,12 @@ NestedPages.QuickEditPost = function()
298
  plugin.save = function()
299
  {
300
  plugin.toggleLoading(true);
301
- var syncmenu = ( $(NestedPages.selectors.syncCheckbox).is(':checked') ) ? 'sync' : 'nosync';
302
 
303
  $.ajax({
304
  url: NestedPages.jsData.ajaxurl,
305
  type: 'post',
306
  datatype: 'json',
307
- data: $(plugin.form).find('form').serialize() + '&action=' + NestedPages.formActions.quickEditPost + '&nonce=' + NestedPages.jsData.nonce + '&syncmenu=' + syncmenu + '&post_type=' + NestedPages.jsData.posttype,
308
  success: function(data){
309
  if (data.status === 'error'){
310
  plugin.toggleLoading(false);
59
  plugin.saveButton = $(this);
60
  plugin.save();
61
  });
62
+ $(document).on('keydown', function(e){
63
+ if ( e.keyCode === 27 ) plugin.formatter.removeQuickEdit();
64
+ });
65
  }
66
 
67
 
301
  plugin.save = function()
302
  {
303
  plugin.toggleLoading(true);
 
304
 
305
  $.ajax({
306
  url: NestedPages.jsData.ajaxurl,
307
  type: 'post',
308
  datatype: 'json',
309
+ data: $(plugin.form).find('form').serialize() + '&action=' + NestedPages.formActions.quickEditPost + '&nonce=' + NestedPages.jsData.nonce + '&syncmenu=' + NestedPages.jsData.syncmenu + '&post_type=' + NestedPages.jsData.posttype,
310
  success: function(data){
311
  if (data.status === 'error'){
312
  plugin.toggleLoading(false);
assets/js/lib/nestedpages.sync-menu-setting.js CHANGED
@@ -28,7 +28,12 @@ NestedPages.SyncMenuSetting = function()
28
  // Sync the "Sync menu" preference / setting
29
  plugin.syncSetting = function()
30
  {
31
- var setting = ( $(NestedPages.selectors.syncCheckbox).is(':checked') ) ? 'sync' : 'nosync';
 
 
 
 
 
32
  $.ajax({
33
  url: NestedPages.jsData.ajaxurl,
34
  type: 'post',
@@ -37,13 +42,13 @@ NestedPages.SyncMenuSetting = function()
37
  action : NestedPages.formActions.syncMenu,
38
  nonce : NestedPages.jsData.nonce,
39
  post_type : NestedPages.jsData.posttype,
40
- syncmenu : setting
41
  },
42
  success: function(data){
43
  if (data.status === 'error'){
44
  alert('There was an error saving the sync setting.')
45
  }
46
- }
47
  });
48
  }
49
 
28
  // Sync the "Sync menu" preference / setting
29
  plugin.syncSetting = function()
30
  {
31
+
32
+ if ( NestedPages.jsData.posttype !== 'page' ) return;
33
+ if ($(NestedPages.selectors.syncCheckbox).length === 0) return;
34
+
35
+ NestedPages.jsData.syncmenu = ( $(NestedPages.selectors.syncCheckbox).is(':checked') ) ? 'sync' : 'nosync';
36
+
37
  $.ajax({
38
  url: NestedPages.jsData.ajaxurl,
39
  type: 'post',
42
  action : NestedPages.formActions.syncMenu,
43
  nonce : NestedPages.jsData.nonce,
44
  post_type : NestedPages.jsData.posttype,
45
+ syncmenu : NestedPages.jsData.syncmenu
46
  },
47
  success: function(data){
48
  if (data.status === 'error'){
49
  alert('There was an error saving the sync setting.')
50
  }
51
+ },
52
  });
53
  }
54
 
assets/js/lib/nestedpages.tabs.js ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ var NestedPages = NestedPages || {};
2
+
3
+ /**
4
+ * Tab functionality
5
+ * @package Nested Pages
6
+ * @author Kyle Phillips - https://github.com/kylephillips/wp-nested-pages
7
+ */
8
+ NestedPages.Tabs = function()
9
+ {
10
+ var plugin = this;
11
+ var $ = jQuery;
12
+
13
+ plugin.activeContent = '';
14
+ plugin.activeButton = '';
15
+
16
+ plugin.init = function()
17
+ {
18
+ plugin.bindEvents();
19
+ }
20
+
21
+
22
+ plugin.bindEvents = function()
23
+ {
24
+ $(document).on('click', NestedPages.selectors.tabButton, function(e){
25
+ e.preventDefault();
26
+ plugin.activeButton = $(this);
27
+ plugin.toggleTabs();
28
+ });
29
+ }
30
+
31
+
32
+ plugin.toggleTabs = function()
33
+ {
34
+ plugin.activeContent = $(plugin.activeButton).attr('href');
35
+ $(NestedPages.selectors.tabContent).hide();
36
+ $(plugin.activeContent).show();
37
+ $(plugin.activeButton).parents(NestedPages.selectors.tabButtonParent).find(NestedPages.selectors.tabButton).removeClass('active');
38
+ $(plugin.activeButton).addClass('active');
39
+ }
40
+
41
+ return plugin.init();
42
+ }
assets/js/nestedpages.min.js CHANGED
@@ -398,8 +398,6 @@ NestedPages.Nesting = function()
398
  $(NestedPages.selectors.errorDiv).hide();
399
  $(NestedPages.selectors.loadingIndicator).show();
400
 
401
- var syncmenu = ( $(NestedPages.selectors.syncCheckbox).is(':checked') ) ? 'sync' : 'nosync';
402
-
403
  list = $(NestedPages.selectors.sortable).nestedSortable('toHierarchy', {startDepthCount: 0});
404
  plugin.disableNesting();
405
 
@@ -412,7 +410,7 @@ NestedPages.Nesting = function()
412
  nonce : NestedPages.jsData.nonce,
413
  list : list,
414
  post_type : NestedPages.jsData.posttype,
415
- syncmenu : syncmenu
416
  },
417
  success: function(data){
418
  plugin.initializeSortable();
@@ -457,7 +455,12 @@ NestedPages.SyncMenuSetting = function()
457
  // Sync the "Sync menu" preference / setting
458
  plugin.syncSetting = function()
459
  {
460
- var setting = ( $(NestedPages.selectors.syncCheckbox).is(':checked') ) ? 'sync' : 'nosync';
 
 
 
 
 
461
  $.ajax({
462
  url: NestedPages.jsData.ajaxurl,
463
  type: 'post',
@@ -466,13 +469,13 @@ NestedPages.SyncMenuSetting = function()
466
  action : NestedPages.formActions.syncMenu,
467
  nonce : NestedPages.jsData.nonce,
468
  post_type : NestedPages.jsData.posttype,
469
- syncmenu : setting
470
  },
471
  success: function(data){
472
  if (data.status === 'error'){
473
  alert('There was an error saving the sync setting.')
474
  }
475
- }
476
  });
477
  }
478
 
@@ -480,163 +483,6 @@ NestedPages.SyncMenuSetting = function()
480
  }
481
  var NestedPages = NestedPages || {};
482
 
483
- /**
484
- * Add a new Link (top level and child)
485
- * @package Nested Pages
486
- * @author Kyle Phillips - https://github.com/kylephillips/wp-nested-pages
487
- */
488
- NestedPages.NewLink = function()
489
- {
490
- var plugin = this;
491
- var $ = jQuery;
492
-
493
- plugin.postParent = 0; // Parent Post ID
494
- plugin.post = ''; // New Post Data
495
- plugin.row = ''; // Newly Appended Row
496
-
497
- plugin.formatter = new NestedPages.Formatter;
498
-
499
- plugin.init = function()
500
- {
501
- plugin.bindEvents();
502
- }
503
-
504
-
505
- plugin.bindEvents = function()
506
- {
507
- $(document).on('click', NestedPages.selectors.openLinkModal, function(e){
508
- e.preventDefault();
509
- plugin.postParent = $(this).attr('data-parentid');
510
- plugin.openModal();
511
- });
512
- $(document).on('click', NestedPages.selectors.saveLink, function(e){
513
- e.preventDefault();
514
- plugin.saveLink();
515
- });
516
- }
517
-
518
-
519
- // Open the Modal and Clear/Populate hidden fields
520
- plugin.openModal = function()
521
- {
522
- $(NestedPages.selectors.linkErrorDiv).hide();
523
- $(NestedPages.selectors.linkModal).find('input').val('');
524
- $(NestedPages.selectors.linkModal).find('.parent_id').val(plugin.postParent);
525
- $(NestedPages.selectors.linkModal).modal('show');
526
- }
527
-
528
-
529
- // Toggle the loading state in the link modal
530
- plugin.toggleLoading = function(loading)
531
- {
532
- if ( loading ){
533
- $(NestedPages.selectors.linkErrorDiv).hide();
534
- $(NestedPages.selectors.linkLoadingIndicator).show();
535
- $(NestedPages.selectors.saveLink).attr('disabled', 'disabled');
536
- return;
537
- }
538
- $(NestedPages.selectors.linkLoadingIndicator).hide();
539
- $(NestedPages.selectors.saveLink).attr('disabled', false);
540
- }
541
-
542
-
543
- // Save the link
544
- plugin.saveLink = function()
545
- {
546
- plugin.toggleLoading(true);
547
- var data = $(NestedPages.selectors.linkForm).serialize();
548
- var syncmenu = ( $(NestedPages.selectors.syncCheckbox).is(':checked') ) ? 'sync' : 'nosync';
549
-
550
- $.ajax({
551
- url: NestedPages.jsData.ajaxurl,
552
- type: 'POST',
553
- datatype: 'json',
554
- data: data + '&action=' + NestedPages.formActions.newLink + '&nonce=' + NestedPages.jsData.nonce + '&syncmenu=' + syncmenu + '&post_type=' + NestedPages.jsData.posttype,
555
- success: function(data){
556
- plugin.toggleLoading(false);
557
- if (data.status === 'error'){
558
- $(NestedPages.selectors.linkErrorDiv).text(data.message).show();
559
- return;
560
- }
561
- plugin.post = data.post_data;
562
- plugin.createRow();
563
- }
564
- });
565
- }
566
-
567
-
568
- // Create the nested pages row for the new link
569
- plugin.createRow = function()
570
- {
571
- var html = '<li id="menuItem_' + plugin.post.id + '" class="page-row';
572
- if ( plugin.post._status === 'publish' ) html += ' published';
573
- html += '">'
574
-
575
- html += '<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="' + plugin.post.np_link_content + '" class="page-link page-title" target="_blank"><span class="title">' + plugin.post.np_link_title + ' <i class="np-icon-link"></i></span>';
576
-
577
- // Post Status
578
- html += '<span class="status">';
579
- if ( plugin.post._status !== 'publish' ) html += plugin.post._status;
580
- html += '</span>';
581
-
582
- // Nested Pages Status
583
- if ( plugin.post.np_status === "hide" ) html += '<i class="np-icon-eye-blocked"></i>';
584
-
585
- // Nav Menu Status
586
- html += '<span class="nav-status">';
587
- if ( plugin.post.nav_status === "hide" ) html += '(' + NestedPages.jsData.hiddenText + ')';
588
- html += '</span>';
589
-
590
- // Quick Edit Button
591
- html += '</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" ';
592
- html += 'data-id="' + plugin.post.id + '"';
593
- html += 'data-parentid="' + plugin.post.parent_id + '"';
594
- html += 'data-title="' + plugin.post.np_link_title + '" ';
595
- html += 'data-url="' + plugin.post.np_link_content + '" ';
596
- html += 'data-status="' + plugin.post._status + '" ';
597
- html += 'data-np-status="' + plugin.post.np_status + '" ';
598
- html += 'data-navstatus="' + plugin.post.nav_status + '" ';
599
- html += 'data-linktarget="' + plugin.post.link_target + '">'
600
- html += NestedPages.jsData.quickEditText;
601
- html += '</a>';
602
-
603
- // Delete Link
604
- html += '<a href="' + plugin.post.delete_link + '" class="np-btn np-btn-trash"><i class="np-icon-remove"></i></a>';
605
-
606
- html += '</div></div></div></li>';
607
-
608
- if ( plugin.post.parent_id === "0" ){
609
- $('.nplist:first li:first').after(html);
610
- } else {
611
- plugin.appendChildRow(html);
612
- }
613
-
614
- $(NestedPages.selectors.linkModal).modal('hide');
615
-
616
- plugin.row = $('#menuItem_' + plugin.post.id).find('.row');
617
- plugin.formatter.flashRow(plugin.row);
618
- }
619
-
620
-
621
- // Append a new child link to the appropriate menu
622
- plugin.appendChildRow = function(html)
623
- {
624
- var parent_row = $('#menuItem_' + plugin.post.parent_id);
625
- if ( $(parent_row).children('ol').length === 0 ){
626
- html = '<ol class="sortable nplist" style="display:block;">' + html + '</ol>';
627
- $(parent_row).append(html);
628
- } else {
629
- $(parent_row).find('ol:first').prepend(html);
630
- }
631
- plugin.formatter.updateSubMenuToggle();
632
- }
633
-
634
-
635
- return plugin.init();
636
-
637
- }
638
- var NestedPages = NestedPages || {};
639
-
640
  /**
641
  * Add new page(s) - Top level & child
642
  * @package Nested Pages
@@ -768,13 +614,12 @@ NestedPages.NewPage = function()
768
  plugin.form = $(button).parents('form');
769
 
770
  var addedit = ( $(button).hasClass('add-edit') ) ? true : false;
771
- var syncmenu = ( $(NestedPages.selectors.syncCheckbox).is(':checked') ) ? 'sync' : 'nosync';
772
 
773
  $.ajax({
774
  url: NestedPages.jsData.ajaxurl,
775
  type: 'post',
776
  datatype: 'json',
777
- data: $(plugin.form).serialize() + '&action=' + NestedPages.formActions.newPage + '&nonce=' + NestedPages.jsData.nonce + '&syncmenu=' + syncmenu + '&post_type=' + NestedPages.jsData.posttype,
778
  success: function(data){
779
  if (data.status === 'error'){
780
  plugin.toggleLoading(false);
@@ -954,6 +799,9 @@ NestedPages.QuickEditPost = function()
954
  plugin.saveButton = $(this);
955
  plugin.save();
956
  });
 
 
 
957
  }
958
 
959
 
@@ -1193,13 +1041,12 @@ NestedPages.QuickEditPost = function()
1193
  plugin.save = function()
1194
  {
1195
  plugin.toggleLoading(true);
1196
- var syncmenu = ( $(NestedPages.selectors.syncCheckbox).is(':checked') ) ? 'sync' : 'nosync';
1197
 
1198
  $.ajax({
1199
  url: NestedPages.jsData.ajaxurl,
1200
  type: 'post',
1201
  datatype: 'json',
1202
- data: $(plugin.form).find('form').serialize() + '&action=' + NestedPages.formActions.quickEditPost + '&nonce=' + NestedPages.jsData.nonce + '&syncmenu=' + syncmenu + '&post_type=' + NestedPages.jsData.posttype,
1203
  success: function(data){
1204
  if (data.status === 'error'){
1205
  plugin.toggleLoading(false);
@@ -1431,6 +1278,9 @@ NestedPages.QuickEditLink = function()
1431
  e.preventDefault();
1432
  plugin.submitForm();
1433
  });
 
 
 
1434
  }
1435
 
1436
 
@@ -1456,7 +1306,12 @@ NestedPages.QuickEditLink = function()
1456
  linktarget : $(plugin.button).attr('data-linktarget'),
1457
  parentid : $(plugin.button).attr('data-parentid'),
1458
  navtitleattr : $(plugin.button).attr('data-navtitleattr'),
1459
- navcss : $(plugin.button).attr('data-navcss')
 
 
 
 
 
1460
  };
1461
  }
1462
 
@@ -1509,6 +1364,21 @@ NestedPages.QuickEditLink = function()
1509
  $(plugin.form).find('.link_target').removeAttr('checked');
1510
  }
1511
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1512
  plugin.formatter.showQuickEdit();
1513
  $(plugin.form).show();
1514
  }
@@ -1518,13 +1388,12 @@ NestedPages.QuickEditLink = function()
1518
  plugin.submitForm = function()
1519
  {
1520
  plugin.toggleLoading(true);
1521
- var syncmenu = ( $(NestedPages.selectors.syncCheckbox).is(':checked') ) ? 'sync' : 'nosync';
1522
 
1523
  $.ajax({
1524
  url: NestedPages.jsData.ajaxurl,
1525
  type: 'post',
1526
  datatype: 'json',
1527
- data: $(plugin.form).find('form').serialize() + '&action=' + NestedPages.formActions.quickEditLink + '&nonce=' + NestedPages.jsData.nonce + '&syncmenu=' + syncmenu + '&post_type=' + NestedPages.jsData.posttype,
1528
  success: function(data){
1529
  if (data.status === 'error'){
1530
  plugin.toggleLoading(false);
@@ -1546,11 +1415,12 @@ NestedPages.QuickEditLink = function()
1546
  // Update the row after successfully saving quick edit data
1547
  plugin.updateRow = function()
1548
  {
 
1549
  var row = $(plugin.form).siblings('.row');
1550
  $(row).find('.title').html(plugin.newPostData.post_title + ' <i class="np-icon-link"></i>');
1551
 
1552
  var status = $(row).find('.status');
1553
- if ( (plugin.newPostData._status !== 'publish') && (data._status !== 'future') ){
1554
  $(status).text('(' + plugin.newPostData._status + ')');
1555
  } else {
1556
  $(status).text('');
@@ -1582,9 +1452,9 @@ NestedPages.QuickEditLink = function()
1582
  $(button).attr('data-status', plugin.newPostData._status);
1583
  $(button).attr('data-navstatus', plugin.newPostData.nav_status);
1584
  $(button).attr('data-np-status', plugin.newPostData.np_status);
1585
- $(button).attr('data-linktarget', plugin.newPostData.link_target);
1586
- $(button).attr('data-navtitleattr', plugin.newPostData.np_title_attribute);
1587
- $(button).attr('data-navcss', plugin.newPostData.np_nav_css_classes);
1588
 
1589
  plugin.formatter.removeQuickEdit();
1590
  plugin.formatter.flashRow(row);
@@ -1695,6 +1565,48 @@ NestedPages.Clone = function()
1695
 
1696
  return plugin.init();
1697
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1698
  /**
1699
  * Primary Nested Pages Initialization
1700
  * @package Nested Pages
@@ -1775,6 +1687,11 @@ NestedPages.selectors = {
1775
  cloneQuantity : '[data-clone-quantity]', // Quantity to Clone
1776
  cloneStatus : '[data-clone-status]', // Clone Status
1777
  cloneAuthor : '[data-clone-author]', // Clone Author
 
 
 
 
 
1778
  }
1779
 
1780
 
@@ -1791,6 +1708,7 @@ NestedPages.jsData = {
1791
  ajaxurl : ajaxurl,
1792
  nonce : nestedpages.np_nonce,
1793
  allPostTypes : nestedpages.post_types, // Localized data with all post types
 
1794
  posttype : '', // current Screen's post type
1795
  nestable : true, // boolean - whether post type is nestable
1796
  hierarchical : true, // boolean - whether post type is hierarchical
@@ -1809,12 +1727,13 @@ NestedPages.formActions = {
1809
  syncToggles : 'npnestToggle',
1810
  syncNesting : 'npsort',
1811
  syncMenu : 'npsyncMenu',
1812
- newLink : 'npnewLink',
1813
  newPage : 'npnewChild',
1814
  quickEditLink : 'npquickEditLink',
1815
  getTaxonomies : 'npgetTaxonomies',
1816
  quickEditPost : 'npquickEdit',
1817
- clonePost : 'npclonePost'
 
 
1818
  }
1819
 
1820
 
@@ -1832,16 +1751,18 @@ NestedPages.Factory = function()
1832
  plugin.pageToggle = new NestedPages.PageToggle;
1833
  plugin.nesting = new NestedPages.Nesting;
1834
  plugin.syncMenuSetting = new NestedPages.SyncMenuSetting;
1835
- plugin.newLink = new NestedPages.NewLink;
1836
  plugin.newPage = new NestedPages.NewPage;
1837
  plugin.quickEditLink = new NestedPages.QuickEditLink;
1838
  plugin.quickEditPost = new NestedPages.QuickEditPost;
1839
  plugin.clone = new NestedPages.Clone;
 
 
1840
 
1841
  plugin.init = function()
1842
  {
1843
  plugin.bindEvents();
1844
  plugin.setPostType();
 
1845
  plugin.setNestable();
1846
  plugin.formatter.updateSubMenuToggle();
1847
  plugin.formatter.setBorders();
@@ -1880,6 +1801,416 @@ NestedPages.Factory = function()
1880
  }
1881
 
1882
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1883
  return plugin.init();
1884
  }
1885
  /**
398
  $(NestedPages.selectors.errorDiv).hide();
399
  $(NestedPages.selectors.loadingIndicator).show();
400
 
 
 
401
  list = $(NestedPages.selectors.sortable).nestedSortable('toHierarchy', {startDepthCount: 0});
402
  plugin.disableNesting();
403
 
410
  nonce : NestedPages.jsData.nonce,
411
  list : list,
412
  post_type : NestedPages.jsData.posttype,
413
+ syncmenu : NestedPages.jsData.syncmenu
414
  },
415
  success: function(data){
416
  plugin.initializeSortable();
455
  // Sync the "Sync menu" preference / setting
456
  plugin.syncSetting = function()
457
  {
458
+
459
+ if ( NestedPages.jsData.posttype !== 'page' ) return;
460
+ if ($(NestedPages.selectors.syncCheckbox).length === 0) return;
461
+
462
+ NestedPages.jsData.syncmenu = ( $(NestedPages.selectors.syncCheckbox).is(':checked') ) ? 'sync' : 'nosync';
463
+
464
  $.ajax({
465
  url: NestedPages.jsData.ajaxurl,
466
  type: 'post',
469
  action : NestedPages.formActions.syncMenu,
470
  nonce : NestedPages.jsData.nonce,
471
  post_type : NestedPages.jsData.posttype,
472
+ syncmenu : NestedPages.jsData.syncmenu
473
  },
474
  success: function(data){
475
  if (data.status === 'error'){
476
  alert('There was an error saving the sync setting.')
477
  }
478
+ },
479
  });
480
  }
481
 
483
  }
484
  var NestedPages = NestedPages || {};
485
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
486
  /**
487
  * Add new page(s) - Top level & child
488
  * @package Nested Pages
614
  plugin.form = $(button).parents('form');
615
 
616
  var addedit = ( $(button).hasClass('add-edit') ) ? true : false;
 
617
 
618
  $.ajax({
619
  url: NestedPages.jsData.ajaxurl,
620
  type: 'post',
621
  datatype: 'json',
622
+ data: $(plugin.form).serialize() + '&action=' + NestedPages.formActions.newPage + '&nonce=' + NestedPages.jsData.nonce + '&syncmenu=' + NestedPages.jsData.syncmenu + '&post_type=' + NestedPages.jsData.posttype,
623
  success: function(data){
624
  if (data.status === 'error'){
625
  plugin.toggleLoading(false);
799
  plugin.saveButton = $(this);
800
  plugin.save();
801
  });
802
+ $(document).on('keydown', function(e){
803
+ if ( e.keyCode === 27 ) plugin.formatter.removeQuickEdit();
804
+ });
805
  }
806
 
807
 
1041
  plugin.save = function()
1042
  {
1043
  plugin.toggleLoading(true);
 
1044
 
1045
  $.ajax({
1046
  url: NestedPages.jsData.ajaxurl,
1047
  type: 'post',
1048
  datatype: 'json',
1049
+ data: $(plugin.form).find('form').serialize() + '&action=' + NestedPages.formActions.quickEditPost + '&nonce=' + NestedPages.jsData.nonce + '&syncmenu=' + NestedPages.jsData.syncmenu + '&post_type=' + NestedPages.jsData.posttype,
1050
  success: function(data){
1051
  if (data.status === 'error'){
1052
  plugin.toggleLoading(false);
1278
  e.preventDefault();
1279
  plugin.submitForm();
1280
  });
1281
+ $(document).on('keydown', function(e){
1282
+ if ( e.keyCode === 27 ) plugin.formatter.removeQuickEdit();
1283
+ });
1284
  }
1285
 
1286
 
1306
  linktarget : $(plugin.button).attr('data-linktarget'),
1307
  parentid : $(plugin.button).attr('data-parentid'),
1308
  navtitleattr : $(plugin.button).attr('data-navtitleattr'),
1309
+ navcss : $(plugin.button).attr('data-navcss'),
1310
+ navtype : $(plugin.button).attr('data-nav-type'),
1311
+ navobject : $(plugin.button).attr('data-nav-object'),
1312
+ navobjectid : $(plugin.button).attr('data-nav-object-id'),
1313
+ navoriginallink : $(plugin.button).attr('data-nav-original-link'),
1314
+ navoriginaltitle : $(plugin.button).attr('data-nav-original-title')
1315
  };
1316
  }
1317
 
1364
  $(plugin.form).find('.link_target').removeAttr('checked');
1365
  }
1366
 
1367
+ // Relationship Links
1368
+ if ( plugin.postData.navobject !== 'custom' && plugin.postData.navobject !== '' ){
1369
+ var html = '<div class="form-control original-link">Original: <a href="' + plugin.postData.navoriginallink + '" target="_blank">' + plugin.postData.navoriginaltitle + '</a></div>';
1370
+ $(plugin.form).find('[data-url-field]').remove();
1371
+ $(html).insertAfter($(plugin.form).find('h3'));
1372
+ $(plugin.form).find('[data-np-menu-object-input]').val(plugin.postData.navobject);
1373
+ $(plugin.form).find('[data-np-menu-objectid-input]').val(plugin.postData.navobjectid);
1374
+ $(plugin.form).find('[data-np-menu-type-input]').val(plugin.postData.navtype);
1375
+ $(plugin.form).find('h3').text('Link: ' + plugin.postData.navoriginaltitle);
1376
+ } else {
1377
+ $(plugin.form).find('h3').text('Link');
1378
+ $(plugin.form).find('[data-np-menu-object-input]').val('custom');
1379
+ $(plugin.form).find('[data-np-menu-type-input]').val('custom');
1380
+ }
1381
+
1382
  plugin.formatter.showQuickEdit();
1383
  $(plugin.form).show();
1384
  }
1388
  plugin.submitForm = function()
1389
  {
1390
  plugin.toggleLoading(true);
 
1391
 
1392
  $.ajax({
1393
  url: NestedPages.jsData.ajaxurl,
1394
  type: 'post',
1395
  datatype: 'json',
1396
+ data: $(plugin.form).find('form').serialize() + '&action=' + NestedPages.formActions.quickEditLink + '&nonce=' + NestedPages.jsData.nonce + '&syncmenu=' + NestedPages.jsData.syncmenu + '&post_type=' + NestedPages.jsData.posttype,
1397
  success: function(data){
1398
  if (data.status === 'error'){
1399
  plugin.toggleLoading(false);
1415
  // Update the row after successfully saving quick edit data
1416
  plugin.updateRow = function()
1417
  {
1418
+ console.log(plugin.newPostData);
1419
  var row = $(plugin.form).siblings('.row');
1420
  $(row).find('.title').html(plugin.newPostData.post_title + ' <i class="np-icon-link"></i>');
1421
 
1422
  var status = $(row).find('.status');
1423
+ if ( (plugin.newPostData._status !== 'publish') && (plugin.newPostData._status !== 'future') ){
1424
  $(status).text('(' + plugin.newPostData._status + ')');
1425
  } else {
1426
  $(status).text('');
1452
  $(button).attr('data-status', plugin.newPostData._status);
1453
  $(button).attr('data-navstatus', plugin.newPostData.nav_status);
1454
  $(button).attr('data-np-status', plugin.newPostData.np_status);
1455
+ $(button).attr('data-linkTarget', plugin.newPostData.linkTarget);
1456
+ $(button).attr('data-navtitleattr', plugin.newPostData.titleAttribute);
1457
+ $(button).attr('data-navcss', plugin.newPostData.cssClasses);
1458
 
1459
  plugin.formatter.removeQuickEdit();
1460
  plugin.formatter.flashRow(row);
1565
 
1566
  return plugin.init();
1567
  }
1568
+ var NestedPages = NestedPages || {};
1569
+
1570
+ /**
1571
+ * Tab functionality
1572
+ * @package Nested Pages
1573
+ * @author Kyle Phillips - https://github.com/kylephillips/wp-nested-pages
1574
+ */
1575
+ NestedPages.Tabs = function()
1576
+ {
1577
+ var plugin = this;
1578
+ var $ = jQuery;
1579
+
1580
+ plugin.activeContent = '';
1581
+ plugin.activeButton = '';
1582
+
1583
+ plugin.init = function()
1584
+ {
1585
+ plugin.bindEvents();
1586
+ }
1587
+
1588
+
1589
+ plugin.bindEvents = function()
1590
+ {
1591
+ $(document).on('click', NestedPages.selectors.tabButton, function(e){
1592
+ e.preventDefault();
1593
+ plugin.activeButton = $(this);
1594
+ plugin.toggleTabs();
1595
+ });
1596
+ }
1597
+
1598
+
1599
+ plugin.toggleTabs = function()
1600
+ {
1601
+ plugin.activeContent = $(plugin.activeButton).attr('href');
1602
+ $(NestedPages.selectors.tabContent).hide();
1603
+ $(plugin.activeContent).show();
1604
+ $(plugin.activeButton).parents(NestedPages.selectors.tabButtonParent).find(NestedPages.selectors.tabButton).removeClass('active');
1605
+ $(plugin.activeButton).addClass('active');
1606
+ }
1607
+
1608
+ return plugin.init();
1609
+ }
1610
  /**
1611
  * Primary Nested Pages Initialization
1612
  * @package Nested Pages
1687
  cloneQuantity : '[data-clone-quantity]', // Quantity to Clone
1688
  cloneStatus : '[data-clone-status]', // Clone Status
1689
  cloneAuthor : '[data-clone-author]', // Clone Author
1690
+
1691
+ // Tabs
1692
+ tabButtonParent : '[data-np-tabs]', // Tab Parent
1693
+ tabButton : '[data-np-tab]', // Tab Link
1694
+ tabContent : '[data-np-tab-pane]', // Tab Pane
1695
  }
1696
 
1697
 
1708
  ajaxurl : ajaxurl,
1709
  nonce : nestedpages.np_nonce,
1710
  allPostTypes : nestedpages.post_types, // Localized data with all post types
1711
+ syncmenu : 'nosync', // Whether to sync the menu
1712
  posttype : '', // current Screen's post type
1713
  nestable : true, // boolean - whether post type is nestable
1714
  hierarchical : true, // boolean - whether post type is hierarchical
1727
  syncToggles : 'npnestToggle',
1728
  syncNesting : 'npsort',
1729
  syncMenu : 'npsyncMenu',
 
1730
  newPage : 'npnewChild',
1731
  quickEditLink : 'npquickEditLink',
1732
  getTaxonomies : 'npgetTaxonomies',
1733
  quickEditPost : 'npquickEdit',
1734
+ clonePost : 'npclonePost',
1735
+ search : 'npmenuSearch',
1736
+ newMenuItem : 'npnewMenuItem'
1737
  }
1738
 
1739
 
1751
  plugin.pageToggle = new NestedPages.PageToggle;
1752
  plugin.nesting = new NestedPages.Nesting;
1753
  plugin.syncMenuSetting = new NestedPages.SyncMenuSetting;
 
1754
  plugin.newPage = new NestedPages.NewPage;
1755
  plugin.quickEditLink = new NestedPages.QuickEditLink;
1756
  plugin.quickEditPost = new NestedPages.QuickEditPost;
1757
  plugin.clone = new NestedPages.Clone;
1758
+ plugin.tabs = new NestedPages.Tabs;
1759
+ plugin.menuLinks = new NestedPages.MenuLinks;
1760
 
1761
  plugin.init = function()
1762
  {
1763
  plugin.bindEvents();
1764
  plugin.setPostType();
1765
+ plugin.setMenuSync();
1766
  plugin.setNestable();
1767
  plugin.formatter.updateSubMenuToggle();
1768
  plugin.formatter.setBorders();
1801
  }
1802
 
1803
 
1804
+ // Set menu sync
1805
+ plugin.setMenuSync = function()
1806
+ {
1807
+ NestedPages.jsData.syncmenu = ( nestedpages.syncmenu === '1' ) ? 'sync' : 'nosync';
1808
+ }
1809
+
1810
+
1811
+ return plugin.init();
1812
+ }
1813
+ var NestedPages = NestedPages || {};
1814
+
1815
+ /**
1816
+ * Menu Item Selection in Modal Link Form
1817
+ * @package Nested Pages
1818
+ * @author Kyle Phillips - https://github.com/kylephillips/wp-nested-pages
1819
+ */
1820
+ NestedPages.MenuLinks = function()
1821
+ {
1822
+ var plugin = this;
1823
+ var $ = jQuery;
1824
+
1825
+ plugin.typeButton = ''; // The Link Type selected button
1826
+ plugin.post = ''; // The new post created
1827
+
1828
+ plugin.formatter = new NestedPages.Formatter;
1829
+
1830
+ plugin.selectors = {
1831
+ form : '[data-np-menu-item-form]', // The form element
1832
+ typeSelect : '[data-np-menu-selection]', // Link in left column to choose type of link
1833
+ accordion : '[data-np-menu-accordion]', // Accordion of objects
1834
+ accordionItem : '[data-np-menu-accordion-item]', // Single item in the accordion
1835
+ formPlaceholder : '.np-menu-link-object-placeholder', // Placeholder element
1836
+ formDetails : '.np-menu-link-details', // Right pane form details
1837
+ searchResults : '[data-np-search-result]', // Appended search result rows
1838
+ defaultResults : '[data-default-result]', // Default results,
1839
+ originalLink : '[data-np-original-link]', // Original Link Preview
1840
+ saveButton : '[data-np-save-link]', // The Form Submit Button
1841
+ urlInputCont : '[data-np-menu-url-cont]', // Container for URL input (only for custom links)
1842
+ errorDiv : '[data-np-error]', // The error notification
1843
+ }
1844
+
1845
+ plugin.fields = {
1846
+ object : '[data-np-menu-object-input]', // The object (ex: post/category/custom)
1847
+ objectid : '[data-np-menu-objectid-input]', // ex: term id, post id
1848
+ itemType : '[data-np-menu-type-input]', // ex: post_type, taxonomy
1849
+ url : '[data-np-menu-url]', // custom url
1850
+ navigationLabel : '[data-np-menu-navigation-label]',
1851
+ titleAttribute : '[data-np-menu-title-attr]',
1852
+ cssClasses : '[data-np-menu-css-classes]',
1853
+ npStatus : '[data-np-menu-np-status]',
1854
+ linkTarget : '[data-np-menu-link-target]',
1855
+ menuTitle : '[data-np-menu-title]'
1856
+ }
1857
+
1858
+ plugin.search = new NestedPages.MenuSearch;
1859
+
1860
+ plugin.init = function()
1861
+ {
1862
+ plugin.bindEvents();
1863
+ }
1864
+
1865
+ plugin.bindEvents = function()
1866
+ {
1867
+ $(document).on('click', NestedPages.selectors.openLinkModal, function(e){
1868
+ e.preventDefault();
1869
+ plugin.postParent = $(this).attr('data-parentid');
1870
+ $(plugin.selectors.form).find('.parent_id').val($(this).attr('data-parentid'));
1871
+ plugin.openModal();
1872
+ });
1873
+ $(document).on('click', plugin.selectors.accordionItem, function(e){
1874
+ e.preventDefault();
1875
+ plugin.accordion($(this));
1876
+ });
1877
+ $(document).on('click', plugin.selectors.typeSelect, function(e){
1878
+ e.preventDefault();
1879
+ plugin.typeButton = $(this);
1880
+ plugin.setLinkType();
1881
+ });
1882
+ $(document).on('keyup', plugin.fields.navigationLabel, function(){
1883
+ plugin.updateTitle();
1884
+ });
1885
+ $(document).on('click', plugin.selectors.saveButton, function(e){
1886
+ e.preventDefault();
1887
+ plugin.submitForm();
1888
+ });
1889
+ $(document).on('keydown', function(e){
1890
+ if ( e.keyCode === 27 ) $('#np-link-modal').modal('hide');
1891
+ });
1892
+ }
1893
+
1894
+ // Open the Modal and Clear/Populate hidden fields
1895
+ plugin.openModal = function()
1896
+ {
1897
+ $(NestedPages.selectors.linkErrorDiv).hide();
1898
+ $(NestedPages.selectors.linkModal).find('input').val('');
1899
+ $(NestedPages.selectors.linkModal).find('.parent_id').val(plugin.postParent);
1900
+ plugin.clearForm();
1901
+ $(plugin.selectors.accordion).find('ul').hide();
1902
+ $(plugin.selectors.typeSelect).removeClass('active');
1903
+ $(NestedPages.selectors.linkModal).modal('show');
1904
+ }
1905
+
1906
+ // Accordion Menu
1907
+ plugin.accordion = function(button)
1908
+ {
1909
+ plugin.clearForm();
1910
+ var submenu = $(button).siblings('ul');
1911
+ if ( $(submenu).is(':visible') ){
1912
+ $(button).removeClass('active');
1913
+ $(submenu).slideUp('fast');
1914
+ return;
1915
+ }
1916
+ $(plugin.selectors.accordionItem).removeClass('active');
1917
+ $(button).addClass('active');
1918
+ $(button).parents(plugin.selectors.accordion).find('ul').slideUp('fast');
1919
+ $(submenu).slideDown('fast');
1920
+ }
1921
+
1922
+ // Set the link type
1923
+ plugin.setLinkType = function()
1924
+ {
1925
+ if ( $(plugin.typeButton).hasClass('active') ){
1926
+ plugin.clearForm();
1927
+ return;
1928
+ }
1929
+ if ( $(plugin.typeButton).hasClass('np-custom-link') ){
1930
+ $(plugin.selectors.accordionItem).removeClass('active');
1931
+ $(plugin.selectors.accordion).find('ul').slideUp('fast');
1932
+ }
1933
+ $(plugin.selectors.formPlaceholder).hide();
1934
+ plugin.populateForm();
1935
+ }
1936
+
1937
+ // Populate the form
1938
+ plugin.populateForm = function()
1939
+ {
1940
+ $(plugin.selectors.saveButton).show();
1941
+ $(plugin.selectors.typeSelect).removeClass('active');
1942
+ $(plugin.typeButton).addClass('active');
1943
+ $(plugin.fields.menuTitle).text($(plugin.typeButton).text()).val($(plugin.typeButton).text());
1944
+ $(plugin.selectors.form).find('h3').find('em').text($(plugin.typeButton).attr('data-np-object-name'));
1945
+ if ( $(plugin.typeButton).attr('data-np-permalink') !== "" ){
1946
+ $(plugin.selectors.form).find(plugin.selectors.urlInputCont).hide();
1947
+ $(plugin.selectors.form).find(plugin.selectors.originalLink).html('<a href="' + $(plugin.typeButton).attr('data-np-permalink') + '">' + $(plugin.typeButton).text() + '</a>');
1948
+ $(plugin.selectors.form).find(plugin.selectors.originalLink).parent('.original-link').show();
1949
+ } else {
1950
+ $(plugin.selectors.form).find(plugin.selectors.urlInputCont).show();
1951
+ $(plugin.selectors.form).find(plugin.selectors.originalLink).parent('.original-link').hide();
1952
+ }
1953
+ $(plugin.fields.object).val($(plugin.typeButton).attr('data-np-menu-object'));
1954
+ $(plugin.fields.objectid).val($(plugin.typeButton).attr('data-np-menu-objectid'));
1955
+ $(plugin.fields.itemType).val($(plugin.typeButton).attr('data-np-menu-type'));
1956
+ $(plugin.selectors.formDetails).show();
1957
+ }
1958
+
1959
+ // Clear the form
1960
+ plugin.clearForm = function()
1961
+ {
1962
+ $(plugin.selectors.form).find(plugin.selectors.errorDiv).hide();
1963
+ $(plugin.selectors.saveButton).hide();
1964
+ $(plugin.selectors.formDetails).hide();
1965
+ $(plugin.selectors.formPlaceholder).show();
1966
+ $(plugin.selectors.form).find('input').not('.parent_id').val('');
1967
+ $(plugin.selectors.form).find(plugin.fields.linkTarget).val('_blank');
1968
+ $(plugin.selectors.form).find('input[type="checkbox"]').attr('checked', false);
1969
+ $(plugin.selectors.typeSelect).removeClass('active');
1970
+ plugin.search.toggleLoading(false);
1971
+ $(plugin.selectors.searchResults).remove();
1972
+ $(plugin.selectors.defaultResults).show();
1973
+ }
1974
+
1975
+ // Update the title text
1976
+ plugin.updateTitle = function()
1977
+ {
1978
+ var value = $(plugin.fields.navigationLabel).val();
1979
+ var title = $(plugin.selectors.form).find('h3').find('span');
1980
+ if ( value !== "" ){
1981
+ $(plugin.fields.menuTitle).val(value);
1982
+ $(title).text(value);
1983
+ } else {
1984
+ $(plugin.fields.menuTitle).val($(plugin.typeButton).text());
1985
+ $(title).text($(plugin.typeButton).text());
1986
+ }
1987
+ }
1988
+
1989
+ // Submit the Form
1990
+ plugin.submitForm = function()
1991
+ {
1992
+ plugin.toggleLoading(true);
1993
+ $.ajax({
1994
+ url : NestedPages.jsData.ajaxurl,
1995
+ type : 'post',
1996
+ data: $(plugin.selectors.form).serialize() + '&action=' + NestedPages.formActions.newMenuItem + '&nonce=' + NestedPages.jsData.nonce + '&post_type=' + NestedPages.jsData.posttype + '&syncmenu=' + NestedPages.jsData.syncmenu,
1997
+ success : function(data){
1998
+ plugin.toggleLoading(false);
1999
+ if ( data.status === 'error' ){
2000
+ $(plugin.selectors.form).find(plugin.selectors.errorDiv).text(data.message).show();
2001
+ return;
2002
+ }
2003
+ plugin.post = data.post_data;
2004
+ plugin.createRow();
2005
+ },
2006
+ error : function(data){
2007
+ console.log(data);
2008
+ }
2009
+ });
2010
+ }
2011
+
2012
+ // Create the nested pages row for the new link
2013
+ plugin.createRow = function()
2014
+ {
2015
+ var html = '<li id="menuItem_' + plugin.post.id + '" class="page-row published';
2016
+ html += '">'
2017
+
2018
+ html += '<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="' + plugin.post.np_link_content + '" class="page-link page-title" target="_blank"><span class="title">' + plugin.post.menuTitle + ' <i class="np-icon-link"></i></span>';
2019
+
2020
+ // Quick Edit Button
2021
+ html += '</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" ';
2022
+ html += 'data-id="' + plugin.post.id + '"';
2023
+ html += 'data-parentid="' + plugin.post.parent_id + '"';
2024
+ html += 'data-title="' + plugin.post.menuTitle + '" ';
2025
+ html += 'data-url="' + plugin.post.url + '" ';
2026
+ html += 'data-status="publish" ';
2027
+ html += 'data-np-status="show" ';
2028
+ html += 'data-navstatus="show" ';
2029
+ html += 'data-navcss="' + plugin.post.cssClasses + '" ';
2030
+ html += 'data-navtitleattr="' + plugin.post.titleAttribute + '" ';
2031
+ html += 'data-nav-type="' + plugin.post.menuType + '" ';
2032
+ html += 'data-nav-object="' + plugin.post.objectType + '" ';
2033
+ html += 'data-nav-object-id="' + plugin.post.objectId + '" ';
2034
+ html += 'data-nav-original-link="' + plugin.post.original_link + '" ';
2035
+ html += 'data-nav-original-title="' + plugin.post.original_title + '" ';
2036
+ html += 'data-linktarget="' + plugin.post.link_target + '">';
2037
+ html += NestedPages.jsData.quickEditText;
2038
+ html += '</a>';
2039
+
2040
+ // Delete Link
2041
+ html += '<a href="' + plugin.post.delete_link + '" class="np-btn np-btn-trash"><i class="np-icon-remove"></i></a>';
2042
+
2043
+ html += '</div></div></div></li>';
2044
+
2045
+ if ( plugin.post.parent_id === "0" ){
2046
+ $('.nplist:first li:first').after(html);
2047
+ } else {
2048
+ plugin.appendChildRow(html);
2049
+ }
2050
+
2051
+ $(NestedPages.selectors.linkModal).modal('hide');
2052
+
2053
+ plugin.row = $('#menuItem_' + plugin.post.id).find('.row');
2054
+ plugin.formatter.flashRow(plugin.row);
2055
+ }
2056
+
2057
+ // Append a new child link to the appropriate menu
2058
+ plugin.appendChildRow = function(html)
2059
+ {
2060
+ var parent_row = $('#menuItem_' + plugin.post.parent_id);
2061
+ if ( $(parent_row).children('ol').length === 0 ){
2062
+ html = '<ol class="sortable nplist" style="display:block;">' + html + '</ol>';
2063
+ $(parent_row).append(html);
2064
+ } else {
2065
+ $(parent_row).find('ol:first').prepend(html);
2066
+ }
2067
+ plugin.formatter.updateSubMenuToggle();
2068
+ }
2069
+
2070
+ // Toggle Loading
2071
+ plugin.toggleLoading = function(loading)
2072
+ {
2073
+ if ( loading ){
2074
+ $(plugin.selectors.form).find(plugin.selectors.errorDiv).hide();
2075
+ $(plugin.selectors.form).find(NestedPages.selectors.quickEditLoadingIndicator).show();
2076
+ $(plugin.selectors.saveButton).attr('disabled', 'disabled');
2077
+ return;
2078
+ }
2079
+ $(plugin.selectors.form).find(NestedPages.selectors.quickEditLoadingIndicator).hide();
2080
+ $(plugin.selectors.saveButton).attr('disabled', false);
2081
+ }
2082
+
2083
+ return plugin.init();
2084
+ }
2085
+ var NestedPages = NestedPages || {};
2086
+
2087
+ /**
2088
+ * Menu Item Search in Modal Link Form
2089
+ * @package Nested Pages
2090
+ * @author Kyle Phillips - https://github.com/kylephillips/wp-nested-pages
2091
+ */
2092
+ NestedPages.MenuSearch = function()
2093
+ {
2094
+ var plugin = this;
2095
+ var $ = jQuery;
2096
+
2097
+ plugin.selectors = {
2098
+ searchForms : '*[data-np-menu-search]', // Search form selector
2099
+ defaultResults : '[data-default-result]', // Default results list items
2100
+ loadingIndicator : '.np-menu-search-loading', // loading indicator
2101
+ noResults : '.np-menu-search-noresults', // No results
2102
+ searchType : 'data-search-type', // The search object type (post_type, taxonomy)
2103
+ searchObject : 'data-search-object', // The object to search (post, category, etc)
2104
+ searchResults : '[data-np-search-result]', // Appended search result rows
2105
+ }
2106
+
2107
+ plugin.activeForm = ''; // The active form
2108
+ plugin.results = ''; // Search results
2109
+ plugin.defaultResults = ''; // The default, loaded results
2110
+ plugin.searchType = ''; // The type of search (post_type, taxonomy)
2111
+ plugin.searchObject = ''; // The object being searched (post, category, post_tag, etc…)
2112
+
2113
+ plugin.init = function()
2114
+ {
2115
+ plugin.bindEvents();
2116
+ }
2117
+
2118
+ plugin.bindEvents = function()
2119
+ {
2120
+ $(document).on('keyup', plugin.selectors.searchForms, function(){
2121
+ plugin.activeForm = $(this);
2122
+ $(plugin.selectors.searchResults).remove();
2123
+ plugin.performSearch();
2124
+ });
2125
+ }
2126
+
2127
+
2128
+ // Perform the search
2129
+ plugin.performSearch = function()
2130
+ {
2131
+ plugin.defaultResults = $(plugin.activeForm).parent('li').siblings(plugin.selectors.defaultResults);
2132
+ if ( $(plugin.activeForm).val().length > 2 ){
2133
+ $(plugin.defaultResults).hide();
2134
+ plugin.toggleLoading(true);
2135
+ plugin.query();
2136
+ return;
2137
+ }
2138
+ plugin.toggleLoading(false);
2139
+ $(plugin.defaultResults).show();
2140
+ }
2141
+
2142
+
2143
+ // Query Search
2144
+ plugin.query = function()
2145
+ {
2146
+ plugin.searchType = $(plugin.activeForm).attr(plugin.selectors.searchType);
2147
+ plugin.searchObject = $(plugin.activeForm).attr(plugin.selectors.searchObject);
2148
+ $.ajax({
2149
+ url: NestedPages.jsData.ajaxurl,
2150
+ type: 'post',
2151
+ datatype: 'json',
2152
+ data: {
2153
+ action : NestedPages.formActions.search,
2154
+ nonce : NestedPages.jsData.nonce,
2155
+ term : $(plugin.activeForm).val(),
2156
+ searchType : plugin.searchType,
2157
+ searchObject : plugin.searchObject,
2158
+ },
2159
+ success: function(data){
2160
+ console.log(data);
2161
+ if ( data.results ){
2162
+ plugin.results = data.results;
2163
+ plugin.toggleLoading(false);
2164
+ if ( plugin.searchType === 'post_type' ){
2165
+ plugin.appendPosts();
2166
+ } else {
2167
+ plugin.appendTaxonomies();
2168
+ }
2169
+ } else {
2170
+ plugin.toggleLoading(false);
2171
+ $(plugin.activeForm).siblings(plugin.selectors.noResults).show();
2172
+ }
2173
+ }
2174
+ });
2175
+ }
2176
+
2177
+
2178
+ // Append post type results
2179
+ plugin.appendPosts = function()
2180
+ {
2181
+ var html = "";
2182
+ $.each(plugin.results, function(i, v){
2183
+ html += '<li data-np-search-result><a href="#" data-np-menu-object="' + plugin.searchObject + '" data-np-menu-type="post_type" data-np-menu-objectid="' + v.ID + '" data-np-permalink="' + v.permalink + '" data-np-object-name="' + v.singular_name + '" data-np-menu-selection>' + v.post_title + '</a></li>';
2184
+ });
2185
+ $(html).insertAfter($(plugin.activeForm).parent('li'));
2186
+ plugin.toggleLoading(false);
2187
+ }
2188
+
2189
+
2190
+ // Append taxonomy results
2191
+ plugin.appendTaxonomies = function()
2192
+ {
2193
+ var html = "";
2194
+ $.each(plugin.results, function(i, v){
2195
+ html += '<li data-np-search-result><a href="#" data-np-menu-object="' + plugin.searchObject + '" data-np-menu-type="post_type" data-np-menu-objectid="' + v.term_id + '" data-np-permalink="' + v.permalink + '" data-np-object-name="' + v.taxonomy + '" data-np-menu-selection>' + v.name + '</a></li>';
2196
+ });
2197
+ $(html).insertAfter($(plugin.activeForm).parent('li'));
2198
+ plugin.toggleLoading(false);
2199
+ }
2200
+
2201
+
2202
+ // Toggle the loading indicator
2203
+ plugin.toggleLoading = function(loading)
2204
+ {
2205
+ var loadingIndicator = $(plugin.activeForm).siblings(plugin.selectors.loadingIndicator);
2206
+ $(plugin.selectors.noResults).hide();
2207
+ if ( loading ){
2208
+ $(loadingIndicator).show();
2209
+ return;
2210
+ }
2211
+ $(loadingIndicator).hide();
2212
+ }
2213
+
2214
  return plugin.init();
2215
  }
2216
  /**
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: 2015-08-15 11:02-0500\n"
5
- "PO-Revision-Date: 2015-08-15 11:02-0500\n"
6
  "Last-Translator: \n"
7
  "Language-Team: \n"
8
  "MIME-Version: 1.0\n"
@@ -16,89 +16,90 @@ msgstr ""
16
  "_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
17
  "X-Poedit-SearchPath-0: .\n"
18
 
19
- #: app/Activation/Dependencies.php:107 app/Views/listing.php:29
20
  msgid "Expand All"
21
  msgstr ""
22
 
23
- #: app/Activation/Dependencies.php:108
24
  msgid "Collapse All"
25
  msgstr ""
26
 
27
- #: app/Activation/Dependencies.php:109 app/Views/partials/tool-list.php:18
28
  msgid "Show Hidden"
29
  msgstr ""
30
 
31
- #: app/Activation/Dependencies.php:110
32
  msgid "Hide Hidden"
33
  msgstr ""
34
 
35
- #: app/Activation/Dependencies.php:111 app/Views/forms/link-form.php:14
36
- #: app/Views/listing.php:16 app/Views/listing.php:17
37
  msgid "Add Link"
38
  msgstr ""
39
 
40
- #: app/Activation/Dependencies.php:112
41
  msgid "Add Child Link"
42
  msgstr ""
43
 
44
- #: app/Activation/Dependencies.php:113
45
- #: app/Entities/Post/PostUpdateRepository.php:68
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:64
48
  msgid "Title"
49
  msgstr ""
50
 
51
- #: app/Activation/Dependencies.php:114 app/Views/forms/quickedit-post.php:11
52
- #: app/Views/partials/row-link.php:60 app/Views/partials/row.php:124
53
  msgid "Quick Edit"
54
  msgstr ""
55
 
56
- #: app/Activation/Dependencies.php:115
57
  msgid "Page Title"
58
  msgstr ""
59
 
60
- #: app/Activation/Dependencies.php:116 app/Views/partials/row.php:128
61
  msgid "View"
62
  msgstr ""
63
 
64
- #: app/Activation/Dependencies.php:117 app/Views/forms/new-child.php:7
65
- #: app/Views/partials/row.php:88
66
  msgid "Add Child"
67
  msgstr ""
68
 
69
- #: app/Activation/Dependencies.php:118
70
  msgid "Add Child Page"
71
  msgstr ""
72
 
73
- #: app/Activation/Dependencies.php:119
74
  msgid "Add Child Pages"
75
  msgstr ""
76
 
77
- #: app/Activation/Dependencies.php:120 app/Views/forms/new-child.php:93
 
78
  msgid "Add"
79
  msgstr ""
80
 
81
- #: app/Activation/Dependencies.php:121
82
  msgid "Add Page"
83
  msgstr ""
84
 
85
- #: app/Activation/Dependencies.php:122
86
  msgid "Add Pages"
87
  msgstr ""
88
 
89
- #: app/Activation/Dependencies.php:123 app/Views/listing.php:10
90
  #: app/Views/listing.php:11
91
  msgid "Add Multiple"
92
  msgstr ""
93
 
94
- #: app/Activation/Dependencies.php:124
95
  msgid ""
96
  "Are you sure you would like to empty the trash? This action is not "
97
  "reversable."
98
  msgstr ""
99
 
100
- #: app/Activation/Dependencies.php:125 app/Views/partials/row-link.php:37
101
- #: app/Views/partials/row.php:39
102
  msgid "Hidden"
103
  msgstr ""
104
 
@@ -106,138 +107,142 @@ msgstr ""
106
  msgid "Settings"
107
  msgstr ""
108
 
109
- #: app/Config/Settings.php:52 app/Views/settings/settings.php:2
110
  msgid "Nested Pages Settings"
111
  msgstr ""
112
 
113
- #: app/Config/Settings.php:53
114
  msgid "Nested Pages"
115
  msgstr ""
116
 
117
- #: app/Entities/AdminMenu/AdminSubmenu.php:73
118
  #: app/Views/partials/tool-list.php:33
119
  msgid "Default"
120
  msgstr ""
121
 
122
- #: app/Entities/Confirmation/LinkDeletedConfirmation.php:9
123
  msgid "Link successfully deleted."
124
  msgstr ""
125
 
126
- #: app/Entities/Confirmation/TrashConfirmation.php:12
127
  msgid "pages moved to the Trash"
128
  msgstr ""
129
 
130
- #: app/Entities/Confirmation/TrashConfirmation.php:14
131
  msgid "moved to the Trash"
132
  msgstr ""
133
 
134
- #: app/Entities/Confirmation/TrashConfirmation.php:19
135
  msgid "Undo"
136
  msgstr ""
137
 
138
- #: app/Entities/Confirmation/TrashRestoredConfirmation.php:10
139
  msgid "pages"
140
  msgstr ""
141
 
142
- #: app/Entities/Confirmation/TrashRestoredConfirmation.php:10
143
  msgid "page"
144
  msgstr ""
145
 
146
- #: app/Entities/Confirmation/TrashRestoredConfirmation.php:11
147
  msgid "restored from trash"
148
  msgstr ""
149
 
150
- #: app/Entities/Post/PostUpdateRepository.php:310
151
- msgid "Label"
152
- msgstr ""
153
-
154
- #: app/Entities/PostType/PostTypeRepository.php:182
155
  msgid "Nested View"
156
  msgstr ""
157
 
158
- #: app/Entities/PostType/PostTypeRepository.php:182
159
  msgid "Sort View"
160
  msgstr ""
161
 
162
- #: app/Entities/PostType/RegisterPostTypes.php:20
163
  msgid "Redirects"
164
  msgstr ""
165
 
166
- #: app/Entities/PostType/RegisterPostTypes.php:21
167
  msgid "Redirect"
168
  msgstr ""
169
 
170
- #: app/Form/Handlers/BaseHandler.php:79
171
  msgid "Incorrect Form Field"
172
  msgstr ""
173
 
174
- #: app/Form/Handlers/BaseHandler.php:110
175
  msgid "There was an error updating the page."
176
  msgstr ""
177
 
178
- #: app/Form/Handlers/ClonePostHandler.php:36
179
  msgid "Post Not Found"
180
  msgstr ""
181
 
182
- #: app/Form/Handlers/EmptyTrashHandler.php:16
183
  msgid "Trash successfully emptied."
184
  msgstr ""
185
 
186
- #: app/Form/Handlers/NewLinkHandler.php:33
187
- #: app/Form/Handlers/QuickEditLinkHandler.php:28
 
 
 
 
 
 
 
 
188
  msgid "Link successfully updated"
189
  msgstr ""
190
 
191
- #: app/Form/Handlers/QuickEditHandler.php:31
192
  msgid "Post successfully updated"
193
  msgstr ""
194
 
195
- #: app/Form/Handlers/SortHandler.php:28
196
  msgid "Page order successfully updated."
197
  msgstr ""
198
 
199
- #: app/Form/Handlers/SortHandler.php:30
200
  msgid "There was an error updating the page order."
201
  msgstr ""
202
 
203
- #: app/Form/Handlers/SyncMenuHandler.php:25
204
  msgid "Menu sync enabled."
205
  msgstr ""
206
 
207
- #: app/Form/Handlers/SyncMenuHandler.php:28
208
  msgid "Menu sync disabled."
209
  msgstr ""
210
 
211
- #: app/Form/Validation/Validation.php:139
212
  msgid "Please provide a valid date."
213
  msgstr ""
214
 
215
- #: app/Form/Validation/Validation.php:151
216
  msgid "Please provide a menu title."
217
  msgstr ""
218
 
219
- #: app/Form/Validation/Validation.php:154
220
  msgid "Please provide a valid URL."
221
  msgstr ""
222
 
223
- #: app/Form/Validation/Validation.php:165
224
  msgid "Please provide a "
225
  msgstr ""
226
 
227
- #: app/Form/Validation/Validation.php:179
228
  msgid "A valid parent page was not provided."
229
  msgstr ""
230
 
231
- #: app/Form/Validation/Validation.php:186
232
  msgid "Please provide at least one page title."
233
  msgstr ""
234
 
235
- #: app/Form/Validation/Validation.php:194
236
  msgid "Page titles cannot be blank."
237
  msgstr ""
238
 
239
  #: app/Views/forms/clone-form.php:9 app/Views/forms/clone-form.php:65
240
- #: app/Views/partials/row.php:93
241
  msgid "Clone"
242
  msgstr ""
243
 
@@ -245,26 +250,25 @@ msgstr ""
245
  msgid "Number of Copies"
246
  msgstr ""
247
 
248
- #: app/Views/forms/clone-form.php:26 app/Views/forms/link-form.php:41
249
- #: app/Views/forms/new-child.php:35 app/Views/forms/quickedit-link.php:27
250
- #: app/Views/forms/quickedit-post.php:76
251
  msgid "Status"
252
  msgstr ""
253
 
254
- #: app/Views/forms/clone-form.php:29 app/Views/forms/link-form.php:44
255
- #: app/Views/forms/new-child.php:38 app/Views/forms/quickedit-link.php:30
256
- #: app/Views/forms/quickedit-post.php:79 app/Views/partials/tool-list.php:10
257
  msgid "Published"
258
  msgstr ""
259
 
260
- #: app/Views/forms/clone-form.php:31 app/Views/forms/link-form.php:47
261
- #: app/Views/forms/quickedit-link.php:33 app/Views/forms/quickedit-post.php:82
262
  msgid "Pending Review"
263
  msgstr ""
264
 
265
- #: app/Views/forms/clone-form.php:32 app/Views/forms/link-form.php:48
266
- #: app/Views/forms/new-child.php:40 app/Views/forms/quickedit-link.php:34
267
- #: app/Views/forms/quickedit-post.php:83 app/Views/partials/tool-list.php:14
268
  msgid "Draft"
269
  msgstr ""
270
 
@@ -274,7 +278,8 @@ msgid "Author"
274
  msgstr ""
275
 
276
  #: app/Views/forms/clone-form.php:62 app/Views/forms/empty-trash-modal.php:11
277
- #: app/Views/forms/new-child.php:90 app/Views/forms/quickedit-link.php:81
 
278
  #: app/Views/forms/quickedit-post.php:207
279
  msgid "Cancel"
280
  msgstr ""
@@ -283,41 +288,47 @@ msgstr ""
283
  msgid "Empty Trash"
284
  msgstr ""
285
 
286
- #: app/Views/forms/link-form.php:31 app/Views/forms/quickedit-link.php:17
287
- #: app/Views/forms/quickedit-post.php:171
288
- msgid "Navigation Label"
289
  msgstr ""
290
 
291
- #: app/Views/forms/link-form.php:36 app/Views/forms/quickedit-link.php:22
292
- msgid "URL"
293
  msgstr ""
294
 
295
- #: app/Views/forms/link-form.php:45 app/Views/forms/quickedit-link.php:31
296
- #: app/Views/forms/quickedit-post.php:80
297
- msgid "Scheduled"
298
  msgstr ""
299
 
300
- #: app/Views/forms/link-form.php:59 app/Views/forms/quickedit-link.php:54
301
- #: app/Views/forms/quickedit-post.php:187
302
- msgid "Hide in Nav Menu"
303
  msgstr ""
304
 
305
- #: app/Views/forms/link-form.php:64 app/Views/forms/quickedit-link.php:60
306
- #: app/Views/forms/quickedit-post.php:126
307
- msgid "Hide in Nested Pages"
308
  msgstr ""
309
 
310
- #: app/Views/forms/link-form.php:69 app/Views/forms/quickedit-link.php:66
311
- #: app/Views/forms/quickedit-post.php:193
312
- msgid "Open link in a new window/tab"
 
 
 
 
 
 
 
 
 
313
  msgstr ""
314
 
315
  #: app/Views/forms/link-form.php:80
316
- msgid "Close"
317
  msgstr ""
318
 
319
- #: app/Views/forms/link-form.php:83
320
- msgid "Save Link"
 
321
  msgstr ""
322
 
323
  #: app/Views/forms/new-child.php:28
@@ -340,9 +351,8 @@ msgstr ""
340
  msgid "Link"
341
  msgstr ""
342
 
343
- #: app/Views/forms/quickedit-link.php:44
344
- #: app/Views/forms/quickedit-post.php:175
345
- msgid "Title Attribute"
346
  msgstr ""
347
 
348
  #: app/Views/forms/quickedit-link.php:48
@@ -350,7 +360,17 @@ msgstr ""
350
  msgid "CSS Classes"
351
  msgstr ""
352
 
353
- #: app/Views/forms/quickedit-link.php:84
 
 
 
 
 
 
 
 
 
 
354
  #: app/Views/forms/quickedit-post.php:210
355
  msgid "Update"
356
  msgstr ""
@@ -404,11 +424,19 @@ msgstr ""
404
  msgid "Sync Menu"
405
  msgstr ""
406
 
407
- #: app/Views/partials/row.php:47
 
 
 
 
 
 
 
 
408
  msgid "currently editing"
409
  msgstr ""
410
 
411
- #: app/Views/partials/row.php:51
412
  msgid "Edit"
413
  msgstr ""
414
 
@@ -444,6 +472,10 @@ msgstr ""
444
  msgid "Decending"
445
  msgstr ""
446
 
 
 
 
 
447
  #: app/Views/settings/settings-general.php:4
448
  msgid "Currently Enabled"
449
  msgstr ""
@@ -456,37 +488,41 @@ msgstr ""
456
  msgid "Nested Pages Version"
457
  msgstr ""
458
 
459
- #: app/Views/settings/settings-general.php:12
460
  msgid "Menu Name"
461
  msgstr ""
462
 
463
- #: app/Views/settings/settings-general.php:15
464
  msgid ""
465
  "Important: Once the menu name has changed, theme files should be updated to "
466
  "reference the new name."
467
  msgstr ""
468
 
469
- #: app/Views/settings/settings-general.php:19
470
  msgid "Display Options"
471
  msgstr ""
472
 
473
- #: app/Views/settings/settings-general.php:23
474
  msgid "Enable Date Picker in Quick Edit"
475
  msgstr ""
476
 
477
- #: app/Views/settings/settings-general.php:28
478
  msgid "Menu Sync"
479
  msgstr ""
480
 
481
- #: app/Views/settings/settings-general.php:32
482
  msgid "Hide Menu Sync Checkbox"
483
  msgstr ""
484
 
485
- #: app/Views/settings/settings-general.php:37
 
 
 
 
486
  msgid "Allow Page Sorting"
487
  msgstr ""
488
 
489
- #: app/Views/settings/settings-general.php:47
490
  msgid "Admins always have sorting ability."
491
  msgstr ""
492
 
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Nested Pages\n"
4
+ "POT-Creation-Date: 2015-08-30 10:36-0500\n"
5
+ "PO-Revision-Date: 2015-08-30 10:36-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:29
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:18
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/listing.php:16
36
+ #: app/Views/listing.php:17
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:69
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:64
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:68 app/Views/partials/row.php:130
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:134
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:94
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/link-form.php:105
78
+ #: app/Views/forms/new-child.php:93
79
  msgid "Add"
80
  msgstr ""
81
 
82
+ #: app/Activation/Dependencies.php:120
83
  msgid "Add Page"
84
  msgstr ""
85
 
86
+ #: app/Activation/Dependencies.php:121
87
  msgid "Add Pages"
88
  msgstr ""
89
 
90
+ #: app/Activation/Dependencies.php:122 app/Views/listing.php:10
91
  #: app/Views/listing.php:11
92
  msgid "Add Multiple"
93
  msgstr ""
94
 
95
+ #: app/Activation/Dependencies.php:123
96
  msgid ""
97
  "Are you sure you would like to empty the trash? This action is not "
98
  "reversable."
99
  msgstr ""
100
 
101
+ #: app/Activation/Dependencies.php:124 app/Views/partials/row-link.php:40
102
+ #: app/Views/partials/row.php:45
103
  msgid "Hidden"
104
  msgstr ""
105
 
107
  msgid "Settings"
108
  msgstr ""
109
 
110
+ #: app/Config/Settings.php:53 app/Views/settings/settings.php:2
111
  msgid "Nested Pages Settings"
112
  msgstr ""
113
 
114
+ #: app/Config/Settings.php:54
115
  msgid "Nested Pages"
116
  msgstr ""
117
 
118
+ #: app/Entities/AdminMenu/AdminSubmenu.php:75
119
  #: app/Views/partials/tool-list.php:33
120
  msgid "Default"
121
  msgstr ""
122
 
123
+ #: app/Entities/Confirmation/LinkDeletedConfirmation.php:12
124
  msgid "Link successfully deleted."
125
  msgstr ""
126
 
127
+ #: app/Entities/Confirmation/TrashConfirmation.php:16
128
  msgid "pages moved to the Trash"
129
  msgstr ""
130
 
131
+ #: app/Entities/Confirmation/TrashConfirmation.php:18
132
  msgid "moved to the Trash"
133
  msgstr ""
134
 
135
+ #: app/Entities/Confirmation/TrashConfirmation.php:23
136
  msgid "Undo"
137
  msgstr ""
138
 
139
+ #: app/Entities/Confirmation/TrashRestoredConfirmation.php:14
140
  msgid "pages"
141
  msgstr ""
142
 
143
+ #: app/Entities/Confirmation/TrashRestoredConfirmation.php:14
144
  msgid "page"
145
  msgstr ""
146
 
147
+ #: app/Entities/Confirmation/TrashRestoredConfirmation.php:15
148
  msgid "restored from trash"
149
  msgstr ""
150
 
151
+ #: app/Entities/PostType/PostTypeRepository.php:189
 
 
 
 
152
  msgid "Nested View"
153
  msgstr ""
154
 
155
+ #: app/Entities/PostType/PostTypeRepository.php:189
156
  msgid "Sort View"
157
  msgstr ""
158
 
159
+ #: app/Entities/PostType/RegisterPostTypes.php:22
160
  msgid "Redirects"
161
  msgstr ""
162
 
163
+ #: app/Entities/PostType/RegisterPostTypes.php:23
164
  msgid "Redirect"
165
  msgstr ""
166
 
167
+ #: app/Form/Listeners/BaseHandler.php:80
168
  msgid "Incorrect Form Field"
169
  msgstr ""
170
 
171
+ #: app/Form/Listeners/BaseHandler.php:109
172
  msgid "There was an error updating the page."
173
  msgstr ""
174
 
175
+ #: app/Form/Listeners/ClonePost.php:36
176
  msgid "Post Not Found"
177
  msgstr ""
178
 
179
+ #: app/Form/Listeners/EmptyTrash.php:19
180
  msgid "Trash successfully emptied."
181
  msgstr ""
182
 
183
+ #: app/Form/Listeners/NewMenuItem.php:27
184
+ msgid "Custom Links must have a label"
185
+ msgstr ""
186
+
187
+ #: app/Form/Listeners/NewMenuItem.php:28
188
+ msgid "Please provide a valid URL"
189
+ msgstr ""
190
+
191
+ #: app/Form/Listeners/NewMenuItem.php:47
192
+ #: app/Form/Listeners/QuickEditLink.php:30
193
  msgid "Link successfully updated"
194
  msgstr ""
195
 
196
+ #: app/Form/Listeners/QuickEdit.php:32
197
  msgid "Post successfully updated"
198
  msgstr ""
199
 
200
+ #: app/Form/Listeners/Sort.php:29
201
  msgid "Page order successfully updated."
202
  msgstr ""
203
 
204
+ #: app/Form/Listeners/Sort.php:31
205
  msgid "There was an error updating the page order."
206
  msgstr ""
207
 
208
+ #: app/Form/Listeners/SyncMenu.php:27
209
  msgid "Menu sync enabled."
210
  msgstr ""
211
 
212
+ #: app/Form/Listeners/SyncMenu.php:30
213
  msgid "Menu sync disabled."
214
  msgstr ""
215
 
216
+ #: app/Form/Validation/Validation.php:134
217
  msgid "Please provide a valid date."
218
  msgstr ""
219
 
220
+ #: app/Form/Validation/Validation.php:145
221
  msgid "Please provide a menu title."
222
  msgstr ""
223
 
224
+ #: app/Form/Validation/Validation.php:148
225
  msgid "Please provide a valid URL."
226
  msgstr ""
227
 
228
+ #: app/Form/Validation/Validation.php:158
229
  msgid "Please provide a "
230
  msgstr ""
231
 
232
+ #: app/Form/Validation/Validation.php:171
233
  msgid "A valid parent page was not provided."
234
  msgstr ""
235
 
236
+ #: app/Form/Validation/Validation.php:178
237
  msgid "Please provide at least one page title."
238
  msgstr ""
239
 
240
+ #: app/Form/Validation/Validation.php:186
241
  msgid "Page titles cannot be blank."
242
  msgstr ""
243
 
244
  #: app/Views/forms/clone-form.php:9 app/Views/forms/clone-form.php:65
245
+ #: app/Views/partials/row.php:99
246
  msgid "Clone"
247
  msgstr ""
248
 
250
  msgid "Number of Copies"
251
  msgstr ""
252
 
253
+ #: app/Views/forms/clone-form.php:26 app/Views/forms/new-child.php:35
254
+ #: app/Views/forms/quickedit-link.php:27 app/Views/forms/quickedit-post.php:76
 
255
  msgid "Status"
256
  msgstr ""
257
 
258
+ #: app/Views/forms/clone-form.php:29 app/Views/forms/new-child.php:38
259
+ #: app/Views/forms/quickedit-link.php:30 app/Views/forms/quickedit-post.php:79
260
+ #: app/Views/partials/tool-list.php:10
261
  msgid "Published"
262
  msgstr ""
263
 
264
+ #: app/Views/forms/clone-form.php:31 app/Views/forms/quickedit-link.php:33
265
+ #: app/Views/forms/quickedit-post.php:82
266
  msgid "Pending Review"
267
  msgstr ""
268
 
269
+ #: app/Views/forms/clone-form.php:32 app/Views/forms/new-child.php:40
270
+ #: app/Views/forms/quickedit-link.php:34 app/Views/forms/quickedit-post.php:83
271
+ #: app/Views/partials/tool-list.php:14
272
  msgid "Draft"
273
  msgstr ""
274
 
278
  msgstr ""
279
 
280
  #: app/Views/forms/clone-form.php:62 app/Views/forms/empty-trash-modal.php:11
281
+ #: app/Views/forms/link-form.php:101 app/Views/forms/new-child.php:90
282
+ #: app/Views/forms/quickedit-link.php:84
283
  #: app/Views/forms/quickedit-post.php:207
284
  msgid "Cancel"
285
  msgstr ""
288
  msgid "Empty Trash"
289
  msgstr ""
290
 
291
+ #: app/Views/forms/link-form.php:18
292
+ msgid "Custom Link"
 
293
  msgstr ""
294
 
295
+ #: app/Views/forms/link-form.php:27 app/Views/forms/link-form.php:44
296
+ msgid "Search"
297
  msgstr ""
298
 
299
+ #: app/Views/forms/link-form.php:27 app/Views/forms/link-form.php:44
300
+ msgid "No Results"
 
301
  msgstr ""
302
 
303
+ #: app/Views/forms/link-form.php:58
304
+ msgid "Select an item"
 
305
  msgstr ""
306
 
307
+ #: app/Views/forms/link-form.php:63
308
+ msgid "Original"
 
309
  msgstr ""
310
 
311
+ #: app/Views/forms/link-form.php:68 app/Views/forms/quickedit-link.php:22
312
+ msgid "URL"
313
+ msgstr ""
314
+
315
+ #: app/Views/forms/link-form.php:72 app/Views/forms/quickedit-link.php:17
316
+ #: app/Views/forms/quickedit-post.php:171
317
+ msgid "Navigation Label"
318
+ msgstr ""
319
+
320
+ #: app/Views/forms/link-form.php:76 app/Views/forms/quickedit-link.php:44
321
+ #: app/Views/forms/quickedit-post.php:175
322
+ msgid "Title Attribute"
323
  msgstr ""
324
 
325
  #: app/Views/forms/link-form.php:80
326
+ msgid "CSS Classes (optional)"
327
  msgstr ""
328
 
329
+ #: app/Views/forms/link-form.php:86 app/Views/forms/quickedit-link.php:66
330
+ #: app/Views/forms/quickedit-post.php:193
331
+ msgid "Open link in a new window/tab"
332
  msgstr ""
333
 
334
  #: app/Views/forms/new-child.php:28
351
  msgid "Link"
352
  msgstr ""
353
 
354
+ #: app/Views/forms/quickedit-link.php:31 app/Views/forms/quickedit-post.php:80
355
+ msgid "Scheduled"
 
356
  msgstr ""
357
 
358
  #: app/Views/forms/quickedit-link.php:48
360
  msgid "CSS Classes"
361
  msgstr ""
362
 
363
+ #: app/Views/forms/quickedit-link.php:54
364
+ #: app/Views/forms/quickedit-post.php:187
365
+ msgid "Hide in Nav Menu"
366
+ msgstr ""
367
+
368
+ #: app/Views/forms/quickedit-link.php:60
369
+ #: app/Views/forms/quickedit-post.php:126
370
+ msgid "Hide in Nested Pages"
371
+ msgstr ""
372
+
373
+ #: app/Views/forms/quickedit-link.php:87
374
  #: app/Views/forms/quickedit-post.php:210
375
  msgid "Update"
376
  msgstr ""
424
  msgid "Sync Menu"
425
  msgstr ""
426
 
427
+ #: app/Views/partials/row.php:23
428
+ msgid "Front Page"
429
+ msgstr ""
430
+
431
+ #: app/Views/partials/row.php:24
432
+ msgid "Posts Page"
433
+ msgstr ""
434
+
435
+ #: app/Views/partials/row.php:53
436
  msgid "currently editing"
437
  msgstr ""
438
 
439
+ #: app/Views/partials/row.php:57
440
  msgid "Edit"
441
  msgstr ""
442
 
472
  msgid "Decending"
473
  msgstr ""
474
 
475
+ #: app/Views/partials/tool-list.php:110
476
+ msgid "All "
477
+ msgstr ""
478
+
479
  #: app/Views/settings/settings-general.php:4
480
  msgid "Currently Enabled"
481
  msgstr ""
488
  msgid "Nested Pages Version"
489
  msgstr ""
490
 
491
+ #: app/Views/settings/settings-general.php:13
492
  msgid "Menu Name"
493
  msgstr ""
494
 
495
+ #: app/Views/settings/settings-general.php:16
496
  msgid ""
497
  "Important: Once the menu name has changed, theme files should be updated to "
498
  "reference the new name."
499
  msgstr ""
500
 
501
+ #: app/Views/settings/settings-general.php:21
502
  msgid "Display Options"
503
  msgstr ""
504
 
505
+ #: app/Views/settings/settings-general.php:25
506
  msgid "Enable Date Picker in Quick Edit"
507
  msgstr ""
508
 
509
+ #: app/Views/settings/settings-general.php:30
510
  msgid "Menu Sync"
511
  msgstr ""
512
 
513
+ #: app/Views/settings/settings-general.php:36
514
  msgid "Hide Menu Sync Checkbox"
515
  msgstr ""
516
 
517
+ #: app/Views/settings/settings-general.php:43
518
+ msgid "Disable Menu Sync Completely"
519
+ msgstr ""
520
+
521
+ #: app/Views/settings/settings-general.php:49
522
  msgid "Allow Page Sorting"
523
  msgstr ""
524
 
525
+ #: app/Views/settings/settings-general.php:59
526
  msgid "Admins always have sorting ability."
527
  msgstr ""
528
 
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.4.1
7
  Author: Kyle Phillips
8
  Author URI: https://github.com/kylephillips
9
  Text Domain: nestedpages
@@ -12,7 +12,7 @@ License: GPLv2 or later.
12
  Copyright: Kyle Phillips
13
  */
14
 
15
- /* Copyright 2014 Kyle Phillips (email : support@nestedpages.com)
16
 
17
  This program is free software; you can redistribute it and/or modify
18
  it under the terms of the GNU General Public License, version 2, as
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.5.0
7
  Author: Kyle Phillips
8
  Author URI: https://github.com/kylephillips
9
  Text Domain: nestedpages
12
  Copyright: Kyle Phillips
13
  */
14
 
15
+ /* Copyright 2015 Kyle Phillips (email : support@nestedpages.com)
16
 
17
  This program is free software; you can redistribute it and/or modify
18
  it under the terms of the GNU General Public License, version 2, as
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://nestedpages.com/
4
  Tags: pages, admin, nested, tree view, page tree, sort, quick edit, structure
5
  Requires at least: 3.8
6
  Tested up to: 4.3
7
- Stable tag: 1.4.0
8
 
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -89,6 +89,11 @@ If you have WordPress SEO by Yoast installed, your page score indicators are sho
89
 
90
  == Changelog ==
91
 
 
 
 
 
 
92
  = 1.4.1 =
93
  * Bug fix in quick edit where child pages display parent row data on update.
94
 
@@ -105,7 +110,7 @@ If you have WordPress SEO by Yoast installed, your page score indicators are sho
105
  * Support added for page that are noindexed in WordPress SEO (Thanks to Joost de Valk)
106
 
107
  = 1.3.14 =
108
- * Minor bug fix – modal not appearing when last item in the trash (provided by ClementRoy)
109
  * Option added to hide the "Sync Menu" checkbox (visit Settings > Nested Pages > General to hide)
110
  * Updated Danish Translation (Thomas Blomberg)
111
  * Confirmed compatibility with WordPress v4.2
@@ -160,7 +165,7 @@ If you have WordPress SEO by Yoast installed, your page score indicators are sho
160
  * Bug fix in menu - pages now nestable under links.
161
 
162
  = 1.3.1 =
163
- * UI enhancements in Quick Edits – default date fields replaced with datepicker and formatted time.
164
 
165
  = 1.3.0 =
166
  * 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.
@@ -258,7 +263,7 @@ All post types are now supported. Also includes minor bug fixes and UI improveme
258
  Bug fix when using custom roles.
259
 
260
  = 1.2 =
261
- 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.
262
 
263
  = 1.1.9 =
264
  Italian translation included along with minor bug fixes.
4
  Tags: pages, admin, nested, tree view, page tree, sort, quick edit, structure
5
  Requires at least: 3.8
6
  Tested up to: 4.3
7
+ Stable tag: 1.4.1
8
 
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
89
 
90
  == Changelog ==
91
 
92
+ = 1.5.0 =
93
+ * Links now include all taxonomies/post types, enabling full control over the primary site menu from the Nested Pages interface. Start adding menu items by selecting "Add Link" from the top, or the link button on a specific row to add a child item.
94
+ * Escape key closing of modal windows added.
95
+ * Category filtering added to pages if categories enabled
96
+
97
  = 1.4.1 =
98
  * Bug fix in quick edit where child pages display parent row data on update.
99
 
110
  * Support added for page that are noindexed in WordPress SEO (Thanks to Joost de Valk)
111
 
112
  = 1.3.14 =
113
+ * Minor bug fix – modal not appearing when last item in the trash (provided by ClementRoy)
114
  * Option added to hide the "Sync Menu" checkbox (visit Settings > Nested Pages > General to hide)
115
  * Updated Danish Translation (Thomas Blomberg)
116
  * Confirmed compatibility with WordPress v4.2
165
  * Bug fix in menu - pages now nestable under links.
166
 
167
  = 1.3.1 =
168
+ * UI enhancements in Quick Edits – default date fields replaced with datepicker and formatted time.
169
 
170
  = 1.3.0 =
171
  * 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.
263
  Bug fix when using custom roles.
264
 
265
  = 1.2 =
266
+ 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.
267
 
268
  = 1.1.9 =
269
  Italian translation included along with minor bug fixes.