Version Description
Download this release
Release Info
Developer | mtekk |
Plugin | Breadcrumb NavXT |
Version | 2.1.4 |
Comparing to | |
See all releases |
Code changes from version 2.1.3 to 2.1.4
- breadcrumb_navxt_admin.php +161 -3
- breadcrumb_navxt_class.php +12 -8
- readme.txt +2 -2
breadcrumb_navxt_admin.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Breadcrumb NavXT - Adminstration Interface
|
4 |
Plugin URI: http://mtekk.weblogs.us/code/breadcrumb-navxt/
|
5 |
Description: Adds a breadcrumb navigation showing the visitor's path to their current location. This enables the administrative interface for specifying the output of the breadcrumb. For details on how to use this plugin visit <a href="http://mtekk.weblogs.us/code/breadcrumb-navxt/">Breadcrumb NavXT</a>.
|
6 |
-
Version: 2.1.
|
7 |
Author: John Havlik
|
8 |
Author URI: http://mtekk.weblogs.us/
|
9 |
*/
|
@@ -19,7 +19,7 @@ Author URI: http://mtekk.weblogs.us/
|
|
19 |
|
20 |
//Configuration
|
21 |
|
22 |
-
$bcn_admin_version = "2.1.
|
23 |
$bcn_admin_req = 8;
|
24 |
|
25 |
//Includes
|
@@ -779,7 +779,165 @@ function bcn_options_style()
|
|
779 |
?>
|
780 |
<style type="text/css">
|
781 |
.bcn_options{border: none;}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
782 |
</style>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
783 |
<?php
|
784 |
}
|
785 |
|
@@ -789,7 +947,7 @@ if(function_exists('add_action')){
|
|
789 |
add_action('activate_breadcrumb-navxt/breadcrumb_navxt_admin.php','bcn_install');
|
790 |
//WordPress Admin interface hook
|
791 |
add_action('admin_menu', 'bcn_add_page');
|
792 |
-
add_action('admin_head', 'bcn_options_style');
|
793 |
//Enque javscript dependencies
|
794 |
//wp_enqueue_script('jquery-ui-tabs');
|
795 |
//Admin Options hook
|
3 |
Plugin Name: Breadcrumb NavXT - Adminstration Interface
|
4 |
Plugin URI: http://mtekk.weblogs.us/code/breadcrumb-navxt/
|
5 |
Description: Adds a breadcrumb navigation showing the visitor's path to their current location. This enables the administrative interface for specifying the output of the breadcrumb. For details on how to use this plugin visit <a href="http://mtekk.weblogs.us/code/breadcrumb-navxt/">Breadcrumb NavXT</a>.
|
6 |
+
Version: 2.1.4
|
7 |
Author: John Havlik
|
8 |
Author URI: http://mtekk.weblogs.us/
|
9 |
*/
|
19 |
|
20 |
//Configuration
|
21 |
|
22 |
+
$bcn_admin_version = "2.1.4";
|
23 |
$bcn_admin_req = 8;
|
24 |
|
25 |
//Includes
|
779 |
?>
|
780 |
<style type="text/css">
|
781 |
.bcn_options{border: none;}
|
782 |
+
.form-table .form-table-inner td {border:none; height:normal; line-height:normal; margin:0; padding:0 8px 0 0; vertical-align: top;}
|
783 |
+
.form-table .form-table-inner tr.spaced td {padding-bottom:6px;}
|
784 |
+
/**
|
785 |
+
* Tabbed Admin Page (CSS)
|
786 |
+
*
|
787 |
+
* unobtrusive approach to add tabbed forms into
|
788 |
+
* the wordpress admin panel
|
789 |
+
*
|
790 |
+
* @note unstable
|
791 |
+
* @see http://www.artnorm.de/this-morning-in-bleeding,105,2008-06.html
|
792 |
+
* @see breadcrumb navxt
|
793 |
+
* @author Tom Klingenberg
|
794 |
+
* @cssdoc 1.0-pre
|
795 |
+
* @colordef #fff white (tab background)
|
796 |
+
* @colordef #c6d9e9 grey-blue (tab line)
|
797 |
+
* @colordef #d54e21 orange (tab text of active tab)
|
798 |
+
* @colordef #d54e21 orange (tab text of inactive tab hovered) external
|
799 |
+
* @colordef #2583ad dark-blue (tab text of inactive tab) external
|
800 |
+
*/
|
801 |
+
ul.ui-tabs-nav {background:#fff; border-bottom:1px solid #c6d9e9; font-size:12px; height:29px; margin:13px 0 0; padding:0; padding-left:8px; list-style:none;}
|
802 |
+
ul.ui-tabs-nav li {display:inline; line-height: 200%; list-style:none; margin: 0; padding:0; position:relative; top:1px; text-align:center; white-space:nowrap;}
|
803 |
+
ul.ui-tabs-nav li a {background:transparent none no-repeat scroll 0%; border:1px transparent #fff; border-bottom:1px solid #c6d9e9; display:block; float:left; line-height:28px; padding:1px 13px 0; position:relative; text-decoration:none;}
|
804 |
+
ul.ui-tabs-nav li.ui-tabs-selected a {-moz-border-radius-topleft:4px; -moz-border-radius-topright:4px; background:#fff; border:1px solid #c6d9e9; border-bottom-color:#fff; color:#d54e21; font-weight:normal; padding:0 12px;}
|
805 |
+
ul.ui-tabs-nav a:focus, a:active {outline: none;}
|
806 |
+
#hasadmintabs fieldset {clear:both;}
|
807 |
</style>
|
808 |
+
<?php
|
809 |
+
/*
|
810 |
+
* needed javascript libraries are included now
|
811 |
+
* add own javascript code now
|
812 |
+
*/
|
813 |
+
?>
|
814 |
+
<script type="text/javascript">
|
815 |
+
/* <![CDATA[ */
|
816 |
+
/**
|
817 |
+
* Tabbed Admin Page (jQuery)
|
818 |
+
*
|
819 |
+
* unobtrusive approach to add tabbed forms into
|
820 |
+
* the wordpress admin panel
|
821 |
+
*
|
822 |
+
* @note unstable
|
823 |
+
* @see http://www.artnorm.de/this-morning-in-bleeding,105,2008-06.html
|
824 |
+
* @see breadcrumb navxt
|
825 |
+
* @author Tom Klingenberg
|
826 |
+
* @uses jQuery
|
827 |
+
* @uses ui.core
|
828 |
+
* @uses ui.tabs
|
829 |
+
*/
|
830 |
+
|
831 |
+
jQuery(document).ready(function()
|
832 |
+
{
|
833 |
+
bcn_tabulator_init();
|
834 |
+
});
|
835 |
+
|
836 |
+
/**
|
837 |
+
* Tabulator Bootup
|
838 |
+
*/
|
839 |
+
function bcn_tabulator_init()
|
840 |
+
{
|
841 |
+
bcn_admin_init_tabs();
|
842 |
+
bcn_admin_gobal_tabs(); // comment out this like to disable tabs in admin
|
843 |
+
|
844 |
+
}
|
845 |
+
|
846 |
+
/**
|
847 |
+
* inittialize tabs for admin panel pages (wordpress core)
|
848 |
+
*
|
849 |
+
* @todo add uniqueid somehow
|
850 |
+
*/
|
851 |
+
function bcn_admin_gobal_tabs()
|
852 |
+
{
|
853 |
+
/* if has already a special id quit the global try here */
|
854 |
+
if (jQuery('#hasadmintabs').length > 0) return;
|
855 |
+
|
856 |
+
jQuery('#wpbody .wrap form').each(function(f)
|
857 |
+
{
|
858 |
+
var $formEle = jQuery(this).children();
|
859 |
+
|
860 |
+
var $eleSets = new Array();
|
861 |
+
var $eleSet = new Array();
|
862 |
+
var $eleSetIgnore = new Array();
|
863 |
+
|
864 |
+
for (var i = 0; i < $formEle.size(); i++)
|
865 |
+
{
|
866 |
+
var curr = $formEle.get(i);
|
867 |
+
var $curr = jQuery(curr);
|
868 |
+
// cut condition: h3 or stop
|
869 |
+
// stop: p.submit
|
870 |
+
if ($curr.is('p.submit') || $curr.is('h3'))
|
871 |
+
{
|
872 |
+
if ($eleSet.length)
|
873 |
+
{
|
874 |
+
if ($eleSets.length == 0 && $eleSet.length == 1 && jQuery($eleSet).is('p')) {
|
875 |
+
$eleSetIgnore = $eleSetIgnore.concat($eleSet);
|
876 |
+
} else {
|
877 |
+
$eleSets.push($eleSet);
|
878 |
+
}
|
879 |
+
$eleSet = new Array();
|
880 |
+
}
|
881 |
+
if ($curr.is('p.submit')) break;
|
882 |
+
$eleSet.push(curr);
|
883 |
+
} else {
|
884 |
+
// handle ingnore bag - works only before the first set is created
|
885 |
+
var pushto = $eleSet;
|
886 |
+
if ($eleSets.length == 0 && $curr.is("input[type='hidden']"))
|
887 |
+
{
|
888 |
+
pushto = $eleSetIgnore;
|
889 |
+
}
|
890 |
+
pushto.push(curr);
|
891 |
+
}
|
892 |
+
}
|
893 |
+
|
894 |
+
// if the page has only one set, quit
|
895 |
+
if ($eleSets.length < 2) return;
|
896 |
+
|
897 |
+
// tabify
|
898 |
+
formid = 'tabulator-tabs-form-' + f;
|
899 |
+
jQuery($eleSetIgnore).filter(':last').after('<div id="' + formid + '"></div>');
|
900 |
+
jQuery('#'+formid).prepend("<ul><\/ul>");
|
901 |
+
var tabcounter = 0;
|
902 |
+
jQuery.each($eleSets, function() {
|
903 |
+
tabcounter++;
|
904 |
+
id = formid + '-tab-' + tabcounter;
|
905 |
+
hash3 = true;
|
906 |
+
h3probe = jQuery(this).filter('h3').eq(0);
|
907 |
+
if (h3probe.is('h3')) {
|
908 |
+
caption = h3probe.text();
|
909 |
+
} else {
|
910 |
+
hash3 = false;
|
911 |
+
caption = jQuery('#wpbody .wrap h2').eq(0).text();
|
912 |
+
}
|
913 |
+
if (caption == ''){
|
914 |
+
caption = 'FALLBACK';
|
915 |
+
}
|
916 |
+
tabdiv = jQuery(this).wrapAll('<span id="'+id+'"></span>');
|
917 |
+
jQuery('#'+formid+' > ul').append('<li><a href="#'+id+'"><span>'+caption+"<\/span><\/a><\/li>");
|
918 |
+
if (hash3) h3probe.hide();
|
919 |
+
});
|
920 |
+
jQuery('#'+formid+' > ul').tabs();
|
921 |
+
});
|
922 |
+
}
|
923 |
+
|
924 |
+
/**
|
925 |
+
* inittialize tabs for breadcrumb navxt admin panel
|
926 |
+
*/
|
927 |
+
function bcn_admin_init_tabs()
|
928 |
+
{
|
929 |
+
jQuery('#hasadmintabs').prepend("<ul><\/ul>");
|
930 |
+
jQuery('#hasadmintabs > fieldset').each(function(i)
|
931 |
+
{
|
932 |
+
id = jQuery(this).attr('id');
|
933 |
+
caption = jQuery(this).find('h3').text();
|
934 |
+
jQuery('#hasadmintabs > ul').append('<li><a href="#'+id+'"><span>'+caption+"<\/span><\/a><\/li>");
|
935 |
+
jQuery(this).find('h3').hide();
|
936 |
+
});
|
937 |
+
jQuery("#hasadmintabs > ul").tabs();
|
938 |
+
}
|
939 |
+
/* ]]> */
|
940 |
+
</script>
|
941 |
<?php
|
942 |
}
|
943 |
|
947 |
add_action('activate_breadcrumb-navxt/breadcrumb_navxt_admin.php','bcn_install');
|
948 |
//WordPress Admin interface hook
|
949 |
add_action('admin_menu', 'bcn_add_page');
|
950 |
+
//add_action('admin_head', 'bcn_options_style');
|
951 |
//Enque javscript dependencies
|
952 |
//wp_enqueue_script('jquery-ui-tabs');
|
953 |
//Admin Options hook
|
breadcrumb_navxt_class.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Breadcrumb NavXT - Core
|
4 |
Plugin URI: http://mtekk.weblogs.us/code/breadcrumb-navxt/
|
5 |
Description: Adds a breadcrumb navigation showing the visitor's path to their current location. This plug-in provides direct access to the bcn_breadcrumb class without using the administrative interface. For details on how to use this plugin visit <a href="http://mtekk.weblogs.us/code/breadcrumb-navxt/">Breadcrumb NavXT</a>.
|
6 |
-
Version: 2.1.
|
7 |
Author: John Havlik
|
8 |
Author URI: http://mtekk.weblogs.us/
|
9 |
*/
|
@@ -23,7 +23,7 @@ Author URI: http://mtekk.weblogs.us/
|
|
23 |
along with this program; if not, write to the Free Software
|
24 |
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
25 |
*/
|
26 |
-
$bcn_version = "2.1.
|
27 |
//The main class
|
28 |
class bcn_breadcrumb
|
29 |
{
|
@@ -186,13 +186,17 @@ class bcn_breadcrumb
|
|
186 |
function do_title()
|
187 |
{
|
188 |
//If there are static front pages we need to make sure that link shows up as well as the blog title.
|
189 |
-
if(get_option('show_on_front') == 'page')
|
190 |
{
|
191 |
//Single posts, archives of all types, and the author pages are descendents of "blog"
|
192 |
-
if(is_page()
|
|
|
|
|
|
|
|
|
193 |
{
|
194 |
$this->breadcrumb['title'] = array();
|
195 |
-
$this->breadcrumb['title'][] = '<a title="' . $this->opt['urltitle_prefix'] . $this->opt['
|
196 |
$this->breadcrumb['title'][] = '<a title="' . $this->opt['urltitle_prefix'] . $this->opt['title_blog'] . $this->opt['urltitle_suffix'] . '" href="' . $this->opt['url_home'] . $this->opt['url_blog'] . '">' . $this->opt['title_blog'] . '</a>';
|
197 |
}
|
198 |
//If it's on the blog page but we don't link current
|
@@ -367,10 +371,10 @@ class bcn_breadcrumb
|
|
367 |
//Trim post title if needed
|
368 |
if($this->opt['posttitle_maxlen'] > 0 && (strlen($bcn_post_title) + 3) > $this->opt['posttitle_maxlen'])
|
369 |
{
|
370 |
-
$
|
371 |
$bcn_count = $this->opt['posttitle_maxlen'];
|
372 |
-
//Make sure we can split at a space
|
373 |
-
if(strpos($bcn_post_title, " "
|
374 |
{
|
375 |
//Don't split mid word
|
376 |
while(substr($bcn_post_title,-1) != " ")
|
3 |
Plugin Name: Breadcrumb NavXT - Core
|
4 |
Plugin URI: http://mtekk.weblogs.us/code/breadcrumb-navxt/
|
5 |
Description: Adds a breadcrumb navigation showing the visitor's path to their current location. This plug-in provides direct access to the bcn_breadcrumb class without using the administrative interface. For details on how to use this plugin visit <a href="http://mtekk.weblogs.us/code/breadcrumb-navxt/">Breadcrumb NavXT</a>.
|
6 |
+
Version: 2.1.4
|
7 |
Author: John Havlik
|
8 |
Author URI: http://mtekk.weblogs.us/
|
9 |
*/
|
23 |
along with this program; if not, write to the Free Software
|
24 |
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
25 |
*/
|
26 |
+
$bcn_version = "2.1.4";
|
27 |
//The main class
|
28 |
class bcn_breadcrumb
|
29 |
{
|
186 |
function do_title()
|
187 |
{
|
188 |
//If there are static front pages we need to make sure that link shows up as well as the blog title.
|
189 |
+
if(get_option('show_on_front') == 'page' && $this->opt['home_display'] === 'true')
|
190 |
{
|
191 |
//Single posts, archives of all types, and the author pages are descendents of "blog"
|
192 |
+
if(is_page())
|
193 |
+
{
|
194 |
+
$this->breadcrumb['title'] = '<a title="' . $this->opt['urltitle_prefix'] . $this->opt['title_home'] . $this->opt['urltitle_suffix'] . '" href="' . $this->opt['url_home'] . '">' . $this->opt['title_home'] . '</a>';
|
195 |
+
}
|
196 |
+
else if(is_single() || is_archive() || is_author() || (is_home() && $this->opt['link_current_item'] === 'true'))
|
197 |
{
|
198 |
$this->breadcrumb['title'] = array();
|
199 |
+
$this->breadcrumb['title'][] = '<a title="' . $this->opt['urltitle_prefix'] . $this->opt['title_home'] . $this->opt['urltitle_suffix'] . '" href="' . $this->opt['url_home'] . '">' . $this->opt['title_home'] . '</a>';
|
200 |
$this->breadcrumb['title'][] = '<a title="' . $this->opt['urltitle_prefix'] . $this->opt['title_blog'] . $this->opt['urltitle_suffix'] . '" href="' . $this->opt['url_home'] . $this->opt['url_blog'] . '">' . $this->opt['title_blog'] . '</a>';
|
201 |
}
|
202 |
//If it's on the blog page but we don't link current
|
371 |
//Trim post title if needed
|
372 |
if($this->opt['posttitle_maxlen'] > 0 && (strlen($bcn_post_title) + 3) > $this->opt['posttitle_maxlen'])
|
373 |
{
|
374 |
+
$bcn_post_title = substr($bcn_post_title, 0, $this->opt['posttitle_maxlen'] - 1);
|
375 |
$bcn_count = $this->opt['posttitle_maxlen'];
|
376 |
+
//Make sure we can split at a space, but we want to limmit to cutting at max an additional 25%
|
377 |
+
if(strpos($bcn_post_title, " ", 3 * $this->opt['posttitle_maxlen'] / 4) > 0)
|
378 |
{
|
379 |
//Don't split mid word
|
380 |
while(substr($bcn_post_title,-1) != " ")
|
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
Contributors: mtekk, hakre
|
3 |
Tags: breadcrumb, navigation
|
4 |
Requires at least: 2.5.0
|
5 |
-
Tested up to: 2.
|
6 |
-
Stable tag: 2.1.
|
7 |
|
8 |
Adds breadcrumb navigation showing the visitor's path to their current location.
|
9 |
|
2 |
Contributors: mtekk, hakre
|
3 |
Tags: breadcrumb, navigation
|
4 |
Requires at least: 2.5.0
|
5 |
+
Tested up to: 2.6
|
6 |
+
Stable tag: 2.1.4
|
7 |
|
8 |
Adds breadcrumb navigation showing the visitor's path to their current location.
|
9 |
|