Breadcrumb NavXT - Version 3.4.1

Version Description

  • Bug fix: Fixed issue with PHP unexpected $end on line 1567 in breadcrumb_navxt_admin.php.
  • Bug fix: Fixed issue where the %link% anchor tag would not be replaced with a URI for flat taxonomies (e.g. tags).
  • Bug fix: Fixed issue where paged breadcrumbs would cause WP_Error objects to be thrown.
Download this release

Release Info

Developer mtekk
Plugin Icon 128x128 Breadcrumb NavXT
Version 3.4.1
Comparing to
See all releases

Code changes from version 3.4.0 to 3.4.1

Files changed (3) hide show
  1. breadcrumb_navxt_admin.php +1585 -1565
  2. breadcrumb_navxt_class.php +4 -4
  3. readme.txt +6 -3
breadcrumb_navxt_admin.php CHANGED
@@ -1,1566 +1,1586 @@
1
- <?php
2
- /*
3
- Plugin Name: Breadcrumb NavXT
4
- Plugin URI: http://mtekk.weblogs.us/code/breadcrumb-navxt/
5
- Description: Adds a breadcrumb navigation showing the visitor&#39;s path to their current location. For details on how to use this plugin visit <a href="http://mtekk.weblogs.us/code/breadcrumb-navxt/">Breadcrumb NavXT</a>.
6
- Version: 3.4.0
7
- Author: John Havlik
8
- Author URI: http://mtekk.weblogs.us/
9
- */
10
- /* Copyright 2007-2009 John Havlik (email : mtekkmonkey@gmail.com)
11
-
12
- This program is free software; you can redistribute it and/or modify
13
- it under the terms of the GNU General Public License as published by
14
- the Free Software Foundation; either version 2 of the License, or
15
- (at your option) any later version.
16
-
17
- This program is distributed in the hope that it will be useful,
18
- but WITHOUT ANY WARRANTY; without even the implied warranty of
19
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
- GNU General Public License for more details.
21
-
22
- You should have received a copy of the GNU General Public License
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
- //Include the breadcrumb class
27
- require_once(dirname(__FILE__) . '/breadcrumb_navxt_class.php');
28
- //Include the supplemental functions
29
- require_once(dirname(__FILE__) . '/breadcrumb_navxt_api.php');
30
- /**
31
- * The administrative interface class
32
- *
33
- * @since 3.0.0
34
- */
35
- class bcn_admin
36
- {
37
- /**
38
- * local store for breadcrumb version
39
- *
40
- * Example: String '3.1.0'
41
- *
42
- * @var string
43
- * @since 3.1.0
44
- */
45
- private $version = '3.4.0';
46
-
47
- /**
48
- * wether or not this administration page has contextual help
49
- *
50
- * @var bool
51
- * @since 3.2
52
- */
53
- private $_has_contextual_help = false;
54
-
55
- /**
56
- * local store for the breadcrumb object
57
- *
58
- * @see bcn_admin()
59
- * @var bcn_breadcrumb
60
- * @since 3.0
61
- */
62
- public $breadcrumb_trail;
63
- /**
64
- * bcn_admin
65
- *
66
- * Administrative interface class default constructor
67
- */
68
- function bcn_admin()
69
- {
70
- //We'll let it fail fataly if the class isn't there as we depend on it
71
- $this->breadcrumb_trail = new bcn_breadcrumb_trail;
72
- //Installation Script hook
73
- add_action('activate_breadcrumb-navxt/breadcrumb_navxt_admin.php', array($this, 'install'));
74
- //Initilizes l10n domain
75
- $this->local();
76
- //WordPress Admin interface hook
77
- add_action('admin_menu', array($this, 'add_page'));
78
- //WordPress Hook for the widget
79
- add_action('plugins_loaded', array($this, 'register_widget'));
80
- //Admin Options update hook
81
- if(isset($_POST['bcn_admin_options']))
82
- {
83
- //Temporarily add update function on init if form has been submitted
84
- add_action('init', array($this, 'update'));
85
- }
86
- //Admin Options reset hook
87
- if(isset($_POST['bcn_admin_reset']))
88
- {
89
- //Temporarily add reset function on init if reset form has been submitted
90
- add_action('init', array($this, 'reset'));
91
- }
92
- //Admin Options export hook
93
- else if(isset($_POST['bcn_admin_export']))
94
- {
95
- //Temporarily add export function on init if export form has been submitted
96
- add_action('init', array($this, 'export'));
97
- }
98
- //Admin Options import hook
99
- else if(isset($_FILES['bcn_admin_import_file']) && !empty($_FILES['bcn_admin_import_file']['name']))
100
- {
101
- //Temporarily add import function on init if import form has been submitted
102
- add_action('init', array($this, 'import'));
103
- }
104
- //Admin Init Hook
105
- add_action('admin_init', array($this, 'admin_init'));
106
- }
107
- /**
108
- * admin initialisation callback function
109
- *
110
- * is bound to wpordpress action 'admin_init' on instantiation
111
- *
112
- * @since 3.2.0
113
- * @return void
114
- */
115
- public function admin_init()
116
- {
117
- // Register options.
118
- register_setting($option_group = 'bcn_admin', $option_name = 'bcn_options', $sanitize_callback = '');
119
- //Add in the nice "settings" link to the plugins page
120
- add_filter('plugin_action_links', array($this, 'filter_plugin_actions'), 10, 2);
121
- //Add javascript enqeueing callback
122
- add_action('wp_print_scripts', array($this, 'javascript'));
123
- }
124
- /**
125
- * security
126
- *
127
- * Makes sure the current user can manage options to proceed
128
- */
129
- function security()
130
- {
131
- //If the user can not manage options we will die on them
132
- if(!current_user_can('manage_options'))
133
- {
134
- _e('Insufficient privileges to proceed.', 'breadcrumb_navxt');
135
- die();
136
- }
137
- }
138
- /**
139
- * install
140
- *
141
- * This sets up and upgrades the database settings, runs on every activation
142
- */
143
- function install()
144
- {
145
- //Call our little security function
146
- $this->security();
147
- //Initilize the options
148
- $this->breadcrumb_trail = new bcn_breadcrumb_trail;
149
- //Reduce db queries by saving this
150
- $db_version = $this->get_option('bcn_version');
151
- //If our version is not the same as in the db, time to update
152
- if($db_version !== $this->version)
153
- {
154
- //Split up the db version into it's components
155
- list($major, $minor, $release) = explode('.', $db_version);
156
- //For upgrading from 2.x.x
157
- if($major == 2)
158
- {
159
- //Delete old options
160
- $delete_options = array
161
- (
162
- 'bcn_preserve', 'bcn_static_frontpage', 'bcn_url_blog',
163
- 'bcn_home_display', 'bcn_home_link', 'bcn_title_home',
164
- 'bcn_title_blog', 'bcn_separator', 'bcn_search_prefix',
165
- 'bcn_search_suffix', 'bcn_author_prefix', 'bcn_author_suffix',
166
- 'bcn_author_display', 'bcn_singleblogpost_prefix',
167
- 'bcn_singleblogpost_suffix', 'bcn_page_prefix', 'bcn_page_suffix',
168
- 'bcn_urltitle_prefix', 'bcn_urltitle_suffix',
169
- 'bcn_archive_category_prefix', 'bcn_archive_category_suffix',
170
- 'bcn_archive_date_prefix', 'bcn_archive_date_suffix',
171
- 'bcn_archive_date_format', 'bcn_attachment_prefix',
172
- 'bcn_attachment_suffix', 'bcn_archive_tag_prefix',
173
- 'bcn_archive_tag_suffix', 'bcn_title_404', 'bcn_link_current_item',
174
- 'bcn_current_item_urltitle', 'bcn_current_item_style_prefix',
175
- 'bcn_current_item_style_suffix', 'bcn_posttitle_maxlen',
176
- 'bcn_paged_display', 'bcn_paged_prefix', 'bcn_paged_suffix',
177
- 'bcn_singleblogpost_taxonomy', 'bcn_singleblogpost_taxonomy_display',
178
- 'bcn_singleblogpost_category_prefix', 'bcn_singleblogpost_category_suffix',
179
- 'bcn_singleblogpost_tag_prefix', 'bcn_singleblogpost_tag_suffix'
180
- );
181
- foreach ($delete_options as $option)
182
- {
183
- $this->delete_option($option);
184
- }
185
- }
186
- else if($major == 3 && $minor == 0)
187
- {
188
- //Update our internal settings
189
- $this->breadcrumb_trail->opt = $this->get_option('bcn_options');
190
- $this->breadcrumb_trail->opt['search_anchor'] = __('<a title="Go to the first page of search results for %title%." href="%link%">','breadcrumb_navxt');
191
- }
192
- else if($major == 3 && $minor < 3)
193
- {
194
- //Update our internal settings
195
- $this->breadcrumb_trail->opt = $this->get_option('bcn_options');
196
- $this->breadcrumb_trail->opt['blog_display'] = true;
197
- }
198
- else if($major == 3 && $minor < 4)
199
- {
200
- //Inline upgrade of the tag setting
201
- if($this->breadcrumb_trail->opt['post_taxonomy_type'] === 'tag')
202
- {
203
- $this->breadcrumb_trail->opt['post_taxonomy_type'] = 'post_tag';
204
- }
205
- //Fix our tag settings
206
- $this->breadcrumb_trail->opt['archive_post_tag_prefix'] = $this->breadcrumb_trail->opt['archive_tag_prefix'];
207
- $this->breadcrumb_trail->opt['archive_post_tag_suffix'] = $this->breadcrumb_trail->opt['archive_tag_suffix'];
208
- $this->breadcrumb_trail->opt['post_tag_prefix'] = $this->breadcrumb_trail->opt['tag_prefix'];
209
- $this->breadcrumb_trail->opt['post_tag_suffix'] = $this->breadcrumb_trail->opt['tag_suffix'];
210
- $this->breadcrumb_trail->opt['post_tag_anchor'] = $this->breadcrumb_trail->opt['tag_anchor'];
211
- }
212
- //Always have to update the version
213
- $this->update_option('bcn_version', $this->version);
214
- //Store the options
215
- $this->add_option('bcn_options', $this->breadcrumb_trail->opt);
216
- }
217
- //Check if we have valid anchors
218
- if($temp = $this->get_option('bcn_options'))
219
- {
220
- //Missing the blog anchor is a bug from 3.0.0/3.0.1 so we soft error that one
221
- if(strlen($temp['blog_anchor']) == 0)
222
- {
223
- $temp['blog_anchor'] = $this->breadcrumb_trail->opt['blog_anchor'];
224
- $this->update_option('bcn_options', $temp);
225
- }
226
- else if(strlen($temp['home_anchor']) == 0 ||
227
- strlen($temp['blog_anchor']) == 0 ||
228
- strlen($temp['page_anchor']) == 0 ||
229
- strlen($temp['post_anchor']) == 0 ||
230
- strlen($temp['tag_anchor']) == 0 ||
231
- strlen($temp['date_anchor']) == 0 ||
232
- strlen($temp['category_anchor']) == 0)
233
- {
234
- $this->delete_option('bcn_options');
235
- $this->add_option('bcn_options', $this->breadcrumb_trail->opt);
236
- }
237
- }
238
- }
239
- /**
240
- * reset
241
- *
242
- * Resets the options to the default values
243
- */
244
- function reset()
245
- {
246
- $this->security();
247
- //Do a nonce check, prevent malicious link/form problems
248
- check_admin_referer('bcn_admin_upload');
249
- //Only needs this one line, will load in the hard coded default option values
250
- $this->update_option('bcn_options', $this->breadcrumb_trail->opt);
251
- //Reset successful, let the user know
252
- add_action('admin_notices', array($this, 'notify_reset'));
253
- }
254
- /**
255
- * export
256
- *
257
- * Exports the database settings to a XML document
258
- */
259
- function export()
260
- {
261
- $this->security();
262
- //Do a nonce check, prevent malicious link/form problems
263
- check_admin_referer('bcn_admin_upload');
264
- //Update our internal settings
265
- $this->breadcrumb_trail->opt = $this->get_option('bcn_options', true);
266
- //Create a DOM document
267
- $dom = new DOMDocument('1.0', 'UTF-8');
268
- //Adds in newlines and tabs to the output
269
- $dom->formatOutput = true;
270
- //We're not using a DTD therefore we need to specify it as a standalone document
271
- $dom->xmlStandalone = true;
272
- //Add an element called options
273
- $node = $dom->createElement('options');
274
- $parnode = $dom->appendChild($node);
275
- //Add a child element named plugin
276
- $node = $dom->createElement('plugin');
277
- $plugnode = $parnode->appendChild($node);
278
- //Add some attributes that identify the plugin and version for the options export
279
- $plugnode->setAttribute('name', 'breadcrumb_navxt');
280
- $plugnode->setAttribute('version', $this->version);
281
- //Change our headder to text/xml for direct save
282
- header('Cache-Control: public');
283
- //The next two will cause good browsers to download instead of displaying the file
284
- header('Content-Description: File Transfer');
285
- header('Content-disposition: attachemnt; filename=bcn_settings.xml');
286
- header('Content-Type: text/xml');
287
- //Loop through the options array
288
- foreach($this->breadcrumb_trail->opt as $key=>$option)
289
- {
290
- //Add a option tag under the options tag, store the option value
291
- $node = $dom->createElement('option', $option);
292
- $newnode = $plugnode->appendChild($node);
293
- //Change the tag's name to that of the stored option
294
- $newnode->setAttribute('name', $key);
295
- }
296
- //Prepair the XML for output
297
- $output = $dom->saveXML();
298
- //Let the browser know how long the file is
299
- header('Content-Length: ' . strlen($output)); // binary length
300
- //Output the file
301
- echo $output;
302
- //Prevent WordPress from continuing on
303
- die();
304
- }
305
- /**
306
- * import
307
- *
308
- * Imports a XML options document
309
- */
310
- function import()
311
- {
312
- //Our quick and dirty error supressor
313
- function error($errno, $errstr, $eerfile, $errline)
314
- {
315
- return true;
316
- }
317
- $this->security();
318
- //Do a nonce check, prevent malicious link/form problems
319
- check_admin_referer('bcn_admin_upload');
320
- //Create a DOM document
321
- $dom = new DOMDocument('1.0', 'UTF-8');
322
- //We want to catch errors ourselves
323
- set_error_handler('error');
324
- //Load the user uploaded file, handle failure gracefully
325
- if($dom->load($_FILES['bcn_admin_import_file']['tmp_name']))
326
- {
327
- //Have to use an xpath query otherwise we run into problems
328
- $xpath = new DOMXPath($dom);
329
- $option_sets = $xpath->query('plugin');
330
- //Loop through all of the xpath query results
331
- foreach($option_sets as $options)
332
- {
333
- //We only want to import options for Breadcrumb NavXT
334
- if($options->getAttribute('name') === 'breadcrumb_navxt')
335
- {
336
- //Do a quick version check
337
- list($plug_major, $plug_minor, $plug_release) = explode('.', $this->version);
338
- list($major, $minor, $release) = explode('.', $options->getAttribute('version'));
339
- //We don't support using newer versioned option files in older releases
340
- if($plug_major == $major && $plug_minor >= $minor)
341
- {
342
- //Loop around all of the options
343
- foreach($options->getelementsByTagName('option') as $child)
344
- {
345
- //Place the option into the option array, DOMDocument decodes html entities for us
346
- $this->breadcrumb_trail->opt[$child->getAttribute('name')] = $child->nodeValue;
347
- }
348
- }
349
- }
350
- }
351
- //Commit the loaded options to the database
352
- $this->update_option('bcn_options', $this->breadcrumb_trail->opt);
353
- //Everything was successful, let the user know
354
- add_action('admin_notices', array($this, 'notify_import_success'));
355
- }
356
- else
357
- {
358
- //Throw an error since we could not load the file for various reasons
359
- add_action('admin_notices', array($this, 'notify_import_failure'));
360
- }
361
- //Reset to the default error handler after we're done
362
- restore_error_handler();
363
- }
364
- /**
365
- * update
366
- *
367
- * Updates the database settings from the webform
368
- */
369
- function update()
370
- {
371
- global $wp_taxonomies;
372
- $this->security();
373
- //Do a nonce check, prevent malicious link/form problems
374
- check_admin_referer('bcn_admin-options');
375
-
376
- //Grab the options from the from post
377
- //Home page settings
378
- $this->breadcrumb_trail->opt['home_display'] = str2bool(bcn_get('home_display', 'false'));
379
- $this->breadcrumb_trail->opt['blog_display'] = str2bool(bcn_get('blog_display', 'false'));
380
- $this->breadcrumb_trail->opt['home_title'] = bcn_get('home_title');
381
- $this->breadcrumb_trail->opt['home_anchor'] = bcn_get('home_anchor', $this->breadcrumb_trail->opt['home_anchor']);
382
- $this->breadcrumb_trail->opt['blog_anchor'] = bcn_get('blog_anchor', $this->breadcrumb_trail->opt['blog_anchor']);
383
- $this->breadcrumb_trail->opt['home_prefix'] = bcn_get('home_prefix');
384
- $this->breadcrumb_trail->opt['home_suffix'] = bcn_get('home_suffix');
385
- $this->breadcrumb_trail->opt['separator'] = bcn_get('separator');
386
- $this->breadcrumb_trail->opt['max_title_length'] = (int) bcn_get('max_title_length');
387
- //Current item settings
388
- $this->breadcrumb_trail->opt['current_item_linked'] = str2bool(bcn_get('current_item_linked', 'false'));
389
- $this->breadcrumb_trail->opt['current_item_anchor'] = bcn_get('current_item_anchor', $this->breadcrumb_trail->opt['current_item_anchor']);
390
- $this->breadcrumb_trail->opt['current_item_prefix'] = bcn_get('current_item_prefix');
391
- $this->breadcrumb_trail->opt['current_item_suffix'] = bcn_get('current_item_suffix');
392
- //Paged settings
393
- $this->breadcrumb_trail->opt['paged_prefix'] = bcn_get('paged_prefix');
394
- $this->breadcrumb_trail->opt['paged_suffix'] = bcn_get('paged_suffix');
395
- $this->breadcrumb_trail->opt['paged_display'] = str2bool(bcn_get('paged_display', 'false'));
396
- //Page settings
397
- $this->breadcrumb_trail->opt['page_prefix'] = bcn_get('page_prefix');
398
- $this->breadcrumb_trail->opt['page_suffix'] = bcn_get('page_suffix');
399
- $this->breadcrumb_trail->opt['page_anchor'] = bcn_get('page_anchor', $this->breadcrumb_trail->opt['page_anchor']);
400
- //Post related options
401
- $this->breadcrumb_trail->opt['post_prefix'] = bcn_get('post_prefix');
402
- $this->breadcrumb_trail->opt['post_suffix'] = bcn_get('post_suffix');
403
- $this->breadcrumb_trail->opt['post_anchor'] = bcn_get('post_anchor', $this->breadcrumb_trail->opt['post_anchor']);
404
- $this->breadcrumb_trail->opt['post_taxonomy_display'] = str2bool(bcn_get('post_taxonomy_display', 'false'));
405
- $this->breadcrumb_trail->opt['post_taxonomy_type'] = bcn_get('post_taxonomy_type');
406
- //Attachment settings
407
- $this->breadcrumb_trail->opt['attachment_prefix'] = bcn_get('attachment_prefix');
408
- $this->breadcrumb_trail->opt['attachment_suffix'] = bcn_get('attachment_suffix');
409
- //404 page settings
410
- $this->breadcrumb_trail->opt['404_prefix'] = bcn_get('404_prefix');
411
- $this->breadcrumb_trail->opt['404_suffix'] = bcn_get('404_suffix');
412
- $this->breadcrumb_trail->opt['404_title'] = bcn_get('404_title');
413
- //Search page settings
414
- $this->breadcrumb_trail->opt['search_prefix'] = bcn_get('search_prefix');
415
- $this->breadcrumb_trail->opt['search_suffix'] = bcn_get('search_suffix');
416
- $this->breadcrumb_trail->opt['search_anchor'] = bcn_get('search_anchor', $this->breadcrumb_trail->opt['search_anchor']);
417
- //Tag settings
418
- $this->breadcrumb_trail->opt['post_tag_prefix'] = bcn_get('post_tag_prefix');
419
- $this->breadcrumb_trail->opt['post_tag_suffix'] = bcn_get('post_tag_suffix');
420
- $this->breadcrumb_trail->opt['post_tag_anchor'] = bcn_get('post_tag_anchor', $this->breadcrumb_trail->opt['post_tag_anchor']);
421
- //Author page settings
422
- $this->breadcrumb_trail->opt['author_prefix'] = bcn_get('author_prefix');
423
- $this->breadcrumb_trail->opt['author_suffix'] = bcn_get('author_suffix');
424
- $this->breadcrumb_trail->opt['author_display'] = bcn_get('author_display');
425
- //Category settings
426
- $this->breadcrumb_trail->opt['category_prefix'] = bcn_get('category_prefix');
427
- $this->breadcrumb_trail->opt['category_suffix'] = bcn_get('category_suffix');
428
- $this->breadcrumb_trail->opt['category_anchor'] = bcn_get('category_anchor', $this->breadcrumb_trail->opt['category_anchor']);
429
- //Archive settings
430
- $this->breadcrumb_trail->opt['archive_category_prefix'] = bcn_get('archive_category_prefix');
431
- $this->breadcrumb_trail->opt['archive_category_suffix'] = bcn_get('archive_category_suffix');
432
- $this->breadcrumb_trail->opt['archive_post_tag_prefix'] = bcn_get('archive_post_tag_prefix');
433
- $this->breadcrumb_trail->opt['archive_post_tag_suffix'] = bcn_get('archive_post_tag_suffix');
434
- //Archive by date settings
435
- $this->breadcrumb_trail->opt['date_anchor'] = bcn_get('date_anchor', $this->breadcrumb_trail->opt['date_anchor']);
436
- $this->breadcrumb_trail->opt['archive_date_prefix'] = bcn_get('archive_date_prefix');
437
- $this->breadcrumb_trail->opt['archive_date_suffix'] = bcn_get('archive_date_suffix');
438
- //Loop through all of the taxonomies in the array
439
- foreach($wp_taxonomies as $taxonomy)
440
- {
441
- //We only want custom taxonomies
442
- if($taxonomy->object_type == 'post' && ($taxonomy->name != 'post_tag' && $taxonomy->name != 'category'))
443
- {
444
- $this->breadcrumb_trail->opt[$taxonomy->name . '_prefix'] = bcn_get($taxonomy->name . '_prefix');
445
- $this->breadcrumb_trail->opt[$taxonomy->name . '_suffix'] = bcn_get($taxonomy->name . '_suffix');
446
- $this->breadcrumb_trail->opt[$taxonomy->name . '_anchor'] = bcn_get($taxonomy->name . '_anchor', $this->breadcrumb_trail->opt['post_tag_anchor']);
447
- $this->breadcrumb_trail->opt['archive_' . $taxonomy->name . '_prefix'] = bcn_get('archive_' . $taxonomy->name . '_prefix');
448
- $this->breadcrumb_trail->opt['archive_' . $taxonomy->name . '_suffix'] = bcn_get('archive_' . $taxonomy->name . '_suffix');
449
- }
450
- }
451
- //Commit the option changes
452
- $this->update_option('bcn_options', $this->breadcrumb_trail->opt);
453
- }
454
- /**
455
- * display
456
- *
457
- * Outputs the breadcrumb trail
458
- *
459
- * @param (bool) $return Whether to return or echo the trail.
460
- * @param (bool) $linked Whether to allow hyperlinks in the trail or not.
461
- * @param (bool) $reverse Whether to reverse the output or not.
462
- */
463
- function display($return = false, $linked = true, $reverse = false)
464
- {
465
- //Update our internal settings
466
- $this->breadcrumb_trail->opt = $this->get_option('bcn_options');
467
- //Generate the breadcrumb trail
468
- $this->breadcrumb_trail->fill();
469
- return $this->breadcrumb_trail->display($return, $linked, $reverse);
470
- }
471
- /**
472
- * display_list
473
- *
474
- * Outputs the breadcrumb trail
475
- *
476
- * @since 3.2.0
477
- * @param (bool) $return Whether to return or echo the trail.
478
- * @param (bool) $linked Whether to allow hyperlinks in the trail or not.
479
- * @param (bool) $reverse Whether to reverse the output or not.
480
- */
481
- function display_list($return = false, $linked = true, $reverse = false)
482
- {
483
- //Update our internal settings
484
- $this->breadcrumb_trail->opt = $this->get_option('bcn_options');
485
- //Generate the breadcrumb trail
486
- $this->breadcrumb_trail->fill();
487
- return $this->breadcrumb_trail->display_list($return, $linked, $reverse);
488
- }
489
- /**
490
- * widget
491
- *
492
- * The sidebar widget
493
- */
494
- function widget($args)
495
- {
496
- extract($args);
497
- //Manditory before widget junk
498
- echo $before_widget;
499
- //Display the breadcrumb trial
500
- if($this->breadcrumb_trail->trail[0] != NULL)
501
- {
502
- $this->breadcrumb_trail->display();
503
- }
504
- else
505
- {
506
- $this->display();
507
- }
508
- //Manditory after widget junk
509
- echo $after_widget;
510
- }
511
- /**
512
- * register_widget
513
- *
514
- * Registers the sidebar widget
515
- */
516
- function register_widget()
517
- {
518
- register_sidebar_widget('Breadcrumb NavXT', array($this, 'widget'));
519
- }
520
- /**
521
- * filter_plugin_actions
522
- *
523
- * Places in a link to the settings page in the plugins listing entry
524
- *
525
- * @param (array) $links An array of links that are output in the listing
526
- * @param (string) $file The file that is currently in processing
527
- * @return (array) Array of links that are output in the listing.
528
- */
529
- function filter_plugin_actions($links, $file)
530
- {
531
- static $this_plugin;
532
- if(!$this_plugin)
533
- {
534
- $this_plugin = plugin_basename(__FILE__);
535
- }
536
- //Make sure we are adding only for Breadcrumb NavXT
537
- if($file == $this_plugin)
538
- {
539
- //Setup the link string
540
- $settings_link = '<a href="options-general.php?page=breadcrumb-navxt">' . __('Settings') . '</a>';
541
- //Add it to the end of the array to better integrate into the WP 2.8 plugins page
542
- $links[] = $settings_link;
543
- }
544
- return $links;
545
- }
546
- /**
547
- * javascript
548
- *
549
- * Enqueues JS dependencies (jquery) for the tabs
550
- *
551
- * @see admin_init()
552
- * @return void
553
- */
554
- function javascript()
555
- {
556
- //Enqueue ui-tabs
557
- wp_enqueue_script('jquery-ui-tabs');
558
- }
559
- /**
560
- * local
561
- *
562
- * Initilizes localization textdomain for translations (if applicable)
563
- *
564
- * normally there is no need to load it because it is already loaded with
565
- * the breadcrumb class. if not, then it will be loaded.
566
- *
567
- * @return void
568
- */
569
- function local()
570
- {
571
- // the global and the check might become obsolete in
572
- // further wordpress versions
573
- // @see https://core.trac.wordpress.org/ticket/10527
574
- global $l10n;
575
- $domain = 'breadcrumb_navxt';
576
- if (!isset( $l10n[$domain] ))
577
- {
578
- load_plugin_textdomain($domain, false, 'breadcrumb-navxt/languages');
579
- }
580
- }
581
- /**
582
- * add_page
583
- *
584
- * Adds the adminpage the menue and the nice little settings link
585
- *
586
- * @return void
587
- */
588
- function add_page()
589
- {
590
- // check capability of user to manage options (access control)
591
- if(current_user_can('manage_options'))
592
- {
593
- //Add the submenu page to "settings" menu
594
- $hookname = add_submenu_page('options-general.php', __('Breadcrumb NavXT Settings', 'breadcrumb_navxt'), 'Breadcrumb NavXT', 'manage_options', 'breadcrumb-navxt', array($this, 'admin_panel'));
595
- //Register admin_head-$hookname callback
596
- add_action('admin_head-'.$hookname, array($this, 'admin_head'));
597
- //Register Help Output
598
- add_action('contextual_help', array($this, 'contextual_help'), 10, 2);
599
- }
600
- }
601
-
602
- /**
603
- * contextual_help action hook function
604
- *
605
- * @param string $contextual_help
606
- * @param string $screen
607
- * @return string
608
- */
609
- function contextual_help($contextual_help, $screen)
610
- {
611
- // add contextual help on current screen
612
- if ($screen == 'settings_page_breadcrumb-navxt')
613
- {
614
- $contextual_help = $this->_get_contextual_help();
615
- $this->_has_contextual_help = true;
616
- }
617
- return $contextual_help;
618
- }
619
-
620
- /**
621
- * get contextual help
622
- *
623
- * @return string
624
- */
625
- private function _get_contextual_help()
626
- {
627
- $t = $this->_get_help_text();
628
- $t = sprintf('<div class="metabox-prefs">%s</div>', $t);
629
- $title = __('Breadcrumb NavXT Settings', 'breadcrumb_navxt');
630
- $t = sprintf('<h5>%s</h5>%s', sprintf(__('Get help with "%s"'), $title), $t);
631
- return $t;
632
- }
633
-
634
- /**
635
- * get help text
636
- *
637
- * @return string
638
- */
639
- private function _get_help_text()
640
- {
641
- return sprintf(__('Tips for the settings are located below select options. Please refer to the %sdocumentation%s for more information.', 'breadcrumb_navxt'),
642
- '<a title="' . __('Go to the Breadcrumb NavXT online documentation', 'breadcrumb_navxt') . '" href="http://mtekk.weblogs.us/code/breadcrumb-navxt/breadcrumb-navxt-doc/">', '</a>');
643
- }
644
-
645
- /**
646
- * admin_head
647
- *
648
- * Adds in the JavaScript and CSS for the tabs in the adminsitrative
649
- * interface
650
- *
651
- */
652
- function admin_head()
653
- {
654
- // print style and script element (should go into head element)
655
- ?>
656
- <style type="text/css">
657
- /**
658
- * Tabbed Admin Page (CSS)
659
- *
660
- * @see Breadcrumb NavXT (Wordpress Plugin)
661
- * @author Tom Klingenberg
662
- * @colordef #c6d9e9 light-blue (older tabs border color, obsolete)
663
- * @colordef #dfdfdf light-grey (tabs border color)
664
- * @colordef #f9f9f9 very-light-grey (admin standard background color)
665
- * @colordef #fff white (active tab background color)
666
- */
667
- #hasadmintabs ul.ui-tabs-nav {border-bottom:1px solid #dfdfdf; font-size:12px; height:29px; list-style-image:none; list-style-position:outside; list-style-type:none; margin:13px 0 0; overflow:visible; padding:0 0 0 8px;}
668
- #hasadmintabs ul.ui-tabs-nav li {display:block; float:left; line-height:200%; list-style-image:none; list-style-position:outside; list-style-type:none; margin:0; padding:0; position:relative; text-align:center; white-space:nowrap; width:auto;}
669
- #hasadmintabs ul.ui-tabs-nav li a {background:transparent none no-repeat scroll 0 50%; border-bottom:1px solid #dfdfdf; display:block; float:left; line-height:28px; padding:1px 13px 0; position:relative; text-decoration:none;}
670
- #hasadmintabs ul.ui-tabs-nav li.ui-tabs-selected a{-moz-border-radius-topleft:4px; -moz-border-radius-topright:4px;border:1px solid #dfdfdf; border-bottom-color:#f9f9f9; color:#333333; font-weight:normal; padding:0 12px;}
671
- #hasadmintabs ul.ui-tabs-nav a:focus, a:active {outline-color:-moz-use-text-color; outline-style:none; outline-width:medium;}
672
- #screen-options-wrap p.submit {margin:0; padding:0;}
673
- </style>
674
- <script type="text/javascript">
675
- /* <![CDATA[ */
676
- /**
677
- * Breadcrumb NavXT Admin Page (javascript/jQuery)
678
- *
679
- * unobtrusive approach to add tabbed forms into
680
- * the wordpress admin panel and various other
681
- * stuff that needs javascript with the Admin Panel.
682
- *
683
- * @see Breadcrumb NavXT (Wordpress Plugin)
684
- * @author Tom Klingenberg
685
- * @author John Havlik
686
- * @uses jQuery
687
- * @uses jQuery.ui.tabs
688
- */
689
- jQuery(function()
690
- {
691
- bcn_context_init();
692
- bcn_tabulator_init();
693
- });
694
- function bcn_confirm(type)
695
- {
696
- if(type == 'reset'){
697
- var answer = confirm("<?php _e('All of your current Breadcrumb NavXT settings will be overwritten with the default values. Are you sure you want to continue?', 'breadcrumb_navxt'); ?>");
698
- }
699
- else{
700
- var answer = confirm("<?php _e('All of your current Breadcrumb NavXT settings will be overwritten with the imported values. Are you sure you want to continue?', 'breadcrumb_navxt'); ?>");
701
- }
702
- if(answer)
703
- return true;
704
- else
705
- return false;
706
- }
707
- /**
708
- * Tabulator Bootup
709
- */
710
- function bcn_tabulator_init(){
711
- /* if this is not the breadcrumb admin page, quit */
712
- if (!jQuery("#hasadmintabs").length) return;
713
- /* init markup for tabs */
714
- jQuery('#hasadmintabs').prepend("<ul><\/ul>");
715
- jQuery('#hasadmintabs > fieldset').each(function(i){
716
- id = jQuery(this).attr('id');
717
- caption = jQuery(this).find('h3').text();
718
- jQuery('#hasadmintabs > ul').append('<li><a href="#'+id+'"><span>'+caption+"<\/span><\/a><\/li>");
719
- jQuery(this).find('h3').hide();
720
- });
721
- /* init the tabs plugin */
722
- var jquiver = undefined == jQuery.ui ? [0,0,0] : undefined == jQuery.ui.version ? [0,1,0] : jQuery.ui.version.split('.');
723
- switch(true){
724
- // tabs plugin has been fixed to work on the parent element again.
725
- case jquiver[0] >= 1 && jquiver[1] >= 7:
726
- jQuery("#hasadmintabs").tabs();
727
- break;
728
- // tabs plugin has bug and needs to work on ul directly.
729
- default:
730
- jQuery("#hasadmintabs > ul").tabs();
731
- }
732
- /* handler for opening the last tab after submit (compability version) */
733
- jQuery('#hasadmintabs ul a').click(function(i){
734
- var form = jQuery('#bcn_admin_options');
735
- var action = form.attr("action").split('#', 1) + jQuery(this).attr('href');
736
- // an older bug pops up with some jQuery version(s), which makes it
737
- // necessary to set the form's action attribute by standard javascript
738
- // node access:
739
- form.get(0).setAttribute("action", action);
740
- });
741
- }
742
- /**
743
- * context screen options for import/export
744
- */
745
- function bcn_context_init(){
746
- if (!jQuery("#bcn_import_export_relocate").length) return;
747
- var jqver = undefined == jQuery.fn.jquery ? [0,0,0] : jQuery.fn.jquery.split('.');
748
- jQuery('#screen-meta').prepend(
749
- '<div id="screen-options-wrap" class="hidden"></div>'
750
- );
751
- jQuery('#screen-meta-links').append(
752
- '<div id="screen-options-link-wrap" class="hide-if-no-js screen-meta-toggle">' +
753
- '<a class="show-settings" id="show-settings-link" href="#screen-options"><?php printf('%s/%s/%s', __('Import', 'breadcrumb_navxt'), __('Export', 'breadcrumb_navxt'), __('Reset', 'breadcrumb_navxt')); ?></a>' +
754
- '</div>'
755
- );
756
- // jQuery Version below 1.3 (common for WP 2.7) needs some other style-classes
757
- // and jQuery events
758
- if (jqver[0] <= 1 && jqver[1] < 3){
759
- // hide-if-no-js for WP 2.8, not for WP 2.7
760
- jQuery('#screen-options-link-wrap').removeClass('hide-if-no-js');
761
- // screen settings tab (WP 2.7 legacy)
762
- jQuery('#show-settings-link').click(function () {
763
- if ( ! jQuery('#screen-options-wrap').hasClass('screen-options-open') ) {
764
- jQuery('#contextual-help-link-wrap').addClass('invisible');
765
- }
766
- jQuery('#screen-options-wrap').slideToggle('fast', function(){
767
- if ( jQuery(this).hasClass('screen-options-open') ) {
768
- jQuery('#show-settings-link').css({'backgroundImage':'url("images/screen-options-right.gif")'});
769
- jQuery('#contextual-help-link-wrap').removeClass('invisible');
770
- jQuery(this).removeClass('screen-options-open');
771
- } else {
772
- jQuery('#show-settings-link').css({'backgroundImage':'url("images/screen-options-right-up.gif")'});
773
- jQuery(this).addClass('screen-options-open');
774
- }
775
- });
776
- return false;
777
- });
778
- }
779
- var code = jQuery('#bcn_import_export_relocate').html();
780
- jQuery('#bcn_import_export_relocate').html('');
781
- code = code.replace(/h3>/gi, 'h5>');
782
- jQuery('#screen-options-wrap').prepend(code);
783
- }
784
- /* ]]> */
785
- </script>
786
- <?php
787
- } //function admin_head()
788
-
789
- /**
790
- * admin_panel
791
- *
792
- * The administrative panel for Breadcrumb NavXT
793
- *
794
- */
795
- function admin_panel()
796
- {
797
- global $wp_taxonomies;
798
- $this->security();
799
- //Update our internal options array, use form safe function
800
- $this->breadcrumb_trail->opt = $this->get_option('bcn_options', true);
801
- ?>
802
- <div class="wrap"><h2><?php _e('Breadcrumb NavXT Settings', 'breadcrumb_navxt'); ?></h2>
803
- <p<?php if ($this->_has_contextual_help): ?> class="hide-if-js"<?php endif; ?>><?php
804
- print $this->_get_help_text();
805
- ?></p>
806
- <form action="options-general.php?page=breadcrumb-navxt" method="post" id="bcn_admin_options">
807
- <?php
808
- settings_fields('bcn_admin');
809
- ?>
810
- <div id="hasadmintabs">
811
- <fieldset id="general" class="bcn_options">
812
- <h3><?php _e('General', 'breadcrumb_navxt'); ?></h3>
813
- <table class="form-table">
814
- <tr valign="top">
815
- <th scope="row">
816
- <label for="separator"><?php _e('Breadcrumb Separator', 'breadcrumb_navxt'); ?></label>
817
- </th>
818
- <td>
819
- <input type="text" name="separator" id="separator" value="<?php echo $this->breadcrumb_trail->opt['separator']; ?>" size="32" /><br />
820
- <span class="setting-description"><?php _e('Placed in between each breadcrumb.', 'breadcrumb_navxt'); ?></span>
821
- </td>
822
- </tr>
823
- <tr valign="top">
824
- <th scope="row">
825
- <label for="max_title_length"><?php _e('Breadcrumb Max Title Length', 'breadcrumb_navxt'); ?></label>
826
- </th>
827
- <td>
828
- <input type="text" name="max_title_length" id="max_title_length" value="<?php echo $this->breadcrumb_trail->opt['max_title_length'];?>" size="10" />
829
- </td>
830
- </tr>
831
- <tr valign="top">
832
- <th scope="row">
833
- <?php _e('Home Breadcrumb', 'breadcrumb_navxt'); ?>
834
- </th>
835
- <td>
836
- <label>
837
- <input name="home_display" type="checkbox" id="home_display" value="true" <?php checked(true, $this->breadcrumb_trail->opt['home_display']); ?> />
838
- <?php _e('Place the home breadcrumb in the trail.', 'breadcrumb_navxt'); ?>
839
- </label><br />
840
- <ul>
841
- <li>
842
- <label for="home_title">
843
- <?php _e('Home Title: ','breadcrumb_navxt');?>
844
- <input type="text" name="home_title" id="home_title" value="<?php echo $this->breadcrumb_trail->opt['home_title']; ?>" size="20" />
845
- </label>
846
- </li>
847
- </ul>
848
- </td>
849
- </tr>
850
- <tr valign="top">
851
- <th scope="row">
852
- <label for="blog_display"><?php _e('Blog Breadcrumb', 'breadcrumb_navxt'); ?></label>
853
- </th>
854
- <td>
855
- <label>
856
- <input name="blog_display" <?php if($this->get_option('show_on_front') !== "page"){echo 'disabled="disabled" class="disabled"';} ?> type="checkbox" id="blog_display" value="true" <?php checked(true, $this->breadcrumb_trail->opt['blog_display']); ?> />
857
- <?php _e('Place the blog breadcrumb in the trail.', 'breadcrumb_navxt'); ?>
858
- </label>
859
- </td>
860
- </tr>
861
- <tr valign="top">
862
- <th scope="row">
863
- <label for="home_prefix"><?php _e('Home Prefix', 'breadcrumb_navxt'); ?></label>
864
- </th>
865
- <td>
866
- <input type="text" name="home_prefix" id="home_prefix" value="<?php echo $this->breadcrumb_trail->opt['home_prefix']; ?>" size="32" />
867
- </td>
868
- </tr>
869
- <tr valign="top">
870
- <th scope="row">
871
- <label for="home_suffix"><?php _e('Home Suffix', 'breadcrumb_navxt'); ?></label>
872
- </th>
873
- <td>
874
- <input type="text" name="home_suffix" id="home_suffix" value="<?php echo $this->breadcrumb_trail->opt['home_suffix']; ?>" size="32" />
875
- </td>
876
- </tr>
877
- <tr valign="top">
878
- <th scope="row">
879
- <label for="home_anchor"><?php _e('Home Anchor', 'breadcrumb_navxt'); ?></label>
880
- </th>
881
- <td>
882
- <input type="text" name="home_anchor" id="home_anchor" value="<?php echo $this->breadcrumb_trail->opt['home_anchor']; ?>" size="60" /><br />
883
- <span class="setting-description"><?php _e('The anchor template for the home breadcrumb.', 'breadcrumb_navxt'); ?></span>
884
- </td>
885
- </tr>
886
- <tr valign="top">
887
- <th scope="row">
888
- <label for="blog_anchor"><?php _e('Blog Anchor', 'breadcrumb_navxt'); ?></label>
889
- </th>
890
- <td>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
891
  <input type="text" <?php if($this->get_option('show_on_front') !== "page"){echo 'disabled="disabled" class="disabled"';} ?> name="blog_anchor" id="blog_anchor" value="<?php echo $this->breadcrumb_trail->opt['blog_anchor']; ?>" size="60" /><br />
892
- <span class="setting-description"><?php _e('The anchor template for the blog breadcrumb, used only in static front page environments.', 'breadcrumb_navxt'); ?></span>
893
- </td>
894
- </tr>
895
- </table>
896
- </fieldset>
897
- <fieldset id="current" class="bcn_options">
898
- <h3><?php _e('Current Item', 'breadcrumb_navxt'); ?></h3>
899
- <table class="form-table">
900
- <tr valign="top">
901
- <th scope="row">
902
- <label for="current_item_linked"><?php _e('Link Current Item', 'breadcrumb_navxt'); ?></label>
903
- </th>
904
- <td>
905
- <label>
906
- <input name="current_item_linked" type="checkbox" id="current_item_linked" value="true" <?php checked(true, $this->breadcrumb_trail->opt['current_item_linked']); ?> />
907
- <?php _e('Yes'); ?>
908
- </label>
909
- </td>
910
- </tr>
911
- <tr valign="top">
912
- <th scope="row">
913
- <label for="current_item_prefix"><?php _e('Current Item Prefix', 'breadcrumb_navxt'); ?></label>
914
- </th>
915
- <td>
916
- <input type="text" name="current_item_prefix" id="current_item_prefix" value="<?php echo $this->breadcrumb_trail->opt['current_item_prefix']; ?>" size="32" /><br />
917
- <span class="setting-description"><?php _e('This is always placed in front of the last breadcrumb in the trail, before any other prefixes for that breadcrumb.', 'breadcrumb_navxt'); ?></span>
918
- </td>
919
- </tr>
920
- <tr valign="top">
921
- <th scope="row">
922
- <label for="current_item_suffix"><?php _e('Current Item Suffix', 'breadcrumb_navxt'); ?></label>
923
- </th>
924
- <td>
925
- <input type="text" name="current_item_suffix" id="current_item_suffix" value="<?php echo $this->breadcrumb_trail->opt['current_item_suffix']; ?>" size="32" /><br />
926
- <span class="setting-description"><?php _e('This is always placed after the last breadcrumb in the trail, and after any other prefixes for that breadcrumb.', 'breadcrumb_navxt'); ?></span>
927
- </td>
928
- </tr>
929
- <tr valign="top">
930
- <th scope="row">
931
- <label for="current_item_anchor"><?php _e('Current Item Anchor', 'breadcrumb_navxt'); ?></label>
932
- </th>
933
- <td>
934
- <input type="text" name="current_item_anchor" id="current_item_anchor" value="<?php echo $this->breadcrumb_trail->opt['current_item_anchor']; ?>" size="60" /><br />
935
- <span class="setting-description"><?php _e('The anchor template for current item breadcrumbs.', 'breadcrumb_navxt'); ?></span>
936
- </td>
937
- </tr>
938
- <tr valign="top">
939
- <th scope="row">
940
- <label for="paged_display"><?php _e('Paged Breadcrumb', 'breadcrumb_navxt'); ?></label>
941
- </th>
942
- <td>
943
- <label>
944
- <input name="paged_display" type="checkbox" id="paged_display" value="true" <?php checked(true, $this->breadcrumb_trail->opt['paged_display']); ?> />
945
- <?php _e('Include the paged breadcrumb in the breadcrumb trail.', 'breadcrumb_navxt'); ?>
946
- </label><br />
947
- <span class="setting-description"><?php _e('Indicates that the user is on a page other than the first on paginated posts/pages.', 'breadcrumb_navxt'); ?></span>
948
- </td>
949
- </tr>
950
- <tr valign="top">
951
- <th scope="row">
952
- <label for="paged_prefix"><?php _e('Paged Prefix', 'breadcrumb_navxt'); ?></label>
953
- </th>
954
- <td>
955
- <input type="text" name="paged_prefix" id="paged_prefix" value="<?php echo $this->breadcrumb_trail->opt['paged_prefix']; ?>" size="32" />
956
- </td>
957
- </tr>
958
- <tr valign="top">
959
- <th scope="row">
960
- <label for="paged_suffix"><?php _e('Paged Suffix', 'breadcrumb_navxt'); ?></label>
961
- </th>
962
- <td>
963
- <input type="text" name="paged_suffix" id="paged_suffix" value="<?php echo $this->breadcrumb_trail->opt['paged_suffix']; ?>" size="32" />
964
- </td>
965
- </tr>
966
- </table>
967
- </fieldset>
968
- <fieldset id="single" class="bcn_options">
969
- <h3><?php _e('Posts &amp; Pages', 'breadcrumb_navxt'); ?></h3>
970
- <table class="form-table">
971
- <tr valign="top">
972
- <th scope="row">
973
- <label for="post_prefix"><?php _e('Post Prefix', 'breadcrumb_navxt'); ?></label>
974
- </th>
975
- <td>
976
- <input type="text" name="post_prefix" id="post_prefix" value="<?php echo $this->breadcrumb_trail->opt['post_prefix']; ?>" size="32" />
977
- </td>
978
- </tr>
979
- <tr valign="top">
980
- <th scope="row">
981
- <label for="post_suffix"><?php _e('Post Suffix', 'breadcrumb_navxt'); ?></label>
982
- </th>
983
- <td>
984
- <input type="text" name="post_suffix" id="post_suffix" value="<?php echo $this->breadcrumb_trail->opt['post_suffix']; ?>" size="32" />
985
- </td>
986
- </tr>
987
- <tr valign="top">
988
- <th scope="row">
989
- <label for="post_anchor"><?php _e('Post Anchor', 'breadcrumb_navxt'); ?></label>
990
- </th>
991
- <td>
992
- <input type="text" name="post_anchor" id="post_anchor" value="<?php echo $this->breadcrumb_trail->opt['post_anchor']; ?>" size="60" /><br />
993
- <span class="setting-description"><?php _e('The anchor template for post breadcrumbs.', 'breadcrumb_navxt'); ?></span>
994
- </td>
995
- </tr>
996
- <tr valign="top">
997
- <th scope="row">
998
- <?php _e('Post Taxonomy Display', 'breadcrumb_navxt'); ?>
999
- </th>
1000
- <td>
1001
- <label for="post_taxonomy_display">
1002
- <input name="post_taxonomy_display" type="checkbox" id="post_taxonomy_display" value="true" <?php checked(true, $this->breadcrumb_trail->opt['post_taxonomy_display']); ?> />
1003
- <?php _e('Show the taxonomy leading to a post in the breadcrumb trail.', 'breadcrumb_navxt'); ?>
1004
- </label>
1005
- </td>
1006
- </tr>
1007
- <tr valign="top">
1008
- <th scope="row">
1009
- <?php _e('Post Taxonomy', 'breadcrumb_navxt'); ?>
1010
- </th>
1011
- <td>
1012
- <label>
1013
- <input name="post_taxonomy_type" type="radio" value="category" class="togx" <?php checked('category', $this->breadcrumb_trail->opt['post_taxonomy_type']); ?> />
1014
- <?php _e('Categories'); ?>
1015
- </label>
1016
- <br/>
1017
- <label>
1018
- <input name="post_taxonomy_type" type="radio" value="date" class="togx" <?php checked('date', $this->breadcrumb_trail->opt['post_taxonomy_type']); ?> />
1019
- <?php _e('Dates'); ?>
1020
- </label>
1021
- <br/>
1022
- <label>
1023
- <input name="post_taxonomy_type" type="radio" value="post_tag" class="togx" <?php checked('post_tag', $this->breadcrumb_trail->opt['post_taxonomy_type']); ?> />
1024
- <?php _e('Tags'); ?>
1025
- </label>
1026
- <br/>
1027
- <?php
1028
- //Loop through all of the taxonomies in the array
1029
- foreach($wp_taxonomies as $taxonomy)
1030
- {
1031
- //We only want custom taxonomies
1032
- if($taxonomy->object_type == 'post' && ($taxonomy->name != 'post_tag' && $taxonomy->name != 'category'))
1033
- {
1034
- ?>
1035
- <label>
1036
- <input name="post_taxonomy_type" type="radio" value="<?php echo $taxonomy->name; ?>" class="togx" <?php checked($taxonomy->name, $this->breadcrumb_trail->opt['post_taxonomy_type']); ?> />
1037
- <?php echo ucwords(__($taxonomy->label)); ?>
1038
- </label>
1039
- <br/>
1040
- <?
1041
- }
1042
- }
1043
- ?>
1044
- <span class="setting-description"><?php _e('The taxonomy which the breadcrumb trail will show.', 'breadcrumb_navxt'); ?></span>
1045
- </td>
1046
- </tr>
1047
- <tr valign="top">
1048
- <th scope="row">
1049
- <label for="page_prefix"><?php _e('Page Prefix', 'breadcrumb_navxt'); ?></label>
1050
- </th>
1051
- <td>
1052
- <input type="text" name="page_prefix" id="page_prefix" value="<?php echo $this->breadcrumb_trail->opt['page_prefix']; ?>" size="32" />
1053
- </td>
1054
- </tr>
1055
- <tr valign="top">
1056
- <th scope="row">
1057
- <label for="page_suffix"><?php _e('Page Suffix', 'breadcrumb_navxt'); ?></label>
1058
- </th>
1059
- <td>
1060
- <input type="text" name="page_suffix" id="page_suffix" value="<?php echo $this->breadcrumb_trail->opt['page_suffix']; ?>" size="32" />
1061
- </td>
1062
- </tr>
1063
- <tr valign="top">
1064
- <th scope="row">
1065
- <label for="page_anchor"><?php _e('Page Anchor', 'breadcrumb_navxt'); ?></label>
1066
- </th>
1067
- <td>
1068
- <input type="text" name="page_anchor" id="page_anchor" value="<?php echo $this->breadcrumb_trail->opt['page_anchor']; ?>" size="60" /><br />
1069
- <span class="setting-description"><?php _e('The anchor template for page breadcrumbs.', 'breadcrumb_navxt'); ?></span>
1070
- </td>
1071
- </tr>
1072
- <tr valign="top">
1073
- <th scope="row">
1074
- <label for="attachment_prefix"><?php _e('Attachment Prefix', 'breadcrumb_navxt'); ?></label>
1075
- </th>
1076
- <td>
1077
- <input type="text" name="attachment_prefix" id="attachment_prefix" value="<?php echo $this->breadcrumb_trail->opt['attachment_prefix']; ?>" size="32" />
1078
- </td>
1079
- </tr>
1080
- <tr valign="top">
1081
- <th scope="row">
1082
- <label for="attachment_suffix"><?php _e('Attachment Suffix', 'breadcrumb_navxt'); ?></label>
1083
- </th>
1084
- <td>
1085
- <input type="text" name="attachment_suffix" id="attachment_suffix" value="<?php echo $this->breadcrumb_trail->opt['attachment_suffix']; ?>" size="32" />
1086
- </td>
1087
- </tr>
1088
- </table>
1089
- </fieldset>
1090
- <fieldset id="category" class="bcn_options">
1091
- <h3><?php _e('Categories', 'breadcrumb_navxt'); ?></h3>
1092
- <table class="form-table">
1093
- <tr valign="top">
1094
- <th scope="row">
1095
- <label for="category_prefix"><?php _e('Category Prefix', 'breadcrumb_navxt'); ?></label>
1096
- </th>
1097
- <td>
1098
- <input type="text" name="category_prefix" id="category_prefix" value="<?php echo $this->breadcrumb_trail->opt['category_prefix']; ?>" size="32" /><br />
1099
- <span class="setting-description"><?php _e('Applied before the anchor on all category breadcrumbs.', 'breadcrumb_navxt'); ?></span>
1100
- </td>
1101
- </tr>
1102
- <tr valign="top">
1103
- <th scope="row">
1104
- <label for="category_suffix"><?php _e('Category Suffix', 'breadcrumb_navxt'); ?></label>
1105
- </th>
1106
- <td>
1107
- <input type="text" name="category_suffix" id="category_suffix" value="<?php echo $this->breadcrumb_trail->opt['category_suffix']; ?>" size="32" /><br />
1108
- <span class="setting-description"><?php _e('Applied after the anchor on all category breadcrumbs.', 'breadcrumb_navxt'); ?></span>
1109
- </td>
1110
- </tr>
1111
- <tr valign="top">
1112
- <th scope="row">
1113
- <label for="category_anchor"><?php _e('Category Anchor', 'breadcrumb_navxt'); ?></label>
1114
- </th>
1115
- <td>
1116
- <input type="text" name="category_anchor" id="category_anchor" value="<?php echo $this->breadcrumb_trail->opt['category_anchor']; ?>" size="60" /><br />
1117
- <span class="setting-description"><?php _e('The anchor template for category breadcrumbs.', 'breadcrumb_navxt'); ?></span>
1118
- </td>
1119
- </tr>
1120
- <tr valign="top">
1121
- <th scope="row">
1122
- <label for="archive_category_prefix"><?php _e('Archive by Category Prefix', 'breadcrumb_navxt'); ?></label>
1123
- </th>
1124
- <td>
1125
- <input type="text" name="archive_category_prefix" id="archive_category_prefix" value="<?php echo $this->breadcrumb_trail->opt['archive_category_prefix']; ?>" size="32" /><br />
1126
- <span class="setting-description"><?php _e('Applied before the title of the current item breadcrumb on an archive by cateogry page.', 'breadcrumb_navxt'); ?></span>
1127
- </td>
1128
- </tr>
1129
- <tr valign="top">
1130
- <th scope="row">
1131
- <label for="archive_category_suffix"><?php _e('Archive by Category Suffix', 'breadcrumb_navxt'); ?></label>
1132
- </th>
1133
- <td>
1134
- <input type="text" name="archive_category_suffix" id="archive_category_suffix" value="<?php echo $this->breadcrumb_trail->opt['archive_category_suffix']; ?>" size="32" /><br />
1135
- <span class="setting-description"><?php _e('Applied after the title of the current item breadcrumb on an archive by cateogry page.', 'breadcrumb_navxt'); ?></span>
1136
- </td>
1137
- </tr>
1138
- </table>
1139
- </fieldset>
1140
- <fieldset id="post_tag" class="bcn_options">
1141
- <h3><?php _e('Tags', 'breadcrumb_navxt'); ?></h3>
1142
- <table class="form-table">
1143
- <tr valign="top">
1144
- <th scope="row">
1145
- <label for="post_tag_prefix"><?php _e('Tag Prefix', 'breadcrumb_navxt'); ?></label>
1146
- </th>
1147
- <td>
1148
- <input type="text" name="post_tag_prefix" id="post_tag_prefix" value="<?php echo $this->breadcrumb_trail->opt['post_tag_prefix']; ?>" size="32" /><br />
1149
- <span class="setting-description"><?php _e('Applied before the anchor on all tag breadcrumbs.', 'breadcrumb_navxt'); ?></span>
1150
- </td>
1151
- </tr>
1152
- <tr valign="top">
1153
- <th scope="row">
1154
- <label for="post_tag_suffix"><?php _e('Tag Suffix', 'breadcrumb_navxt'); ?></label>
1155
- </th>
1156
- <td>
1157
- <input type="text" name="post_tag_suffix" id="post_tag_suffix" value="<?php echo $this->breadcrumb_trail->opt['post_tag_suffix']; ?>" size="32" /><br />
1158
- <span class="setting-description"><?php _e('Applied after the anchor on all tag breadcrumbs.', 'breadcrumb_navxt'); ?></span>
1159
- </td>
1160
- </tr>
1161
- <tr valign="top">
1162
- <th scope="row">
1163
- <label for="post_tag_anchor"><?php _e('Tag Anchor', 'breadcrumb_navxt'); ?></label>
1164
- </th>
1165
- <td>
1166
- <input type="text" name="post_tag_anchor" id="post_tag_anchor" value="<?php echo $this->breadcrumb_trail->opt['post_tag_anchor']; ?>" size="60" /><br />
1167
- <span class="setting-description"><?php _e('The anchor template for tag breadcrumbs.', 'breadcrumb_navxt'); ?></span>
1168
- </td>
1169
- </tr>
1170
- <tr valign="top">
1171
- <th scope="row">
1172
- <label for="archive_post_tag_prefix"><?php _e('Archive by Tag Prefix', 'breadcrumb_navxt'); ?></label>
1173
- </th>
1174
- <td>
1175
- <input type="text" name="archive_post_tag_prefix" id="archive_post_tag_prefix" value="<?php echo $this->breadcrumb_trail->opt['archive_post_tag_prefix']; ?>" size="32" /><br />
1176
- <span class="setting-description"><?php _e('Applied before the title of the current item breadcrumb on an archive by tag page.', 'breadcrumb_navxt'); ?></span>
1177
- </td>
1178
- </tr>
1179
- <tr valign="top">
1180
- <th scope="row">
1181
- <label for="archive_post_tag_suffix"><?php _e('Archive by Tag Suffix', 'breadcrumb_navxt'); ?></label>
1182
- </th>
1183
- <td>
1184
- <input type="text" name="archive_post_tag_suffix" id="archive_post_tag_suffix" value="<?php echo $this->breadcrumb_trail->opt['archive_post_tag_suffix']; ?>" size="32" /><br />
1185
- <span class="setting-description"><?php _e('Applied after the title of the current item breadcrumb on an archive by tag page.', 'breadcrumb_navxt'); ?></span>
1186
- </td>
1187
- </tr>
1188
- </table>
1189
- </fieldset>
1190
- <?php
1191
- //Loop through all of the taxonomies in the array
1192
- foreach($wp_taxonomies as $taxonomy)
1193
- {
1194
- //We only want custom taxonomies
1195
- if($taxonomy->object_type == 'post' && ($taxonomy->name != 'post_tag' && $taxonomy->name != 'category'))
1196
- {
1197
- ?>
1198
- <fieldset id="<?php echo $taxonomy->name; ?>" class="bcn_options">
1199
- <h3><?php echo ucwords(__($taxonomy->label)); ?></h3>
1200
- <table class="form-table">
1201
- <tr valign="top">
1202
- <th scope="row">
1203
- <label for="<?php echo $taxonomy->name; ?>_prefix"><?php printf(__('%s Prefix', 'breadcrumb_navxt'), ucwords(__($taxonomy->label))); ?></label>
1204
- </th>
1205
- <td>
1206
- <input type="text" name="<?php echo $taxonomy->name; ?>_prefix" id="<?php echo $taxonomy->name; ?>_prefix" value="<?php echo $this->breadcrumb_trail->opt[$taxonomy->name . '_prefix']; ?>" size="32" /><br />
1207
- <span class="setting-description"><?php printf(__('Applied before the anchor on all %s breadcrumbs.', 'breadcrumb_navxt'), strtolower(__($taxonomy->label))); ?></span>
1208
- </td>
1209
- </tr>
1210
- <tr valign="top">
1211
- <th scope="row">
1212
- <label for="<?php echo $taxonomy->name; ?>_suffix"><?php printf(__('%s Suffix', 'breadcrumb_navxt'), ucwords(__($taxonomy->label))); ?></label>
1213
- </th>
1214
- <td>
1215
- <input type="text" name="<?php echo $taxonomy->name; ?>_suffix" id="<?php echo $taxonomy->name; ?>_suffix" value="<?php echo $this->breadcrumb_trail->opt[$taxonomy->name . '_suffix']; ?>" size="32" /><br />
1216
- <span class="setting-description"><?php printf(__('Applied after the anchor on all %s breadcrumbs.', 'breadcrumb_navxt'), strtolower(__($taxonomy->label))); ?></span>
1217
- </td>
1218
- </tr>
1219
- <tr valign="top">
1220
- <th scope="row">
1221
- <label for="<?php echo $taxonomy->name; ?>_anchor"><?php printf(__('%s Anchor', 'breadcrumb_navxt'), ucwords(__($taxonomy->label))); ?></label>
1222
- </th>
1223
- <td>
1224
- <input type="text" name="<?php echo $taxonomy->name; ?>_anchor" id="<?php echo $taxonomy->name; ?>_anchor" value="<?php echo $this->breadcrumb_trail->opt[$taxonomy->name . '_anchor']; ?>" size="60" /><br />
1225
- <span class="setting-description"><?php printf(__('The anchor template for %s breadcrumbs.', 'breadcrumb_navxt'), strtolower(__($taxonomy->label))); ?></span>
1226
- </td>
1227
- </tr>
1228
- <tr valign="top">
1229
- <th scope="row">
1230
- <label for="archive_<?php echo $taxonomy->name; ?>_prefix"><?php printf(__('Archive by %s Prefix', 'breadcrumb_navxt'), ucwords(__($taxonomy->label))); ?></label>
1231
- </th>
1232
- <td>
1233
- <input type="text" name="archive_<?php echo $taxonomy->name; ?>_prefix" id="archive_<?php echo $taxonomy->name; ?>_prefix" value="<?php echo $this->breadcrumb_trail->opt['archive_' . $taxonomy->name . '_prefix']; ?>" size="32" /><br />
1234
- <span class="setting-description"><?php printf(__('Applied before the title of the current item breadcrumb on an archive by %s page.', 'breadcrumb_navxt'), strtolower(__($taxonomy->label))); ?></span>
1235
- </td>
1236
- </tr>
1237
- <tr valign="top">
1238
- <th scope="row">
1239
- <label for="archive_<?php echo $taxonomy->name; ?>_suffix"><?php printf(__('Archive by %s Suffix', 'breadcrumb_navxt'), ucwords(__($taxonomy->label))); ?></label>
1240
- </th>
1241
- <td>
1242
- <input type="text" name="archive_<?php echo $taxonomy->name; ?>_suffix" id="archive_<?php echo $taxonomy->name; ?>_suffix" value="<?php echo $this->breadcrumb_trail->opt['archive_' . $taxonomy->name . '_suffix']; ?>" size="32" /><br />
1243
- <span class="setting-description"><?php printf(__('Applied after the title of the current item breadcrumb on an archive by %s page.', 'breadcrumb_navxt'), strtolower(__($taxonomy->label))); ?></span>
1244
- </td>
1245
- </tr>
1246
- </table>
1247
- </fieldset>
1248
- <?
1249
- }
1250
- }
1251
- ?>
1252
- <fieldset id="date" class="bcn_options">
1253
- <h3><?php _e('Date Archives', 'breadcrumb_navxt'); ?></h3>
1254
- <table class="form-table">
1255
- <tr valign="top">
1256
- <th scope="row">
1257
- <label for="archive_date_prefix"><?php _e('Archive by Date Prefix', 'breadcrumb_navxt'); ?></label>
1258
- </th>
1259
- <td>
1260
- <input type="text" name="archive_date_prefix" id="archive_date_prefix" value="<?php echo $this->breadcrumb_trail->opt['archive_date_prefix']; ?>" size="32" /><br />
1261
- <span class="setting-description"><?php _e('Applied before the anchor on all date breadcrumbs.', 'breadcrumb_navxt'); ?></span>
1262
- </td>
1263
- </tr>
1264
- <tr valign="top">
1265
- <th scope="row">
1266
- <label for="archive_date_suffix"><?php _e('Archive by Date Suffix', 'breadcrumb_navxt'); ?></label>
1267
- </th>
1268
- <td>
1269
- <input type="text" name="archive_date_suffix" id="archive_date_suffix" value="<?php echo $this->breadcrumb_trail->opt['archive_date_suffix']; ?>" size="32" /><br />
1270
- <span class="setting-description"><?php _e('Applied after the anchor on all date breadcrumbs.', 'breadcrumb_navxt'); ?></span>
1271
- </td>
1272
- </tr>
1273
- <tr valign="top">
1274
- <th scope="row">
1275
- <label for="date_anchor"><?php _e('Date Anchor', 'breadcrumb_navxt'); ?></label>
1276
- </th>
1277
- <td>
1278
- <input type="text" name="date_anchor" id="date_anchor" value="<?php echo $this->breadcrumb_trail->opt['date_anchor']; ?>" size="60" /><br />
1279
- <span class="setting-description"><?php _e('The anchor template for date breadcrumbs.', 'breadcrumb_navxt'); ?></span>
1280
- </td>
1281
- </tr>
1282
- </table>
1283
- </fieldset>
1284
- <fieldset id="miscellaneous" class="bcn_options">
1285
- <h3><?php _e('Miscellaneous', 'breadcrumb_navxt'); ?></h3>
1286
- <table class="form-table">
1287
- <tr valign="top">
1288
- <th scope="row">
1289
- <label for="author_prefix"><?php _e('Author Prefix', 'breadcrumb_navxt'); ?></label>
1290
- </th>
1291
- <td>
1292
- <input type="text" name="author_prefix" id="author_prefix" value="<?php echo $this->breadcrumb_trail->opt['author_prefix']; ?>" size="32" />
1293
- </td>
1294
- </tr>
1295
- <tr valign="top">
1296
- <th scope="row">
1297
- <label for="author_suffix"><?php _e('Author Suffix', 'breadcrumb_navxt'); ?></label>
1298
- </th>
1299
- <td>
1300
- <input type="text" name="author_suffix" id="author_suffix" value="<?php echo $this->breadcrumb_trail->opt['author_suffix']; ?>" size="32" />
1301
- </td>
1302
- </tr>
1303
- <tr valign="top">
1304
- <th scope="row">
1305
- <label for="author_display"><?php _e('Author Display Format', 'breadcrumb_navxt'); ?></label>
1306
- </th>
1307
- <td>
1308
- <select name="author_display" id="author_display">
1309
- <?php $this->select_options('author_display', array("display_name", "nickname", "first_name", "last_name")); ?>
1310
- </select><br />
1311
- <span class="setting-description"><?php _e('display_name uses the name specified in "Display name publicly as" under the user profile the others correspond to options in the user profile.', 'breadcrumb_navxt'); ?></span>
1312
- </td>
1313
- </tr>
1314
- <tr valign="top">
1315
- <th scope="row">
1316
- <label for="search_prefix"><?php _e('Search Prefix', 'breadcrumb_navxt'); ?></label>
1317
- </th>
1318
- <td>
1319
- <input type="text" name="search_prefix" id="search_prefix" value="<?php echo $this->breadcrumb_trail->opt['search_prefix']; ?>" size="32" />
1320
- </td>
1321
- </tr>
1322
- <tr valign="top">
1323
- <th scope="row">
1324
- <label for="search_suffix"><?php _e('Search Suffix', 'breadcrumb_navxt'); ?></label>
1325
- </th>
1326
- <td>
1327
- <input type="text" name="search_suffix" id="search_suffix" value="<?php echo $this->breadcrumb_trail->opt['search_suffix']; ?>" size="32" />
1328
- </td>
1329
- </tr>
1330
- <tr valign="top">
1331
- <th scope="row">
1332
- <label for="search_anchor"><?php _e('Search Anchor', 'breadcrumb_navxt'); ?></label>
1333
- </th>
1334
- <td>
1335
- <input type="text" name="search_anchor" id="search_anchor" value="<?php echo $this->breadcrumb_trail->opt['search_anchor']; ?>" size="60" /><br />
1336
- <span class="setting-description"><?php _e('The anchor template for search breadcrumbs, used only when the search results span several pages.', 'breadcrumb_navxt'); ?></span>
1337
- </td>
1338
- </tr>
1339
- <tr valign="top">
1340
- <th scope="row">
1341
- <label for="id404_title"><?php _e('404 Title', 'breadcrumb_navxt'); ?></label>
1342
- </th>
1343
- <td>
1344
- <input type="text" name="404_title" id="id404_title" value="<?php echo $this->breadcrumb_trail->opt['404_title']; ?>" size="32" />
1345
- </td>
1346
- </tr>
1347
- <tr valign="top">
1348
- <th scope="row">
1349
- <label for="id404_prefix"><?php _e('404 Prefix', 'breadcrumb_navxt'); ?></label>
1350
- </th>
1351
- <td>
1352
- <input type="text" name="404_prefix" id="id404_prefix" value="<?php echo $this->breadcrumb_trail->opt['404_prefix']; ?>" size="32" />
1353
- </td>
1354
- </tr>
1355
- <tr valign="top">
1356
- <th scope="row">
1357
- <label for="id404_suffix"><?php _e('404 Suffix', 'breadcrumb_navxt'); ?></label>
1358
- </th>
1359
- <td>
1360
- <input type="text" name="404_suffix" id="id404_suffix" value="<?php echo $this->breadcrumb_trail->opt['404_suffix']; ?>" size="32" />
1361
- </td>
1362
- </tr>
1363
- </table>
1364
- </fieldset>
1365
- </div>
1366
- <p class="submit"><input type="submit" class="button-primary" name="bcn_admin_options" value="<?php _e('Save Changes') ?>" /></p>
1367
- </form>
1368
- <div id="bcn_import_export_relocate">
1369
- <form action="options-general.php?page=breadcrumb-navxt" method="post" enctype="multipart/form-data" id="bcn_admin_upload">
1370
- <?php wp_nonce_field('bcn_admin_upload');?>
1371
- <fieldset id="import_export" class="bcn_options">
1372
- <h3><?php _e('Import/Export/Reset Settings', 'breadcrumb_navxt'); ?></h3>
1373
- <p><?php _e('Import Breadcrumb NavXT settings from a XML file, export the current settings to a XML file, or reset to the default Breadcrumb NavXT settings.', 'breadcrumb_navxt');?></p>
1374
- <table class="form-table">
1375
- <tr valign="top">
1376
- <th scope="row">
1377
- <label for="bcn_admin_import_file"><?php _e('Settings File', 'breadcrumb_navxt'); ?></label>
1378
- </th>
1379
- <td>
1380
- <input type="file" name="bcn_admin_import_file" id="bcn_admin_import_file" size="32"/><br />
1381
- <span class="setting-description"><?php _e('Select a XML settings file to upload and import settings from.', 'breadcrumb_navxt'); ?></span>
1382
- </td>
1383
- </tr>
1384
- </table>
1385
- <p class="submit">
1386
- <input type="submit" class="button" name="bcn_admin_import" value="<?php _e('Import', 'breadcrumb_navxt') ?>" onclick="return bcn_confirm('import')" />
1387
- <input type="submit" class="button" name="bcn_admin_export" value="<?php _e('Export', 'breadcrumb_navxt') ?>" />
1388
- <input type="submit" class="button" name="bcn_admin_reset" value="<?php _e('Reset', 'breadcrumb_navxt') ?>" onclick="return bcn_confirm('reset')" />
1389
- </p>
1390
- </fieldset>
1391
- </form>
1392
- </div>
1393
- </div>
1394
- <?php
1395
- }
1396
- /**
1397
- * select_options
1398
- *
1399
- * Displays wordpress options as <seclect> options defaults to true/false
1400
- *
1401
- * @param string $optionname name of wordpress options store
1402
- * @param array $options array of names of options that can be selected
1403
- * @param array $exclude[optional] array of names in $options array to be excluded
1404
- */
1405
- function select_options($optionname, $options, $exclude = array())
1406
- {
1407
- $value = $this->breadcrumb_trail->opt[$optionname];
1408
- //First output the current value
1409
- if($value)
1410
- {
1411
- printf('<option>%s</option>', $value);
1412
- }
1413
- //Now do the rest
1414
- foreach($options as $option)
1415
- {
1416
- //Don't want multiple occurance of the current value
1417
- if($option != $value && !in_array($option, $exclude))
1418
- {
1419
- printf('<option>%s</option>', $option);
1420
- }
1421
- }
1422
- }
1423
- /**
1424
- * add_option
1425
- *
1426
- * This inserts the value into the option name, WPMU safe
1427
- *
1428
- * @param (string) key name where to save the value in $value
1429
- * @param (mixed) value to insert into the options db
1430
- * @return (bool)
1431
- */
1432
- function add_option($key, $value)
1433
- {
1434
- return add_option($key, $value);
1435
- }
1436
- /**
1437
- * delete_option
1438
- *
1439
- * This removes the option name, WPMU safe
1440
- *
1441
- * @param (string) key name of the option to remove
1442
- * @return (bool)
1443
- */
1444
- function delete_option($key)
1445
- {
1446
- return delete_option($key);
1447
- }
1448
- /**
1449
- * update_option
1450
- *
1451
- * This updates the value into the option name, WPMU safe
1452
- *
1453
- * @param (string) key name where to save the value in $value
1454
- * @param (mixed) value to insert into the options db
1455
- * @return (bool)
1456
- */
1457
- function update_option($key, $value)
1458
- {
1459
- return update_option($key, $value);
1460
- }
1461
- /**
1462
- * get_option
1463
- *
1464
- * This grabs the the data from the db it is WPMU safe and can place the data
1465
- * in a HTML form safe manner.
1466
- *
1467
- * @param (string) key name of the wordpress option to get
1468
- * @param (bool) safe output for HTML forms (default: false)
1469
- * @return (mixed) value of option
1470
- */
1471
- function get_option($key, $safe = false)
1472
- {
1473
- $db_data = get_option($key);
1474
- if($safe)
1475
- {
1476
- //If we get an array, we should loop through all of its members
1477
- if(is_array($db_data))
1478
- {
1479
- //Loop through all the members
1480
- foreach($db_data as $key=>$item)
1481
- {
1482
- //We ignore anything but strings
1483
- if(is_string($item))
1484
- {
1485
- $db_data[$key] = htmlentities($item, ENT_COMPAT, 'UTF-8');
1486
- }
1487
- }
1488
- }
1489
- else
1490
- {
1491
- $db_data = htmlentities($db_data, ENT_COMPAT, 'UTF-8');
1492
- }
1493
- }
1494
- return $db_data;
1495
- }
1496
- /**
1497
- * notify
1498
- *
1499
- * Output a 'notify' box with a message after an event occurs
1500
- *
1501
- * @param $message string the message to deliver
1502
- * @param $error bool[optional] is the message an error?
1503
- */
1504
- function notify($message, $error = false)
1505
- {
1506
- //If the message is an error use the appropriate class
1507
- $class = $error ? 'error' : 'updated fade';
1508
- printf('<div class="%s"><p>%s</p></div>', $class, $message);
1509
- }
1510
-
1511
- /**
1512
- * callback function for admin_notices
1513
- *
1514
- * @return void
1515
- */
1516
- function notify_import_failure()
1517
- {
1518
- $this->notify(__('Importing settings from file failed.', 'breadcrumb_navxt'), true);
1519
- }
1520
-
1521
- /**
1522
- * callback function for admin_notices
1523
- *
1524
- * @return void
1525
- */
1526
- function notify_import_success()
1527
- {
1528
- $this->notify(__('The Breadcrumb NavXT settings were successfully imported from file.', 'breadcrumb_navxt'));
1529
- }
1530
-
1531
- /**
1532
- * callback function for admin_notices
1533
- *
1534
- * @return void
1535
- */
1536
- function notify_reset()
1537
- {
1538
- $this->notify(__('The Breadcrumb NavXT settings were reset to the default values.', 'breadcrumb_navxt'));
1539
- }
1540
- }
1541
- //Let's make an instance of our object takes care of everything
1542
- $bcn_admin = new bcn_admin;
1543
- /**
1544
- * A wrapper for the internal function in the class
1545
- *
1546
- * @param bool $return Whether to return or echo the trail. (optional)
1547
- * @param bool $linked Whether to allow hyperlinks in the trail or not. (optional)
1548
- * @param bool $reverse Whether to reverse the output or not. (optional)
1549
- */
1550
- function bcn_display($return = false, $linked = true, $reverse = false)
1551
- {
1552
- global $bcn_admin;
1553
- return $bcn_admin->display($return, $linked, $reverse);
1554
- }
1555
- /**
1556
- * A wrapper for the internal function in the class
1557
- *
1558
- * @param bool $return Whether to return or echo the trail. (optional)
1559
- * @param bool $linked Whether to allow hyperlinks in the trail or not. (optional)
1560
- * @param bool $reverse Whether to reverse the output or not. (optional)
1561
- */
1562
- function bcn_display_list($return = false, $linked = true, $reverse = false)
1563
- {
1564
- global $bcn_admin;
1565
- return $bcn_admin->display_list($return, $linked, $reverse);
1566
- }
1
+ <?php
2
+ /*
3
+ Plugin Name: Breadcrumb NavXT
4
+ Plugin URI: http://mtekk.weblogs.us/code/breadcrumb-navxt/
5
+ Description: Adds a breadcrumb navigation showing the visitor&#39;s path to their current location. For details on how to use this plugin visit <a href="http://mtekk.weblogs.us/code/breadcrumb-navxt/">Breadcrumb NavXT</a>.
6
+ Version: 3.4.1
7
+ Author: John Havlik
8
+ Author URI: http://mtekk.weblogs.us/
9
+ */
10
+ /* Copyright 2007-2009 John Havlik (email : mtekkmonkey@gmail.com)
11
+
12
+ This program is free software; you can redistribute it and/or modify
13
+ it under the terms of the GNU General Public License as published by
14
+ the Free Software Foundation; either version 2 of the License, or
15
+ (at your option) any later version.
16
+
17
+ This program is distributed in the hope that it will be useful,
18
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
19
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
+ GNU General Public License for more details.
21
+
22
+ You should have received a copy of the GNU General Public License
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
+ //Include the breadcrumb class
27
+ require_once(dirname(__FILE__) . '/breadcrumb_navxt_class.php');
28
+ //Include the supplemental functions
29
+ require_once(dirname(__FILE__) . '/breadcrumb_navxt_api.php');
30
+ /**
31
+ * The administrative interface class
32
+ *
33
+ * @since 3.0.0
34
+ */
35
+ class bcn_admin
36
+ {
37
+ /**
38
+ * local store for breadcrumb version
39
+ *
40
+ * Example: String '3.1.0'
41
+ *
42
+ * @var string
43
+ * @since 3.1.0
44
+ */
45
+ private $version = '3.4.1';
46
+
47
+ /**
48
+ * wether or not this administration page has contextual help
49
+ *
50
+ * @var bool
51
+ * @since 3.2
52
+ */
53
+ private $_has_contextual_help = false;
54
+
55
+ /**
56
+ * local store for the breadcrumb object
57
+ *
58
+ * @see bcn_admin()
59
+ * @var bcn_breadcrumb
60
+ * @since 3.0
61
+ */
62
+ public $breadcrumb_trail;
63
+ /**
64
+ * bcn_admin
65
+ *
66
+ * Administrative interface class default constructor
67
+ */
68
+ function bcn_admin()
69
+ {
70
+ //We'll let it fail fataly if the class isn't there as we depend on it
71
+ $this->breadcrumb_trail = new bcn_breadcrumb_trail;
72
+ //Installation Script hook
73
+ add_action('activate_breadcrumb-navxt/breadcrumb_navxt_admin.php', array($this, 'install'));
74
+ //Initilizes l10n domain
75
+ $this->local();
76
+ //WordPress Admin interface hook
77
+ add_action('admin_menu', array($this, 'add_page'));
78
+ //WordPress Hook for the widget
79
+ add_action('plugins_loaded', array($this, 'register_widget'));
80
+ //Admin Options update hook
81
+ if(isset($_POST['bcn_admin_options']))
82
+ {
83
+ //Temporarily add update function on init if form has been submitted
84
+ add_action('init', array($this, 'update'));
85
+ }
86
+ //Admin Options reset hook
87
+ if(isset($_POST['bcn_admin_reset']))
88
+ {
89
+ //Temporarily add reset function on init if reset form has been submitted
90
+ add_action('init', array($this, 'reset'));
91
+ }
92
+ //Admin Options export hook
93
+ else if(isset($_POST['bcn_admin_export']))
94
+ {
95
+ //Temporarily add export function on init if export form has been submitted
96
+ add_action('init', array($this, 'export'));
97
+ }
98
+ //Admin Options import hook
99
+ else if(isset($_FILES['bcn_admin_import_file']) && !empty($_FILES['bcn_admin_import_file']['name']))
100
+ {
101
+ //Temporarily add import function on init if import form has been submitted
102
+ add_action('init', array($this, 'import'));
103
+ }
104
+ //Admin Init Hook
105
+ add_action('admin_init', array($this, 'admin_init'));
106
+ }
107
+ /**
108
+ * admin initialisation callback function
109
+ *
110
+ * is bound to wpordpress action 'admin_init' on instantiation
111
+ *
112
+ * @since 3.2.0
113
+ * @return void
114
+ */
115
+ public function admin_init()
116
+ {
117
+ // Register options.
118
+ register_setting($option_group = 'bcn_admin', $option_name = 'bcn_options', $sanitize_callback = '');
119
+ //Add in the nice "settings" link to the plugins page
120
+ add_filter('plugin_action_links', array($this, 'filter_plugin_actions'), 10, 2);
121
+ //Add javascript enqeueing callback
122
+ add_action('wp_print_scripts', array($this, 'javascript'));
123
+ }
124
+ /**
125
+ * security
126
+ *
127
+ * Makes sure the current user can manage options to proceed
128
+ */
129
+ function security()
130
+ {
131
+ //If the user can not manage options we will die on them
132
+ if(!current_user_can('manage_options'))
133
+ {
134
+ _e('Insufficient privileges to proceed.', 'breadcrumb_navxt');
135
+ die();
136
+ }
137
+ }
138
+ /**
139
+ * install
140
+ *
141
+ * This sets up and upgrades the database settings, runs on every activation
142
+ */
143
+ function install()
144
+ {
145
+ //Call our little security function
146
+ $this->security();
147
+ //Initilize the options
148
+ $this->breadcrumb_trail = new bcn_breadcrumb_trail;
149
+ //Reduce db queries by saving this
150
+ $db_version = $this->get_option('bcn_version');
151
+ //If our version is not the same as in the db, time to update
152
+ if($db_version !== $this->version)
153
+ {
154
+ //Split up the db version into it's components
155
+ list($major, $minor, $release) = explode('.', $db_version);
156
+ //For upgrading from 2.x.x
157
+ if($major == 2)
158
+ {
159
+ //Delete old options
160
+ $delete_options = array
161
+ (
162
+ 'bcn_preserve', 'bcn_static_frontpage', 'bcn_url_blog',
163
+ 'bcn_home_display', 'bcn_home_link', 'bcn_title_home',
164
+ 'bcn_title_blog', 'bcn_separator', 'bcn_search_prefix',
165
+ 'bcn_search_suffix', 'bcn_author_prefix', 'bcn_author_suffix',
166
+ 'bcn_author_display', 'bcn_singleblogpost_prefix',
167
+ 'bcn_singleblogpost_suffix', 'bcn_page_prefix', 'bcn_page_suffix',
168
+ 'bcn_urltitle_prefix', 'bcn_urltitle_suffix',
169
+ 'bcn_archive_category_prefix', 'bcn_archive_category_suffix',
170
+ 'bcn_archive_date_prefix', 'bcn_archive_date_suffix',
171
+ 'bcn_archive_date_format', 'bcn_attachment_prefix',
172
+ 'bcn_attachment_suffix', 'bcn_archive_tag_prefix',
173
+ 'bcn_archive_tag_suffix', 'bcn_title_404', 'bcn_link_current_item',
174
+ 'bcn_current_item_urltitle', 'bcn_current_item_style_prefix',
175
+ 'bcn_current_item_style_suffix', 'bcn_posttitle_maxlen',
176
+ 'bcn_paged_display', 'bcn_paged_prefix', 'bcn_paged_suffix',
177
+ 'bcn_singleblogpost_taxonomy', 'bcn_singleblogpost_taxonomy_display',
178
+ 'bcn_singleblogpost_category_prefix', 'bcn_singleblogpost_category_suffix',
179
+ 'bcn_singleblogpost_tag_prefix', 'bcn_singleblogpost_tag_suffix'
180
+ );
181
+ foreach ($delete_options as $option)
182
+ {
183
+ $this->delete_option($option);
184
+ }
185
+ }
186
+ else if($major == 3 && $minor == 0)
187
+ {
188
+ //Update our internal settings
189
+ $this->breadcrumb_trail->opt = $this->get_option('bcn_options');
190
+ //Update our internal settings
191
+ $this->breadcrumb_trail->opt = $this->get_option('bcn_options');
192
+ $this->breadcrumb_trail->opt['search_anchor'] = __('<a title="Go to the first page of search results for %title%." href="%link%">','breadcrumb_navxt');
193
+ }
194
+ else if($major == 3 && $minor < 3)
195
+ {
196
+ //Update our internal settings
197
+ $this->breadcrumb_trail->opt = $this->get_option('bcn_options');
198
+ //Update our internal settings
199
+ $this->breadcrumb_trail->opt = $this->get_option('bcn_options');
200
+ $this->breadcrumb_trail->opt['blog_display'] = true;
201
+ }
202
+ else if($major == 3 && $minor < 4)
203
+ {
204
+ //Update our internal settings
205
+ $this->breadcrumb_trail->opt = $this->get_option('bcn_options');
206
+ //Inline upgrade of the tag setting
207
+ if($this->breadcrumb_trail->opt['post_taxonomy_type'] === 'tag')
208
+ {
209
+ $this->breadcrumb_trail->opt['post_taxonomy_type'] = 'post_tag';
210
+ }
211
+ //Fix our tag settings
212
+ $this->breadcrumb_trail->opt['archive_post_tag_prefix'] = $this->breadcrumb_trail->opt['archive_tag_prefix'];
213
+ $this->breadcrumb_trail->opt['archive_post_tag_suffix'] = $this->breadcrumb_trail->opt['archive_tag_suffix'];
214
+ $this->breadcrumb_trail->opt['post_tag_prefix'] = $this->breadcrumb_trail->opt['tag_prefix'];
215
+ $this->breadcrumb_trail->opt['post_tag_suffix'] = $this->breadcrumb_trail->opt['tag_suffix'];
216
+ $this->breadcrumb_trail->opt['post_tag_anchor'] = $this->breadcrumb_trail->opt['tag_anchor'];
217
+ }
218
+ //Always have to update the version
219
+ $this->update_option('bcn_version', $this->version);
220
+ //Store the options
221
+ $this->add_option('bcn_options', $this->breadcrumb_trail->opt);
222
+ }
223
+ //Check if we have valid anchors
224
+ if($temp = $this->get_option('bcn_options'))
225
+ {
226
+ //Missing the blog anchor is a bug from 3.0.0/3.0.1 so we soft error that one
227
+ if(strlen($temp['blog_anchor']) == 0)
228
+ {
229
+ $temp['blog_anchor'] = $this->breadcrumb_trail->opt['blog_anchor'];
230
+ $this->update_option('bcn_options', $temp);
231
+ }
232
+ else if(strlen($temp['home_anchor']) == 0 ||
233
+ strlen($temp['blog_anchor']) == 0 ||
234
+ strlen($temp['page_anchor']) == 0 ||
235
+ strlen($temp['post_anchor']) == 0 ||
236
+ strlen($temp['tag_anchor']) == 0 ||
237
+ strlen($temp['date_anchor']) == 0 ||
238
+ strlen($temp['category_anchor']) == 0)
239
+ {
240
+ $this->delete_option('bcn_options');
241
+ $this->add_option('bcn_options', $this->breadcrumb_trail->opt);
242
+ }
243
+ }
244
+ }
245
+ /**
246
+ * uninstall
247
+ *
248
+ * This removes database settings upon deletion of the plugin from WordPress
249
+ */
250
+ function uninstall()
251
+ {
252
+ //Call our little security function
253
+ $this->security();
254
+ //Remove the option array setting
255
+ $this->delete_option('bcn_options');
256
+ //Remove the version setting
257
+ $this->delete_option('bcn_version');
258
+ }
259
+ /**
260
+ * reset
261
+ *
262
+ * Resets the options to the default values
263
+ */
264
+ function reset()
265
+ {
266
+ $this->security();
267
+ //Do a nonce check, prevent malicious link/form problems
268
+ check_admin_referer('bcn_admin_upload');
269
+ //Only needs this one line, will load in the hard coded default option values
270
+ $this->update_option('bcn_options', $this->breadcrumb_trail->opt);
271
+ //Reset successful, let the user know
272
+ add_action('admin_notices', array($this, 'notify_reset'));
273
+ }
274
+ /**
275
+ * export
276
+ *
277
+ * Exports the database settings to a XML document
278
+ */
279
+ function export()
280
+ {
281
+ $this->security();
282
+ //Do a nonce check, prevent malicious link/form problems
283
+ check_admin_referer('bcn_admin_upload');
284
+ //Update our internal settings
285
+ $this->breadcrumb_trail->opt = $this->get_option('bcn_options', true);
286
+ //Create a DOM document
287
+ $dom = new DOMDocument('1.0', 'UTF-8');
288
+ //Adds in newlines and tabs to the output
289
+ $dom->formatOutput = true;
290
+ //We're not using a DTD therefore we need to specify it as a standalone document
291
+ $dom->xmlStandalone = true;
292
+ //Add an element called options
293
+ $node = $dom->createElement('options');
294
+ $parnode = $dom->appendChild($node);
295
+ //Add a child element named plugin
296
+ $node = $dom->createElement('plugin');
297
+ $plugnode = $parnode->appendChild($node);
298
+ //Add some attributes that identify the plugin and version for the options export
299
+ $plugnode->setAttribute('name', 'breadcrumb_navxt');
300
+ $plugnode->setAttribute('version', $this->version);
301
+ //Change our headder to text/xml for direct save
302
+ header('Cache-Control: public');
303
+ //The next two will cause good browsers to download instead of displaying the file
304
+ header('Content-Description: File Transfer');
305
+ header('Content-disposition: attachemnt; filename=bcn_settings.xml');
306
+ header('Content-Type: text/xml');
307
+ //Loop through the options array
308
+ foreach($this->breadcrumb_trail->opt as $key=>$option)
309
+ {
310
+ //Add a option tag under the options tag, store the option value
311
+ $node = $dom->createElement('option', $option);
312
+ $newnode = $plugnode->appendChild($node);
313
+ //Change the tag's name to that of the stored option
314
+ $newnode->setAttribute('name', $key);
315
+ }
316
+ //Prepair the XML for output
317
+ $output = $dom->saveXML();
318
+ //Let the browser know how long the file is
319
+ header('Content-Length: ' . strlen($output)); // binary length
320
+ //Output the file
321
+ echo $output;
322
+ //Prevent WordPress from continuing on
323
+ die();
324
+ }
325
+ /**
326
+ * import
327
+ *
328
+ * Imports a XML options document
329
+ */
330
+ function import()
331
+ {
332
+ //Our quick and dirty error supressor
333
+ function error($errno, $errstr, $eerfile, $errline)
334
+ {
335
+ return true;
336
+ }
337
+ $this->security();
338
+ //Do a nonce check, prevent malicious link/form problems
339
+ check_admin_referer('bcn_admin_upload');
340
+ //Create a DOM document
341
+ $dom = new DOMDocument('1.0', 'UTF-8');
342
+ //We want to catch errors ourselves
343
+ set_error_handler('error');
344
+ //Load the user uploaded file, handle failure gracefully
345
+ if($dom->load($_FILES['bcn_admin_import_file']['tmp_name']))
346
+ {
347
+ //Have to use an xpath query otherwise we run into problems
348
+ $xpath = new DOMXPath($dom);
349
+ $option_sets = $xpath->query('plugin');
350
+ //Loop through all of the xpath query results
351
+ foreach($option_sets as $options)
352
+ {
353
+ //We only want to import options for Breadcrumb NavXT
354
+ if($options->getAttribute('name') === 'breadcrumb_navxt')
355
+ {
356
+ //Do a quick version check
357
+ list($plug_major, $plug_minor, $plug_release) = explode('.', $this->version);
358
+ list($major, $minor, $release) = explode('.', $options->getAttribute('version'));
359
+ //We don't support using newer versioned option files in older releases
360
+ if($plug_major == $major && $plug_minor >= $minor)
361
+ {
362
+ //Loop around all of the options
363
+ foreach($options->getelementsByTagName('option') as $child)
364
+ {
365
+ //Place the option into the option array, DOMDocument decodes html entities for us
366
+ $this->breadcrumb_trail->opt[$child->getAttribute('name')] = $child->nodeValue;
367
+ }
368
+ }
369
+ }
370
+ }
371
+ //Commit the loaded options to the database
372
+ $this->update_option('bcn_options', $this->breadcrumb_trail->opt);
373
+ //Everything was successful, let the user know
374
+ add_action('admin_notices', array($this, 'notify_import_success'));
375
+ }
376
+ else
377
+ {
378
+ //Throw an error since we could not load the file for various reasons
379
+ add_action('admin_notices', array($this, 'notify_import_failure'));
380
+ }
381
+ //Reset to the default error handler after we're done
382
+ restore_error_handler();
383
+ }
384
+ /**
385
+ * update
386
+ *
387
+ * Updates the database settings from the webform
388
+ */
389
+ function update()
390
+ {
391
+ global $wp_taxonomies;
392
+ $this->security();
393
+ //Do a nonce check, prevent malicious link/form problems
394
+ check_admin_referer('bcn_admin-options');
395
+
396
+ //Grab the options from the from post
397
+ //Home page settings
398
+ $this->breadcrumb_trail->opt['home_display'] = str2bool(bcn_get('home_display', 'false'));
399
+ $this->breadcrumb_trail->opt['blog_display'] = str2bool(bcn_get('blog_display', 'false'));
400
+ $this->breadcrumb_trail->opt['home_title'] = bcn_get('home_title');
401
+ $this->breadcrumb_trail->opt['home_anchor'] = bcn_get('home_anchor', $this->breadcrumb_trail->opt['home_anchor']);
402
+ $this->breadcrumb_trail->opt['blog_anchor'] = bcn_get('blog_anchor', $this->breadcrumb_trail->opt['blog_anchor']);
403
+ $this->breadcrumb_trail->opt['home_prefix'] = bcn_get('home_prefix');
404
+ $this->breadcrumb_trail->opt['home_suffix'] = bcn_get('home_suffix');
405
+ $this->breadcrumb_trail->opt['separator'] = bcn_get('separator');
406
+ $this->breadcrumb_trail->opt['max_title_length'] = (int) bcn_get('max_title_length');
407
+ //Current item settings
408
+ $this->breadcrumb_trail->opt['current_item_linked'] = str2bool(bcn_get('current_item_linked', 'false'));
409
+ $this->breadcrumb_trail->opt['current_item_anchor'] = bcn_get('current_item_anchor', $this->breadcrumb_trail->opt['current_item_anchor']);
410
+ $this->breadcrumb_trail->opt['current_item_prefix'] = bcn_get('current_item_prefix');
411
+ $this->breadcrumb_trail->opt['current_item_suffix'] = bcn_get('current_item_suffix');
412
+ //Paged settings
413
+ $this->breadcrumb_trail->opt['paged_prefix'] = bcn_get('paged_prefix');
414
+ $this->breadcrumb_trail->opt['paged_suffix'] = bcn_get('paged_suffix');
415
+ $this->breadcrumb_trail->opt['paged_display'] = str2bool(bcn_get('paged_display', 'false'));
416
+ //Page settings
417
+ $this->breadcrumb_trail->opt['page_prefix'] = bcn_get('page_prefix');
418
+ $this->breadcrumb_trail->opt['page_suffix'] = bcn_get('page_suffix');
419
+ $this->breadcrumb_trail->opt['page_anchor'] = bcn_get('page_anchor', $this->breadcrumb_trail->opt['page_anchor']);
420
+ //Post related options
421
+ $this->breadcrumb_trail->opt['post_prefix'] = bcn_get('post_prefix');
422
+ $this->breadcrumb_trail->opt['post_suffix'] = bcn_get('post_suffix');
423
+ $this->breadcrumb_trail->opt['post_anchor'] = bcn_get('post_anchor', $this->breadcrumb_trail->opt['post_anchor']);
424
+ $this->breadcrumb_trail->opt['post_taxonomy_display'] = str2bool(bcn_get('post_taxonomy_display', 'false'));
425
+ $this->breadcrumb_trail->opt['post_taxonomy_type'] = bcn_get('post_taxonomy_type');
426
+ //Attachment settings
427
+ $this->breadcrumb_trail->opt['attachment_prefix'] = bcn_get('attachment_prefix');
428
+ $this->breadcrumb_trail->opt['attachment_suffix'] = bcn_get('attachment_suffix');
429
+ //404 page settings
430
+ $this->breadcrumb_trail->opt['404_prefix'] = bcn_get('404_prefix');
431
+ $this->breadcrumb_trail->opt['404_suffix'] = bcn_get('404_suffix');
432
+ $this->breadcrumb_trail->opt['404_title'] = bcn_get('404_title');
433
+ //Search page settings
434
+ $this->breadcrumb_trail->opt['search_prefix'] = bcn_get('search_prefix');
435
+ $this->breadcrumb_trail->opt['search_suffix'] = bcn_get('search_suffix');
436
+ $this->breadcrumb_trail->opt['search_anchor'] = bcn_get('search_anchor', $this->breadcrumb_trail->opt['search_anchor']);
437
+ //Tag settings
438
+ $this->breadcrumb_trail->opt['post_tag_prefix'] = bcn_get('post_tag_prefix');
439
+ $this->breadcrumb_trail->opt['post_tag_suffix'] = bcn_get('post_tag_suffix');
440
+ $this->breadcrumb_trail->opt['post_tag_anchor'] = bcn_get('post_tag_anchor', $this->breadcrumb_trail->opt['post_tag_anchor']);
441
+ //Author page settings
442
+ $this->breadcrumb_trail->opt['author_prefix'] = bcn_get('author_prefix');
443
+ $this->breadcrumb_trail->opt['author_suffix'] = bcn_get('author_suffix');
444
+ $this->breadcrumb_trail->opt['author_display'] = bcn_get('author_display');
445
+ //Category settings
446
+ $this->breadcrumb_trail->opt['category_prefix'] = bcn_get('category_prefix');
447
+ $this->breadcrumb_trail->opt['category_suffix'] = bcn_get('category_suffix');
448
+ $this->breadcrumb_trail->opt['category_anchor'] = bcn_get('category_anchor', $this->breadcrumb_trail->opt['category_anchor']);
449
+ //Archive settings
450
+ $this->breadcrumb_trail->opt['archive_category_prefix'] = bcn_get('archive_category_prefix');
451
+ $this->breadcrumb_trail->opt['archive_category_suffix'] = bcn_get('archive_category_suffix');
452
+ $this->breadcrumb_trail->opt['archive_post_tag_prefix'] = bcn_get('archive_post_tag_prefix');
453
+ $this->breadcrumb_trail->opt['archive_post_tag_suffix'] = bcn_get('archive_post_tag_suffix');
454
+ //Archive by date settings
455
+ $this->breadcrumb_trail->opt['date_anchor'] = bcn_get('date_anchor', $this->breadcrumb_trail->opt['date_anchor']);
456
+ $this->breadcrumb_trail->opt['archive_date_prefix'] = bcn_get('archive_date_prefix');
457
+ $this->breadcrumb_trail->opt['archive_date_suffix'] = bcn_get('archive_date_suffix');
458
+ //Loop through all of the taxonomies in the array
459
+ foreach($wp_taxonomies as $taxonomy)
460
+ {
461
+ //We only want custom taxonomies
462
+ if($taxonomy->object_type == 'post' && ($taxonomy->name != 'post_tag' && $taxonomy->name != 'category'))
463
+ {
464
+ $this->breadcrumb_trail->opt[$taxonomy->name . '_prefix'] = bcn_get($taxonomy->name . '_prefix');
465
+ $this->breadcrumb_trail->opt[$taxonomy->name . '_suffix'] = bcn_get($taxonomy->name . '_suffix');
466
+ $this->breadcrumb_trail->opt[$taxonomy->name . '_anchor'] = bcn_get($taxonomy->name . '_anchor', $this->breadcrumb_trail->opt['post_tag_anchor']);
467
+ $this->breadcrumb_trail->opt['archive_' . $taxonomy->name . '_prefix'] = bcn_get('archive_' . $taxonomy->name . '_prefix');
468
+ $this->breadcrumb_trail->opt['archive_' . $taxonomy->name . '_suffix'] = bcn_get('archive_' . $taxonomy->name . '_suffix');
469
+ }
470
+ }
471
+ //Commit the option changes
472
+ $this->update_option('bcn_options', $this->breadcrumb_trail->opt);
473
+ }
474
+ /**
475
+ * display
476
+ *
477
+ * Outputs the breadcrumb trail
478
+ *
479
+ * @param (bool) $return Whether to return or echo the trail.
480
+ * @param (bool) $linked Whether to allow hyperlinks in the trail or not.
481
+ * @param (bool) $reverse Whether to reverse the output or not.
482
+ */
483
+ function display($return = false, $linked = true, $reverse = false)
484
+ {
485
+ //Update our internal settings
486
+ $this->breadcrumb_trail->opt = $this->get_option('bcn_options');
487
+ //Generate the breadcrumb trail
488
+ $this->breadcrumb_trail->fill();
489
+ return $this->breadcrumb_trail->display($return, $linked, $reverse);
490
+ }
491
+ /**
492
+ * display_list
493
+ *
494
+ * Outputs the breadcrumb trail
495
+ *
496
+ * @since 3.2.0
497
+ * @param (bool) $return Whether to return or echo the trail.
498
+ * @param (bool) $linked Whether to allow hyperlinks in the trail or not.
499
+ * @param (bool) $reverse Whether to reverse the output or not.
500
+ */
501
+ function display_list($return = false, $linked = true, $reverse = false)
502
+ {
503
+ //Update our internal settings
504
+ $this->breadcrumb_trail->opt = $this->get_option('bcn_options');
505
+ //Generate the breadcrumb trail
506
+ $this->breadcrumb_trail->fill();
507
+ return $this->breadcrumb_trail->display_list($return, $linked, $reverse);
508
+ }
509
+ /**
510
+ * widget
511
+ *
512
+ * The sidebar widget
513
+ */
514
+ function widget($args)
515
+ {
516
+ extract($args);
517
+ //Manditory before widget junk
518
+ echo $before_widget;
519
+ //Display the breadcrumb trial
520
+ if($this->breadcrumb_trail->trail[0] != NULL)
521
+ {
522
+ $this->breadcrumb_trail->display();
523
+ }
524
+ else
525
+ {
526
+ $this->display();
527
+ }
528
+ //Manditory after widget junk
529
+ echo $after_widget;
530
+ }
531
+ /**
532
+ * register_widget
533
+ *
534
+ * Registers the sidebar widget
535
+ */
536
+ function register_widget()
537
+ {
538
+ register_sidebar_widget('Breadcrumb NavXT', array($this, 'widget'));
539
+ }
540
+ /**
541
+ * filter_plugin_actions
542
+ *
543
+ * Places in a link to the settings page in the plugins listing entry
544
+ *
545
+ * @param (array) $links An array of links that are output in the listing
546
+ * @param (string) $file The file that is currently in processing
547
+ * @return (array) Array of links that are output in the listing.
548
+ */
549
+ function filter_plugin_actions($links, $file)
550
+ {
551
+ static $this_plugin;
552
+ if(!$this_plugin)
553
+ {
554
+ $this_plugin = plugin_basename(__FILE__);
555
+ }
556
+ //Make sure we are adding only for Breadcrumb NavXT
557
+ if($file == $this_plugin)
558
+ {
559
+ //Setup the link string
560
+ $settings_link = '<a href="options-general.php?page=breadcrumb-navxt">' . __('Settings') . '</a>';
561
+ //Add it to the end of the array to better integrate into the WP 2.8 plugins page
562
+ $links[] = $settings_link;
563
+ }
564
+ return $links;
565
+ }
566
+ /**
567
+ * javascript
568
+ *
569
+ * Enqueues JS dependencies (jquery) for the tabs
570
+ *
571
+ * @see admin_init()
572
+ * @return void
573
+ */
574
+ function javascript()
575
+ {
576
+ //Enqueue ui-tabs
577
+ wp_enqueue_script('jquery-ui-tabs');
578
+ }
579
+ /**
580
+ * local
581
+ *
582
+ * Initilizes localization textdomain for translations (if applicable)
583
+ *
584
+ * normally there is no need to load it because it is already loaded with
585
+ * the breadcrumb class. if not, then it will be loaded.
586
+ *
587
+ * @return void
588
+ */
589
+ function local()
590
+ {
591
+ // the global and the check might become obsolete in
592
+ // further wordpress versions
593
+ // @see https://core.trac.wordpress.org/ticket/10527
594
+ global $l10n;
595
+ $domain = 'breadcrumb_navxt';
596
+ if (!isset( $l10n[$domain] ))
597
+ {
598
+ load_plugin_textdomain($domain, false, 'breadcrumb-navxt/languages');
599
+ }
600
+ }
601
+ /**
602
+ * add_page
603
+ *
604
+ * Adds the adminpage the menue and the nice little settings link
605
+ *
606
+ * @return void
607
+ */
608
+ function add_page()
609
+ {
610
+ // check capability of user to manage options (access control)
611
+ if(current_user_can('manage_options'))
612
+ {
613
+ //Add the submenu page to "settings" menu
614
+ $hookname = add_submenu_page('options-general.php', __('Breadcrumb NavXT Settings', 'breadcrumb_navxt'), 'Breadcrumb NavXT', 'manage_options', 'breadcrumb-navxt', array($this, 'admin_panel'));
615
+ //Register admin_head-$hookname callback
616
+ add_action('admin_head-'.$hookname, array($this, 'admin_head'));
617
+ //Register Help Output
618
+ add_action('contextual_help', array($this, 'contextual_help'), 10, 2);
619
+ }
620
+ }
621
+
622
+ /**
623
+ * contextual_help action hook function
624
+ *
625
+ * @param string $contextual_help
626
+ * @param string $screen
627
+ * @return string
628
+ */
629
+ function contextual_help($contextual_help, $screen)
630
+ {
631
+ // add contextual help on current screen
632
+ if ($screen == 'settings_page_breadcrumb-navxt')
633
+ {
634
+ $contextual_help = $this->_get_contextual_help();
635
+ $this->_has_contextual_help = true;
636
+ }
637
+ return $contextual_help;
638
+ }
639
+
640
+ /**
641
+ * get contextual help
642
+ *
643
+ * @return string
644
+ */
645
+ private function _get_contextual_help()
646
+ {
647
+ $t = $this->_get_help_text();
648
+ $t = sprintf('<div class="metabox-prefs">%s</div>', $t);
649
+ $title = __('Breadcrumb NavXT Settings', 'breadcrumb_navxt');
650
+ $t = sprintf('<h5>%s</h5>%s', sprintf(__('Get help with "%s"'), $title), $t);
651
+ return $t;
652
+ }
653
+
654
+ /**
655
+ * get help text
656
+ *
657
+ * @return string
658
+ */
659
+ private function _get_help_text()
660
+ {
661
+ return sprintf(__('Tips for the settings are located below select options. Please refer to the %sdocumentation%s for more information.', 'breadcrumb_navxt'),
662
+ '<a title="' . __('Go to the Breadcrumb NavXT online documentation', 'breadcrumb_navxt') . '" href="http://mtekk.weblogs.us/code/breadcrumb-navxt/breadcrumb-navxt-doc/">', '</a>');
663
+ }
664
+
665
+ /**
666
+ * admin_head
667
+ *
668
+ * Adds in the JavaScript and CSS for the tabs in the adminsitrative
669
+ * interface
670
+ *
671
+ */
672
+ function admin_head()
673
+ {
674
+ // print style and script element (should go into head element)
675
+ ?>
676
+ <style type="text/css">
677
+ /**
678
+ * Tabbed Admin Page (CSS)
679
+ *
680
+ * @see Breadcrumb NavXT (Wordpress Plugin)
681
+ * @author Tom Klingenberg
682
+ * @colordef #c6d9e9 light-blue (older tabs border color, obsolete)
683
+ * @colordef #dfdfdf light-grey (tabs border color)
684
+ * @colordef #f9f9f9 very-light-grey (admin standard background color)
685
+ * @colordef #fff white (active tab background color)
686
+ */
687
+ #hasadmintabs ul.ui-tabs-nav {border-bottom:1px solid #dfdfdf; font-size:12px; height:29px; list-style-image:none; list-style-position:outside; list-style-type:none; margin:13px 0 0; overflow:visible; padding:0 0 0 8px;}
688
+ #hasadmintabs ul.ui-tabs-nav li {display:block; float:left; line-height:200%; list-style-image:none; list-style-position:outside; list-style-type:none; margin:0; padding:0; position:relative; text-align:center; white-space:nowrap; width:auto;}
689
+ #hasadmintabs ul.ui-tabs-nav li a {background:transparent none no-repeat scroll 0 50%; border-bottom:1px solid #dfdfdf; display:block; float:left; line-height:28px; padding:1px 13px 0; position:relative; text-decoration:none;}
690
+ #hasadmintabs ul.ui-tabs-nav li.ui-tabs-selected a{-moz-border-radius-topleft:4px; -moz-border-radius-topright:4px;border:1px solid #dfdfdf; border-bottom-color:#f9f9f9; color:#333333; font-weight:normal; padding:0 12px;}
691
+ #hasadmintabs ul.ui-tabs-nav a:focus, a:active {outline-color:-moz-use-text-color; outline-style:none; outline-width:medium;}
692
+ #screen-options-wrap p.submit {margin:0; padding:0;}
693
+ </style>
694
+ <script type="text/javascript">
695
+ /* <![CDATA[ */
696
+ /**
697
+ * Breadcrumb NavXT Admin Page (javascript/jQuery)
698
+ *
699
+ * unobtrusive approach to add tabbed forms into
700
+ * the wordpress admin panel and various other
701
+ * stuff that needs javascript with the Admin Panel.
702
+ *
703
+ * @see Breadcrumb NavXT (Wordpress Plugin)
704
+ * @author Tom Klingenberg
705
+ * @author John Havlik
706
+ * @uses jQuery
707
+ * @uses jQuery.ui.tabs
708
+ */
709
+ jQuery(function()
710
+ {
711
+ bcn_context_init();
712
+ bcn_tabulator_init();
713
+ });
714
+ function bcn_confirm(type)
715
+ {
716
+ if(type == 'reset'){
717
+ var answer = confirm("<?php _e('All of your current Breadcrumb NavXT settings will be overwritten with the default values. Are you sure you want to continue?', 'breadcrumb_navxt'); ?>");
718
+ }
719
+ else{
720
+ var answer = confirm("<?php _e('All of your current Breadcrumb NavXT settings will be overwritten with the imported values. Are you sure you want to continue?', 'breadcrumb_navxt'); ?>");
721
+ }
722
+ if(answer)
723
+ return true;
724
+ else
725
+ return false;
726
+ }
727
+ /**
728
+ * Tabulator Bootup
729
+ */
730
+ function bcn_tabulator_init(){
731
+ /* if this is not the breadcrumb admin page, quit */
732
+ if (!jQuery("#hasadmintabs").length) return;
733
+ /* init markup for tabs */
734
+ jQuery('#hasadmintabs').prepend("<ul><\/ul>");
735
+ jQuery('#hasadmintabs > fieldset').each(function(i){
736
+ id = jQuery(this).attr('id');
737
+ caption = jQuery(this).find('h3').text();
738
+ jQuery('#hasadmintabs > ul').append('<li><a href="#'+id+'"><span>'+caption+"<\/span><\/a><\/li>");
739
+ jQuery(this).find('h3').hide();
740
+ });
741
+ /* init the tabs plugin */
742
+ var jquiver = undefined == jQuery.ui ? [0,0,0] : undefined == jQuery.ui.version ? [0,1,0] : jQuery.ui.version.split('.');
743
+ switch(true){
744
+ // tabs plugin has been fixed to work on the parent element again.
745
+ case jquiver[0] >= 1 && jquiver[1] >= 7:
746
+ jQuery("#hasadmintabs").tabs();
747
+ break;
748
+ // tabs plugin has bug and needs to work on ul directly.
749
+ default:
750
+ jQuery("#hasadmintabs > ul").tabs();
751
+ }
752
+ /* handler for opening the last tab after submit (compability version) */
753
+ jQuery('#hasadmintabs ul a').click(function(i){
754
+ var form = jQuery('#bcn_admin_options');
755
+ var action = form.attr("action").split('#', 1) + jQuery(this).attr('href');
756
+ // an older bug pops up with some jQuery version(s), which makes it
757
+ // necessary to set the form's action attribute by standard javascript
758
+ // node access:
759
+ form.get(0).setAttribute("action", action);
760
+ });
761
+ }
762
+ /**
763
+ * context screen options for import/export
764
+ */
765
+ function bcn_context_init(){
766
+ if (!jQuery("#bcn_import_export_relocate").length) return;
767
+ var jqver = undefined == jQuery.fn.jquery ? [0,0,0] : jQuery.fn.jquery.split('.');
768
+ jQuery('#screen-meta').prepend(
769
+ '<div id="screen-options-wrap" class="hidden"></div>'
770
+ );
771
+ jQuery('#screen-meta-links').append(
772
+ '<div id="screen-options-link-wrap" class="hide-if-no-js screen-meta-toggle">' +
773
+ '<a class="show-settings" id="show-settings-link" href="#screen-options"><?php printf('%s/%s/%s', __('Import', 'breadcrumb_navxt'), __('Export', 'breadcrumb_navxt'), __('Reset', 'breadcrumb_navxt')); ?></a>' +
774
+ '</div>'
775
+ );
776
+ // jQuery Version below 1.3 (common for WP 2.7) needs some other style-classes
777
+ // and jQuery events
778
+ if (jqver[0] <= 1 && jqver[1] < 3){
779
+ // hide-if-no-js for WP 2.8, not for WP 2.7
780
+ jQuery('#screen-options-link-wrap').removeClass('hide-if-no-js');
781
+ // screen settings tab (WP 2.7 legacy)
782
+ jQuery('#show-settings-link').click(function () {
783
+ if ( ! jQuery('#screen-options-wrap').hasClass('screen-options-open') ) {
784
+ jQuery('#contextual-help-link-wrap').addClass('invisible');
785
+ }
786
+ jQuery('#screen-options-wrap').slideToggle('fast', function(){
787
+ if ( jQuery(this).hasClass('screen-options-open') ) {
788
+ jQuery('#show-settings-link').css({'backgroundImage':'url("images/screen-options-right.gif")'});
789
+ jQuery('#contextual-help-link-wrap').removeClass('invisible');
790
+ jQuery(this).removeClass('screen-options-open');
791
+ } else {
792
+ jQuery('#show-settings-link').css({'backgroundImage':'url("images/screen-options-right-up.gif")'});
793
+ jQuery(this).addClass('screen-options-open');
794
+ }
795
+ });
796
+ return false;
797
+ });
798
+ }
799
+ var code = jQuery('#bcn_import_export_relocate').html();
800
+ jQuery('#bcn_import_export_relocate').html('');
801
+ code = code.replace(/h3>/gi, 'h5>');
802
+ jQuery('#screen-options-wrap').prepend(code);
803
+ }
804
+ /* ]]> */
805
+ </script>
806
+ <?php
807
+ } //function admin_head()
808
+
809
+ /**
810
+ * admin_panel
811
+ *
812
+ * The administrative panel for Breadcrumb NavXT
813
+ *
814
+ */
815
+ function admin_panel()
816
+ {
817
+ global $wp_taxonomies;
818
+ $this->security();
819
+ //Update our internal options array, use form safe function
820
+ $this->breadcrumb_trail->opt = $this->get_option('bcn_options', true);
821
+ ?>
822
+ <div class="wrap"><h2><?php _e('Breadcrumb NavXT Settings', 'breadcrumb_navxt'); ?></h2>
823
+ <p<?php if ($this->_has_contextual_help): ?> class="hide-if-js"<?php endif; ?>><?php
824
+ print $this->_get_help_text();
825
+ ?></p>
826
+ <form action="options-general.php?page=breadcrumb-navxt" method="post" id="bcn_admin_options">
827
+ <?php
828
+ settings_fields('bcn_admin');
829
+ ?>
830
+ <div id="hasadmintabs">
831
+ <fieldset id="general" class="bcn_options">
832
+ <h3><?php _e('General', 'breadcrumb_navxt'); ?></h3>
833
+ <table class="form-table">
834
+ <tr valign="top">
835
+ <th scope="row">
836
+ <label for="separator"><?php _e('Breadcrumb Separator', 'breadcrumb_navxt'); ?></label>
837
+ </th>
838
+ <td>
839
+ <input type="text" name="separator" id="separator" value="<?php echo $this->breadcrumb_trail->opt['separator']; ?>" size="32" /><br />
840
+ <span class="setting-description"><?php _e('Placed in between each breadcrumb.', 'breadcrumb_navxt'); ?></span>
841
+ </td>
842
+ </tr>
843
+ <tr valign="top">
844
+ <th scope="row">
845
+ <label for="max_title_length"><?php _e('Breadcrumb Max Title Length', 'breadcrumb_navxt'); ?></label>
846
+ </th>
847
+ <td>
848
+ <input type="text" name="max_title_length" id="max_title_length" value="<?php echo $this->breadcrumb_trail->opt['max_title_length'];?>" size="10" />
849
+ </td>
850
+ </tr>
851
+ <tr valign="top">
852
+ <th scope="row">
853
+ <?php _e('Home Breadcrumb', 'breadcrumb_navxt'); ?>
854
+ </th>
855
+ <td>
856
+ <label>
857
+ <input name="home_display" type="checkbox" id="home_display" value="true" <?php checked(true, $this->breadcrumb_trail->opt['home_display']); ?> />
858
+ <?php _e('Place the home breadcrumb in the trail.', 'breadcrumb_navxt'); ?>
859
+ </label><br />
860
+ <ul>
861
+ <li>
862
+ <label for="home_title">
863
+ <?php _e('Home Title: ','breadcrumb_navxt');?>
864
+ <input type="text" name="home_title" id="home_title" value="<?php echo $this->breadcrumb_trail->opt['home_title']; ?>" size="20" />
865
+ </label>
866
+ </li>
867
+ </ul>
868
+ </td>
869
+ </tr>
870
+ <tr valign="top">
871
+ <th scope="row">
872
+ <label for="blog_display"><?php _e('Blog Breadcrumb', 'breadcrumb_navxt'); ?></label>
873
+ </th>
874
+ <td>
875
+ <label>
876
+ <input name="blog_display" <?php if($this->get_option('show_on_front') !== "page"){echo 'disabled="disabled" class="disabled"';} ?> type="checkbox" id="blog_display" value="true" <?php checked(true, $this->breadcrumb_trail->opt['blog_display']); ?> />
877
+ <?php _e('Place the blog breadcrumb in the trail.', 'breadcrumb_navxt'); ?>
878
+ </label>
879
+ </td>
880
+ </tr>
881
+ <tr valign="top">
882
+ <th scope="row">
883
+ <label for="home_prefix"><?php _e('Home Prefix', 'breadcrumb_navxt'); ?></label>
884
+ </th>
885
+ <td>
886
+ <input type="text" name="home_prefix" id="home_prefix" value="<?php echo $this->breadcrumb_trail->opt['home_prefix']; ?>" size="32" />
887
+ </td>
888
+ </tr>
889
+ <tr valign="top">
890
+ <th scope="row">
891
+ <label for="home_suffix"><?php _e('Home Suffix', 'breadcrumb_navxt'); ?></label>
892
+ </th>
893
+ <td>
894
+ <input type="text" name="home_suffix" id="home_suffix" value="<?php echo $this->breadcrumb_trail->opt['home_suffix']; ?>" size="32" />
895
+ </td>
896
+ </tr>
897
+ <tr valign="top">
898
+ <th scope="row">
899
+ <label for="home_anchor"><?php _e('Home Anchor', 'breadcrumb_navxt'); ?></label>
900
+ </th>
901
+ <td>
902
+ <input type="text" name="home_anchor" id="home_anchor" value="<?php echo $this->breadcrumb_trail->opt['home_anchor']; ?>" size="60" /><br />
903
+ <span class="setting-description"><?php _e('The anchor template for the home breadcrumb.', 'breadcrumb_navxt'); ?></span>
904
+ </td>
905
+ </tr>
906
+ <tr valign="top">
907
+ <th scope="row">
908
+ <label for="blog_anchor"><?php _e('Blog Anchor', 'breadcrumb_navxt'); ?></label>
909
+ </th>
910
+ <td>
911
  <input type="text" <?php if($this->get_option('show_on_front') !== "page"){echo 'disabled="disabled" class="disabled"';} ?> name="blog_anchor" id="blog_anchor" value="<?php echo $this->breadcrumb_trail->opt['blog_anchor']; ?>" size="60" /><br />
912
+ <span class="setting-description"><?php _e('The anchor template for the blog breadcrumb, used only in static front page environments.', 'breadcrumb_navxt'); ?></span>
913
+ </td>
914
+ </tr>
915
+ </table>
916
+ </fieldset>
917
+ <fieldset id="current" class="bcn_options">
918
+ <h3><?php _e('Current Item', 'breadcrumb_navxt'); ?></h3>
919
+ <table class="form-table">
920
+ <tr valign="top">
921
+ <th scope="row">
922
+ <label for="current_item_linked"><?php _e('Link Current Item', 'breadcrumb_navxt'); ?></label>
923
+ </th>
924
+ <td>
925
+ <label>
926
+ <input name="current_item_linked" type="checkbox" id="current_item_linked" value="true" <?php checked(true, $this->breadcrumb_trail->opt['current_item_linked']); ?> />
927
+ <?php _e('Yes'); ?>
928
+ </label>
929
+ </td>
930
+ </tr>
931
+ <tr valign="top">
932
+ <th scope="row">
933
+ <label for="current_item_prefix"><?php _e('Current Item Prefix', 'breadcrumb_navxt'); ?></label>
934
+ </th>
935
+ <td>
936
+ <input type="text" name="current_item_prefix" id="current_item_prefix" value="<?php echo $this->breadcrumb_trail->opt['current_item_prefix']; ?>" size="32" /><br />
937
+ <span class="setting-description"><?php _e('This is always placed in front of the last breadcrumb in the trail, before any other prefixes for that breadcrumb.', 'breadcrumb_navxt'); ?></span>
938
+ </td>
939
+ </tr>
940
+ <tr valign="top">
941
+ <th scope="row">
942
+ <label for="current_item_suffix"><?php _e('Current Item Suffix', 'breadcrumb_navxt'); ?></label>
943
+ </th>
944
+ <td>
945
+ <input type="text" name="current_item_suffix" id="current_item_suffix" value="<?php echo $this->breadcrumb_trail->opt['current_item_suffix']; ?>" size="32" /><br />
946
+ <span class="setting-description"><?php _e('This is always placed after the last breadcrumb in the trail, and after any other prefixes for that breadcrumb.', 'breadcrumb_navxt'); ?></span>
947
+ </td>
948
+ </tr>
949
+ <tr valign="top">
950
+ <th scope="row">
951
+ <label for="current_item_anchor"><?php _e('Current Item Anchor', 'breadcrumb_navxt'); ?></label>
952
+ </th>
953
+ <td>
954
+ <input type="text" name="current_item_anchor" id="current_item_anchor" value="<?php echo $this->breadcrumb_trail->opt['current_item_anchor']; ?>" size="60" /><br />
955
+ <span class="setting-description"><?php _e('The anchor template for current item breadcrumbs.', 'breadcrumb_navxt'); ?></span>
956
+ </td>
957
+ </tr>
958
+ <tr valign="top">
959
+ <th scope="row">
960
+ <label for="paged_display"><?php _e('Paged Breadcrumb', 'breadcrumb_navxt'); ?></label>
961
+ </th>
962
+ <td>
963
+ <label>
964
+ <input name="paged_display" type="checkbox" id="paged_display" value="true" <?php checked(true, $this->breadcrumb_trail->opt['paged_display']); ?> />
965
+ <?php _e('Include the paged breadcrumb in the breadcrumb trail.', 'breadcrumb_navxt'); ?>
966
+ </label><br />
967
+ <span class="setting-description"><?php _e('Indicates that the user is on a page other than the first on paginated posts/pages.', 'breadcrumb_navxt'); ?></span>
968
+ </td>
969
+ </tr>
970
+ <tr valign="top">
971
+ <th scope="row">
972
+ <label for="paged_prefix"><?php _e('Paged Prefix', 'breadcrumb_navxt'); ?></label>
973
+ </th>
974
+ <td>
975
+ <input type="text" name="paged_prefix" id="paged_prefix" value="<?php echo $this->breadcrumb_trail->opt['paged_prefix']; ?>" size="32" />
976
+ </td>
977
+ </tr>
978
+ <tr valign="top">
979
+ <th scope="row">
980
+ <label for="paged_suffix"><?php _e('Paged Suffix', 'breadcrumb_navxt'); ?></label>
981
+ </th>
982
+ <td>
983
+ <input type="text" name="paged_suffix" id="paged_suffix" value="<?php echo $this->breadcrumb_trail->opt['paged_suffix']; ?>" size="32" />
984
+ </td>
985
+ </tr>
986
+ </table>
987
+ </fieldset>
988
+ <fieldset id="single" class="bcn_options">
989
+ <h3><?php _e('Posts &amp; Pages', 'breadcrumb_navxt'); ?></h3>
990
+ <table class="form-table">
991
+ <tr valign="top">
992
+ <th scope="row">
993
+ <label for="post_prefix"><?php _e('Post Prefix', 'breadcrumb_navxt'); ?></label>
994
+ </th>
995
+ <td>
996
+ <input type="text" name="post_prefix" id="post_prefix" value="<?php echo $this->breadcrumb_trail->opt['post_prefix']; ?>" size="32" />
997
+ </td>
998
+ </tr>
999
+ <tr valign="top">
1000
+ <th scope="row">
1001
+ <label for="post_suffix"><?php _e('Post Suffix', 'breadcrumb_navxt'); ?></label>
1002
+ </th>
1003
+ <td>
1004
+ <input type="text" name="post_suffix" id="post_suffix" value="<?php echo $this->breadcrumb_trail->opt['post_suffix']; ?>" size="32" />
1005
+ </td>
1006
+ </tr>
1007
+ <tr valign="top">
1008
+ <th scope="row">
1009
+ <label for="post_anchor"><?php _e('Post Anchor', 'breadcrumb_navxt'); ?></label>
1010
+ </th>
1011
+ <td>
1012
+ <input type="text" name="post_anchor" id="post_anchor" value="<?php echo $this->breadcrumb_trail->opt['post_anchor']; ?>" size="60" /><br />
1013
+ <span class="setting-description"><?php _e('The anchor template for post breadcrumbs.', 'breadcrumb_navxt'); ?></span>
1014
+ </td>
1015
+ </tr>
1016
+ <tr valign="top">
1017
+ <th scope="row">
1018
+ <?php _e('Post Taxonomy Display', 'breadcrumb_navxt'); ?>
1019
+ </th>
1020
+ <td>
1021
+ <label for="post_taxonomy_display">
1022
+ <input name="post_taxonomy_display" type="checkbox" id="post_taxonomy_display" value="true" <?php checked(true, $this->breadcrumb_trail->opt['post_taxonomy_display']); ?> />
1023
+ <?php _e('Show the taxonomy leading to a post in the breadcrumb trail.', 'breadcrumb_navxt'); ?>
1024
+ </label>
1025
+ </td>
1026
+ </tr>
1027
+ <tr valign="top">
1028
+ <th scope="row">
1029
+ <?php _e('Post Taxonomy', 'breadcrumb_navxt'); ?>
1030
+ </th>
1031
+ <td>
1032
+ <label>
1033
+ <input name="post_taxonomy_type" type="radio" value="category" class="togx" <?php checked('category', $this->breadcrumb_trail->opt['post_taxonomy_type']); ?> />
1034
+ <?php _e('Categories'); ?>
1035
+ </label>
1036
+ <br/>
1037
+ <label>
1038
+ <input name="post_taxonomy_type" type="radio" value="date" class="togx" <?php checked('date', $this->breadcrumb_trail->opt['post_taxonomy_type']); ?> />
1039
+ <?php _e('Dates'); ?>
1040
+ </label>
1041
+ <br/>
1042
+ <label>
1043
+ <input name="post_taxonomy_type" type="radio" value="post_tag" class="togx" <?php checked('post_tag', $this->breadcrumb_trail->opt['post_taxonomy_type']); ?> />
1044
+ <?php _e('Tags'); ?>
1045
+ </label>
1046
+ <br/>
1047
+ <?php
1048
+ //Loop through all of the taxonomies in the array
1049
+ foreach($wp_taxonomies as $taxonomy)
1050
+ {
1051
+ //We only want custom taxonomies
1052
+ if($taxonomy->object_type == 'post' && ($taxonomy->name != 'post_tag' && $taxonomy->name != 'category'))
1053
+ {
1054
+ ?>
1055
+ <label>
1056
+ <input name="post_taxonomy_type" type="radio" value="<?php echo $taxonomy->name; ?>" class="togx" <?php checked($taxonomy->name, $this->breadcrumb_trail->opt['post_taxonomy_type']); ?> />
1057
+ <?php echo ucwords(__($taxonomy->label)); ?>
1058
+ </label>
1059
+ <br/>
1060
+ <?php
1061
+ }
1062
+ }
1063
+ ?>
1064
+ <span class="setting-description"><?php _e('The taxonomy which the breadcrumb trail will show.', 'breadcrumb_navxt'); ?></span>
1065
+ </td>
1066
+ </tr>
1067
+ <tr valign="top">
1068
+ <th scope="row">
1069
+ <label for="page_prefix"><?php _e('Page Prefix', 'breadcrumb_navxt'); ?></label>
1070
+ </th>
1071
+ <td>
1072
+ <input type="text" name="page_prefix" id="page_prefix" value="<?php echo $this->breadcrumb_trail->opt['page_prefix']; ?>" size="32" />
1073
+ </td>
1074
+ </tr>
1075
+ <tr valign="top">
1076
+ <th scope="row">
1077
+ <label for="page_suffix"><?php _e('Page Suffix', 'breadcrumb_navxt'); ?></label>
1078
+ </th>
1079
+ <td>
1080
+ <input type="text" name="page_suffix" id="page_suffix" value="<?php echo $this->breadcrumb_trail->opt['page_suffix']; ?>" size="32" />
1081
+ </td>
1082
+ </tr>
1083
+ <tr valign="top">
1084
+ <th scope="row">
1085
+ <label for="page_anchor"><?php _e('Page Anchor', 'breadcrumb_navxt'); ?></label>
1086
+ </th>
1087
+ <td>
1088
+ <input type="text" name="page_anchor" id="page_anchor" value="<?php echo $this->breadcrumb_trail->opt['page_anchor']; ?>" size="60" /><br />
1089
+ <span class="setting-description"><?php _e('The anchor template for page breadcrumbs.', 'breadcrumb_navxt'); ?></span>
1090
+ </td>
1091
+ </tr>
1092
+ <tr valign="top">
1093
+ <th scope="row">
1094
+ <label for="attachment_prefix"><?php _e('Attachment Prefix', 'breadcrumb_navxt'); ?></label>
1095
+ </th>
1096
+ <td>
1097
+ <input type="text" name="attachment_prefix" id="attachment_prefix" value="<?php echo $this->breadcrumb_trail->opt['attachment_prefix']; ?>" size="32" />
1098
+ </td>
1099
+ </tr>
1100
+ <tr valign="top">
1101
+ <th scope="row">
1102
+ <label for="attachment_suffix"><?php _e('Attachment Suffix', 'breadcrumb_navxt'); ?></label>
1103
+ </th>
1104
+ <td>
1105
+ <input type="text" name="attachment_suffix" id="attachment_suffix" value="<?php echo $this->breadcrumb_trail->opt['attachment_suffix']; ?>" size="32" />
1106
+ </td>
1107
+ </tr>
1108
+ </table>
1109
+ </fieldset>
1110
+ <fieldset id="category" class="bcn_options">
1111
+ <h3><?php _e('Categories', 'breadcrumb_navxt'); ?></h3>
1112
+ <table class="form-table">
1113
+ <tr valign="top">
1114
+ <th scope="row">
1115
+ <label for="category_prefix"><?php _e('Category Prefix', 'breadcrumb_navxt'); ?></label>
1116
+ </th>
1117
+ <td>
1118
+ <input type="text" name="category_prefix" id="category_prefix" value="<?php echo $this->breadcrumb_trail->opt['category_prefix']; ?>" size="32" /><br />
1119
+ <span class="setting-description"><?php _e('Applied before the anchor on all category breadcrumbs.', 'breadcrumb_navxt'); ?></span>
1120
+ </td>
1121
+ </tr>
1122
+ <tr valign="top">
1123
+ <th scope="row">
1124
+ <label for="category_suffix"><?php _e('Category Suffix', 'breadcrumb_navxt'); ?></label>
1125
+ </th>
1126
+ <td>
1127
+ <input type="text" name="category_suffix" id="category_suffix" value="<?php echo $this->breadcrumb_trail->opt['category_suffix']; ?>" size="32" /><br />
1128
+ <span class="setting-description"><?php _e('Applied after the anchor on all category breadcrumbs.', 'breadcrumb_navxt'); ?></span>
1129
+ </td>
1130
+ </tr>
1131
+ <tr valign="top">
1132
+ <th scope="row">
1133
+ <label for="category_anchor"><?php _e('Category Anchor', 'breadcrumb_navxt'); ?></label>
1134
+ </th>
1135
+ <td>
1136
+ <input type="text" name="category_anchor" id="category_anchor" value="<?php echo $this->breadcrumb_trail->opt['category_anchor']; ?>" size="60" /><br />
1137
+ <span class="setting-description"><?php _e('The anchor template for category breadcrumbs.', 'breadcrumb_navxt'); ?></span>
1138
+ </td>
1139
+ </tr>
1140
+ <tr valign="top">
1141
+ <th scope="row">
1142
+ <label for="archive_category_prefix"><?php _e('Archive by Category Prefix', 'breadcrumb_navxt'); ?></label>
1143
+ </th>
1144
+ <td>
1145
+ <input type="text" name="archive_category_prefix" id="archive_category_prefix" value="<?php echo $this->breadcrumb_trail->opt['archive_category_prefix']; ?>" size="32" /><br />
1146
+ <span class="setting-description"><?php _e('Applied before the title of the current item breadcrumb on an archive by cateogry page.', 'breadcrumb_navxt'); ?></span>
1147
+ </td>
1148
+ </tr>
1149
+ <tr valign="top">
1150
+ <th scope="row">
1151
+ <label for="archive_category_suffix"><?php _e('Archive by Category Suffix', 'breadcrumb_navxt'); ?></label>
1152
+ </th>
1153
+ <td>
1154
+ <input type="text" name="archive_category_suffix" id="archive_category_suffix" value="<?php echo $this->breadcrumb_trail->opt['archive_category_suffix']; ?>" size="32" /><br />
1155
+ <span class="setting-description"><?php _e('Applied after the title of the current item breadcrumb on an archive by cateogry page.', 'breadcrumb_navxt'); ?></span>
1156
+ </td>
1157
+ </tr>
1158
+ </table>
1159
+ </fieldset>
1160
+ <fieldset id="post_tag" class="bcn_options">
1161
+ <h3><?php _e('Tags', 'breadcrumb_navxt'); ?></h3>
1162
+ <table class="form-table">
1163
+ <tr valign="top">
1164
+ <th scope="row">
1165
+ <label for="post_tag_prefix"><?php _e('Tag Prefix', 'breadcrumb_navxt'); ?></label>
1166
+ </th>
1167
+ <td>
1168
+ <input type="text" name="post_tag_prefix" id="post_tag_prefix" value="<?php echo $this->breadcrumb_trail->opt['post_tag_prefix']; ?>" size="32" /><br />
1169
+ <span class="setting-description"><?php _e('Applied before the anchor on all tag breadcrumbs.', 'breadcrumb_navxt'); ?></span>
1170
+ </td>
1171
+ </tr>
1172
+ <tr valign="top">
1173
+ <th scope="row">
1174
+ <label for="post_tag_suffix"><?php _e('Tag Suffix', 'breadcrumb_navxt'); ?></label>
1175
+ </th>
1176
+ <td>
1177
+ <input type="text" name="post_tag_suffix" id="post_tag_suffix" value="<?php echo $this->breadcrumb_trail->opt['post_tag_suffix']; ?>" size="32" /><br />
1178
+ <span class="setting-description"><?php _e('Applied after the anchor on all tag breadcrumbs.', 'breadcrumb_navxt'); ?></span>
1179
+ </td>
1180
+ </tr>
1181
+ <tr valign="top">
1182
+ <th scope="row">
1183
+ <label for="post_tag_anchor"><?php _e('Tag Anchor', 'breadcrumb_navxt'); ?></label>
1184
+ </th>
1185
+ <td>
1186
+ <input type="text" name="post_tag_anchor" id="post_tag_anchor" value="<?php echo $this->breadcrumb_trail->opt['post_tag_anchor']; ?>" size="60" /><br />
1187
+ <span class="setting-description"><?php _e('The anchor template for tag breadcrumbs.', 'breadcrumb_navxt'); ?></span>
1188
+ </td>
1189
+ </tr>
1190
+ <tr valign="top">
1191
+ <th scope="row">
1192
+ <label for="archive_post_tag_prefix"><?php _e('Archive by Tag Prefix', 'breadcrumb_navxt'); ?></label>
1193
+ </th>
1194
+ <td>
1195
+ <input type="text" name="archive_post_tag_prefix" id="archive_post_tag_prefix" value="<?php echo $this->breadcrumb_trail->opt['archive_post_tag_prefix']; ?>" size="32" /><br />
1196
+ <span class="setting-description"><?php _e('Applied before the title of the current item breadcrumb on an archive by tag page.', 'breadcrumb_navxt'); ?></span>
1197
+ </td>
1198
+ </tr>
1199
+ <tr valign="top">
1200
+ <th scope="row">
1201
+ <label for="archive_post_tag_suffix"><?php _e('Archive by Tag Suffix', 'breadcrumb_navxt'); ?></label>
1202
+ </th>
1203
+ <td>
1204
+ <input type="text" name="archive_post_tag_suffix" id="archive_post_tag_suffix" value="<?php echo $this->breadcrumb_trail->opt['archive_post_tag_suffix']; ?>" size="32" /><br />
1205
+ <span class="setting-description"><?php _e('Applied after the title of the current item breadcrumb on an archive by tag page.', 'breadcrumb_navxt'); ?></span>
1206
+ </td>
1207
+ </tr>
1208
+ </table>
1209
+ </fieldset>
1210
+ <?php
1211
+ //Loop through all of the taxonomies in the array
1212
+ foreach($wp_taxonomies as $taxonomy)
1213
+ {
1214
+ //We only want custom taxonomies
1215
+ if($taxonomy->object_type == 'post' && ($taxonomy->name != 'post_tag' && $taxonomy->name != 'category'))
1216
+ {
1217
+ ?>
1218
+ <fieldset id="<?php echo $taxonomy->name; ?>" class="bcn_options">
1219
+ <h3><?php echo ucwords(__($taxonomy->label)); ?></h3>
1220
+ <table class="form-table">
1221
+ <tr valign="top">
1222
+ <th scope="row">
1223
+ <label for="<?php echo $taxonomy->name; ?>_prefix"><?php printf(__('%s Prefix', 'breadcrumb_navxt'), ucwords(__($taxonomy->label))); ?></label>
1224
+ </th>
1225
+ <td>
1226
+ <input type="text" name="<?php echo $taxonomy->name; ?>_prefix" id="<?php echo $taxonomy->name; ?>_prefix" value="<?php echo $this->breadcrumb_trail->opt[$taxonomy->name . '_prefix']; ?>" size="32" /><br />
1227
+ <span class="setting-description"><?php printf(__('Applied before the anchor on all %s breadcrumbs.', 'breadcrumb_navxt'), strtolower(__($taxonomy->label))); ?></span>
1228
+ </td>
1229
+ </tr>
1230
+ <tr valign="top">
1231
+ <th scope="row">
1232
+ <label for="<?php echo $taxonomy->name; ?>_suffix"><?php printf(__('%s Suffix', 'breadcrumb_navxt'), ucwords(__($taxonomy->label))); ?></label>
1233
+ </th>
1234
+ <td>
1235
+ <input type="text" name="<?php echo $taxonomy->name; ?>_suffix" id="<?php echo $taxonomy->name; ?>_suffix" value="<?php echo $this->breadcrumb_trail->opt[$taxonomy->name . '_suffix']; ?>" size="32" /><br />
1236
+ <span class="setting-description"><?php printf(__('Applied after the anchor on all %s breadcrumbs.', 'breadcrumb_navxt'), strtolower(__($taxonomy->label))); ?></span>
1237
+ </td>
1238
+ </tr>
1239
+ <tr valign="top">
1240
+ <th scope="row">
1241
+ <label for="<?php echo $taxonomy->name; ?>_anchor"><?php printf(__('%s Anchor', 'breadcrumb_navxt'), ucwords(__($taxonomy->label))); ?></label>
1242
+ </th>
1243
+ <td>
1244
+ <input type="text" name="<?php echo $taxonomy->name; ?>_anchor" id="<?php echo $taxonomy->name; ?>_anchor" value="<?php echo $this->breadcrumb_trail->opt[$taxonomy->name . '_anchor']; ?>" size="60" /><br />
1245
+ <span class="setting-description"><?php printf(__('The anchor template for %s breadcrumbs.', 'breadcrumb_navxt'), strtolower(__($taxonomy->label))); ?></span>
1246
+ </td>
1247
+ </tr>
1248
+ <tr valign="top">
1249
+ <th scope="row">
1250
+ <label for="archive_<?php echo $taxonomy->name; ?>_prefix"><?php printf(__('Archive by %s Prefix', 'breadcrumb_navxt'), ucwords(__($taxonomy->label))); ?></label>
1251
+ </th>
1252
+ <td>
1253
+ <input type="text" name="archive_<?php echo $taxonomy->name; ?>_prefix" id="archive_<?php echo $taxonomy->name; ?>_prefix" value="<?php echo $this->breadcrumb_trail->opt['archive_' . $taxonomy->name . '_prefix']; ?>" size="32" /><br />
1254
+ <span class="setting-description"><?php printf(__('Applied before the title of the current item breadcrumb on an archive by %s page.', 'breadcrumb_navxt'), strtolower(__($taxonomy->label))); ?></span>
1255
+ </td>
1256
+ </tr>
1257
+ <tr valign="top">
1258
+ <th scope="row">
1259
+ <label for="archive_<?php echo $taxonomy->name; ?>_suffix"><?php printf(__('Archive by %s Suffix', 'breadcrumb_navxt'), ucwords(__($taxonomy->label))); ?></label>
1260
+ </th>
1261
+ <td>
1262
+ <input type="text" name="archive_<?php echo $taxonomy->name; ?>_suffix" id="archive_<?php echo $taxonomy->name; ?>_suffix" value="<?php echo $this->breadcrumb_trail->opt['archive_' . $taxonomy->name . '_suffix']; ?>" size="32" /><br />
1263
+ <span class="setting-description"><?php printf(__('Applied after the title of the current item breadcrumb on an archive by %s page.', 'breadcrumb_navxt'), strtolower(__($taxonomy->label))); ?></span>
1264
+ </td>
1265
+ </tr>
1266
+ </table>
1267
+ </fieldset>
1268
+ <?php
1269
+ }
1270
+ }
1271
+ ?>
1272
+ <fieldset id="date" class="bcn_options">
1273
+ <h3><?php _e('Date Archives', 'breadcrumb_navxt'); ?></h3>
1274
+ <table class="form-table">
1275
+ <tr valign="top">
1276
+ <th scope="row">
1277
+ <label for="archive_date_prefix"><?php _e('Archive by Date Prefix', 'breadcrumb_navxt'); ?></label>
1278
+ </th>
1279
+ <td>
1280
+ <input type="text" name="archive_date_prefix" id="archive_date_prefix" value="<?php echo $this->breadcrumb_trail->opt['archive_date_prefix']; ?>" size="32" /><br />
1281
+ <span class="setting-description"><?php _e('Applied before the anchor on all date breadcrumbs.', 'breadcrumb_navxt'); ?></span>
1282
+ </td>
1283
+ </tr>
1284
+ <tr valign="top">
1285
+ <th scope="row">
1286
+ <label for="archive_date_suffix"><?php _e('Archive by Date Suffix', 'breadcrumb_navxt'); ?></label>
1287
+ </th>
1288
+ <td>
1289
+ <input type="text" name="archive_date_suffix" id="archive_date_suffix" value="<?php echo $this->breadcrumb_trail->opt['archive_date_suffix']; ?>" size="32" /><br />
1290
+ <span class="setting-description"><?php _e('Applied after the anchor on all date breadcrumbs.', 'breadcrumb_navxt'); ?></span>
1291
+ </td>
1292
+ </tr>
1293
+ <tr valign="top">
1294
+ <th scope="row">
1295
+ <label for="date_anchor"><?php _e('Date Anchor', 'breadcrumb_navxt'); ?></label>
1296
+ </th>
1297
+ <td>
1298
+ <input type="text" name="date_anchor" id="date_anchor" value="<?php echo $this->breadcrumb_trail->opt['date_anchor']; ?>" size="60" /><br />
1299
+ <span class="setting-description"><?php _e('The anchor template for date breadcrumbs.', 'breadcrumb_navxt'); ?></span>
1300
+ </td>
1301
+ </tr>
1302
+ </table>
1303
+ </fieldset>
1304
+ <fieldset id="miscellaneous" class="bcn_options">
1305
+ <h3><?php _e('Miscellaneous', 'breadcrumb_navxt'); ?></h3>
1306
+ <table class="form-table">
1307
+ <tr valign="top">
1308
+ <th scope="row">
1309
+ <label for="author_prefix"><?php _e('Author Prefix', 'breadcrumb_navxt'); ?></label>
1310
+ </th>
1311
+ <td>
1312
+ <input type="text" name="author_prefix" id="author_prefix" value="<?php echo $this->breadcrumb_trail->opt['author_prefix']; ?>" size="32" />
1313
+ </td>
1314
+ </tr>
1315
+ <tr valign="top">
1316
+ <th scope="row">
1317
+ <label for="author_suffix"><?php _e('Author Suffix', 'breadcrumb_navxt'); ?></label>
1318
+ </th>
1319
+ <td>
1320
+ <input type="text" name="author_suffix" id="author_suffix" value="<?php echo $this->breadcrumb_trail->opt['author_suffix']; ?>" size="32" />
1321
+ </td>
1322
+ </tr>
1323
+ <tr valign="top">
1324
+ <th scope="row">
1325
+ <label for="author_display"><?php _e('Author Display Format', 'breadcrumb_navxt'); ?></label>
1326
+ </th>
1327
+ <td>
1328
+ <select name="author_display" id="author_display">
1329
+ <?php $this->select_options('author_display', array("display_name", "nickname", "first_name", "last_name")); ?>
1330
+ </select><br />
1331
+ <span class="setting-description"><?php _e('display_name uses the name specified in "Display name publicly as" under the user profile the others correspond to options in the user profile.', 'breadcrumb_navxt'); ?></span>
1332
+ </td>
1333
+ </tr>
1334
+ <tr valign="top">
1335
+ <th scope="row">
1336
+ <label for="search_prefix"><?php _e('Search Prefix', 'breadcrumb_navxt'); ?></label>
1337
+ </th>
1338
+ <td>
1339
+ <input type="text" name="search_prefix" id="search_prefix" value="<?php echo $this->breadcrumb_trail->opt['search_prefix']; ?>" size="32" />
1340
+ </td>
1341
+ </tr>
1342
+ <tr valign="top">
1343
+ <th scope="row">
1344
+ <label for="search_suffix"><?php _e('Search Suffix', 'breadcrumb_navxt'); ?></label>
1345
+ </th>
1346
+ <td>
1347
+ <input type="text" name="search_suffix" id="search_suffix" value="<?php echo $this->breadcrumb_trail->opt['search_suffix']; ?>" size="32" />
1348
+ </td>
1349
+ </tr>
1350
+ <tr valign="top">
1351
+ <th scope="row">
1352
+ <label for="search_anchor"><?php _e('Search Anchor', 'breadcrumb_navxt'); ?></label>
1353
+ </th>
1354
+ <td>
1355
+ <input type="text" name="search_anchor" id="search_anchor" value="<?php echo $this->breadcrumb_trail->opt['search_anchor']; ?>" size="60" /><br />
1356
+ <span class="setting-description"><?php _e('The anchor template for search breadcrumbs, used only when the search results span several pages.', 'breadcrumb_navxt'); ?></span>
1357
+ </td>
1358
+ </tr>
1359
+ <tr valign="top">
1360
+ <th scope="row">
1361
+ <label for="id404_title"><?php _e('404 Title', 'breadcrumb_navxt'); ?></label>
1362
+ </th>
1363
+ <td>
1364
+ <input type="text" name="404_title" id="id404_title" value="<?php echo $this->breadcrumb_trail->opt['404_title']; ?>" size="32" />
1365
+ </td>
1366
+ </tr>
1367
+ <tr valign="top">
1368
+ <th scope="row">
1369
+ <label for="id404_prefix"><?php _e('404 Prefix', 'breadcrumb_navxt'); ?></label>
1370
+ </th>
1371
+ <td>
1372
+ <input type="text" name="404_prefix" id="id404_prefix" value="<?php echo $this->breadcrumb_trail->opt['404_prefix']; ?>" size="32" />
1373
+ </td>
1374
+ </tr>
1375
+ <tr valign="top">
1376
+ <th scope="row">
1377
+ <label for="id404_suffix"><?php _e('404 Suffix', 'breadcrumb_navxt'); ?></label>
1378
+ </th>
1379
+ <td>
1380
+ <input type="text" name="404_suffix" id="id404_suffix" value="<?php echo $this->breadcrumb_trail->opt['404_suffix']; ?>" size="32" />
1381
+ </td>
1382
+ </tr>
1383
+ </table>
1384
+ </fieldset>
1385
+ </div>
1386
+ <p class="submit"><input type="submit" class="button-primary" name="bcn_admin_options" value="<?php _e('Save Changes') ?>" /></p>
1387
+ </form>
1388
+ <div id="bcn_import_export_relocate">
1389
+ <form action="options-general.php?page=breadcrumb-navxt" method="post" enctype="multipart/form-data" id="bcn_admin_upload">
1390
+ <?php wp_nonce_field('bcn_admin_upload');?>
1391
+ <fieldset id="import_export" class="bcn_options">
1392
+ <h3><?php _e('Import/Export/Reset Settings', 'breadcrumb_navxt'); ?></h3>
1393
+ <p><?php _e('Import Breadcrumb NavXT settings from a XML file, export the current settings to a XML file, or reset to the default Breadcrumb NavXT settings.', 'breadcrumb_navxt');?></p>
1394
+ <table class="form-table">
1395
+ <tr valign="top">
1396
+ <th scope="row">
1397
+ <label for="bcn_admin_import_file"><?php _e('Settings File', 'breadcrumb_navxt'); ?></label>
1398
+ </th>
1399
+ <td>
1400
+ <input type="file" name="bcn_admin_import_file" id="bcn_admin_import_file" size="32"/><br />
1401
+ <span class="setting-description"><?php _e('Select a XML settings file to upload and import settings from.', 'breadcrumb_navxt'); ?></span>
1402
+ </td>
1403
+ </tr>
1404
+ </table>
1405
+ <p class="submit">
1406
+ <input type="submit" class="button" name="bcn_admin_import" value="<?php _e('Import', 'breadcrumb_navxt') ?>" onclick="return bcn_confirm('import')" />
1407
+ <input type="submit" class="button" name="bcn_admin_export" value="<?php _e('Export', 'breadcrumb_navxt') ?>" />
1408
+ <input type="submit" class="button" name="bcn_admin_reset" value="<?php _e('Reset', 'breadcrumb_navxt') ?>" onclick="return bcn_confirm('reset')" />
1409
+ </p>
1410
+ </fieldset>
1411
+ </form>
1412
+ </div>
1413
+ </div>
1414
+ <?php
1415
+ }
1416
+ /**
1417
+ * select_options
1418
+ *
1419
+ * Displays wordpress options as <seclect> options defaults to true/false
1420
+ *
1421
+ * @param string $optionname name of wordpress options store
1422
+ * @param array $options array of names of options that can be selected
1423
+ * @param array $exclude[optional] array of names in $options array to be excluded
1424
+ */
1425
+ function select_options($optionname, $options, $exclude = array())
1426
+ {
1427
+ $value = $this->breadcrumb_trail->opt[$optionname];
1428
+ //First output the current value
1429
+ if($value)
1430
+ {
1431
+ printf('<option>%s</option>', $value);
1432
+ }
1433
+ //Now do the rest
1434
+ foreach($options as $option)
1435
+ {
1436
+ //Don't want multiple occurance of the current value
1437
+ if($option != $value && !in_array($option, $exclude))
1438
+ {
1439
+ printf('<option>%s</option>', $option);
1440
+ }
1441
+ }
1442
+ }
1443
+ /**
1444
+ * add_option
1445
+ *
1446
+ * This inserts the value into the option name, WPMU safe
1447
+ *
1448
+ * @param (string) key name where to save the value in $value
1449
+ * @param (mixed) value to insert into the options db
1450
+ * @return (bool)
1451
+ */
1452
+ function add_option($key, $value)
1453
+ {
1454
+ return add_option($key, $value);
1455
+ }
1456
+ /**
1457
+ * delete_option
1458
+ *
1459
+ * This removes the option name, WPMU safe
1460
+ *
1461
+ * @param (string) key name of the option to remove
1462
+ * @return (bool)
1463
+ */
1464
+ function delete_option($key)
1465
+ {
1466
+ return delete_option($key);
1467
+ }
1468
+ /**
1469
+ * update_option
1470
+ *
1471
+ * This updates the value into the option name, WPMU safe
1472
+ *
1473
+ * @param (string) key name where to save the value in $value
1474
+ * @param (mixed) value to insert into the options db
1475
+ * @return (bool)
1476
+ */
1477
+ function update_option($key, $value)
1478
+ {
1479
+ return update_option($key, $value);
1480
+ }
1481
+ /**
1482
+ * get_option
1483
+ *
1484
+ * This grabs the the data from the db it is WPMU safe and can place the data
1485
+ * in a HTML form safe manner.
1486
+ *
1487
+ * @param (string) key name of the wordpress option to get
1488
+ * @param (bool) safe output for HTML forms (default: false)
1489
+ * @return (mixed) value of option
1490
+ */
1491
+ function get_option($key, $safe = false)
1492
+ {
1493
+ $db_data = get_option($key);
1494
+ if($safe)
1495
+ {
1496
+ //If we get an array, we should loop through all of its members
1497
+ if(is_array($db_data))
1498
+ {
1499
+ //Loop through all the members
1500
+ foreach($db_data as $key=>$item)
1501
+ {
1502
+ //We ignore anything but strings
1503
+ if(is_string($item))
1504
+ {
1505
+ $db_data[$key] = htmlentities($item, ENT_COMPAT, 'UTF-8');
1506
+ }
1507
+ }
1508
+ }
1509
+ else
1510
+ {
1511
+ $db_data = htmlentities($db_data, ENT_COMPAT, 'UTF-8');
1512
+ }
1513
+ }
1514
+ return $db_data;
1515
+ }
1516
+ /**
1517
+ * notify
1518
+ *
1519
+ * Output a 'notify' box with a message after an event occurs
1520
+ *
1521
+ * @param $message string the message to deliver
1522
+ * @param $error bool[optional] is the message an error?
1523
+ */
1524
+ function notify($message, $error = false)
1525
+ {
1526
+ //If the message is an error use the appropriate class
1527
+ $class = $error ? 'error' : 'updated fade';
1528
+ printf('<div class="%s"><p>%s</p></div>', $class, $message);
1529
+ }
1530
+
1531
+ /**
1532
+ * callback function for admin_notices
1533
+ *
1534
+ * @return void
1535
+ */
1536
+ function notify_import_failure()
1537
+ {
1538
+ $this->notify(__('Importing settings from file failed.', 'breadcrumb_navxt'), true);
1539
+ }
1540
+
1541
+ /**
1542
+ * callback function for admin_notices
1543
+ *
1544
+ * @return void
1545
+ */
1546
+ function notify_import_success()
1547
+ {
1548
+ $this->notify(__('The Breadcrumb NavXT settings were successfully imported from file.', 'breadcrumb_navxt'));
1549
+ }
1550
+
1551
+ /**
1552
+ * callback function for admin_notices
1553
+ *
1554
+ * @return void
1555
+ */
1556
+ function notify_reset()
1557
+ {
1558
+ $this->notify(__('The Breadcrumb NavXT settings were reset to the default values.', 'breadcrumb_navxt'));
1559
+ }
1560
+ }
1561
+ //Let's make an instance of our object takes care of everything
1562
+ $bcn_admin = new bcn_admin;
1563
+ /**
1564
+ * A wrapper for the internal function in the class
1565
+ *
1566
+ * @param bool $return Whether to return or echo the trail. (optional)
1567
+ * @param bool $linked Whether to allow hyperlinks in the trail or not. (optional)
1568
+ * @param bool $reverse Whether to reverse the output or not. (optional)
1569
+ */
1570
+ function bcn_display($return = false, $linked = true, $reverse = false)
1571
+ {
1572
+ global $bcn_admin;
1573
+ return $bcn_admin->display($return, $linked, $reverse);
1574
+ }
1575
+ /**
1576
+ * A wrapper for the internal function in the class
1577
+ *
1578
+ * @param bool $return Whether to return or echo the trail. (optional)
1579
+ * @param bool $linked Whether to allow hyperlinks in the trail or not. (optional)
1580
+ * @param bool $reverse Whether to reverse the output or not. (optional)
1581
+ */
1582
+ function bcn_display_list($return = false, $linked = true, $reverse = false)
1583
+ {
1584
+ global $bcn_admin;
1585
+ return $bcn_admin->display_list($return, $linked, $reverse);
1586
+ }
breadcrumb_navxt_class.php CHANGED
@@ -130,7 +130,7 @@ class bcn_breadcrumb
130
  class bcn_breadcrumb_trail
131
  {
132
  //Our member variables
133
- public $version = '3.4.0';
134
  //An array of breadcrumbs
135
  public $trail = array();
136
  //The options
@@ -477,7 +477,7 @@ class bcn_breadcrumb_trail
477
  $bcn_breadcrumb->title .= ', ';
478
  }
479
  //This is a bit hackish, but it compiles the tag anchor and appends it to the current breadcrumb title
480
- $bcn_breadcrumb->title .= $this->opt[$taxonomy . '_prefix'] . str_replace('%title%', $term->name, $this->opt[$taxonomy . '_anchor']) .
481
  $term->name . '</a>' . $this->opt[$taxonomy . '_suffix'];
482
  $is_first = false;
483
  }
@@ -534,7 +534,7 @@ class bcn_breadcrumb_trail
534
  if(is_paged() && $this->opt['paged_display'])
535
  {
536
  //Figure out the anchor for current category
537
- $breadcrumb->set_anchor($this->opt[$term->taxonomy . '_anchor'], get_term_link($term->term_id, $term->taxonomy));
538
  }
539
  //Get parents of current category
540
  if($term->parent)
@@ -563,7 +563,7 @@ class bcn_breadcrumb_trail
563
  if(is_paged() && $this->opt['paged_display'])
564
  {
565
  //Figure out the anchor for current category
566
- $breadcrumb->set_anchor($this->opt[$term->taxonomy . '_anchor'], get_term_link($term->term_id, $term->taxonomy));
567
  }
568
  }
569
  /**
130
  class bcn_breadcrumb_trail
131
  {
132
  //Our member variables
133
+ public $version = '3.4.1';
134
  //An array of breadcrumbs
135
  public $trail = array();
136
  //The options
477
  $bcn_breadcrumb->title .= ', ';
478
  }
479
  //This is a bit hackish, but it compiles the tag anchor and appends it to the current breadcrumb title
480
+ $bcn_breadcrumb->title .= $this->opt[$taxonomy . '_prefix'] . str_replace('%title%', $term->name, str_replace('%link%', get_term_link($term, $taxonomy), $this->opt[$taxonomy . '_anchor'])) .
481
  $term->name . '</a>' . $this->opt[$taxonomy . '_suffix'];
482
  $is_first = false;
483
  }
534
  if(is_paged() && $this->opt['paged_display'])
535
  {
536
  //Figure out the anchor for current category
537
+ $breadcrumb->set_anchor($this->opt[$term->taxonomy . '_anchor'], get_term_link($term, $term->taxonomy));
538
  }
539
  //Get parents of current category
540
  if($term->parent)
563
  if(is_paged() && $this->opt['paged_display'])
564
  {
565
  //Figure out the anchor for current category
566
+ $breadcrumb->set_anchor($this->opt[$term->taxonomy . '_anchor'], get_term_link($term, $term->taxonomy));
567
  }
568
  }
569
  /**
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: mtekk, hakre
3
  Tags: breadcrumb, navigation
4
  Requires at least: 2.6
5
  Tested up to: 2.9
6
- Stable tag: 3.4.0
7
  Adds breadcrumb navigation showing the visitor's path to their current location.
8
 
9
  == Description ==
@@ -31,10 +31,13 @@ Don't see your language on the list? Feel free to translate Breadcrumb NavXT and
31
  Please visit [Breadcrumb NavXT's](http://mtekk.weblogs.us/code/breadcrumb-navxt/#installation "Go to Breadcrumb NavXT's project page's installation section.") project page for installation and usage instructions.
32
 
33
  == Changelog ==
34
-
 
 
 
35
  = 3.4.0 =
36
  * New feature: Proper support of custom taxonomies. category_parents and post_tags replaced with term_parents and post_terms.
37
- * New feature: Ability to use date as post taxonomy�.
38
  * New feature: Translations for Italian now included thanks to Luca Camellini.
39
  * Bug fix: Fixed permalink for day breadcrumbs.
40
  * Bug fix: Flat taxonomy archive breadcrumbs now are surrounded by both the standard and archive prefix/suffix combination.
3
  Tags: breadcrumb, navigation
4
  Requires at least: 2.6
5
  Tested up to: 2.9
6
+ Stable tag: 3.4.1
7
  Adds breadcrumb navigation showing the visitor's path to their current location.
8
 
9
  == Description ==
31
  Please visit [Breadcrumb NavXT's](http://mtekk.weblogs.us/code/breadcrumb-navxt/#installation "Go to Breadcrumb NavXT's project page's installation section.") project page for installation and usage instructions.
32
 
33
  == Changelog ==
34
+ = 3.4.1 =
35
+ * Bug fix: Fixed issue with PHP unexpected $end on line 1567 in breadcrumb_navxt_admin.php.
36
+ * Bug fix: Fixed issue where the %link% anchor tag would not be replaced with a URI for flat taxonomies (e.g. tags).
37
+ * Bug fix: Fixed issue where paged breadcrumbs would cause WP_Error objects to be thrown.
38
  = 3.4.0 =
39
  * New feature: Proper support of custom taxonomies. category_parents and post_tags replaced with term_parents and post_terms.
40
+ * New feature: Ability to use date as post "taxonomy".
41
  * New feature: Translations for Italian now included thanks to Luca Camellini.
42
  * Bug fix: Fixed permalink for day breadcrumbs.
43
  * Bug fix: Flat taxonomy archive breadcrumbs now are surrounded by both the standard and archive prefix/suffix combination.