Permalink
Browse files

[Breadcrumbs]

- Fix issue with initialize() no longer needed, plus integrating $scriptProperties
  • Loading branch information...
1 parent 82c0048 commit 140498a18a0127a0302f6db47f66e69161d03349 splittingred committed Apr 13, 2009
@@ -23,27 +23,12 @@ class BreadCrumbs {
* @param modX $modx A reference to the modX constructor.
* @param array $config A configuration array.
*/
- function BreadCrumbs(&$modx,$config) {
- $this->__construct($modx,$config);
+ function BreadCrumbs(&$modx,$config = array()) {
+ $this->__construct($modx,$config = array());
}
/** @ignore */
- function __construct(&$modx,$config) {
+ function __construct(&$modx,$config = array()) {
$this->modx =& $modx;
- $this->config = $config;
- $this->_crumbs = array();
- $this->_tpls = array();
- }
- /**#@-*/
-
- /**
- * Initialize the default configuration parameters, allowing overrides
- *
- * @access public
- * @param array $config An array of configuration parameters
- * @return array The newly set config array
- */
- function initialize($config = array()) {
- if (!is_array($config)) $config = array();
$this->config = array_merge(array(
/**
@@ -156,10 +141,10 @@ function initialize($config = array()) {
'bcTplCrumbOuter' => '<span class="B_crumbBox">[[+text]]</span>',
'bcTplCrumb' => '<span class="B_crumb">[[+text]]</span>',
),$config);
-
- return $this->config;
+ $this->_crumbs = array();
+ $this->_tpls = array();
}
-
+ /**#@-*/
/**
* Show the current resource's breadcrumbs.
*
@@ -27,11 +27,9 @@
* hide)
* .B_homeCrumb Class given to the home crumb
*/
-
/* Check for home page */
$path = $modx->config['core_path'].'components/breadcrumbs/';
$modx->loadClass('breadcrumbs',$path,true,true);
-$bc = new BreadCrumbs($modx);
-$bc->initialize($scriptProperties);
+$bc = new BreadCrumbs($modx,$scriptProperties);
return $bc->run();

0 comments on commit 140498a

Please sign in to comment.