Spade
Mini Shell
helper.php000064400000004625151165171360006551 0ustar00<?php
/**
* @package Joomla.Site
* @subpackage mod_breadcrumbs
*
* @copyright (C) 2006 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Helper for mod_breadcrumbs
*
* @since 1.5
*/
class ModBreadCrumbsHelper
{
/**
* Retrieve breadcrumb items
*
* @param \Joomla\Registry\Registry &$params module parameters
*
* @return array
*/
public static function getList(&$params)
{
// Get the PathWay object from the application
$app = JFactory::getApplication();
$pathway = $app->getPathway();
$items = $pathway->getPathWay();
$lang = JFactory::getLanguage();
$menu = $app->getMenu();
// Look for the home menu
if (JLanguageMultilang::isEnabled())
{
$home = $menu->getDefault($lang->getTag());
}
else
{
$home = $menu->getDefault();
}
$count = count($items);
// Don't use $items here as it references JPathway properties
directly
$crumbs = array();
for ($i = 0; $i < $count; $i ++)
{
$crumbs[$i] = new stdClass;
$crumbs[$i]->name =
stripslashes(htmlspecialchars($items[$i]->name, ENT_COMPAT,
'UTF-8'));
$crumbs[$i]->link = !is_null($items[$i]->link) ?
JRoute::_($items[$i]->link) : '';
}
if ($params->get('showHome', 1))
{
$item = new stdClass;
$item->name = htmlspecialchars($params->get('homeText',
JText::_('MOD_BREADCRUMBS_HOME')), ENT_COMPAT,
'UTF-8');
$item->link = JRoute::_('index.php?Itemid=' .
$home->id);
array_unshift($crumbs, $item);
}
return $crumbs;
}
/**
* Set the breadcrumbs separator for the breadcrumbs display.
*
* @param string $custom Custom xhtml compliant string to separate the
items of the breadcrumbs
*
* @return string Separator string
*
* @since 1.5
*/
public static function setSeparator($custom = null)
{
$lang = JFactory::getLanguage();
// If a custom separator has not been provided we try to load a template
// specific one first, and if that is not present we load the default
separator
if ($custom === null)
{
if ($lang->isRtl())
{
$_separator = JHtml::_('image',
'system/arrow_rtl.png', null, null, true);
}
else
{
$_separator = JHtml::_('image', 'system/arrow.png',
null, null, true);
}
}
else
{
$_separator = htmlspecialchars($custom, ENT_COMPAT,
'UTF-8');
}
return $_separator;
}
}
mod_breadcrumbs.php000064400000001375151165171360010421 0ustar00<?php
/**
* @package Joomla.Site
* @subpackage mod_breadcrumbs
*
* @copyright (C) 2005 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
// Include the breadcrumbs functions only once
JLoader::register('ModBreadCrumbsHelper', __DIR__ .
'/helper.php');
// Get the breadcrumbs
$list = ModBreadCrumbsHelper::getList($params);
$count = count($list);
// Set the default separator
$separator =
ModBreadCrumbsHelper::setSeparator($params->get('separator'));
$moduleclass_sfx =
htmlspecialchars($params->get('moduleclass_sfx',
''), ENT_COMPAT, 'UTF-8');
require JModuleHelper::getLayoutPath('mod_breadcrumbs',
$params->get('layout', 'default'));
mod_breadcrumbs.xml000064400000006505151165171360010432 0ustar00<?xml
version="1.0" encoding="utf-8"?>
<extension type="module" version="3.1"
client="site" method="upgrade">
<name>mod_breadcrumbs</name>
<author>Joomla! Project</author>
<creationDate>July 2006</creationDate>
<copyright>(C) 2006 Open Source Matters, Inc.</copyright>
<license>GNU General Public License version 2 or later; see
LICENSE.txt</license>
<authorEmail>admin@joomla.org</authorEmail>
<authorUrl>www.joomla.org</authorUrl>
<version>3.0.0</version>
<description>MOD_BREADCRUMBS_XML_DESCRIPTION</description>
<files>
<filename
module="mod_breadcrumbs">mod_breadcrumbs.php</filename>
<folder>tmpl</folder>
<filename>helper.php</filename>
</files>
<languages>
<language
tag="en-GB">en-GB.mod_breadcrumbs.ini</language>
<language
tag="en-GB">en-GB.mod_breadcrumbs.sys.ini</language>
</languages>
<help key="JHELP_EXTENSIONS_MODULE_MANAGER_BREADCRUMBS" />
<config>
<fields name="params">
<fieldset name="basic">
<field
name="showHere"
type="radio"
label="MOD_BREADCRUMBS_FIELD_SHOWHERE_LABEL"
description="MOD_BREADCRUMBS_FIELD_SHOWHERE_DESC"
class="btn-group btn-group-yesno"
default="1"
filter="integer"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
<field
name="showHome"
type="radio"
label="MOD_BREADCRUMBS_FIELD_SHOWHOME_LABEL"
description="MOD_BREADCRUMBS_FIELD_SHOWHOME_DESC"
class="btn-group btn-group-yesno"
default="1"
filter="integer"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
<field
name="homeText"
type="text"
label="MOD_BREADCRUMBS_FIELD_HOMETEXT_LABEL"
description="MOD_BREADCRUMBS_FIELD_HOMETEXT_DESC"
showon="showHome:1"
/>
<field
name="showLast"
type="radio"
label="MOD_BREADCRUMBS_FIELD_SHOWLAST_LABEL"
description="MOD_BREADCRUMBS_FIELD_SHOWLAST_DESC"
default="1"
filter="integer"
class="btn-group btn-group-yesno"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
<field
name="separator"
type="text"
label="MOD_BREADCRUMBS_FIELD_SEPARATOR_LABEL"
description="MOD_BREADCRUMBS_FIELD_SEPARATOR_DESC"
/>
</fieldset>
<fieldset name="advanced">
<field
name="layout"
type="modulelayout"
label="JFIELD_ALT_LAYOUT_LABEL"
description="JFIELD_ALT_MODULE_LAYOUT_DESC"
validate="moduleLayout"
/>
<field
name="moduleclass_sfx"
type="textarea"
label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL"
description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC"
rows="3"
/>
<field
name="cache"
type="list"
label="COM_MODULES_FIELD_CACHING_LABEL"
description="COM_MODULES_FIELD_CACHING_DESC"
default="0"
filter="integer"
>
<option value="1">JGLOBAL_USE_GLOBAL</option>
<option
value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option>
</field>
<field
name="cache_time"
type="number"
label="COM_MODULES_FIELD_CACHE_TIME_LABEL"
description="COM_MODULES_FIELD_CACHE_TIME_DESC"
default="0"
filter="integer"
/>
<field
name="cachemode"
type="hidden"
default="itemid"
>
<option value="itemid"></option>
</field>
</fieldset>
</fields>
</config>
</extension>
tmpl/default.php000064400000004534151165171370007672 0ustar00<?php
/**
* @package Joomla.Site
* @subpackage mod_breadcrumbs
*
* @copyright (C) 2006 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
?>
<div aria-label="<?php echo htmlspecialchars($module->title,
ENT_QUOTES, 'UTF-8'); ?>" role="navigation">
<ul itemscope itemtype="https://schema.org/BreadcrumbList"
class="breadcrumb<?php echo $moduleclass_sfx; ?>">
<?php if ($params->get('showHere', 1)) : ?>
<li>
<?php echo JText::_('MOD_BREADCRUMBS_HERE');
?> 
</li>
<?php else : ?>
<li class="active">
<span class="divider icon-location"></span>
</li>
<?php endif; ?>
<?php
// Get rid of duplicated entries on trail including home page when using
multilanguage
for ($i = 0; $i < $count; $i++)
{
if ($i === 1 && !empty($list[$i]->link) &&
!empty($list[$i - 1]->link) && $list[$i]->link === $list[$i -
1]->link)
{
unset($list[$i]);
}
}
// Find last and penultimate items in breadcrumbs list
end($list);
$last_item_key = key($list);
prev($list);
$penult_item_key = key($list);
// Make a link if not the last item in the breadcrumbs
$show_last = $params->get('showLast', 1);
// Generate the trail
foreach ($list as $key => $item) :
if ($key !== $last_item_key) :
// Render all but last item - along with separator ?>
<li itemprop="itemListElement" itemscope
itemtype="https://schema.org/ListItem">
<?php if (!empty($item->link)) : ?>
<a itemprop="item" href="<?php echo
$item->link; ?>" class="pathway"><span
itemprop="name"><?php echo $item->name;
?></span></a>
<?php else : ?>
<span itemprop="name">
<?php echo $item->name; ?>
</span>
<?php endif; ?>
<?php if (($key !== $penult_item_key) || $show_last) : ?>
<span class="divider">
<?php echo $separator; ?>
</span>
<?php endif; ?>
<meta itemprop="position" content="<?php echo
$key + 1; ?>">
</li>
<?php elseif ($show_last) :
// Render last item if reqd. ?>
<li itemprop="itemListElement" itemscope
itemtype="https://schema.org/ListItem"
class="active">
<span itemprop="name">
<?php echo $item->name; ?>
</span>
<meta itemprop="position" content="<?php echo
$key + 1; ?>">
</li>
<?php endif;
endforeach; ?>
</ul>
</div>