Content Aware Sidebars – Unlimited Widget Areas - Version 1.1.2

Version Description

  • Added: wordpress 3.5 compatibility
  • Fixed: slight css changes on edit screen
  • Fixed: "show with all" checkbox toggles other checkboxes correctly
Download this release

Release Info

Developer intoxstudio
Plugin Icon 128x128 Content Aware Sidebars – Unlimited Widget Areas
Version 1.1.2
Comparing to
See all releases

Code changes from version 1.0 to 1.1.2

content-aware-sidebars.php CHANGED
@@ -1,12 +1,13 @@
1
  <?php
2
  /**
3
  * @package Content Aware Sidebars
 
4
  */
5
  /*
6
  Plugin Name: Content Aware Sidebars
7
  Plugin URI: http://www.intox.dk/
8
  Description: Manage and show sidebars according to the content being viewed.
9
- Version: 1.0
10
  Author: Joachim Jensen
11
  Author URI: http://www.intox.dk/
12
  Text Domain: content-aware-sidebars
@@ -32,12 +33,14 @@ License: GPL2
32
 
33
  final class ContentAwareSidebars {
34
 
35
- const db_version = '0.8';
36
  const prefix = '_cas_';
37
 
38
  private $metadata = array();
39
  private $taxonomies = array();
40
- private $sidebar_cache = array();
 
 
41
 
42
  /**
43
  *
@@ -46,47 +49,44 @@ final class ContentAwareSidebars {
46
  */
47
  public function __construct() {
48
 
49
- register_activation_hook(__FILE__, array(&$this,'plugin_activation'));
50
- register_deactivation_hook(__FILE__, array(&$this,'plugin_deactivation'));
51
 
52
  $this->_load_dependencies();
53
 
54
  // WordPress Hooks. Somewhat ordered by execution
55
 
56
  // On sitewide requests
57
- add_action('plugins_loaded', array(&$this,'deploy_modules'));
58
- add_action('init', array(&$this,'init_sidebar_type'),99);
59
- add_action('widgets_init', array(&$this,'create_sidebars'));
60
 
61
  // On admin requests
62
- add_action('admin_menu', array(&$this,'clear_admin_menu'));
63
- add_action('admin_init', array(&$this,'prepare_admin_scripts_styles'));
64
- add_action('admin_print_scripts-edit.php', array(&$this,'load_admin_scripts'));
65
- add_action('admin_print_scripts-post-new.php', array(&$this,'load_admin_scripts'));
66
- add_action('admin_print_scripts-post.php', array(&$this,'load_admin_scripts'));
67
 
68
  // On post type and taxonomy requests
69
- add_action('delete_post', array(&$this,'remove_sidebar_widgets'));
70
- add_action('save_post', array(&$this,'save_post'));
71
 
72
  // Order not known yet
73
- add_action('add_meta_boxes_sidebar', array(&$this,'create_meta_boxes'));
74
 
75
- add_filter('default_hidden_meta_boxes', array(&$this,'change_default_hidden'),10,2);
76
- add_filter('manage_edit-sidebar_columns', array(&$this,'admin_column_headers'));
77
  add_filter('manage_edit-sidebar_sortable_columns', array(&$this,'admin_column_sortable_headers'));
78
- add_filter('manage_posts_custom_column', array(&$this,'admin_column_rows'),10,3);
79
- add_filter('post_row_actions', array(&$this,'sidebar_row_actions'),10,2);
80
- add_filter('post_updated_messages', array(&$this,'sidebar_updated_messages'));
81
 
82
 
83
  // Sitewide hooks that should not be loaded sitewide here
84
  if(is_admin()) {
85
- add_filter('request', array(&$this,'admin_column_orderby'));
86
 
87
- add_action('wp_loaded', array(&$this,'db_update'));
88
  } else {
89
- add_filter('wp', array(&$this,'replace_sidebar'));
90
  }
91
 
92
  }
@@ -103,18 +103,20 @@ final class ContentAwareSidebars {
103
  'static' => true,
104
  'post_type' => true,
105
  'author' => true,
106
- 'page_template' => true,
107
  'taxonomy' => true,
108
  'bbpress' => function_exists('bbp_get_version'), // bbPress
109
- 'qtranslate' => defined('QT_SUPPORTED_WP_VERSION'), // qTranslate
110
  'transposh' => defined('TRANSPOSH_PLUGIN_VER'), // Transposh Translation Filter
111
  'wpml' => defined('ICL_LANGUAGE_CODE') // WPML Multilingual Blog/CMS
112
  );
113
 
 
 
114
  // Fire!
115
  foreach($modules as $name => $enabled) {
116
  if($enabled)
117
- $this->_forge_module($name);
118
  }
119
 
120
  }
@@ -181,9 +183,6 @@ final class ContentAwareSidebars {
181
  )
182
  );
183
 
184
- // Get metadata from modules
185
- $this->metadata = apply_filters('cas_metadata',$this->metadata);
186
-
187
  }
188
 
189
  /**
@@ -193,8 +192,6 @@ final class ContentAwareSidebars {
193
  */
194
  public function init_sidebar_type() {
195
 
196
- load_plugin_textdomain('content-aware-sidebars', false, dirname( plugin_basename(__FILE__)).'/lang/');
197
-
198
  // List public taxonomies
199
  foreach(get_taxonomies(array('public'=>true),'names') as $tax) {
200
  $this->taxonomies[] = $tax;
@@ -203,25 +200,25 @@ final class ContentAwareSidebars {
203
  // Register the sidebar type
204
  register_post_type('sidebar',array(
205
  'labels' => array(
206
- 'name' => __('Sidebars', 'content-aware-sidebars'),
207
- 'singular_name' => __('Sidebar', 'content-aware-sidebars'),
208
- 'add_new' => _x('Add New', 'sidebar', 'content-aware-sidebars'),
209
- 'add_new_item' => __('Add New Sidebar', 'content-aware-sidebars'),
210
- 'edit_item' => __('Edit Sidebar', 'content-aware-sidebars'),
211
- 'new_item' => __('New Sidebar', 'content-aware-sidebars'),
212
- 'all_items' => __('All Sidebars', 'content-aware-sidebars'),
213
- 'view_item' => __('View Sidebar', 'content-aware-sidebars'),
214
- 'search_items' => __('Search Sidebars', 'content-aware-sidebars'),
215
- 'not_found' => __('No sidebars found', 'content-aware-sidebars'),
216
  'not_found_in_trash' => __('No sidebars found in Trash', 'content-aware-sidebars')
217
  ),
218
- 'show_ui' => true,
219
- 'query_var' => false,
220
- 'rewrite' => false,
221
- 'menu_position' => null,
222
- 'supports' => array('title','page-attributes','excerpt'),
223
- 'taxonomies' => $this->taxonomies,
224
- 'menu_icon' => WP_PLUGIN_URL.'/'.plugin_basename(dirname(__FILE__)).'/img/icon-16.png'
225
  ));
226
  }
227
 
@@ -276,14 +273,14 @@ final class ContentAwareSidebars {
276
  //WP3.1 does not support (array) as post_status
277
  $posts = get_posts(array(
278
  'numberposts' => -1,
279
- 'post_type' => 'sidebar',
280
  'post_status' => 'publish,private,future'
281
  ));
282
  foreach($posts as $post) {
283
  register_sidebar( array(
284
- 'name' => $post->post_title,
285
  'description' => $post->post_excerpt,
286
- 'id' => 'ca-sidebar-'.$post->ID,
287
  'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
288
  'after_widget' => '</li>',
289
  'before_title' => '<h3 class="widget-title">',
@@ -370,7 +367,7 @@ final class ContentAwareSidebars {
370
 
371
  if($column_name == 'handle' && $current < 2) {
372
  $host = get_post_meta($post_id,self::prefix.'host',true);
373
- $current_from_list .= ": ".(isset($this->metadata['host']['list'][$host]) ? $this->metadata['host']['list'][$host] : "HOST NOT FOUND");
374
  }
375
  echo $current_from_list;
376
  }
@@ -421,7 +418,7 @@ final class ContentAwareSidebars {
421
  *
422
  * @param array $actions
423
  * @param object $post
424
- * @return type
425
  */
426
  public function sidebar_row_actions($actions, $post) {
427
  if($post->post_type == 'sidebar' && $post->post_status != 'trash') {
@@ -500,6 +497,9 @@ final class ContentAwareSidebars {
500
  public function get_sidebars() {
501
  global $wpdb;
502
 
 
 
 
503
  // Return cache if present
504
  if(!empty($this->sidebar_cache)) {
505
  if($this->sidebar_cache[0] == false)
@@ -507,18 +507,19 @@ final class ContentAwareSidebars {
507
  else
508
  return $this->sidebar_cache;
509
  }
510
-
511
  $joins = array();
512
  $where = array();
513
  $where2 = array();
514
 
515
- // Run hooks for query
516
- do_action('cas_sidebar_db');
517
-
518
- // Apply hooks for db
519
- $joins = apply_filters('cas_sidebar_db_join', $joins, self::prefix);
520
- $where = apply_filters('cas_sidebar_db_where', $where);
521
- $where2 = apply_filters('cas_sidebar_db_where2', $where2);
 
522
 
523
  // Check if there are any rules for this type of content
524
  if(empty($where))
@@ -565,26 +566,32 @@ final class ContentAwareSidebars {
565
  // Add boxes
566
  // Author Words
567
  add_meta_box(
568
- 'ca-sidebar-dev-words',
569
  __('Words from the author', 'content-aware-sidebars'),
570
  array(&$this,'meta_box_author_words'),
571
  'sidebar',
572
  'side',
573
  'high'
574
  );
575
-
576
- // Add module boxes
577
- do_action('cas_admin_gui',$this);
578
 
579
- // Options
580
  add_meta_box(
581
- 'ca-sidebar',
582
- __('Options', 'content-aware-sidebars'),
583
- array(&$this,'meta_box_content'),
584
  'sidebar',
585
  'normal',
586
  'high'
587
  );
 
 
 
 
 
 
 
 
 
588
  }
589
 
590
 
@@ -609,7 +616,7 @@ final class ContentAwareSidebars {
609
 
610
  if ($condition && get_user_option( 'metaboxhidden_sidebar' ) === false) {
611
 
612
- $hidden_meta_boxes = array('postexcerpt','pageparentdiv','ca-sidebar-tax-post_format','ca-sidebar-post-type-attachment','ca-sidebar-authors');
613
  $hidden = array_merge($hidden,$hidden_meta_boxes);
614
 
615
  $user = wp_get_current_user();
@@ -619,47 +626,37 @@ final class ContentAwareSidebars {
619
  return $hidden;
620
  }
621
 
 
 
 
 
 
 
 
 
622
  /**
623
  *
624
  * Options content
625
  *
626
  */
627
- public function meta_box_content() {
628
 
629
  $columns = array(
630
- 'static',
631
  'exposure',
632
  'handle' => 'handle,host',
633
  'merge-pos'
634
  );
635
 
636
- //echo '<div id="cas_tabs">';
637
- //
638
- //echo '<ul>';
639
- //echo '<li class="nav-tab"><a href="#_cas_settings">Settings</a></li>';
640
- //echo '<li><a href="#_cas_test">Settings</a></li>';
641
- //echo '</ul>';
642
- //
643
- //echo '<div id="_cas_settings">';
644
- echo '<table class="form-table">';
645
  foreach($columns as $key => $value) {
646
 
647
- echo '<tr><th scope="row">'.$this->metadata[is_numeric($key) ? $value : $key]['name'].'</th>';
648
- echo '<td>';
649
  $values = explode(',',$value);
650
  foreach($values as $val) {
651
  $this->_form_field($val);
652
  }
653
- echo '</td></tr>';
654
  }
655
- echo '</table>';
656
- //echo '</div>';
657
- //
658
- //echo '<div id="_cas_test">';
659
- //echo 'hello';
660
- //echo '</div>';
661
- //
662
- //echo '</div>';
663
  }
664
 
665
  /**
@@ -690,137 +687,6 @@ final class ContentAwareSidebars {
690
  <?php
691
  }
692
 
693
- /**
694
- *
695
- * Taxonomy content
696
- *
697
- * @param object $post
698
- * @param array $box
699
- */
700
- public function meta_box_taxonomy($post, $box) {
701
- $meta = get_post_meta($post->ID, self::prefix.'taxonomies', true);
702
- $current = $meta != '' ? $meta : array();
703
-
704
- $taxonomy = $box['args'];
705
-
706
- $terms = get_terms($taxonomy->name, array('get' => 'all'));
707
-
708
- if (!$terms || is_wp_error($terms)) {
709
- echo '<p>'.__('No items.').'</p>';
710
- } else {
711
-
712
- ?>
713
- <div id="taxonomy-<?php echo $taxonomy->name; ?>" class="categorydiv">
714
- <ul id="<?php echo $taxonomy->name; ?>-tabs" class="category-tabs">
715
- <li class="hide-if-no-js"><a href="#<?php echo $taxonomy->name; ?>-pop" tabindex="3"><?php _e( 'Most Used' ); ?></a></li>
716
- <li class="tabs"><a href="#<?php echo $taxonomy->name; ?>-all" tabindex="3"><?php _e('View All'); ?></a></li>
717
- </ul>
718
-
719
- <div id="<?php echo $taxonomy->name; ?>-pop" class="tabs-panel" style="display: none;height:inherit;max-height:200px;">
720
- <ul id="<?php echo $taxonomy->name; ?>checklist-pop" class="categorychecklist form-no-clear" >
721
- <?php $popular_ids = cas_popular_terms_checklist($taxonomy); ?>
722
- </ul>
723
- </div>
724
-
725
- <div id="<?php echo $taxonomy->name; ?>-all" class="tabs-panel" style="height:inherit;max-height:200px;">
726
- <input type="hidden" name="<?php echo ($taxonomy->name == "category" ? "post_category[]" : "tax_input[$taxonomy->name]"); ?>" value="0" />
727
- <ul id="<?php echo $taxonomy->name; ?>checklist" class="list:<?php echo $taxonomy->name?> categorychecklist form-no-clear">
728
- <?php cas_terms_checklist($post->ID, array('taxonomy' => $taxonomy,'popular_terms' => $popular_ids, 'terms' => $terms)) ?>
729
- </ul>
730
- </div>
731
- </div>
732
- <?php
733
- }
734
-
735
- echo '<p style="padding:6px 0 4px;">'."\n";
736
- echo '<label><input type="checkbox" name="taxonomies[]" value="'.$taxonomy->name.'"'.(in_array($taxonomy->name,$current) ? ' checked="checked"' : '').' /> '.sprintf(__('Show with %s','content-aware-sidebars'),$taxonomy->labels->all_items).'</label>'."\n";
737
- echo '</p>'."\n";
738
-
739
- }
740
-
741
- /**
742
- *
743
- * Post Type content
744
- *
745
- * @param object $post
746
- * @param array $box
747
- */
748
- public function meta_box_post_type($post, $box) {
749
- $meta = get_post_meta($post->ID, self::prefix.'post_types', true);
750
- $current = $meta != '' ? $meta : array();
751
- $post_type = $box['args'];
752
-
753
- $exclude = array();
754
- if($post_type->name == 'page' && 'page' == get_option( 'show_on_front')) {
755
- $exclude[] = get_option('page_on_front');
756
- $exclude[] = get_option('page_for_posts');
757
- }
758
-
759
- //WP3.1 does not support (array) as post_status
760
- $posts = get_posts(array(
761
- 'numberposts' => -1,
762
- 'post_type' => $post_type->name,
763
- 'post_status' => 'publish,private,future',
764
- 'exclude' => $exclude
765
- ));
766
-
767
- if (!$posts || is_wp_error($posts)) {
768
- echo '<p>'.__('No items.').'</p>';
769
- } else {
770
-
771
- ?>
772
- <div id="posttype-<?php echo $post_type->name; ?>" class="categorydiv">
773
- <ul id="posttype-<?php echo $post_type->name; ?>-tabs" class="category-tabs">
774
- <li class="tabs"><a href="#<?php echo $post_type->name; ?>-all" tabindex="3"><?php _e('View All'); ?></a></li>
775
- </ul>
776
- <div id="<?php echo $post_type->name; ?>-all" class="tabs-panel" style="height:inherit;max-height:200px;">
777
- <ul id="<?php echo $post_type->name; ?>checklist" class="list:<?php echo $post_type->name?> categorychecklist form-no-clear">
778
- <?php cas_posts_checklist($post->ID, array('post_type' => $post_type,'posts'=>$posts)); ?>
779
- </ul>
780
- </div>
781
- </div>
782
- <?php
783
- }
784
-
785
- //WP3.1.4 does not support $post_type->labels->all_items
786
- echo '<p style="padding:6px 0 4px;">'."\n";
787
- echo '<label><input type="checkbox" name="post_types[]" value="'.$post_type->name.'"'.(in_array($post_type->name,$current) ? ' checked="checked"' : '').' /> '.sprintf(__('Show with All %s','content-aware-sidebars'),$post_type->label).'</label>'."\n";
788
- echo '</p>'."\n";
789
-
790
- }
791
-
792
- /**
793
- *
794
- * Various content
795
- *
796
- * @param object $post
797
- * @param array $box
798
- */
799
- public function meta_box_checkboxes($post, $box) {
800
- $field = $box['args'];
801
- $meta = get_post_meta($post->ID, self::prefix.$field, true);
802
- $current = $meta != '' ? $meta : array();
803
- ?>
804
- <div id="list-<?php echo $field; ?>" class="categorydiv">
805
- <ul id="<?php echo $field; ?>-tabs" class="category-tabs">
806
- <li class="tabs"><a href="#<?php echo $field; ?>-all" tabindex="3"><?php _e('View All'); ?></a></li>
807
- </ul>
808
- <div id="<?php echo $field; ?>-all" class="tabs-panel" style="height:inherit;max-height:200px;">
809
- <ul id="authorlistchecklist" class="list:<?php echo $field; ?> categorychecklist form-no-clear">
810
- <?php
811
- foreach($this->metadata[$field]['list'] as $id => $name) {
812
- echo '<li><label><input type="checkbox" name="'.$field.'[]" value="'.$id.'"'.(in_array($id,$current) ? ' checked="checked"' : '').' /> '.$name.'</label></li>'."\n";
813
- }
814
- ?>
815
- </ul>
816
- </div>
817
- </div>
818
- <p style="padding:6px 0 4px;">
819
- <label><input type="checkbox" name="<?php echo $field; ?>[]" value="<?php echo $field; ?>"<?php echo (in_array($field,$current) ? ' checked="checked"' : ''); ?> /> <?php printf(__('Show with All %s','content-aware-sidebars'),$this->metadata[$field]['name']); ?></label>
820
- </p>
821
- <?php
822
- }
823
-
824
  /**
825
  *
826
  * Create form field for metadata
@@ -836,7 +702,7 @@ final class ContentAwareSidebars {
836
  $current = $meta != '' ? $meta : $setting['val'];
837
  switch($setting['type']) {
838
  case 'select' :
839
- echo '<select style="width:200px;" name="'.$setting['id'].'">'."\n";
840
  foreach($setting['list'] as $key => $value) {
841
  echo '<option value="'.$key.'"'.($key == $current ? ' selected="selected"' : '').'>'.$value.'</option>'."\n";
842
  }
@@ -891,17 +757,39 @@ final class ContentAwareSidebars {
891
  $this->_init_metadata();
892
 
893
  // Update metadata
894
- foreach ($this->metadata as $field) {
895
- $old = get_post_meta($post_id, self::prefix.$field['id'], true);
896
- $new = isset($_POST[$field['id']]) ? $_POST[$field['id']] : '';
897
-
898
  if ($new != '' && $new != $old) {
899
  update_post_meta($post_id, self::prefix.$field['id'], $new);
900
-
901
  } elseif ($new == '' && $old != '') {
902
- delete_post_meta($post_id, self::prefix.$field['id'], $old);
903
  }
904
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
905
  }
906
 
907
  /**
@@ -919,23 +807,28 @@ final class ContentAwareSidebars {
919
  *
920
  * @global string $pagenow
921
  */
922
- public function load_admin_scripts() {
923
- global $pagenow;
924
- if($pagenow != 'edit.php') {
925
- //wp_enqueue_script('jquery-ui-tabs');
 
 
 
 
 
 
 
 
 
 
 
926
  wp_enqueue_script('cas_admin_script');
 
 
 
 
927
  }
928
- wp_enqueue_style('cas_admin_style');
929
- }
930
-
931
- /**
932
- *
933
- * Prepare scripts and styles for administration
934
- *
935
- */
936
- public function prepare_admin_scripts_styles() {
937
- wp_register_script('cas_admin_script', WP_PLUGIN_URL.'/'.plugin_basename(dirname(__FILE__)).'/js/cas_admin.js', array('jquery'), '0.1');
938
- wp_register_style('cas_admin_style', WP_PLUGIN_URL.'/'.plugin_basename(dirname(__FILE__)).'/css/style.css', false, '0.1');
939
  }
940
 
941
  /**
1
  <?php
2
  /**
3
  * @package Content Aware Sidebars
4
+ * @author Joachim Jensen <jv@intox.dk>
5
  */
6
  /*
7
  Plugin Name: Content Aware Sidebars
8
  Plugin URI: http://www.intox.dk/
9
  Description: Manage and show sidebars according to the content being viewed.
10
+ Version: 1.1.2
11
  Author: Joachim Jensen
12
  Author URI: http://www.intox.dk/
13
  Text Domain: content-aware-sidebars
33
 
34
  final class ContentAwareSidebars {
35
 
36
+ const db_version = 1.1;
37
  const prefix = '_cas_';
38
 
39
  private $metadata = array();
40
  private $taxonomies = array();
41
+ private $sidebar_cache = array();
42
+
43
+ private $modules = array();
44
 
45
  /**
46
  *
49
  */
50
  public function __construct() {
51
 
52
+ register_activation_hook(__FILE__, array(&$this,'plugin_activation'));
53
+ register_deactivation_hook(__FILE__, array(&$this,'plugin_deactivation'));
54
 
55
  $this->_load_dependencies();
56
 
57
  // WordPress Hooks. Somewhat ordered by execution
58
 
59
  // On sitewide requests
60
+ add_action('plugins_loaded', array(&$this,'deploy_modules'));
61
+ add_action('init', array(&$this,'init_sidebar_type'),99);
62
+ add_action('widgets_init', array(&$this,'create_sidebars'));
63
 
64
  // On admin requests
65
+ add_action('admin_menu', array(&$this,'clear_admin_menu'));
66
+ add_action('admin_enqueue_scripts', array(&$this,'load_admin_scripts'));
 
 
 
67
 
68
  // On post type and taxonomy requests
69
+ add_action('delete_post', array(&$this,'remove_sidebar_widgets'));
70
+ add_action('save_post', array(&$this,'save_post'));
71
 
72
  // Order not known yet
73
+ add_action('add_meta_boxes_sidebar', array(&$this,'create_meta_boxes'));
74
 
75
+ add_filter('default_hidden_meta_boxes', array(&$this,'change_default_hidden'),10,2);
76
+ add_filter('manage_edit-sidebar_columns', array(&$this,'admin_column_headers'));
77
  add_filter('manage_edit-sidebar_sortable_columns', array(&$this,'admin_column_sortable_headers'));
78
+ add_filter('manage_posts_custom_column', array(&$this,'admin_column_rows'),10,3);
79
+ add_filter('post_row_actions', array(&$this,'sidebar_row_actions'),10,2);
80
+ add_filter('post_updated_messages', array(&$this,'sidebar_updated_messages'));
81
 
82
 
83
  // Sitewide hooks that should not be loaded sitewide here
84
  if(is_admin()) {
85
+ add_filter('request', array(&$this,'admin_column_orderby'));
86
 
87
+ add_action('wp_loaded', array(&$this,'db_update'));
88
  } else {
89
+ add_filter('wp', array(&$this,'replace_sidebar'));
90
  }
91
 
92
  }
103
  'static' => true,
104
  'post_type' => true,
105
  'author' => true,
106
+ 'page_template' => true,
107
  'taxonomy' => true,
108
  'bbpress' => function_exists('bbp_get_version'), // bbPress
109
+ 'qtranslate' => defined('QT_SUPPORTED_WP_VERSION'), // qTranslate
110
  'transposh' => defined('TRANSPOSH_PLUGIN_VER'), // Transposh Translation Filter
111
  'wpml' => defined('ICL_LANGUAGE_CODE') // WPML Multilingual Blog/CMS
112
  );
113
 
114
+ load_plugin_textdomain('content-aware-sidebars', false, dirname( plugin_basename(__FILE__)).'/lang/');
115
+
116
  // Fire!
117
  foreach($modules as $name => $enabled) {
118
  if($enabled)
119
+ $this->modules[$name] = $this->_forge_module($name);
120
  }
121
 
122
  }
183
  )
184
  );
185
 
 
 
 
186
  }
187
 
188
  /**
192
  */
193
  public function init_sidebar_type() {
194
 
 
 
195
  // List public taxonomies
196
  foreach(get_taxonomies(array('public'=>true),'names') as $tax) {
197
  $this->taxonomies[] = $tax;
200
  // Register the sidebar type
201
  register_post_type('sidebar',array(
202
  'labels' => array(
203
+ 'name' => __('Sidebars', 'content-aware-sidebars'),
204
+ 'singular_name' => __('Sidebar', 'content-aware-sidebars'),
205
+ 'add_new' => _x('Add New', 'sidebar', 'content-aware-sidebars'),
206
+ 'add_new_item' => __('Add New Sidebar', 'content-aware-sidebars'),
207
+ 'edit_item' => __('Edit Sidebar', 'content-aware-sidebars'),
208
+ 'new_item' => __('New Sidebar', 'content-aware-sidebars'),
209
+ 'all_items' => __('All Sidebars', 'content-aware-sidebars'),
210
+ 'view_item' => __('View Sidebar', 'content-aware-sidebars'),
211
+ 'search_items' => __('Search Sidebars', 'content-aware-sidebars'),
212
+ 'not_found' => __('No sidebars found', 'content-aware-sidebars'),
213
  'not_found_in_trash' => __('No sidebars found in Trash', 'content-aware-sidebars')
214
  ),
215
+ 'show_ui' => true,
216
+ 'query_var' => false,
217
+ 'rewrite' => false,
218
+ 'menu_position' => null,
219
+ 'supports' => array('title','page-attributes','excerpt'),
220
+ 'taxonomies' => $this->taxonomies,
221
+ 'menu_icon' => WP_PLUGIN_URL.'/'.plugin_basename(dirname(__FILE__)).'/img/icon-16.png'
222
  ));
223
  }
224
 
273
  //WP3.1 does not support (array) as post_status
274
  $posts = get_posts(array(
275
  'numberposts' => -1,
276
+ 'post_type' => 'sidebar',
277
  'post_status' => 'publish,private,future'
278
  ));
279
  foreach($posts as $post) {
280
  register_sidebar( array(
281
+ 'name' => $post->post_title,
282
  'description' => $post->post_excerpt,
283
+ 'id' => 'ca-sidebar-'.$post->ID,
284
  'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
285
  'after_widget' => '</li>',
286
  'before_title' => '<h3 class="widget-title">',
367
 
368
  if($column_name == 'handle' && $current < 2) {
369
  $host = get_post_meta($post_id,self::prefix.'host',true);
370
+ $current_from_list .= ": ".(isset($this->metadata['host']['list'][$host]) ? $this->metadata['host']['list'][$host] : '<span style="color:red;">'.__('Please update Host Sidebar','content-aware-sidebars').'</span>');
371
  }
372
  echo $current_from_list;
373
  }
418
  *
419
  * @param array $actions
420
  * @param object $post
421
+ * @return array
422
  */
423
  public function sidebar_row_actions($actions, $post) {
424
  if($post->post_type == 'sidebar' && $post->post_status != 'trash') {
497
  public function get_sidebars() {
498
  global $wpdb;
499
 
500
+ if(post_password_required())
501
+ return false;
502
+
503
  // Return cache if present
504
  if(!empty($this->sidebar_cache)) {
505
  if($this->sidebar_cache[0] == false)
507
  else
508
  return $this->sidebar_cache;
509
  }
510
+
511
  $joins = array();
512
  $where = array();
513
  $where2 = array();
514
 
515
+ // Get rules
516
+ foreach($this->modules as $module) {
517
+ if($module->is_content()) {
518
+ $joins[] = apply_filters("cas-db-join-".$module->get_id(), $module->db_join());
519
+ $where[] = apply_filters("cas-db-where-".$module->get_id(), $module->db_where());
520
+ $where2[] = $module->db_where2();
521
+ }
522
+ }
523
 
524
  // Check if there are any rules for this type of content
525
  if(empty($where))
566
  // Add boxes
567
  // Author Words
568
  add_meta_box(
569
+ 'cas-dev-words',
570
  __('Words from the author', 'content-aware-sidebars'),
571
  array(&$this,'meta_box_author_words'),
572
  'sidebar',
573
  'side',
574
  'high'
575
  );
 
 
 
576
 
577
+ // Module rules
578
  add_meta_box(
579
+ 'cas-rules',
580
+ __('Content', 'content-aware-sidebars'),
581
+ array(&$this,'meta_box_rules'),
582
  'sidebar',
583
  'normal',
584
  'high'
585
  );
586
+
587
+ // Options
588
+ add_meta_box(
589
+ 'cas-options',
590
+ __('Options', 'content-aware-sidebars'),
591
+ array(&$this,'meta_box_options'),
592
+ 'sidebar',
593
+ 'side'
594
+ );
595
  }
596
 
597
 
616
 
617
  if ($condition && get_user_option( 'metaboxhidden_sidebar' ) === false) {
618
 
619
+ $hidden_meta_boxes = array('postexcerpt','pageparentdiv');
620
  $hidden = array_merge($hidden,$hidden_meta_boxes);
621
 
622
  $user = wp_get_current_user();
626
  return $hidden;
627
  }
628
 
629
+ public function meta_box_rules() {
630
+ echo '<div id="cas-accordion">'."\n";
631
+ foreach($this->modules as $module) {
632
+ $module->meta_box_content();
633
+ }
634
+ echo '</div>'."\n";
635
+ }
636
+
637
  /**
638
  *
639
  * Options content
640
  *
641
  */
642
+ public function meta_box_options() {
643
 
644
  $columns = array(
 
645
  'exposure',
646
  'handle' => 'handle,host',
647
  'merge-pos'
648
  );
649
 
 
 
 
 
 
 
 
 
 
650
  foreach($columns as $key => $value) {
651
 
652
+ echo '<span>'.$this->metadata[is_numeric($key) ? $value : $key]['name'].':';
653
+ echo '<p>';
654
  $values = explode(',',$value);
655
  foreach($values as $val) {
656
  $this->_form_field($val);
657
  }
658
+ echo '</p></span>';
659
  }
 
 
 
 
 
 
 
 
660
  }
661
 
662
  /**
687
  <?php
688
  }
689
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
690
  /**
691
  *
692
  * Create form field for metadata
702
  $current = $meta != '' ? $meta : $setting['val'];
703
  switch($setting['type']) {
704
  case 'select' :
705
+ echo '<select style="width:250px;" name="'.$setting['id'].'">'."\n";
706
  foreach($setting['list'] as $key => $value) {
707
  echo '<option value="'.$key.'"'.($key == $current ? ' selected="selected"' : '').'>'.$value.'</option>'."\n";
708
  }
757
  $this->_init_metadata();
758
 
759
  // Update metadata
760
+ foreach ($this->metadata as $field) {
761
+ $new = isset($_POST[$field['id']]) ? $_POST[$field['id']] : '';
762
+ $old = get_post_meta($post_id, self::prefix.$field['id'], true);
763
+
764
  if ($new != '' && $new != $old) {
765
  update_post_meta($post_id, self::prefix.$field['id'], $new);
 
766
  } elseif ($new == '' && $old != '') {
767
+ delete_post_meta($post_id, self::prefix.$field['id'], $old);
768
  }
769
+ }
770
+ // Update module data
771
+ foreach ($this->modules as $module) {
772
+ $new = isset($_POST[$module->get_id()]) ? $_POST[$module->get_id()] : '';
773
+ $old = array_flip(get_post_meta($post_id, self::prefix.$module->get_id(), false));
774
+
775
+ if(is_array($new)) {
776
+ // Skip existing data or insert new data
777
+ foreach($new as $new_single) {
778
+ if(isset($old[$new_single])) {
779
+ unset($old[$new_single]);
780
+ } else {
781
+ add_post_meta($post_id, self::prefix.$module->get_id(), $new_single);
782
+ }
783
+ }
784
+ // Remove existing data that have not been skipped
785
+ foreach($old as $old_key => $old_value) {
786
+ delete_post_meta($post_id, self::prefix.$module->get_id(), $old_key);
787
+ }
788
+ } elseif(!empty($old)) {
789
+ // Remove any old values when $new is empty
790
+ delete_post_meta($post_id, self::prefix.$module->get_id());
791
+ }
792
+ }
793
  }
794
 
795
  /**
807
  *
808
  * @global string $pagenow
809
  */
810
+ public function load_admin_scripts($hook) {
811
+ global $wp_version;
812
+
813
+ wp_register_script('cas_admin_script', WP_PLUGIN_URL.'/'.plugin_basename(dirname(__FILE__)).'/js/cas_admin.js', array('jquery'), '0.1', true);
814
+ wp_register_style('cas_admin_style', WP_PLUGIN_URL.'/'.plugin_basename(dirname(__FILE__)).'/css/style.css', array(), '0.1');
815
+
816
+ if($hook == 'post.php' || $hook == 'post-new.php') {
817
+ // WordPress < 3.3 does not have jQuery UI accordion
818
+ if($wp_version < 3.3) {
819
+ //die(var_dump($wp_version < 3.3));
820
+ wp_register_script('cas-jquery-ui-accordion', WP_PLUGIN_URL.'/'.plugin_basename(dirname(__FILE__)).'/js/jquery.ui.accordion.js', array('jquery-ui-core','jquery-ui-widget'), '1.8.9', true);
821
+ wp_enqueue_script('cas-jquery-ui-accordion');
822
+ } else {
823
+ wp_enqueue_script('jquery-ui-accordion');
824
+ }
825
  wp_enqueue_script('cas_admin_script');
826
+
827
+ wp_enqueue_style('cas_admin_style');
828
+ } else if($hook == 'edit.php') {
829
+ wp_enqueue_style('cas_admin_style');
830
  }
831
+
 
 
 
 
 
 
 
 
 
 
832
  }
833
 
834
  /**
css/style.css CHANGED
@@ -1,6 +1,76 @@
 
 
 
 
 
1
  .icon32-posts-sidebar {
2
  background:transparent url('../img/icon-32.png') no-repeat !important;
3
  }
4
- /*#preview-action {
5
- display:none !important;
6
- }*/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * @package Content Aware Sidebars
3
+ * @author Joachim Jensen <jv@intox.dk>
4
+ */
5
+
6
  .icon32-posts-sidebar {
7
  background:transparent url('../img/icon-32.png') no-repeat !important;
8
  }
9
+
10
+ #cas-rules, .postbox-container, .meta-box-sortables, #cas-rules .inside, .postbox, #normal-sortables {
11
+ height:inherit !important;
12
+ }
13
+
14
+ #cas-rules .inside {
15
+ overflow:hidden;
16
+ margin:0;
17
+ padding:0;
18
+ }
19
+
20
+ #cas-accordion > h4 {
21
+ border-width:1px 0 !important;
22
+ border-style:solid;
23
+ border-color:#f9f9f9 #f9f9f9 #dfdfdf !important;
24
+ margin:0;
25
+ background-color:#ececec;
26
+ display:block;
27
+ outline: none;
28
+ }
29
+
30
+ #cas-accordion > h4:hover {
31
+ background-color:#e4e4e4 !important;
32
+ }
33
+
34
+ #cas-accordion > h4 a {
35
+ display:block;
36
+ height:30px;
37
+ line-height:30px;
38
+ padding:0 30px;
39
+ text-decoration: none;
40
+ }
41
+
42
+ .cas-rule-content {
43
+ border-width:1px 0 !important;
44
+ border-style:solid;
45
+ border-color:#eee #eee #cfcfcf !important;
46
+ padding:10px !important;
47
+ background-color:#dfdfdf !important;
48
+ }
49
+
50
+ #cas-accordion .ui-state-default:last-of-type, .cas-rule-content:last-child {
51
+ border-width:1px 0 0 !important;
52
+ }
53
+
54
+ #cas-accordion .ui-state-default.ui-state-active, #cas-accordion .ui-state-active {
55
+ border-width:1px 0 !important;
56
+ background-color:#dfdfdf;
57
+ border-color:#c0c0c0 #fff #cfcfcf !important;
58
+ box-shadow:inset 0 2px 1px 0 #cfcfcf;
59
+ }
60
+
61
+ #cas-accordion .tabs, #cas-accordion .tabs-panel {
62
+ background-color:#fff;
63
+ border-width:1px;
64
+ border-style:solid;
65
+ border-color:#ccc;
66
+ }
67
+
68
+ #cas-accordion .tabs {
69
+ border-color:#ccc #ccc #fff;
70
+ }
71
+
72
+ .cas-tick {
73
+ background-image:url('../img/tick.png'); /* Icon by fatcow.com */
74
+ background-repeat: no-repeat;
75
+ background-position: 8px center;
76
+ }
img/tick.png ADDED
Binary file
js/cas_admin.js CHANGED
@@ -1,91 +1,91 @@
1
  /**
2
  * @package Content Aware Sidebars
 
3
  */
 
 
 
 
 
 
 
 
4
  jQuery(document).ready(function($) {
5
 
6
- handleAllCheckbox("post_types","posttype");
7
- handleAllCheckbox("taxonomies","taxonomy");
8
- handleAllCheckbox("authors","list");
9
- handleAllCheckbox("page_templates","list");
10
-
11
- handleSidebarHandle();
12
 
13
- //$( "#cas_tabs" ).tabs();
14
-
15
- /**
16
- *
17
- * Handle "Show with All" checkbox
18
- *
19
- */
20
- function handleAllCheckbox(name,type) {
21
-
22
- var checkbox = "input[name='"+name+"[]']";
23
-
24
- // Execute on ready for each checkbox
25
- $(checkbox).each(function() {
26
- disenableSingleCheckboxes($(this),type);
27
- });
28
-
29
- // Execute on change
30
- $(checkbox).change(function(){
31
- disenableSingleCheckboxes($(this),type);
32
- });
33
- }
34
-
35
- /**
36
- *
37
- * The state of a "Show with All" checkbox will control the
38
- * accessibility of the respective checkboxes for specific entities
39
- * If state is checked, they will be disabled
40
- *
41
- */
42
- function disenableSingleCheckboxes(checkbox,type) {
43
- var checkboxes = "#"+type+"-"+checkbox.val()+" :input";
44
-
45
- if(checkbox.is(":checked")) {
46
- $(checkboxes).attr("disabled", true);
47
- } else {
48
- $(checkboxes).removeAttr("disabled");
49
- }
50
- }
51
 
52
- /**
53
- *
54
- * Handle the Handle selection
55
- *
56
- */
57
- function handleSidebarHandle() {
58
 
59
- var name = "select[name='handle']";
60
 
61
- // Execute on ready
62
- $(name).each(function(){
63
- endisableHostSidebars($(this));
64
- });
65
 
66
- // Execute on change
67
- $(name).change(function(){
68
- endisableHostSidebars($(this));
69
- });
70
- }
71
 
72
- /**
73
- *
74
- * The value of Handle selection will control the
75
- * accessibility of the host sidebar selection
76
- * If Handling is manual, selection of host sidebar will be disabled
77
- *
78
- */
79
- function endisableHostSidebars(select) {
80
- var name = "select[name='host']";
81
- if(select.val() == 2) {
82
- $(name).hide();
83
- $(name).attr("disabled", true);
84
 
85
- } else {
86
- $(name).show();
87
- $(name).removeAttr("disabled");
88
- }
89
- }
90
 
91
  });
1
  /**
2
  * @package Content Aware Sidebars
3
+ * @author Joachim Jensen <jv@intox.dk>
4
  */
5
+
6
+ jQuery( "#cas-accordion" ).accordion({
7
+ header: 'h4',
8
+ autoHeight: false,
9
+ collapsible: true,
10
+ heightStyle: 'content'
11
+ });
12
+
13
  jQuery(document).ready(function($) {
14
 
15
+ handleSidebarHandle();
 
 
 
 
 
16
 
17
+ /**
18
+ *
19
+ * Set tickers if at least one checkbox is checked
20
+ *
21
+ */
22
+ $('.cas-rule-content :input').each( function() {
23
+ toggleTick(this);
24
+ });
25
+ $('.cas-rule-content :input').change( function() {
26
+ toggleTick(this);
27
+ });
28
+
29
+ /**
30
+ *
31
+ * Toggle specific checkboxes depending on "show with all" checkbox
32
+ *
33
+ */
34
+ $('.cas-rule-content .cas-chk-all').each( function() {
35
+ toggleAllSpecific(this);
36
+ });
37
+ $('.cas-rule-content .cas-chk-all').change( function() {
38
+ toggleAllSpecific(this);
39
+ });
40
+
41
+ function toggleTick(checkbox) {
42
+ $(checkbox).parents('.cas-rule-content').prev().toggleClass('cas-tick',$('#'+$(checkbox).parents('.cas-rule-content').attr('id')+' :input:checked').length > 0);
43
+ }
44
+
45
+ function toggleAllSpecific(checkbox) {
46
+ var checkboxes = $(".cas-rule-content ."+$(checkbox).parents('.cas-rule-content').attr("id"));
47
+ if($(checkbox).is(":checked")) {
48
+ $(checkboxes).attr("disabled", true);
49
+ } else {
50
+ $(checkboxes).removeAttr("disabled");
51
+ }
52
+ }
 
 
53
 
54
+ /**
55
+ *
56
+ * Handle the Handle selection
57
+ *
58
+ */
59
+ function handleSidebarHandle() {
60
 
61
+ var name = "select[name='handle']";
62
 
63
+ // Execute on ready
64
+ $(name).each(function(){
65
+ endisableHostSidebars($(this));
66
+ });
67
 
68
+ // Execute on change
69
+ $(name).change(function(){
70
+ endisableHostSidebars($(this));
71
+ });
72
+ }
73
 
74
+ /**
75
+ * The value of Handle selection will control the
76
+ * accessibility of the host sidebar selection
77
+ * If Handling is manual, selection of host sidebar will be disabled
78
+ */
79
+ function endisableHostSidebars(select) {
80
+ var name = "select[name='host']";
81
+ if(select.val() == 2) {
82
+ $(name).hide();
83
+ $(name).attr("disabled", true);
 
 
84
 
85
+ } else {
86
+ $(name).show();
87
+ $(name).removeAttr("disabled");
88
+ }
89
+ }
90
 
91
  });
js/jquery.ui.accordion.js ADDED
@@ -0,0 +1 @@
 
1
+ (function($,undefined){$.widget("ui.accordion",{options:{active:0,animated:"slide",autoHeight:true,clearStyle:false,collapsible:false,event:"click",fillSpace:false,header:"> li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:false,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase();}},_create:function(){var self=this,options=self.options;self.running=0;self.element.addClass("ui-accordion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix");self.headers=self.element.find(options.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){if(options.disabled){return;}$(this).addClass("ui-state-hover");}).bind("mouseleave.accordion",function(){if(options.disabled){return;}$(this).removeClass("ui-state-hover");}).bind("focus.accordion",function(){if(options.disabled){return;}$(this).addClass("ui-state-focus");}).bind("blur.accordion",function(){if(options.disabled){return;}$(this).removeClass("ui-state-focus");});self.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");if(options.navigation){var current=self.element.find("a").filter(options.navigationFilter).eq(0);if(current.length){var header=current.closest(".ui-accordion-header");if(header.length){self.active=header;}else{self.active=current.closest(".ui-accordion-content").prev();}}}self.active=self._findActive(self.active||options.active).addClass("ui-state-default ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top");self.active.next().addClass("ui-accordion-content-active");self._createIcons();self.resize();self.element.attr("role","tablist");self.headers.attr("role","tab").bind("keydown.accordion",function(event){return self._keydown(event);}).next().attr("role","tabpanel");self.headers.not(self.active||"").attr({"aria-expanded":"false",tabIndex:-1}).next().hide();if(!self.active.length){self.headers.eq(0).attr("tabIndex",0);}else{self.active.attr({"aria-expanded":"true",tabIndex:0});}if(!$.browser.safari){self.headers.find("a").attr("tabIndex",-1);}if(options.event){self.headers.bind(options.event.split(" ").join(".accordion ")+".accordion",function(event){self._clickHandler.call(self,event,this);event.preventDefault();});}},_createIcons:function(){var options=this.options;if(options.icons){$("<span></span>").addClass("ui-icon "+options.icons.header).prependTo(this.headers);this.active.children(".ui-icon").toggleClass(options.icons.header).toggleClass(options.icons.headerSelected);this.element.addClass("ui-accordion-icons");}},_destroyIcons:function(){this.headers.children(".ui-icon").remove();this.element.removeClass("ui-accordion-icons");},destroy:function(){var options=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role");this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("tabIndex");this.headers.find("a").removeAttr("tabIndex");this._destroyIcons();var contents=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled");if(options.autoHeight||options.fillHeight){contents.css("height","");}return $.Widget.prototype.destroy.call(this);},_setOption:function(key,value){$.Widget.prototype._setOption.apply(this,arguments);if(key=="active"){this.activate(value);}if(key=="icons"){this._destroyIcons();if(value){this._createIcons();}}if(key=="disabled"){this.headers.add(this.headers.next())[value?"addClass":"removeClass"]("ui-accordion-disabled ui-state-disabled");}},_keydown:function(event){if(this.options.disabled||event.altKey||event.ctrlKey){return;}var keyCode=$.ui.keyCode,length=this.headers.length,currentIndex=this.headers.index(event.target),toFocus=false;switch(event.keyCode){case keyCode.RIGHT:case keyCode.DOWN:toFocus=this.headers[(currentIndex+1)%length];break;case keyCode.LEFT:case keyCode.UP:toFocus=this.headers[(currentIndex-1+length)%length];break;case keyCode.SPACE:case keyCode.ENTER:this._clickHandler({target:event.target},event.target);event.preventDefault();}if(toFocus){$(event.target).attr("tabIndex",-1);$(toFocus).attr("tabIndex",0);toFocus.focus();return false;}return true;},resize:function(){var options=this.options,maxHeight;if(options.fillSpace){if($.browser.msie){var defOverflow=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden");}maxHeight=this.element.parent().height();if($.browser.msie){this.element.parent().css("overflow",defOverflow);}this.headers.each(function(){maxHeight-=$(this).outerHeight(true);});this.headers.next().each(function(){$(this).height(Math.max(0,maxHeight-$(this).innerHeight()+$(this).height()));}).css("overflow","auto");}else{if(options.autoHeight){maxHeight=0;this.headers.next().each(function(){maxHeight=Math.max(maxHeight,$(this).height("").height());}).height(maxHeight);}}return this;},activate:function(index){this.options.active=index;var active=this._findActive(index)[0];this._clickHandler({target:active},active);return this;},_findActive:function(selector){return selector?typeof selector==="number"?this.headers.filter(":eq("+selector+")"):this.headers.not(this.headers.not(selector)):selector===false?$([]):this.headers.filter(":eq(0)");},_clickHandler:function(event,target){var options=this.options;if(options.disabled){return;}if(!event.target){if(!options.collapsible){return;}this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(options.icons.headerSelected).addClass(options.icons.header);this.active.next().addClass("ui-accordion-content-active");var toHide=this.active.next(),data={options:options,newHeader:$([]),oldHeader:options.active,newContent:$([]),oldContent:toHide},toShow=(this.active=$([]));this._toggle(toShow,toHide,data);return;}var clicked=$(event.currentTarget||target),clickedIsActive=clicked[0]===this.active[0];options.active=options.collapsible&&clickedIsActive?false:this.headers.index(clicked);if(this.running||(!options.collapsible&&clickedIsActive)){return;}var active=this.active,toShow=clicked.next(),toHide=this.active.next(),data={options:options,newHeader:clickedIsActive&&options.collapsible?$([]):clicked,oldHeader:this.active,newContent:clickedIsActive&&options.collapsible?$([]):toShow,oldContent:toHide},down=this.headers.index(this.active[0])>this.headers.index(clicked[0]);this.active=clickedIsActive?$([]):clicked;this._toggle(toShow,toHide,data,clickedIsActive,down);active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(options.icons.headerSelected).addClass(options.icons.header);if(!clickedIsActive){clicked.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").children(".ui-icon").removeClass(options.icons.header).addClass(options.icons.headerSelected);clicked.next().addClass("ui-accordion-content-active");}return;},_toggle:function(toShow,toHide,data,clickedIsActive,down){var self=this,options=self.options;self.toShow=toShow;self.toHide=toHide;self.data=data;var complete=function(){if(!self){return;}return self._completed.apply(self,arguments);};self._trigger("changestart",null,self.data);self.running=toHide.size()===0?toShow.size():toHide.size();if(options.animated){var animOptions={};if(options.collapsible&&clickedIsActive){animOptions={toShow:$([]),toHide:toHide,complete:complete,down:down,autoHeight:options.autoHeight||options.fillSpace};}else{animOptions={toShow:toShow,toHide:toHide,complete:complete,down:down,autoHeight:options.autoHeight||options.fillSpace};}if(!options.proxied){options.proxied=options.animated;}if(!options.proxiedDuration){options.proxiedDuration=options.duration;}options.animated=$.isFunction(options.proxied)?options.proxied(animOptions):options.proxied;options.duration=$.isFunction(options.proxiedDuration)?options.proxiedDuration(animOptions):options.proxiedDuration;var animations=$.ui.accordion.animations,duration=options.duration,easing=options.animated;if(easing&&!animations[easing]&&!$.easing[easing]){easing="slide";}if(!animations[easing]){animations[easing]=function(options){this.slide(options,{easing:easing,duration:duration||700});};}animations[easing](animOptions);}else{if(options.collapsible&&clickedIsActive){toShow.toggle();}else{toHide.hide();toShow.show();}complete(true);}toHide.prev().attr({"aria-expanded":"false",tabIndex:-1}).blur();toShow.prev().attr({"aria-expanded":"true",tabIndex:0}).focus();},_completed:function(cancel){this.running=cancel?0:--this.running;if(this.running){return;}if(this.options.clearStyle){this.toShow.add(this.toHide).css({height:"",overflow:""});}this.toHide.removeClass("ui-accordion-content-active");if(this.toHide.length){this.toHide.parent()[0].className=this.toHide.parent()[0].className;}this._trigger("change",null,this.data);}});$.extend($.ui.accordion,{version:"1.8.9",animations:{slide:function(options,additions){options=$.extend({easing:"swing",duration:300},options,additions);if(!options.toHide.size()){options.toShow.animate({height:"show",paddingTop:"show",paddingBottom:"show"},options);return;}if(!options.toShow.size()){options.toHide.animate({height:"hide",paddingTop:"hide",paddingBottom:"hide"},options);return;}var overflow=options.toShow.css("overflow"),percentDone=0,showProps={},hideProps={},fxAttrs=["height","paddingTop","paddingBottom"],originalWidth;var s=options.toShow;originalWidth=s[0].style.width;s.width(parseInt(s.parent().width(),10)-parseInt(s.css("paddingLeft"),10)-parseInt(s.css("paddingRight"),10)-(parseInt(s.css("borderLeftWidth"),10)||0)-(parseInt(s.css("borderRightWidth"),10)||0));$.each(fxAttrs,function(i,prop){hideProps[prop]="hide";var parts=(""+$.css(options.toShow[0],prop)).match(/^([\d+-.]+)(.*)$/);showProps[prop]={value:parts[1],unit:parts[2]||"px"};});options.toShow.css({height:0,overflow:"hidden"}).show();options.toHide.filter(":hidden").each(options.complete).end().filter(":visible").animate(hideProps,{step:function(now,settings){if(settings.prop=="height"){percentDone=(settings.end-settings.start===0)?0:(settings.now-settings.start)/(settings.end-settings.start);}options.toShow[0].style[settings.prop]=(percentDone*showProps[settings.prop].value)+showProps[settings.prop].unit;},duration:options.duration,easing:options.easing,complete:function(){if(!options.autoHeight){options.toShow.css("height","");}options.toShow.css({width:originalWidth,overflow:overflow});options.complete();}});},bounceslide:function(options){this.slide(options,{easing:options.down?"easeOutBounce":"swing",duration:options.down?1000:200});}}});})(jQuery);
lang/content-aware-sidebars-da_DK.mo CHANGED
Binary file
lang/content-aware-sidebars-da_DK.po CHANGED
@@ -4,252 +4,261 @@ msgid ""
4
  msgstr ""
5
  "Project-Id-Version: Content Aware Sidebars 0.8.3\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/content-aware-sidebars\n"
7
- "POT-Creation-Date: 2012-05-30 22:56:32+00:00\n"
8
- "PO-Revision-Date: 2012-05-31 00:59+0100\n"
9
- "Last-Translator: Joachim Jensen <jv@intox.dk>\n"
10
  "Language-Team: Intox Studio <jv@intox.dk>\n"
 
11
  "MIME-Version: 1.0\n"
12
  "Content-Type: text/plain; charset=UTF-8\n"
13
  "Content-Transfer-Encoding: 8bit\n"
14
- "X-Poedit-Language: Danish\n"
15
- "X-Poedit-Country: DENMARK\n"
16
 
17
- #: content-aware-sidebars.php:151
18
- #: content-aware-sidebars.php:329
19
  msgid "Exposure"
20
  msgstr "Eksponering"
21
 
22
- #: content-aware-sidebars.php:157
23
  msgid "Singular"
24
  msgstr "Singulær"
25
 
26
- #: content-aware-sidebars.php:158
27
  msgid "Singular & Archive"
28
  msgstr "Singulær og arkiv"
29
 
30
- #: content-aware-sidebars.php:159
31
  msgid "Archive"
32
  msgstr "Arkiv"
33
 
34
- #: content-aware-sidebars.php:163
35
- #: content-aware-sidebars.php:330
36
  msgctxt "option"
37
  msgid "Handle"
38
  msgstr "Håndtering"
39
 
40
- #: content-aware-sidebars.php:165
41
  msgid "Replace host sidebar, merge with it or add sidebar manually."
42
  msgstr "Erstat værts-sidebar, flet med den eller tilføj denne sidebar manuelt."
43
 
44
- #: content-aware-sidebars.php:169
45
  msgid "Replace"
46
  msgstr "Erstat"
47
 
48
- #: content-aware-sidebars.php:170
49
  msgid "Merge"
50
  msgstr "Flet"
51
 
52
- #: content-aware-sidebars.php:171
53
  msgid "Manual"
54
  msgstr "Manuel"
55
 
56
- #: content-aware-sidebars.php:175
57
  msgid "Host Sidebar"
58
  msgstr "Værts-sidebar"
59
 
60
- #: content-aware-sidebars.php:183
61
- #: content-aware-sidebars.php:331
62
  msgid "Merge position"
63
  msgstr "Fletteposition"
64
 
65
- #: content-aware-sidebars.php:185
66
  msgid "Place sidebar on top or bottom of host when merging."
67
  msgstr "Flet ind fra oven eller bunden."
68
 
69
- #: content-aware-sidebars.php:189
70
  msgid "Top"
71
  msgstr "Top"
72
 
73
- #: content-aware-sidebars.php:190
74
  msgid "Bottom"
75
  msgstr "Bund"
76
 
77
- #: content-aware-sidebars.php:223
78
  msgid "Sidebars"
79
  msgstr "Sidebars"
80
 
81
- #: content-aware-sidebars.php:224
82
  msgid "Sidebar"
83
  msgstr "Sidebar"
84
 
85
- #: content-aware-sidebars.php:225
86
  msgctxt "sidebar"
87
  msgid "Add New"
88
  msgstr "Tilføj ny"
89
 
90
- #: content-aware-sidebars.php:226
91
  msgid "Add New Sidebar"
92
  msgstr "Tilføj ny sidebar"
93
 
94
- #: content-aware-sidebars.php:227
95
  msgid "Edit Sidebar"
96
  msgstr "Rediger sidebar"
97
 
98
- #: content-aware-sidebars.php:228
99
  msgid "New Sidebar"
100
  msgstr "Ny sidebar"
101
 
102
- #: content-aware-sidebars.php:229
103
  msgid "All Sidebars"
104
  msgstr "Alle sidebars"
105
 
106
- #: content-aware-sidebars.php:230
107
  msgid "View Sidebar"
108
  msgstr "Vis sidebar"
109
 
110
- #: content-aware-sidebars.php:231
111
  msgid "Search Sidebars"
112
  msgstr "Søg sidebars"
113
 
114
- #: content-aware-sidebars.php:232
115
  msgid "No sidebars found"
116
  msgstr "Ingen sidebars fundet"
117
 
118
- #: content-aware-sidebars.php:233
119
  msgid "No sidebars found in Trash"
120
  msgstr "Ingen sidebars fundet i papirkurven"
121
 
122
- #: content-aware-sidebars.php:254
123
  msgid "Sidebar updated. <a href=\"%s\">Manage widgets</a>"
124
  msgstr "Sidebar opdateret. <a href=\"%s\">Håndter widgets</a>"
125
 
126
- #: content-aware-sidebars.php:257
127
  msgid "Sidebar updated."
128
  msgstr "Sidebar opdateret."
129
 
130
- #: content-aware-sidebars.php:259
131
  msgid "Sidebar published. <a href=\"%s\">Manage widgets</a>"
132
  msgstr "Sidebar udgivet. <a href=\"%s\">Håndter widgets</a>"
133
 
134
- #: content-aware-sidebars.php:260
135
  msgid "Sidebar saved."
136
  msgstr "Sidebar gemt."
137
 
138
- #: content-aware-sidebars.php:261
139
  msgid "Sidebar submitted. <a href=\"%s\">Manage widgets</a>"
140
  msgstr "Sidebar indsendt. <a href=\"%s\">Håndter widgets</a>"
141
 
142
- #: content-aware-sidebars.php:262
143
- msgid "Sidebar scheduled for: <strong>%1$s</strong>. <a href=\"%2$s\">Manage widgets</a>"
144
- msgstr "Sidebar planlagt til: <strong>%1$s</strong>. <a href=\"%2$s\">Håndter widgets</a>"
 
 
 
 
145
 
146
  #. translators: Publish box date format, see http:php.net/date
147
- #: content-aware-sidebars.php:264
148
  msgid "M j, Y @ G:i"
149
  msgstr "j. M, Y @ G:i"
150
 
151
- #: content-aware-sidebars.php:265
152
  msgid "Sidebar draft updated."
153
  msgstr "Sidebar-kladde opdateret."
154
 
155
- #: content-aware-sidebars.php:444
 
 
 
 
156
  msgid "Manage Widgets"
157
  msgstr "Håndter widgets"
158
 
159
- #: content-aware-sidebars.php:572
160
  msgid "Words from the author"
161
  msgstr "Et par ord fra forfatteren"
162
 
163
- #: content-aware-sidebars.php:585
 
 
 
 
164
  msgid "Options"
165
  msgstr "Indstillinger"
166
 
167
- #: content-aware-sidebars.php:679
168
  msgid "If you love this plugin, please consider donating."
169
  msgstr "Venligst overvej at donere, hvis du elsker dette plugin."
170
 
171
- #: content-aware-sidebars.php:681
172
- msgid "Remember to <a class=\"button\" href=\"%1$s\" target=\"_blank\">rate</a> and <a class=\"button\" href=\"%2$s\" target=\"_blank\">share</a> it too!"
173
- msgstr "Glem ikke at <a class=\"button\" href=\"%1$s\" target=\"_blank\">vurdere</a> og <a class=\"button\" href=\"%2$s\" target=\"_blank\">dele</a> det!"
 
 
 
 
174
 
175
- #: content-aware-sidebars.php:683
176
  msgid "Check out Content Aware Sidebars for %23WordPress! :)"
177
  msgstr "Jeg bruger Content Aware Sidebars til %23WordPress! :)"
178
 
179
- #: content-aware-sidebars.php:698
180
- #: content-aware-sidebars.php:750
181
- msgid "No items."
182
- msgstr "Ingen elementer."
183
 
184
- #: content-aware-sidebars.php:704
185
- msgid "Most Used"
186
- msgstr "Mest brugte"
187
 
188
- #: content-aware-sidebars.php:705
189
- #: content-aware-sidebars.php:756
190
- #: content-aware-sidebars.php:781
191
  msgid "View All"
192
  msgstr "Vis alle"
193
 
194
- #: content-aware-sidebars.php:725
195
- msgid "Show with %s"
196
- msgstr "Vis ved %s"
197
-
198
- #: content-aware-sidebars.php:769
199
- #: content-aware-sidebars.php:794
200
- msgid "Show with All %s"
201
- msgstr "Vis ved alle %s"
202
-
203
- #: modules/author.php:28
204
- #: modules/author.php:42
205
  msgid "Authors"
206
  msgstr "Forfattere"
207
 
208
- #: modules/page_template.php:17
209
- #: modules/page_template.php:30
 
 
 
210
  msgid "Page Templates"
211
  msgstr "Skabeloner"
212
 
213
- #: modules/post_type.php:30
214
  msgid "Post Types"
215
  msgstr "Indholdstyper"
216
 
217
- #: modules/qtranslate.php:27
218
- #: modules/qtranslate.php:39
219
- #: modules/transposh.php:27
220
- #: modules/transposh.php:39
221
- #: modules/wpml.php:26
222
- #: modules/wpml.php:38
223
  msgid "Languages"
224
  msgstr "Sprog"
225
 
226
- #: modules/static.php:15
227
  msgid "Static Pages"
228
  msgstr "Statiske sider"
229
 
230
- #: modules/static.php:21
231
  msgid "Front Page"
232
  msgstr "Forside"
233
 
234
- #: modules/static.php:22
235
  msgid "Search Results"
236
  msgstr "Søgeresultater"
237
 
238
- #: modules/static.php:23
239
  msgid "404 Page"
240
  msgstr "404-side"
241
 
242
- #: modules/taxonomy.php:32
243
  msgid "Taxonomies"
244
  msgstr "Taksonomier"
245
 
 
 
 
 
 
 
 
 
246
  #. Plugin Name of the plugin/theme
247
  msgid "Content Aware Sidebars"
248
  msgstr "Content Aware Sidebars"
249
 
250
- #. #-#-#-#-# plugin.pot (Content Aware Sidebars 0.8.3) #-#-#-#-#
251
  #. Plugin URI of the plugin/theme
252
- #. #-#-#-#-# plugin.pot (Content Aware Sidebars 0.8.3) #-#-#-#-#
253
  #. Author URI of the plugin/theme
254
  msgid "http://www.intox.dk/"
255
  msgstr "http://www.intox.dk/"
4
  msgstr ""
5
  "Project-Id-Version: Content Aware Sidebars 0.8.3\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/content-aware-sidebars\n"
7
+ "POT-Creation-Date: 2012-09-19 11:11:11+00:00\n"
8
+ "PO-Revision-Date: 2012-09-19 13:12+0100\n"
9
+ "Last-Translator: Intox Studio <jv@intox.dk>\n"
10
  "Language-Team: Intox Studio <jv@intox.dk>\n"
11
+ "Language: da_DK\n"
12
  "MIME-Version: 1.0\n"
13
  "Content-Type: text/plain; charset=UTF-8\n"
14
  "Content-Transfer-Encoding: 8bit\n"
 
 
15
 
16
+ #: content-aware-sidebars.php:145 content-aware-sidebars.php:308
 
17
  msgid "Exposure"
18
  msgstr "Eksponering"
19
 
20
+ #: content-aware-sidebars.php:151
21
  msgid "Singular"
22
  msgstr "Singulær"
23
 
24
+ #: content-aware-sidebars.php:152
25
  msgid "Singular & Archive"
26
  msgstr "Singulær og arkiv"
27
 
28
+ #: content-aware-sidebars.php:153
29
  msgid "Archive"
30
  msgstr "Arkiv"
31
 
32
+ #: content-aware-sidebars.php:157 content-aware-sidebars.php:309
 
33
  msgctxt "option"
34
  msgid "Handle"
35
  msgstr "Håndtering"
36
 
37
+ #: content-aware-sidebars.php:159
38
  msgid "Replace host sidebar, merge with it or add sidebar manually."
39
  msgstr "Erstat værts-sidebar, flet med den eller tilføj denne sidebar manuelt."
40
 
41
+ #: content-aware-sidebars.php:163
42
  msgid "Replace"
43
  msgstr "Erstat"
44
 
45
+ #: content-aware-sidebars.php:164
46
  msgid "Merge"
47
  msgstr "Flet"
48
 
49
+ #: content-aware-sidebars.php:165
50
  msgid "Manual"
51
  msgstr "Manuel"
52
 
53
+ #: content-aware-sidebars.php:169
54
  msgid "Host Sidebar"
55
  msgstr "Værts-sidebar"
56
 
57
+ #: content-aware-sidebars.php:177 content-aware-sidebars.php:310
 
58
  msgid "Merge position"
59
  msgstr "Fletteposition"
60
 
61
+ #: content-aware-sidebars.php:179
62
  msgid "Place sidebar on top or bottom of host when merging."
63
  msgstr "Flet ind fra oven eller bunden."
64
 
65
+ #: content-aware-sidebars.php:183
66
  msgid "Top"
67
  msgstr "Top"
68
 
69
+ #: content-aware-sidebars.php:184
70
  msgid "Bottom"
71
  msgstr "Bund"
72
 
73
+ #: content-aware-sidebars.php:205
74
  msgid "Sidebars"
75
  msgstr "Sidebars"
76
 
77
+ #: content-aware-sidebars.php:206
78
  msgid "Sidebar"
79
  msgstr "Sidebar"
80
 
81
+ #: content-aware-sidebars.php:207
82
  msgctxt "sidebar"
83
  msgid "Add New"
84
  msgstr "Tilføj ny"
85
 
86
+ #: content-aware-sidebars.php:208
87
  msgid "Add New Sidebar"
88
  msgstr "Tilføj ny sidebar"
89
 
90
+ #: content-aware-sidebars.php:209
91
  msgid "Edit Sidebar"
92
  msgstr "Rediger sidebar"
93
 
94
+ #: content-aware-sidebars.php:210
95
  msgid "New Sidebar"
96
  msgstr "Ny sidebar"
97
 
98
+ #: content-aware-sidebars.php:211
99
  msgid "All Sidebars"
100
  msgstr "Alle sidebars"
101
 
102
+ #: content-aware-sidebars.php:212
103
  msgid "View Sidebar"
104
  msgstr "Vis sidebar"
105
 
106
+ #: content-aware-sidebars.php:213
107
  msgid "Search Sidebars"
108
  msgstr "Søg sidebars"
109
 
110
+ #: content-aware-sidebars.php:214
111
  msgid "No sidebars found"
112
  msgstr "Ingen sidebars fundet"
113
 
114
+ #: content-aware-sidebars.php:215
115
  msgid "No sidebars found in Trash"
116
  msgstr "Ingen sidebars fundet i papirkurven"
117
 
118
+ #: content-aware-sidebars.php:239
119
  msgid "Sidebar updated. <a href=\"%s\">Manage widgets</a>"
120
  msgstr "Sidebar opdateret. <a href=\"%s\">Håndter widgets</a>"
121
 
122
+ #: content-aware-sidebars.php:242
123
  msgid "Sidebar updated."
124
  msgstr "Sidebar opdateret."
125
 
126
+ #: content-aware-sidebars.php:244
127
  msgid "Sidebar published. <a href=\"%s\">Manage widgets</a>"
128
  msgstr "Sidebar udgivet. <a href=\"%s\">Håndter widgets</a>"
129
 
130
+ #: content-aware-sidebars.php:245
131
  msgid "Sidebar saved."
132
  msgstr "Sidebar gemt."
133
 
134
+ #: content-aware-sidebars.php:246
135
  msgid "Sidebar submitted. <a href=\"%s\">Manage widgets</a>"
136
  msgstr "Sidebar indsendt. <a href=\"%s\">Håndter widgets</a>"
137
 
138
+ #: content-aware-sidebars.php:247
139
+ msgid ""
140
+ "Sidebar scheduled for: <strong>%1$s</strong>. <a href=\"%2$s\">Manage "
141
+ "widgets</a>"
142
+ msgstr ""
143
+ "Sidebar planlagt til: <strong>%1$s</strong>. <a href=\"%2$s\">Håndter "
144
+ "widgets</a>"
145
 
146
  #. translators: Publish box date format, see http:php.net/date
147
+ #: content-aware-sidebars.php:249
148
  msgid "M j, Y @ G:i"
149
  msgstr "j. M, Y @ G:i"
150
 
151
+ #: content-aware-sidebars.php:250
152
  msgid "Sidebar draft updated."
153
  msgstr "Sidebar-kladde opdateret."
154
 
155
+ #: content-aware-sidebars.php:372
156
+ msgid "Please update Host Sidebar"
157
+ msgstr "Værts-sidebar skal opdateres"
158
+
159
+ #: content-aware-sidebars.php:435
160
  msgid "Manage Widgets"
161
  msgstr "Håndter widgets"
162
 
163
+ #: content-aware-sidebars.php:569
164
  msgid "Words from the author"
165
  msgstr "Et par ord fra forfatteren"
166
 
167
+ #: content-aware-sidebars.php:579
168
+ msgid "Content"
169
+ msgstr "Indhold"
170
+
171
+ #: content-aware-sidebars.php:589
172
  msgid "Options"
173
  msgstr "Indstillinger"
174
 
175
+ #: content-aware-sidebars.php:685
176
  msgid "If you love this plugin, please consider donating."
177
  msgstr "Venligst overvej at donere, hvis du elsker dette plugin."
178
 
179
+ #: content-aware-sidebars.php:687
180
+ msgid ""
181
+ "Remember to <a class=\"button\" href=\"%1$s\" target=\"_blank\">rate</a> and "
182
+ "<a class=\"button\" href=\"%2$s\" target=\"_blank\">share</a> it too!"
183
+ msgstr ""
184
+ "Glem ikke at <a class=\"button\" href=\"%1$s\" target=\"_blank\">vurdere</a> "
185
+ "og <a class=\"button\" href=\"%2$s\" target=\"_blank\">dele</a> det!"
186
 
187
+ #: content-aware-sidebars.php:689
188
  msgid "Check out Content Aware Sidebars for %23WordPress! :)"
189
  msgstr "Jeg bruger Content Aware Sidebars til %23WordPress! :)"
190
 
191
+ #: content-aware-sidebars.php:691
192
+ msgid "Check out Content Aware Sidebars :)"
193
+ msgstr "Jeg bruger Content Aware Sidebars :)"
 
194
 
195
+ #: modules/abstract.php:43 modules/post_type.php:75
196
+ msgid "Show with All %s"
197
+ msgstr "Vis ved alle %s"
198
 
199
+ #: modules/abstract.php:47 modules/post_type.php:85 modules/taxonomy.php:114
 
 
200
  msgid "View All"
201
  msgstr "Vis alle"
202
 
203
+ #: modules/author.php:20
 
 
 
 
 
 
 
 
 
 
204
  msgid "Authors"
205
  msgstr "Forfattere"
206
 
207
+ #: modules/bbpress.php:19
208
+ msgid "bbPress"
209
+ msgstr "bbPress"
210
+
211
+ #: modules/page_template.php:20
212
  msgid "Page Templates"
213
  msgstr "Skabeloner"
214
 
215
+ #: modules/post_type.php:22
216
  msgid "Post Types"
217
  msgstr "Indholdstyper"
218
 
219
+ #: modules/post_type.php:79 modules/taxonomy.php:108
220
+ msgid "No items."
221
+ msgstr "Ingen elementer."
222
+
223
+ #: modules/qtranslate.php:19 modules/transposh.php:19 modules/wpml.php:19
 
224
  msgid "Languages"
225
  msgstr "Sprog"
226
 
227
+ #: modules/static.php:21
228
  msgid "Static Pages"
229
  msgstr "Statiske sider"
230
 
231
+ #: modules/static.php:26
232
  msgid "Front Page"
233
  msgstr "Forside"
234
 
235
+ #: modules/static.php:27
236
  msgid "Search Results"
237
  msgstr "Søgeresultater"
238
 
239
+ #: modules/static.php:28
240
  msgid "404 Page"
241
  msgstr "404-side"
242
 
243
+ #: modules/taxonomy.php:24
244
  msgid "Taxonomies"
245
  msgstr "Taksonomier"
246
 
247
+ #: modules/taxonomy.php:105
248
+ msgid "Show with %s"
249
+ msgstr "Vis ved %s"
250
+
251
+ #: modules/taxonomy.php:113
252
+ msgid "Most Used"
253
+ msgstr "Mest brugte"
254
+
255
  #. Plugin Name of the plugin/theme
256
  msgid "Content Aware Sidebars"
257
  msgstr "Content Aware Sidebars"
258
 
259
+ #. #-#-#-#-# plugin.pot (Content Aware Sidebars 1.0) #-#-#-#-#
260
  #. Plugin URI of the plugin/theme
261
+ #. #-#-#-#-# plugin.pot (Content Aware Sidebars 1.0) #-#-#-#-#
262
  #. Author URI of the plugin/theme
263
  msgid "http://www.intox.dk/"
264
  msgstr "http://www.intox.dk/"
lang/content-aware-sidebars-it_IT.mo CHANGED
Binary file
lang/content-aware-sidebars-it_IT.po CHANGED
@@ -4,253 +4,264 @@ msgid ""
4
  msgstr ""
5
  "Project-Id-Version: Content Aware Sidebars 0.8.3\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/content-aware-sidebars\n"
7
- "POT-Creation-Date: 2012-05-30 22:56:32+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-05-31 13:35+0100\n"
12
- "Last-Translator: Luciano Del Fico <info@myweb2.it>\n"
13
- "Language-Team: MyWeb2 <info@myweb2.it>\n"
14
- "X-Poedit-Language: Italian\n"
15
- "X-Poedit-Country: ITALY\n"
16
  "X-Poedit-SourceCharset: utf-8\n"
 
17
 
18
- #: content-aware-sidebars.php:151
19
- #: content-aware-sidebars.php:329
20
  msgid "Exposure"
21
  msgstr "Tipologia"
22
 
23
- #: content-aware-sidebars.php:157
24
  msgid "Singular"
25
  msgstr "Singola"
26
 
27
- #: content-aware-sidebars.php:158
28
  msgid "Singular & Archive"
29
  msgstr "Singola e archivio"
30
 
31
- #: content-aware-sidebars.php:159
32
  msgid "Archive"
33
  msgstr "Archivio"
34
 
35
- #: content-aware-sidebars.php:163
36
- #: content-aware-sidebars.php:330
37
  msgctxt "option"
38
  msgid "Handle"
39
  msgstr "Comportamento"
40
 
41
- #: content-aware-sidebars.php:165
42
  msgid "Replace host sidebar, merge with it or add sidebar manually."
43
- msgstr "Sostituisce host sidebar, si fonde con essa o aggiunge la sidebar manualmente."
 
44
 
45
- #: content-aware-sidebars.php:169
46
  msgid "Replace"
47
  msgstr "Sostituzione"
48
 
49
- #: content-aware-sidebars.php:170
50
  msgid "Merge"
51
  msgstr "Unione"
52
 
53
- #: content-aware-sidebars.php:171
54
  msgid "Manual"
55
  msgstr "Manuale"
56
 
57
- #: content-aware-sidebars.php:175
58
  msgid "Host Sidebar"
59
- msgstr "Sidebar Host"
60
 
61
- #: content-aware-sidebars.php:183
62
- #: content-aware-sidebars.php:331
63
  msgid "Merge position"
64
  msgstr "Posizione"
65
 
66
- #: content-aware-sidebars.php:185
67
  msgid "Place sidebar on top or bottom of host when merging."
68
  msgstr "Posizione sidebar in alto o in basso dell'host durante la fusione."
69
 
70
- #: content-aware-sidebars.php:189
71
  msgid "Top"
72
  msgstr "Alto"
73
 
74
- #: content-aware-sidebars.php:190
75
  msgid "Bottom"
76
  msgstr "Basso"
77
 
78
- #: content-aware-sidebars.php:223
79
  msgid "Sidebars"
80
  msgstr "Sidebars"
81
 
82
- #: content-aware-sidebars.php:224
83
  msgid "Sidebar"
84
  msgstr "Sidebar"
85
 
86
- #: content-aware-sidebars.php:225
87
  msgctxt "sidebar"
88
  msgid "Add New"
89
  msgstr "Aggiungi"
90
 
91
- #: content-aware-sidebars.php:226
92
  msgid "Add New Sidebar"
93
  msgstr "Aggiungi Nuova Sidebar"
94
 
95
- #: content-aware-sidebars.php:227
96
  msgid "Edit Sidebar"
97
  msgstr "Modifica Sidebar"
98
 
99
- #: content-aware-sidebars.php:228
100
  msgid "New Sidebar"
101
  msgstr "Nuova Sidebar"
102
 
103
- #: content-aware-sidebars.php:229
104
  msgid "All Sidebars"
105
  msgstr "Tutte le Sidebars"
106
 
107
- #: content-aware-sidebars.php:230
108
  msgid "View Sidebar"
109
  msgstr "Vedi Sidebar"
110
 
111
- #: content-aware-sidebars.php:231
112
  msgid "Search Sidebars"
113
  msgstr "Cerca Sidebars"
114
 
115
- #: content-aware-sidebars.php:232
116
  msgid "No sidebars found"
117
  msgstr "Nessuna sidebar trovata"
118
 
119
- #: content-aware-sidebars.php:233
120
  msgid "No sidebars found in Trash"
121
  msgstr "nessuna sidebar cancellata"
122
 
123
- #: content-aware-sidebars.php:254
124
  msgid "Sidebar updated. <a href=\"%s\">Manage widgets</a>"
125
  msgstr "Sidebar aggiornata. <a href=\"%s\">Gestione widgets</a>"
126
 
127
- #: content-aware-sidebars.php:257
128
  msgid "Sidebar updated."
129
  msgstr "Sidebar aggiornata."
130
 
131
- #: content-aware-sidebars.php:259
132
  msgid "Sidebar published. <a href=\"%s\">Manage widgets</a>"
133
  msgstr "Sidebar publicata. <a href=\"%s\">Gestione widgets</a>"
134
 
135
- #: content-aware-sidebars.php:260
136
  msgid "Sidebar saved."
137
  msgstr "Sidebar salvata."
138
 
139
- #: content-aware-sidebars.php:261
140
  msgid "Sidebar submitted. <a href=\"%s\">Manage widgets</a>"
141
  msgstr "Sidebar inviata. <a href=\"%s\">Gestione widgets</a>"
142
 
143
- #: content-aware-sidebars.php:262
144
- msgid "Sidebar scheduled for: <strong>%1$s</strong>. <a href=\"%2$s\">Manage widgets</a>"
145
- msgstr "Sidebar posticipata per: <strong>%1$s</strong>. <a href=\"%2$s\">Gestione widgets</a>"
 
 
 
 
146
 
147
  #. translators: Publish box date format, see http:php.net/date
148
- #: content-aware-sidebars.php:264
149
  msgid "M j, Y @ G:i"
150
  msgstr "M j, Y @ G:i"
151
 
152
- #: content-aware-sidebars.php:265
153
  msgid "Sidebar draft updated."
154
  msgstr "Bozza sidebar aggiornata. "
155
 
156
- #: content-aware-sidebars.php:444
 
 
 
 
157
  msgid "Manage Widgets"
158
  msgstr "Gestione Widgets"
159
 
160
- #: content-aware-sidebars.php:572
161
  msgid "Words from the author"
162
  msgstr "Parole dell'autore"
163
 
164
- #: content-aware-sidebars.php:585
 
 
 
 
165
  msgid "Options"
166
  msgstr "Opzioni"
167
 
168
- #: content-aware-sidebars.php:679
169
  msgid "If you love this plugin, please consider donating."
170
  msgstr "Se ti piace questo plugin, considera l'eventualità fare una donazione."
171
 
172
- #: content-aware-sidebars.php:681
173
- msgid "Remember to <a class=\"button\" href=\"%1$s\" target=\"_blank\">rate</a> and <a class=\"button\" href=\"%2$s\" target=\"_blank\">share</a> it too!"
174
- msgstr "Ricorda di <a class=\"button\" href=\"%1$s\" target=\"_blank\">valutarlo</a> e <a class=\"button\" href=\"%2$s\" target=\"_blank\">condiverlo</a>!"
 
 
 
 
175
 
176
- #: content-aware-sidebars.php:683
177
  msgid "Check out Content Aware Sidebars for %23WordPress! :)"
178
  msgstr "Verifica Content Aware Sidebars per %23WordPress! :)"
179
 
180
- #: content-aware-sidebars.php:698
181
- #: content-aware-sidebars.php:750
182
- msgid "No items."
183
- msgstr "Nessun oggetto."
184
 
185
- #: content-aware-sidebars.php:704
186
- msgid "Most Used"
187
- msgstr "Più usati"
188
 
189
- #: content-aware-sidebars.php:705
190
- #: content-aware-sidebars.php:756
191
- #: content-aware-sidebars.php:781
192
  msgid "View All"
193
  msgstr "Vedi tutti"
194
 
195
- #: content-aware-sidebars.php:725
196
- msgid "Show with %s"
197
- msgstr "Mostra %s"
198
-
199
- #: content-aware-sidebars.php:769
200
- #: content-aware-sidebars.php:794
201
- msgid "Show with All %s"
202
- msgstr "Seleziona tutto: %s"
203
-
204
- #: modules/author.php:28
205
- #: modules/author.php:42
206
  msgid "Authors"
207
  msgstr "Autori"
208
 
209
- #: modules/page_template.php:17
210
- #: modules/page_template.php:30
 
 
 
211
  msgid "Page Templates"
212
  msgstr "Template Pagine"
213
 
214
- #: modules/post_type.php:30
215
  msgid "Post Types"
216
  msgstr "Tipi di messaggi"
217
 
218
- #: modules/qtranslate.php:27
219
- #: modules/qtranslate.php:39
220
- #: modules/transposh.php:27
221
- #: modules/transposh.php:39
222
- #: modules/wpml.php:26
223
- #: modules/wpml.php:38
224
  msgid "Languages"
225
  msgstr "Lingue"
226
 
227
- #: modules/static.php:15
228
  msgid "Static Pages"
229
  msgstr "Pagine statiche"
230
 
231
- #: modules/static.php:21
232
  msgid "Front Page"
233
  msgstr "Pagina principale"
234
 
235
- #: modules/static.php:22
236
  msgid "Search Results"
237
  msgstr "Risultati di ricerca"
238
 
239
- #: modules/static.php:23
240
  msgid "404 Page"
241
  msgstr "Pagina 404"
242
 
243
- #: modules/taxonomy.php:32
244
  msgid "Taxonomies"
245
  msgstr "Tassonomie"
246
 
 
 
 
 
 
 
 
 
247
  #. Plugin Name of the plugin/theme
248
  msgid "Content Aware Sidebars"
249
  msgstr "Content Aware Sidebars"
250
 
251
- #. #-#-#-#-# plugin.pot (Content Aware Sidebars 0.8.3) #-#-#-#-#
252
  #. Plugin URI of the plugin/theme
253
- #. #-#-#-#-# plugin.pot (Content Aware Sidebars 0.8.3) #-#-#-#-#
254
  #. Author URI of the plugin/theme
255
  msgid "http://www.intox.dk/"
256
  msgstr "http://www.intox.dk/"
@@ -262,4 +273,3 @@ msgstr "Gestisce e mostra sidebars a seconda del contenuto visualizzato."
262
  #. Author of the plugin/theme
263
  msgid "Joachim Jensen"
264
  msgstr "Joachim Jensen"
265
-
4
  msgstr ""
5
  "Project-Id-Version: Content Aware Sidebars 0.8.3\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/content-aware-sidebars\n"
7
+ "POT-Creation-Date: 2012-09-19 11:11:11+00:00\n"
8
+ "PO-Revision-Date: 2012-09-20 08:23+0100\n"
9
+ "Last-Translator: Luciano Del Fico <info@myweb2.it>\n"
10
+ "Language-Team: MyWeb2 <info@myweb2.it>\n"
11
+ "Language: it_IT\n"
12
  "MIME-Version: 1.0\n"
13
  "Content-Type: text/plain; charset=UTF-8\n"
14
  "Content-Transfer-Encoding: 8bit\n"
 
 
 
 
 
15
  "X-Poedit-SourceCharset: utf-8\n"
16
+ "X-Generator: Poedit 1.5.3\n"
17
 
18
+ #: content-aware-sidebars.php:145 content-aware-sidebars.php:308
 
19
  msgid "Exposure"
20
  msgstr "Tipologia"
21
 
22
+ #: content-aware-sidebars.php:151
23
  msgid "Singular"
24
  msgstr "Singola"
25
 
26
+ #: content-aware-sidebars.php:152
27
  msgid "Singular & Archive"
28
  msgstr "Singola e archivio"
29
 
30
+ #: content-aware-sidebars.php:153
31
  msgid "Archive"
32
  msgstr "Archivio"
33
 
34
+ #: content-aware-sidebars.php:157 content-aware-sidebars.php:309
 
35
  msgctxt "option"
36
  msgid "Handle"
37
  msgstr "Comportamento"
38
 
39
+ #: content-aware-sidebars.php:159
40
  msgid "Replace host sidebar, merge with it or add sidebar manually."
41
+ msgstr ""
42
+ "Sostituisce sidebar, si fonde con essa o aggiunge la sidebar manualmente."
43
 
44
+ #: content-aware-sidebars.php:163
45
  msgid "Replace"
46
  msgstr "Sostituzione"
47
 
48
+ #: content-aware-sidebars.php:164
49
  msgid "Merge"
50
  msgstr "Unione"
51
 
52
+ #: content-aware-sidebars.php:165
53
  msgid "Manual"
54
  msgstr "Manuale"
55
 
56
+ #: content-aware-sidebars.php:169
57
  msgid "Host Sidebar"
58
+ msgstr "Sidebar"
59
 
60
+ #: content-aware-sidebars.php:177 content-aware-sidebars.php:310
 
61
  msgid "Merge position"
62
  msgstr "Posizione"
63
 
64
+ #: content-aware-sidebars.php:179
65
  msgid "Place sidebar on top or bottom of host when merging."
66
  msgstr "Posizione sidebar in alto o in basso dell'host durante la fusione."
67
 
68
+ #: content-aware-sidebars.php:183
69
  msgid "Top"
70
  msgstr "Alto"
71
 
72
+ #: content-aware-sidebars.php:184
73
  msgid "Bottom"
74
  msgstr "Basso"
75
 
76
+ #: content-aware-sidebars.php:205
77
  msgid "Sidebars"
78
  msgstr "Sidebars"
79
 
80
+ #: content-aware-sidebars.php:206
81
  msgid "Sidebar"
82
  msgstr "Sidebar"
83
 
84
+ #: content-aware-sidebars.php:207
85
  msgctxt "sidebar"
86
  msgid "Add New"
87
  msgstr "Aggiungi"
88
 
89
+ #: content-aware-sidebars.php:208
90
  msgid "Add New Sidebar"
91
  msgstr "Aggiungi Nuova Sidebar"
92
 
93
+ #: content-aware-sidebars.php:209
94
  msgid "Edit Sidebar"
95
  msgstr "Modifica Sidebar"
96
 
97
+ #: content-aware-sidebars.php:210
98
  msgid "New Sidebar"
99
  msgstr "Nuova Sidebar"
100
 
101
+ #: content-aware-sidebars.php:211
102
  msgid "All Sidebars"
103
  msgstr "Tutte le Sidebars"
104
 
105
+ #: content-aware-sidebars.php:212
106
  msgid "View Sidebar"
107
  msgstr "Vedi Sidebar"
108
 
109
+ #: content-aware-sidebars.php:213
110
  msgid "Search Sidebars"
111
  msgstr "Cerca Sidebars"
112
 
113
+ #: content-aware-sidebars.php:214
114
  msgid "No sidebars found"
115
  msgstr "Nessuna sidebar trovata"
116
 
117
+ #: content-aware-sidebars.php:215
118
  msgid "No sidebars found in Trash"
119
  msgstr "nessuna sidebar cancellata"
120
 
121
+ #: content-aware-sidebars.php:239
122
  msgid "Sidebar updated. <a href=\"%s\">Manage widgets</a>"
123
  msgstr "Sidebar aggiornata. <a href=\"%s\">Gestione widgets</a>"
124
 
125
+ #: content-aware-sidebars.php:242
126
  msgid "Sidebar updated."
127
  msgstr "Sidebar aggiornata."
128
 
129
+ #: content-aware-sidebars.php:244
130
  msgid "Sidebar published. <a href=\"%s\">Manage widgets</a>"
131
  msgstr "Sidebar publicata. <a href=\"%s\">Gestione widgets</a>"
132
 
133
+ #: content-aware-sidebars.php:245
134
  msgid "Sidebar saved."
135
  msgstr "Sidebar salvata."
136
 
137
+ #: content-aware-sidebars.php:246
138
  msgid "Sidebar submitted. <a href=\"%s\">Manage widgets</a>"
139
  msgstr "Sidebar inviata. <a href=\"%s\">Gestione widgets</a>"
140
 
141
+ #: content-aware-sidebars.php:247
142
+ msgid ""
143
+ "Sidebar scheduled for: <strong>%1$s</strong>. <a href=\"%2$s\">Manage "
144
+ "widgets</a>"
145
+ msgstr ""
146
+ "Sidebar posticipata per: <strong>%1$s</strong>. <a href=\"%2$s\">Gestione "
147
+ "widgets</a>"
148
 
149
  #. translators: Publish box date format, see http:php.net/date
150
+ #: content-aware-sidebars.php:249
151
  msgid "M j, Y @ G:i"
152
  msgstr "M j, Y @ G:i"
153
 
154
+ #: content-aware-sidebars.php:250
155
  msgid "Sidebar draft updated."
156
  msgstr "Bozza sidebar aggiornata. "
157
 
158
+ #: content-aware-sidebars.php:372
159
+ msgid "Please update Host Sidebar"
160
+ msgstr "Aggiorna Sidebar"
161
+
162
+ #: content-aware-sidebars.php:435
163
  msgid "Manage Widgets"
164
  msgstr "Gestione Widgets"
165
 
166
+ #: content-aware-sidebars.php:569
167
  msgid "Words from the author"
168
  msgstr "Parole dell'autore"
169
 
170
+ #: content-aware-sidebars.php:579
171
+ msgid "Content"
172
+ msgstr "Contenuto"
173
+
174
+ #: content-aware-sidebars.php:589
175
  msgid "Options"
176
  msgstr "Opzioni"
177
 
178
+ #: content-aware-sidebars.php:685
179
  msgid "If you love this plugin, please consider donating."
180
  msgstr "Se ti piace questo plugin, considera l'eventualità fare una donazione."
181
 
182
+ #: content-aware-sidebars.php:687
183
+ msgid ""
184
+ "Remember to <a class=\"button\" href=\"%1$s\" target=\"_blank\">rate</a> and "
185
+ "<a class=\"button\" href=\"%2$s\" target=\"_blank\">share</a> it too!"
186
+ msgstr ""
187
+ "Ricorda di <a class=\"button\" href=\"%1$s\" target=\"_blank\">valutarlo</"
188
+ "a> e <a class=\"button\" href=\"%2$s\" target=\"_blank\">condiverlo</a>!"
189
 
190
+ #: content-aware-sidebars.php:689
191
  msgid "Check out Content Aware Sidebars for %23WordPress! :)"
192
  msgstr "Verifica Content Aware Sidebars per %23WordPress! :)"
193
 
194
+ #: content-aware-sidebars.php:691
195
+ msgid "Check out Content Aware Sidebars :)"
196
+ msgstr "Verifica Content Aware Sidebars per WordPress! :)"
 
197
 
198
+ #: modules/abstract.php:43 modules/post_type.php:75
199
+ msgid "Show with All %s"
200
+ msgstr "Seleziona tutto: %s"
201
 
202
+ #: modules/abstract.php:47 modules/post_type.php:85 modules/taxonomy.php:114
 
 
203
  msgid "View All"
204
  msgstr "Vedi tutti"
205
 
206
+ #: modules/author.php:20
 
 
 
 
 
 
 
 
 
 
207
  msgid "Authors"
208
  msgstr "Autori"
209
 
210
+ #: modules/bbpress.php:19
211
+ msgid "bbPress"
212
+ msgstr "bbPress"
213
+
214
+ #: modules/page_template.php:20
215
  msgid "Page Templates"
216
  msgstr "Template Pagine"
217
 
218
+ #: modules/post_type.php:22
219
  msgid "Post Types"
220
  msgstr "Tipi di messaggi"
221
 
222
+ #: modules/post_type.php:79 modules/taxonomy.php:108
223
+ msgid "No items."
224
+ msgstr "Nessun oggetto."
225
+
226
+ #: modules/qtranslate.php:19 modules/transposh.php:19 modules/wpml.php:19
 
227
  msgid "Languages"
228
  msgstr "Lingue"
229
 
230
+ #: modules/static.php:21
231
  msgid "Static Pages"
232
  msgstr "Pagine statiche"
233
 
234
+ #: modules/static.php:26
235
  msgid "Front Page"
236
  msgstr "Pagina principale"
237
 
238
+ #: modules/static.php:27
239
  msgid "Search Results"
240
  msgstr "Risultati di ricerca"
241
 
242
+ #: modules/static.php:28
243
  msgid "404 Page"
244
  msgstr "Pagina 404"
245
 
246
+ #: modules/taxonomy.php:24
247
  msgid "Taxonomies"
248
  msgstr "Tassonomie"
249
 
250
+ #: modules/taxonomy.php:105
251
+ msgid "Show with %s"
252
+ msgstr "Mostra %s"
253
+
254
+ #: modules/taxonomy.php:113
255
+ msgid "Most Used"
256
+ msgstr "Più usati"
257
+
258
  #. Plugin Name of the plugin/theme
259
  msgid "Content Aware Sidebars"
260
  msgstr "Content Aware Sidebars"
261
 
262
+ #. #-#-#-#-# plugin.pot (Content Aware Sidebars 1.0) #-#-#-#-#
263
  #. Plugin URI of the plugin/theme
264
+ #. #-#-#-#-# plugin.pot (Content Aware Sidebars 1.0) #-#-#-#-#
265
  #. Author URI of the plugin/theme
266
  msgid "http://www.intox.dk/"
267
  msgstr "http://www.intox.dk/"
273
  #. Author of the plugin/theme
274
  msgid "Joachim Jensen"
275
  msgstr "Joachim Jensen"
 
lang/content-aware-sidebars.pot CHANGED
@@ -2,9 +2,9 @@
2
  # This file is distributed under the same license as the Content Aware Sidebars package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Content Aware Sidebars 0.8.3\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/content-aware-sidebars\n"
7
- "POT-Creation-Date: 2012-05-30 22:56:32+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -12,235 +12,248 @@ msgstr ""
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
  "Language-Team: LANGUAGE <LL@li.org>\n"
14
 
15
- #: content-aware-sidebars.php:151 content-aware-sidebars.php:329
16
  msgid "Exposure"
17
  msgstr ""
18
 
19
- #: content-aware-sidebars.php:157
20
  msgid "Singular"
21
  msgstr ""
22
 
23
- #: content-aware-sidebars.php:158
24
  msgid "Singular & Archive"
25
  msgstr ""
26
 
27
- #: content-aware-sidebars.php:159
28
  msgid "Archive"
29
  msgstr ""
30
 
31
- #: content-aware-sidebars.php:163 content-aware-sidebars.php:330
32
  msgctxt "option"
33
  msgid "Handle"
34
  msgstr ""
35
 
36
- #: content-aware-sidebars.php:165
37
  msgid "Replace host sidebar, merge with it or add sidebar manually."
38
  msgstr ""
39
 
40
- #: content-aware-sidebars.php:169
41
  msgid "Replace"
42
  msgstr ""
43
 
44
- #: content-aware-sidebars.php:170
45
  msgid "Merge"
46
  msgstr ""
47
 
48
- #: content-aware-sidebars.php:171
49
  msgid "Manual"
50
  msgstr ""
51
 
52
- #: content-aware-sidebars.php:175
53
  msgid "Host Sidebar"
54
  msgstr ""
55
 
56
- #: content-aware-sidebars.php:183 content-aware-sidebars.php:331
57
  msgid "Merge position"
58
  msgstr ""
59
 
60
- #: content-aware-sidebars.php:185
61
  msgid "Place sidebar on top or bottom of host when merging."
62
  msgstr ""
63
 
64
- #: content-aware-sidebars.php:189
65
  msgid "Top"
66
  msgstr ""
67
 
68
- #: content-aware-sidebars.php:190
69
  msgid "Bottom"
70
  msgstr ""
71
 
72
- #: content-aware-sidebars.php:223
73
  msgid "Sidebars"
74
  msgstr ""
75
 
76
- #: content-aware-sidebars.php:224
77
  msgid "Sidebar"
78
  msgstr ""
79
 
80
- #: content-aware-sidebars.php:225
81
  msgctxt "sidebar"
82
  msgid "Add New"
83
  msgstr ""
84
 
85
- #: content-aware-sidebars.php:226
86
  msgid "Add New Sidebar"
87
  msgstr ""
88
 
89
- #: content-aware-sidebars.php:227
90
  msgid "Edit Sidebar"
91
  msgstr ""
92
 
93
- #: content-aware-sidebars.php:228
94
  msgid "New Sidebar"
95
  msgstr ""
96
 
97
- #: content-aware-sidebars.php:229
98
  msgid "All Sidebars"
99
  msgstr ""
100
 
101
- #: content-aware-sidebars.php:230
102
  msgid "View Sidebar"
103
  msgstr ""
104
 
105
- #: content-aware-sidebars.php:231
106
  msgid "Search Sidebars"
107
  msgstr ""
108
 
109
- #: content-aware-sidebars.php:232
110
  msgid "No sidebars found"
111
  msgstr ""
112
 
113
- #: content-aware-sidebars.php:233
114
  msgid "No sidebars found in Trash"
115
  msgstr ""
116
 
117
- #: content-aware-sidebars.php:254
118
  msgid "Sidebar updated. <a href=\"%s\">Manage widgets</a>"
119
  msgstr ""
120
 
121
- #: content-aware-sidebars.php:257
122
  msgid "Sidebar updated."
123
  msgstr ""
124
 
125
- #: content-aware-sidebars.php:259
126
  msgid "Sidebar published. <a href=\"%s\">Manage widgets</a>"
127
  msgstr ""
128
 
129
- #: content-aware-sidebars.php:260
130
  msgid "Sidebar saved."
131
  msgstr ""
132
 
133
- #: content-aware-sidebars.php:261
134
  msgid "Sidebar submitted. <a href=\"%s\">Manage widgets</a>"
135
  msgstr ""
136
 
137
- #: content-aware-sidebars.php:262
138
  msgid ""
139
  "Sidebar scheduled for: <strong>%1$s</strong>. <a href=\"%2$s\">Manage "
140
  "widgets</a>"
141
  msgstr ""
142
 
143
  #. translators: Publish box date format, see http:php.net/date
144
- #: content-aware-sidebars.php:264
145
  msgid "M j, Y @ G:i"
146
  msgstr ""
147
 
148
- #: content-aware-sidebars.php:265
149
  msgid "Sidebar draft updated."
150
  msgstr ""
151
 
152
- #: content-aware-sidebars.php:444
 
 
 
 
153
  msgid "Manage Widgets"
154
  msgstr ""
155
 
156
- #: content-aware-sidebars.php:572
157
  msgid "Words from the author"
158
  msgstr ""
159
 
160
- #: content-aware-sidebars.php:585
 
 
 
 
161
  msgid "Options"
162
  msgstr ""
163
 
164
- #: content-aware-sidebars.php:679
165
  msgid "If you love this plugin, please consider donating."
166
  msgstr ""
167
 
168
- #: content-aware-sidebars.php:681
169
  msgid ""
170
  "Remember to <a class=\"button\" href=\"%1$s\" target=\"_blank\">rate</a> and "
171
  "<a class=\"button\" href=\"%2$s\" target=\"_blank\">share</a> it too!"
172
  msgstr ""
173
 
174
- #: content-aware-sidebars.php:683
175
  msgid "Check out Content Aware Sidebars for %23WordPress! :)"
176
  msgstr ""
177
 
178
- #: content-aware-sidebars.php:698 content-aware-sidebars.php:750
179
- msgid "No items."
180
  msgstr ""
181
 
182
- #: content-aware-sidebars.php:704
183
- msgid "Most Used"
184
  msgstr ""
185
 
186
- #: content-aware-sidebars.php:705 content-aware-sidebars.php:756
187
- #: content-aware-sidebars.php:781
188
  msgid "View All"
189
  msgstr ""
190
 
191
- #: content-aware-sidebars.php:725
192
- msgid "Show with %s"
193
- msgstr ""
194
-
195
- #: content-aware-sidebars.php:769 content-aware-sidebars.php:794
196
- msgid "Show with All %s"
197
  msgstr ""
198
 
199
- #: modules/author.php:28 modules/author.php:42
200
- msgid "Authors"
201
  msgstr ""
202
 
203
- #: modules/page_template.php:17 modules/page_template.php:30
204
  msgid "Page Templates"
205
  msgstr ""
206
 
207
- #: modules/post_type.php:30
208
  msgid "Post Types"
209
  msgstr ""
210
 
211
- #: modules/qtranslate.php:27 modules/qtranslate.php:39
212
- #: modules/transposh.php:27 modules/transposh.php:39 modules/wpml.php:26
213
- #: modules/wpml.php:38
 
 
214
  msgid "Languages"
215
  msgstr ""
216
 
217
- #: modules/static.php:15
218
  msgid "Static Pages"
219
  msgstr ""
220
 
221
- #: modules/static.php:21
222
  msgid "Front Page"
223
  msgstr ""
224
 
225
- #: modules/static.php:22
226
  msgid "Search Results"
227
  msgstr ""
228
 
229
- #: modules/static.php:23
230
  msgid "404 Page"
231
  msgstr ""
232
 
233
- #: modules/taxonomy.php:32
234
  msgid "Taxonomies"
235
  msgstr ""
236
 
 
 
 
 
 
 
 
 
237
  #. Plugin Name of the plugin/theme
238
  msgid "Content Aware Sidebars"
239
  msgstr ""
240
 
241
- #. #-#-#-#-# plugin.pot (Content Aware Sidebars 0.8.3) #-#-#-#-#
242
  #. Plugin URI of the plugin/theme
243
- #. #-#-#-#-# plugin.pot (Content Aware Sidebars 0.8.3) #-#-#-#-#
244
  #. Author URI of the plugin/theme
245
  msgid "http://www.intox.dk/"
246
  msgstr ""
2
  # This file is distributed under the same license as the Content Aware Sidebars package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Content Aware Sidebars 1.0\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/content-aware-sidebars\n"
7
+ "POT-Creation-Date: 2012-09-19 11:11:11+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
  "Language-Team: LANGUAGE <LL@li.org>\n"
14
 
15
+ #: content-aware-sidebars.php:145 content-aware-sidebars.php:308
16
  msgid "Exposure"
17
  msgstr ""
18
 
19
+ #: content-aware-sidebars.php:151
20
  msgid "Singular"
21
  msgstr ""
22
 
23
+ #: content-aware-sidebars.php:152
24
  msgid "Singular & Archive"
25
  msgstr ""
26
 
27
+ #: content-aware-sidebars.php:153
28
  msgid "Archive"
29
  msgstr ""
30
 
31
+ #: content-aware-sidebars.php:157 content-aware-sidebars.php:309
32
  msgctxt "option"
33
  msgid "Handle"
34
  msgstr ""
35
 
36
+ #: content-aware-sidebars.php:159
37
  msgid "Replace host sidebar, merge with it or add sidebar manually."
38
  msgstr ""
39
 
40
+ #: content-aware-sidebars.php:163
41
  msgid "Replace"
42
  msgstr ""
43
 
44
+ #: content-aware-sidebars.php:164
45
  msgid "Merge"
46
  msgstr ""
47
 
48
+ #: content-aware-sidebars.php:165
49
  msgid "Manual"
50
  msgstr ""
51
 
52
+ #: content-aware-sidebars.php:169
53
  msgid "Host Sidebar"
54
  msgstr ""
55
 
56
+ #: content-aware-sidebars.php:177 content-aware-sidebars.php:310
57
  msgid "Merge position"
58
  msgstr ""
59
 
60
+ #: content-aware-sidebars.php:179
61
  msgid "Place sidebar on top or bottom of host when merging."
62
  msgstr ""
63
 
64
+ #: content-aware-sidebars.php:183
65
  msgid "Top"
66
  msgstr ""
67
 
68
+ #: content-aware-sidebars.php:184
69
  msgid "Bottom"
70
  msgstr ""
71
 
72
+ #: content-aware-sidebars.php:205
73
  msgid "Sidebars"
74
  msgstr ""
75
 
76
+ #: content-aware-sidebars.php:206
77
  msgid "Sidebar"
78
  msgstr ""
79
 
80
+ #: content-aware-sidebars.php:207
81
  msgctxt "sidebar"
82
  msgid "Add New"
83
  msgstr ""
84
 
85
+ #: content-aware-sidebars.php:208
86
  msgid "Add New Sidebar"
87
  msgstr ""
88
 
89
+ #: content-aware-sidebars.php:209
90
  msgid "Edit Sidebar"
91
  msgstr ""
92
 
93
+ #: content-aware-sidebars.php:210
94
  msgid "New Sidebar"
95
  msgstr ""
96
 
97
+ #: content-aware-sidebars.php:211
98
  msgid "All Sidebars"
99
  msgstr ""
100
 
101
+ #: content-aware-sidebars.php:212
102
  msgid "View Sidebar"
103
  msgstr ""
104
 
105
+ #: content-aware-sidebars.php:213
106
  msgid "Search Sidebars"
107
  msgstr ""
108
 
109
+ #: content-aware-sidebars.php:214
110
  msgid "No sidebars found"
111
  msgstr ""
112
 
113
+ #: content-aware-sidebars.php:215
114
  msgid "No sidebars found in Trash"
115
  msgstr ""
116
 
117
+ #: content-aware-sidebars.php:239
118
  msgid "Sidebar updated. <a href=\"%s\">Manage widgets</a>"
119
  msgstr ""
120
 
121
+ #: content-aware-sidebars.php:242
122
  msgid "Sidebar updated."
123
  msgstr ""
124
 
125
+ #: content-aware-sidebars.php:244
126
  msgid "Sidebar published. <a href=\"%s\">Manage widgets</a>"
127
  msgstr ""
128
 
129
+ #: content-aware-sidebars.php:245
130
  msgid "Sidebar saved."
131
  msgstr ""
132
 
133
+ #: content-aware-sidebars.php:246
134
  msgid "Sidebar submitted. <a href=\"%s\">Manage widgets</a>"
135
  msgstr ""
136
 
137
+ #: content-aware-sidebars.php:247
138
  msgid ""
139
  "Sidebar scheduled for: <strong>%1$s</strong>. <a href=\"%2$s\">Manage "
140
  "widgets</a>"
141
  msgstr ""
142
 
143
  #. translators: Publish box date format, see http:php.net/date
144
+ #: content-aware-sidebars.php:249
145
  msgid "M j, Y @ G:i"
146
  msgstr ""
147
 
148
+ #: content-aware-sidebars.php:250
149
  msgid "Sidebar draft updated."
150
  msgstr ""
151
 
152
+ #: content-aware-sidebars.php:372
153
+ msgid "Please update Host Sidebar"
154
+ msgstr ""
155
+
156
+ #: content-aware-sidebars.php:435
157
  msgid "Manage Widgets"
158
  msgstr ""
159
 
160
+ #: content-aware-sidebars.php:569
161
  msgid "Words from the author"
162
  msgstr ""
163
 
164
+ #: content-aware-sidebars.php:579
165
+ msgid "Content"
166
+ msgstr ""
167
+
168
+ #: content-aware-sidebars.php:589
169
  msgid "Options"
170
  msgstr ""
171
 
172
+ #: content-aware-sidebars.php:685
173
  msgid "If you love this plugin, please consider donating."
174
  msgstr ""
175
 
176
+ #: content-aware-sidebars.php:687
177
  msgid ""
178
  "Remember to <a class=\"button\" href=\"%1$s\" target=\"_blank\">rate</a> and "
179
  "<a class=\"button\" href=\"%2$s\" target=\"_blank\">share</a> it too!"
180
  msgstr ""
181
 
182
+ #: content-aware-sidebars.php:689
183
  msgid "Check out Content Aware Sidebars for %23WordPress! :)"
184
  msgstr ""
185
 
186
+ #: content-aware-sidebars.php:691
187
+ msgid "Check out Content Aware Sidebars :)"
188
  msgstr ""
189
 
190
+ #: modules/abstract.php:43 modules/post_type.php:75
191
+ msgid "Show with All %s"
192
  msgstr ""
193
 
194
+ #: modules/abstract.php:47 modules/post_type.php:85 modules/taxonomy.php:114
 
195
  msgid "View All"
196
  msgstr ""
197
 
198
+ #: modules/author.php:20
199
+ msgid "Authors"
 
 
 
 
200
  msgstr ""
201
 
202
+ #: modules/bbpress.php:19
203
+ msgid "bbPress"
204
  msgstr ""
205
 
206
+ #: modules/page_template.php:20
207
  msgid "Page Templates"
208
  msgstr ""
209
 
210
+ #: modules/post_type.php:22
211
  msgid "Post Types"
212
  msgstr ""
213
 
214
+ #: modules/post_type.php:79 modules/taxonomy.php:108
215
+ msgid "No items."
216
+ msgstr ""
217
+
218
+ #: modules/qtranslate.php:19 modules/transposh.php:19 modules/wpml.php:19
219
  msgid "Languages"
220
  msgstr ""
221
 
222
+ #: modules/static.php:21
223
  msgid "Static Pages"
224
  msgstr ""
225
 
226
+ #: modules/static.php:26
227
  msgid "Front Page"
228
  msgstr ""
229
 
230
+ #: modules/static.php:27
231
  msgid "Search Results"
232
  msgstr ""
233
 
234
+ #: modules/static.php:28
235
  msgid "404 Page"
236
  msgstr ""
237
 
238
+ #: modules/taxonomy.php:24
239
  msgid "Taxonomies"
240
  msgstr ""
241
 
242
+ #: modules/taxonomy.php:105
243
+ msgid "Show with %s"
244
+ msgstr ""
245
+
246
+ #: modules/taxonomy.php:113
247
+ msgid "Most Used"
248
+ msgstr ""
249
+
250
  #. Plugin Name of the plugin/theme
251
  msgid "Content Aware Sidebars"
252
  msgstr ""
253
 
254
+ #. #-#-#-#-# plugin.pot (Content Aware Sidebars 1.0) #-#-#-#-#
255
  #. Plugin URI of the plugin/theme
256
+ #. #-#-#-#-# plugin.pot (Content Aware Sidebars 1.0) #-#-#-#-#
257
  #. Author URI of the plugin/theme
258
  msgid "http://www.intox.dk/"
259
  msgstr ""
modules/abstract.php CHANGED
@@ -1,6 +1,7 @@
1
  <?php
2
  /**
3
  * @package Content Aware Sidebars
 
4
  */
5
 
6
  /**
@@ -11,6 +12,7 @@
11
  abstract class CASModule {
12
 
13
  protected $id;
 
14
 
15
  /**
16
  *
@@ -18,37 +20,45 @@ abstract class CASModule {
18
  *
19
  */
20
  public function __construct() {
21
- if(!isset($this->id))
22
- $this->id = substr(get_class($this),strpos(get_class($this),'_')+1);
23
-
24
- add_filter('cas_metadata', array(&$this,'metadata'));
25
- add_action('cas_admin_gui', array(&$this,'admin_gui'));
26
- add_action('cas_sidebar_db', array(&$this,'init_content'));
27
-
28
- }
29
-
30
- public function get_id() {
31
- return $this->id;
32
  }
33
 
34
- /**
35
- *
36
- * Add hooks to plugin
37
- *
38
- */
39
- public function init_content() {
40
 
41
- if($this->is_content()) {
42
- add_filter('cas_sidebar_db_join', array(&$this,'db_join'),10,2);
43
- add_filter('cas_sidebar_db_where', array(&$this,'db_where'));
44
- add_filter('cas_sidebar_db_where2', array(&$this,'db_where2'));
45
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
  }
47
 
48
- public function db_join($join, $prefix) {
49
  global $wpdb;
50
- $join[$this->id] = "LEFT JOIN $wpdb->postmeta {$this->id} ON {$this->id}.post_id = posts.ID AND {$this->id}.meta_key = '".$prefix.$this->id."' ";
51
- return $join;
52
  }
53
 
54
  public function exclude_sidebar($continue, $post, $prefix) {
@@ -63,14 +73,16 @@ abstract class CASModule {
63
 
64
  }
65
 
66
- public function db_where2($where) {
67
- $where[$this->id] = "{$this->id}.meta_value IS NOT NULL";
68
- return $where;
 
 
 
69
  }
70
 
71
- abstract public function admin_gui($class);
72
- abstract public function metadata($metadata);
73
  abstract public function is_content();
74
- abstract public function db_where($where);
75
 
76
  }
1
  <?php
2
  /**
3
  * @package Content Aware Sidebars
4
+ * @author Joachim Jensen <jv@intox.dk>
5
  */
6
 
7
  /**
12
  abstract class CASModule {
13
 
14
  protected $id;
15
+ protected $name;
16
 
17
  /**
18
  *
20
  *
21
  */
22
  public function __construct() {
23
+ $this->id = substr(get_class($this),strpos(get_class($this),'_')+1);
 
 
 
 
 
 
 
 
 
 
24
  }
25
 
26
+ public function meta_box_content() {
27
+ global $post;
 
 
 
 
28
 
29
+ if(!$this->_get_content())
30
+ return;
31
+
32
+ echo '<h4><a href="#">'.$this->name.'</a></h4>'."\n";
33
+ echo '<div class="cas-rule-content" id="cas-'.$this->id.'">';
34
+ $field = $this->id;
35
+ $meta = get_post_meta($post->ID, ContentAwareSidebars::prefix.$field, false);
36
+ $current = $meta != '' ? $meta : array();
37
+ ?>
38
+ <p>
39
+ <label><input class="cas-chk-all" type="checkbox" name="<?php echo $field; ?>[]" value="<?php echo $field; ?>" <?php checked(in_array($field, $current), true, true); ?> /> <?php printf(__('Show with All %s','content-aware-sidebars'),$this->name); ?></label>
40
+ </p>
41
+ <div id="list-<?php echo $field; ?>" class="categorydiv" style="min-height:100%;">
42
+ <ul id="<?php echo $field; ?>-tabs" class="category-tabs">
43
+ <li class="tabs"><a href="#<?php echo $field; ?>-all" tabindex="3"><?php _e('View All'); ?></a></li>
44
+ </ul>
45
+ <div id="<?php echo $field; ?>-all" class="tabs-panel" style="min-height:100%;">
46
+ <ul id="authorlistchecklist" class="list:<?php echo $field; ?> categorychecklist form-no-clear">
47
+ <?php
48
+ foreach($this->_get_content() as $id => $name) {
49
+ echo '<li><label><input class="cas-' . $this->id . '" type="checkbox" name="'.$field.'[]" value="'.$id.'"'.checked(in_array($id,$current), true, false).' /> '.$name.'</label></li>'."\n";
50
+ }
51
+ ?>
52
+ </ul>
53
+ </div>
54
+ </div>
55
+ <?php
56
+ echo '</div>';
57
  }
58
 
59
+ public function db_join() {
60
  global $wpdb;
61
+ return "LEFT JOIN $wpdb->postmeta {$this->id} ON {$this->id}.post_id = posts.ID AND {$this->id}.meta_key = '".ContentAwareSidebars::prefix.$this->id."' ";
 
62
  }
63
 
64
  public function exclude_sidebar($continue, $post, $prefix) {
73
 
74
  }
75
 
76
+ public function db_where2() {
77
+ return "{$this->id}.meta_value IS NOT NULL";
78
+ }
79
+
80
+ public function get_id() {
81
+ return $this->id;
82
  }
83
 
84
+ abstract protected function _get_content();
 
85
  abstract public function is_content();
86
+ abstract public function db_where();
87
 
88
  }
modules/author.php CHANGED
@@ -1,6 +1,7 @@
1
  <?php
2
  /**
3
  * @package Content Aware Sidebars
 
4
  */
5
 
6
  /**
@@ -14,50 +15,30 @@
14
  */
15
  class CASModule_author extends CASModule {
16
 
17
- protected $id = 'authors';
18
-
19
- public function metadata($metadata) {
20
- global $wpdb;
21
-
22
- $author_list = array();
23
- foreach($wpdb->get_results("SELECT ID, display_name FROM $wpdb->users ORDER BY ID ASC") as $user) {
24
- $author_list[$user->ID] = $user->display_name;
25
- }
26
-
27
- $metadata[$this->id] = array(
28
- 'name' => __('Authors', 'content-aware-sidebars'),
29
- 'id' => $this->id,
30
- 'desc' => '',
31
- 'val' => array(),
32
- 'type' => 'checkbox',
33
- 'list' => $author_list
34
- );
35
- return $metadata;
36
-
37
- }
38
-
39
- public function admin_gui($class) {
40
- add_meta_box(
41
- 'ca-sidebar-authors',
42
- __('Authors', 'content-aware-sidebars'),
43
- array(&$class,'meta_box_checkboxes'),
44
- 'sidebar',
45
- 'side',
46
- 'default',
47
- $this->id
48
- );
49
  }
50
 
51
  public function is_content() {
52
  return (is_singular() && !is_front_page()) || is_author();
53
  }
54
 
55
- public function db_where($where) {
56
  global $post;
57
  $author = (string)(is_singular() ? $post->post_author : get_query_var('author'));
58
- $where[$this->id] = "(authors.meta_value IS NULL OR (authors.meta_value LIKE '%authors%' OR authors.meta_value LIKE '%".serialize($author)."%'))";
59
- return $where;
60
 
61
  }
 
 
 
 
 
 
 
 
 
62
 
63
  }
1
  <?php
2
  /**
3
  * @package Content Aware Sidebars
4
+ * @author Joachim Jensen <jv@intox.dk>
5
  */
6
 
7
  /**
15
  */
16
  class CASModule_author extends CASModule {
17
 
18
+ public function __construct() {
19
+ parent::__construct();
20
+ $this->id = 'authors';
21
+ $this->name = __('Authors','content-aware-sidebars');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
  }
23
 
24
  public function is_content() {
25
  return (is_singular() && !is_front_page()) || is_author();
26
  }
27
 
28
+ public function db_where() {
29
  global $post;
30
  $author = (string)(is_singular() ? $post->post_author : get_query_var('author'));
31
+ return "(authors.meta_value IS NULL OR authors.meta_value IN('authors','".$author."'))";
 
32
 
33
  }
34
+
35
+ public function _get_content() {
36
+ global $wpdb;
37
+ $author_list = array();
38
+ foreach($wpdb->get_results("SELECT ID, display_name FROM $wpdb->users ORDER BY ID ASC LIMIT 0,200") as $user) {
39
+ $author_list[$user->ID] = $user->display_name;
40
+ }
41
+ return $author_list;
42
+ }
43
 
44
  }
modules/bbpress.php CHANGED
@@ -1,6 +1,7 @@
1
  <?php
2
  /**
3
  * @package Content Aware Sidebars
 
4
  */
5
 
6
  /**
@@ -13,24 +14,31 @@
13
  */
14
  class CASModule_bbpress extends CASModule {
15
 
16
- protected $id = 'authors';
17
-
18
- public function metadata($metadata) {
19
- return $metadata;
20
- }
21
-
22
- public function admin_gui($class) {
23
 
 
24
  }
25
 
26
  public function is_content() {
27
  return bbp_is_single_user();
28
  }
29
 
30
- public function db_where($where) {
31
- $where[$this->id] = "(authors.meta_value LIKE '%authors%' OR authors.meta_value LIKE '%".serialize((string)bbp_get_displayed_user_id())."%')";
 
 
 
 
 
 
 
 
 
 
32
  return $where;
33
-
34
  }
35
 
36
  }
1
  <?php
2
  /**
3
  * @package Content Aware Sidebars
4
+ * @author Joachim Jensen <jv@intox.dk>
5
  */
6
 
7
  /**
14
  */
15
  class CASModule_bbpress extends CASModule {
16
 
17
+ public function __construct() {
18
+ parent::__construct();
19
+ $this->id = 'authors';
20
+ $this->name = __('bbPress','content-aware-sidebars');
 
 
 
21
 
22
+ add_filter('cas-db-where-post_types', array(&$this,'add_forum_dependency'));
23
  }
24
 
25
  public function is_content() {
26
  return bbp_is_single_user();
27
  }
28
 
29
+ public function db_where() {
30
+ return "(authors.meta_value = 'authors' OR authors.meta_value = '".bbp_get_displayed_user_id()."')";
31
+ }
32
+
33
+ public function _get_content() {
34
+ return 0;
35
+ }
36
+
37
+ public function add_forum_dependency($where) {
38
+ if(is_singular(array('topic','reply'))) {
39
+ $where = "(post_types.meta_value IS NULL OR post_types.meta_value IN('".get_post_type()."','".get_the_ID()."','".bbp_get_forum_id()."','forum'))";
40
+ }
41
  return $where;
 
42
  }
43
 
44
  }
modules/page_template.php CHANGED
@@ -1,6 +1,7 @@
1
  <?php
2
  /**
3
  * @package Content Aware Sidebars
 
4
  */
5
 
6
  /**
@@ -14,30 +15,10 @@
14
  */
15
  class CASModule_page_template extends CASModule {
16
 
17
- protected $id = 'page_templates';
18
-
19
- public function metadata($metadata) {
20
- $metadata['page_templates'] = array(
21
- 'name' => __('Page Templates', 'content-aware-sidebars'),
22
- 'id' => 'page_templates',
23
- 'desc' => '',
24
- 'val' => array(),
25
- 'type' => 'checkbox',
26
- 'list' => array_flip(get_page_templates())
27
- );
28
- return $metadata;
29
- }
30
-
31
- public function admin_gui($class) {
32
- add_meta_box(
33
- 'ca-sidebar-page_templates',
34
- __('Page Templates', 'content-aware-sidebars'),
35
- array(&$class,'meta_box_checkboxes'),
36
- 'sidebar',
37
- 'side',
38
- 'default',
39
- 'page_templates'
40
- );
41
  }
42
 
43
  public function is_content() {
@@ -50,10 +31,13 @@ class CASModule_page_template extends CASModule {
50
  return false;
51
  }
52
 
53
- public function db_where($where) {
54
  $template = get_post_meta(get_the_ID(),'_wp_page_template',true);
55
- $where[$this->id] = "(page_templates.meta_value IS NULL OR (page_templates.meta_value LIKE '%page_templates%' OR page_templates.meta_value LIKE '%".$template."%'))";
56
- return $where;
 
 
 
57
  }
58
 
59
  }
1
  <?php
2
  /**
3
  * @package Content Aware Sidebars
4
+ * @author Joachim Jensen <jv@intox.dk>
5
  */
6
 
7
  /**
15
  */
16
  class CASModule_page_template extends CASModule {
17
 
18
+ public function __construct() {
19
+ parent::__construct();
20
+ $this->id = 'page_templates';
21
+ $this->name = __('Page Templates','content-aware-sidebars');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
  }
23
 
24
  public function is_content() {
31
  return false;
32
  }
33
 
34
+ public function db_where() {
35
  $template = get_post_meta(get_the_ID(),'_wp_page_template',true);
36
+ return "(page_templates.meta_value IS NULL OR page_templates.meta_value IN('page_templates','".$template."'))";
37
+ }
38
+
39
+ public function _get_content() {
40
+ return array_flip(get_page_templates());
41
  }
42
 
43
  }
modules/post_type.php CHANGED
@@ -1,6 +1,7 @@
1
  <?php
2
  /**
3
  * @package Content Aware Sidebars
 
4
  */
5
 
6
  /**
@@ -14,59 +15,91 @@
14
  */
15
  class CASModule_post_type extends CASModule {
16
 
17
- protected $id = 'post_types';
18
- private $post_types;
19
  private $post_type_objects;
20
 
21
- public function metadata($metadata) {
22
-
23
- // List public post types
24
- foreach(get_post_types(array('public'=>true),'objects') as $post_type) {
25
- $this->post_types[$post_type->name] = $post_type->label;
26
- $this->post_type_objects[$post_type->name] = $post_type;
27
- }
28
-
29
- $metadata['post_types'] = array(
30
- 'name' => __('Post Types', 'content-aware-sidebars'),
31
- 'id' => 'post_types',
32
- 'desc' => '',
33
- 'val' => array(),
34
- 'type' => 'checkbox',
35
- 'list' => $this->post_types
36
- );
37
- return $metadata;
38
-
39
  }
40
 
41
- public function admin_gui($class) {
42
- foreach($this->post_type_objects as $post_type) {
43
- add_meta_box(
44
- 'ca-sidebar-post-type-'.$post_type->name,
45
- $post_type->label,
46
- array(&$class,'meta_box_post_type'),
47
- 'sidebar',
48
- 'normal',
49
- 'high',
50
- $post_type
51
- );
52
- }
53
  }
54
 
55
  public function is_content() {
56
  return ((is_singular() || is_home()) && !is_front_page()) || is_post_type_archive();
57
  }
58
 
59
- public function db_where($where) {
60
  if(is_singular()) {
61
- $where[$this->id] = "(post_types.meta_value IS NULL OR (post_types.meta_value LIKE '%".serialize(get_post_type())."%' OR post_types.meta_value LIKE '%".serialize((string)get_the_ID())."%'))";
62
- return $where;
63
  }
64
  global $post_type;
65
 
66
  // Home has post as default post type
67
  if(!$post_type) $post_type = 'post';
68
- $where[$this->id] = "(post_types.meta_value IS NULL OR post_types.meta_value LIKE '%".serialize($post_type)."%')";
69
- return $where;
70
  }
71
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
72
  }
1
  <?php
2
  /**
3
  * @package Content Aware Sidebars
4
+ * @author Joachim Jensen <jv@intox.dk>
5
  */
6
 
7
  /**
15
  */
16
  class CASModule_post_type extends CASModule {
17
 
 
 
18
  private $post_type_objects;
19
 
20
+ public function __construct() {
21
+ parent::__construct();
22
+ $this->id = 'post_types';
23
+ $this->name = __('Post Types','content-aware-sidebars');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  }
25
 
26
+ public function _get_content() {
27
+
 
 
 
 
 
 
 
 
 
 
28
  }
29
 
30
  public function is_content() {
31
  return ((is_singular() || is_home()) && !is_front_page()) || is_post_type_archive();
32
  }
33
 
34
+ public function db_where() {
35
  if(is_singular()) {
36
+ return "(post_types.meta_value IS NULL OR post_types.meta_value IN('".get_post_type()."','".get_the_ID()."'))";
 
37
  }
38
  global $post_type;
39
 
40
  // Home has post as default post type
41
  if(!$post_type) $post_type = 'post';
42
+ return "(post_types.meta_value IS NULL OR post_types.meta_value = '".$post_type."')";
 
43
  }
44
+
45
+ public function meta_box_content() {
46
+ global $post;
47
+
48
+ foreach ($this->_get_post_types() as $post_type) {
49
+ echo '<h4><a href="#">' . $post_type->label . '</a></h4>'."\n";
50
+ echo '<div class="cas-rule-content" id="cas-' . $this->id . '-' . $post_type->name . '">'."\n";
51
+ $meta = get_post_meta($post->ID, ContentAwareSidebars::prefix . 'post_types', false);
52
+ $current = $meta != '' ? $meta : array();
53
+
54
+ $exclude = array();
55
+ if ($post_type->name == 'page' && 'page' == get_option('show_on_front')) {
56
+ $exclude[] = get_option('page_on_front');
57
+ $exclude[] = get_option('page_for_posts');
58
+ }
59
+
60
+ //WP3.1 does not support (array) as post_status
61
+ $posts = get_posts(array(
62
+ 'numberposts' => 200,
63
+ 'post_type' => $post_type->name,
64
+ 'post_status' => 'publish,private,future',
65
+ 'exclude' => $exclude
66
+ ));
67
+
68
+ //WP3.1.4 does not support $post_type->labels->all_items
69
+ echo '<p>' . "\n";
70
+ echo '<label><input class="cas-chk-all" type="checkbox" name="post_types[]" value="' . $post_type->name . '"' . checked(in_array($post_type->name, $current), true, false) . ' /> ' . sprintf(__('Show with All %s', 'content-aware-sidebars'), $post_type->label) . '</label>' . "\n";
71
+ echo '</p>' . "\n";
72
+
73
+ if (!$posts || is_wp_error($posts)) {
74
+ echo '<p>' . __('No items.') . '</p>';
75
+ } else {
76
+
77
+ ?>
78
+ <div id="posttype-<?php echo $post_type->name; ?>" class="categorydiv" style="min-height:100%;">
79
+ <ul id="posttype-<?php echo $post_type->name; ?>-tabs" class="category-tabs">
80
+ <li class="tabs"><a href="#<?php echo $post_type->name; ?>-all" tabindex="3"><?php _e('View All'); ?></a></li>
81
+ </ul>
82
+ <div id="<?php echo $post_type->name; ?>-all" class="tabs-panel" style="min-height:100%;">
83
+ <ul id="<?php echo $post_type->name; ?>checklist" class="list:<?php echo $post_type->name ?> categorychecklist form-no-clear">
84
+ <?php cas_posts_checklist($post->ID, array('post_type' => $post_type, 'posts' => $posts)); ?>
85
+ </ul>
86
+ </div>
87
+ </div>
88
+ <?php
89
+ }
90
+
91
+ echo '</div>';
92
+ }
93
+ }
94
+
95
+ private function _get_post_types() {
96
+ if (empty($this->post_type_objects)) {
97
+ // List public post types
98
+ foreach (get_post_types(array('public' => true), 'objects') as $post_type) {
99
+ $this->post_type_objects[$post_type->name] = $post_type;
100
+ }
101
+ }
102
+ return $this->post_type_objects;
103
+ }
104
+
105
  }
modules/qtranslate.php CHANGED
@@ -1,6 +1,7 @@
1
  <?php
2
  /**
3
  * @package Content Aware Sidebars
 
4
  */
5
 
6
  /**
@@ -13,57 +14,36 @@
13
  */
14
  class CASModule_qtranslate extends CASModule {
15
 
16
- protected $id = 'language';
17
-
18
  public function __construct() {
19
  parent::__construct();
 
 
20
 
21
  add_filter('manage_edit-sidebar_columns', array(&$this,'admin_column_headers'));
22
 
23
  }
24
 
25
- public function metadata($metadata) {
26
- global $q_config;
27
- $langs = array();
28
-
29
- foreach(get_option('qtranslate_enabled_languages') as $lng) {
30
- $langs[$lng] = $q_config['language_name'][$lng];
31
- }
32
-
33
- $metadata[$this->id] = array(
34
- 'name' => __('Languages', 'content-aware-sidebars'),
35
- 'id' => 'language',
36
- 'val' => array(),
37
- 'type' => 'checkbox',
38
- 'list' => $langs
39
- );
40
- return $metadata;
41
- }
42
-
43
- public function admin_gui($class) {
44
- add_meta_box(
45
- 'ca-sidebar-qtranslate',
46
- __('Languages', 'content-aware-sidebars'),
47
- array(&$class,'meta_box_checkboxes'),
48
- 'sidebar',
49
- 'side',
50
- 'default',
51
- $this->id
52
- );
53
- }
54
-
55
  public function is_content() {
56
  return true;
57
  }
58
 
59
- public function db_where($where) {
60
- $where[$this->id] = "(language.meta_value IS NULL OR (language.meta_value LIKE '%language%' OR language.meta_value LIKE '%".serialize(qtrans_getLanguage())."%'))";
61
- return $where;
62
  }
63
 
64
  public function admin_column_headers($columns) {
65
  unset($columns['language']);
66
  return $columns;
67
  }
 
 
 
 
 
 
 
 
 
 
68
 
69
  }
1
  <?php
2
  /**
3
  * @package Content Aware Sidebars
4
+ * @author Joachim Jensen <jv@intox.dk>
5
  */
6
 
7
  /**
14
  */
15
  class CASModule_qtranslate extends CASModule {
16
 
 
 
17
  public function __construct() {
18
  parent::__construct();
19
+ $this->id = 'language';
20
+ $this->name = __('Languages','content-aware-sidebars');
21
 
22
  add_filter('manage_edit-sidebar_columns', array(&$this,'admin_column_headers'));
23
 
24
  }
25
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
  public function is_content() {
27
  return true;
28
  }
29
 
30
+ public function db_where() {
31
+ return "(language.meta_value IS NULL OR language.meta_value IN('language','".qtrans_getLanguage()."'))";
 
32
  }
33
 
34
  public function admin_column_headers($columns) {
35
  unset($columns['language']);
36
  return $columns;
37
  }
38
+
39
+ public function _get_content() {
40
+ global $q_config;
41
+ $langs = array();
42
+
43
+ foreach(get_option('qtranslate_enabled_languages') as $lng) {
44
+ $langs[$lng] = $q_config['language_name'][$lng];
45
+ }
46
+ return $langs;
47
+ }
48
 
49
  }
modules/static.php CHANGED
@@ -1,6 +1,7 @@
1
  <?php
2
  /**
3
  * @package Content Aware Sidebars
 
4
  */
5
 
6
  /**
@@ -15,31 +16,25 @@
15
  */
16
  class CASModule_static extends CASModule {
17
 
18
- public function metadata($metadata) {
19
- $metadata[$this->id] = array(
20
- 'name' => __('Static Pages', 'content-aware-sidebars'),
21
- 'id' => $this->id,
22
- 'desc' => '',
23
- 'val' => array(),
24
- 'type' => 'checkbox',
25
- 'list' => array(
26
  'front-page' => __('Front Page', 'content-aware-sidebars'),
27
  'search' => __('Search Results', 'content-aware-sidebars'),
28
  '404' => __('404 Page', 'content-aware-sidebars')
29
- )
30
- );
31
- return $metadata;
32
- }
33
-
34
- public function admin_gui($class) {
35
-
36
  }
37
 
38
  public function is_content() {
39
  return is_front_page() || is_search() || is_404();
40
  }
41
 
42
- public function db_where($where) {
43
  if(is_front_page()) {
44
  $val = 'front-page';
45
  } else if(is_search()) {
@@ -47,8 +42,28 @@ class CASModule_static extends CASModule {
47
  } else {
48
  $val = '404';
49
  }
50
- $where[$this->id] = "(static.meta_value IS NULL OR static.meta_value LIKE '%".$val."%')";
51
- return $where;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  }
53
 
54
  }
1
  <?php
2
  /**
3
  * @package Content Aware Sidebars
4
+ * @author Joachim Jensen <jv@intox.dk>
5
  */
6
 
7
  /**
16
  */
17
  class CASModule_static extends CASModule {
18
 
19
+ public function __construct() {
20
+ parent::__construct();
21
+ $this->id = 'static';
22
+ $this->name = __('Static Pages','content-aware-sidebars');
23
+ }
24
+
25
+ public function _get_content() {
26
+ return array(
27
  'front-page' => __('Front Page', 'content-aware-sidebars'),
28
  'search' => __('Search Results', 'content-aware-sidebars'),
29
  '404' => __('404 Page', 'content-aware-sidebars')
30
+ );
 
 
 
 
 
 
31
  }
32
 
33
  public function is_content() {
34
  return is_front_page() || is_search() || is_404();
35
  }
36
 
37
+ public function db_where() {
38
  if(is_front_page()) {
39
  $val = 'front-page';
40
  } else if(is_search()) {
42
  } else {
43
  $val = '404';
44
  }
45
+ return "(static.meta_value IS NULL OR static.meta_value = '".$val."')";
46
+
47
+ }
48
+
49
+ public function meta_box_content() {
50
+ global $post;
51
+
52
+ echo '<h4><a href="#">'.$this->name.'</a></h4>'."\n";
53
+ echo '<div class="cas-rule-content" id="cas-' . $this->id . '">';
54
+ $field = $this->id;
55
+ $meta = get_post_meta($post->ID, ContentAwareSidebars::prefix . $field, false);
56
+ $current = $meta != '' ? $meta : array();
57
+ ?>
58
+ <ul class="list:<?php echo $field; ?> categorychecklist form-no-clear">
59
+ <?php
60
+ foreach ($this->_get_content() as $id => $name) {
61
+ echo '<li><label><input type="checkbox" name="' . $field . '[]" value="' . $id . '"' . (in_array($id, $current) ? ' checked="checked"' : '') . ' /> ' . $name . '</label></li>' . "\n";
62
+ }
63
+ ?>
64
+ </ul>
65
+ <?php
66
+ echo '</div>';
67
  }
68
 
69
  }
modules/taxonomy.php CHANGED
@@ -1,6 +1,7 @@
1
  <?php
2
  /**
3
  * @package Content Aware Sidebars
 
4
  */
5
 
6
  /**
@@ -14,52 +15,21 @@
14
  */
15
  class CASModule_taxonomy extends CASModule {
16
 
17
- protected $id = 'taxonomies';
18
- private $taxonomies;
19
  private $taxonomy_objects;
20
- private $post_taxonomies;
21
  private $post_terms;
22
 
23
- public function metadata($metadata) {
24
-
25
- // List public taxonomies
26
- foreach(get_taxonomies(array('public'=>true),'objects') as $tax) {
27
- $this->taxonomies[$tax->name] = $tax->label;
28
- $this->taxonomy_objects[$tax->name] = $tax;
29
- }
30
-
31
- $metadata[$this->id] = array(
32
- 'name' => __('Taxonomies', 'content-aware-sidebars'),
33
- 'id' => $this->id,
34
- 'desc' => '',
35
- 'val' => array(),
36
- 'type' => 'checkbox',
37
- 'list' => $this->taxonomies
38
- );
39
- return $metadata;
40
-
41
- }
42
-
43
- public function admin_gui($class) {
44
- foreach($this->taxonomy_objects as $tax) {
45
- add_meta_box(
46
- 'ca-sidebar-tax-'.$tax->name,
47
- $tax->label,
48
- array(&$class,'meta_box_taxonomy'),
49
- 'sidebar',
50
- 'side',
51
- 'default',
52
- $tax
53
- );
54
- }
55
  }
56
 
57
  public function is_content() {
58
  if(is_singular()) {
59
  // Check if content has any taxonomies supported
60
- $this->post_taxonomies = get_object_taxonomies(get_post_type());
61
- if($this->post_taxonomies) {
62
- $this->post_terms = wp_get_object_terms(get_the_ID(),$this->post_taxonomies);
63
  // Check if content has any actual taxonomy terms
64
  if($this->post_terms) {
65
  return true;
@@ -71,47 +41,104 @@ class CASModule_taxonomy extends CASModule {
71
  return false;
72
  }
73
 
74
- public function db_join($join, $prefix) {
75
  global $wpdb;
76
 
77
  $joins = "LEFT JOIN $wpdb->term_relationships term ON term.object_id = posts.ID ";
78
  $joins .= "LEFT JOIN $wpdb->term_taxonomy taxonomy ON taxonomy.term_taxonomy_id = term.term_taxonomy_id ";
79
  $joins .= "LEFT JOIN $wpdb->terms terms ON terms.term_id = taxonomy.term_id ";
80
- $joins .= "LEFT JOIN $wpdb->postmeta taxonomies ON taxonomies.post_id = posts.ID AND taxonomies.meta_key = '".$prefix."taxonomies'";
81
 
82
- $join[$this->id] = $joins;
83
-
84
- return $join;
85
 
86
  }
87
 
88
- public function db_where($where) {
89
 
90
  if(is_singular()) {
91
  $terms = array();
92
- $taxonomies = array();
93
 
94
- //Grab posts terms and make where rules for taxonomies.
95
- $tax_where[] = "taxonomies.meta_value IS NULL";
96
  foreach($this->post_terms as $term) {
97
- $terms[] = $term->slug;
98
- if(!isset($taxonomies[$term->taxonomy])) {
99
- $tax_where[] = "taxonomies.meta_value LIKE '%".$taxonomies[$term->taxonomy] = $term->taxonomy."%'";
100
- }
 
 
 
101
  }
102
 
103
- $where[$this->id] = "(terms.slug IS NULL OR terms.slug IN('".implode("','",$terms)."')) AND (".implode(' OR ',$tax_where).")";
104
- return $where;
 
105
  }
106
  $term = get_queried_object();
107
 
108
- $where[$this->id] = "(terms.slug = '$term->slug' OR taxonomies.meta_value LIKE '%".serialize($term->taxonomy)."%')";
109
- return $where;
110
 
111
  }
112
 
113
- public function db_where2($where) {
114
- $where[$this->id] = "terms.slug IS NOT NULL OR taxonomies.meta_value IS NOT NULL";
115
- return $where;
116
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
117
  }
1
  <?php
2
  /**
3
  * @package Content Aware Sidebars
4
+ * @author Joachim Jensen <jv@intox.dk>
5
  */
6
 
7
  /**
15
  */
16
  class CASModule_taxonomy extends CASModule {
17
 
 
 
18
  private $taxonomy_objects;
 
19
  private $post_terms;
20
 
21
+ public function __construct() {
22
+ parent::__construct();
23
+ $this->id = 'taxonomies';
24
+ $this->name = __('Taxonomies','content-aware-sidebars');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  }
26
 
27
  public function is_content() {
28
  if(is_singular()) {
29
  // Check if content has any taxonomies supported
30
+ $taxonomies = get_object_taxonomies(get_post_type());
31
+ if($taxonomies) {
32
+ $this->post_terms = wp_get_object_terms(get_the_ID(),$taxonomies);
33
  // Check if content has any actual taxonomy terms
34
  if($this->post_terms) {
35
  return true;
41
  return false;
42
  }
43
 
44
+ public function db_join() {
45
  global $wpdb;
46
 
47
  $joins = "LEFT JOIN $wpdb->term_relationships term ON term.object_id = posts.ID ";
48
  $joins .= "LEFT JOIN $wpdb->term_taxonomy taxonomy ON taxonomy.term_taxonomy_id = term.term_taxonomy_id ";
49
  $joins .= "LEFT JOIN $wpdb->terms terms ON terms.term_id = taxonomy.term_id ";
50
+ $joins .= "LEFT JOIN $wpdb->postmeta taxonomies ON taxonomies.post_id = posts.ID AND taxonomies.meta_key = '".ContentAwareSidebars::prefix."taxonomies'";
51
 
52
+ return $joins;
 
 
53
 
54
  }
55
 
56
+ public function db_where() {
57
 
58
  if(is_singular()) {
59
  $terms = array();
 
60
 
61
+ //Grab posts taxonomies and terms and sort them
 
62
  foreach($this->post_terms as $term) {
63
+ $terms[$term->taxonomy][] = $term->slug;
64
+ }
65
+
66
+ // Make rules for taxonomies and terms
67
+ foreach($terms as $taxonomy => $term_arr) {
68
+ $termrules[] = "(taxonomy.taxonomy = '".$taxonomy."' AND terms.slug IN('".implode("','",$term_arr)."'))";
69
+ $taxrules[] = $taxonomy;
70
  }
71
 
72
+ return "(terms.slug IS NULL OR ".implode(" OR ",$termrules).") AND (taxonomies.meta_value IS NULL OR taxonomies.meta_value IN('".implode("','",$taxrules)."'))";
73
+
74
+
75
  }
76
  $term = get_queried_object();
77
 
78
+ return "((taxonomy.taxonomy = '".$term->taxonomy."' AND terms.slug = '".$term->slug."') OR taxonomies.meta_value = '".$term->taxonomy."')";
 
79
 
80
  }
81
 
82
+ public function db_where2() {
83
+ return "terms.slug IS NOT NULL OR taxonomies.meta_value IS NOT NULL";
 
84
  }
85
+
86
+ public function _get_content() {
87
+
88
+ }
89
+
90
+ public function meta_box_content() {
91
+ global $post;
92
+
93
+ foreach ($this->_get_taxonomies() as $taxonomy) {
94
+ echo '<h4><a href="#">' . $taxonomy->label . '</a></h4>'."\n";
95
+ echo '<div class="cas-rule-content" id="cas-' . $this->id . '-' . $taxonomy->name . '">';
96
+
97
+ $meta = get_post_meta($post->ID, ContentAwareSidebars::prefix . 'taxonomies', false);
98
+ $current = $meta != '' ? $meta : array();
99
+
100
+ $terms = get_terms($taxonomy->name, array('get' => 'all','number' => 200));
101
+
102
+ echo '<p>' . "\n";
103
+ echo '<label><input class="cas-chk-all" type="checkbox" name="taxonomies[]" value="' . $taxonomy->name . '"' . checked(in_array($taxonomy->name, $current), true, false) . ' /> ' . sprintf(__('Show with %s', 'content-aware-sidebars'), $taxonomy->labels->all_items) . '</label>' . "\n";
104
+ echo '</p>' . "\n";
105
+ if (!$terms || is_wp_error($terms)) {
106
+ echo '<p>' . __('No items.') . '</p>';
107
+ } else {
108
+ ?>
109
+ <div id="taxonomy-<?php echo $taxonomy->name; ?>" class="categorydiv" style="min-height:100%;">
110
+ <ul id="<?php echo $taxonomy->name; ?>-tabs" class="category-tabs">
111
+ <li class="hide-if-no-js"><a href="#<?php echo $taxonomy->name; ?>-pop" tabindex="3"><?php _e('Most Used'); ?></a></li>
112
+ <li class="tabs"><a href="#<?php echo $taxonomy->name; ?>-all" tabindex="3"><?php _e('View All'); ?></a></li>
113
+ </ul>
114
+
115
+ <div id="<?php echo $taxonomy->name; ?>-pop" class="tabs-panel" style="display: none;min-height:100%;">
116
+ <ul id="<?php echo $taxonomy->name; ?>checklist-pop" class="categorychecklist form-no-clear" >
117
+ <?php $popular_ids = cas_popular_terms_checklist($taxonomy); ?>
118
+ </ul>
119
+ </div>
120
+
121
+ <div id="<?php echo $taxonomy->name; ?>-all" class="tabs-panel" style="min-height:100%;">
122
+ <input type="hidden" name="<?php echo ($taxonomy->name == "category" ? "post_category[]" : "tax_input[$taxonomy->name]"); ?>" value="0" />
123
+ <ul id="<?php echo $taxonomy->name; ?>checklist" class="list:<?php echo $taxonomy->name ?> categorychecklist form-no-clear">
124
+ <?php cas_terms_checklist($post->ID, array('taxonomy' => $taxonomy, 'popular_terms' => $popular_ids, 'terms' => $terms)) ?>
125
+ </ul>
126
+ </div>
127
+ </div>
128
+ <?php
129
+ }
130
+ echo '</div>'."\n";
131
+ }
132
+ }
133
+
134
+ private function _get_taxonomies() {
135
+ // List public taxonomies
136
+ if (empty($this->taxonomy_objects)) {
137
+ foreach (get_taxonomies(array('public' => true), 'objects') as $tax) {
138
+ $this->taxonomy_objects[$tax->name] = $tax;
139
+ }
140
+ }
141
+ return $this->taxonomy_objects;
142
+ }
143
+
144
  }
modules/transposh.php CHANGED
@@ -1,6 +1,7 @@
1
  <?php
2
  /**
3
  * @package Content Aware Sidebars
 
4
  */
5
 
6
  /**
@@ -13,47 +14,29 @@
13
  */
14
  class CASModule_transposh extends CASModule {
15
 
16
- protected $id = 'language';
17
-
18
- public function metadata($metadata) {
19
- global $my_transposh_plugin;
20
- $langs = array();
21
-
22
- foreach(explode(',',$my_transposh_plugin->options->get_viewable_langs()) as $lng) {
23
- $langs[$lng] = transposh_consts::get_language_orig_name($lng);
24
- }
25
-
26
- $metadata['language'] = array(
27
- 'name' => __('Languages', 'content-aware-sidebars'),
28
- 'id' => 'language',
29
- 'val' => array(),
30
- 'type' => 'checkbox',
31
- 'list' => $langs
32
- );
33
- return $metadata;
34
- }
35
-
36
- public function admin_gui($class) {
37
- add_meta_box(
38
- 'ca-sidebar-transposh',
39
- __('Languages', 'content-aware-sidebars'),
40
- array(&$class,'meta_box_checkboxes'),
41
- 'sidebar',
42
- 'side',
43
- 'default',
44
- 'language'
45
- );
46
  }
47
 
48
  public function is_content() {
49
  return true;
50
  }
51
 
52
- public function db_where($where) {
53
  global $my_transposh_plugin;
54
- $where[$this->id] = "(language.meta_value IS NULL OR (language.meta_value LIKE '%language%' OR language.meta_value LIKE '%".serialize($my_transposh_plugin->tgl)."%'))";
55
- return $where;
56
 
57
  }
 
 
 
 
 
 
 
 
 
58
 
59
  }
1
  <?php
2
  /**
3
  * @package Content Aware Sidebars
4
+ * @author Joachim Jensen <jv@intox.dk>
5
  */
6
 
7
  /**
14
  */
15
  class CASModule_transposh extends CASModule {
16
 
17
+ public function __construct() {
18
+ parent::__construct();
19
+ $this->id = 'language';
20
+ $this->name = __('Languages','content-aware-sidebars');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  }
22
 
23
  public function is_content() {
24
  return true;
25
  }
26
 
27
+ public function db_where() {
28
  global $my_transposh_plugin;
29
+ return "(language.meta_value IS NULL OR language.meta_value IN('language','".$my_transposh_plugin->tgl."'))";
 
30
 
31
  }
32
+
33
+ public function _get_content() {
34
+ global $my_transposh_plugin;
35
+ $langs = array();
36
+ foreach(explode(',',$my_transposh_plugin->options->get_viewable_langs()) as $lng) {
37
+ $langs[$lng] = transposh_consts::get_language_orig_name($lng);
38
+ }
39
+ return $langs;
40
+ }
41
 
42
  }
modules/wpml.php CHANGED
@@ -1,6 +1,7 @@
1
  <?php
2
  /**
3
  * @package Content Aware Sidebars
 
4
  */
5
 
6
  /**
@@ -13,45 +14,27 @@
13
  */
14
  class CASModule_wpml extends CASModule {
15
 
16
- protected $id = 'language';
17
-
18
- public function metadata($metadata) {
19
- $langs = array();
20
-
21
- foreach(icl_get_languages('skip_missing=N') as $lng) {
22
- $langs[$lng['language_code']] = $lng['native_name'];
23
- }
24
-
25
- $metadata['language'] = array(
26
- 'name' => __('Languages', 'content-aware-sidebars'),
27
- 'id' => 'language',
28
- 'val' => array(),
29
- 'type' => 'checkbox',
30
- 'list' => $langs
31
- );
32
- return $metadata;
33
- }
34
-
35
- public function admin_gui($class) {
36
- add_meta_box(
37
- 'ca-sidebar-wpml',
38
- __('Languages', 'content-aware-sidebars'),
39
- array(&$class,'meta_box_checkboxes'),
40
- 'sidebar',
41
- 'side',
42
- 'default',
43
- 'language'
44
- );
45
  }
46
 
47
  public function is_content() {
48
  return true;
49
  }
50
 
51
- public function db_where($where) {
52
- $where[$this->id] = "(language.meta_value IS NULL OR (language.meta_value LIKE '%language%' OR language.meta_value LIKE '%".serialize(ICL_LANGUAGE_CODE)."%'))";
53
- return $where;
 
 
 
54
 
 
 
 
 
55
  }
56
 
57
  }
1
  <?php
2
  /**
3
  * @package Content Aware Sidebars
4
+ * @author Joachim Jensen <jv@intox.dk>
5
  */
6
 
7
  /**
14
  */
15
  class CASModule_wpml extends CASModule {
16
 
17
+ public function __construct() {
18
+ parent::__construct();
19
+ $this->id = 'language';
20
+ $this->name = __('Languages','content-aware-sidebars');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  }
22
 
23
  public function is_content() {
24
  return true;
25
  }
26
 
27
+ public function db_where() {
28
+ return "(language.meta_value IS NULL OR language.meta_value IN('language','".ICL_LANGUAGE_CODE."'))";
29
+ }
30
+
31
+ public function _get_content() {
32
+ $langs = array();
33
 
34
+ foreach(icl_get_languages('skip_missing=N') as $lng) {
35
+ $langs[$lng['language_code']] = $lng['native_name'];
36
+ }
37
+ return $langs;
38
  }
39
 
40
  }
readme.txt CHANGED
@@ -1,22 +1,23 @@
1
  === Plugin Name ===
2
  Contributors: intoxstudio
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=KPZHE6A72LEN4&lc=US&item_name=WordPress%20Plugin%3a%20Content%20Aware%20Sidebars&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted
4
- Tags: sidebar, widget, content aware, seo, dynamic, flexible, modular
5
  Requires at least: 3.1
6
- Tested up to: 3.4
7
- Stable tag: 1.0
8
  License: GPL2
9
 
10
- Manage and show sidebars according to the content being viewed.
11
 
12
  == Description ==
13
 
14
- Manage an infinite number of sidebars. Make your WordPress site even more dynamic and boost SEO by controlling what content the sidebars should be displayed with. Creating flexible, dynamic sidebars has never been easier, and no code is needed at all as everything is easily done in the administration.
15
  No extra database tables or table columns will be added.
16
 
17
  = Features =
18
 
19
- * Show sidebars with all or specific:
 
20
  * Singulars - e.g. some posts or pages
21
  * (Custom) Post Types
22
  * Singulars with given (custom) taxonomies or taxonomy terms
@@ -83,14 +84,41 @@ The function accepts URL-style strings as parameters too, like the standard Word
83
 
84
  == Screenshots ==
85
 
86
- 1. Add a new Content Aware Sidebar to be displayed with All Posts and Another Page. It replaces `Main Sidebar`
87
  2. Simple overview of all created Content Aware Sidebars
88
  3. Add widgets to the newly added sidebar
89
  4. Viewing front page of site. `Main Sidebar` is displayed
90
- 5. Viewing Another Page. The Content Aware Sidebar has replaced `Main Sidebar`
91
 
92
  == Changelog ==
93
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
94
  = 1.0 =
95
 
96
  * Added: plugin rewritten to flexible modular system
@@ -105,7 +133,7 @@ The function accepts URL-style strings as parameters too, like the standard Word
105
 
106
  = 0.8.3 =
107
 
108
- * Added: Danish and Italian translation
109
  * Fixed: sidebar query might be larger than max_join_size
110
  * Fixed: row content in admin overview would be loaded with post types with matching keys
111
 
@@ -205,6 +233,10 @@ The function accepts URL-style strings as parameters too, like the standard Word
205
 
206
  == Upgrade Notice ==
207
 
 
 
 
 
208
  = 0.8 =
209
 
210
  * Content Aware Sidebar data in your database will be updated automatically. Remember to backup this data before updating the plugin.
1
  === Plugin Name ===
2
  Contributors: intoxstudio
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=KPZHE6A72LEN4&lc=US&item_name=WordPress%20Plugin%3a%20Content%20Aware%20Sidebars&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted
4
+ Tags: sidebar, widget, content aware, seo, dynamic, flexible, modular, bbpress, qtranslate, transposh, wpml
5
  Requires at least: 3.1
6
+ Tested up to: 3.5
7
+ Stable tag: 1.1.2
8
  License: GPL2
9
 
10
+ Create and display sidebars according to the content being viewed.
11
 
12
  == Description ==
13
 
14
+ Manage an infinite number of sidebars. Make your WordPress site even more dynamic and boost SEO by controlling what content the sidebars should be displayed with. Creating flexible, dynamic sidebars has never been easier, and no code is needed at all as everything is easily done in the administration panel.
15
  No extra database tables or table columns will be added.
16
 
17
  = Features =
18
 
19
+ * Easy-to-use sidebar manager
20
+ * Display sidebars with all or specific:
21
  * Singulars - e.g. some posts or pages
22
  * (Custom) Post Types
23
  * Singulars with given (custom) taxonomies or taxonomy terms
84
 
85
  == Screenshots ==
86
 
87
+ 1. Add a new Content Aware Sidebar to be displayed with all Posts that contains Very Categorized. It replaces `Main Sidebar`
88
  2. Simple overview of all created Content Aware Sidebars
89
  3. Add widgets to the newly added sidebar
90
  4. Viewing front page of site. `Main Sidebar` is displayed
91
+ 5. Viewing a Post that contains Very Categorized. `Very Categorized Posts` sidebar has replaced `Main Sidebar`
92
 
93
  == Changelog ==
94
 
95
+ = 1.1.2 =
96
+
97
+ * Added: wordpress 3.5 compatibility
98
+ * Fixed: slight css changes on edit screen
99
+ * Fixed: "show with all" checkbox toggles other checkboxes correctly
100
+
101
+ = 1.1.1 =
102
+
103
+ * Fixed: slight css changes on edit screen
104
+ * Fixed: tick.png included
105
+ * Fixed: taxonomy terms could influence each other in rare cases
106
+ * Fixed: taxonomy wide rules for taxonomy archives
107
+ * Fixed: cache caused db update module to skip 1.1 update if going from 0
108
+
109
+ = 1.1 =
110
+
111
+ * Added: improved gui on edit screen including content accordion
112
+ * Added: bbpress forum-topic dependency
113
+ * Added: sidebars hidden on password protected content
114
+ * Added: relevant usermeta cleared on plugin deletion
115
+ * Fixed: performance gain by dropping serialized metadata
116
+ * Fixed: database data update module revised
117
+ * Fixed: css class in posts and terms walker
118
+ * Fixed: limit of max 200 of each content type on edit screen (temp)
119
+ * Fixed: style and scripts loaded properly
120
+ * Removed: individual content meta boxes on edit screen
121
+
122
  = 1.0 =
123
 
124
  * Added: plugin rewritten to flexible modular system
133
 
134
  = 0.8.3 =
135
 
136
+ * Added: danish and italian translation
137
  * Fixed: sidebar query might be larger than max_join_size
138
  * Fixed: row content in admin overview would be loaded with post types with matching keys
139
 
233
 
234
  == Upgrade Notice ==
235
 
236
+ = 1.1 =
237
+
238
+ * Content Aware Sidebar data in your database will be updated automatically. Remember to backup this data before updating the plugin.
239
+
240
  = 0.8 =
241
 
242
  * Content Aware Sidebar data in your database will be updated automatically. Remember to backup this data before updating the plugin.
screenshot-1.png CHANGED
Binary file
screenshot-2.png CHANGED
Binary file
screenshot-3.png CHANGED
Binary file
screenshot-4.png CHANGED
Binary file
screenshot-5.png CHANGED
Binary file
uninstall.php CHANGED
@@ -14,9 +14,13 @@ delete_option('cas_db_version');
14
  $posts = get_posts(array(
15
  'numberposts' => -1,
16
  'post_type' => 'sidebar',
17
- 'post_status' => null
18
  ));
19
  foreach($posts as $post) {
20
  wp_delete_post($post->ID, true);
21
  }
22
 
 
 
 
 
14
  $posts = get_posts(array(
15
  'numberposts' => -1,
16
  'post_type' => 'sidebar',
17
+ 'post_status' => 'any'
18
  ));
19
  foreach($posts as $post) {
20
  wp_delete_post($post->ID, true);
21
  }
22
 
23
+ // Remove user meta
24
+ global $wpdb;
25
+ $wpdb->query("DELETE FROM $wpdb->usermeta WHERE meta_key IN('metaboxhidden_sidebar','closedpostboxes_sidebar')");
26
+
update_db.php CHANGED
@@ -16,6 +16,7 @@ function cas_run_db_update($current_version) {
16
 
17
  // Get current plugin db version
18
  $installed_version = get_option('cas_db_version');
 
19
  if($installed_version === false)
20
  $installed_version = 0;
21
 
@@ -23,49 +24,81 @@ function cas_run_db_update($current_version) {
23
  if($installed_version == $current_version)
24
  return true;
25
 
26
- $versions = array('0.8');
27
- $retry = array_flip($versions);
28
-
29
- //Launch updates
30
- for($i = 0; $i < sizeof($versions); $i++){
31
- $return = false;
32
-
33
- //After failing 3 times, something must be wrong
34
- if($retry[$versions[$i]] == 3) break;
35
-
36
- if(version_compare($installed_version,$versions[$i],'<')) {
37
-
38
- $function = 'cas_update_to_'.str_replace('.','',$versions[$i]);
39
-
40
  if(function_exists($function)) {
41
- call_user_func_array($function, array(&$return));
42
- if($return) {
43
- $installed_version = $versions[$i];
44
- } else {
45
- $retry[$versions[$i]]++;
46
- $i--;
47
  }
48
- }
49
  }
50
- }
51
-
52
- // Update database on success
53
- if($return)
54
- update_option('cas_db_version',$installed_version);
55
-
56
  return $return;
57
  }
58
  }
59
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
  /**
61
  *
62
  * Version 0 -> 0.8
63
  * Introduces database version management, adds preficed keys to metadata
64
  *
65
- * @global type $wpdb
66
- * @param type $return
67
  */
68
- function cas_update_to_08($return) {
69
  global $wpdb;
70
 
71
  $prefix = '_cas_';
@@ -89,9 +122,7 @@ function cas_update_to_08($return) {
89
  ",'sidebar'));
90
 
91
  //Check if there is any
92
- if(empty($posts)) {
93
- $return = true;
94
- } else {
95
  //Update the meta keys
96
  foreach($metadata as $meta) {
97
  $wpdb->query("
@@ -101,8 +132,10 @@ function cas_update_to_08($return) {
101
  AND post_id IN(".implode(',',$posts).")
102
  ");
103
  }
 
 
104
  }
105
 
106
- $return = true;
107
 
108
  }
16
 
17
  // Get current plugin db version
18
  $installed_version = get_option('cas_db_version');
19
+
20
  if($installed_version === false)
21
  $installed_version = 0;
22
 
24
  if($installed_version == $current_version)
25
  return true;
26
 
27
+ $versions = array(0.8,1.1);
28
+
29
+ //Launch updates
30
+ foreach($versions as $version) {
31
+ $return = false;
32
+
33
+ if(version_compare($installed_version,$version,'<')) {
34
+ $function = 'cas_update_to_'.str_replace('.','',$version);
 
 
 
 
 
 
35
  if(function_exists($function)) {
36
+
37
+ $return = $function();
38
+
39
+ // Update database on success
40
+ if($return) {
41
+ update_option('cas_db_version',$installed_version = $version);
42
  }
43
+ }
44
  }
45
+ }
46
+
 
 
 
 
47
  return $return;
48
  }
49
  }
50
 
51
+ /**
52
+ * Version 0.8 -> 1.1
53
+ * Serialized metadata gets their own rows
54
+ *
55
+ * @param boolean $return
56
+ */
57
+ function cas_update_to_11() {
58
+
59
+ $moduledata = array(
60
+ 'static',
61
+ 'post_types',
62
+ 'authors',
63
+ 'page_templates',
64
+ 'taxonomies',
65
+ 'language'
66
+ );
67
+
68
+ // Get all sidebars
69
+ $posts = get_posts(array(
70
+ 'numberposts' => -1,
71
+ 'post_type' => 'sidebar',
72
+ 'post_status' => 'publish,pending,draft,future,private,trash'
73
+ ));
74
+
75
+ if(!empty($posts)) {
76
+ foreach($posts as $post) {
77
+ foreach($moduledata as $field) {
78
+ // Remove old serialized data and insert it again properly
79
+ $old = get_post_meta($post->ID, ContentAwareSidebars::prefix.$field, true);
80
+ if($old != '') {
81
+ delete_post_meta($post->ID, ContentAwareSidebars::prefix.$field, $old);
82
+ foreach((array)$old as $new_single) {
83
+ add_post_meta($post->ID, ContentAwareSidebars::prefix.$field, $new_single);
84
+ }
85
+ }
86
+ }
87
+ }
88
+ }
89
+
90
+ return true;
91
+ }
92
+
93
  /**
94
  *
95
  * Version 0 -> 0.8
96
  * Introduces database version management, adds preficed keys to metadata
97
  *
98
+ * @global object $wpdb
99
+ * @param boolean $return
100
  */
101
+ function cas_update_to_08() {
102
  global $wpdb;
103
 
104
  $prefix = '_cas_';
122
  ",'sidebar'));
123
 
124
  //Check if there is any
125
+ if(!empty($posts)) {
 
 
126
  //Update the meta keys
127
  foreach($metadata as $meta) {
128
  $wpdb->query("
132
  AND post_id IN(".implode(',',$posts).")
133
  ");
134
  }
135
+ // Clear cache for new meta keys
136
+ wp_cache_flush();
137
  }
138
 
139
+ return true;
140
 
141
  }
walker.php CHANGED
@@ -58,7 +58,7 @@ class CAS_Walker_Checklist extends Walker {
58
  return;
59
  }
60
 
61
- $output .= "\n".'<li id="'.$post_type->name.'-'.$term->ID.'"><label class="selectit"><input value="'.$term->ID.'" type="checkbox" name="post_types[]" id="in-'.$post_type->name.'-'.$term->ID.'"'.checked(in_array($term->ID,$selected_cats),true,false).disabled(empty($disabled),false,false).'/> '.esc_html( $term->post_title ).'</label>';
62
 
63
  } else {
64
 
@@ -71,7 +71,7 @@ class CAS_Walker_Checklist extends Walker {
71
  $value = $taxonomy->hierarchical ? 'term_id' : 'slug';
72
  $class = in_array( $term->term_id, $popular_terms ) ? ' class="popular-category"' : '';
73
 
74
- $output .= "\n".'<li id="'.$taxonomy->name.'-'.$term->term_id.'"$class><label class="selectit"><input value="'.$term->$value.'" type="checkbox" name="'.$name.'[]" id="in-'.$taxonomy->name.'-'.$term->term_id.'"'.checked(in_array($term->term_id,$selected_terms),true,false).disabled(empty($disabled),false,false).'/> '.esc_html( apply_filters('the_category', $term->name )) . '</label>';
75
 
76
  }
77
 
@@ -179,7 +179,7 @@ function cas_popular_terms_checklist( $taxonomy, $default = 0, $number = 10, $ec
179
 
180
  <li id="<?php echo $id; ?>" class="popular-category">
181
  <label class="selectit">
182
- <input id="in-<?php echo $id; ?>" type="checkbox"<?php echo in_array( $term->term_id, $checked_terms ) ? ' checked="checked"' : ''; ?> value="<?php echo $term->term_id; ?>"<?php echo $disabled ?>/>
183
  <?php echo esc_html( apply_filters( 'the_category', $term->name ) ); ?>
184
  </label>
185
  </li>
@@ -211,11 +211,11 @@ function cas_posts_checklist($post_id = 0, $args = array()) {
211
 
212
  $args = array(
213
  'post_type' => $post_type,
214
- 'disabled' => !current_user_can($post_type->cap->edit_post)
215
  );
216
 
217
  if($post_id)
218
- $args['selected_cats'] = (array)get_post_meta($post_id, '_cas_post_types', true);
219
  else
220
  $args['selected_cats'] = array();
221
 
58
  return;
59
  }
60
 
61
+ $output .= "\n".'<li id="'.$post_type->name.'-'.$term->ID.'"><label class="selectit"><input class="cas-post_types-'.$post_type->name.'" value="'.$term->ID.'" type="checkbox" name="post_types[]" id="in-'.$post_type->name.'-'.$term->ID.'"'.checked(in_array($term->ID,$selected_cats),true,false).disabled(empty($disabled),false,false).'/> '.esc_html( $term->post_title ).'</label>';
62
 
63
  } else {
64
 
71
  $value = $taxonomy->hierarchical ? 'term_id' : 'slug';
72
  $class = in_array( $term->term_id, $popular_terms ) ? ' class="popular-category"' : '';
73
 
74
+ $output .= "\n".'<li id="'.$taxonomy->name.'-'.$term->term_id.'"'.$class.'><label class="selectit"><input class="cas-taxonomies-'.$taxonomy->name.'" value="'.$term->$value.'" type="checkbox" name="'.$name.'[]" id="in-'.$taxonomy->name.'-'.$term->term_id.'"'.checked(in_array($term->term_id,$selected_terms),true,false).disabled(empty($disabled),false,false).'/> '.esc_html( apply_filters('the_category', $term->name )) . '</label>';
75
 
76
  }
77
 
179
 
180
  <li id="<?php echo $id; ?>" class="popular-category">
181
  <label class="selectit">
182
+ <input class="cas-taxonomies-<?php echo $taxonomy->name; ?>" id="in-<?php echo $id; ?>" type="checkbox"<?php echo in_array( $term->term_id, $checked_terms ) ? ' checked="checked"' : ''; ?> value="<?php echo $term->term_id; ?>"<?php echo $disabled ?>/>
183
  <?php echo esc_html( apply_filters( 'the_category', $term->name ) ); ?>
184
  </label>
185
  </li>
211
 
212
  $args = array(
213
  'post_type' => $post_type,
214
+ //'disabled' => !current_user_can($post_type->cap->read_post,$post_type)
215
  );
216
 
217
  if($post_id)
218
+ $args['selected_cats'] = get_post_meta($post_id, '_cas_post_types', false);
219
  else
220
  $args['selected_cats'] = array();
221