Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
_build/build.config.php
_packages
config.core.php
nbproject
.idea
Expand Down
15 changes: 11 additions & 4 deletions _build/build.transport.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,25 +65,27 @@
$modx= new modX();
$modx->initialize('mgr');
$modx->setLogLevel(xPDO::LOG_LEVEL_INFO);
if (!XPDO_CLI_MODE) { echo '<pre>'; }
$modx->setLogTarget('ECHO');
$modx->setLogTarget(XPDO_CLI_MODE ? 'ECHO' : 'HTML');
echo 'Packing '.PKG_NAME_LOWER.'-'.PKG_VERSION.'-'.PKG_RELEASE.'<pre>'; flush();

$modx->loadClass('transport.modPackageBuilder','',false, true);
$builder = new modPackageBuilder($modx);
$builder->directory = dirname(dirname(__FILE__)).'/_packages/';
$builder->createPackage(PKG_NAME_LOWER,PKG_VERSION,PKG_RELEASE);
$builder->registerNamespace(PKG_NAME_LOWER,false,true,'{core_path}components/'.PKG_NAME_LOWER.'/');

/* create category */
$category= $modx->newObject('modCategory');
$category->set('id',1);
$category->set('category',PKG_NAME);
$modx->log(modX::LOG_LEVEL_INFO,'Packaged in category.'); flush();

/* add snippets */
$snippets = include_once $sources['data'].'transport.snippets.php';
if (is_array($snippets)) {
$category->addMany($snippets);
$modx->log(xPDO::LOG_LEVEL_INFO,'Packaged in '.count($snippets).' Snippets.');
} else { $modx->log(xPDO::LOG_LEVEL_ERROR,'Adding snippets failed.'); }
$modx->log(modX::LOG_LEVEL_INFO,'Packaged in '.count($snippets).' snippets.'); flush();
} else { $modx->log(modX::LOG_LEVEL_FATAL,'Adding snippets failed.'); }

/* create category vehicle */
$attr = array(
Expand All @@ -99,6 +101,7 @@
),
)
);
$modx->log(modX::LOG_LEVEL_INFO, 'Packaging in vehicle...'); flush();
$vehicle = $builder->createVehicle($category,$attr);
$vehicle->resolve('file',array(
'source' => $sources['source_core'],
Expand All @@ -111,15 +114,19 @@
));*/
$builder->putVehicle($vehicle);

/* now pack in the license file, readme and setup options */
$builder->setPackageAttributes(array(
'license' => file_get_contents($sources['docs'] . 'license.txt'),
'readme' => file_get_contents($sources['docs'] . 'readme.txt'),
'changelog' => file_get_contents($sources['docs'] . 'changelog.txt'),
));
$modx->log(modX::LOG_LEVEL_INFO,'Packaged in package attributes.'); flush();

/* zip up package */
$modx->log(modX::LOG_LEVEL_INFO,'Packing...'); flush();
$builder->pack();

/* calculate build time */
$mtime= microtime();
$mtime= explode(" ", $mtime);
$mtime= $mtime[1] + $mtime[0];
Expand Down
24 changes: 21 additions & 3 deletions _build/data/transport.snippets.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,28 @@
$snippets[0]= $modx->newObject('modSnippet');
$snippets[0]->fromArray(array(
'id' => 0,
'name' => 'Breadcrumbs',
'description' => '',
'snippet' => getSnippetContent($sources['source_core'].'/elements/snippets/snippet.breadcrumbs.php'),
'name' => PKG_NAME,
'description' => 'Creates a highly configurable and styleable breadcrumb navigation trail.',
'snippet' => getSnippetContent($sources['snippets'].'snippet.'.PKG_NAME_LOWER.'.php'),
'properties' => '',
),'',true,true);

$snippetProperties = array();
$props = include $sources['snippets'].'snippet.'.PKG_NAME_LOWER.'.properties.php';
foreach ($props as $key => $value) {
if (is_string($value) || is_int($value)) { $type = 'textfield'; }
elseif (is_bool($value)) { $type = 'combo-boolean'; }
else { $type = 'textfield'; }
$snippetProperties[] = array(
'name' => $key,
'desc' => PKG_NAME_LOWER.'.prop_desc.'.$key,
'type' => $type,
'options' => '',
'value' => ($value != null) ? $value : '',
'lexicon' => PKG_NAME_LOWER.':properties'
);
}
if (count($snippetProperties) > 0)
$snippets[0]->setProperties($snippetProperties);

return $snippets;
Binary file added _packages/breadcrumbs-1.1.0-pl.transport.zip
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
* @editor Shaun McCormick <shaun@collabpad.com>
* @editor Shawn Wilkerson <shawn@shawnwilkerson.com>
* @editor Wieger Sloot, Sterc.nl <wieger@sterc.nl>
* @editor Jerome Perrin <hello@jeromeperrin.com>
* @tester Bob Ray
* @package breadcrumbs
*
Expand All @@ -41,15 +42,16 @@
* @see breadcrumbs.class.php for config settings
*
* Included classes
* .B_crumbBox Span that surrounds all crumb output
* .B_hideCrumb Span surrounding the "..." if there are more crumbs than will be shown
* .B_currentCrumb Span or A tag surrounding the current crumb
* .B_firstCrumb Span that always surrounds the first crumb, whether it is "home" or not
* .B_lastCrumb Span surrounding last crumb, whether it is the current page or not .
* .B_crumb Class given to each A tag surrounding the intermediate crumbs (not home, or
* hide)
* .B_homeCrumb Class given to the home crumb
* .breadcrumb ul tag that surrounds all crumb output
* .active a tag surrounding the current crumb
* .maxDelimiter li tag surrounding the "..." if there are more crumbs than will be shown
*/
require_once $modx->getOption('breadcrumbs.core_path',null,$modx->getOption('core_path').'components/breadcrumbs/').'model/breadcrumbs/breadcrumbs.class.php';
$bc = new BreadCrumbs($modx,$scriptProperties);
return $bc->run();
$path = $modx->getOption('breadcrumbs.core_path',null,$modx->getOption('core_path').'components/breadcrumbs/');

$p = include $path.'elements/snippets/snippet.breadcrumbs.properties.php';
$p = array_merge($p,$scriptProperties);

$breadcrumbs = $modx->getService('breadcrumbs','BreadCrumbs',$path.'model/',$p);
if (!($breadcrumbs instanceof BreadCrumbs)) return $modx->lexicon('breadcrumbs.error.loadingclass',array('path' => $path.'model/'));

return $breadcrumbs->run();
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
<?php
/**
* BreadCrumbs
*
* Copyright 2009-2011 by Shaun McCormick <shaun+bc@modx.com>
*
* BreadCrumbs is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option) any
* later version.
*
* BreadCrumbs is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
* A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with
* BreadCrumbs; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
* Suite 330, Boston, MA 02111-1307 USA
*
* @package breadcrumbs
*/
/**
* @name BreadCrumbs
* @version 0.9f
* @created 2012-04-02
* @since 2009-05-11
* @author Jerome Perrin <hello@jeromeperrin.com>
* @package breadcrumbs
*
* This snippet was designed to show the path through the various levels of site
* structure back to the root. It is NOT necessarily the path the user took to
* arrive at a given page.
*
*/

return array(

/**
* Max number of elements to have in a path. 100 is an arbitrary
* high number. If you make it smaller, like say 2, but you are 5
* levels deep, it will appear as: Home > ... > Level 4 > Level 5 It
* should be noted that "Home" and the current page do not count.
* Each of these are configured separately.
*
* @var integer $maxCrumbs
*/
'maxCrumbs' => 100,
/**
* When your path includes an unpublished folder, setting this to 1
* will show all documents in path EXCEPT the unpublished. Example
* path (unpublished in caps): home > news > CURRENT > SPORTS >
* skiiing > article $pathThruUnPub = true would give you this: home
* > news > skiiing > article $pathThruUnPub = false would give you
* this: home > skiiing > article (assuming you have home crumb
* turned on)
*
* @var boolean $pathThruUnPub
*/
'pathThruUnPub' => true,
/**
* Setting this to 1 will hide items in the breadcrumb list that
* are set to be hidden in menus.
*
* @var boolean $respectHidemenu
*/
'respectHidemenu' => true,
/**
* Would you like your crumb string to start with a link to home?
* Some would not because a home link is usually found in the site
* logo or elsewhere in the navigation scheme.
*
* @var boolean $showHomeCrumb
*/
'showHomeCrumb' => true,
/**
* You can use this to turn off the breadcrumbs on the home page
* with 1. grad: actually '1' shows and '0' hides crumbs at
* homepage.
*
* @var boolean $showCrumbsAtHome
*/
'showCrumbsAtHome' => false,
/**
* Show the current page in path with 1 or not with 0.
*
* @var boolean $showCurrentCrumb
*/
'showCurrentCrumb' => true,
/**
* If you want the current page crumb to be a link (to itself) then
* set to 1.
*
* @var boolean $currentAsLink
*/
'currentAsLink' => true,
/**
* Define what you want between the crumbs.
*
* @var string $crumbSeparator
*/
'crumbSeparator' => '&raquo;',
/**
* Just in case you want to have a home link, but want to call it
* something else.
*
* @var string $homeCrumbTitle
*/
'homeCrumbTitle' => 'Home',
/**
* In case you want to have a custom description of the home link.
* Defaults to title of home link.
*
* @var string $homeCrumbDescription
*/
'homeCrumbDescription' => 'Home',
/**
* To change default page field to be used as a breadcrumb title,
* default is pagetitle.
*
* @var string $titleField
*/
'titleField' => 'pagetitle',
/**
* To change default page field to be used as a breadcrumb
* description, default is description (GA: falls back to pagetitle
* if description is empty).
*
* @var string $descField
*/
'descField' => 'description',
/**
* The class of the outer container
*
* @var string $outerClass
*/
'outerClass' => 'breadcrumb',
/**
* The class of the current crumb
*
* @var string $currentCrumbClass
*/
'currentCrumbClass' => 'active',
/**
* The string that will show if the maximum number of breadcrumbs
* has been shown.
*
* @var string $max_delimiter
*/
'maxDelimiter' => '...',
'bcTplCrumbCurrent' => '<li class="[[+class]]" itemscope="itemscope" itemtype="http://data-vocabulary.org/Breadcrumb">[[+text]]</li>',
'bcTplCrumbCurrentLink' => '<a itemprop="url" href="[[~[[+resource]]]]"><span itemprop="title">[[+text]]</span></a>',
'bcTplCrumbHome' => '<a itemprop="url" href="[[~[[++site_start]]]]"><span itemprop="title">[[+text]]</span></a>',
'bcTplCrumbMax' => '<li class="maxDelimiter" itemscope="itemscope" itemtype="http://data-vocabulary.org/Breadcrumb">[[+text]]</li>',
'bcTplCrumbLink' => '<a itemprop="url" href="[[~[[+resource]]]]"><span itemprop="title">[[+text]]</span></a>',
'bcTplCrumbOuter' => '<ul class="[[+class]]">[[+text]]</ul>',
'bcTplCrumb' => '<li itemscope="itemscope" itemtype="http://data-vocabulary.org/Breadcrumb">[[+text]]</li>',
'bcTplCrumbSeparator' => '<span class="divider">[[+separator]]</span>'
);

?>
33 changes: 33 additions & 0 deletions core/components/breadcrumbs/lexicon/en/default.inc.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php
/**
* BreadCrumbs
*
* Copyright 2009-2011 by Shaun McCormick <shaun+bc@modx.com>
*
* BreadCrumbs is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option) any
* later version.
*
* BreadCrumbs is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
* A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with
* BreadCrumbs; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
* Suite 330, Boston, MA 02111-1307 USA
*
* @package breadcrumbs
*/

/**
* Default English Topic for BreadCrumbs.
*
* @author Jerome Perrin <hello@jeromeperrin.com>
* @package BreadCrumbs
* @subpackage lexicon
* @language en
*/
$_lang['breadcrumbs'] = 'BreadCrumbs';
$_lang['breadcrumbs.error.loadingclass'] = 'Error loading class BreadCrumbs from [[+path]].';

51 changes: 51 additions & 0 deletions core/components/breadcrumbs/lexicon/en/properties.inc.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php
/**
* BreadCrumbs
*
* Copyright 2009-2011 by Shaun McCormick <shaun+bc@modx.com>
*
* BreadCrumbs is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option) any
* later version.
*
* BreadCrumbs is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
* A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with
* BreadCrumbs; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
* Suite 330, Boston, MA 02111-1307 USA
*
* @package breadcrumbs
*/

/**
* Properties English Topic for breadcrumbs.
*
* @author Jerome Perrin <hello@jeromeperrin.com>
* @package BreadCrumbs
* @subpackage lexicon
* @language en
*/
$_lang['breadcrumbs.prop_desc.maxCrumbs'] = 'Max number of elements to have in a path. If you make it smaller, like say 2, but you are 5 levels deep, it will appear as: Home > ... > Level 4 > Level 5. "Home" and the current page do not count. Each of these are configured separately.';
$_lang['breadcrumbs.prop_desc.pathThruUnPub'] = 'When your path includes an unpublished folder, setting this to 1 will show all documents in path EXCEPT the unpublished. Refer to the documentation for more details: http://rtfm.modx.com/display/ADDON/Breadcrumbs';
$_lang['breadcrumbs.prop_desc.respectHidemenu'] = 'Setting this to 1 will hide items in the breadcrumb list that are set to be hidden in menus.';
$_lang['breadcrumbs.prop_desc.showHomeCrumb'] = 'Would you like your crumb string to start with a link to home? Some would not because a home link is usually found in the site logo or elsewhere in the navigation scheme.';
$_lang['breadcrumbs.prop_desc.showCrumbsAtHome'] = 'You can use this to turn off the breadcrumbs on the home page with 1. grad: actually \'1\' shows and \'0\' hides crumbs at homepage';
$_lang['breadcrumbs.prop_desc.showCurrentCrumb'] = 'Show the current page in path with 1 or not with 0';
$_lang['breadcrumbs.prop_desc.currentAsLink'] = 'If you want the current page crumb to be a link (to itself) then set to 1.';
$_lang['breadcrumbs.prop_desc.crumbSeparator'] = 'Define what you want between the crumbs.';
$_lang['breadcrumbs.prop_desc.homeCrumbTitle'] = 'Just in case you want to have a home link, but want to call it something else.';
$_lang['breadcrumbs.prop_desc.homeCrumbDescription'] = 'In case you want to have a custom description of the home link. Defaults to title of home link.';
$_lang['breadcrumbs.prop_desc.titleField'] = 'To change default page field to be used as a breadcrumb title, default is pagetitle.';
$_lang['breadcrumbs.prop_desc.descField'] = 'To change default page field to be used as a breadcrumb description, default is description (GA: falls back to pagetitle if description is empty).';
$_lang['breadcrumbs.prop_desc.maxDelimiter'] = 'The string that will show if the maximum number of breadcrumbs has been shown.';
$_lang['breadcrumbs.prop_desc.bcTplCrumbCurrent'] = '';
$_lang['breadcrumbs.prop_desc.bcTplCrumbCurrentLink'] = '';
$_lang['breadcrumbs.prop_desc.bcTplCrumbHome'] = '';
$_lang['breadcrumbs.prop_desc.bcTplCrumbMax'] = '';
$_lang['breadcrumbs.prop_desc.bcTplCrumbLink'] = '';
$_lang['breadcrumbs.prop_desc.bcTplCrumbOuter'] = '';
$_lang['breadcrumbs.prop_desc.bcTplCrumb'] = '';
$_lang['breadcrumbs.prop_desc.bcTplCrumbSeparator'] = '';
Loading