Permalink
Browse files

Added tax ordering, sidebar update for sermons

-Sidebar is almost done
  • Loading branch information...
1 parent 98b3554 commit 9444f010823cf9a15826de56c8cacd4337abdeee Justin Louie committed Dec 14, 2012
Showing with 1,963 additions and 117 deletions.
  1. +37 −0 plugins/taxonomy-terms-order/css/to.css
  2. BIN plugins/taxonomy-terms-order/images/admin-icon-settings.gif
  3. BIN plugins/taxonomy-terms-order/images/menu-icon.gif
  4. BIN plugins/taxonomy-terms-order/images/wpspin_light.gif
  5. +241 −0 plugins/taxonomy-terms-order/include/interface.php
  6. +140 −0 plugins/taxonomy-terms-order/include/options.php
  7. +48 −0 plugins/taxonomy-terms-order/include/terms_walker.php
  8. +135 −0 plugins/taxonomy-terms-order/js/to-javascript.js
  9. BIN plugins/taxonomy-terms-order/lang/to-de_DE.mo
  10. +175 −0 plugins/taxonomy-terms-order/lang/to-de_DE.po
  11. BIN plugins/taxonomy-terms-order/lang/to-fr_FR.mo
  12. +175 −0 plugins/taxonomy-terms-order/lang/to-fr_FR.po
  13. BIN plugins/taxonomy-terms-order/lang/to-nl_NL.mo
  14. +162 −0 plugins/taxonomy-terms-order/lang/to-nl_NL.po
  15. BIN plugins/taxonomy-terms-order/lang/to-ro_RO.mo
  16. +178 −0 plugins/taxonomy-terms-order/lang/to-ro_RO.po
  17. BIN plugins/taxonomy-terms-order/lang/to.mo
  18. +157 −0 plugins/taxonomy-terms-order/lang/to.po
  19. +178 −0 plugins/taxonomy-terms-order/lang/to.pot
  20. +69 −0 plugins/taxonomy-terms-order/readme.txt
  21. BIN plugins/taxonomy-terms-order/screenshot-1.gif
  22. BIN plugins/taxonomy-terms-order/screenshot-2.gif
  23. +184 −0 plugins/taxonomy-terms-order/taxonomy-terms-order.php
  24. +1 −1 themes/scacseattle.org/archive-ct_sermon.php
  25. +38 −0 themes/scacseattle.org/content-sermons.php
  26. +0 −69 themes/scacseattle.org/content.php
  27. +11 −4 themes/scacseattle.org/sass/sermons.css.sass
  28. +14 −7 themes/scacseattle.org/sidebar-sermons.php
  29. +5 −0 themes/scacseattle.org/style.css
  30. +15 −36 themes/scacseattle.org/taxonomy-sermon_series.php
@@ -0,0 +1,37 @@
+
+h2.subtitle {font-size: 15px; font-style: italic; font-weight: bold}
+
+#order-terms img {vertical-align: middle}
+#order-terms #tto_sortable { list-style-type: none; margin: 20px 0 0; padding: 0; width: 100%; }
+#order-terms ul {list-style: none;}
+#order-terms ul.children {margin-left: 25px}
+.term_type_li .item {border: 1px solid #DDDDDD; border-radius: 6px 6px 6px 6px; cursor: move; margin: 4px 0; padding: 2px 0;line-height: 140%;margin-bottom: 6px;}
+.term_type_li .item span { background: none repeat scroll 0 0 #F7F7F7; color: #808080; display: block; font-weight: bold; padding: 5px;}
+.term_type_li .item span.edit {position: absolute; right: 10px; top: 6px; padding: 0px; margin: 0px}
+#order-terms .placeholder{border-color:#bbb;background-color:#f5f5f5; height:30px; background-image: none; -moz-border-radius: 6px 6px 6px 6px; border: 1px solid #E6E6E6;}
+.term_type_li ul {margin-top: 6px}
+#dragHelper li, #dragHelper ul {background: transparent !important;}
+#dragHelper ul {list-style: none;}
+
+.wp-list-taxonomy {width: 100%}
+.wp-list-taxonomy thead tr th{padding-bottom: 7px}
+.wp-list-taxonomy tr {background-color: #FCFCFC;}
+.wp-list-taxonomy tbody th.check-column { padding: 9px 0 22px;}
+.wp-list-taxonomy td { color: #555555;}
+.wp-list-taxonomy td, .wp-list-taxonomy th { border-bottom-color: #DFDFDF; border-top-color: #FFFFFF;}
+.wp-list-taxonomy th, .wp-list-taxonomy td { overflow: hidden;}
+.wp-list-taxonomy td { font-size: 12px; padding: 9px 7px 4px 7px; vertical-align: top;}
+.wp-list-taxonomy td, .wp-list-taxonomy th { border-style: solid; border-width: 1px 0;}
+.wp-list-taxonomy * { word-wrap: break-word;}
+
+#cpt_info_box {padding: 0 10px; border: 1px dashed #21759B; background-color: #F1F1F1; margin-top: 10px}
+#cpt_info_box p {font-size: 12px}
+#cpt_info_box #donate_form {float: right; padding: 10px 0 10px 10px}
+#icon-settings {background-image:url("../images/admin-icon-settings.gif");background-repeat:no-repeat;}
+#p_right {float: right; width: 200px; }
+.p_s_item {float: left; padding: 0px 5px; margin-top: 15px; margin-bottom: 5px}
+.p_s_item.s_gp {padding-top: 2px; margin-left: 10px}
+
+.clear {clear: both}
+
+
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,241 @@
+<?php
+
+
+ function TOPluginInterface()
+ {
+ global $wpdb, $wp_locale;
+
+ $taxonomy = isset($_GET['taxonomy']) ? $_GET['taxonomy'] : '';
+ $post_type = isset($_GET['post_type']) ? $_GET['post_type'] : 'post';
+
+ $post_type_data = get_post_type_object($post_type);
+
+ if (!taxonomy_exists($taxonomy))
+ $taxonomy = '';
+
+ ?>
+ <div class="wrap">
+ <div class="icon32" id="icon-edit"><br></div>
+ <h2><?php _e( "Taxonomy Order", 'to' ) ?></h2>
+
+ <div id="cpt_info_box">
+ <div id="p_right">
+
+ <div id="p_socialize">
+ <div class="p_s_item s_gp">
+ <!-- Place this tag in your head or just before your close body tag -->
+ <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
+
+ <!-- Place this tag where you want the +1 button to render -->
+ <div class="g-plusone" data-size="small" data-annotation="none" data-href="http://nsp-code.com/"></div>
+ </div>
+ <div class="p_s_item s_t">
+ <a href="https://twitter.com/share" class="twitter-share-button" data-url="http://www.nsp-code.com" data-text="Define custom order for your taxonomies terms through an easy to use javascript AJAX drag and drop interface. No theme code updates are necessarily, this plugin will take care of query update." data-count="none">Tweet</a><script type="text/javascript" src="//platform.twitter.com/widgets.js"></script>
+ </div>
+
+ <div class="p_s_item s_f">
+ <iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.nsp-code.com%2F&amp;send=false&amp;layout=button_count&amp;width=75&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font=arial&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:75px; height:21px;" allowTransparency="true"></iframe>
+ </div>
+
+ <div class="clear"></div>
+ </div>
+
+ <div id="donate_form">
+ <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
+ <input type="hidden" name="cmd" value="_s-xclick">
+ <input type="hidden" name="hosted_button_id" value="CU22TFDKJMLAE">
+ <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
+ <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
+ </form>
+ </div>
+ </div>
+ <p><?php _e( "Did you found useful this plug-in? Please support our work with a donation or write an article about this plugin in your blog with a link to our site", 'to' ) ?> <br /><strong>http://www.nsp-code.com/</strong>.</p>
+ <h4><?php _e( "Did you know there is available a more advanced version of this plug-in?", 'to' ) ?> <a target="_blank" href="http://www.nsp-code.com/premium-plugins/wordpress-plugins/advanced-taxonomy-terms-order/"><?php _e( "Read more", 'to' ) ?></a></h4>
+ <p><?php _e( "Check our", 'to' ) ?> <a target="_blank" href="http://wordpress.org/extend/plugins/post-types-order/">Post Types Order</a> <?php _e( "plugin which allow to custom sort all posts, pages, custom post types", 'to' ) ?> </p>
+ </div>
+ <div id="ajax-response"></div>
+
+ <noscript>
+ <div class="error message">
+ <p><?php _e( "This plugin can't work without javascript, because it's use drag and drop and AJAX.", 'to' ) ?></p>
+ </div>
+ </noscript>
+
+ <div class="clear"></div>
+
+ <form action="edit.php" method="get" id="to_form">
+ <input type="hidden" name="page" value="to-interface-<?php echo $post_type ?>" />
+ <?php
+
+ if ($post_type != 'post')
+ echo '<input type="hidden" name="post_type" value="'. $post_type .'" />';
+
+ //output all available taxonomies for this post type
+
+ $post_type_taxonomies = get_object_taxonomies($post_type);
+
+ foreach ($post_type_taxonomies as $key => $taxonomy_name)
+ {
+ $taxonomy_info = get_taxonomy($taxonomy_name);
+ if ($taxonomy_info->hierarchical !== TRUE)
+ unset($post_type_taxonomies[$key]);
+ }
+
+ //use the first taxonomy if emtpy taxonomy
+ if ($taxonomy == '' || !taxonomy_exists($taxonomy))
+ {
+ reset($post_type_taxonomies);
+ $taxonomy = current($post_type_taxonomies);
+ }
+
+ if (count($post_type_taxonomies) > 1)
+ {
+
+ ?>
+
+ <h2 class="subtitle"><?php echo ucfirst($post_type_data->labels->name) ?> <?php _e( "Taxonomies", 'to' ) ?></h2>
+ <table cellspacing="0" class="wp-list-taxonomy">
+ <thead>
+ <tr>
+ <th style="" class="column-cb check-column" id="cb" scope="col">&nbsp;</th><th style="" class="" id="author" scope="col"><?php _e( "Taxonomy Title", 'to' ) ?></th><th style="" class="manage-column" id="categories" scope="col"><?php _e( "Total Posts", 'to' ) ?></th> </tr>
+ </thead>
+
+
+ <tbody id="the-list">
+ <?php
+
+ $alternate = FALSE;
+ foreach ($post_type_taxonomies as $post_type_taxonomy)
+ {
+ $taxonomy_info = get_taxonomy($post_type_taxonomy);
+
+ $alternate = $alternate === TRUE ? FALSE :TRUE;
+
+ $taxonomy_terms = get_terms($key);
+
+ ?>
+ <tr valign="top" class="<?php if ($alternate === TRUE) {echo 'alternate ';} ?>" id="taxonomy-<?php echo $taxonomy ?>">
+ <th class="check-column" scope="row"><input type="radio" onclick="to_change_taxonomy(this)" value="<?php echo $post_type_taxonomy ?>" <?php if ($post_type_taxonomy == $taxonomy) {echo 'checked="checked"';} ?> name="taxonomy">&nbsp;</th>
+ <td class="categories column-categories"><b><?php echo $taxonomy_info->label ?></b> (<?php echo $taxonomy_info->labels->singular_name; ?>)</td>
+ <td class="categories column-categories"><?php echo count($taxonomy_terms) ?></td>
+ </tr>
+
+ <?php
+ }
+ ?>
+ </tbody>
+ </table>
+ <br /><br />
+ <?php
+ }
+ ?>
+
+ <div id="order-terms">
+
+
+
+ <div id="post-body">
+
+ <ul class="sortable" id="tto_sortable">
+ <?php
+ listTerms($taxonomy);
+ ?>
+ </ul>
+
+ <div class="clear"></div>
+ </div>
+
+ <div class="alignleft actions">
+ <p class="submit">
+ <a href="javascript:;" class="save-order button-primary"><?php _e( "Update", 'to' ) ?></a>
+ </p>
+ </div>
+
+ </div>
+
+ </form>
+
+ <script type="text/javascript">
+ jQuery(document).ready(function() {
+
+ var NestedSortableSerializedData;
+ jQuery("ul.sortable").sortable({
+ 'tolerance':'intersect',
+ 'cursor':'pointer',
+ 'items':'> li',
+ 'axi': 'y',
+ 'placeholder':'placeholder',
+ 'nested': 'ul'
+ });
+ });
+
+
+ jQuery(".save-order").bind( "click", function() {
+
+ var mySortable = new Array();
+ jQuery(".sortable").each( function(){
+
+ var serialized = jQuery(this).sortable("serialize");
+
+ var parent_tag = jQuery(this).parent().get(0).tagName;
+ parent_tag = parent_tag.toLowerCase()
+ if (parent_tag == 'li')
+ {
+ //
+ var tag_id = jQuery(this).parent().attr('id');
+ mySortable[tag_id] = serialized;
+ }
+ else
+ {
+ //
+ mySortable[0] = serialized;
+ }
+ });
+
+ //serialize the array
+ var serialize_data = serialize(mySortable);
+
+ jQuery.post( ajaxurl, { action:'update-taxonomy-order', order: serialize_data, taxonomy : '<?php echo $taxonomy ?>' }, function() {
+ jQuery("#ajax-response").html('<div class="message updated fade"><p><?php _e( "Items Order Updates", 'to' ) ?></p></div>');
+ jQuery("#ajax-response div").delay(3000).hide("slow");
+ });
+ });
+ </script>
+
+ </div>
+ <?php
+
+
+ }
+
+
+ function listTerms($taxonomy)
+ {
+
+ // Query pages.
+ $args = array(
+ 'orderby' => 'term_order',
+ 'depth' => 0,
+ 'child_of' => 0,
+ 'hide_empty' => 0
+ );
+ $taxonomy_terms = get_terms($taxonomy, $args);
+
+ $output = '';
+ if (count($taxonomy_terms) > 0)
+ {
+ $output = TOwalkTree($taxonomy_terms, $args['depth'], $args);
+ }
+
+ echo $output;
+
+ }
+
+ function TOwalkTree($taxonomy_terms, $depth, $r)
+ {
+ $walker = new TO_Terms_Walker;
+ $args = array($taxonomy_terms, $depth, $r);
+ return call_user_func_array(array(&$walker, 'walk'), $args);
+ }
+
+?>
Oops, something went wrong. Retry.

0 comments on commit 9444f01

Please sign in to comment.