CMS Tree Page View - Version 1.2.1

Version Description

  • Fixed wrong count if WPML where activated and future or private posts existed for a language
  • Show info message if no posts found after fetching posts with AJAX
  • Updated Swedish translation
  • Updated Russian translation - hopefully it works this time!
  • Updated POT file
  • Minor language fixes, like actually loading plugin textdomain before using any texts...
Download this release

Release Info

Developer eskapism
Plugin Icon wp plugin CMS Tree Page View
Version 1.2.1
Comparing to
See all releases

Code changes from version 0.8.9 to 1.2.1

functions.php CHANGED
@@ -1,11 +1,189 @@
1
  <?php
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  // for debug, remember to comment out (yes.. i *know* i will forget this later on...)
4
  // require("FirePHPCore/FirePHP.class.php");
5
  // $firephp = FirePHP::getInstance(true);
6
 
 
 
 
7
  function cms_tpv_admin_head() {
8
 
 
 
 
 
9
  global $cms_tpv_view;
10
  if (isset($_GET["cms_tpv_view"])) {
11
  $cms_tpv_view = htmlspecialchars($_GET["cms_tpv_view"]);
@@ -34,94 +212,279 @@ function cms_tpv_admin_head() {
34
  <?php
35
  }
36
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  function cms_admin_enqueue_scripts() {
38
 
39
- wp_enqueue_script( "jquery-cookie", CMS_TPV_URL . "scripts/jquery.biscuit.js", array("jquery")); // renamed from cookie to fix problems with mod_security
40
- wp_enqueue_script( "jquery-jstree", CMS_TPV_URL . "scripts/jquery.jstree.js", false, CMS_TPV_VERSION);
41
- wp_enqueue_script( "jquery-alerts", CMS_TPV_URL . "scripts/jquery.alerts.js", false, CMS_TPV_VERSION);
42
- wp_enqueue_script( "jquery-hoverintent", CMS_TPV_URL . "scripts/jquery.hoverIntent.minified.js", false, CMS_TPV_VERSION);
43
- #wp_enqueue_script( "jquery-ui-dialog", CMS_TPV_URL . "scripts/jquery.ui.dialog.min.js", false, CMS_TPV_VERSION);
44
- wp_enqueue_script( "cms_tree_page_view", CMS_TPV_URL . "scripts/cms_tree_page_view.js", false, CMS_TPV_VERSION);
45
-
46
- // @todo: only load these when we do show a tree, ie. on the dashboard or showing the tree for a post type
47
- // see: http://devpress.com/blog/how-to-load-javascript-in-the-wordpress-admin/
48
- // admin_enqueue_scripts-hook?
49
- wp_enqueue_style( "cms_tpv_styles", CMS_TPV_URL . "styles/styles.css", false, CMS_TPV_VERSION );
50
- wp_enqueue_style( "jquery-alerts", CMS_TPV_URL . "styles/jquery.alerts.css", false, CMS_TPV_VERSION );
51
-
52
- $oLocale = array(
53
- "Enter_title_of_new_page" => __("Enter title of new page", 'cms-tree-page-view'),
54
- "child_pages" => __("child pages", 'cms-tree-page-view'),
55
- "Edit_page" => __("Edit page", 'cms-tree-page-view'),
56
- "View_page" => __("View page", 'cms-tree-page-view'),
57
- "Edit" => __("Edit", 'cms-tree-page-view'),
58
- "View" => __("View", 'cms-tree-page-view'),
59
- "Add_page" => __("Add page", 'cms-tree-page-view'),
60
- "Add_new_page_after" => __("Add new page after", 'cms-tree-page-view'),
61
- "after" => __("after", 'cms-tree-page-view'),
62
- "inside" => __("inside", 'cms-tree-page-view'),
63
- "Can_not_add_sub_page_when_status_is_draft" => __("Sorry, can't create a sub page to a page with status \"draft\".", 'cms-tree-page-view'),
64
- "Can_not_add_sub_page_when_status_is_trash" => __("Sorry, can't create a sub page to a page with status \"trash\".", 'cms-tree-page-view'),
65
- "Can_not_add_page_after_when_status_is_trash" => __("Sorry, can't create a page after a page with status \"trash\".", 'cms-tree-page-view'),
66
- "Add_new_page_inside" => __("Add new page inside", 'cms-tree-page-view'),
67
- "Status_draft" => __("draft", 'cms-tree-page-view'),
68
- "Status_future" => __("future", 'cms-tree-page-view'),
69
- "Status_password" => __("protected", 'cms-tree-page-view'), // is "protected" word better than "password" ?
70
- "Status_pending" => __("pending", 'cms-tree-page-view'),
71
- "Status_private" => __("private", 'cms-tree-page-view'),
72
- "Status_trash" => __("trash", 'cms-tree-page-view'),
73
- "Password_protected_page" => __("Password protected page", 'cms-tree-page-view'),
74
- "Adding_page" => __("Adding page...", 'cms-tree-page-view'),
75
- );
76
- wp_localize_script( "cms_tree_page_view", 'cmstpv_l10n', $oLocale);
 
 
 
 
 
 
 
 
77
 
 
78
 
79
  }
80
 
 
 
 
 
 
 
81
 
82
  function cms_tpv_admin_init() {
83
 
84
  // DEBUG
85
  //wp_enqueue_script( "jquery-hotkeys" );
86
 
87
- load_plugin_textdomain('cms-tree-page-view', WP_CONTENT_DIR . "/plugins/languages", "/cms-tree-page-view/languages");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
88
 
89
  }
90
 
91
- // save settings
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
92
  function cms_tpv_save_settings() {
 
93
  if (isset($_POST["cms_tpv_action"]) && $_POST["cms_tpv_action"] == "save_settings") {
 
94
  $options = array();
95
  $options["dashboard"] = (array) $_POST["post-type-dashboard"];
96
  $options["menu"] = (array) $_POST["post-type-menu"];
 
 
97
  update_option('cms_tpv_options', $options); // enable this to show box
 
98
  }
99
- /*
100
- [post-type-dashboard] => Array
101
- (
102
- [0] => post
103
- [1] => page
104
- )
105
-
106
- [post-type-menu] => Array
107
- (
108
- [0] => post
109
- [1] => page
110
- )
111
 
112
- */
113
  }
114
 
 
 
 
115
  function cms_tpv_wp_dashboard_setup() {
 
 
 
116
  // add dashboard to capability edit_pages only
117
  if (current_user_can("edit_pages")) {
118
  $options = cms_tpv_get_options();
119
  foreach ($options["dashboard"] as $one_dashboard_post_type) {
120
  $post_type_object = get_post_type_object($one_dashboard_post_type);
121
  $new_func_name = create_function('', "cms_tpv_dashboard('$one_dashboard_post_type');");
122
- wp_add_dashboard_widget( "cms_tpv_dashboard_widget_{$one_dashboard_post_type}", $post_type_object->labels->name . " Tree View", $new_func_name );
 
123
  }
124
  }
 
125
  }
126
 
127
 
@@ -129,7 +492,7 @@ function cms_tpv_wp_dashboard_setup() {
129
  * Output on dashboard
130
  */
131
  function cms_tpv_dashboard($post_type = "") {
132
- // cms_tpv_show_annoying_box();
133
  cms_tpv_print_common_tree_stuff($post_type);
134
  }
135
 
@@ -145,103 +508,122 @@ function cms_tpv_admin_menu() {
145
  $slug = "edit.php?post_type=$one_menu_post_type";
146
  }
147
  $post_type_object = get_post_type_object($one_menu_post_type);
148
- // print_r($post_type_object);
149
- add_submenu_page($slug, $post_type_object->labels->name . " Tree View", $post_type_object->labels->name . " Tree View", $post_type_object->cap->edit_posts, "cms-tpv-page-$one_menu_post_type", "cms_tpv_pages_page");
 
 
150
  }
151
 
152
  add_submenu_page( 'options-general.php' , CMS_TPV_NAME, CMS_TPV_NAME, "administrator", "cms-tpv-options", "cms_tpv_options");
153
 
154
  }
155
 
156
-
157
  /**
158
  * Output options page
159
  */
160
  function cms_tpv_options() {
161
 
162
- /*
163
- // Just som testing stuff
164
- $args = array(
165
- "numberposts" => "-1",
166
- "orderby" => "menu_order",
167
- "order" => "ASC",
168
- "caller_get_posts" => 1, // get sticky posts in natural order (or so I understand it anyway)
169
- "post_status" => "publish", // "any" seems to get all but auto-drafts
170
- "post_type" => "page"
171
- );
172
- $posts = get_pages($args); // works
173
- // $posts = get_posts($args); // does not work
174
- var_dump($posts);
175
- echo "num of posts: " . sizeof($posts);
176
- foreach ($posts as $one_post) {
177
- #bonny_d($one_post);
178
- echo "<br><br>title: " . esc_html($one_post->post_title);
179
- echo "<br>status: " . $one_post->post_status;
180
- echo "<br>type: " . $one_post->post_type;
181
- }
182
- // */
183
-
184
  ?>
185
  <div class="wrap">
186
 
 
 
 
187
  <h2><?php echo CMS_TPV_NAME ?> <?php _e("settings", 'cms-tree-page-view') ?></h2>
188
 
189
- <form method="post" action="options.php">
 
190
  <?php wp_nonce_field('update-options'); ?>
191
 
192
  <h3><?php _e("Select where to show a tree for pages and custom post types", 'cms-tree-page-view')?></h3>
193
 
194
- <?php
195
- $options = cms_tpv_get_options();
196
-
197
- $post_types = get_post_types(array(), "objects");
198
- $arr_page_options = array();
199
- foreach ($post_types as $one_post_type) {
200
- $name = $one_post_type->name;
201
 
202
- if ($name == "post") {
203
- // no support for pages. you could show them.. but since we can't reorder them there is not idea to show them.. or..?
204
- // 14 jul 2011: ok, let's enable it for posts too. some people says it useful
205
- // http://wordpress.org/support/topic/this-plugin-should-work-also-on-posts
206
- // continue;
207
- }
208
-
209
- if ($one_post_type->show_ui) {
210
-
211
- $arr_page_options[] = "post-type-dashboard-$name";
212
- $arr_page_options[] = "post-type-menu-$name";
213
- echo "<p>";
214
- echo "<strong>".$one_post_type->label."</strong>";
215
 
216
- $checked = (in_array($name, $options["dashboard"])) ? " checked='checked' " : "";
217
- echo "<br />";
218
- echo "<input $checked type='checkbox' name='post-type-dashboard[]' value='$name' id='post-type-dashboard-$name' /> <label for='post-type-dashboard-$name'>" . __("On dashboard", 'cms-tree-page-view') . "</label>";
 
 
219
 
220
- $checked = (in_array($name, $options["menu"])) ? " checked='checked' " : "";
221
- echo "<br />";
222
- echo "<input $checked type='checkbox' name='post-type-menu[]' value='$name' id='post-type-menu-$name' /> <label for='post-type-menu-$name'>" . __("In menu", 'cms-tree-page-view') . "</label>";
223
- echo "</p>";
224
- }
225
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
226
 
227
- ?>
228
-
229
  <input type="hidden" name="action" value="update" />
230
  <input type="hidden" name="cms_tpv_action" value="save_settings" />
231
  <input type="hidden" name="page_options" value="<?php echo join($arr_page_options, ",") ?>" />
232
  <p class="submit">
233
  <input type="submit" class="button-primary" value="<?php _e('Save Changes', 'cms-tree-page-view') ?>" />
234
  </p>
 
235
  </form>
 
236
  </div>
237
 
238
  <?php
239
  }
240
 
 
 
 
 
241
  function cms_tpv_get_options() {
242
  $arr_options = (array) get_option('cms_tpv_options');
243
- $arr_options["dashboard"] = (array) $arr_options["dashboard"];
244
- $arr_options["menu"] = (array) $arr_options["menu"];
 
245
  return $arr_options;
246
  }
247
 
@@ -257,7 +639,7 @@ function cms_tpv_get_selected_post_type() {
257
  }
258
  if (!$post_type) {
259
  // no post type, happens with ozh admin drop down, so get it via page instead
260
- $page = $_GET["page"];
261
  $post_type = str_replace("cms-tpv-page-", "", $page);
262
  }
263
 
@@ -277,27 +659,112 @@ function cms_tpv_is_post_type_hierarchical($post_type_object) {
277
  return $is_hierarchical;
278
  }
279
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
280
  /**
281
  * Print tree stuff that is common for both dashboard and page
282
  */
283
  function cms_tpv_print_common_tree_stuff($post_type = "") {
284
 
 
 
285
  if (!$post_type) {
286
  $post_type = cms_tpv_get_selected_post_type();
287
  }
288
- #echo "post_type: $post_type";
289
  $post_type_object = get_post_type_object($post_type);
290
  $get_pages_args = array("post_type" => $post_type);
291
 
292
  $pages = cms_tpv_get_pages($get_pages_args);
293
 
 
294
  $wpml_current_lang = "";
295
- if (defined("ICL_SITEPRESS_VERSION") && $post_type == "page") {
296
- global $sitepress;
297
- $wpml_current_lang = $sitepress->get_current_language();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
298
  }
299
 
300
- global $cms_tpv_view;
301
  // output js for the root/top level
302
  // function cms_tpv_print_childs($pageID, $view = "all", $arrOpenChilds = null, $post_type) {
303
  // @todo: make into function since used at other places
@@ -312,6 +779,7 @@ function cms_tpv_print_common_tree_stuff($post_type = "") {
312
  ob_start();
313
  cms_tpv_print_childs(0, $cms_tpv_view, $jstree_open, $post_type);
314
  $json_data = ob_get_clean();
 
315
  ?>
316
  <script type="text/javascript">
317
  cms_tpv_jsondata.<?php echo $post_type ?> = <?php echo $json_data ?>;
@@ -323,9 +791,9 @@ function cms_tpv_print_common_tree_stuff($post_type = "") {
323
  <input type="hidden" name="cms_tpv_meta_wpml_language" value="<?php echo $wpml_current_lang ?>" />
324
  <?php
325
 
326
- // check if WPML is activated
327
- // if: show a language-menu
328
- if (defined("ICL_SITEPRESS_VERSION") && $post_type == "page") {
329
  $wpml_langs = icl_get_languages();
330
  $wpml_active_lang = null;
331
  if (sizeof($wpml_langs)>=1) {
@@ -338,38 +806,45 @@ function cms_tpv_print_common_tree_stuff($post_type = "") {
338
  $wpml_active_lang = $one_lang;
339
  $selected = "current";
340
  }
341
- $lang_out .= "<li><a class='cms_tvp_switch_lang $selected cms_tpv_switch_language_code_{$one_lang["language_code"]}' href='#'>$one_lang_details[display_name]</a> | </li>";
 
 
 
 
 
 
 
 
342
  }
343
- $lang_out = preg_replace('/ \| <\/li>$/', "</li>", $lang_out);
344
  $lang_out .= "</ul>";
345
  echo $lang_out;
346
  }
 
347
  }
348
- /*
349
- Array
350
- (
351
- [en] => Array
352
- (
353
- [id] => 1
354
- [active] => 1
355
- [native_name] => English
356
- [language_code] => en
357
- [translated_name] => English
358
- [url] => http://localhost/wordpress3
359
- [country_flag_url] => http://localhost/wordpress3/wp-content/plugins/sitepress-multilingual-cms/res/flags/en.png
360
- )
361
- */
362
-
363
- if (empty($pages)) {
364
- echo '<div class="updated fade below-h2"><p>' . __("No posts found.", 'cms-tree-page-view') . '</p></div>';
365
- } else {
366
  // start the party!
 
367
  ?>
368
-
369
- <ul class="cms-tpv-subsubsub">
370
- <li><a class="cms_tvp_view_all <?php echo ($cms_tpv_view=="all") ? "current" : "" ?>" href="#"><?php _e("All", 'cms-tree-page-view') ?></a> |</li>
371
- <li><a class="cms_tvp_view_public <?php echo ($cms_tpv_view=="public") ? "current" : "" ?>" href="#"><?php _e("Public", 'cms-tree-page-view') ?></a> |</li>
372
- <li><a class="cms_tvp_view_trash <?php echo ($cms_tpv_view=="trash") ? "current" : "" ?>" href="#"><?php _e("Trash", 'cms-tree-page-view') ?></a></li>
 
 
 
 
 
 
 
 
 
 
 
 
373
 
374
  <?php
375
  if (cms_tpv_is_post_type_hierarchical($post_type_object)) {
@@ -384,11 +859,12 @@ function cms_tpv_print_common_tree_stuff($post_type = "") {
384
  <form class="cms_tree_view_search_form" method="get" action="">
385
  <input type="text" name="search" class="cms_tree_view_search" />
386
  <a title="<?php _e("Clear search", 'cms-tree-page-view') ?>" class="cms_tree_view_search_form_reset" href="#">x</a>
387
- <input type="submit" class="cms_tree_view_search_submit" value="<?php _e("Search", 'cms-tree-page-view') ?>" />
388
  <span class="cms_tree_view_search_form_working"><?php _e("Searching...", 'cms-tree-page-view') ?></span>
389
  <span class="cms_tree_view_search_form_no_hits"><?php _e("Nothing found.", 'cms-tree-page-view') ?></span>
390
  </form>
391
  </li>
 
392
  </ul>
393
 
394
  <div class="cms_tpv_working">
@@ -405,23 +881,81 @@ function cms_tpv_print_common_tree_stuff($post_type = "") {
405
 
406
  <div style="clear: both;"></div>
407
 
 
408
  <div class="cms_tpv_page_actions">
409
- <p>
410
- <a href="#" title='<?php _e("Edit page", "cms-tree-page-view")?>' class='cms_tpv_action_edit'><?php _e("Edit", "cms-tree-page-view")?></a> |
 
 
 
 
411
  <a href="#" title='<?php _e("View page", "cms-tree-page-view")?>' class='cms_tpv_action_view'><?php _e("View", "cms-tree-page-view")?></a>
412
  </p>
 
 
413
  <p class="cms_tpv_action_add_and_edit_page">
 
414
  <span class='cms_tpv_action_add_page'><?php echo $post_type_object->labels->add_new_item ?></span>
 
415
  <a href="#" title='<?php _e("Add new page after", "cms-tree-page-view")?>' class='cms_tpv_action_add_page_after'><?php _e("After", "cms-tree-page-view")?></a>
 
416
  <?php
417
  // if post type is hierarchical we can add pages inside
418
  if (cms_tpv_is_post_type_hierarchical($post_type_object)) {
419
- ?> | <a href="#" title='<?php _e("Add new page inside", "cms-tree-page-view")?>' class='cms_tpv_action_add_page_inside'><?php _e("Inside", "cms-tree-page-view")?></a><?php
420
  }
421
  // if post status = draft then we can not add pages inside because wordpress currently can not keep its parent if we edit the page
422
  ?>
423
  <!-- <span class="cms_tpv_action_add_page_inside_disallowed"><?php _e("Can not create page inside of a page with draft status", "cms-tree-page-view")?></span> -->
 
424
  </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
425
  <dl>
426
  <dt><?php _e("Last modified", "cms-tree-page-view") ?></dt>
427
  <dd>
@@ -431,11 +965,19 @@ function cms_tpv_print_common_tree_stuff($post_type = "") {
431
  <dt><?php _e("Page ID", "cms-tree-page-view") ?></dt>
432
  <dd><span class="cms_tpv_page_actions_page_id"></span></dd>
433
  </dl>
 
434
  <div class="cms_tpv_page_actions_columns"></div>
435
  <span class="cms_tpv_page_actions_arrow"></span>
436
  </div>
437
  <?php
438
  }
 
 
 
 
 
 
 
439
  ?>
440
 
441
  </div>
@@ -452,9 +994,26 @@ function cms_tpv_pages_page() {
452
  $post_type = cms_tpv_get_selected_post_type();
453
  $post_type_object = get_post_type_object($post_type);
454
 
 
 
 
 
 
 
455
  ?>
456
  <div class="wrap">
457
- <h2><?php echo ($post_type_object->labels->name); ?> Tree View</h2>
 
 
 
 
 
 
 
 
 
 
 
458
 
459
  <?php
460
  /*
@@ -559,6 +1118,7 @@ function cms_tpv_get_pages($args = null) {
559
 
560
  #do_action_ref_array('parse_query', array(&$this));
561
  #print_r($get_posts_args);
 
562
  $pages = get_posts($get_posts_args);
563
 
564
  // filter out pages for wpml, by applying same filter as get_pages does
@@ -599,6 +1159,9 @@ function cms_tpv_print_childs($pageID, $view = "all", $arrOpenChilds = null, $po
599
 
600
  global $post;
601
 
 
 
 
602
  #cms_tpv_firedebug(timer_stop());
603
 
604
  ?>[<?php
@@ -609,6 +1172,7 @@ function cms_tpv_print_childs($pageID, $view = "all", $arrOpenChilds = null, $po
609
  $tmpPost = $post;
610
  $post = $onePage;
611
  $page_id = $onePage->ID;
 
612
 
613
  $editLink = get_edit_post_link($onePage->ID, 'notDisplay');
614
  $content = esc_html($onePage->post_content);
@@ -621,7 +1185,7 @@ function cms_tpv_print_childs($pageID, $view = "all", $arrOpenChilds = null, $po
621
  $arrChildPages = cms_tpv_get_pages("parent={$onePage->ID}&view=$view&post_type=$post_type");
622
  }
623
 
624
- if ( isset( $arrChildPages ) ) {
625
  $hasChildren = true;
626
  }
627
  // if no children, output no state
@@ -709,15 +1273,15 @@ function cms_tpv_print_childs($pageID, $view = "all", $arrOpenChilds = null, $po
709
  "data": {
710
  "title": "<?php echo $title ?>",
711
  "attr": {
712
- "href": "<?php echo $editLink ?>",
713
- "xid": "cms-tpv-<?php echo $onePage->ID ?>"
714
- },
715
- "xicon": "<?php echo CMS_TPV_URL . "images/page_white_text.png" ?>"
716
  },
717
  "attr": {
718
- "xhref": "<?php echo $editLink ?>",
719
  "id": "cms-tpv-<?php echo $onePage->ID ?>",
720
- "xtitle": "<?php _e("Click to edit. Drag to move.", 'cms-tree-page-view') ?>",
721
  "class": "<?php echo $user_can_edit_page_css ?>"
722
  },
723
  <?php echo $strState ?>
@@ -726,17 +1290,20 @@ function cms_tpv_print_childs($pageID, $view = "all", $arrOpenChilds = null, $po
726
  "post_id": "<?php echo $onePage->ID ?>",
727
  "post_type": "<?php echo $onePage->post_type ?>",
728
  "post_status": "<?php echo $onePage->post_status ?>",
 
729
  "rel": "<?php echo $rel ?>",
730
- "childCount": <?php echo ( isset( $arrChildPages ) ) ? sizeof( $arrChildPages ) : 0 ; ?>,
731
  "permalink": "<?php echo htmlspecialchars_decode(get_permalink($onePage->ID)) ?>",
732
  "editlink": "<?php echo htmlspecialchars_decode($editLink) ?>",
733
  "modified_time": "<?php echo $post_modified_time ?>",
734
  "modified_author": "<?php echo $post_author ?>",
735
  "columns": <?php echo $str_columns ?>,
736
- "user_can_edit_page": "<?php echo (int) $user_can_edit_page ?>"
 
737
  }
738
  <?php
739
  // if id is in $arrOpenChilds then also output children on this one
 
740
  if ($hasChildren && isset($arrOpenChilds) && in_array($onePage->ID, $arrOpenChilds)) {
741
  ?>, "children": <?php
742
  cms_tpv_print_childs($onePage->ID, $view, $arrOpenChilds, $post_type);
@@ -760,6 +1327,7 @@ function cms_tpv_print_childs($pageID, $view = "all", $arrOpenChilds = null, $po
760
  }
761
 
762
  // Act on AJAX-call
 
763
  function cms_tpv_get_childs() {
764
 
765
  header("Content-type: application/json");
@@ -970,7 +1538,8 @@ function cms_tpv_move_page() {
970
  $post_to_save = array(
971
  "ID" => $post_node->ID,
972
  "menu_order" => 0,
973
- "post_parent" => $post_ref_node->ID
 
974
  );
975
  wp_update_post( $post_to_save );
976
 
@@ -991,7 +1560,8 @@ function cms_tpv_move_page() {
991
  $post_to_save = array(
992
  "ID" => $post_node->ID,
993
  "menu_order" => $post_ref_node->menu_order,
994
- "post_parent" => $post_ref_node->post_parent
 
995
  );
996
  wp_update_post( $post_to_save );
997
 
@@ -1011,7 +1581,8 @@ function cms_tpv_move_page() {
1011
  $post_to_save = array(
1012
  "ID" => $post_node->ID,
1013
  "menu_order" => $post_ref_node->menu_order+1,
1014
- "post_parent" => $post_ref_node->post_parent
 
1015
  );
1016
  wp_update_post( $post_to_save );
1017
 
@@ -1042,7 +1613,9 @@ function cms_tpv_move_page() {
1042
  * Show a box with some dontate-links and stuff
1043
  */
1044
  function cms_tpv_show_annoying_box() {
1045
- #update_option('cms_tpv_show_annoying_little_box', 1); // enable this to show box
 
 
1046
  if ( isset($_GET["action"]) && "cms_tpv_remove_annoying_box" == $_GET["action"] ) {
1047
  $show_box = 0;
1048
  update_option('cms_tpv_show_annoying_little_box', $show_box);
@@ -1052,9 +1625,28 @@ function cms_tpv_show_annoying_box() {
1052
  if ($show_box) {
1053
  ?>
1054
  <div class="cms_tpv_annoying_little_box">
1055
- <p class="cms_tpv_annoying_little_box_close"><a href="<?php echo add_query_arg("action", "cms_tpv_remove_annoying_box")?>"><?php _e("Close", 'cms-tree-page-view') ?></a></p>
1056
- <p><?php _e('<strong>Thank you for using this plugin!</strong> If you need help please check out the <a href="http://eskapism.se/code-playground/cms-tree-page-view/?utm_source=wordpress&utm_medium=banner&utm_campaign=promobox">plugin homepage</a> or the <a href="http://wordpress.org/tags/cms-tree-page-view?forum_id=10">support forum</a>.', 'cms-tree-page-view') ?></p>
1057
- <p><?php _e('If you like this plugin, please <a href="http://eskapism.se/sida/donate/?utm_source=wordpress&utm_medium=banner&utm_campaign=promobox">support my work by donating</a> - or at least say something nice about this plugin in a blog post or tweet.', 'cms-tree-page-view') ?></p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1058
  </div>
1059
  <?php
1060
  }
@@ -1075,19 +1667,51 @@ function cms_tpv_install() {
1075
  // after upgrading/re-enabling the plugin, also re-enable the little please-donate-box
1076
  update_option('cms_tpv_show_annoying_little_box', 1);
1077
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1078
  // check and update version
1079
  $version = get_option('cms_tpv_version', 0);
 
 
1080
  if ($version <= 0) {
1081
- // first install or pre custom posts version:
1082
- // make sure pages are enabled by default
1083
  $options = array();
 
 
1084
  $options["dashboard"] = array("page");
1085
- $options["menu"] = array("page");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1086
  update_option('cms_tpv_options', $options);
1087
- }
1088
 
1089
- // set to current version
1090
- update_option('cms_tpv_version', CMS_TPV_VERSION);
1091
  }
1092
 
1093
  // when plugins are loaded, check if current plugin version is same as stored
1
  <?php
2
 
3
+ /**
4
+ * Use the ajax action-thingie to catch our form with new pages
5
+ * Add pages and then redirect to...?
6
+ */
7
+ function cms_tpv_add_pages() {
8
+
9
+ #sf_d($_POST);exit;
10
+ /*
11
+ Array
12
+ (
13
+ [action] => cms_tpv_add_pages
14
+ [cms_tpv_add_new_pages_names] => Array
15
+ (
16
+ [0] => xxxxx
17
+ [1] => yyyy
18
+ [2] =>
19
+ )
20
+
21
+ [cms_tpv_add_type] => inside
22
+ [cms_tpv_add_status] => draft
23
+ [lang] => de
24
+ )
25
+ */
26
+
27
+ $post_position = $_POST["cms_tpv_add_type"];
28
+ $post_status = $_POST["cms_tpv_add_status"];
29
+ $post_names = (array) $_POST["cms_tpv_add_new_pages_names"];
30
+ $ref_post_id = (int) $_POST["ref_post_id"];
31
+ $lang = $_POST["lang"];
32
+
33
+ // If lang variable is set, then set some more wpml-related post/get-variables
34
+ if ($lang) {
35
+ // post seems to fix creating new posts in selcted lang
36
+ $_POST["icl_post_language"] = $lang;
37
+ // $_GET["lang"] = $lang;
38
+ }
39
+
40
+ // make sure the status is publish and nothing else (yes, perhaps I named it bad elsewhere)
41
+ if ("published" === $post_status) $post_status = "publish";
42
+
43
+ // remove possibly empty posts
44
+ $arr_post_names = array();
45
+ foreach ($post_names as $one_post_name) {
46
+ if ( trim($one_post_name) ) {
47
+ $arr_post_names[] = $one_post_name;
48
+ }
49
+ }
50
+
51
+ $arr_post_names_count = sizeof($arr_post_names);
52
+
53
+ // check that there are pages left
54
+ if (empty($arr_post_names)) die("Error: no pages to add.");
55
+
56
+ $ref_post = get_post($ref_post_id);
57
+ if (NULL === $ref_post) die("Error: could not load reference post.");
58
+
59
+ // Make room for our new pages
60
+ // Get all pages at a level level and loop until our reference page
61
+ // and then all pages after that one will get it's menu_order
62
+ // increased by the same number as the number of new posts we're gonna add
63
+
64
+ $post_parent = 0;
65
+ if ("after" === $post_position) {
66
+ $post_parent = $ref_post->post_parent;
67
+ } elseif ("inside" === $post_position) {
68
+ $post_parent = $ref_post->ID;
69
+ }
70
+
71
+
72
+ /*
73
+ perhaps for wpml:
74
+ suppress_filters=0
75
+
76
+ */
77
+
78
+ $args = array(
79
+ "post_status" => "any",
80
+ "post_type" => $ref_post->post_type,
81
+ "numberposts" => -1,
82
+ "offset" => 0,
83
+ "orderby" => 'menu_order',
84
+ 'order' => 'asc',
85
+ 'post_parent' => $post_parent,
86
+ "suppress_filters" => FALSE
87
+ );
88
+ //if ($lang) $args["lang"] = $lang;
89
+ $posts = get_posts($args);
90
+
91
+ #sf_d($_GET["lang"]);sf_d($args);sf_d($posts);exit;
92
+
93
+ // If posts exist at this level, make room for our new pages by increasing the menu order
94
+ if (sizeof($posts) > 0) {
95
+
96
+ if ("after" === $post_position) {
97
+
98
+ $has_passed_ref_post = FALSE;
99
+ foreach ($posts as $one_post) {
100
+
101
+ if ($has_passed_ref_post) {
102
+
103
+ $post_update = array(
104
+ "ID" => $one_post->ID,
105
+ "menu_order" => $one_post->menu_order + $arr_post_names_count
106
+ );
107
+ $return_id = wp_update_post($post_update);
108
+ if (0 ===$return_id) die("Error: could not update post with id " . $post_update->ID);
109
+
110
+ }
111
+
112
+ if ( ! $has_passed_ref_post && $ref_post->ID === $one_post->ID) {
113
+ $has_passed_ref_post = TRUE;
114
+ }
115
+
116
+ }
117
+
118
+ $new_menu_order = $ref_post->menu_order;
119
+
120
+ } elseif ("inside" === $post_position) {
121
+
122
+ // in inside, place at beginning
123
+ // so just get first post and use that menu order as base
124
+ $new_menu_order = $posts[0]->menu_order - $arr_post_names_count;
125
+
126
+ }
127
+
128
+
129
+ } else {
130
+
131
+ // no posts, start at 0
132
+ $new_menu_order = 0;
133
+
134
+ }
135
+
136
+ $post_parent_id = NULL;
137
+ if ("after" === $post_position) {
138
+ $post_parent_id = $ref_post->post_parent;
139
+ } elseif ("inside" === $post_position) {
140
+ $post_parent_id = $ref_post->ID;
141
+ }
142
+
143
+ // Done maybe updating menu orders, add the new pages
144
+ $arr_added_pages_ids = array();
145
+ foreach ($arr_post_names as $one_new_post_name) {
146
+
147
+ $new_menu_order++;
148
+ $newpost_args = array(
149
+ "menu_order" => $new_menu_order,
150
+ "post_parent" => $post_parent_id,
151
+ "post_status" => $post_status,
152
+ "post_title" => $one_new_post_name,
153
+ "post_type" => $ref_post->post_type
154
+ );
155
+ $new_post_id = wp_insert_post($newpost_args);
156
+
157
+ if (0 === $new_post_id) {
158
+ die("Error: could not add post");
159
+ }
160
+
161
+ $arr_added_pages_ids[] = $new_post_id;
162
+
163
+
164
+ }
165
+
166
+ // Done. Redirect to the first page created.
167
+ $first_post_edit_link = get_edit_post_link($arr_added_pages_ids[0], "");
168
+ wp_redirect($first_post_edit_link);
169
+
170
+ exit;
171
+
172
+ }
173
+
174
  // for debug, remember to comment out (yes.. i *know* i will forget this later on...)
175
  // require("FirePHPCore/FirePHP.class.php");
176
  // $firephp = FirePHP::getInstance(true);
177
 
178
+ /**
179
+ * Output and add hooks in head
180
+ */
181
  function cms_tpv_admin_head() {
182
 
183
+ if (!cms_tpv_is_one_of_our_pages()) return;
184
+
185
+ cms_tpv_setup_postsoverview();
186
+
187
  global $cms_tpv_view;
188
  if (isset($_GET["cms_tpv_view"])) {
189
  $cms_tpv_view = htmlspecialchars($_GET["cms_tpv_view"]);
212
  <?php
213
  }
214
 
215
+ /**
216
+ * Detect if we are on a page that use CMS Tree Page View
217
+ */
218
+ function cms_tpv_is_one_of_our_pages() {
219
+
220
+ $options = cms_tpv_get_options();
221
+ $post_type = cms_tpv_get_selected_post_type();
222
+
223
+ if (! function_exists("get_current_screen")) return FALSE;
224
+
225
+ $current_screen = get_current_screen();
226
+ $is_plugin_page = FALSE;
227
+
228
+ // Check if current page is one of the ones defined in $options["menu"]
229
+ foreach ($options["menu"] as $one_post_type) {
230
+ if ( strpos($current_screen->id, "_page_cms-tpv-page-{$one_post_type}") !== FALSE) {
231
+ $is_plugin_page = TRUE;
232
+ break;
233
+ }
234
+ }
235
+
236
+ // Check if current page is one of the ones defined in $options["postsoverview"]
237
+ if ($current_screen->base === "edit" && in_array($current_screen->post_type, $options["postsoverview"])) {
238
+ $is_plugin_page = TRUE;
239
+ }
240
+
241
+ if ($current_screen->id === "settings_page_cms-tpv-options") {
242
+ // Is settings page for plugin
243
+ $is_plugin_page = TRUE;
244
+ } elseif ($current_screen->id === "dashboard" && !empty($options["dashboard"])) {
245
+ // At least one post type is enabled to be visible on dashboard
246
+ $is_plugin_page = TRUE;
247
+ }
248
+
249
+ return $is_plugin_page;
250
+
251
+ }
252
+
253
+ /**
254
+ * Add styles and scripts to pages that use the plugin
255
+ */
256
  function cms_admin_enqueue_scripts() {
257
 
258
+ if (cms_tpv_is_one_of_our_pages()) {
259
+
260
+ // renamed from cookie to fix problems with mod_security
261
+ wp_enqueue_script( "jquery-cookie", CMS_TPV_URL . "scripts/jquery.biscuit.js", array("jquery"));
262
+ wp_enqueue_script( "jquery-ui-sortable");
263
+ wp_enqueue_script( "jquery-jstree", CMS_TPV_URL . "scripts/jquery.jstree.js", false, CMS_TPV_VERSION);
264
+ wp_enqueue_script( "jquery-alerts", CMS_TPV_URL . "scripts/jquery.alerts.js", false, CMS_TPV_VERSION);
265
+ // wp_enqueue_script( "hoverIntent");
266
+ wp_enqueue_script( "cms_tree_page_view", CMS_TPV_URL . "scripts/cms_tree_page_view.js", false, CMS_TPV_VERSION);
267
+
268
+ wp_enqueue_style( "cms_tpv_styles", CMS_TPV_URL . "styles/styles.css", false, CMS_TPV_VERSION );
269
+ wp_enqueue_style( "jquery-alerts", CMS_TPV_URL . "styles/jquery.alerts.css", false, CMS_TPV_VERSION );
270
+
271
+ $oLocale = array(
272
+ "Enter_title_of_new_page" => __("Enter title of new page", 'cms-tree-page-view'),
273
+ "child_pages" => __("child pages", 'cms-tree-page-view'),
274
+ "Edit_page" => __("Edit page", 'cms-tree-page-view'),
275
+ "View_page" => __("View page", 'cms-tree-page-view'),
276
+ "Edit" => __("Edit", 'cms-tree-page-view'),
277
+ "View" => __("View", 'cms-tree-page-view'),
278
+ "Add_page" => __("Add page", 'cms-tree-page-view'),
279
+ "Add_new_page_after" => __("Add new page after", 'cms-tree-page-view'),
280
+ "after" => __("after", 'cms-tree-page-view'),
281
+ "inside" => __("inside", 'cms-tree-page-view'),
282
+ "Can_not_add_sub_page_when_status_is_draft" => __("Sorry, can't create a sub page to a page with status \"draft\".", 'cms-tree-page-view'),
283
+ "Can_not_add_sub_page_when_status_is_trash" => __("Sorry, can't create a sub page to a page with status \"trash\".", 'cms-tree-page-view'),
284
+ "Can_not_add_page_after_when_status_is_trash" => __("Sorry, can't create a page after a page with status \"trash\".", 'cms-tree-page-view'),
285
+ "Add_new_page_inside" => __("Add new page inside", 'cms-tree-page-view'),
286
+ "Status_draft" => __("draft", 'cms-tree-page-view'),
287
+ "Status_future" => __("future", 'cms-tree-page-view'),
288
+ "Status_password" => __("protected", 'cms-tree-page-view'), // is "protected" word better than "password" ?
289
+ "Status_pending" => __("pending", 'cms-tree-page-view'),
290
+ "Status_private" => __("private", 'cms-tree-page-view'),
291
+ "Status_trash" => __("trash", 'cms-tree-page-view'),
292
+ "Status_draft_ucase" => ucfirst( __("draft", 'cms-tree-page-view') ),
293
+ "Status_future_ucase" => ucfirst( __("future", 'cms-tree-page-view') ),
294
+ "Status_password_ucase" => ucfirst( __("protected", 'cms-tree-page-view') ), // is "protected" word better than "password" ?
295
+ "Status_pending_ucase" => ucfirst( __("pending", 'cms-tree-page-view') ),
296
+ "Status_private_ucase" => ucfirst( __("private", 'cms-tree-page-view') ),
297
+ "Status_trash_ucase" => ucfirst( __("trash", 'cms-tree-page-view') ),
298
+ "Password_protected_page" => __("Password protected page", 'cms-tree-page-view'),
299
+ "Adding_page" => __("Adding page...", 'cms-tree-page-view'),
300
+ "Adding" => __("Adding ...", 'cms-tree-page-view'),
301
+ "No posts found" => __("No posts found.", 'cms-tree-page-view')
302
+ );
303
+ wp_localize_script( "cms_tree_page_view", 'cmstpv_l10n', $oLocale);
304
 
305
+ }
306
 
307
  }
308
 
309
+ function cms_tpv_load_textdomain() {
310
+ // echo "load textdomain";
311
+ if (is_admin()) {
312
+ load_plugin_textdomain('cms-tree-page-view', WP_CONTENT_DIR . "/plugins/languages", "/cms-tree-page-view/languages");
313
+ }
314
+ }
315
 
316
  function cms_tpv_admin_init() {
317
 
318
  // DEBUG
319
  //wp_enqueue_script( "jquery-hotkeys" );
320
 
321
+ // add row to plugin page
322
+
323
+ add_filter( 'plugin_row_meta', 'cms_tpv_set_plugin_row_meta', 10, 2 );
324
+
325
+ }
326
+
327
+ /**
328
+ * Check if this is a post overview page and that plugin is enabled for this overview page
329
+ */
330
+ function cms_tpv_setup_postsoverview() {
331
+
332
+ $options = cms_tpv_get_options();
333
+ $current_screen = get_current_screen();
334
+
335
+ if ("edit" === $current_screen->base && in_array($current_screen->post_type, $options["postsoverview"])) {
336
+
337
+ // Ok, this is a post overview page that we are enabled for
338
+ add_filter("views_" . $current_screen->id, "cmstpv_filter_views_edit_postsoverview");
339
+
340
+ cmstpv_postoverview_head();
341
+
342
+ }
343
+
344
+ }
345
+
346
+ /**
347
+ * Add style etc to wp head to minimize flashing content
348
+ */
349
+ function cmstpv_postoverview_head() {
350
+
351
+ if ( isset($_GET["mode"]) && $_GET["mode"] === "tree" ) {
352
+ ?>
353
+ <style>
354
+ /* hide and position WP things */
355
+ /* TODO: move this to wp head so we don't have time to see wps own stuff */
356
+ .subsubsub, .tablenav.bottom, .tablenav .actions, .wp-list-table, .search-box, .tablenav .tablenav-pages { display: none !important; }
357
+ .tablenav.top { float: right; }
358
+ .view-switch { visibility: hidden; }
359
+ </style>
360
+ <?php
361
+ } else {
362
+ // post overview is enabled, but not active
363
+ // make room for our icon directly so page does not look jerky while adding it
364
+ ?>
365
+ <style>
366
+ .view-switch {
367
+ padding-right: 23px;
368
+ }
369
+ </style>
370
+ <?php
371
+ }
372
+
373
+ }
374
+
375
+ /**
376
+ * Output tree and html code for post overview page
377
+ */
378
+ function cmstpv_filter_views_edit_postsoverview($filter_var) {
379
+
380
+ $current_screen = get_current_screen();
381
+
382
+ ob_start();
383
+ cms_tpv_print_common_tree_stuff();
384
+ $tree_common_stuff = ob_get_clean();
385
+
386
+ /*
387
+ on non hierarcical post types this one exists:
388
+ tablenav-pages one-page
389
+ then after:
390
+ <div class="view-switch">
391
+
392
+ if view-switch exists: add item to it
393
+ if view-switch not exists: add it + item to it
394
+
395
+ http://playground.ep/wordpress/wp-admin/images/list.png
396
+ */
397
+ $mode = "tree";
398
+ $class = isset($_GET["mode"]) && $_GET["mode"] == $mode ? " class='current' " : "";
399
+ $title = __("Tree View", 'cms-tree-page-view');
400
+ $tree_a = "<a href='" . esc_url( add_query_arg( 'mode', $mode, $_SERVER['REQUEST_URI'] ) ) . "' $class> <img id='view-switch-$mode' src='" . esc_url( includes_url( 'images/blank.gif' ) ) . "' width='20' height='20' title='$title' alt='$title' /></a>\n";
401
+
402
+ // Copy of wordpress own, if it does not exist
403
+ $wp_list_a = "";
404
+ if (is_post_type_hierarchical( $current_screen->post_type ) ) {
405
+
406
+ $mode = "list";
407
+ $class = isset($_GET["mode"]) && $_GET["mode"] != $mode ? " class='cmstpv_add_list_view' " : " class='cmstpv_add_list_view current' ";
408
+ $title = __("List View");
409
+ $wp_list_a = "<a href='" . esc_url( add_query_arg( 'mode', $mode, $_SERVER['REQUEST_URI'] ) ) . "' $class><img id='view-switch-$mode' src='" . esc_url( includes_url( 'images/blank.gif' ) ) . "' width='20' height='20' title='$title' alt='$title' /></a>\n";
410
+
411
+ }
412
+
413
+ $out = "";
414
+ $out .= $tree_a;
415
+ $out .= $wp_list_a;
416
+
417
+ // Output tree related stuff if that view/mode is selected
418
+ if (isset($_GET["mode"]) && $_GET["mode"] === "tree") {
419
+
420
+ $out .= sprintf('
421
+ <div class="cmstpv-postsoverview-wrap">
422
+ %1$s
423
+ </div>
424
+ ', $tree_common_stuff);
425
+
426
+ }
427
+
428
+ echo $out;
429
+
430
+ return $filter_var;
431
 
432
  }
433
 
434
+
435
+ /**
436
+ * Add settings link to plugin page
437
+ * Hopefully this helps some people to find the settings page quicker
438
+ */
439
+ function cms_tpv_set_plugin_row_meta($links, $file) {
440
+
441
+ if ($file === "cms-tree-page-view/index.php") {
442
+ return array_merge(
443
+ $links,
444
+ array( sprintf( '<a href="options-general.php?page=%s">%s</a>', "cms-tpv-options", __('Settings') ) )
445
+ );
446
+ }
447
+ return $links;
448
+
449
+ }
450
+
451
+
452
+ /**
453
+ * Save settings, called when saving settings in general > cms tree page view
454
+ */
455
  function cms_tpv_save_settings() {
456
+
457
  if (isset($_POST["cms_tpv_action"]) && $_POST["cms_tpv_action"] == "save_settings") {
458
+
459
  $options = array();
460
  $options["dashboard"] = (array) $_POST["post-type-dashboard"];
461
  $options["menu"] = (array) $_POST["post-type-menu"];
462
+ $options["postsoverview"] = (array) $_POST["post-type-postsoverview"];
463
+
464
  update_option('cms_tpv_options', $options); // enable this to show box
465
+
466
  }
 
 
 
 
 
 
 
 
 
 
 
 
467
 
 
468
  }
469
 
470
+ /**
471
+ * Add widget to dashboard
472
+ */
473
  function cms_tpv_wp_dashboard_setup() {
474
+
475
+ // echo "setup dashboard";
476
+
477
  // add dashboard to capability edit_pages only
478
  if (current_user_can("edit_pages")) {
479
  $options = cms_tpv_get_options();
480
  foreach ($options["dashboard"] as $one_dashboard_post_type) {
481
  $post_type_object = get_post_type_object($one_dashboard_post_type);
482
  $new_func_name = create_function('', "cms_tpv_dashboard('$one_dashboard_post_type');");
483
+ $widget_name = sprintf( _x('%1$s Tree', "name of dashboard", "cms-tree-page-view"), $post_type_object->labels->name);
484
+ wp_add_dashboard_widget( "cms_tpv_dashboard_widget_{$one_dashboard_post_type}", $widget_name, $new_func_name );
485
  }
486
  }
487
+
488
  }
489
 
490
 
492
  * Output on dashboard
493
  */
494
  function cms_tpv_dashboard($post_type = "") {
495
+ //cms_tpv_show_annoying_box();
496
  cms_tpv_print_common_tree_stuff($post_type);
497
  }
498
 
508
  $slug = "edit.php?post_type=$one_menu_post_type";
509
  }
510
  $post_type_object = get_post_type_object($one_menu_post_type);
511
+
512
+ $menu_name = _x("Tree View", "name in menu", "cms-tree-page-view");
513
+ $page_title = sprintf(_x('%1$s Tree View', "title on page with tree", "cms-tree-page-view"), $post_type_object->labels->name);
514
+ add_submenu_page($slug, $page_title, $menu_name, $post_type_object->cap->edit_posts, "cms-tpv-page-$one_menu_post_type", "cms_tpv_pages_page");
515
  }
516
 
517
  add_submenu_page( 'options-general.php' , CMS_TPV_NAME, CMS_TPV_NAME, "administrator", "cms-tpv-options", "cms_tpv_options");
518
 
519
  }
520
 
 
521
  /**
522
  * Output options page
523
  */
524
  function cms_tpv_options() {
525
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
526
  ?>
527
  <div class="wrap">
528
 
529
+ <?php cms_tpv_show_annoying_box(); ?>
530
+
531
+ <?php screen_icon(); ?>
532
  <h2><?php echo CMS_TPV_NAME ?> <?php _e("settings", 'cms-tree-page-view') ?></h2>
533
 
534
+ <form method="post" action="options.php" class="cmtpv_options_form">
535
+
536
  <?php wp_nonce_field('update-options'); ?>
537
 
538
  <h3><?php _e("Select where to show a tree for pages and custom post types", 'cms-tree-page-view')?></h3>
539
 
540
+ <table class="form-table">
 
 
 
 
 
 
541
 
542
+ <tbody>
543
+
544
+ <?php
 
 
 
 
 
 
 
 
 
 
545
 
546
+ $options = cms_tpv_get_options();
547
+
548
+ $post_types = get_post_types(array(
549
+ "show_ui" => TRUE
550
+ ), "objects");
551
 
552
+ $arr_page_options = array();
553
+ foreach ($post_types as $one_post_type) {
554
+
555
+ $name = $one_post_type->name;
556
+
557
+ if ($name === "post") {
558
+ // no support for pages. you could show them.. but since we can't reorder them there is not idea to show them.. or..?
559
+ // 14 jul 2011: ok, let's enable it for posts too. some people says it useful
560
+ // http://wordpress.org/support/topic/this-plugin-should-work-also-on-posts
561
+ // continue;
562
+ } else if ($name === "attachment") {
563
+ // No support for media/attachment
564
+ continue;
565
+ }
566
+
567
+ $arr_page_options[] = "post-type-dashboard-$name";
568
+ $arr_page_options[] = "post-type-menu-$name";
569
+ $arr_page_options[] = "post-type-postsoverview-$name";
570
+
571
+ echo "<tr>";
572
+
573
+ echo "<th scope='row'>";
574
+ echo "<p>".$one_post_type->label."</p>";
575
+ echo "</th>";
576
+
577
+ echo "<td>";
578
+
579
+ echo "<p>";
580
+
581
+ $checked = (in_array($name, $options["dashboard"])) ? " checked='checked' " : "";
582
+ echo "<input $checked type='checkbox' name='post-type-dashboard[]' value='$name' id='post-type-dashboard-$name' /> <label for='post-type-dashboard-$name'>" . __("On dashboard", 'cms-tree-page-view') . "</label>";
583
+
584
+ echo "<br />";
585
+ $checked = (in_array($name, $options["menu"])) ? " checked='checked' " : "";
586
+ echo "<input $checked type='checkbox' name='post-type-menu[]' value='$name' id='post-type-menu-$name' /> <label for='post-type-menu-$name'>" . __("In menu", 'cms-tree-page-view') . "</label>";
587
+
588
+ echo "<br />";
589
+ $checked = (in_array($name, $options["postsoverview"])) ? " checked='checked' " : "";
590
+ echo "<input $checked type='checkbox' name='post-type-postsoverview[]' value='$name' id='post-type-postsoverview-$name' /> <label for='post-type-postsoverview-$name'>" . __("On post overview screen", 'cms-tree-page-view') . "</label>";
591
+
592
+ echo "</p>";
593
+
594
+ echo "</td>";
595
+
596
+ echo "</tr>";
597
+
598
+ }
599
+
600
+ ?>
601
+ </tbody>
602
+ </table>
603
 
 
 
604
  <input type="hidden" name="action" value="update" />
605
  <input type="hidden" name="cms_tpv_action" value="save_settings" />
606
  <input type="hidden" name="page_options" value="<?php echo join($arr_page_options, ",") ?>" />
607
  <p class="submit">
608
  <input type="submit" class="button-primary" value="<?php _e('Save Changes', 'cms-tree-page-view') ?>" />
609
  </p>
610
+
611
  </form>
612
+
613
  </div>
614
 
615
  <?php
616
  }
617
 
618
+ /**
619
+ * Load settings
620
+ * @return array with options
621
+ */
622
  function cms_tpv_get_options() {
623
  $arr_options = (array) get_option('cms_tpv_options');
624
+ $arr_options["dashboard"] = (array) @$arr_options["dashboard"];
625
+ $arr_options["menu"] = (array) @$arr_options["menu"];
626
+ $arr_options["postsoverview"] = (array) @$arr_options["postsoverview"];
627
  return $arr_options;
628
  }
629
 
639
  }
640
  if (!$post_type) {
641
  // no post type, happens with ozh admin drop down, so get it via page instead
642
+ $page = isset($_GET["page"]) ? $_GET["page"] : "";
643
  $post_type = str_replace("cms-tpv-page-", "", $page);
644
  }
645
 
659
  return $is_hierarchical;
660
  }
661
 
662
+ /**
663
+ * Get number of posts from WPML
664
+ */
665
+ function cms_tpv_get_wpml_post_counts($post_type) {
666
+
667
+ global $wpdb;
668
+
669
+ $arr_statuses = array("publish", "draft", "trash", "future", "private");
670
+ $arr_counts = array();
671
+
672
+ foreach ($arr_statuses as $post_status) {
673
+
674
+ $extra_cond = "";
675
+ if ($post_status){
676
+ $extra_cond .= " AND post_status = '" . $post_status . "'";
677
+ }
678
+ if ($post_status != 'trash'){
679
+ $extra_cond .= " AND post_status <> 'trash'";
680
+ }
681
+ $extra_cond .= " AND post_status <> 'auto-draft'";
682
+ $sql = "
683
+ SELECT language_code, COUNT(p.ID) AS c FROM {$wpdb->prefix}icl_translations t
684
+ JOIN {$wpdb->posts} p ON t.element_id=p.ID
685
+ JOIN {$wpdb->prefix}icl_languages l ON t.language_code=l.code AND l.active = 1
686
+ WHERE p.post_type='{$post_type}' AND t.element_type='post_{$post_type}' {$extra_cond}
687
+ GROUP BY language_code
688
+ ";
689
+
690
+ $res = $wpdb->get_results($sql);
691
+
692
+ $langs = array();
693
+ $langs['all'] = 0;
694
+ foreach($res as $r) {
695
+ $langs[$r->language_code] = $r->c;
696
+ $langs['all'] += $r->c;
697
+ }
698
+
699
+ $arr_counts[$post_status] = $langs;
700
+
701
+ }
702
+
703
+ return $arr_counts;
704
+
705
+ }
706
+
707
+
708
  /**
709
  * Print tree stuff that is common for both dashboard and page
710
  */
711
  function cms_tpv_print_common_tree_stuff($post_type = "") {
712
 
713
+ global $sitepress, $cms_tpv_view, $wpdb;
714
+
715
  if (!$post_type) {
716
  $post_type = cms_tpv_get_selected_post_type();
717
  }
718
+
719
  $post_type_object = get_post_type_object($post_type);
720
  $get_pages_args = array("post_type" => $post_type);
721
 
722
  $pages = cms_tpv_get_pages($get_pages_args);
723
 
724
+ // check if wpml is active and if this post type is one of its enabled ones
725
  $wpml_current_lang = "";
726
+ $wmpl_active_for_post = FALSE;
727
+ if (defined("ICL_SITEPRESS_VERSION")) {
728
+
729
+ $wpml_post_types = $sitepress->get_translatable_documents();
730
+ if (array_key_exists($post_type, $wpml_post_types)) {
731
+ $wmpl_active_for_post = TRUE;
732
+ $wpml_current_lang = $sitepress->get_current_language();
733
+ }
734
+
735
+ }
736
+
737
+ $status_data_attributes = array("all" => "", "publish" => "", "trash" => "");
738
+
739
+ // Calculate post counts
740
+ if ($wpml_current_lang) {
741
+
742
+ // Count code for WPML, mostly taken/inspired from WPML Multilingual CMS, sitepress.class.php
743
+ $langs = array();
744
+
745
+ $wpml_post_counts = cms_tpv_get_wpml_post_counts($post_type);
746
+
747
+ $post_count_all = (int) @$wpml_post_counts["private"][$wpml_current_lang] + (int) @$wpml_post_counts["future"][$wpml_current_lang] + (int) @$wpml_post_counts["publish"][$wpml_current_lang] + (int) @$wpml_post_counts["draft"][$wpml_current_lang];
748
+ $post_count_publish = (int) @$wpml_post_counts["publish"][$wpml_current_lang];
749
+ $post_count_trash = (int) @$wpml_post_counts["trash"][$wpml_current_lang];
750
+
751
+ foreach ($wpml_post_counts["publish"] as $one_wpml_lang => $one_wpml_lang_count) {
752
+ if ("all" === $one_wpml_lang) continue;
753
+ $lang_post_count_all = (int) @$wpml_post_counts["publish"][$one_wpml_lang] + (int) @$wpml_post_counts["draft"][$one_wpml_lang];
754
+ $lang_post_count_publish = (int) @$wpml_post_counts["publish"][$one_wpml_lang];
755
+ $lang_post_count_trash = (int) @$wpml_post_counts["trash"][$one_wpml_lang];
756
+ $status_data_attributes["all"] .= " data-post-count-{$one_wpml_lang}='{$lang_post_count_all}' ";
757
+ $status_data_attributes["publish"] .= " data-post-count-{$one_wpml_lang}='{$lang_post_count_publish}' ";
758
+ $status_data_attributes["trash"] .= " data-post-count-{$one_wpml_lang}='{$lang_post_count_trash}' ";
759
+ }
760
+
761
+ } else {
762
+ $post_count = wp_count_posts($post_type);
763
+ $post_count_all = $post_count->publish + $post_count->future + $post_count->draft + $post_count->pending + $post_count->private;
764
+ $post_count_publish = $post_count->publish;
765
+ $post_count_trash = $post_count->trash;
766
  }
767
 
 
768
  // output js for the root/top level
769
  // function cms_tpv_print_childs($pageID, $view = "all", $arrOpenChilds = null, $post_type) {
770
  // @todo: make into function since used at other places
779
  ob_start();
780
  cms_tpv_print_childs(0, $cms_tpv_view, $jstree_open, $post_type);
781
  $json_data = ob_get_clean();
782
+ if (! $json_data) $json_data = '{}';
783
  ?>
784
  <script type="text/javascript">
785
  cms_tpv_jsondata.<?php echo $post_type ?> = <?php echo $json_data ?>;
791
  <input type="hidden" name="cms_tpv_meta_wpml_language" value="<?php echo $wpml_current_lang ?>" />
792
  <?php
793
 
794
+ // check if WPML is activated and show a language-menu
795
+ if ($wmpl_active_for_post) {
796
+
797
  $wpml_langs = icl_get_languages();
798
  $wpml_active_lang = null;
799
  if (sizeof($wpml_langs)>=1) {
806
  $wpml_active_lang = $one_lang;
807
  $selected = "current";
808
  }
809
+
810
+ $lang_count = (int) @$wpml_post_counts["publish"][$one_lang["language_code"]] + (int) @$wpml_post_counts["draft"][$one_lang["language_code"]];
811
+
812
+ $lang_out .= "
813
+ <li>
814
+ <a class='cms_tvp_switch_lang $selected cms_tpv_switch_language_code_{$one_lang["language_code"]}' href='#'>
815
+ $one_lang_details[display_name]
816
+ <span class='count'>(" . $lang_count . ")</span>
817
+ </a> |</li>";
818
  }
819
+ $lang_out = preg_replace('/ \|<\/li>$/', "</li>", $lang_out);
820
  $lang_out .= "</ul>";
821
  echo $lang_out;
822
  }
823
+
824
  }
825
+
826
+ if (true) {
827
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
828
  // start the party!
829
+
830
  ?>
831
+ <ul class="cms-tpv-subsubsub cms-tpv-subsubsub-select-view">
832
+ <li class="cms_tvp_view_is_status_view">
833
+ <a class="cms_tvp_view_all <?php echo ($cms_tpv_view=="all") ? "current" : "" ?>" href="#" <?php echo $status_data_attributes["all"] ?>>
834
+ <?php _e("All", 'cms-tree-page-view') ?>
835
+ <span class="count">(<?php echo $post_count_all ?>)</span>
836
+ </a> |</li>
837
+ <li class="cms_tvp_view_is_status_view">
838
+ <a class="cms_tvp_view_public <?php echo ($cms_tpv_view=="public") ? "current" : "" ?>" href="#" <?php echo $status_data_attributes["publish"] ?>>
839
+ <?php _e("Public", 'cms-tree-page-view') ?>
840
+ <span class="count">(<?php echo $post_count_publish ?>)</span>
841
+ </a> |</li>
842
+ <li class="cms_tvp_view_is_status_view">
843
+ <a class="cms_tvp_view_trash <?php echo ($cms_tpv_view=="trash") ? "current" : "" ?>" href="#" <?php echo $status_data_attributes["trash"] ?>>
844
+ <?php _e("Trash", 'cms-tree-page-view') ?>
845
+ <span class="count">(<?php echo $post_count_trash ?>)</span>
846
+ </a>
847
+ </li>
848
 
849
  <?php
850
  if (cms_tpv_is_post_type_hierarchical($post_type_object)) {
859
  <form class="cms_tree_view_search_form" method="get" action="">
860
  <input type="text" name="search" class="cms_tree_view_search" />
861
  <a title="<?php _e("Clear search", 'cms-tree-page-view') ?>" class="cms_tree_view_search_form_reset" href="#">x</a>
862
+ <input type="submit" class="cms_tree_view_search_submit button button-small" value="<?php _e("Search", 'cms-tree-page-view') ?>" />
863
  <span class="cms_tree_view_search_form_working"><?php _e("Searching...", 'cms-tree-page-view') ?></span>
864
  <span class="cms_tree_view_search_form_no_hits"><?php _e("Nothing found.", 'cms-tree-page-view') ?></span>
865
  </form>
866
  </li>
867
+
868
  </ul>
869
 
870
  <div class="cms_tpv_working">
881
 
882
  <div style="clear: both;"></div>
883
 
884
+ <!-- template forpopup with actions -->
885
  <div class="cms_tpv_page_actions">
886
+
887
+ <!-- cms_tpv_page_actions_page_id -->
888
+ <h4 class="cms_tpv_page_actions_headline"></h4>
889
+
890
+ <p class="cms_tpv_action_edit_and_view">
891
+ <a href="#" title='<?php _e("Edit page", "cms-tree-page-view")?>' class='cms_tpv_action_edit'><?php _e("Edit", "cms-tree-page-view")?></a>
892
  <a href="#" title='<?php _e("View page", "cms-tree-page-view")?>' class='cms_tpv_action_view'><?php _e("View", "cms-tree-page-view")?></a>
893
  </p>
894
+
895
+ <!-- links to add page -->
896
  <p class="cms_tpv_action_add_and_edit_page">
897
+
898
  <span class='cms_tpv_action_add_page'><?php echo $post_type_object->labels->add_new_item ?></span>
899
+
900
  <a href="#" title='<?php _e("Add new page after", "cms-tree-page-view")?>' class='cms_tpv_action_add_page_after'><?php _e("After", "cms-tree-page-view")?></a>
901
+
902
  <?php
903
  // if post type is hierarchical we can add pages inside
904
  if (cms_tpv_is_post_type_hierarchical($post_type_object)) {
905
+ ?><a href="#" title='<?php _e("Add new page inside", "cms-tree-page-view")?>' class='cms_tpv_action_add_page_inside'><?php _e("Inside", "cms-tree-page-view")?></a><?php
906
  }
907
  // if post status = draft then we can not add pages inside because wordpress currently can not keep its parent if we edit the page
908
  ?>
909
  <!-- <span class="cms_tpv_action_add_page_inside_disallowed"><?php _e("Can not create page inside of a page with draft status", "cms-tree-page-view")?></span> -->
910
+
911
  </p>
912
+
913
+ <div class="cms_tpv_action_add_doit">
914
+
915
+ <form method="post" action="<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>">
916
+
917
+ <input type="hidden" name="action" value="cms_tpv_add_pages">
918
+ <input type="hidden" name="ref_post_id" value="">
919
+
920
+ <!-- lang for wpml -->
921
+ <input type="hidden" name="lang" value="">
922
+
923
+ <!-- <fieldset> -->
924
+
925
+ <h4><?php _e("Add page(s)", "cms-tree-page-view") ?></h4>
926
+
927
+ <div>
928
+ <!-- Pages<br> -->
929
+ <ul class="cms_tpv_action_add_doit_pages">
930
+ <li><span></span><input placeholder="<?php _e("Enter title here") ?>" type="text" name="cms_tpv_add_new_pages_names[]"></li>
931
+ </ul>
932
+ </div>
933
+
934
+ <div>
935
+ <?php _e("Position", "cms-tree-page-view") ?><br>
936
+ <label><input type="radio" name="cms_tpv_add_type" value="after"> <?php _e("After", "cms-tree-page-view") ?></label>
937
+ <label><input type="radio" name="cms_tpv_add_type" value="inside"> <?php _e("Inside", "cms-tree-page-view") ?></label>
938
+ </div>
939
+
940
+
941
+ <div>
942
+ <? _e("Status", "cms-tree-page-view") ?><br>
943
+ <label><input type="radio" name="cms_tpv_add_status" value="draft" checked> <?php _e("Draft", "cms-tree-page-view") ?></label>
944
+ <label><input type="radio" name="cms_tpv_add_status" value="published"> <?php _e("Published", "cms-tree-page-view") ?></label>
945
+ </div>
946
+
947
+ <div>
948
+ <input type="submit" value="<?php _e("Add", "cms-tree-page-view") ?>" class="button-primary">
949
+ <?php _e("or", "cms-tree-page-view") ?>
950
+ <a href="#" class="cms_tpv_add_cancel"><?php _e("cancel", "cms-tree-page-view") ?></a>
951
+ </div>
952
+
953
+ <!-- </fieldset> -->
954
+
955
+ </form>
956
+
957
+ </div>
958
+
959
  <dl>
960
  <dt><?php _e("Last modified", "cms-tree-page-view") ?></dt>
961
  <dd>
965
  <dt><?php _e("Page ID", "cms-tree-page-view") ?></dt>
966
  <dd><span class="cms_tpv_page_actions_page_id"></span></dd>
967
  </dl>
968
+
969
  <div class="cms_tpv_page_actions_columns"></div>
970
  <span class="cms_tpv_page_actions_arrow"></span>
971
  </div>
972
  <?php
973
  }
974
+
975
+ if (empty($pages)) {
976
+
977
+ echo '<div class="updated fade below-h2"><p>' . __("No posts found.", 'cms-tree-page-view') . '</p></div>';
978
+
979
+ }
980
+
981
  ?>
982
 
983
  </div>
994
  $post_type = cms_tpv_get_selected_post_type();
995
  $post_type_object = get_post_type_object($post_type);
996
 
997
+ if ( 'post' != $post_type ) {
998
+ $post_new_file = "post-new.php?post_type=$post_type";
999
+ } else {
1000
+ $post_new_file = 'post-new.php';
1001
+ }
1002
+
1003
  ?>
1004
  <div class="wrap">
1005
+ <?php echo get_screen_icon(); ?>
1006
+ <h2><?php
1007
+
1008
+ $page_title = sprintf(_x('%1$s Tree View', "headline of page with tree", "cms-tree-page-view"), $post_type_object->labels->name);
1009
+ echo $page_title;
1010
+
1011
+ // Add "add new" link the same way as the regular post page has
1012
+ if ( current_user_can( $post_type_object->cap->create_posts ) ) {
1013
+ echo ' <a href="' . esc_url( $post_new_file ) . '" class="add-new-h2">' . esc_html( $post_type_object->labels->add_new ) . '</a>';
1014
+ }
1015
+
1016
+ ?></h2>
1017
 
1018
  <?php
1019
  /*
1118
 
1119
  #do_action_ref_array('parse_query', array(&$this));
1120
  #print_r($get_posts_args);
1121
+
1122
  $pages = get_posts($get_posts_args);
1123
 
1124
  // filter out pages for wpml, by applying same filter as get_pages does
1159
 
1160
  global $post;
1161
 
1162
+ // Translated post statuses
1163
+ $post_statuses = get_post_statuses();
1164
+
1165
  #cms_tpv_firedebug(timer_stop());
1166
 
1167
  ?>[<?php
1172
  $tmpPost = $post;
1173
  $post = $onePage;
1174
  $page_id = $onePage->ID;
1175
+ $arrChildPages = NULL;
1176
 
1177
  $editLink = get_edit_post_link($onePage->ID, 'notDisplay');
1178
  $content = esc_html($onePage->post_content);
1185
  $arrChildPages = cms_tpv_get_pages("parent={$onePage->ID}&view=$view&post_type=$post_type");
1186
  }
1187
 
1188
+ if ( !empty($arrChildPages) ) {
1189
  $hasChildren = true;
1190
  }
1191
  // if no children, output no state
1273
  "data": {
1274
  "title": "<?php echo $title ?>",
1275
  "attr": {
1276
+ "href": "<?php echo $editLink ?>"
1277
+ <?php /* , "xid": "cms-tpv-<?php echo $onePage->ID ?>" */ ?>
1278
+ }<?php /*,
1279
+ "xicon": "<?php echo CMS_TPV_URL . "images/page_white_text.png" ?>"*/?>
1280
  },
1281
  "attr": {
1282
+ <?php /* "xhref": "<?php echo $editLink ?>", */ ?>
1283
  "id": "cms-tpv-<?php echo $onePage->ID ?>",
1284
+ <?php /* "xtitle": "<?php _e("Click to edit. Drag to move.", 'cms-tree-page-view') ?>", */ ?>
1285
  "class": "<?php echo $user_can_edit_page_css ?>"
1286
  },
1287
  <?php echo $strState ?>
1290
  "post_id": "<?php echo $onePage->ID ?>",
1291
  "post_type": "<?php echo $onePage->post_type ?>",
1292
  "post_status": "<?php echo $onePage->post_status ?>",
1293
+ "post_status_translated": "<?php echo isset($post_statuses[$onePage->post_status]) ? $post_statuses[$onePage->post_status] : $onePage->post_status ?>",
1294
  "rel": "<?php echo $rel ?>",
1295
+ "childCount": <?php echo ( !empty( $arrChildPages ) ) ? sizeof( $arrChildPages ) : 0 ; ?>,
1296
  "permalink": "<?php echo htmlspecialchars_decode(get_permalink($onePage->ID)) ?>",
1297
  "editlink": "<?php echo htmlspecialchars_decode($editLink) ?>",
1298
  "modified_time": "<?php echo $post_modified_time ?>",
1299
  "modified_author": "<?php echo $post_author ?>",
1300
  "columns": <?php echo $str_columns ?>,
1301
+ "user_can_edit_page": "<?php echo (int) $user_can_edit_page ?>",
1302
+ "post_title": "<?php echo $title ?>"
1303
  }
1304
  <?php
1305
  // if id is in $arrOpenChilds then also output children on this one
1306
+ // TODO: if only "a few" (< 100?) pages then load all, but keep closed, so we don't have to do the ajax thingie
1307
  if ($hasChildren && isset($arrOpenChilds) && in_array($onePage->ID, $arrOpenChilds)) {
1308
  ?>, "children": <?php
1309
  cms_tpv_print_childs($onePage->ID, $view, $arrOpenChilds, $post_type);
1327
  }
1328
 
1329
  // Act on AJAX-call
1330
+ // Get pages
1331
  function cms_tpv_get_childs() {
1332
 
1333
  header("Content-type: application/json");
1538
  $post_to_save = array(
1539
  "ID" => $post_node->ID,
1540
  "menu_order" => 0,
1541
+ "post_parent" => $post_ref_node->ID,
1542
+ "post_type" => $post_ref_node->post_type
1543
  );
1544
  wp_update_post( $post_to_save );
1545
 
1560
  $post_to_save = array(
1561
  "ID" => $post_node->ID,
1562
  "menu_order" => $post_ref_node->menu_order,
1563
+ "post_parent" => $post_ref_node->post_parent,
1564
+ "post_type" => $post_ref_node->post_type
1565
  );
1566
  wp_update_post( $post_to_save );
1567
 
1581
  $post_to_save = array(
1582
  "ID" => $post_node->ID,
1583
  "menu_order" => $post_ref_node->menu_order+1,
1584
+ "post_parent" => $post_ref_node->post_parent,
1585
+ "post_type" => $post_ref_node->post_type
1586
  );
1587
  wp_update_post( $post_to_save );
1588
 
1613
  * Show a box with some dontate-links and stuff
1614
  */
1615
  function cms_tpv_show_annoying_box() {
1616
+
1617
+ // update_option('cms_tpv_show_annoying_little_box', 1); // enable this to show box while testing
1618
+
1619
  if ( isset($_GET["action"]) && "cms_tpv_remove_annoying_box" == $_GET["action"] ) {
1620
  $show_box = 0;
1621
  update_option('cms_tpv_show_annoying_little_box', $show_box);
1625
  if ($show_box) {
1626
  ?>
1627
  <div class="cms_tpv_annoying_little_box">
1628
+
1629
+ <h3><?php _e('Thanks for using my plugin', 'cms-tree-page-view') ?></h3>
1630
+ <p class="cms_tpv_annoying_little_box_gravatar"><a href="https://twitter.com/eskapism"><?php echo get_avatar("par.thernstrom@gmail.com", '64'); ?></a></p>
1631
+ <p><?php _e('Hi there! I just wanna says thanks for using my plugin. I hope you like it as much as I do.', 'cms-tree-page-view') ?></p>
1632
+ <p class="cms_tpv_annoying_little_box_author"><a href="https://twitter.com/eskapism"><?php _e('/Pär Thernström - plugin creator', 'cms-tree-page-view') ?></a></p>
1633
+
1634
+ <h3><?php _e('I like this plugin<br>– how can I thank you?', 'cms-tree-page-view') ?></h3>
1635
+ <p><?php _e('There are serveral ways for you to show your appreciation:', 'cms-tree-page-view') ?></p>
1636
+ <ul>
1637
+ <li><?php printf(__('<a href="%1$s">Give it a nice review</a> over at the WordPress Plugin Directory', 'cms-tree-page-view'), "http://wordpress.org/support/view/plugin-reviews/cms-tree-page-view") ?></li>
1638
+ <li><?php printf(__('<a href="%1$s">Give a donation</a> – any amount will make me happy', 'cms-tree-page-view'), "http://eskapism.se/sida/donate/?utm_source=wordpress&utm_medium=banner&utm_campaign=promobox") ?></li>
1639
+ <li><?php printf(__('<a href="%1$s">Post a nice tweet</a> or make a nice blog post about the plugin', 'cms-tree-page-view'), "https://twitter.com/intent/tweet?text=I really like the CMS Tree Page View plugin for WordPress http://wordpress.org/extend/plugins/cms-tree-page-view/") ?></li>
1640
+ </ul>
1641
+
1642
+ <h3><?php _e('Support', 'cms-tree-page-view') ?></h3>
1643
+ <p><?php printf(__('Plese see the <a href="%1$s">support forum</a> for help.', 'cms-tree-page-view'), "http://wordpress.org/support/plugin/cms-tree-page-view") ?></p>
1644
+
1645
+ <p class="cms_tpv_annoying_little_box_close">
1646
+ <a href="<?php echo add_query_arg("action", "cms_tpv_remove_annoying_box")?>">
1647
+ <?php _e("Hide until next upgrade", 'cms-tree-page-view') ?>
1648
+ </a>
1649
+ </p>
1650
  </div>
1651
  <?php
1652
  }
1667
  // after upgrading/re-enabling the plugin, also re-enable the little please-donate-box
1668
  update_option('cms_tpv_show_annoying_little_box', 1);
1669
 
1670
+ // first install or pre custom posts version:
1671
+ // make sure pages are enabled by default
1672
+ // run on admin_init so most themes and plugins have time to setup their things. late prio too.
1673
+ add_action("admin_init", "cms_tpv_setup_defaults", 999);
1674
+
1675
+ // set to current version
1676
+ update_option('cms_tpv_version', CMS_TPV_VERSION);
1677
+ }
1678
+ #cms_tpv_install();
1679
+
1680
+ /**
1681
+ * setup some defaults
1682
+ */
1683
+ function cms_tpv_setup_defaults() {
1684
+
1685
  // check and update version
1686
  $version = get_option('cms_tpv_version', 0);
1687
+ #$version = 0; // uncomment to test default settings
1688
+
1689
  if ($version <= 0) {
1690
+
 
1691
  $options = array();
1692
+
1693
+ // Add pages to both dashboard and menu
1694
  $options["dashboard"] = array("page");
1695
+
1696
+ // since 0.10.1 enable menu for all hierarchical custom post types
1697
+ // since 1.2 also enable on post overview page
1698
+ $post_types = get_post_types(array(
1699
+ "show_ui" => TRUE,
1700
+ "hierarchical" => TRUE
1701
+ ), "objects");
1702
+
1703
+ foreach ($post_types as $one_post_type) {
1704
+ $options["menu"][] = $one_post_type->name;
1705
+ $options["postsoverview"][] = $one_post_type->name;
1706
+ }
1707
+
1708
+ $options["menu"] = array_unique($options["menu"]);
1709
+ $options["postsoverview"] = array_unique($options["postsoverview"]);
1710
+
1711
  update_option('cms_tpv_options', $options);
 
1712
 
1713
+ }
1714
+
1715
  }
1716
 
1717
  // when plugins are loaded, check if current plugin version is same as stored
index.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: CMS Tree Page View
4
  Plugin URI: http://eskapism.se/code-playground/cms-tree-page-view/
5
  Description: Adds a CMS-like tree view of all your pages, like the view often found in a page-focused CMS. Use the tree view to edit, view, add pages and search pages (very useful if you have many pages). And with drag and drop you can rearrange the order of your pages. Page management won't get any easier than this!
6
- Version: 0.8.9
7
  Author: Pär Thernström
8
  Author URI: http://eskapism.se/
9
  License: GPL2
@@ -26,28 +26,30 @@ License: GPL2
26
  */
27
 
28
  #require("functions.php");
29
- require(dirname(__FILE__)."/functions.php");
30
 
31
- define( "CMS_TPV_VERSION", "0.8.9");
32
  define( "CMS_TPV_NAME", "CMS Tree Page View");
33
 
34
- // This gives the full URL including http. Apparently is does not work with https (gives http-link instead)
35
- // On my system it will be: http://localhost/wp/wp-content/plugins/cms-tree-page-view/
36
- // define( "CMS_TPV_URL", WP_PLUGIN_URL . '/cms-tree-page-view/');
37
-
38
- // Define path to this plugin. This needs to be done in a kinda wierd way because of the fact that I use symblinks on my system.
39
- $plugin_dir_url = plugin_dir_url( __FILE__ ); // Gives wrong path on my system
40
- $arr_authors_wierd_local_paths = array(
41
- "/Users/bonny/Dropbox/Webb/"
42
- );
43
- $plugin_dir_url = str_replace($arr_authors_wierd_local_paths, "/", $plugin_dir_url);
44
 
45
- // Now we have http://localhost/wp/wp-content/pluginscms-tree-page-view/trunk/
46
- // So replace last /trunk/ part
47
- $plugin_dir_url = preg_replace("/\/trunk\/$/", "/", $plugin_dir_url);
 
 
 
 
 
 
 
 
 
48
 
49
  // There! Now we should have it.
50
  define( "CMS_TPV_URL", $plugin_dir_url);
 
 
 
51
 
52
  // on admin init: add styles and scripts
53
  add_action( 'admin_init', 'cms_tpv_admin_init' );
@@ -55,18 +57,22 @@ add_action( 'admin_enqueue_scripts', 'cms_admin_enqueue_scripts' );
55
  add_action( 'admin_init', 'cms_tpv_save_settings' );
56
 
57
  // Hook onto dashboard and admin menu
58
- add_action( 'wp_dashboard_setup', "cms_tpv_wp_dashboard_setup" );
59
  add_action( 'admin_menu', "cms_tpv_admin_menu" );
60
  add_action( 'admin_head', "cms_tpv_admin_head" );
 
61
 
62
  // Ajax hooks
63
  add_action('wp_ajax_cms_tpv_get_childs', 'cms_tpv_get_childs');
64
  add_action('wp_ajax_cms_tpv_move_page', 'cms_tpv_move_page');
65
  add_action('wp_ajax_cms_tpv_add_page', 'cms_tpv_add_page');
 
66
 
67
  // activation
68
  register_activation_hook( WP_PLUGIN_DIR . "/cms-tree-page-view/index.php" , 'cms_tpv_install' );
69
 
 
 
 
70
  // catch upgrade
71
  add_action('plugins_loaded', 'cms_tpv_plugins_loaded' , 1);
72
 
3
  Plugin Name: CMS Tree Page View
4
  Plugin URI: http://eskapism.se/code-playground/cms-tree-page-view/
5
  Description: Adds a CMS-like tree view of all your pages, like the view often found in a page-focused CMS. Use the tree view to edit, view, add pages and search pages (very useful if you have many pages). And with drag and drop you can rearrange the order of your pages. Page management won't get any easier than this!
6
+ Version: 1.2.1
7
  Author: Pär Thernström
8
  Author URI: http://eskapism.se/
9
  License: GPL2
26
  */
27
 
28
  #require("functions.php");
 
29
 
30
+ define( "CMS_TPV_VERSION", "1.2.1");
31
  define( "CMS_TPV_NAME", "CMS Tree Page View");
32
 
33
+ require(dirname(__FILE__)."/functions.php");
 
 
 
 
 
 
 
 
 
34
 
35
+ // Find the plugin directory URL
36
+ $aa = __FILE__;
37
+ if ( isset( $mu_plugin ) ) {
38
+ $aa = $mu_plugin;
39
+ }
40
+ if ( isset( $network_plugin ) ) {
41
+ $aa = $network_plugin;
42
+ }
43
+ if ( isset( $plugin ) ) {
44
+ $aa = $plugin;
45
+ }
46
+ $plugin_dir_url = plugin_dir_url(basename($aa)) . 'cms-tree-page-view/';
47
 
48
  // There! Now we should have it.
49
  define( "CMS_TPV_URL", $plugin_dir_url);
50
+ // define( "CMS_TPV_PLUGIN_FOLDERNAME_AND_FILENAME", basename(dirname(__FILE__)) . "/" . basename(__FILE__) );
51
+
52
+ add_action( 'init', 'cms_tpv_load_textdomain' );
53
 
54
  // on admin init: add styles and scripts
55
  add_action( 'admin_init', 'cms_tpv_admin_init' );
57
  add_action( 'admin_init', 'cms_tpv_save_settings' );
58
 
59
  // Hook onto dashboard and admin menu
 
60
  add_action( 'admin_menu', "cms_tpv_admin_menu" );
61
  add_action( 'admin_head', "cms_tpv_admin_head" );
62
+ add_action( 'wp_dashboard_setup', "cms_tpv_wp_dashboard_setup" );
63
 
64
  // Ajax hooks
65
  add_action('wp_ajax_cms_tpv_get_childs', 'cms_tpv_get_childs');
66
  add_action('wp_ajax_cms_tpv_move_page', 'cms_tpv_move_page');
67
  add_action('wp_ajax_cms_tpv_add_page', 'cms_tpv_add_page');
68
+ add_action('wp_ajax_cms_tpv_add_pages', 'cms_tpv_add_pages');
69
 
70
  // activation
71
  register_activation_hook( WP_PLUGIN_DIR . "/cms-tree-page-view/index.php" , 'cms_tpv_install' );
72
 
73
+ // To test activation hook, uncomment function below
74
+ // cms_tpv_install();
75
+
76
  // catch upgrade
77
  add_action('plugins_loaded', 'cms_tpv_plugins_loaded' , 1);
78
 
languages/cms-tree-page-view-et.mo ADDED
Binary file
languages/cms-tree-page-view-et.po ADDED
@@ -0,0 +1,267 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) 2010
2
+ # This file is distributed under the same license as the package.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: \n"
6
+ "Report-Msgid-Bugs-To: http://wordpress.org/tag/cms-tree-page-view\n"
7
+ "POT-Creation-Date: 2011-03-06 14:33:36+00:00\n"
8
+ "MIME-Version: 1.0\n"
9
+ "Content-Type: text/plain; charset=UTF-8\n"
10
+ "Content-Transfer-Encoding: 8bit\n"
11
+ "PO-Revision-Date: 2012-09-02 16:12+0200\n"
12
+ "Last-Translator: \n"
13
+ "Language-Team: LANGUAGE <LL@li.org>\n"
14
+
15
+ #: functions.php:53
16
+ msgid "Enter title of new page"
17
+ msgstr "Sisesta uue lehekülje pealkiri"
18
+
19
+ #: functions.php:54
20
+ msgid "child pages"
21
+ msgstr "alamleht"
22
+
23
+ #: functions.php:55 functions.php:381
24
+ msgid "Edit page"
25
+ msgstr "Muuda lehte"
26
+
27
+ #: functions.php:56 functions.php:382
28
+ msgid "View page"
29
+ msgstr "Vaata lehekülge"
30
+
31
+ #: functions.php:57 functions.php:381
32
+ msgid "Edit"
33
+ msgstr "Muuda"
34
+
35
+ #: functions.php:58 functions.php:382
36
+ msgid "View"
37
+ msgstr "Vaata"
38
+
39
+ #: functions.php:59
40
+ msgid "Add page"
41
+ msgstr "Lisa lehekülg"
42
+
43
+ #: functions.php:60 functions.php:386
44
+ msgid "Add new page after"
45
+ msgstr "Lisa uus lehekülg peale"
46
+
47
+ #: functions.php:61
48
+ msgid "after"
49
+ msgstr "peale"
50
+
51
+ #: functions.php:62
52
+ msgid "inside"
53
+ msgstr "sees"
54
+
55
+ #: functions.php:63
56
+ msgid "Sorry, can't create a sub page to a page with status \"draft\"."
57
+ msgstr "Vabandust! Ei saa luua alamlehte, kui lehekülje staatus on \"draft\"."
58
+
59
+ #: functions.php:64
60
+ msgid "Sorry, can't create a sub page to a page with status \"trash\"."
61
+ msgstr "Vabandust! Ei saa luua alamlehte, kui lehekülje staatus on \"trash\"."
62
+
63
+ #: functions.php:65
64
+ msgid "Sorry, can't create a page after a page with status \"trash\"."
65
+ msgstr ""
66
+ "Vabandust! Ei ei ole võimalik luua uut lehekülge peale lehte, mille staatus "
67
+ "on \"trash\"."
68
+
69
+ #: functions.php:66 functions.php:390
70
+ msgid "Add new page inside"
71
+ msgstr "Lisa uus alamleht"
72
+
73
+ #: functions.php:67
74
+ msgid "draft"
75
+ msgstr "mustand"
76
+
77
+ #: functions.php:68
78
+ msgid "future"
79
+ msgstr "võimalus"
80
+
81
+ #: functions.php:69
82
+ msgid "protected"
83
+ msgstr "kaitstud"
84
+
85
+ #: functions.php:70 functions.php:644
86
+ msgid "pending"
87
+ msgstr "pooleliolev"
88
+
89
+ #: functions.php:71
90
+ msgid "private"
91
+ msgstr "privaatne"
92
+
93
+ #: functions.php:72
94
+ msgid "trash"
95
+ msgstr "prügi"
96
+
97
+ #: functions.php:73
98
+ msgid "Password protected page"
99
+ msgstr "Parooliga kaitstud lehekülg"
100
+
101
+ #: functions.php:74
102
+ msgid "Adding page..."
103
+ msgstr "Lisan lehekülge..."
104
+
105
+ #: functions.php:175
106
+ msgid "settings"
107
+ msgstr "seaded"
108
+
109
+ #: functions.php:180
110
+ msgid "Select where to show a tree for pages and custom post types"
111
+ msgstr "Vali kus näidatakse järiekorra muutmise võimalust"
112
+
113
+ #: functions.php:204
114
+ msgid "On dashboard"
115
+ msgstr "Töölaual"
116
+
117
+ #: functions.php:208
118
+ msgid "In menu"
119
+ msgstr "Menüüs"
120
+
121
+ #: functions.php:219
122
+ msgid "Save Changes"
123
+ msgstr "Salvesta muudatused"
124
+
125
+ #: functions.php:335
126
+ msgid "No posts found."
127
+ msgstr "Postitusi ei leitud"
128
+
129
+ #: functions.php:341
130
+ msgid "All"
131
+ msgstr "Kõik"
132
+
133
+ #: functions.php:342
134
+ msgid "Public"
135
+ msgstr "Avalik"
136
+
137
+ #: functions.php:343
138
+ msgid "Trash"
139
+ msgstr "Prügi"
140
+
141
+ #: functions.php:348
142
+ msgid "Expand"
143
+ msgstr "Laienda"
144
+
145
+ #: functions.php:349
146
+ msgid "Collapse"
147
+ msgstr "Kollaps"
148
+
149
+ #: functions.php:357
150
+ msgid "Clear search"
151
+ msgstr "Tühista otsing"
152
+
153
+ #: functions.php:358
154
+ msgid "Search"
155
+ msgstr "Otsi"
156
+
157
+ #: functions.php:359
158
+ msgid "Searching..."
159
+ msgstr "Otsin..."
160
+
161
+ #: functions.php:360
162
+ msgid "Nothing found."
163
+ msgstr "Midagi ei leitud."
164
+
165
+ #: functions.php:366
166
+ msgid "Loading..."
167
+ msgstr "Laen..."
168
+
169
+ #: functions.php:371
170
+ msgid "Search: no pages found"
171
+ msgstr "Otsing: lehekülgi ei leitud"
172
+
173
+ #: functions.php:374
174
+ msgid "Loading tree"
175
+ msgstr "Laen"
176
+
177
+ #: functions.php:386
178
+ msgid "After"
179
+ msgstr "Peale"
180
+
181
+ #: functions.php:390
182
+ msgid "Inside"
183
+ msgstr "Sees"
184
+
185
+ #: functions.php:394
186
+ msgid "Can not create page inside of a page with draft status"
187
+ msgstr "Ei saa luua alamlehte, kui lehekülg on mustand"
188
+
189
+ #: functions.php:397
190
+ msgid "Last modified"
191
+ msgstr "Viimati muudetud"
192
+
193
+ #: functions.php:399
194
+ msgid "by"
195
+ msgstr " "
196
+
197
+ #: functions.php:402
198
+ msgid "Page ID"
199
+ msgstr "Lehekülje ID"
200
+
201
+ #: functions.php:609
202
+ msgid "Unknown user"
203
+ msgstr "Tundmatu kasutaja"
204
+
205
+ #: functions.php:614
206
+ msgid "<Untitled page>"
207
+ msgstr "<Pealkirjata lehekülg>"
208
+
209
+ #: functions.php:634
210
+ msgid "Comments"
211
+ msgstr "Kommentaarid"
212
+
213
+ #: functions.php:641
214
+ msgid "%s pending"
215
+ msgstr "% pooleli"
216
+
217
+ #: functions.php:651
218
+ msgctxt "comment count"
219
+ msgid "0"
220
+ msgstr "0"
221
+
222
+ #: functions.php:651
223
+ msgctxt "comment count"
224
+ msgid "1"
225
+ msgstr "1"
226
+
227
+ #: functions.php:651
228
+ msgctxt "comment count"
229
+ msgid "%"
230
+ msgstr "%"
231
+
232
+ #: functions.php:682
233
+ msgid "Click to edit. Drag to move."
234
+ msgstr "Kliki muutmiseks. Lohista liigutamiseks."
235
+
236
+ #: functions.php:833
237
+ msgid "New page"
238
+ msgstr "Uus lehekülg"
239
+
240
+ #: functions.php:1015
241
+ msgid "Close"
242
+ msgstr "Sulge"
243
+
244
+ #: functions.php:1016
245
+ msgid ""
246
+ "<strong>Thank you for using this plugin!</strong> If you need help please "
247
+ "check out the <a href=\"http://eskapism.se/code-playground/cms-tree-page-"
248
+ "view/?utm_source=wordpress&utm_medium=banner&utm_campaign=promobox\">plugin "
249
+ "homepage</a> or the <a href=\"http://wordpress.org/tags/cms-tree-page-view?"
250
+ "forum_id=10\">support forum</a>."
251
+ msgstr ""
252
+ "<strong>Tänan et kasutad meie pluginat!</strong> Vajadusel külasta <a href="
253
+ "\"http://eskapism.se/code-playground/cms-tree-page-view/?"
254
+ "utm_source=wordpress&utm_medium=banner&utm_campaign=promobox\">plugina "
255
+ "kodulehte</a>või <a href=\"http://wordpress.org/tags/cms-tree-page-view?"
256
+ "forum_id=10\">tugifoorumit</a>."
257
+
258
+ #: functions.php:1017
259
+ msgid ""
260
+ "If you like this plugin, please <a href=\"http://eskapism.se/sida/donate/?"
261
+ "utm_source=wordpress&utm_medium=banner&utm_campaign=promobox\">support my "
262
+ "work by donating</a> - or at least say something nice about this plugin in a "
263
+ "blog post or tweet."
264
+ msgstr ""
265
+ "Kui meie plugin sulle meeldib <a href=\"http://eskapism.se/sida/donate/?"
266
+ "utm_source=wordpress&utm_medium=banner&utm_campaign=promobox\">toeta meie "
267
+ "tööd annetades</a>."
languages/cms-tree-page-view-lt_LT.mo CHANGED
Binary file
languages/cms-tree-page-view-lt_LT.po CHANGED
@@ -1,323 +1,320 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: \n"
4
- "Report-Msgid-Bugs-To: http://wordpress.org/tag/cms-tree-page-view\n"
5
- "POT-Creation-Date: 2011-03-06 14:33:36+00:00\n"
6
- "PO-Revision-Date: 2010-MO-DA HO:MI+ZONE\n"
7
- "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
- "Language-Team: LANGUAGE <LL@li.org>\n"
9
- "MIME-Version: 1.0\n"
10
- "Content-Type: text/plain; charset=UTF-8\n"
11
- "Content-Transfer-Encoding: 8bit\n"
12
- "Plural-Forms: nplurals=2; plural=n != 1;\n"
13
- "X-Poedit-Language: \n"
14
- "X-Poedit-Country: \n"
15
- "X-Poedit-SourceCharset: utf-8\n"
16
- "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;\n"
17
- "X-Poedit-Basepath: \n"
18
- "X-Poedit-Bookmarks: \n"
19
- "X-Poedit-SearchPath-0: .\n"
20
- "X-Textdomain-Support: yes"
21
-
22
- #: functions.php:55
23
- #@ cms-tree-page-view
24
- msgid "Enter title of new page"
25
- msgstr "Naujo puslapio pavadinimas"
26
-
27
- #: functions.php:56
28
- #@ cms-tree-page-view
29
- msgid "child pages"
30
- msgstr "vidinis puslapis"
31
-
32
- #: functions.php:57
33
- #: functions.php:401
34
- #@ cms-tree-page-view
35
- msgid "Edit page"
36
- msgstr "Redaguoti puslapį"
37
-
38
- #: functions.php:58
39
- #: functions.php:402
40
- #@ cms-tree-page-view
41
- msgid "View page"
42
- msgstr "Peržiūrėti puslapį"
43
-
44
- #: functions.php:59
45
- #: functions.php:401
46
- #@ cms-tree-page-view
47
- msgid "Edit"
48
- msgstr "Redaguoti"
49
-
50
- #: functions.php:60
51
- #: functions.php:402
52
- #@ cms-tree-page-view
53
- msgid "View"
54
- msgstr "Peržiūrėti"
55
-
56
- #: functions.php:61
57
- #@ cms-tree-page-view
58
- msgid "Add page"
59
- msgstr "Pridėti puslapį"
60
-
61
- #: functions.php:62
62
- #: functions.php:406
63
- #@ cms-tree-page-view
64
- msgid "Add new page after"
65
- msgstr "Pridėti puslapį po"
66
-
67
- #: functions.php:63
68
- #@ cms-tree-page-view
69
- msgid "after"
70
- msgstr "po"
71
-
72
- #: functions.php:64
73
- #@ cms-tree-page-view
74
- msgid "inside"
75
- msgstr "viduje"
76
-
77
- #: functions.php:65
78
- #@ cms-tree-page-view
79
- msgid "Sorry, can't create a sub page to a page with status \"draft\"."
80
- msgstr "Atsiprašome, negalima sukurti gylesnio meniu puslapio su \"draft\" būsena."
81
-
82
- #: functions.php:66
83
- #@ cms-tree-page-view
84
- msgid "Sorry, can't create a sub page to a page with status \"trash\"."
85
- msgstr "Atsiprašome, negalima sukurti gylesnio meniu puslapio su \"trash\" būsena."
86
-
87
- #: functions.php:67
88
- #@ cms-tree-page-view
89
- msgid "Sorry, can't create a page after a page with status \"trash\"."
90
- msgstr "Atsiprašome, negalima sukurti puslapio po puslapio su \"trash\" būsena."
91
-
92
- #: functions.php:68
93
- #: functions.php:410
94
- #@ cms-tree-page-view
95
- msgid "Add new page inside"
96
- msgstr "Pridėti naują puslapį viduje"
97
-
98
- #: functions.php:69
99
- #@ cms-tree-page-view
100
- msgid "draft"
101
- msgstr "eskizas"
102
-
103
- #: functions.php:70
104
- #@ cms-tree-page-view
105
- msgid "future"
106
- msgstr "būsimas"
107
-
108
- #: functions.php:71
109
- #@ cms-tree-page-view
110
- msgid "protected"
111
- msgstr "apsaugotas"
112
-
113
- #: functions.php:72
114
- #: functions.php:673
115
- #@ cms-tree-page-view
116
- #@ default
117
- msgid "pending"
118
- msgstr "laukiamas"
119
-
120
- #: functions.php:73
121
- #@ cms-tree-page-view
122
- msgid "private"
123
- msgstr "privatus"
124
-
125
- #: functions.php:74
126
- #@ cms-tree-page-view
127
- msgid "trash"
128
- msgstr "šiukšlė"
129
-
130
- #: functions.php:75
131
- #@ cms-tree-page-view
132
- msgid "Password protected page"
133
- msgstr "Slaptažodžiu apsaugotas puslapis"
134
-
135
- #: functions.php:76
136
- #@ cms-tree-page-view
137
- msgid "Adding page..."
138
- msgstr "Pridedamas puslapis..."
139
-
140
- #: functions.php:178
141
- #@ cms-tree-page-view
142
- msgid "settings"
143
- msgstr "nustatymai"
144
-
145
- #: functions.php:183
146
- #@ cms-tree-page-view
147
- msgid "Select where to show a tree for pages and custom post types"
148
- msgstr "Pasirinkite, kur parodyti medį puslapiams ir pasirinktų pasisakymų tipų"
149
-
150
- #: functions.php:209
151
- #@ cms-tree-page-view
152
- msgid "On dashboard"
153
- msgstr "Ant skydelio"
154
-
155
- #: functions.php:213
156
- #@ cms-tree-page-view
157
- msgid "In menu"
158
- msgstr "Meniu"
159
-
160
- #: functions.php:224
161
- #@ cms-tree-page-view
162
- msgid "Save Changes"
163
- msgstr "Išsaugoti pakeitimus"
164
-
165
- #: functions.php:355
166
- #@ cms-tree-page-view
167
- msgid "No posts found."
168
- msgstr "Nerasti pasisakymai."
169
-
170
- #: functions.php:361
171
- #@ cms-tree-page-view
172
- msgid "All"
173
- msgstr "VIsi"
174
-
175
- #: functions.php:362
176
- #@ cms-tree-page-view
177
- msgid "Public"
178
- msgstr "Viešas"
179
-
180
- #: functions.php:363
181
- #@ cms-tree-page-view
182
- msgid "Trash"
183
- msgstr "Šiukšlė"
184
-
185
- #: functions.php:368
186
- #@ cms-tree-page-view
187
- msgid "Expand"
188
- msgstr "Išplėsti"
189
-
190
- #: functions.php:369
191
- #@ cms-tree-page-view
192
- msgid "Collapse"
193
- msgstr "Sutraukti"
194
-
195
- #: functions.php:377
196
- #@ cms-tree-page-view
197
- msgid "Clear search"
198
- msgstr "Išvalyti paiešką"
199
-
200
- #: functions.php:378
201
- #@ cms-tree-page-view
202
- msgid "Search"
203
- msgstr "Ieškoti"
204
-
205
- #: functions.php:379
206
- #@ cms-tree-page-view
207
- msgid "Searching..."
208
- msgstr "Ieškoma..."
209
-
210
- #: functions.php:380
211
- #@ cms-tree-page-view
212
- msgid "Nothing found."
213
- msgstr "NIeko nerasta."
214
-
215
- #: functions.php:386
216
- #@ cms-tree-page-view
217
- msgid "Loading..."
218
- msgstr "Kraunama..."
219
-
220
- #: functions.php:391
221
- #@ cms-tree-page-view
222
- msgid "Search: no pages found"
223
- msgstr "Paieška: puslapiai nerasti"
224
-
225
- #: functions.php:394
226
- #@ cms-tree-page-view
227
- msgid "Loading tree"
228
- msgstr "Kraunamas medis"
229
-
230
- #: functions.php:406
231
- #@ cms-tree-page-view
232
- msgid "After"
233
- msgstr "Po"
234
-
235
- #: functions.php:410
236
- #@ cms-tree-page-view
237
- msgid "Inside"
238
- msgstr "Viduje"
239
-
240
- #: functions.php:414
241
- #@ cms-tree-page-view
242
- msgid "Can not create page inside of a page with draft status"
243
- msgstr "Negalima sukurti puslapio viduje su statusu šiukšlė"
244
-
245
- #: functions.php:417
246
- #@ cms-tree-page-view
247
- msgid "Last modified"
248
- msgstr "Vėliausiai redaguota"
249
-
250
- #: functions.php:419
251
- #@ cms-tree-page-view
252
- msgid "by"
253
- msgstr " "
254
-
255
- #: functions.php:422
256
- #@ cms-tree-page-view
257
- msgid "Page ID"
258
- msgstr "Puslapio ID"
259
-
260
- #: functions.php:638
261
- #@ cms-tree-page-view
262
- msgid "Unknown user"
263
- msgstr "Nežinomas vartotojas"
264
-
265
- #: functions.php:643
266
- #@ cms-tree-page-view
267
- msgid "<Untitled page>"
268
- msgstr "<Nepavadintas puslapis>"
269
-
270
- #: functions.php:663
271
- #@ default
272
- msgid "Comments"
273
- msgstr ""
274
-
275
- #: functions.php:670
276
- #, php-format
277
- #@ default
278
- msgid "%s pending"
279
- msgstr ""
280
-
281
- #: functions.php:680
282
- #@ default
283
- msgctxt "comment count"
284
- msgid "0"
285
- msgstr ""
286
-
287
- #: functions.php:680
288
- #@ default
289
- msgctxt "comment count"
290
- msgid "1"
291
- msgstr ""
292
-
293
- #: functions.php:680
294
- #@ default
295
- msgctxt "comment count"
296
- msgid "%"
297
- msgstr ""
298
-
299
- #: functions.php:711
300
- #@ cms-tree-page-view
301
- msgid "Click to edit. Drag to move."
302
- msgstr "Spragtelt redaguoti. Tempti."
303
-
304
- #: functions.php:862
305
- #@ cms-tree-page-view
306
- msgid "New page"
307
- msgstr "Naujas puslapis"
308
-
309
- #: functions.php:1046
310
- #@ cms-tree-page-view
311
- msgid "Close"
312
- msgstr "Uždaryti"
313
-
314
- #: functions.php:1047
315
- #@ cms-tree-page-view
316
- msgid "<strong>Thank you for using this plugin!</strong> If you need help please check out the <a href=\"http://eskapism.se/code-playground/cms-tree-page-view/?utm_source=wordpress&utm_medium=banner&utm_campaign=promobox\">plugin homepage</a> or the <a href=\"http://wordpress.org/tags/cms-tree-page-view?forum_id=10\">support forum</a>."
317
- msgstr "<strong>Ačiū, kad naudojate šį įskiepį!</strong>Jei Jums reikia pagalbos, žiūrėkita čia<a href=\"http://eskapism.se/code-playground/cms-tree-page-view/?utm_source=wordpress&utm_medium=banner&utm_campaign=promobox\">įskiepio namų puslapis</a> arba <a href=\"http://wordpress.org/tags/cms-tree-page-view?forum_id=10\">pagalbos diskusijos</a>."
318
-
319
- #: functions.php:1048
320
- #@ cms-tree-page-view
321
- msgid "If you like this plugin, please <a href=\"http://eskapism.se/sida/donate/?utm_source=wordpress&utm_medium=banner&utm_campaign=promobox\">support my work by donating</a> - or at least say something nice about this plugin in a blog post or tweet."
322
- msgstr "Jei Jums patinka šis įskiepis, prašau <a href=\"http://eskapism.se/sida/donate/?utm_source=wordpress&utm_medium=banner&utm_campaign=promobox\">paremti mano darbą</a> - arba parašyti ką nors gražaus apie šį įskiepį bloge ar pasakyti."
323
-
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: \n"
4
+ "Report-Msgid-Bugs-To: http://wordpress.org/tag/cms-tree-page-view\n"
5
+ "POT-Creation-Date: 2011-03-06 14:33:36+00:00\n"
6
+ "PO-Revision-Date: 2012-04-03 17:15+0200\n"
7
+ "Last-Translator: Gediminas <gcekanauskas@gmail.com>\n"
8
+ "Language-Team: Gediminas <gcekanauskas@gmail.com>\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "Plural-Forms: nplurals=2; plural=n != 1;\n"
13
+ "X-Poedit-SourceCharset: utf-8\n"
14
+ "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2\n"
15
+ "X-Textdomain-Support: yes\n"
16
+ "X-Poedit-Basepath: .\n"
17
+ "X-Poedit-SearchPath-0: .\n"
18
+
19
+ #@ cms-tree-page-view
20
+ #: functions.php:55
21
+ msgid "Enter title of new page"
22
+ msgstr "Naujo puslapio pavadinimas"
23
+
24
+ #@ cms-tree-page-view
25
+ #: functions.php:56
26
+ msgid "child pages"
27
+ msgstr "vidinis puslapis"
28
+
29
+ #@ cms-tree-page-view
30
+ #: functions.php:57
31
+ #: functions.php:401
32
+ msgid "Edit page"
33
+ msgstr "Redaguoti puslapį"
34
+
35
+ #@ cms-tree-page-view
36
+ #: functions.php:58
37
+ #: functions.php:402
38
+ msgid "View page"
39
+ msgstr "Peržiūrėti puslapį"
40
+
41
+ #@ cms-tree-page-view
42
+ #: functions.php:59
43
+ #: functions.php:401
44
+ msgid "Edit"
45
+ msgstr "Redaguoti"
46
+
47
+ #@ cms-tree-page-view
48
+ #: functions.php:60
49
+ #: functions.php:402
50
+ msgid "View"
51
+ msgstr "Peržiūrėti"
52
+
53
+ #@ cms-tree-page-view
54
+ #: functions.php:61
55
+ msgid "Add page"
56
+ msgstr "Pridėti puslapį"
57
+
58
+ #@ cms-tree-page-view
59
+ #: functions.php:62
60
+ #: functions.php:406
61
+ msgid "Add new page after"
62
+ msgstr "Pridėti puslapį po"
63
+
64
+ #@ cms-tree-page-view
65
+ #: functions.php:63
66
+ msgid "after"
67
+ msgstr "po"
68
+
69
+ #@ cms-tree-page-view
70
+ #: functions.php:64
71
+ msgid "inside"
72
+ msgstr "viduje"
73
+
74
+ #@ cms-tree-page-view
75
+ #: functions.php:65
76
+ msgid "Sorry, can't create a sub page to a page with status \"draft\"."
77
+ msgstr "Atsiprašome, negalima sukurti gilesnio meniu puslapio su \"draft\" būsena."
78
+
79
+ #@ cms-tree-page-view
80
+ #: functions.php:66
81
+ msgid "Sorry, can't create a sub page to a page with status \"trash\"."
82
+ msgstr "Atsiprašome, negalima sukurti gilesnio meniu puslapio su \"trash\" būsena."
83
+
84
+ #@ cms-tree-page-view
85
+ #: functions.php:67
86
+ msgid "Sorry, can't create a page after a page with status \"trash\"."
87
+ msgstr "Atsiprašome, negalima sukurti puslapio po puslapio su \"trash\" būsena."
88
+
89
+ #@ cms-tree-page-view
90
+ #: functions.php:68
91
+ #: functions.php:410
92
+ msgid "Add new page inside"
93
+ msgstr "Pridėti naują puslapį viduje"
94
+
95
+ #@ cms-tree-page-view
96
+ #: functions.php:69
97
+ msgid "draft"
98
+ msgstr "eskizas"
99
+
100
+ #@ cms-tree-page-view
101
+ #: functions.php:70
102
+ msgid "future"
103
+ msgstr "būsimas"
104
+
105
+ #@ cms-tree-page-view
106
+ #: functions.php:71
107
+ msgid "protected"
108
+ msgstr "apsaugotas"
109
+
110
+ #@ cms-tree-page-view
111
+ #@ default
112
+ #: functions.php:72
113
+ #: functions.php:673
114
+ msgid "pending"
115
+ msgstr "laukiamas"
116
+
117
+ #@ cms-tree-page-view
118
+ #: functions.php:73
119
+ msgid "private"
120
+ msgstr "privatus"
121
+
122
+ #@ cms-tree-page-view
123
+ #: functions.php:74
124
+ msgid "trash"
125
+ msgstr "šiukšlė"
126
+
127
+ #@ cms-tree-page-view
128
+ #: functions.php:75
129
+ msgid "Password protected page"
130
+ msgstr "Slaptažodžiu apsaugotas puslapis"
131
+
132
+ #@ cms-tree-page-view
133
+ #: functions.php:76
134
+ msgid "Adding page..."
135
+ msgstr "Pridedamas puslapis..."
136
+
137
+ #@ cms-tree-page-view
138
+ #: functions.php:178
139
+ msgid "settings"
140
+ msgstr "nustatymai"
141
+
142
+ #@ cms-tree-page-view
143
+ #: functions.php:183
144
+ msgid "Select where to show a tree for pages and custom post types"
145
+ msgstr "Pasirinkite, kuriems įrašų tipams rodyti medžio struktūrą"
146
+
147
+ #@ cms-tree-page-view
148
+ #: functions.php:209
149
+ msgid "On dashboard"
150
+ msgstr "Ant skydelio"
151
+
152
+ #@ cms-tree-page-view
153
+ #: functions.php:213
154
+ msgid "In menu"
155
+ msgstr "Meniu"
156
+
157
+ #@ cms-tree-page-view
158
+ #: functions.php:224
159
+ msgid "Save Changes"
160
+ msgstr "Išsaugoti pakeitimus"
161
+
162
+ #@ cms-tree-page-view
163
+ #: functions.php:355
164
+ msgid "No posts found."
165
+ msgstr "Įrašų nerasta."
166
+
167
+ #@ cms-tree-page-view
168
+ #: functions.php:361
169
+ msgid "All"
170
+ msgstr "Visi"
171
+
172
+ #@ cms-tree-page-view
173
+ #: functions.php:362
174
+ msgid "Public"
175
+ msgstr "Paskelbti"
176
+
177
+ #@ cms-tree-page-view
178
+ #: functions.php:363
179
+ msgid "Trash"
180
+ msgstr "Šiukšlinėje"
181
+
182
+ #@ cms-tree-page-view
183
+ #: functions.php:368
184
+ msgid "Expand"
185
+ msgstr "Išplėsti visus"
186
+
187
+ #@ cms-tree-page-view
188
+ #: functions.php:369
189
+ msgid "Collapse"
190
+ msgstr "Sutraukti visus"
191
+
192
+ #@ cms-tree-page-view
193
+ #: functions.php:377
194
+ msgid "Clear search"
195
+ msgstr "Išvalyti paiešką"
196
+
197
+ #@ cms-tree-page-view
198
+ #: functions.php:378
199
+ msgid "Search"
200
+ msgstr "Ieškoti"
201
+
202
+ #@ cms-tree-page-view
203
+ #: functions.php:379
204
+ msgid "Searching..."
205
+ msgstr "Ieškoma..."
206
+
207
+ #@ cms-tree-page-view
208
+ #: functions.php:380
209
+ msgid "Nothing found."
210
+ msgstr "Nieko nerasta."
211
+
212
+ #@ cms-tree-page-view
213
+ #: functions.php:386
214
+ msgid "Loading..."
215
+ msgstr "Kraunama..."
216
+
217
+ #@ cms-tree-page-view
218
+ #: functions.php:391
219
+ msgid "Search: no pages found"
220
+ msgstr "Paieška: puslapių nerasta"
221
+
222
+ #@ cms-tree-page-view
223
+ #: functions.php:394
224
+ msgid "Loading tree"
225
+ msgstr "Kraunamas medis"
226
+
227
+ #@ cms-tree-page-view
228
+ #: functions.php:406
229
+ msgid "After"
230
+ msgstr "Po"
231
+
232
+ #@ cms-tree-page-view
233
+ #: functions.php:410
234
+ msgid "Inside"
235
+ msgstr "Viduje"
236
+
237
+ #@ cms-tree-page-view
238
+ #: functions.php:414
239
+ msgid "Can not create page inside of a page with draft status"
240
+ msgstr "Negalima sukurti puslapio, turinčio juodraščio statusą, viduje"
241
+
242
+ #@ cms-tree-page-view
243
+ #: functions.php:417
244
+ msgid "Last modified"
245
+ msgstr "Vėliausiai redaguota"
246
+
247
+ #@ cms-tree-page-view
248
+ #: functions.php:419
249
+ msgid "by"
250
+ msgstr " "
251
+
252
+ #@ cms-tree-page-view
253
+ #: functions.php:422
254
+ msgid "Page ID"
255
+ msgstr "Puslapio ID"
256
+
257
+ #@ cms-tree-page-view
258
+ #: functions.php:638
259
+ msgid "Unknown user"
260
+ msgstr "Nežinomas vartotojas"
261
+
262
+ #@ cms-tree-page-view
263
+ #: functions.php:643
264
+ msgid "<Untitled page>"
265
+ msgstr "<Nepavadintas puslapis>"
266
+
267
+ #@ default
268
+ #: functions.php:663
269
+ msgid "Comments"
270
+ msgstr "Komentarai"
271
+
272
+ #@ default
273
+ #: functions.php:670
274
+ #, php-format
275
+ msgid "%s pending"
276
+ msgstr "Liko: %s"
277
+
278
+ #@ default
279
+ #: functions.php:680
280
+ msgctxt "comment count"
281
+ msgid "0"
282
+ msgstr ""
283
+
284
+ #@ default
285
+ #: functions.php:680
286
+ msgctxt "comment count"
287
+ msgid "1"
288
+ msgstr ""
289
+
290
+ #@ default
291
+ #: functions.php:680
292
+ msgctxt "comment count"
293
+ msgid "%"
294
+ msgstr ""
295
+
296
+ #@ cms-tree-page-view
297
+ #: functions.php:711
298
+ msgid "Click to edit. Drag to move."
299
+ msgstr "Spragtelkite, norėdami redaguoti. Tempkite, norėdami perkeltii."
300
+
301
+ #@ cms-tree-page-view
302
+ #: functions.php:862
303
+ msgid "New page"
304
+ msgstr "Naujas puslapis"
305
+
306
+ #@ cms-tree-page-view
307
+ #: functions.php:1046
308
+ msgid "Close"
309
+ msgstr "Uždaryti"
310
+
311
+ #@ cms-tree-page-view
312
+ #: functions.php:1047
313
+ msgid "<strong>Thank you for using this plugin!</strong> If you need help please check out the <a href=\"http://eskapism.se/code-playground/cms-tree-page-view/?utm_source=wordpress&utm_medium=banner&utm_campaign=promobox\">plugin homepage</a> or the <a href=\"http://wordpress.org/tags/cms-tree-page-view?forum_id=10\">support forum</a>."
314
+ msgstr "<strong>Ačiū, kad naudojate šį įskiepį!</strong>Jei reikia pagalbos, galite apsilankyti <a href=\"http://eskapism.se/code-playground/cms-tree-page-view/?utm_source=wordpress&utm_medium=banner&utm_campaign=promobox\">įskiepio tinklapyje</a> arba <a href=\"http://wordpress.org/tags/cms-tree-page-view?forum_id=10\">pagalbos diskusijos</a>."
315
+
316
+ #@ cms-tree-page-view
317
+ #: functions.php:1048
318
+ msgid "If you like this plugin, please <a href=\"http://eskapism.se/sida/donate/?utm_source=wordpress&utm_medium=banner&utm_campaign=promobox\">support my work by donating</a> - or at least say something nice about this plugin in a blog post or tweet."
319
+ msgstr "Jei patinka šis įskiepis, prašau <a href=\"http://eskapism.se/sida/donate/?utm_source=wordpress&utm_medium=banner&utm_campaign=promobox\">paremti mano darbą</a> ar bent paminėkite šį įskiepį savo tinklaraštyje ar \"twitteryje\"."
320
+
 
 
 
languages/cms-tree-page-view-pl_PL.mo ADDED
Binary file
languages/cms-tree-page-view-pl_PL.po CHANGED
@@ -3,7 +3,7 @@ msgstr ""
3
  "Project-Id-Version: CMS Tree Page View\n"
4
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/cms-tree-page-view\n"
5
  "POT-Creation-Date: 2010-08-28 21:55+0000\n"
6
- "PO-Revision-Date: 2011-08-08 15:28+0100\n"
7
  "Last-Translator: Michał Księżuk <michal@ksiezuk.pl>\n"
8
  "Language-Team: gadjukin.net <georgij@gadjukin.net>\n"
9
  "MIME-Version: 1.0\n"
@@ -164,7 +164,7 @@ msgstr "Strona chroniona hasłem"
164
  #@ cms-tree-page-view
165
  #: functions.php:342
166
  msgid "Public"
167
- msgstr "Publiczne"
168
 
169
  #@ cms-tree-page-view
170
  #: functions.php:219
@@ -316,5 +316,5 @@ msgstr "<strong>Dziękuję za używanie tej wtyczki!</strong> Jeśli potrzebujes
316
  #@ cms-tree-page-view
317
  #: functions.php:1015
318
  msgid "If you like this plugin, please <a href=\"http://eskapism.se/sida/donate/?utm_source=wordpress&utm_medium=banner&utm_campaign=promobox\">support my work by donating</a> - or at least say something nice about this plugin in a blog post or tweet."
319
- msgstr "Jeśli spodobała się Tobie ta wtyczka, proszę <a href=\\\"http://eskapism.se/sida/donate/?utm_source=wordpress&utm_medium=banner&utm_campaign=promobox\\\">wesprzyj moją pracę</a> - albo przynajmniej napisz coś miłego o tej wtyczce na swoim blogu lub Tweeterze."
320
 
3
  "Project-Id-Version: CMS Tree Page View\n"
4
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/cms-tree-page-view\n"
5
  "POT-Creation-Date: 2010-08-28 21:55+0000\n"
6
+ "PO-Revision-Date: 2011-08-08 15:18+0100\n"
7
  "Last-Translator: Michał Księżuk <michal@ksiezuk.pl>\n"
8
  "Language-Team: gadjukin.net <georgij@gadjukin.net>\n"
9
  "MIME-Version: 1.0\n"
164
  #@ cms-tree-page-view
165
  #: functions.php:342
166
  msgid "Public"
167
+ msgstr "Publiczny"
168
 
169
  #@ cms-tree-page-view
170
  #: functions.php:219
316
  #@ cms-tree-page-view
317
  #: functions.php:1015
318
  msgid "If you like this plugin, please <a href=\"http://eskapism.se/sida/donate/?utm_source=wordpress&utm_medium=banner&utm_campaign=promobox\">support my work by donating</a> - or at least say something nice about this plugin in a blog post or tweet."
319
+ msgstr "Pokud se vám tento plugin líbí, prosím podpořte mou práci <a href=\\\"http://eskapism.se/sida/donate/?utm_source=wordpress&utm_medium=banner&utm_campaign=promobox\\\">malým darem</a> - nebo alespoň řekněte něco pěkného o tomto pluginu v blogu."
320
 
languages/cms-tree-page-view-ru_RU.mo CHANGED
Binary file
languages/cms-tree-page-view-ru_RU.po CHANGED
@@ -1,133 +1,372 @@
1
- # Translation of the WordPress plugin by .
2
- # Copyright (C) 2010
3
  # This file is distributed under the same license as the package.
4
- # FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
5
- #
6
  msgid ""
7
  msgstr ""
8
  "Project-Id-Version: CTPV\n"
9
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/cms-tree-page-view\n"
10
- "POT-Creation-Date: 2010-04-09 11:39+0000\n"
11
- "PO-Revision-Date: 2010-05-24 15:24+0300\n"
12
- "Last-Translator: Александр <alexufo@mail.ru>\n"
13
- "Language-Team: Marcis G. <alexufo@mail.ru>\n"
14
  "MIME-Version: 1.0\n"
15
- "Content-Type: text/plain; charset=utf-8\n"
16
  "Content-Transfer-Encoding: 8bit\n"
17
- "X-Poedit-Language: Russian\n"
18
- "X-Poedit-Country: RUSSIAN FEDERATION\n"
19
- "X-Poedit-SourceCharset: utf8\n"
 
 
20
 
21
- #: functions.php:84
22
- msgid "settings"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  msgstr "Настройки"
24
 
25
- #: functions.php:91
26
- msgid "Show tree"
27
- msgstr "Показывать плагин"
 
 
 
 
 
 
 
 
28
 
29
- #: functions.php:95
30
- msgid "on the dashboard"
31
- msgstr "на панел"
32
 
33
- #: functions.php:98
34
- msgid "under the pages menu"
35
- msgstr " в разделе \"Страницы\""
36
 
37
- #: functions.php:105
38
  msgid "Save Changes"
39
  msgstr "Сохранить изменения"
40
 
41
- #: functions.php:127
 
 
 
 
42
  msgid "All"
43
  msgstr "Все"
44
 
45
- #: functions.php:128
46
  msgid "Public"
47
  msgstr "Опубликованные"
48
 
49
- #: functions.php:130
 
 
 
 
50
  msgid "Expand"
51
  msgstr "Раскрыть"
52
 
53
- #: functions.php:131
54
  msgid "Collapse"
55
- msgstr "Собрать"
 
 
 
 
56
 
57
- #: functions.php:136
58
  msgid "Search"
59
  msgstr "Поиск"
60
 
61
- #: functions.php:137
62
  msgid "Searching..."
63
  msgstr "Поиск..."
64
 
65
- #: functions.php:142
 
 
 
 
66
  msgid "Loading..."
67
  msgstr "Загрузка..."
68
 
69
- #: functions.php:144
70
  msgid "Search: no pages found"
71
- msgstr "Поиск: страниц не найдено"
72
 
73
- #: functions.php:146
74
  msgid "Loading tree"
75
  msgstr "Загрузка дерева"
76
 
77
- #: functions.php:248
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
78
  msgid "<Untitled page>"
79
- msgstr "<Без имени>"
 
 
 
 
 
 
 
 
 
 
 
 
 
80
 
81
- #: functions.php:264
82
- msgid "Click to edit. Drag to move."
83
- msgstr "Щелчок для правки. Схватить для перемещения."
84
 
85
- #: functions.php:380
 
 
 
 
86
  msgid "New page"
87
  msgstr "Новая страница"
88
 
89
- #: scripts/cms_tree_page_view.php:85
90
- #: scripts/cms_tree_page_view.php:102
91
- msgid "Enter title of new page"
92
- msgstr "Введите имя новой страницы"
93
-
94
- #: scripts/cms_tree_page_view.php:283
95
- msgid "child pages"
96
- msgstr "Дочерние сраницы"
97
 
98
- #: scripts/cms_tree_page_view.php:293
99
- msgid "Edit page"
100
- msgstr "Править страницу"
 
 
 
 
101
 
102
- #: scripts/cms_tree_page_view.php:293
103
- msgid "Edit"
104
- msgstr "Правка"
105
 
106
- #: scripts/cms_tree_page_view.php:294
107
- msgid "View page"
108
- msgstr "Смотреть страницу"
109
 
110
- #: scripts/cms_tree_page_view.php:294
111
- msgid "View"
112
- msgstr "Смотреть"
113
 
114
- #: scripts/cms_tree_page_view.php:296
115
- msgid "Add page"
116
- msgstr "Добавить страницу"
 
 
 
117
 
118
- #: scripts/cms_tree_page_view.php:297
119
- msgid "Add new page after"
120
- msgstr "Добавить новую страницу ниже"
 
 
 
121
 
122
- #: scripts/cms_tree_page_view.php:297
123
- msgid "after"
124
- msgstr "ниже"
 
 
 
 
125
 
126
- #: scripts/cms_tree_page_view.php:298
127
- msgid "Add new page inside"
128
- msgstr "Добавить новую страницу внутри"
129
 
130
- #: scripts/cms_tree_page_view.php:298
131
- msgid "inside"
132
- msgstr "внутри"
 
133
 
 
 
 
1
+ # Copyright (C) 2012
 
2
  # This file is distributed under the same license as the package.
 
 
3
  msgid ""
4
  msgstr ""
5
  "Project-Id-Version: CTPV\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/cms-tree-page-view\n"
7
+ "POT-Creation-Date: 2012-12-23 11:26+0400\n"
8
+ "PO-Revision-Date: 2012-12-26 21:58+0100\n"
9
+ "Last-Translator: Pär Thernström <par.thernstrom@gmail.com>\n"
10
+ "Language-Team: \n"
11
  "MIME-Version: 1.0\n"
12
+ "Content-Type: text/plain; charset=UTF-8\n"
13
  "Content-Transfer-Encoding: 8bit\n"
14
+ "X-Generator: Poedit 1.5.4\n"
15
+ "X-Poedit-Basepath: E:\\Translate WP\\cms-tree-page-view\n"
16
+ "X-Poedit-KeywordsList: _e;__;_x\n"
17
+ "X-Poedit-SourceCharset: UTF-8\n"
18
+ "X-Poedit-SearchPath-0: E:\\Translate WP\\cms-tree-page-view\n"
19
 
20
+ #: E:\Translate WP\cms-tree-page-view/functions.php:272
21
+ msgid "Enter title of new page"
22
+ msgstr "Введите название новой страницы"
23
+
24
+ #: E:\Translate WP\cms-tree-page-view/functions.php:273
25
+ msgid "child pages"
26
+ msgstr "дочерние страницы"
27
+
28
+ #: E:\Translate WP\cms-tree-page-view/functions.php:274
29
+ #: WP\cms-tree-page-view/functions.php:887
30
+ msgid "Edit page"
31
+ msgstr "Редактировать страницу"
32
+
33
+ #: E:\Translate WP\cms-tree-page-view/functions.php:275
34
+ #: WP\cms-tree-page-view/functions.php:888
35
+ msgid "View page"
36
+ msgstr "Просмотр страницы"
37
+
38
+ #: E:\Translate WP\cms-tree-page-view/functions.php:276
39
+ #: WP\cms-tree-page-view/functions.php:887
40
+ msgid "Edit"
41
+ msgstr "Изменить"
42
+
43
+ #: E:\Translate WP\cms-tree-page-view/functions.php:277
44
+ #: WP\cms-tree-page-view/functions.php:888
45
+ msgid "View"
46
+ msgstr "Показать"
47
+
48
+ #: E:\Translate WP\cms-tree-page-view/functions.php:278
49
+ msgid "Add page"
50
+ msgstr "Добавить страницу"
51
+
52
+ #: E:\Translate WP\cms-tree-page-view/functions.php:279
53
+ #: WP\cms-tree-page-view/functions.php:896
54
+ msgid "Add new page after"
55
+ msgstr "Добавить новую страницу после"
56
+
57
+ #: E:\Translate WP\cms-tree-page-view/functions.php:280
58
+ msgid "after"
59
+ msgstr "после"
60
+
61
+ #: E:\Translate WP\cms-tree-page-view/functions.php:281
62
+ msgid "inside"
63
+ msgstr "внутри"
64
+
65
+ #: E:\Translate WP\cms-tree-page-view/functions.php:282
66
+ msgid "Sorry, can't create a sub page to a page with status \"draft\"."
67
+ msgstr ""
68
+ "К сожалению, невозможно создать подстраницу для страницы со статусом "
69
+ "\"черновик \"."
70
+
71
+ #: E:\Translate WP\cms-tree-page-view/functions.php:283
72
+ msgid "Sorry, can't create a sub page to a page with status \"trash\"."
73
+ msgstr ""
74
+ "К сожалению, невозможно создать подстраницу для страницы со статусом \"в "
75
+ "корзине \"."
76
+
77
+ #: E:\Translate WP\cms-tree-page-view/functions.php:284
78
+ msgid "Sorry, can't create a page after a page with status \"trash\"."
79
+ msgstr ""
80
+ "К сожалению, невозможно создать страницу после страницы со статусом \"в "
81
+ "корзине \"."
82
+
83
+ #: E:\Translate WP\cms-tree-page-view/functions.php:285
84
+ #: WP\cms-tree-page-view/functions.php:901
85
+ msgid "Add new page inside"
86
+ msgstr "Добавить новую страницу внутри"
87
+
88
+ #: E:\Translate WP\cms-tree-page-view/functions.php:286
89
+ #: WP\cms-tree-page-view/functions.php:292
90
+ msgid "draft"
91
+ msgstr "черновик"
92
+
93
+ #: E:\Translate WP\cms-tree-page-view/functions.php:287
94
+ #: WP\cms-tree-page-view/functions.php:293
95
+ msgid "future"
96
+ msgstr "будущая"
97
+
98
+ #: E:\Translate WP\cms-tree-page-view/functions.php:288
99
+ #: WP\cms-tree-page-view/functions.php:294
100
+ msgid "protected"
101
+ msgstr "защищенная"
102
+
103
+ #: E:\Translate WP\cms-tree-page-view/functions.php:289
104
+ #: WP\cms-tree-page-view/functions.php:295
105
+ #: WP\cms-tree-page-view/functions.php:1235
106
+ msgid "pending"
107
+ msgstr "в ожидании"
108
+
109
+ #: E:\Translate WP\cms-tree-page-view/functions.php:290
110
+ #: WP\cms-tree-page-view/functions.php:296
111
+ msgid "private"
112
+ msgstr "личная"
113
+
114
+ #: E:\Translate WP\cms-tree-page-view/functions.php:291
115
+ #: WP\cms-tree-page-view/functions.php:297
116
+ msgid "trash"
117
+ msgstr "в корзине"
118
+
119
+ #: E:\Translate WP\cms-tree-page-view/functions.php:298
120
+ msgid "Password protected page"
121
+ msgstr "Страница защищенная паролем"
122
+
123
+ #: E:\Translate WP\cms-tree-page-view/functions.php:299
124
+ msgid "Adding page..."
125
+ msgstr "Добавление пароля..."
126
+
127
+ #: E:\Translate WP\cms-tree-page-view/functions.php:300
128
+ msgid "Adding ..."
129
+ msgstr "Добавление ..."
130
+
131
+ #: E:\Translate WP\cms-tree-page-view/functions.php:393
132
+ #: WP\cms-tree-page-view/functions.php:502
133
+ msgid "Tree View"
134
+ msgstr "В виде дерева"
135
+
136
+ #: E:\Translate WP\cms-tree-page-view/functions.php:402
137
+ msgid "List View"
138
+ msgstr "Просмотр списка"
139
+
140
+ #: E:\Translate WP\cms-tree-page-view/functions.php:438
141
+ msgid "Settings"
142
  msgstr "Настройки"
143
 
144
+ #: E:\Translate WP\cms-tree-page-view/functions.php:523
145
+ msgid "settings"
146
+ msgstr "настройки"
147
+
148
+ #: E:\Translate WP\cms-tree-page-view/functions.php:529
149
+ msgid "Select where to show a tree for pages and custom post types"
150
+ msgstr "Укажите где показать дерево страниц и пользовательских типов записей"
151
+
152
+ #: E:\Translate WP\cms-tree-page-view/functions.php:573
153
+ msgid "On dashboard"
154
+ msgstr "На консоли"
155
 
156
+ #: E:\Translate WP\cms-tree-page-view/functions.php:577
157
+ msgid "In menu"
158
+ msgstr "В меню"
159
 
160
+ #: E:\Translate WP\cms-tree-page-view/functions.php:581
161
+ msgid "On post overview screen"
162
+ msgstr "На обзорном экране сообщений"
163
 
164
+ #: E:\Translate WP\cms-tree-page-view/functions.php:599
165
  msgid "Save Changes"
166
  msgstr "Сохранить изменения"
167
 
168
+ #: E:\Translate WP\cms-tree-page-view/functions.php:818
169
+ msgid "No posts found."
170
+ msgstr "Записи не нейдены."
171
+
172
+ #: E:\Translate WP\cms-tree-page-view/functions.php:830
173
  msgid "All"
174
  msgstr "Все"
175
 
176
+ #: E:\Translate WP\cms-tree-page-view/functions.php:835
177
  msgid "Public"
178
  msgstr "Опубликованные"
179
 
180
+ #: E:\Translate WP\cms-tree-page-view/functions.php:840
181
+ msgid "Trash"
182
+ msgstr "Корзина"
183
+
184
+ #: E:\Translate WP\cms-tree-page-view/functions.php:848
185
  msgid "Expand"
186
  msgstr "Раскрыть"
187
 
188
+ #: E:\Translate WP\cms-tree-page-view/functions.php:849
189
  msgid "Collapse"
190
+ msgstr "Свернуть"
191
+
192
+ #: E:\Translate WP\cms-tree-page-view/functions.php:857
193
+ msgid "Clear search"
194
+ msgstr "Очистить поиск"
195
 
196
+ #: E:\Translate WP\cms-tree-page-view/functions.php:858
197
  msgid "Search"
198
  msgstr "Поиск"
199
 
200
+ #: E:\Translate WP\cms-tree-page-view/functions.php:859
201
  msgid "Searching..."
202
  msgstr "Поиск..."
203
 
204
+ #: E:\Translate WP\cms-tree-page-view/functions.php:860
205
+ msgid "Nothing found."
206
+ msgstr "Ничего не найдено."
207
+
208
+ #: E:\Translate WP\cms-tree-page-view/functions.php:867
209
  msgid "Loading..."
210
  msgstr "Загрузка..."
211
 
212
+ #: E:\Translate WP\cms-tree-page-view/functions.php:872
213
  msgid "Search: no pages found"
214
+ msgstr "Поиск: страницы не найдены"
215
 
216
+ #: E:\Translate WP\cms-tree-page-view/functions.php:875
217
  msgid "Loading tree"
218
  msgstr "Загрузка дерева"
219
 
220
+ #: E:\Translate WP\cms-tree-page-view/functions.php:896
221
+ #: WP\cms-tree-page-view/functions.php:932
222
+ msgid "After"
223
+ msgstr "После"
224
+
225
+ #: E:\Translate WP\cms-tree-page-view/functions.php:901
226
+ #: WP\cms-tree-page-view/functions.php:933
227
+ msgid "Inside"
228
+ msgstr "Внутри"
229
+
230
+ #: E:\Translate WP\cms-tree-page-view/functions.php:905
231
+ msgid "Can not create page inside of a page with draft status"
232
+ msgstr "Невозможно создать страницу внутри страницы со статусом /\"черновик/\""
233
+
234
+ #: E:\Translate WP\cms-tree-page-view/functions.php:921
235
+ msgid "Add page(s)"
236
+ msgstr "Добавить страницу(ы)"
237
+
238
+ #: E:\Translate WP\cms-tree-page-view/functions.php:926
239
+ msgid "Enter title here"
240
+ msgstr "Введите название здесь"
241
+
242
+ #: E:\Translate WP\cms-tree-page-view/functions.php:931
243
+ msgid "Position"
244
+ msgstr "Положение"
245
+
246
+ #: E:\Translate WP\cms-tree-page-view/functions.php:938
247
+ msgid "Status"
248
+ msgstr "Состояние"
249
+
250
+ #: E:\Translate WP\cms-tree-page-view/functions.php:939
251
+ msgid "Draft"
252
+ msgstr "Черновик"
253
+
254
+ #: E:\Translate WP\cms-tree-page-view/functions.php:940
255
+ msgid "Published"
256
+ msgstr "Опубликовано"
257
+
258
+ #: E:\Translate WP\cms-tree-page-view/functions.php:944
259
+ msgid "Add"
260
+ msgstr "Добавить"
261
+
262
+ #: E:\Translate WP\cms-tree-page-view/functions.php:945
263
+ msgid "or"
264
+ msgstr "или"
265
+
266
+ #: E:\Translate WP\cms-tree-page-view/functions.php:946
267
+ msgid "cancel"
268
+ msgstr "отмена"
269
+
270
+ #: E:\Translate WP\cms-tree-page-view/functions.php:956
271
+ msgid "Last modified"
272
+ msgstr "Последнее изменение"
273
+
274
+ #: E:\Translate WP\cms-tree-page-view/functions.php:958
275
+ msgid "by"
276
+ msgstr "-"
277
+
278
+ #: E:\Translate WP\cms-tree-page-view/functions.php:961
279
+ msgid "Page ID"
280
+ msgstr "ID страницы"
281
+
282
+ #: E:\Translate WP\cms-tree-page-view/functions.php:1200
283
+ msgid "Unknown user"
284
+ msgstr "Неизвестный пользователь"
285
+
286
+ #: E:\Translate WP\cms-tree-page-view/functions.php:1205
287
  msgid "<Untitled page>"
288
+ msgstr "<Страница без названия>"
289
+
290
+ #: E:\Translate WP\cms-tree-page-view/functions.php:1225
291
+ msgid "Comments"
292
+ msgstr "Комментарии"
293
+
294
+ #: E:\Translate WP\cms-tree-page-view/functions.php:1232
295
+ #, php-format
296
+ msgid "%s pending"
297
+ msgstr "%s в ожидании"
298
+
299
+ #: E:\Translate WP\cms-tree-page-view/functions.php:1242
300
+ msgid "0"
301
+ msgstr "0"
302
 
303
+ #: E:\Translate WP\cms-tree-page-view/functions.php:1242
304
+ msgid "1"
305
+ msgstr "1"
306
 
307
+ #: E:\Translate WP\cms-tree-page-view/functions.php:1242
308
+ msgid "%"
309
+ msgstr "%"
310
+
311
+ #: E:\Translate WP\cms-tree-page-view/functions.php:1428
312
  msgid "New page"
313
  msgstr "Новая страница"
314
 
315
+ #: E:\Translate WP\cms-tree-page-view/functions.php:1618
316
+ msgid "Thanks for using my plugin"
317
+ msgstr "Спасибо за использование моего плагина"
 
 
 
 
 
318
 
319
+ #: E:\Translate WP\cms-tree-page-view/functions.php:1620
320
+ msgid ""
321
+ "Hi there! I just wanna says thanks for using my plugin. I hope you like it "
322
+ "as much as I do."
323
+ msgstr ""
324
+ "Привет! Я просто хочу, сказать спасибо за использование моего плагина. Я "
325
+ "надеюсь, что Вам он нравится так же, как и мне."
326
 
327
+ #: E:\Translate WP\cms-tree-page-view/functions.php:1621
328
+ msgid "/Pär Thernström - plugin creator"
329
+ msgstr "/Pär Thernström - создатель плагина"
330
 
331
+ #: E:\Translate WP\cms-tree-page-view/functions.php:1623
332
+ msgid "I like this plugin<br>– how can I thank you?"
333
+ msgstr "Мне нравится этот плагин<br> - как я могу отблагодарить Вас?"
334
 
335
+ #: E:\Translate WP\cms-tree-page-view/functions.php:1624
336
+ msgid "There are serveral ways for you to show your appreciation:"
337
+ msgstr "Есть несколько способов, чтобы показать Вашу признательность:"
338
 
339
+ #: E:\Translate WP\cms-tree-page-view/functions.php:1626
340
+ #, php-format
341
+ msgid ""
342
+ "<a href=\"%1$s\">Give it a nice review</a> over at the WordPress Plugin "
343
+ "Directory"
344
+ msgstr "<a href=\"%1$s\">Дать хороший отзыв</a> в Каталоге Плагинов WordPress"
345
 
346
+ #: E:\Translate WP\cms-tree-page-view/functions.php:1627
347
+ #, php-format
348
+ msgid "<a href=\"%1$s\">Give a donation</a> – any amount will make me happy"
349
+ msgstr ""
350
+ "<a href=\"%1$s\">Сделать пожертвование</a> – любая сумма сделает меня "
351
+ "счастливым"
352
 
353
+ #: E:\Translate WP\cms-tree-page-view/functions.php:1628
354
+ #, php-format
355
+ msgid ""
356
+ "<a href=\"%1$s\">Post a nice tweet</a> or make a nice blog post about the "
357
+ "plugin"
358
+ msgstr ""
359
+ "<a href=\"%1$s\">Написать хороший твит</a> ли сделать хороший блог о плагине"
360
 
361
+ #: E:\Translate WP\cms-tree-page-view/functions.php:1631
362
+ msgid "Support"
363
+ msgstr "Поддержка"
364
 
365
+ #: E:\Translate WP\cms-tree-page-view/functions.php:1632
366
+ #, php-format
367
+ msgid "Plese see the <a href=\"%1$s\">support forum</a> for help."
368
+ msgstr "Читайте <a href=\"%1$s\">форум поддержки</a> для помощи."
369
 
370
+ #: E:\Translate WP\cms-tree-page-view/functions.php:1636
371
+ msgid "Hide until next upgrade"
372
+ msgstr "Скрыть до следующего обновления"
languages/cms-tree-page-view-sv_SE.mo CHANGED
Binary file
languages/cms-tree-page-view-sv_SE.po ADDED
@@ -0,0 +1,372 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) 2012
2
+ # This file is distributed under the same license as the package.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: \n"
6
+ "Report-Msgid-Bugs-To: http://wordpress.org/tag/cms-tree-page-view\n"
7
+ "POT-Creation-Date: 2012-12-26 20:37:31+00:00\n"
8
+ "PO-Revision-Date: 2012-12-27 16:26+0100\n"
9
+ "Last-Translator: Pär Thernström <par.thernstrom@gmail.com>\n"
10
+ "Language-Team: LANGUAGE <LL@li.org>\n"
11
+ "Language: sv_SE\n"
12
+ "MIME-Version: 1.0\n"
13
+ "Content-Type: text/plain; charset=UTF-8\n"
14
+ "Content-Transfer-Encoding: 8bit\n"
15
+ "X-Generator: Poedit 1.5.4\n"
16
+ "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;"
17
+ "_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;_ex:1,2c;"
18
+ "esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c\n"
19
+ "X-Poedit-Basepath: .\n"
20
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
21
+ "X-Poedit-SearchPath-0: .\n"
22
+ "X-Poedit-SearchPath-1: ..\n"
23
+
24
+ #: functions.php:272
25
+ msgid "Enter title of new page"
26
+ msgstr "Ange titel på ny sida"
27
+
28
+ #: functions.php:273
29
+ msgid "child pages"
30
+ msgstr "undersidor"
31
+
32
+ #: functions.php:274 functions.php:887
33
+ msgid "Edit page"
34
+ msgstr "Redigera sida"
35
+
36
+ #: functions.php:275 functions.php:888
37
+ msgid "View page"
38
+ msgstr "Visa sida"
39
+
40
+ #: functions.php:276 functions.php:887
41
+ msgid "Edit"
42
+ msgstr "Redigera"
43
+
44
+ #: functions.php:277 functions.php:888
45
+ msgid "View"
46
+ msgstr "Visa"
47
+
48
+ #: functions.php:278
49
+ msgid "Add page"
50
+ msgstr "Lägg till sida"
51
+
52
+ #: functions.php:279 functions.php:896
53
+ msgid "Add new page after"
54
+ msgstr "Lägg till sida efter"
55
+
56
+ #: functions.php:280
57
+ msgid "after"
58
+ msgstr "efter"
59
+
60
+ #: functions.php:281
61
+ msgid "inside"
62
+ msgstr "inuti"
63
+
64
+ #: functions.php:282
65
+ msgid "Sorry, can't create a sub page to a page with status \"draft\"."
66
+ msgstr "Kan inte skapa en undersida till en sida med status \"utkast\"."
67
+
68
+ #: functions.php:283
69
+ msgid "Sorry, can't create a sub page to a page with status \"trash\"."
70
+ msgstr "Kan inte skapa en undersida till en sida med status \"i papperskorg\"."
71
+
72
+ #: functions.php:284
73
+ msgid "Sorry, can't create a page after a page with status \"trash\"."
74
+ msgstr "Kan inte skapa sida efter en sida med status \"i papperskorg\"."
75
+
76
+ #: functions.php:285 functions.php:901
77
+ msgid "Add new page inside"
78
+ msgstr "Ny sida inuti"
79
+
80
+ #: functions.php:286 functions.php:292
81
+ msgid "draft"
82
+ msgstr "utkast"
83
+
84
+ #: functions.php:287 functions.php:293
85
+ msgid "future"
86
+ msgstr "framtid"
87
+
88
+ #: functions.php:288 functions.php:294
89
+ msgid "protected"
90
+ msgstr "skyddad"
91
+
92
+ #: functions.php:289 functions.php:295 functions.php:1235
93
+ msgid "pending"
94
+ msgstr "väntande"
95
+
96
+ #: functions.php:290 functions.php:296
97
+ msgid "private"
98
+ msgstr "privat"
99
+
100
+ #: functions.php:291 functions.php:297
101
+ msgid "trash"
102
+ msgstr "papperskorg"
103
+
104
+ #: functions.php:298
105
+ msgid "Password protected page"
106
+ msgstr "Lösenordsskyddad sida"
107
+
108
+ #: functions.php:299
109
+ msgid "Adding page..."
110
+ msgstr "Lägger till sida..."
111
+
112
+ #: functions.php:300
113
+ msgid "Adding ..."
114
+ msgstr "Lägger till ..."
115
+
116
+ #: functions.php:393
117
+ msgid "Tree View"
118
+ msgstr "Trädvy"
119
+
120
+ #: functions.php:402
121
+ msgid "List View"
122
+ msgstr "Listvy"
123
+
124
+ #: functions.php:438
125
+ msgid "Settings"
126
+ msgstr "Inställningar"
127
+
128
+ #: functions.php:474
129
+ msgctxt "name of dashboard"
130
+ msgid "%1$s Tree"
131
+ msgstr "Trädvy för %1$s"
132
+
133
+ #: functions.php:502
134
+ msgctxt "name in menu"
135
+ msgid "Tree View"
136
+ msgstr "Trädvy"
137
+
138
+ #: functions.php:503
139
+ msgctxt "title on page with tree"
140
+ msgid "%1$s Tree View"
141
+ msgstr "Trädvy för %1$s"
142
+
143
+ #: functions.php:523
144
+ msgid "settings"
145
+ msgstr "inställningar"
146
+
147
+ #: functions.php:529
148
+ msgid "Select where to show a tree for pages and custom post types"
149
+ msgstr "Välj var en trädvy ska visas för sidor och custom post types."
150
+
151
+ #: functions.php:573
152
+ msgid "On dashboard"
153
+ msgstr "På adminpanelen"
154
+
155
+ #: functions.php:577
156
+ msgid "In menu"
157
+ msgstr "I menyn"
158
+
159
+ #: functions.php:581
160
+ msgid "On post overview screen"
161
+ msgstr "På översiktssida för poster"
162
+
163
+ #: functions.php:599
164
+ msgid "Save Changes"
165
+ msgstr "Spara Ändringar"
166
+
167
+ #: functions.php:818
168
+ msgid "No posts found."
169
+ msgstr "Inga inlägg funna."
170
+
171
+ #: functions.php:830
172
+ msgid "All"
173
+ msgstr "Alla"
174
+
175
+ #: functions.php:835
176
+ msgid "Public"
177
+ msgstr "Publika"
178
+
179
+ #: functions.php:840
180
+ msgid "Trash"
181
+ msgstr "Papperskorg"
182
+
183
+ #: functions.php:848
184
+ msgid "Expand"
185
+ msgstr "Fäll ut"
186
+
187
+ #: functions.php:849
188
+ msgid "Collapse"
189
+ msgstr "Fäll ihop"
190
+
191
+ #: functions.php:857
192
+ msgid "Clear search"
193
+ msgstr "Rensa sök"
194
+
195
+ #: functions.php:858
196
+ msgid "Search"
197
+ msgstr "Sök"
198
+
199
+ #: functions.php:859
200
+ msgid "Searching..."
201
+ msgstr "Söker..."
202
+
203
+ #: functions.php:860
204
+ msgid "Nothing found."
205
+ msgstr "Inget funnet."
206
+
207
+ #: functions.php:867
208
+ msgid "Loading..."
209
+ msgstr "Laddar..."
210
+
211
+ #: functions.php:872
212
+ msgid "Search: no pages found"
213
+ msgstr "Sök: inga sidor hittades"
214
+
215
+ #: functions.php:875
216
+ msgid "Loading tree"
217
+ msgstr "Laddar träd"
218
+
219
+ #: functions.php:896 functions.php:932
220
+ msgid "After"
221
+ msgstr "Efter"
222
+
223
+ #: functions.php:901 functions.php:933
224
+ msgid "Inside"
225
+ msgstr "Inuti"
226
+
227
+ #: functions.php:905
228
+ msgid "Can not create page inside of a page with draft status"
229
+ msgstr "Kan inte skapa sida inuti en sida med status utkast"
230
+
231
+ #: functions.php:921
232
+ msgid "Add page(s)"
233
+ msgstr "Lägg till sidor"
234
+
235
+ #: functions.php:926
236
+ msgid "Enter title here"
237
+ msgstr "Ange rubrik här"
238
+
239
+ #: functions.php:931
240
+ msgid "Position"
241
+ msgstr "Plats"
242
+
243
+ #: functions.php:938
244
+ msgid "Status"
245
+ msgstr "Status"
246
+
247
+ #: functions.php:939
248
+ msgid "Draft"
249
+ msgstr "Utkast"
250
+
251
+ #: functions.php:940
252
+ msgid "Published"
253
+ msgstr "Publicerad"
254
+
255
+ #: functions.php:944
256
+ msgid "Add"
257
+ msgstr "Lägg till"
258
+
259
+ #: functions.php:945
260
+ msgid "or"
261
+ msgstr "eller"
262
+
263
+ #: functions.php:946
264
+ msgid "cancel"
265
+ msgstr "avbryt"
266
+
267
+ #: functions.php:956
268
+ msgid "Last modified"
269
+ msgstr "Senast ändrad"
270
+
271
+ #: functions.php:958
272
+ msgid "by"
273
+ msgstr "av"
274
+
275
+ #: functions.php:961
276
+ msgid "Page ID"
277
+ msgstr "ID på sida"
278
+
279
+ #: functions.php:997
280
+ msgctxt "headline of page with tree"
281
+ msgid "%1$s Tree View"
282
+ msgstr "Trädvy för %1$s"
283
+
284
+ #: functions.php:1200
285
+ msgid "Unknown user"
286
+ msgstr "Okänd användare"
287
+
288
+ #: functions.php:1205
289
+ msgid "<Untitled page>"
290
+ msgstr "<Namnlös sida>"
291
+
292
+ #: functions.php:1225
293
+ msgid "Comments"
294
+ msgstr "Kommentarer"
295
+
296
+ #: functions.php:1232
297
+ msgid "%s pending"
298
+ msgstr "%s väntande"
299
+
300
+ #: functions.php:1242
301
+ msgctxt "comment count"
302
+ msgid "0"
303
+ msgstr "0"
304
+
305
+ #: functions.php:1242
306
+ msgctxt "comment count"
307
+ msgid "1"
308
+ msgstr "1"
309
+
310
+ #: functions.php:1242
311
+ msgctxt "comment count"
312
+ msgid "%"
313
+ msgstr "%"
314
+
315
+ #: functions.php:1428
316
+ msgid "New page"
317
+ msgstr "Ny sida"
318
+
319
+ #: functions.php:1618
320
+ msgid "Thanks for using my plugin"
321
+ msgstr "Tack för att du använder min plugin"
322
+
323
+ #: functions.php:1620
324
+ msgid ""
325
+ "Hi there! I just wanna says thanks for using my plugin. I hope you like it "
326
+ "as much as I do."
327
+ msgstr ""
328
+ "Hejsan! Tack för att du använder min plugin. Hoppas du gillar den lika "
329
+ "mycket som jag gör."
330
+
331
+ #: functions.php:1621
332
+ msgid "/Pär Thernström - plugin creator"
333
+ msgstr "/Pär Thernström - skapare av pluginen"
334
+
335
+ #: functions.php:1623
336
+ msgid "I like this plugin<br>– how can I thank you?"
337
+ msgstr "Jag gillar den här pluginen<br>– hur kan jag tacka dig?"
338
+
339
+ #: functions.php:1624
340
+ msgid "There are serveral ways for you to show your appreciation:"
341
+ msgstr "Det finns flera sätt du kan visa att du gillar pluginen på:"
342
+
343
+ #: functions.php:1626
344
+ msgid ""
345
+ "<a href=\"%1$s\">Give it a nice review</a> over at the WordPress Plugin "
346
+ "Directory"
347
+ msgstr ""
348
+ "<a href=\"%1$s\">Ge den ett bra betyg</a> på WordPress Plugin Directory"
349
+
350
+ #: functions.php:1627
351
+ msgid "<a href=\"%1$s\">Give a donation</a> – any amount will make me happy"
352
+ msgstr "<a href=\"%1$s\">Donera</a> – oavsett summa så blir jag glad"
353
+
354
+ #: functions.php:1628
355
+ msgid ""
356
+ "<a href=\"%1$s\">Post a nice tweet</a> or make a nice blog post about the "
357
+ "plugin"
358
+ msgstr ""
359
+ "<a href=\"%1$s\">Skriv en snäll tweet</a> eller skriv ett schysst "
360
+ "blogginlägg om pluginen"
361
+
362
+ #: functions.php:1631
363
+ msgid "Support"
364
+ msgstr "Hjälp"
365
+
366
+ #: functions.php:1632
367
+ msgid "Plese see the <a href=\"%1$s\">support forum</a> for help."
368
+ msgstr "Besök <a href=\"%1$s\">supportforumet</a> om du behöver hjälp."
369
+
370
+ #: functions.php:1636
371
+ msgid "Hide until next upgrade"
372
+ msgstr "Göm tills nästa uppdatering"
languages/cms-tree-page-view.mo ADDED
Binary file
languages/cms-tree-page-view.pot CHANGED
@@ -1,257 +1,358 @@
1
- # Copyright (C) 2010
2
  # This file is distributed under the same license as the package.
3
  msgid ""
4
  msgstr ""
5
  "Project-Id-Version: \n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/cms-tree-page-view\n"
7
- "POT-Creation-Date: 2011-03-06 14:33:36+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
- "PO-Revision-Date: 2010-MO-DA HO:MI+ZONE\n"
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
  "Language-Team: LANGUAGE <LL@li.org>\n"
14
 
15
- #: functions.php:53
16
  msgid "Enter title of new page"
17
  msgstr ""
18
 
19
- #: functions.php:54
20
  msgid "child pages"
21
  msgstr ""
22
 
23
- #: functions.php:55 functions.php:381
24
  msgid "Edit page"
25
  msgstr ""
26
 
27
- #: functions.php:56 functions.php:382
28
  msgid "View page"
29
  msgstr ""
30
 
31
- #: functions.php:57 functions.php:381
32
  msgid "Edit"
33
  msgstr ""
34
 
35
- #: functions.php:58 functions.php:382
36
  msgid "View"
37
  msgstr ""
38
 
39
- #: functions.php:59
40
  msgid "Add page"
41
  msgstr ""
42
 
43
- #: functions.php:60 functions.php:386
44
  msgid "Add new page after"
45
  msgstr ""
46
 
47
- #: functions.php:61
48
  msgid "after"
49
  msgstr ""
50
 
51
- #: functions.php:62
52
  msgid "inside"
53
  msgstr ""
54
 
55
- #: functions.php:63
56
  msgid "Sorry, can't create a sub page to a page with status \"draft\"."
57
  msgstr ""
58
 
59
- #: functions.php:64
60
  msgid "Sorry, can't create a sub page to a page with status \"trash\"."
61
  msgstr ""
62
 
63
- #: functions.php:65
64
  msgid "Sorry, can't create a page after a page with status \"trash\"."
65
  msgstr ""
66
 
67
- #: functions.php:66 functions.php:390
68
  msgid "Add new page inside"
69
  msgstr ""
70
 
71
- #: functions.php:67
72
  msgid "draft"
73
  msgstr ""
74
 
75
- #: functions.php:68
76
  msgid "future"
77
  msgstr ""
78
 
79
- #: functions.php:69
80
  msgid "protected"
81
  msgstr ""
82
 
83
- #: functions.php:70 functions.php:644
84
  msgid "pending"
85
  msgstr ""
86
 
87
- #: functions.php:71
88
  msgid "private"
89
  msgstr ""
90
 
91
- #: functions.php:72
92
  msgid "trash"
93
  msgstr ""
94
 
95
- #: functions.php:73
96
  msgid "Password protected page"
97
  msgstr ""
98
 
99
- #: functions.php:74
100
  msgid "Adding page..."
101
  msgstr ""
102
 
103
- #: functions.php:175
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
104
  msgid "settings"
105
  msgstr ""
106
 
107
- #: functions.php:180
108
  msgid "Select where to show a tree for pages and custom post types"
109
  msgstr ""
110
 
111
- #: functions.php:204
112
  msgid "On dashboard"
113
  msgstr ""
114
 
115
- #: functions.php:208
116
  msgid "In menu"
117
  msgstr ""
118
 
119
- #: functions.php:219
 
 
 
 
120
  msgid "Save Changes"
121
  msgstr ""
122
 
123
- #: functions.php:335
124
  msgid "No posts found."
125
  msgstr ""
126
 
127
- #: functions.php:341
128
  msgid "All"
129
  msgstr ""
130
 
131
- #: functions.php:342
132
  msgid "Public"
133
  msgstr ""
134
 
135
- #: functions.php:343
136
  msgid "Trash"
137
  msgstr ""
138
 
139
- #: functions.php:348
140
  msgid "Expand"
141
  msgstr ""
142
 
143
- #: functions.php:349
144
  msgid "Collapse"
145
  msgstr ""
146
 
147
- #: functions.php:357
148
  msgid "Clear search"
149
  msgstr ""
150
 
151
- #: functions.php:358
152
  msgid "Search"
153
  msgstr ""
154
 
155
- #: functions.php:359
156
  msgid "Searching..."
157
  msgstr ""
158
 
159
- #: functions.php:360
160
  msgid "Nothing found."
161
  msgstr ""
162
 
163
- #: functions.php:366
164
  msgid "Loading..."
165
  msgstr ""
166
 
167
- #: functions.php:371
168
  msgid "Search: no pages found"
169
  msgstr ""
170
 
171
- #: functions.php:374
172
  msgid "Loading tree"
173
  msgstr ""
174
 
175
- #: functions.php:386
176
  msgid "After"
177
  msgstr ""
178
 
179
- #: functions.php:390
180
  msgid "Inside"
181
  msgstr ""
182
 
183
- #: functions.php:394
184
  msgid "Can not create page inside of a page with draft status"
185
  msgstr ""
186
 
187
- #: functions.php:397
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
188
  msgid "Last modified"
189
  msgstr ""
190
 
191
- #: functions.php:399
192
  msgid "by"
193
  msgstr ""
194
 
195
- #: functions.php:402
196
  msgid "Page ID"
197
  msgstr ""
198
 
199
- #: functions.php:609
 
 
 
 
 
200
  msgid "Unknown user"
201
  msgstr ""
202
 
203
- #: functions.php:614
204
  msgid "<Untitled page>"
205
  msgstr ""
206
 
207
- #: functions.php:634
208
  msgid "Comments"
209
  msgstr ""
210
 
211
- #: functions.php:641
212
  msgid "%s pending"
213
  msgstr ""
214
 
215
- #: functions.php:651
216
  msgctxt "comment count"
217
  msgid "0"
218
  msgstr ""
219
 
220
- #: functions.php:651
221
  msgctxt "comment count"
222
  msgid "1"
223
  msgstr ""
224
 
225
- #: functions.php:651
226
  msgctxt "comment count"
227
  msgid "%"
228
  msgstr ""
229
 
230
- #: functions.php:682
231
- msgid "Click to edit. Drag to move."
232
  msgstr ""
233
 
234
- #: functions.php:833
235
- msgid "New page"
236
  msgstr ""
237
 
238
- #: functions.php:1015
239
- msgid "Close"
 
 
240
  msgstr ""
241
 
242
- #: functions.php:1016
 
 
 
 
 
 
 
 
 
 
 
 
243
  msgid ""
244
- "<strong>Thank you for using this plugin!</strong> If you need help please "
245
- "check out the <a href=\"http://eskapism.se/code-playground/cms-tree-page-"
246
- "view/?utm_source=wordpress&utm_medium=banner&utm_campaign=promobox\">plugin "
247
- "homepage</a> or the <a href=\"http://wordpress.org/tags/cms-tree-page-view?"
248
- "forum_id=10\">support forum</a>."
 
249
  msgstr ""
250
 
251
- #: functions.php:1017
252
  msgid ""
253
- "If you like this plugin, please <a href=\"http://eskapism.se/sida/donate/?"
254
- "utm_source=wordpress&utm_medium=banner&utm_campaign=promobox\">support my "
255
- "work by donating</a> - or at least say something nice about this plugin in a "
256
- "blog post or tweet."
 
 
 
 
 
 
 
 
 
 
257
  msgstr ""
1
+ # Copyright (C) 2012
2
  # This file is distributed under the same license as the package.
3
  msgid ""
4
  msgstr ""
5
  "Project-Id-Version: \n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/cms-tree-page-view\n"
7
+ "POT-Creation-Date: 2012-12-26 20:37:31+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
+ "PO-Revision-Date: 2012-MO-DA HO:MI+ZONE\n"
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
  "Language-Team: LANGUAGE <LL@li.org>\n"
14
 
15
+ #: functions.php:272
16
  msgid "Enter title of new page"
17
  msgstr ""
18
 
19
+ #: functions.php:273
20
  msgid "child pages"
21
  msgstr ""
22
 
23
+ #: functions.php:274 functions.php:887
24
  msgid "Edit page"
25
  msgstr ""
26
 
27
+ #: functions.php:275 functions.php:888
28
  msgid "View page"
29
  msgstr ""
30
 
31
+ #: functions.php:276 functions.php:887
32
  msgid "Edit"
33
  msgstr ""
34
 
35
+ #: functions.php:277 functions.php:888
36
  msgid "View"
37
  msgstr ""
38
 
39
+ #: functions.php:278
40
  msgid "Add page"
41
  msgstr ""
42
 
43
+ #: functions.php:279 functions.php:896
44
  msgid "Add new page after"
45
  msgstr ""
46
 
47
+ #: functions.php:280
48
  msgid "after"
49
  msgstr ""
50
 
51
+ #: functions.php:281
52
  msgid "inside"
53
  msgstr ""
54
 
55
+ #: functions.php:282
56
  msgid "Sorry, can't create a sub page to a page with status \"draft\"."
57
  msgstr ""
58
 
59
+ #: functions.php:283
60
  msgid "Sorry, can't create a sub page to a page with status \"trash\"."
61
  msgstr ""
62
 
63
+ #: functions.php:284
64
  msgid "Sorry, can't create a page after a page with status \"trash\"."
65
  msgstr ""
66
 
67
+ #: functions.php:285 functions.php:901
68
  msgid "Add new page inside"
69
  msgstr ""
70
 
71
+ #: functions.php:286 functions.php:292
72
  msgid "draft"
73
  msgstr ""
74
 
75
+ #: functions.php:287 functions.php:293
76
  msgid "future"
77
  msgstr ""
78
 
79
+ #: functions.php:288 functions.php:294
80
  msgid "protected"
81
  msgstr ""
82
 
83
+ #: functions.php:289 functions.php:295 functions.php:1235
84
  msgid "pending"
85
  msgstr ""
86
 
87
+ #: functions.php:290 functions.php:296
88
  msgid "private"
89
  msgstr ""
90
 
91
+ #: functions.php:291 functions.php:297
92
  msgid "trash"
93
  msgstr ""
94
 
95
+ #: functions.php:298
96
  msgid "Password protected page"
97
  msgstr ""
98
 
99
+ #: functions.php:299
100
  msgid "Adding page..."
101
  msgstr ""
102
 
103
+ #: functions.php:300
104
+ msgid "Adding ..."
105
+ msgstr ""
106
+
107
+ #: functions.php:393
108
+ msgid "Tree View"
109
+ msgstr ""
110
+
111
+ #: functions.php:402
112
+ msgid "List View"
113
+ msgstr ""
114
+
115
+ #: functions.php:438
116
+ msgid "Settings"
117
+ msgstr ""
118
+
119
+ #: functions.php:474
120
+ msgctxt "name of dashboard"
121
+ msgid "%1$s Tree"
122
+ msgstr ""
123
+
124
+ #: functions.php:502
125
+ msgctxt "name in menu"
126
+ msgid "Tree View"
127
+ msgstr ""
128
+
129
+ #: functions.php:503
130
+ msgctxt "title on page with tree"
131
+ msgid "%1$s Tree View"
132
+ msgstr ""
133
+
134
+ #: functions.php:523
135
  msgid "settings"
136
  msgstr ""
137
 
138
+ #: functions.php:529
139
  msgid "Select where to show a tree for pages and custom post types"
140
  msgstr ""
141
 
142
+ #: functions.php:573
143
  msgid "On dashboard"
144
  msgstr ""
145
 
146
+ #: functions.php:577
147
  msgid "In menu"
148
  msgstr ""
149
 
150
+ #: functions.php:581
151
+ msgid "On post overview screen"
152
+ msgstr ""
153
+
154
+ #: functions.php:599
155
  msgid "Save Changes"
156
  msgstr ""
157
 
158
+ #: functions.php:818
159
  msgid "No posts found."
160
  msgstr ""
161
 
162
+ #: functions.php:830
163
  msgid "All"
164
  msgstr ""
165
 
166
+ #: functions.php:835
167
  msgid "Public"
168
  msgstr ""
169
 
170
+ #: functions.php:840
171
  msgid "Trash"
172
  msgstr ""
173
 
174
+ #: functions.php:848
175
  msgid "Expand"
176
  msgstr ""
177
 
178
+ #: functions.php:849
179
  msgid "Collapse"
180
  msgstr ""
181
 
182
+ #: functions.php:857
183
  msgid "Clear search"
184
  msgstr ""
185
 
186
+ #: functions.php:858
187
  msgid "Search"
188
  msgstr ""
189
 
190
+ #: functions.php:859
191
  msgid "Searching..."
192
  msgstr ""
193
 
194
+ #: functions.php:860
195
  msgid "Nothing found."
196
  msgstr ""
197
 
198
+ #: functions.php:867
199
  msgid "Loading..."
200
  msgstr ""
201
 
202
+ #: functions.php:872
203
  msgid "Search: no pages found"
204
  msgstr ""
205
 
206
+ #: functions.php:875
207
  msgid "Loading tree"
208
  msgstr ""
209
 
210
+ #: functions.php:896 functions.php:932
211
  msgid "After"
212
  msgstr ""
213
 
214
+ #: functions.php:901 functions.php:933
215
  msgid "Inside"
216
  msgstr ""
217
 
218
+ #: functions.php:905
219
  msgid "Can not create page inside of a page with draft status"
220
  msgstr ""
221
 
222
+ #: functions.php:921
223
+ msgid "Add page(s)"
224
+ msgstr ""
225
+
226
+ #: functions.php:926
227
+ msgid "Enter title here"
228
+ msgstr ""
229
+
230
+ #: functions.php:931
231
+ msgid "Position"
232
+ msgstr ""
233
+
234
+ #: functions.php:938
235
+ msgid "Status"
236
+ msgstr ""
237
+
238
+ #: functions.php:939
239
+ msgid "Draft"
240
+ msgstr ""
241
+
242
+ #: functions.php:940
243
+ msgid "Published"
244
+ msgstr ""
245
+
246
+ #: functions.php:944
247
+ msgid "Add"
248
+ msgstr ""
249
+
250
+ #: functions.php:945
251
+ msgid "or"
252
+ msgstr ""
253
+
254
+ #: functions.php:946
255
+ msgid "cancel"
256
+ msgstr ""
257
+
258
+ #: functions.php:956
259
  msgid "Last modified"
260
  msgstr ""
261
 
262
+ #: functions.php:958
263
  msgid "by"
264
  msgstr ""
265
 
266
+ #: functions.php:961
267
  msgid "Page ID"
268
  msgstr ""
269
 
270
+ #: functions.php:997
271
+ msgctxt "headline of page with tree"
272
+ msgid "%1$s Tree View"
273
+ msgstr ""
274
+
275
+ #: functions.php:1200
276
  msgid "Unknown user"
277
  msgstr ""
278
 
279
+ #: functions.php:1205
280
  msgid "<Untitled page>"
281
  msgstr ""
282
 
283
+ #: functions.php:1225
284
  msgid "Comments"
285
  msgstr ""
286
 
287
+ #: functions.php:1232
288
  msgid "%s pending"
289
  msgstr ""
290
 
291
+ #: functions.php:1242
292
  msgctxt "comment count"
293
  msgid "0"
294
  msgstr ""
295
 
296
+ #: functions.php:1242
297
  msgctxt "comment count"
298
  msgid "1"
299
  msgstr ""
300
 
301
+ #: functions.php:1242
302
  msgctxt "comment count"
303
  msgid "%"
304
  msgstr ""
305
 
306
+ #: functions.php:1428
307
+ msgid "New page"
308
  msgstr ""
309
 
310
+ #: functions.php:1618
311
+ msgid "Thanks for using my plugin"
312
  msgstr ""
313
 
314
+ #: functions.php:1620
315
+ msgid ""
316
+ "Hi there! I just wanna says thanks for using my plugin. I hope you like it "
317
+ "as much as I do."
318
  msgstr ""
319
 
320
+ #: functions.php:1621
321
+ msgid "/Pär Thernström - plugin creator"
322
+ msgstr ""
323
+
324
+ #: functions.php:1623
325
+ msgid "I like this plugin<br>– how can I thank you?"
326
+ msgstr ""
327
+
328
+ #: functions.php:1624
329
+ msgid "There are serveral ways for you to show your appreciation:"
330
+ msgstr ""
331
+
332
+ #: functions.php:1626
333
  msgid ""
334
+ "<a href=\"%1$s\">Give it a nice review</a> over at the WordPress Plugin "
335
+ "Directory"
336
+ msgstr ""
337
+
338
+ #: functions.php:1627
339
+ msgid "<a href=\"%1$s\">Give a donation</a> – any amount will make me happy"
340
  msgstr ""
341
 
342
+ #: functions.php:1628
343
  msgid ""
344
+ "<a href=\"%1$s\">Post a nice tweet</a> or make a nice blog post about the "
345
+ "plugin"
346
+ msgstr ""
347
+
348
+ #: functions.php:1631
349
+ msgid "Support"
350
+ msgstr ""
351
+
352
+ #: functions.php:1632
353
+ msgid "Plese see the <a href=\"%1$s\">support forum</a> for help."
354
+ msgstr ""
355
+
356
+ #: functions.php:1636
357
+ msgid "Hide until next upgrade"
358
  msgstr ""
readme.txt CHANGED
@@ -2,11 +2,11 @@
2
  Contributors: eskapism, MarsApril
3
  Donate link: http://eskapism.se/sida/donate/
4
  Tags: page, pages, posts, custom posts, tree, cms, dashboard, overview, drag-and-drop, rearrange, management, manage, admin
5
- Requires at least: 3.0
6
- Tested up to: 3.3.1
7
- Stable tag: 0.8.9
8
 
9
- Adds a tree of all your pages or custom posts. Use drag & drop to reorder your pages, and edit, view, add, and search your pages.
10
 
11
  == Description ==
12
 
@@ -23,13 +23,34 @@ Page management in WordPress won't get any easier than this!
23
  * View your pages & posts in a tree-view, like you view files in Windows Explorer or the Finder in OS X
24
  * Drag and drop to rearrange/order your pages
25
  * Add pages after or inside a page
 
26
  * Edit pages
27
  * View pages
28
  * Search pages
29
  * Available for both regular pages and custom posts
 
30
  * View your site hierarchy directly from the WordPress dashboard
 
31
  * Support for translation plugin [WPML](http://wordpress.org/extend/plugins/sitepress-multilingual-cms/), so you can manage all the languages of your site
32
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  #### Screencast
34
  Watch this screencast to see how easy you could be managing your pages:
35
  [youtube http://www.youtube.com/watch?v=H4BGomLi_FU]
@@ -52,16 +73,13 @@ This plugin is available in the following languages:
52
  * Polish
53
  * Greek
54
  * Danish
55
-
56
- #### Making the tree available for your vistors
57
- If you're looking for a version of this page tree that the vistors of your site can use, then check out
58
- this navigation widget called [Nice Navigation](http://wordpress.org/extend/plugins/nice-navigation/).
59
 
60
  #### Always show your pages in the admin area
61
  If you want to always have a list of your pages available in your WordPress admin area, please check out the plugin
62
  [Admin Menu Tree Page View](http://wordpress.org/extend/plugins/admin-menu-tree-page-view/).
63
 
64
-
65
  #### Donation and more plugins
66
  * If you like this plugin don't forget to [donate to support further development](http://eskapism.se/sida/donate/).
67
  * More [WordPress CMS plugins](http://wordpress.org/extend/plugins/profile/eskapism) by the same author.
@@ -77,15 +95,84 @@ Now the tree with the pages will be visible both on the dashboard and in the men
77
  == Screenshots ==
78
 
79
  1. The page tree in action
80
- 2. Edit, view and add pages (choices visible upon mouse over).
81
- 3. Search pages.
82
  4. Drag-and-drop to rearrange/change the order of the pages.
83
  5. The tree is also available on the dashboard and therefore available immediately after you login.
84
- 6. The settings page - choose where you want the tree to show up
85
- 7. Users of WPML can find all their languages in the tree
86
 
87
  == Changelog ==
88
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
89
  = 0.8.9 =
90
  - Added Belarusian translation. thanks Web Geek Science  (<a href="http://webhostinggeeks.com/">Web Hosting Geeks</a>)
91
  - Fixed XSS vulnerability as described here: https://www.htbridge.com/advisory/HTB23083
@@ -336,7 +423,3 @@ http://wordpress.org/support/topic/plugin-cms-tree-page-view-broken-for-language
336
  - First public version.
337
 
338
 
339
- == Still on WordPress 2? ==
340
- If you are using WordPress 2.x you can try this old version instead:
341
- http://downloads.wordpress.org/plugin/cms-tree-page-view.0.4.9.zip
342
-
2
  Contributors: eskapism, MarsApril
3
  Donate link: http://eskapism.se/sida/donate/
4
  Tags: page, pages, posts, custom posts, tree, cms, dashboard, overview, drag-and-drop, rearrange, management, manage, admin
5
+ Requires at least: 3.4
6
+ Tested up to: 3.5
7
+ Stable tag: 1.2.1
8
 
9
+ Adds a tree view of all pages & custom posts. Get a great overview + options to drag & drop to reorder and option to add multiple pages at once.
10
 
11
  == Description ==
12
 
23
  * View your pages & posts in a tree-view, like you view files in Windows Explorer or the Finder in OS X
24
  * Drag and drop to rearrange/order your pages
25
  * Add pages after or inside a page
26
+ * Add multiple pages at once - perfect for setting up a new site structure
27
  * Edit pages
28
  * View pages
29
  * Search pages
30
  * Available for both regular pages and custom posts
31
+ * Works with both hierarchical and non-hierarchical post types
32
  * View your site hierarchy directly from the WordPress dashboard
33
+ * Drag and drop between trees with different post types to change to post type of the draged item, i.e. change a regular page to became any custom post type
34
  * Support for translation plugin [WPML](http://wordpress.org/extend/plugins/sitepress-multilingual-cms/), so you can manage all the languages of your site
35
 
36
+ #### Show your pages on your site in the same order as they are in CMS Tree Page View
37
+ To show your pages on your website in the same order as they appear in this plugin, you must
38
+ sort them by "menu order".
39
+
40
+ ´
41
+ // Example using query_posts
42
+ $args = array(
43
+ 'orderby'=> 'menu_order',
44
+ 'order'=>'ASC',
45
+ 'post_type' => 'page',
46
+ );
47
+ $posts = query_posts($args);
48
+
49
+ // Example using wp_query
50
+ $query = new WP_Query( array( 'post_type' => 'page', 'orderby' => 'title menu_order', 'order' => 'ASC' ) );
51
+
52
+ ´
53
+
54
  #### Screencast
55
  Watch this screencast to see how easy you could be managing your pages:
56
  [youtube http://www.youtube.com/watch?v=H4BGomLi_FU]
73
  * Polish
74
  * Greek
75
  * Danish
76
+ * Lithuanian
77
+ * Estonian
 
 
78
 
79
  #### Always show your pages in the admin area
80
  If you want to always have a list of your pages available in your WordPress admin area, please check out the plugin
81
  [Admin Menu Tree Page View](http://wordpress.org/extend/plugins/admin-menu-tree-page-view/).
82
 
 
83
  #### Donation and more plugins
84
  * If you like this plugin don't forget to [donate to support further development](http://eskapism.se/sida/donate/).
85
  * More [WordPress CMS plugins](http://wordpress.org/extend/plugins/profile/eskapism) by the same author.
95
  == Screenshots ==
96
 
97
  1. The page tree in action
98
+ 2. Edit, view and even add multiple pages at once!
99
+ 3. Search pages
100
  4. Drag-and-drop to rearrange/change the order of the pages.
101
  5. The tree is also available on the dashboard and therefore available immediately after you login.
102
+ 6. Users of WPML can find all their languages in the tree
103
+ 7. Quickly switch between regular list view and tree view using the switch icon
104
 
105
  == Changelog ==
106
 
107
+ = 1.2.1 =
108
+ - Fixed wrong count if WPML where activated and future or private posts existed for a language
109
+ - Show info message if no posts found after fetching posts with AJAX
110
+ - Updated Swedish translation
111
+ - Updated Russian translation - hopefully it works this time!
112
+ - Updated POT file
113
+ - Minor language fixes, like actually loading plugin textdomain before using any texts...
114
+
115
+ = 1.2 =
116
+ - Added option to show the tree in the regular post overview screen. Makes the tree view fit into the regular workflow and GUI much better. To enable: go to settings > CMS Tree Page View > Tick the option "On post overview screen". Then go to for example the pages overview screen and in the upper right corner there will be an icon to switch between the regular list view and the tree view of this plugin.
117
+ - Fixed so search button now looks more like the rest of the WordPress GUI
118
+ - Fixed a undefined index warning
119
+ - Fixed wrong language count for WPML-enabled post types
120
+ - Perhaps fixed a problem with some other plugins, for example Formidable Pro
121
+ - Added icon to settings page
122
+ - Added updated Russian translation
123
+ - Updated POT-file for translators
124
+
125
+ = 1.1 =
126
+ - Added "Add new"-link next to headline, to better match the regular post overview page + it makes it possible to add new pages/posts when there are no pages/posts added (previously there needed to be at least one post added to be able to add new posts)
127
+ - Added post count in parenthesis after each post status. Also makes the page match the regular post overview page a it more. Works for both built in post types and custom post types + if WPML is installed it will show post count for each language too.
128
+ - Fixed a bug with sortables (well, I kinda forgot to load that script at all!) that made the plugin only work on the dashboard.
129
+ - Fixed some IE-bugs
130
+
131
+ = 1.0 =
132
+ - New: create multiple pages at once! Add multiple pages faster than ever before! You can even select if the new pages should be drafts or published. And ever drag and drop the pages to get the correct order even before adding them. I know - it's awesome!
133
+ - Fixed: adds new pages with the correct and selected WPML-language
134
+ - Added: you can now change the type of a post by draging the post between different trees on the dashboard. So if you have one custom post type called "Cars" and another called "Bicycles" you can now drag a page from the cars tree to the bicicyles tree and the post will converted to that post type. Pretty powerful feature that you used to need a separately plugin to be able to do.
135
+ - Misc fixes
136
+ - Added new POT-file for translators
137
+ - I decided to call this version 1. I've been using this plugin for so long time now and I use it in almost every WordPress project I participate in (all projects with lots of pages), so with this new add-mulitple-page-feature it feels like it's time to go to version 1. Hope you'll agree! :)
138
+
139
+ = 0.10.1 =
140
+ - Fixed popup closing to fast on Firefox.
141
+ - Enable menu item setting by default for hierarchical post types during first install. It was confusing when it was enabled for pages but not for other post types. Consistency!
142
+ - Added link to settings page to plugin listing.
143
+ - Fixed: WPML-stuff now also works on custom post types
144
+
145
+ = 0.10 =
146
+ - Fixed position of action div. Now it's always to the right of the page name.
147
+ - Fixed so action div never is below the fold of the browser. Instead it's moved up until it's visible.
148
+ - Fixed problem related to hoverIntent and mouseover and drag and drop. There was just to many wierd things going on so I switched to my own solution instead. Let me know if it works ok for you too now again!
149
+
150
+ = 0.9 =
151
+ - Only output scripts and styles on pages that the plugin uses. This should speed up other parts of the WordPress admin a little tiny itsy bitsy bit.
152
+ - Added a hopefully not to spammy box about donation and stuff. Hopefully it it encourages some of you to give it a good review or maybe even donate some money. I've spent a lot, lot, LOT of time developing this plugin you know ;)
153
+ - Changed title on dashboard widgets and changed name of the menu item under each supported post type. Makes the titles/names look/feel a bit less dorky.
154
+ - Show icons next to the headline of top of pages with the tree
155
+ - Minor CSS changes like a little bit bigger text on the pages and a bit more spacing between each page. Makes a bit easier to drag and drop/move them around.
156
+ - Changed javascript to to use on() istead on live()
157
+ - Removed hoverIntent since that is included in WordPress by default
158
+ - Started using hoverIndent to make the popup with page actions show after a short while for each page. This also means that you can move outside the actions-pop-up for a short while without the pop up being closed - a thing that annoyed me very much. This makes the whole popup actions div thingie feels less in-your-face all the time. Hope you like it as much as I do!
159
+
160
+ = 0.8.14 =
161
+ - Added Estonian translation
162
+
163
+ = 0.8.13 =
164
+ - Updated Lithuanian language
165
+
166
+ = 0.8.12 =
167
+ - Fix for forever loading tree
168
+ - No plus-sign on nodes that has no children
169
+
170
+ = 0.8.11 =
171
+ - Changed the way to find the plugin url. Hopefully works better now. Thanks https://twitter.com/windyjonas for the patch.
172
+
173
+ = 0.8.10 =
174
+ - Updated Polish translation, including .mo-file
175
+
176
  = 0.8.9 =
177
  - Added Belarusian translation. thanks Web Geek Science  (<a href="http://webhostinggeeks.com/">Web Hosting Geeks</a>)
178
  - Fixed XSS vulnerability as described here: https://www.htbridge.com/advisory/HTB23083
423
  - First public version.
424
 
425
 
 
 
 
 
screenshot-2.png CHANGED
Binary file
screenshot-6.png CHANGED
Binary file
screenshot-7.png CHANGED
Binary file
scripts/cms_tree_page_view.js CHANGED
@@ -1,13 +1,204 @@
1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  // @todo: add prefix to treeOptions, div_actions
3
  var cms_tpv_tree, treeOptions, div_actions, cms_tpv_current_li_id = null;
4
  jQuery(function($) {
5
 
6
- cms_tpv_tree = $(".cms_tpv_container");
7
- div_actions = $(".cms_tpv_page_actions");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
 
9
  treeOptions = {
10
- xplugins: ["cookie","ui","crrm","themes","json_data","search","types","dnd"],
11
  plugins: ["themes","json_data","cookies","search","dnd", "types"],
12
  core: {
13
  "html_titles": true
@@ -17,55 +208,35 @@ jQuery(function($) {
17
  "url": ajaxurl + CMS_TPV_AJAXURL + CMS_TPV_VIEW,
18
  // this function is executed in the instance's scope (this refers to the tree instance)
19
  // the parameter is the node being loaded (may be -1, 0, or undefined when loading the root nodes)
20
- "data" : function (n) {
21
  // the result is fed to the AJAX request `data` option
22
  if (n.data) {
23
  var post_id = n.data("post_id");
24
  return {
25
  "id": post_id
26
- }
27
  }
28
- }
29
-
30
- }
31
- /*
32
- // data can be initially set like this
33
- // but it has to be set by type...
34
- "data": [{
35
- "data": {
36
- "title": "I am a new page",
37
- "attr": {
38
- "href": "http://localhost/wp-admin/post.php?post=1060&action=edit",
39
- "xid": "cms-tpv-1060"
40
- },
41
- "xicon": "http://localhost/wp-content/plugins/cms-tree-page-view/images/page_white_text.png"
42
  },
43
- "attr": {
44
- "xhref": "http://localhost/wp-admin/post.php?post=1060&action=edit",
45
- "id": "cms-tpv-1060",
46
- "xtitle": "Click to edit. Drag to move.",
47
- "class": "cms_tpv_user_can_edit_page_yes"
 
 
 
 
 
48
  },
49
- "metadata": {
50
- "id": "cms-tpv-1060",
51
- "post_id": "1060",
52
- "post_type": "page",
53
- "post_status": "publish",
54
- "rel": "publish",
55
- "childCount": 0,
56
- "permalink": "http://localhost/i-am-a-new-page/",
57
- "editlink": "http://localhost/wp-admin/post.php?post=1060&action=edit",
58
- "modified_time": "August 15, 2010",
59
- "modified_author": "admin",
60
- "columns": "%3Cdl%3E%3Cdt%3EComments%3C%2Fdt%3E%3Cdd%3E%3Cdiv%20class%3D%22post-com-count-wrapper%22%3E%3Ca%20href%3D%27edit-comments.php%3Fp%3D1060%27%20title%3D%270%20pending%27%3E%3Cspan%3E0%3C%2Fspan%3E%3C%2Fa%3E%3C%2Fdiv%3E%3C%2Fdd%3E%3C%2Fdl%3E",
61
- "user_can_edit_page": "1"
62
  }
63
-
64
  }
65
- ]*/
66
  },
67
  "themes": {
68
- "theme": "wordpress"
 
69
  },
70
  "search": {
71
  "ajax" : {
@@ -75,7 +246,7 @@ jQuery(function($) {
75
  },
76
  "dnd": {
77
  }
78
- }
79
 
80
  if (cms_tpv_tree.length > 0) {
81
  cms_tpv_bind_clean_node(); // don't remember why I run this here.. :/
@@ -91,7 +262,7 @@ jQuery(function($) {
91
  treeOptionsTmp.json_data.data = cms_tpv_jsondata[post_type]; // get from js
92
 
93
  var isHierarchical = $(elm).closest(".cms_tpv_wrapper").find("[name=cms_tpv_meta_post_type_hierarchical]").val();
94
- if (isHierarchical == 0) {
95
  // no move to children if not hierarchical
96
  treeOptionsTmp.types = {
97
  "types": {
@@ -99,119 +270,134 @@ jQuery(function($) {
99
  "valid_children" : [ "none" ]
100
  }
101
  }
102
- }
103
  }
104
 
105
  $elm.bind("search.jstree", function (event, data) {
106
- if (data.rslt.nodes.length == 0) {
107
  // no hits. doh.
108
  $(this).closest(".cms_tpv_wrapper").find(".cms_tree_view_search_form_no_hits").fadeIn("fast");
109
  }
110
  });
111
 
 
 
 
112
  $elm.jstree(treeOptionsTmp);
113
 
114
  });
115
-
116
 
117
  }); // end ondomready
118
 
119
 
120
- // get post type
121
- // elm must be within .cms_tpv_wrapper to work
122
- function cms_tpv_get_post_type(elm) {
123
- return jQuery(elm).closest(".cms_tpv_wrapper").find("[name=cms_tpv_meta_post_type]").val();
124
- }
125
- // get selected lang
126
- function cms_tpv_get_wpml_selected_lang(elm) {
127
- return jQuery(elm).closest(".cms_tpv_wrapper").find("[name=cms_tpv_meta_wpml_language]").val();
128
- }
129
 
130
- function cms_tpv_get_page_actions_div(elm) {
131
- return jQuery(elm).closest(".cms_tpv_wrapper").find(".cms_tpv_page_actions");
132
- }
133
- function cms_tpv_get_wrapper(elm) {
134
- var $wrapper = jQuery(elm).closest(".cms_tpv_wrapper");
135
- return $wrapper;
136
  }
137
 
138
 
139
- // add page after
140
- jQuery(".cms_tpv_action_add_page_after").live("click", function() {
141
- var $this = jQuery(this);
142
- var post_type = cms_tpv_get_post_type(this);
143
- var selected_lang = cms_tpv_get_wpml_selected_lang(this);
 
 
 
144
 
145
- var post_status = $this.closest("li").data("post_status");
 
 
 
 
 
146
 
147
- // not allowed when status is trash
148
- if (post_status == "trash") {
149
- jAlert(cmstpv_l10n.Can_not_add_page_after_when_status_is_trash);
150
- return false;
151
- }
152
 
153
- jPrompt(cmstpv_l10n.Enter_title_of_new_page, "", "CMS Tree Page View", function(new_page_title) {
154
- if (new_page_title) {
155
- var pageID = $this.parents("li:first").attr("id");
156
- jQuery(".cms_tpv_message").html("<p>"+cmstpv_l10n.Adding_page+"</p>").slideDown("fast");
157
- jQuery.post(ajaxurl, {
158
- "action": "cms_tpv_add_page",
159
- "pageID": pageID,
160
- "type": "after",
161
- "page_title": new_page_title,
162
- "post_type": post_type,
163
- "wpml_lang": selected_lang
164
- }, function(data, textStatus) {
165
- document.location = data;
166
- });
167
  }
168
- });
169
 
170
- return false;
171
- });
 
172
 
173
- // add page inside
174
- jQuery(".cms_tpv_action_add_page_inside").live("click", function() {
175
- var $this = jQuery(this);
176
- var post_type = cms_tpv_get_post_type(this);
177
- var selected_lang = cms_tpv_get_wpml_selected_lang(this);
178
-
179
- var post_status = $this.closest("li").data("post_status");
180
-
181
- // check page status, because we cant add a page inside a page with status draft or status trash
182
- // if we edit the page wordpress will forget the parent
183
- //$li.data("jstree").permalink;
184
- //var post_status = li.data("jstree").post_status;
185
- if (post_status == "draft") {
186
- jAlert(cmstpv_l10n.Can_not_add_sub_page_when_status_is_draft);
187
- return false;
188
- }
189
 
190
- // not allowed when status is trash
191
- if (post_status == "trash") {
192
- jAlert(cmstpv_l10n.Can_not_add_sub_page_when_status_is_trash);
193
- return false;
194
- }
195
-
196
- jPrompt(cmstpv_l10n.Enter_title_of_new_page, "", "CMS Tree Page View", function(new_page_title) {
197
- if (new_page_title) {
198
- var pageID = $this.parents("li:first").attr("id");
199
- jQuery(".cms_tpv_message").html("<p>" + cmstpv_l10n.Adding_page + "</p>").slideDown("fast");
200
- jQuery.post(ajaxurl, {
201
- "action": "cms_tpv_add_page",
202
- "pageID": pageID,
203
- "type": "inside",
204
- "page_title": new_page_title,
205
- "post_type": post_type,
206
- "wpml_lang": selected_lang
207
- }, function(data, textStatus) {
208
- document.location = data;
209
- });
210
  }
 
211
  });
212
- return false;
213
- });
214
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
215
 
216
 
217
  // check if tree is beging dragged
@@ -221,19 +407,34 @@ function cms_tpv_is_dragging() {
221
  }
222
 
223
  // fired when mouse is over li
224
- function cms_tpv_mouseover_li(li) {
 
225
 
226
- //console.log("show actions div");
227
- $li = jQuery(li);
 
 
 
228
 
229
- var div_actions_for_post_type = cms_tpv_get_page_actions_div(li);
 
 
 
230
 
231
- if (cms_tpv_is_dragging() == false) {
232
-
233
- if (div_actions_for_post_type.is(":visible")) {
234
  // do nada
235
  } else {
236
 
 
 
 
 
 
 
 
 
 
 
237
  $li.find("a:first").addClass("hover");
238
 
239
  // setup link for view page
@@ -245,92 +446,131 @@ function cms_tpv_mouseover_li(li) {
245
  $edit = div_actions_for_post_type.find(".cms_tpv_action_edit");
246
  var editlink = $li.data("editlink");
247
  $edit.attr("href", editlink);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
248
 
249
  // check if user is allowed to edit page
250
  var $cms_tpv_action_add_and_edit_page = div_actions_for_post_type.find(".cms_tpv_action_add_and_edit_page");
251
- if ($li.data("user_can_edit_page") == 0) {
252
  // nooope
253
  $edit.hide();
254
  $cms_tpv_action_add_and_edit_page.hide();
255
  } else {
256
- $edit.show();
257
  $cms_tpv_action_add_and_edit_page.show();
 
258
  }
259
 
260
- // ..and some extras
261
- div_actions_for_post_type.find(".cms_tpv_page_actions_modified_time").text($li.data("modified_time"));
262
- div_actions_for_post_type.find(".cms_tpv_page_actions_modified_by").text($li.data("modified_author"));
263
- div_actions_for_post_type.find(".cms_tpv_page_actions_page_id").text($li.data("post_id"));
264
-
265
- div_actions_for_post_type.find(".cms_tpv_page_actions_columns").html( unescape($li.data("columns")) );
266
-
267
- // position and show action div
268
- var $a = $li.find("a");
269
- var width = $a.outerWidth(true);
270
- $li.append(div_actions_for_post_type);
271
- left_pos = width+28;
272
- top_pos = -8;
273
- div_actions_for_post_type.css("left", left_pos);
274
- div_actions_for_post_type.css("top", top_pos);
275
- div_actions_for_post_type.show();
276
  }
277
  }
278
 
279
  }
280
 
281
- // fired when mouse leaves li
282
- function cms_tpv_mouseout_li(li) {
283
- $li = jQuery(li);
284
- $li.find("a:first").removeClass("hover");
285
- div_actions.hide();
286
- }
287
-
288
- // mouse over, show actions
289
- // but only if the mouse not already is over the li (don't know why it fires multiple times, but it does)
290
- // 29 August, 2010 this worked nice but it had problems with child-lis...
291
- /*
292
- jQuery(".jstree li").live("mouseenter", function(e) {
293
 
294
- //console.log("mouseenter");
295
- var $li = jQuery(this);
296
- var li_id = $li.attr("id");
297
 
298
- // add hoverIntent, if not prev. attached
299
- if ($li.data("hasHoverIntent")) {
300
- // already got it
301
- } else {
302
- $li.data("hasHoverIntent", true);
303
- $li.hoverIntent(function() {
304
- // console.log("over");
305
- cms_tpv_mouseover_li(this);
306
- }, function() {
307
- console.log("out");
308
- //cms_tpv_mouseout_li(this);
309
- });
310
- // lastlt trigger mouseenter again so the popup will show
311
- $li.trigger("mouseover");
312
  }
313
 
314
- });
315
- */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
316
 
317
- jQuery(".jstree li").live("mouseover", function(e) {
318
- var $li = jQuery(this);
319
- var li_id = $li.attr("id");
320
- cms_tpv_mouseover_li(this);
321
  });
322
- // ..and hide them again
323
- jQuery(".jstree li").live("mouseout", function() {
324
- //cms_tpv_current_li_id = null;
325
- //console.log("out");
326
- cms_tpv_mouseout_li(this);
 
 
 
 
 
 
 
327
  });
328
 
329
 
330
- // hide action links on drag
331
- jQuery.jstree.drag_start = function() {
332
- jQuery(".cms_tpv_action_view, .cms_tpv_action_edit, .cms_tpv_action_add_page, .cms_tpv_action_add_page_after, .cms_tpv_action_add_page_inside").hide();
333
- }
 
 
 
 
334
 
335
  /**
336
  * add childcount and other things to each li
@@ -368,22 +608,24 @@ function cms_tpv_bind_clean_node() {
368
  data.r - the drop target
369
  */
370
 
 
 
371
  if (nodePosition == "before") {
372
- var node_id = jQuery( nodeBeingMoved ).attr( "id" );
373
  ref_node_id = jQuery( nodeRef ).attr( "id" );
374
  } else if (nodePosition == "after") {
375
- var node_id = jQuery( nodeBeingMoved ).attr( "id" );
376
  ref_node_id = jQuery( nodeR ).attr( "id" );
377
  } else if (nodePosition == "inside") {
378
- var node_id = jQuery( nodeBeingMoved ).attr( "id" );
379
  ref_node_id = jQuery( nodeR ).attr( "id" );
380
  }
381
 
382
  // Update parent or menu order
383
  jQuery.post(ajaxurl, {
384
- action: "cms_tpv_move_page",
385
- "node_id": node_id,
386
- "ref_node_id": ref_node_id,
387
  "type": nodePosition,
388
  "icl_post_language": selected_lang
389
  }, function(data, textStatus) {
@@ -395,6 +637,7 @@ function cms_tpv_bind_clean_node() {
395
  var obj = (data.rslt.obj);
396
  if (obj && obj != -1) {
397
  obj.each(function(i, elm) {
 
398
  var li = jQuery(elm);
399
  var aFirst = li.find("a:first");
400
 
@@ -404,52 +647,53 @@ function cms_tpv_bind_clean_node() {
404
  } else {
405
  li.data("done_cms_tpv_clean_node", true);
406
  }
407
- // new way:
408
- // console.log(li.data("childCount"));
409
- // add number of children
410
- //if (li.data("jstree")) {
411
- var childCount = li.data("childCount");
412
- if (childCount > 0) {
413
- aFirst.append("<span title='" + childCount + " " + cmstpv_l10n.child_pages + "' class='child_count'>("+childCount+")</span>");
414
- }
415
-
416
- // add protection type
417
- var rel = li.data("rel");
418
- if(rel == "password") {
419
- aFirst.find("ins").after("<span class='post_protected' title='" + cmstpv_l10n.Password_protected_page + "'>&nbsp;</span>");
420
- }
421
-
422
- // add page type
423
- var post_status = li.data("post_status");
424
- // post_status can be any value because of plugins like Edit flow
425
- // check if we have an existing translation for the string, otherwise use the post status directly
426
- var post_status_to_show = "";
427
- if (post_status_to_show = cmstpv_l10n["Status_"+post_status]) {
428
- // it's ok
429
- } else {
430
- post_status_to_show = post_status;
431
- }
432
- if (post_status != "publish") {
433
- aFirst.find("ins").first().after("<span class='post_type post_type_"+post_status+"'>" + post_status_to_show + "</span>");
434
- }
435
- //}
436
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
437
  });
438
  }
439
  });
440
  }
441
 
442
- // search: perform
443
- jQuery(".cms_tree_view_search_form").live("submit", function() {
 
444
  var $wrapper = jQuery(this).closest(".cms_tpv_wrapper");
445
  $wrapper.find(".cms_tpv_search_no_hits").hide();
446
  var s = $wrapper.find(".cms_tree_view_search").attr("value");
447
  s = jQuery.trim( s );
448
- // search, oh the mighty search!
449
  if (s) {
450
  $wrapper.find(".cms_tree_view_search_form_no_hits").fadeOut("fast");
451
  $wrapper.find(".cms_tree_view_search_form_working").fadeIn("fast");
452
- $wrapper.find(".cms_tree_view_search_form_reset")
453
  $wrapper.find(".cms_tpv_container").jstree("search", s);
454
  $wrapper.find(".cms_tree_view_search_form_reset").fadeIn("fast");
455
  } else {
@@ -458,13 +702,15 @@ jQuery(".cms_tree_view_search_form").live("submit", function() {
458
  $wrapper.find(".cms_tree_view_search_form_reset").fadeOut("fast");
459
  }
460
  $wrapper.find(".cms_tree_view_search_form_working").fadeOut("fast");
 
461
  return false;
 
462
  });
463
 
464
- // search: reset
465
- jQuery(".cms_tree_view_search_form_reset").live("click", function() {
466
  var $wrapper = jQuery(this).closest(".cms_tpv_wrapper");
467
- $wrapper.find(".cms_tree_view_search").val("")
468
  $wrapper.find(".cms_tpv_container").jstree("clear_search");
469
  $wrapper.find(".cms_tree_view_search_form_reset").fadeOut("fast");
470
  $wrapper.find(".cms_tree_view_search_form_no_hits").fadeOut("fast");
@@ -472,43 +718,67 @@ jQuery(".cms_tree_view_search_form_reset").live("click", function() {
472
  });
473
 
474
  // open/close links
475
- jQuery(".cms_tpv_open_all").live("click", function() {
476
  var $wrapper = jQuery(this).closest(".cms_tpv_wrapper");
477
  $wrapper.find(".cms_tpv_container").jstree("open_all");
478
  return false;
479
  });
480
- jQuery(".cms_tpv_close_all").live("click", function() {
 
481
  var $wrapper = jQuery(this).closest(".cms_tpv_wrapper");
482
  $wrapper.find(".cms_tpv_container").jstree("close_all");
483
  return false;
484
  });
485
 
486
  // view all or public or trash
487
- jQuery(".cms_tvp_view_all").live("click", function() {
488
  cms_tvp_set_view("all", this);
489
  return false;
490
  });
491
- jQuery(".cms_tvp_view_public").live("click", function() {
 
492
  cms_tvp_set_view("public", this);
493
  return false;
494
  });
495
- jQuery(".cms_tvp_view_trash").live("click", function() {
 
496
  cms_tvp_set_view("trash", this);
497
  return false;
498
  });
499
 
500
 
501
- // change lang
502
- jQuery("a.cms_tvp_switch_lang").live("click", function(e) {
 
503
  $wrapper = cms_tpv_get_wrapper(this);
 
 
504
  $wrapper.find("ul.cms_tvp_switch_langs a").removeClass("current");
505
  jQuery(this).addClass("current");
506
 
 
507
  var re = /cms_tpv_switch_language_code_([\w-]+)/;
508
  var matches = re.exec( jQuery(this).attr("class") );
509
  var lang_code = matches[1];
 
 
510
  $wrapper.find("[name=cms_tpv_meta_wpml_language]").val(lang_code);
511
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
512
  var current_view = cms_tpv_get_current_view(this);
513
  cms_tvp_set_view(current_view, this);
514
 
@@ -516,29 +786,45 @@ jQuery("a.cms_tvp_switch_lang").live("click", function(e) {
516
 
517
  });
518
 
 
 
 
 
 
519
  function cms_tpv_get_current_view(elm) {
 
520
  $wrapper = cms_tpv_get_wrapper(elm);
 
521
  if ($wrapper.find(".cms_tvp_view_all").hasClass("current")) {
522
  return "all";
523
  } else if ($wrapper.find(".cms_tvp_view_public").hasClass("current")) {
524
  return "public";
525
  } else {
526
- return false; // like unknown
527
  }
528
 
529
  }
530
 
 
 
 
 
 
531
  function cms_tvp_set_view(view, elm) {
532
 
533
- var $wrapper = jQuery(elm).closest(".cms_tpv_wrapper");
 
534
 
535
- var div_actions_for_post_type = cms_tpv_get_page_actions_div(elm);
536
- $wrapper.append(div_actions_for_post_type);
537
 
 
538
  $wrapper.find(".cms_tvp_view_all, .cms_tvp_view_public, .cms_tvp_view_trash").removeClass("current");
539
  $wrapper.find(".cms_tpv_container").jstree("destroy").html("");
 
 
540
  cms_tpv_bind_clean_node();
541
 
 
542
  if (view == "all") {
543
  $wrapper.find(".cms_tvp_view_all").addClass("current");
544
  } else if (view == "public") {
@@ -549,7 +835,56 @@ function cms_tvp_set_view(view, elm) {
549
 
550
  }
551
 
 
552
  var treeOptionsTmp = jQuery.extend(true, {}, treeOptions);
553
  treeOptionsTmp.json_data.ajax.url = ajaxurl + CMS_TPV_AJAXURL + view + "&post_type=" + cms_tpv_get_post_type(elm) + "&lang=" + cms_tpv_get_wpml_selected_lang(elm);
 
 
554
  $wrapper.find(".cms_tpv_container").jstree(treeOptionsTmp);
 
555
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
 
2
+ /*
3
+
4
+ Some docs so I remember how things work:
5
+
6
+ Timers:
7
+
8
+ cmstpv_global_link_timer
9
+ set when mouse over link. used to show the actions div.
10
+
11
+ */
12
+
13
+
14
+ /**
15
+ * Should have a module for all instead...
16
+ */
17
+ var cms_tree_page_view = (function ($) {
18
+
19
+ var my = {},
20
+ privateVariable = 1;
21
+
22
+ function privateMethod() {
23
+ // ...
24
+ }
25
+
26
+ my.moduleProperty = 1;
27
+ my.elements = {};
28
+
29
+ my.selectors = {
30
+ containers: "div.cms_tpv_container",
31
+ action_div: "div.cms_tpv_page_actions",
32
+ action_doit: "div.cms_tpv_action_add_doit"
33
+ };
34
+
35
+ my.init = function() {
36
+ my.log("init cms tree page view");
37
+ my.setup_elements();
38
+ my.setup_listeners();
39
+ };
40
+
41
+ // this is wrong, the action div and doit should be for each container, not for all
42
+ my.setup_elements = function() {
43
+ for (var elm in my.selectors) {
44
+ if (my.selectors.hasOwnProperty(elm))
45
+ my.elements[elm] = $(my.selectors[elm]);
46
+ }
47
+ };
48
+
49
+ my.setup_listeners = function() {
50
+
51
+ // When something has been written in one of the page titles: show another row
52
+ // Also: if more than one row are empty at the end, remove all but the last
53
+ $(document).on("keyup", "ul.cms_tpv_action_add_doit_pages li:last-child input", function(e) {
54
+
55
+ var $t = $(this);
56
+ var $li = $t.closest("li");
57
+
58
+ if ($.trim($t.val()) !== "") {
59
+
60
+ var $new_li = $li.clone().hide();
61
+ $new_li.find("input").val("");
62
+ $li.after( $new_li );
63
+ $new_li.slideDown();
64
+
65
+ }
66
+
67
+ });
68
+
69
+ // Click on cancel-link = hide add-div
70
+ jQuery(document).on("click", "a.cms_tpv_add_cancel", function(e) {
71
+
72
+ e.preventDefault();
73
+ var actions_div_doit = cms_tpv_get_page_actions_div_doit(this);
74
+ actions_div_doit.slideUp("fast", function() {
75
+
76
+ // Reset status back to draft
77
+ $("input[name='cms_tpv_add_status'][value='draft']").attr("checked", true);
78
+
79
+ // Remove all LIs except the last one
80
+ $("ul.cms_tpv_action_add_doit_pages").find("li:not(:last)").remove();
81
+
82
+ });
83
+
84
+ });
85
+
86
+ // Click on link to add pages
87
+ jQuery(document).on("click", "a.cms_tpv_action_add_page_after, a.cms_tpv_action_add_page_inside", function(e) {
88
+
89
+ e.preventDefault();
90
+ var $this = jQuery(this);
91
+ var post_type = cms_tpv_get_post_type(this);
92
+ var selected_lang = cms_tpv_get_wpml_selected_lang(this);
93
+ var actions_div = cms_tpv_get_page_actions_div(this);
94
+ var actions_div_doit = cms_tpv_get_page_actions_div_doit(this);
95
+ var post_status = actions_div.data("post_status");
96
+
97
+ var add_type = "";
98
+ if ($this.hasClass("cms_tpv_action_add_page_after")) {
99
+ add_type = "after";
100
+ } else if ($this.hasClass("cms_tpv_action_add_page_inside")) {
101
+ add_type = "inside";
102
+ }
103
+
104
+ // not allowed when status is trash
105
+ if (post_status === "trash" && add_type === "inside") {
106
+ jAlert(cmstpv_l10n.Can_not_add_page_after_when_status_is_trash);
107
+ return;
108
+ }
109
+
110
+ // if status is draft then it's not ok to add sub pages
111
+ if (post_status === "draft" && add_type === "inside") {
112
+ jAlert(cmstpv_l10n.Can_not_add_sub_page_when_status_is_draft);
113
+ return false;
114
+ }
115
+
116
+ // Make the list sortable
117
+ $("ul.cms_tpv_action_add_doit_pages").sortable({
118
+ "axis": "y",
119
+ "items": "> li:not(:last)",
120
+ "containment": 'parent',
121
+ "forceHelperSize": true,
122
+ "forcePlaceholderSize": true,
123
+ "handle": "span:first",
124
+ "placeholder": "ui-state-highlight"
125
+ });
126
+
127
+ // Set up correct values for input fields and radio buttons and then show form/section
128
+ actions_div_doit.find("[name='lang']").val(selected_lang);
129
+ actions_div_doit.find("[name='cms_tpv_add_type'][value='"+add_type+"']").attr("checked", "checked");
130
+ actions_div_doit.find("[name='ref_post_id']").val( actions_div.data("post_id") );
131
+ actions_div_doit.slideDown("fast", function() {
132
+ actions_div_doit.find("[name='cms_tpv_add_new_pages_names[]']").focus();
133
+ });
134
+
135
+
136
+ }); // click add page
137
+
138
+ // submit form with new pages
139
+ jQuery(document).on("submit", "div.cms_tpv_action_add_doit form", function(e) {
140
+
141
+ //e.preventDefault();
142
+ my.log("submitting form");
143
+ var $form = $(this);
144
+ $form.find("input[type='submit']").val( cmstpv_l10n.Adding ).attr("disabled", true);
145
+
146
+ });
147
+
148
+ };
149
+
150
+ /**
151
+ * Log, but only if console.log is available
152
+ */
153
+ my.log = function(what) {
154
+ if (typeof(window.console) === "object" && typeof(window.console.log) === "function" ) {
155
+ console.log(what);
156
+ }
157
+ };
158
+
159
+ return my;
160
+
161
+ }(jQuery));
162
+
163
+ // Bott it up on domready
164
+ jQuery(function() {
165
+ cms_tree_page_view.init();
166
+ });
167
+
168
+
169
  // @todo: add prefix to treeOptions, div_actions
170
  var cms_tpv_tree, treeOptions, div_actions, cms_tpv_current_li_id = null;
171
  jQuery(function($) {
172
 
173
+ // Globals, don't "var" them! :)
174
+ cms_tpv_tree = $("div.cms_tpv_container");
175
+ div_actions = $("div.cms_tpv_page_actions");
176
+ cms_tpv_message = $("div.cms_tpv_message");
177
+
178
+ // try to override css
179
+ var height = "20", height2 = "18", ins_height = "20";
180
+ css_string = '' +
181
+ '.jstree ul, .jstree li { display:block; margin:0 0 0 0; padding:0 0 0 0; list-style-type:none; } ' +
182
+ '.jstree li { display:block; min-height:'+height+'px; line-height:'+height+'px; white-space:nowrap; margin-left:18px; min-width:18px; } ' +
183
+ '.jstree-rtl li { margin-left:0; margin-right:18px; } ' +
184
+ '.jstree > ul > li { margin-left:0px; } ' +
185
+ '.jstree-rtl > ul > li { margin-right:0px; } ' +
186
+ '.jstree ins { display:inline-block; text-decoration:none; width:18px; height:'+height+'px; margin:0 0 0 0; padding:0; } ' +
187
+ '.jstree a { display:inline-block; line-height:'+height2+'px; height:'+height2+'px; color:black; white-space:nowrap; text-decoration:none; padding:1px 2px; margin:0; } ' +
188
+ '.jstree a:focus { outline: none; } ' +
189
+ '.jstree a > ins { height:'+ins_height+'px; width:16px; } ' +
190
+ '.jstree a > .jstree-icon { margin-right:3px; } ' +
191
+ '.jstree-rtl a > .jstree-icon { margin-left:3px; margin-right:0; } ' +
192
+ 'li.jstree-open > ul { display:block; } ' +
193
+ 'li.jstree-closed > ul { display:none; } ' +
194
+ '#vakata-dragged { background-color: white; };' +
195
+ '';
196
+ $.vakata.css.add_sheet({
197
+ str : css_string,
198
+ title : "jstree_cms_tpv"
199
+ });
200
 
201
  treeOptions = {
 
202
  plugins: ["themes","json_data","cookies","search","dnd", "types"],
203
  core: {
204
  "html_titles": true
208
  "url": ajaxurl + CMS_TPV_AJAXURL + CMS_TPV_VIEW,
209
  // this function is executed in the instance's scope (this refers to the tree instance)
210
  // the parameter is the node being loaded (may be -1, 0, or undefined when loading the root nodes)
211
+ "data" : function (n) {
212
  // the result is fed to the AJAX request `data` option
213
  if (n.data) {
214
  var post_id = n.data("post_id");
215
  return {
216
  "id": post_id
217
+ };
218
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
219
  },
220
+ "success": function(data, status) {
221
+
222
+ // If data is null or empty = show message about no nodes
223
+ if (data === null || !data) {
224
+ cms_tpv_message.html( "<p>" + cmstpv_l10n["No posts found"] + "</p>" );
225
+ cms_tpv_message.show();
226
+ } /*else {
227
+ cms_tpv_message.hide();
228
+ }*/
229
+
230
  },
231
+ "error": function(data, status) {
 
 
 
 
 
 
 
 
 
 
 
 
232
  }
233
+
234
  }
235
+
236
  },
237
  "themes": {
238
+ "theme": "wordpress",
239
+ "dots": false
240
  },
241
  "search": {
242
  "ajax" : {
246
  },
247
  "dnd": {
248
  }
249
+ };
250
 
251
  if (cms_tpv_tree.length > 0) {
252
  cms_tpv_bind_clean_node(); // don't remember why I run this here.. :/
262
  treeOptionsTmp.json_data.data = cms_tpv_jsondata[post_type]; // get from js
263
 
264
  var isHierarchical = $(elm).closest(".cms_tpv_wrapper").find("[name=cms_tpv_meta_post_type_hierarchical]").val();
265
+ if (isHierarchical === "0") {
266
  // no move to children if not hierarchical
267
  treeOptionsTmp.types = {
268
  "types": {
270
  "valid_children" : [ "none" ]
271
  }
272
  }
273
+ };
274
  }
275
 
276
  $elm.bind("search.jstree", function (event, data) {
277
+ if (data.rslt.nodes.length === 0) {
278
  // no hits. doh.
279
  $(this).closest(".cms_tpv_wrapper").find(".cms_tree_view_search_form_no_hits").fadeIn("fast");
280
  }
281
  });
282
 
283
+ // whole tre loaded
284
+ $elm.bind("loaded.jstree", cms_tpv_tree_loaded);
285
+
286
  $elm.jstree(treeOptionsTmp);
287
 
288
  });
 
289
 
290
  }); // end ondomready
291
 
292
 
293
+ function cms_tpv_mouseover(e) {
294
+
295
+ var $this = jQuery(this);
296
+ var $li = $this.closest("li");
297
+ cms_tpv_mouseover_li(e, $li.get(0));
298
+ return true;
 
 
 
299
 
 
 
 
 
 
 
300
  }
301
 
302
 
303
+ /**
304
+ * When tree is loaded: start hoverindenting stuff
305
+ * Is only fired when tree was loaded and contained stuff
306
+ */
307
+ function cms_tpv_tree_loaded(event, data) {
308
+
309
+ var $container = jQuery(event.target);
310
+ var actions_div_doit = cms_tpv_get_page_actions_div_doit(event.target);
311
 
312
+ // init = clear up some things
313
+ actions_div_doit.hide();
314
+ $container.find("li.has-visible-actions").removeClass("has-visible-actions");
315
+ $container.find("a.hover").removeClass("hover");
316
+ $container.find("div.cms_tpv_page_actions").removeClass("cms_tpv_page_actions_visible");
317
+ $container.find("div.cms_tpv_page_actions_visible").removeClass("cms_tpv_page_actions_visible");
318
 
319
+ // when mouse enters a/link
320
+ // start timer and if no other a/link has been moused over since it started it's ok to show this one
321
+ jQuery($container).on("mouseenter", "a", function(e) {
 
 
322
 
323
+ // Don't activate if entered on ins-tag. We use that only for drag and drop
324
+ // if (e.relatedTarget && e.relatedTarget.tagName === "INS") return;
325
+
326
+ cms_tree_page_view.log("mouseenter container");
327
+
328
+ var global_timer = $container.data("cmstpv_global_link_timer");
329
+
330
+ if (global_timer) {
331
+ // global timer exists, so overwrite it with our new one
332
+ // stop that timer before setting ours
333
+ cms_tree_page_view.log("clear global timer");
334
+ clearTimeout(global_timer);
335
+ } else {
336
+ // no timer exists, overwrite with ours
337
  }
 
338
 
339
+ // create new timer to show action div, no matter if one exists already
340
+ // but not if we are creating new pages
341
+ cms_tree_page_view.log("add timer for mousover on link");
342
 
343
+ if ( ! actions_div_doit.is(":visible") ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
344
 
345
+ var timeoutID = setTimeout((function() {
346
+ cms_tpv_mouseover_li(e);
347
+ }), 500, e);
348
+
349
+ $container.data("cmstpv_global_link_timer", timeoutID);
350
+
351
+ } else {
352
+ //console.log("timer not added because doit visible");
 
 
 
 
 
 
 
 
 
 
 
 
353
  }
354
+
355
  });
 
 
356
 
357
+ /**
358
+ * When mouse down we may want to drag and drop,
359
+ * so hide the action div and cancel the timer
360
+ */
361
+ jQuery($container).on("mousedown", "a", function(e) {
362
+
363
+ cms_tree_page_view.log("mousedown a");
364
+
365
+ var $target = jQuery(e.target);
366
+ var $container = $target.closest("div.cms_tpv_container");
367
+ var $wrapper = $container.closest("div.cms_tpv_wrapper");
368
+
369
+ $container.find("li.has-visible-actions").removeClass("has-visible-actions");
370
+ $container.find("a.hover").removeClass("hover");
371
+ $wrapper.find("div.cms_tpv_page_actions").removeClass("cms_tpv_page_actions_visible");
372
+
373
+ });
374
+
375
+ }
376
+
377
+
378
+ // get post type
379
+ // elm must be within .cms_tpv_wrapper to work
380
+ function cms_tpv_get_post_type(elm) {
381
+ return jQuery(elm).closest("div.cms_tpv_wrapper").find("[name=cms_tpv_meta_post_type]").val();
382
+ }
383
+ // get selected lang
384
+ function cms_tpv_get_wpml_selected_lang(elm) {
385
+ return jQuery(elm).closest("div.cms_tpv_wrapper").find("[name=cms_tpv_meta_wpml_language]").val();
386
+ }
387
+
388
+ function cms_tpv_get_page_actions_div(elm) {
389
+ return jQuery(elm).closest("div.cms_tpv_wrapper").find("div.cms_tpv_page_actions");
390
+ }
391
+
392
+ function cms_tpv_get_page_actions_div_doit(elm) {
393
+ return jQuery(elm).closest("div.cms_tpv_wrapper").find("div.cms_tpv_action_add_doit");
394
+ }
395
+
396
+
397
+ function cms_tpv_get_wrapper(elm) {
398
+ var $wrapper = jQuery(elm).closest("div.cms_tpv_wrapper");
399
+ return $wrapper;
400
+ }
401
 
402
 
403
  // check if tree is beging dragged
407
  }
408
 
409
  // fired when mouse is over li
410
+ // actually when over a, old name :/
411
+ function cms_tpv_mouseover_li(e) {
412
 
413
+ var $target = jQuery(e.target);
414
+ var $li = $target.closest("li");
415
+ var div_actions_for_post_type = cms_tpv_get_page_actions_div($li);
416
+ var actions_div_doit = cms_tpv_get_page_actions_div_doit($li);
417
+ var $cms_tpv_container = $li.closest("div.cms_tpv_container");
418
 
419
+ if (cms_tpv_is_dragging() === false) {
420
+
421
+ var is_visible = div_actions_for_post_type.is(":visible");
422
+ is_visible = false;
423
 
424
+ if (is_visible) {
 
 
425
  // do nada
426
  } else {
427
 
428
+ // Add info to the action div from the li
429
+ div_actions_for_post_type.data("post_status", $li.data("post_status"));
430
+
431
+ // Remove classes on all elements
432
+ $cms_tpv_container.find("li.has-visible-actions").removeClass("has-visible-actions");
433
+ $cms_tpv_container.find("a.hover").removeClass("hover");
434
+
435
+ // Add classes to only our new
436
+ $li.addClass("has-visible-actions");
437
+ $cms_tpv_container.addClass("has-visible-actions");
438
  $li.find("a:first").addClass("hover");
439
 
440
  // setup link for view page
446
  $edit = div_actions_for_post_type.find(".cms_tpv_action_edit");
447
  var editlink = $li.data("editlink");
448
  $edit.attr("href", editlink);
449
+
450
+ // ..and some extras
451
+ div_actions_for_post_type.find(".cms_tpv_page_actions_modified_time").text($li.data("modified_time"));
452
+ div_actions_for_post_type.find(".cms_tpv_page_actions_modified_by").text($li.data("modified_author"));
453
+ div_actions_for_post_type.find(".cms_tpv_page_actions_page_id").text($li.data("post_id"));
454
+ div_actions_for_post_type.find(".cms_tpv_page_actions_columns").html( unescape($li.data("columns")) );
455
+
456
+ // add post title as headline
457
+ div_actions_for_post_type.find(".cms_tpv_page_actions_headline").html( $li.data("post_title") );
458
+
459
+ // add post id to data
460
+ div_actions_for_post_type.data("post_id", $li.data("post_id"));
461
+
462
+ // position and show action div
463
+ var $a = $li.find("a");
464
+ var width = $a.outerWidth(true);
465
+ var new_offset = div_actions_for_post_type.offset();
466
+ var new_offset_left = e.pageX + 35;
467
+
468
+ new_offset_left = $a.offset().left + $a.width() + 20;
469
+ new_offset.left = new_offset_left;
470
+ new_offset.top = $a.offset().top - 30;
471
+ div_actions_for_post_type.offset(new_offset);
472
+
473
+ // check if action div bottom is visible in browser window, if not move it up until it is
474
+ var pos_diff = (div_actions_for_post_type.offset().top + div_actions_for_post_type.height()) - (jQuery(window).height() + jQuery(window).scrollTop());
475
+ if (pos_diff > 0) {
476
+
477
+ // set action div to begin at bottom of link instead
478
+ new_offset.top = $a.offset().top - div_actions_for_post_type.height() + 15; // <- ska bli botten på vår div
479
+ div_actions_for_post_type.offset( new_offset );
480
+ div_actions_for_post_type.addClass("cms_tpv_page_actions_visible_from_bottom");
481
+
482
+ } else {
483
+ div_actions_for_post_type.removeClass("cms_tpv_page_actions_visible_from_bottom");
484
+ }
485
 
486
  // check if user is allowed to edit page
487
  var $cms_tpv_action_add_and_edit_page = div_actions_for_post_type.find(".cms_tpv_action_add_and_edit_page");
488
+ if ($li.data("user_can_edit_page") === "0") {
489
  // nooope
490
  $edit.hide();
491
  $cms_tpv_action_add_and_edit_page.hide();
492
  } else {
493
+ //$edit.show();
494
  $cms_tpv_action_add_and_edit_page.show();
495
+ div_actions_for_post_type.addClass("cms_tpv_page_actions_visible");
496
  }
497
 
498
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
499
  }
500
  }
501
 
502
  }
503
 
504
+ /**
505
+ * When mouse leaves the whole cms tree page view-area/div
506
+ * hide actions div after moving mouse out of a page and not moving it on again for...a while
507
+ */
508
+ jQuery(document).on("mouseleave", "div.cms_tpv_container", function(e) {
 
 
 
 
 
 
 
509
 
510
+ cms_tree_page_view.log("mouseleave container");
 
 
511
 
512
+ var $container = jQuery(e.target).closest("div.cms_tpv_container");
513
+ var $wrapper = $container.closest("div.cms_tpv_wrapper");
514
+ var t = this;
515
+
516
+ // Reset global timer
517
+ var global_timer = $container.data("cmstpv_global_link_timer");
518
+ if (global_timer) {
519
+ cms_tree_page_view.log("clear global timer");
520
+ clearTimeout(global_timer);
 
 
 
 
 
521
  }
522
 
523
+ // Don't hide if in add-pages-mode
524
+ var actions_div_doit = cms_tpv_get_page_actions_div_doit(this);
525
+ if ( actions_div_doit.is(":visible") )
526
+ return;
527
+
528
+ // Maybe hide popup after a short while
529
+ var hideTimer = setTimeout(function() {
530
+
531
+ cms_tree_page_view.log("maybe hide popup because outside container");
532
+
533
+ // But don't hide if we are inside the popup
534
+ var $relatedTarget = jQuery(e.relatedTarget);
535
+ if ($relatedTarget.hasClass("cms_tpv_page_actions")) {
536
+ // we are over the actions div, so don't hide
537
+ cms_tree_page_view.log("cancel hide beacuse over actions div");
538
+ } else {
539
+ // somewhere else, do hide
540
+ cms_tree_page_view.log("do hide");
541
+ $container.find("li.has-visible-actions").removeClass("has-visible-actions");
542
+ $container.find("a.hover").removeClass("hover");
543
+ $wrapper.find("div.cms_tpv_page_actions").removeClass("cms_tpv_page_actions_visible");
544
+ }
545
+
546
+ }, 500);
547
+
548
+ $container.data("cmstpv_global_link_timer", hideTimer);
549
 
 
 
 
 
550
  });
551
+
552
+ // When mouse enters actions div then cancel possibly global hide timer
553
+ // If moved outside container and then back, cancel possibly global timer
554
+ jQuery(document).on("mouseenter", "div.cms_tpv_page_actions", function(e) {
555
+
556
+ var $this = jQuery(this);
557
+ var $wrapper = $this.closest("div.cms_tpv_wrapper");
558
+ var $container = $wrapper.find("div.cms_tpv_container");
559
+ var timer = $container.data("cmstpv_global_link_timer");
560
+
561
+ clearTimeout(timer);
562
+
563
  });
564
 
565
 
566
+ // When mouse enter the whole cms tree page view-area/div
567
+ jQuery(document).on("mouseenter", "div.cms_tpv_container", function(e) {
568
+
569
+ var $container = jQuery(this);
570
+ jQuery.data(this, "cmstpv_do_hide_after_timeout", false);
571
+
572
+ });
573
+
574
 
575
  /**
576
  * add childcount and other things to each li
608
  data.r - the drop target
609
  */
610
 
611
+ var node_id,
612
+ ref_node_id;
613
  if (nodePosition == "before") {
614
+ node_id = jQuery( nodeBeingMoved ).attr( "id" );
615
  ref_node_id = jQuery( nodeRef ).attr( "id" );
616
  } else if (nodePosition == "after") {
617
+ node_id = jQuery( nodeBeingMoved ).attr( "id" );
618
  ref_node_id = jQuery( nodeR ).attr( "id" );
619
  } else if (nodePosition == "inside") {
620
+ node_id = jQuery( nodeBeingMoved ).attr( "id" );
621
  ref_node_id = jQuery( nodeR ).attr( "id" );
622
  }
623
 
624
  // Update parent or menu order
625
  jQuery.post(ajaxurl, {
626
+ action: "cms_tpv_move_page",
627
+ "node_id": node_id,
628
+ "ref_node_id": ref_node_id,
629
  "type": nodePosition,
630
  "icl_post_language": selected_lang
631
  }, function(data, textStatus) {
637
  var obj = (data.rslt.obj);
638
  if (obj && obj != -1) {
639
  obj.each(function(i, elm) {
640
+
641
  var li = jQuery(elm);
642
  var aFirst = li.find("a:first");
643
 
647
  } else {
648
  li.data("done_cms_tpv_clean_node", true);
649
  }
650
+
651
+ var childCount = li.data("childCount");
652
+ if (childCount > 0) {
653
+ aFirst.append("<span title='" + childCount + " " + cmstpv_l10n.child_pages + "' class='child_count'>("+childCount+")</span>");
654
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
655
 
656
+ // add protection type
657
+ var rel = li.data("rel");
658
+ if(rel == "password") {
659
+ aFirst.find("ins").after("<span class='post_protected' title='" + cmstpv_l10n.Password_protected_page + "'>&nbsp;</span>");
660
+ }
661
+
662
+ // add page type
663
+ var post_status = li.data("post_status");
664
+ // post_status can be any value because of plugins like Edit flow
665
+ // check if we have an existing translation for the string, otherwise use the post status directly
666
+ var post_status_to_show = "";
667
+ if (post_status_to_show = cmstpv_l10n["Status_"+post_status + "_ucase"]) {
668
+ // it's ok
669
+ } else {
670
+ post_status_to_show = post_status;
671
+ }
672
+ if (post_status != "publish") {
673
+ aFirst.find("ins").first().after("<span class='post_type post_type_"+post_status+"'>" + post_status_to_show + "</span>");
674
+ }
675
+
676
+ // To make hoverindent work we must wrap something around the a bla bla bla
677
+ //var div_wrap = jQuery("<div class='cmstpv-hoverIntent-wrap' />");
678
+ //aFirst.wrap(div_wrap);
679
+
680
  });
681
  }
682
  });
683
  }
684
 
685
+ // Perform search when submiting form
686
+ jQuery(document).on("submit", "form.cms_tree_view_search_form", function(e) {
687
+
688
  var $wrapper = jQuery(this).closest(".cms_tpv_wrapper");
689
  $wrapper.find(".cms_tpv_search_no_hits").hide();
690
  var s = $wrapper.find(".cms_tree_view_search").attr("value");
691
  s = jQuery.trim( s );
692
+
693
  if (s) {
694
  $wrapper.find(".cms_tree_view_search_form_no_hits").fadeOut("fast");
695
  $wrapper.find(".cms_tree_view_search_form_working").fadeIn("fast");
696
+ $wrapper.find(".cms_tree_view_search_form_reset");
697
  $wrapper.find(".cms_tpv_container").jstree("search", s);
698
  $wrapper.find(".cms_tree_view_search_form_reset").fadeIn("fast");
699
  } else {
702
  $wrapper.find(".cms_tree_view_search_form_reset").fadeOut("fast");
703
  }
704
  $wrapper.find(".cms_tree_view_search_form_working").fadeOut("fast");
705
+
706
  return false;
707
+
708
  });
709
 
710
+ // Reset search when click on x-link
711
+ jQuery(document).on("click", "a.cms_tree_view_search_form_reset", function(e) {
712
  var $wrapper = jQuery(this).closest(".cms_tpv_wrapper");
713
+ $wrapper.find(".cms_tree_view_search").val("");
714
  $wrapper.find(".cms_tpv_container").jstree("clear_search");
715
  $wrapper.find(".cms_tree_view_search_form_reset").fadeOut("fast");
716
  $wrapper.find(".cms_tree_view_search_form_no_hits").fadeOut("fast");
718
  });
719
 
720
  // open/close links
721
+ jQuery(document).on("click", "a.cms_tpv_open_all", function(e) {
722
  var $wrapper = jQuery(this).closest(".cms_tpv_wrapper");
723
  $wrapper.find(".cms_tpv_container").jstree("open_all");
724
  return false;
725
  });
726
+
727
+ jQuery(document).on("click", "a.cms_tpv_close_all", function(e) {
728
  var $wrapper = jQuery(this).closest(".cms_tpv_wrapper");
729
  $wrapper.find(".cms_tpv_container").jstree("close_all");
730
  return false;
731
  });
732
 
733
  // view all or public or trash
734
+ jQuery(document).on("click", "a.cms_tvp_view_all", function(e) {
735
  cms_tvp_set_view("all", this);
736
  return false;
737
  });
738
+
739
+ jQuery(document).on("click", "a.cms_tvp_view_public", function(e) {
740
  cms_tvp_set_view("public", this);
741
  return false;
742
  });
743
+
744
+ jQuery(document).on("click", "a.cms_tvp_view_trash", function() {
745
  cms_tvp_set_view("trash", this);
746
  return false;
747
  });
748
 
749
 
750
+ // click on link to change WPML-language
751
+ jQuery(document).on("click", "a.cms_tvp_switch_lang", function(e) {
752
+
753
  $wrapper = cms_tpv_get_wrapper(this);
754
+
755
+ // Mark clicked link as selected
756
  $wrapper.find("ul.cms_tvp_switch_langs a").removeClass("current");
757
  jQuery(this).addClass("current");
758
 
759
+ // Determine selected language, based on classes on the link
760
  var re = /cms_tpv_switch_language_code_([\w-]+)/;
761
  var matches = re.exec( jQuery(this).attr("class") );
762
  var lang_code = matches[1];
763
+
764
+ // Add seleted lang to hidden input
765
  $wrapper.find("[name=cms_tpv_meta_wpml_language]").val(lang_code);
766
 
767
+ // Update post count
768
+ // Post counts are stored on the links for all | public | trash
769
+ var $ul_select_view = $wrapper.find(".cms-tpv-subsubsub-select-view");
770
+ $ul_select_view.find("li.cms_tvp_view_is_status_view a").each(function(i, a_tag) {
771
+
772
+ // check if this link has a data attr with count for the selected lang
773
+ var $a = jQuery(a_tag);
774
+ var link_count = $a.data("post-count-" + lang_code);
775
+ if ("undefined" === typeof(link_count)) link_count = 0;
776
+
777
+ $a.find(".count").text("(" + link_count + ")");
778
+
779
+ });
780
+
781
+ // Set the view = reload the tree
782
  var current_view = cms_tpv_get_current_view(this);
783
  cms_tvp_set_view(current_view, this);
784
 
786
 
787
  });
788
 
789
+ function cms_tpv_hide_action_div() {
790
+
791
+ }
792
+
793
+
794
  function cms_tpv_get_current_view(elm) {
795
+
796
  $wrapper = cms_tpv_get_wrapper(elm);
797
+
798
  if ($wrapper.find(".cms_tvp_view_all").hasClass("current")) {
799
  return "all";
800
  } else if ($wrapper.find(".cms_tvp_view_public").hasClass("current")) {
801
  return "public";
802
  } else {
803
+ return false; // like unknown
804
  }
805
 
806
  }
807
 
808
+ /**
809
+ * Sets the view; load pages for the current lang + post type + status
810
+ * @param view all | public | trash
811
+ * @elm element
812
+ */
813
  function cms_tvp_set_view(view, elm) {
814
 
815
+ var $wrapper = jQuery(elm).closest(".cms_tpv_wrapper"),
816
+ div_actions_for_post_type = cms_tpv_get_page_actions_div(elm);
817
 
818
+ cms_tpv_message.hide();
 
819
 
820
+ $wrapper.append(div_actions_for_post_type);
821
  $wrapper.find(".cms_tvp_view_all, .cms_tvp_view_public, .cms_tvp_view_trash").removeClass("current");
822
  $wrapper.find(".cms_tpv_container").jstree("destroy").html("");
823
+ $wrapper.find("div.cms_tpv_page_actions").removeClass("cms_tpv_page_actions_visible");
824
+
825
  cms_tpv_bind_clean_node();
826
 
827
+ // Mark selected link
828
  if (view == "all") {
829
  $wrapper.find(".cms_tvp_view_all").addClass("current");
830
  } else if (view == "public") {
835
 
836
  }
837
 
838
+ // Reload tree
839
  var treeOptionsTmp = jQuery.extend(true, {}, treeOptions);
840
  treeOptionsTmp.json_data.ajax.url = ajaxurl + CMS_TPV_AJAXURL + view + "&post_type=" + cms_tpv_get_post_type(elm) + "&lang=" + cms_tpv_get_wpml_selected_lang(elm);
841
+
842
+ $wrapper.find(".cms_tpv_container").bind("loaded.jstree open_node.jstree", cms_tpv_tree_loaded);
843
  $wrapper.find(".cms_tpv_container").jstree(treeOptionsTmp);
844
+
845
  }
846
+
847
+
848
+
849
+ /**
850
+ * Stuff for the posts overview setting
851
+ */
852
+ jQuery(function($) {
853
+
854
+ // Move tree link into position
855
+ var tree_view_switch = $("#view-switch-tree"),
856
+ tree_view_switch_a = tree_view_switch.closest("a"),
857
+ cmstpv_postsoverview_wrap = $("div.cmstpv-postsoverview-wrap");
858
+
859
+ // Check if view-switch exists and add it if it does not
860
+ // It must exist because that's where we have our switch to tree-icon
861
+ var view_switch = $("div.view-switch");
862
+ if (! view_switch.length) {
863
+
864
+ view_switch = $("<div class='view-switch'></div>");
865
+ $("div.tablenav-pages:first").after(view_switch);
866
+
867
+ var view_switch_list = $("#view-switch-list"),
868
+ view_switch_list_a = view_switch_list.closest("a");
869
+
870
+ view_switch.append(view_switch_list_a);
871
+
872
+ }
873
+
874
+ // Add our link inside view switch
875
+ view_switch.append(tree_view_switch_a);
876
+ view_switch.addClass("view-switch-cstpv-icon-added");
877
+
878
+ // if in tree mode: add a class to wpbody so we can style things
879
+ if (cmstpv_postsoverview_wrap.length) {
880
+
881
+ $wp_body = $("#wpbody");
882
+ $wp_body.addClass("cmstpv_postsoverview_enabled");
883
+
884
+ // Move wordpress table with view etc above cms tree page view so the icons get the correct position
885
+ var viewswitch = $("div.view-switch");
886
+ viewswitch.appendTo(cmstpv_postsoverview_wrap);
887
+
888
+ }
889
+
890
+ });
scripts/jquery.hoverIntent.minified.js DELETED
@@ -1,9 +0,0 @@
1
- /**
2
- * hoverIntent r5 // 2007.03.27 // jQuery 1.1.2+
3
- * <http://cherne.net/brian/resources/jquery.hoverIntent.html>
4
- *
5
- * @param f onMouseOver function || An object with configuration options
6
- * @param g onMouseOut function || Nothing (use configuration options object)
7
- * @author Brian Cherne <brian@cherne.net>
8
- */
9
- (function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY;};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev]);}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev]);};var handleHover=function(e){var p=(e.type=="mouseover"?e.fromElement:e.toElement)||e.relatedTarget;while(p&&p!=this){try{p=p.parentNode;}catch(e){p=this;}}if(p==this){return false;}var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);}if(e.type=="mouseover"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob);},cfg.timeout);}}};return this.mouseover(handleHover).mouseout(handleHover);};})(jQuery);
 
 
 
 
 
 
 
 
 
scripts/jquery.jstree.js CHANGED
@@ -66,6 +66,7 @@
66
  tmp.setAttribute('type',"text/css");
67
  if(opts.title) { tmp.setAttribute("id", opts.title + "-stylesheet"); }
68
  }
 
69
  if(tmp.styleSheet) {
70
  if(is_new) {
71
  document.getElementsByTagName("head")[0].appendChild(tmp);
@@ -234,6 +235,7 @@
234
  rslt = func.apply(
235
  $.extend({}, this, {
236
  __callback : function (data) {
 
237
  this.get_container().triggerHandler( i + '.jstree', { "inst" : this, "args" : args, "rslt" : data, "rlbk" : rlbk });
238
  },
239
  __rollback : function () {
@@ -267,6 +269,7 @@
267
 
268
  // load the css when DOM is ready
269
  $(function() {
 
270
  // code is copied from jQuery ($.browser is deprecated + there is a bug in IE)
271
  var u = navigator.userAgent.toLowerCase(),
272
  v = (u.match( /.+?(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1],
66
  tmp.setAttribute('type',"text/css");
67
  if(opts.title) { tmp.setAttribute("id", opts.title + "-stylesheet"); }
68
  }
69
+
70
  if(tmp.styleSheet) {
71
  if(is_new) {
72
  document.getElementsByTagName("head")[0].appendChild(tmp);
235
  rslt = func.apply(
236
  $.extend({}, this, {
237
  __callback : function (data) {
238
+ //console.log(i);
239
  this.get_container().triggerHandler( i + '.jstree', { "inst" : this, "args" : args, "rslt" : data, "rlbk" : rlbk });
240
  },
241
  __rollback : function () {
269
 
270
  // load the css when DOM is ready
271
  $(function() {
272
+
273
  // code is copied from jQuery ($.browser is deprecated + there is a bug in IE)
274
  var u = navigator.userAgent.toLowerCase(),
275
  v = (u.match( /.+?(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1],
scripts/themes/wordpress/style.css CHANGED
@@ -78,14 +78,18 @@
78
  padding-bottom: 2px;*/
79
  position: relative;
80
  }
81
- .jstree li.jstree-closed,
82
  .jstree li.jstree-open
83
  {
84
- /* padding-top: 4px;
85
- padding-bottom: 4px; */
86
- }
87
- .jstree li.hover a,
88
  .jstree li a.hover
89
  {
90
  background-color: #e7f4f9;
91
  }
 
 
 
 
 
78
  padding-bottom: 2px;*/
79
  position: relative;
80
  }
81
+ /*.jstree li.jstree-closed,
82
  .jstree li.jstree-open
83
  {
84
+ }*/
85
+
86
+ /*.jstree li.hover a,
 
87
  .jstree li a.hover
88
  {
89
  background-color: #e7f4f9;
90
  }
91
+ */
92
+
93
+ .jstree li a:hover {
94
+ background-color: #e7f4f9;
95
+ }
styles/images/arrow-top.gif ADDED
Binary file
styles/images/switch-view-icons.png ADDED
Binary file
styles/images/switch-view-icons.psd ADDED
Binary file
styles/styles.css CHANGED
@@ -5,6 +5,8 @@
5
  }
6
  */
7
 
 
 
8
 
9
  .cms_tpv_wrapper {
10
  z-index: 10;
@@ -19,6 +21,7 @@
19
  /* clear: both; */
20
  overflow: visible;
21
  margin-top: 1.5em;
 
22
  }
23
 
24
  #wpbody-content .cms_tpv_container {
@@ -33,16 +36,41 @@
33
  clear: both;
34
  }
35
 
 
 
 
 
 
 
 
 
 
 
36
  .cms-tpv-subsubsub li {
37
- display: inline;
 
 
 
 
 
 
 
 
 
 
 
38
  }
39
 
40
  .cms-tpv-subsubsub li a.current {
41
  font-weight: bold;
42
- text-decoration: none;
43
  color: black;
44
  }
45
 
 
 
 
 
 
46
  .pages_page_cms-tpv-pages-page .cms-tpv-subsubsub li {
47
  zoom: 1; /* weird ie-problems otherwise, like li-items that disappear on search. */
48
  }
@@ -51,29 +79,6 @@
51
  clear: both;
52
  }
53
 
54
- /*
55
- span.cms_tpv_action_edit,
56
- li span.cms_tpv_action_view,
57
- li span.cms_tpv_action_add_page_after,
58
- li span.cms_tpv_action_add_page_inside
59
- {
60
- display: none;
61
- text-decoration: underline;
62
- border: 0;
63
- -moz-border-radius: 0;
64
- -webkit-border-radius: 0;
65
- border-radius: 0;
66
- padding: 0 0 0 .5ex;
67
-
68
- }
69
- li span.cms_tpv_action_add_page {
70
- display: none;
71
- border: 0;
72
- padding: 0 0 0 .5em;
73
- color: #666;
74
- }
75
- */
76
-
77
  .cms-tree-view-search
78
  {
79
  background-color: #ffefba;
@@ -99,7 +104,7 @@ li span.cms_tpv_action_add_page {
99
  background-color: transparent;
100
  color: #999;
101
  border: none;
102
- font-size: .8em;
103
  margin-left: .5em;
104
  }
105
 
@@ -113,11 +118,11 @@ li span.cms_tpv_action_add_page {
113
 
114
 
115
  .tree-default span.post_type {
116
- background-color: #f85b11;
117
- -moz-border-radius: 3px;
118
- -webkit-border-radius: 3px;
119
- border-radius: 3px;
120
- padding: 1px 4px 1px 4px;
121
  color: white;
122
  border: none;
123
  font-size: .8em;
@@ -127,16 +132,14 @@ li span.cms_tpv_action_add_page {
127
  .tree-default span.post_type_draft {
128
 
129
  }
130
- .tree-default span.post_type_password {
131
- background-color: #25b61a;
132
- }
133
  .tree-default span.post_type_private {
134
- background-color: #25b61a;
135
  }
136
  .tree-default span.post_type_pending,
137
  .tree-default span.post_type_future
138
  {
139
- background-color: #0069e0;
140
  }
141
 
142
 
@@ -174,6 +177,8 @@ li span.cms_tpv_action_add_page {
174
 
175
  .cms_tree_view_search {
176
  width: 130px;
 
 
177
  }
178
  .cms_tree_view_search_form_working,
179
  .cms_tree_view_search_form_no_hits
@@ -210,54 +215,105 @@ li span.cms_tpv_action_add_page {
210
  background: transparent url(https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.3/themes/ui-lightness/images/ui-icons_222222_256x240.png) no-repeat -32px -194px;
211
  }
212
 
213
- .cms_tpv_annoying_little_box {
214
- padding: 1em;
215
- background-color: #FFFBCC;
216
- border: 1px solid #E6DB55;
217
- margin: 1em 0 1em 0;
218
- -moz-border-radius: 6px;
219
- -webkit-border-radius: 6px;
220
- border-radius: 6px;
221
- }
222
- .cms_tpv_annoying_little_box p {
223
- margin: 0 0 .5em 0;
224
- }
225
- p.cms_tpv_annoying_little_box_close {
226
- float: right;
227
- margin-left: 2em;
228
- font-size: .8em;
229
- margin-top: -1em;
230
- margin-right: -.5em;
231
- }
232
 
233
  .cms_tpv_page_actions {
 
234
  width: auto;
235
- min-width: 125px;
236
  height: auto;
237
  background-color: white;
238
  position: absolute;
239
  top: 0;
240
  white-space: normal;
241
  z-index: 100;
242
- padding: 7px;
243
- display: none;
244
- -moz-box-shadow: 2px 2px 8px #ddd; /* FF3.5+ */
245
- border: 1px solid #bbb;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
246
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
247
  .cms_tpv_page_actions p {
248
- margin: 0 0 .5em 0;
 
 
 
 
 
 
249
  }
250
  .cms_tpv_wrapper .cms_tpv_page_actions a {
251
  display: inline;
252
  background: transparent;
253
  text-decoration: underline;
254
- padding: 0;
255
  color: #21759B;
 
 
 
 
 
 
 
256
  }
257
 
258
  .cms_tpv_wrapper .cms_tpv_page_actions a:hover
259
  {
260
  color: #d54e21;
 
261
  }
262
 
263
  .cms_tpv_page_actions ul {
@@ -276,24 +332,21 @@ p.cms_tpv_annoying_little_box_close {
276
  }
277
  .cms_tpv_page_actions dl {
278
  margin-top: 1em;
 
279
  color: #333;
280
  font-size: 11px;
 
281
  }
282
  .cms_tpv_page_actions dl dd {
283
  margin: 0;
284
  }
285
  .cms_tpv_page_actions dl dt {
286
  color: #999;
 
287
  }
288
 
289
  .cms_tpv_page_actions_arrow {
290
- width: 8px;
291
- height: 15px;
292
- background: url(images/arrow-left.gif) no-repeat top left;
293
- position: absolute;
294
- display: block;
295
- top: 7px;
296
- left: -8px;
297
  }
298
 
299
  .cms_tpv_page_actions_columns table td {
@@ -305,16 +358,20 @@ p.cms_tpv_annoying_little_box_close {
305
  padding-right: 2px;
306
  vertical-align: middle;
307
  }
308
- .cms_tpv_page_actions_columns .post-com-count-wrapper {
309
- }
310
- .cms_tpv_wrapper .cms_tpv_page_actions_columns a.post-com-count {
311
- }
312
 
313
  li.cms_tpv_user_can_edit_page_no a {
314
  opacity: .6; /* Standard: FF gt 1.5, Opera, Safari */
315
  -ms-filter: "alpha(opacity=60)"; /* IE 8 */
316
  }
317
 
 
 
 
 
 
 
 
 
318
  .bonny-plugins-inner-sidebar {
319
  float: right;
320
  width: 210px;
@@ -322,3 +379,143 @@ li.cms_tpv_user_can_edit_page_no a {
322
  padding-left: 10px;
323
  border-left: 1px solid #E3E3E3;
324
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  }
6
  */
7
 
8
+ @import url("http://s0.wordpress.com/i/noticons/noticons.css");
9
+
10
 
11
  .cms_tpv_wrapper {
12
  z-index: 10;
21
  /* clear: both; */
22
  overflow: visible;
23
  margin-top: 1.5em;
24
+ font-size: 13px;
25
  }
26
 
27
  #wpbody-content .cms_tpv_container {
36
  clear: both;
37
  }
38
 
39
+ .cms-tpv-subsubsub {
40
+ margin-top: 8px;
41
+ color: #666;
42
+ margin-bottom: 0;
43
+ }
44
+
45
+ .cms_tvp_switch_langs + .cms-tpv-subsubsub {
46
+ margin-top: 0;
47
+ }
48
+
49
  .cms-tpv-subsubsub li {
50
+ display: inline-block;
51
+ /*margin-left: 2px;*/
52
+ }
53
+
54
+ .cms-tpv-subsubsub li:first-child {
55
+ margin-left: 0;
56
+ }
57
+
58
+ .cms-tpv-subsubsub li a {
59
+ text-decoration: none;
60
+ line-height: 2;
61
+ padding: .2em;
62
  }
63
 
64
  .cms-tpv-subsubsub li a.current {
65
  font-weight: bold;
 
66
  color: black;
67
  }
68
 
69
+ .cms-tpv-subsubsub li a .count {
70
+ font-weight: normal;
71
+ color: #999;
72
+ }
73
+
74
  .pages_page_cms-tpv-pages-page .cms-tpv-subsubsub li {
75
  zoom: 1; /* weird ie-problems otherwise, like li-items that disappear on search. */
76
  }
79
  clear: both;
80
  }
81
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82
  .cms-tree-view-search
83
  {
84
  background-color: #ffefba;
104
  background-color: transparent;
105
  color: #999;
106
  border: none;
107
+ font-size: .9em;
108
  margin-left: .5em;
109
  }
110
 
118
 
119
 
120
  .tree-default span.post_type {
121
+ background-color: rgba(248, 98, 16, .75);
122
+ -moz-border-radius: 2px;
123
+ -webkit-border-radius: 2px;
124
+ border-radius: 2px;
125
+ padding: 1px 4px 2px 4px;
126
  color: white;
127
  border: none;
128
  font-size: .8em;
132
  .tree-default span.post_type_draft {
133
 
134
  }
135
+ .tree-default span.post_type_password,
 
 
136
  .tree-default span.post_type_private {
137
+ background-color: rgba(37, 182, 26, .75);
138
  }
139
  .tree-default span.post_type_pending,
140
  .tree-default span.post_type_future
141
  {
142
+ background-color: rgba(0, 105, 224, .75);
143
  }
144
 
145
 
177
 
178
  .cms_tree_view_search {
179
  width: 130px;
180
+ height: 21px;
181
+ line-height: 20px;
182
  }
183
  .cms_tree_view_search_form_working,
184
  .cms_tree_view_search_form_no_hits
215
  background: transparent url(https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.3/themes/ui-lightness/images/ui-icons_222222_256x240.png) no-repeat -32px -194px;
216
  }
217
 
218
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
219
 
220
  .cms_tpv_page_actions {
221
+ /*transition: all .25s ease-in-out; -webkit-transition: all .25s ease-in-out; -moz-transition: all .25s ease-in-out; -o-transition: all .25s ease-in-out; -ms-transition: all .25s ease-in-out;*/
222
  width: auto;
223
+ width: 200px;
224
  height: auto;
225
  background-color: white;
226
  position: absolute;
227
  top: 0;
228
  white-space: normal;
229
  z-index: 100;
230
+ padding: 10px 10px 0 10px;
231
+ visibility: hidden;
232
+ /*
233
+ jetpack style:
234
+ -moz-box-shadow: 0 4px 8px rgba(0,0,0,0.1);
235
+ -webkit-box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
236
+ box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);*/
237
+ /* admin bar style */
238
+ -moz-box-shadow: 0 4px 4px rgba(0, 0, 0, 0.2);
239
+ -webkit-box-shadow: 0 4px 4px rgba(0, 0, 0, 0.2);
240
+ box-shadow: 0 4px 4px rgba(0, 0, 0, 0.2);
241
+ border: 1px solid #DFDFDF;
242
+ opacity: 0;
243
+ font-family: sans-serif !important;
244
+ }
245
+
246
+ .cms_tpv_page_actions:before {
247
+ color: white;
248
+ position: absolute;
249
+ left: -16px;
250
+ top: 32px;
251
+ content: '\25C0'; /* left arrow */
252
+ display: inline-block;
253
+ -webkit-font-smoothing: antialiased;
254
+ font: normal 16px/1 'Noticons';
255
+ vertical-align: top;
256
+ text-shadow: 0px 1px 6px rgba(0, 0, 0, 0.2), -1px 0px 0 #DFDFDF;
257
+ overflow: hidden;
258
+ }
259
+
260
+ .cms_tpv_page_actions_visible_from_bottom:before {
261
+ top: auto;
262
+ bottom: 10px;
263
+ }
264
+
265
+ .cms_tpv_page_actions.cms_tpv_page_actions_visible {
266
+ /*display: block;*/
267
+ visibility: visible;
268
+ opacity: 1;
269
+ }
270
+
271
+
272
+ /*
273
+ div.cms_tpv_container.has-visible-actions li {
274
+ opacity: .5
275
  }
276
+
277
+ div.cms_tpv_container.has-visible-actions li.has-visible-actions {
278
+ opacity: 1;
279
+ }
280
+ */
281
+ li.has-visible-actions > a:first-of-type {
282
+ /*font-weight: bold;*/
283
+ background-color: #d8f5fa;
284
+ }
285
+
286
+ .jstree a > ins {
287
+
288
+ }
289
+
290
  .cms_tpv_page_actions p {
291
+ margin: .5em 0 .5em 0;
292
+ line-height: 1.2;
293
+ }
294
+ p.cms_tpv_action_add_and_edit_page,
295
+ p.cms_tpv_action_edit_and_view
296
+ {
297
+ margin-top: 0em;
298
  }
299
  .cms_tpv_wrapper .cms_tpv_page_actions a {
300
  display: inline;
301
  background: transparent;
302
  text-decoration: underline;
 
303
  color: #21759B;
304
+ font-weight: normal;
305
+ padding: 0 .5em 0 0;
306
+ margin-right: .2em;
307
+ border-right: 1px solid #aaa;
308
+ }
309
+ .cms_tpv_wrapper .cms_tpv_page_actions a:last-child {
310
+ border: none;
311
  }
312
 
313
  .cms_tpv_wrapper .cms_tpv_page_actions a:hover
314
  {
315
  color: #d54e21;
316
+ background-color: transparent;
317
  }
318
 
319
  .cms_tpv_page_actions ul {
332
  }
333
  .cms_tpv_page_actions dl {
334
  margin-top: 1em;
335
+ margin-bottom: 1em;
336
  color: #333;
337
  font-size: 11px;
338
+ line-height: 1.2;
339
  }
340
  .cms_tpv_page_actions dl dd {
341
  margin: 0;
342
  }
343
  .cms_tpv_page_actions dl dt {
344
  color: #999;
345
+ margin: .5em 0 0 0;
346
  }
347
 
348
  .cms_tpv_page_actions_arrow {
349
+ display: none;
 
 
 
 
 
 
350
  }
351
 
352
  .cms_tpv_page_actions_columns table td {
358
  padding-right: 2px;
359
  vertical-align: middle;
360
  }
 
 
 
 
361
 
362
  li.cms_tpv_user_can_edit_page_no a {
363
  opacity: .6; /* Standard: FF gt 1.5, Opera, Safari */
364
  -ms-filter: "alpha(opacity=60)"; /* IE 8 */
365
  }
366
 
367
+ h4.cms_tpv_page_actions_headline {
368
+ margin: 0 0 0 0;
369
+ font-weight: bold !important;
370
+ font-family: sans-serif !important;
371
+ line-height: 1.1;
372
+ }
373
+
374
+
375
  .bonny-plugins-inner-sidebar {
376
  float: right;
377
  width: 210px;
379
  padding-left: 10px;
380
  border-left: 1px solid #E3E3E3;
381
  }
382
+
383
+ .cms_tpv_action_add_doit {
384
+ /*background-color: lightyellow;*/
385
+ display: none;
386
+ }
387
+
388
+ .cms_tpv_action_add_doit fieldset {
389
+ border: 1px solid #ddd;
390
+ border-left-width: 0;
391
+ border-right-width: 0;
392
+ padding: .75em .25em .75em 0;
393
+ }
394
+
395
+ .cms_tpv_action_add_doit h4,
396
+ .cms_tpv_action_add_doit legend {
397
+ margin: 0;
398
+ }
399
+
400
+ .cms_tpv_action_add_doit form > div {
401
+ margin-top: .75em;
402
+ }
403
+ .cms_tpv_action_add_doit form > div:first-of-type {
404
+ margin-top: 0;
405
+ }
406
+
407
+ .cms_tpv_action_add_doit label {
408
+ margin-right: .5em;
409
+ }
410
+
411
+ ul.cms_tpv_action_add_doit_pages .ui-state-highlight {
412
+ display: block;
413
+ }
414
+
415
+ ul.cms_tpv_action_add_doit_pages {
416
+ position: relative;
417
+ margin: 0 0 0 -10px;
418
+ padding: 0;
419
+ overflow: auto;
420
+ }
421
+ .cms_tpv_action_add_doit_pages li {
422
+ display: block;
423
+ position: relative;
424
+ float: left;
425
+ padding: 0 0 0 0;
426
+ margin: 1px 0 1px 0;
427
+ }
428
+ .cms_tpv_action_add_doit_pages input {
429
+ float: left;
430
+ width: 90%;
431
+ transition: all .25s ease-in-out; -webkit-transition: all .25s ease-in-out; -moz-transition: all .25s ease-in-out; -o-transition: all .25s ease-in-out; -ms-transition: all .25s ease-in-out;
432
+ }
433
+ .cms_tpv_action_add_doit_pages span:first-child {
434
+ background: transparent url(https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.3/themes/ui-darkness/images/ui-icons_222222_256x240.png) no-repeat -2px -228px;
435
+ margin-top: 7px;
436
+ margin-right: 3px;
437
+ float: left;
438
+ width: 8px;
439
+ height: 10px;
440
+ cursor: move;
441
+ }
442
+
443
+ .cms_tpv_action_add_doit_pages li:last-child span:first-child {
444
+ visibility: hidden;
445
+ }
446
+
447
+ /*
448
+ for posts overview enabled mode
449
+ */
450
+ .cmstpv-postsoverview-wrap {
451
+ position: relative;
452
+ }
453
+ .cmstpv-postsoverview-wrap .view-switch {
454
+ position: absolute;
455
+ visibility: visible;
456
+ top: 0;
457
+ right: 0;
458
+ }
459
+
460
+ .view-switch.view-switch-cstpv-icon-added {
461
+ padding-right: 0;
462
+ }
463
+
464
+ #view-switch-tree {
465
+ background: url(images/switch-view-icons.png) 0 0;
466
+ display: none;
467
+ }
468
+ .current #view-switch-tree {
469
+ background-position: -20px 0;
470
+ }
471
+
472
+ .cmstpv_add_list_view {
473
+ display: none;
474
+ }
475
+ .view-switch #view-switch-tree,
476
+ .view-switch .cmstpv_add_list_view {
477
+ display: inline;
478
+ }
479
+
480
+ /* options screen */
481
+ .cmtpv_options_form {
482
+ float: left;
483
+ }
484
+
485
+ .cms_tpv_annoying_little_box {
486
+ padding: 1.5em;
487
+ background-color: #FAFAFA;
488
+ border: 1px solid #ddd;
489
+ margin: 1em 0 1em 0;
490
+ float: right;
491
+ width: 22em;
492
+ }
493
+
494
+ .cms_tpv_annoying_little_box h3:first-of-type {
495
+ margin-top: 0;
496
+ }
497
+
498
+ .cms_tpv_annoying_little_box_author {
499
+ font-style: italic;
500
+ }
501
+
502
+ .cms_tpv_annoying_little_box p {
503
+ margin: 0 0 .5em 0;
504
+ }
505
+
506
+ p.cms_tpv_annoying_little_box_gravatar {
507
+ float: right;
508
+ margin: 0 0 1em 1em;
509
+ }
510
+
511
+ .cms_tpv_annoying_little_box ul {
512
+ list-style-type: disc;
513
+ margin-left: 20px;
514
+ }
515
+
516
+ p.cms_tpv_annoying_little_box_close {
517
+ text-align: right;
518
+ font-size: .8em;
519
+ margin-top: 1.5em;
520
+ margin-bottom: 0;
521
+ }