Spade
Mini Shell
| Directory:~$ /home/lmsyaran/public_html/joomla4/ |
| [Home] [System Details] [Kill Me] |
com_media/imageslist/default_folder.php000064400000001544147357347510014336
0ustar00<?php
/**
* @package Joomla.Administrator
* @subpackage com_media
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
$input = JFactory::getApplication()->input;
?>
<li class="imgOutline thumbnail height-80 width-80 center">
<a
href="index.php?option=com_media&view=imagesList&tmpl=component&folder=<?php
echo rawurlencode($this->_tmp_folder->path_relative);
?>&asset=<?php echo
$input->getCmd('asset');?>&author=<?php echo
$input->getCmd('author');?>"
target="imageframe">
<div class="imgFolder">
<span class="icon-folder-2"></span>
</div>
<div class="small">
<?php echo JHtml::_('string.truncate',
$this->escape($this->_tmp_folder->name), 10, false); ?>
</div>
</a>
</li>
com_media/imageslist/default_image.php000064400000002551147357347510014144
0ustar00<?php
/**
* @package Joomla.Administrator
* @subpackage com_media
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\Registry\Registry;
$params = new Registry;
$dispatcher = JEventDispatcher::getInstance();
$dispatcher->trigger('onContentBeforeDisplay',
array('com_media.file', &$this->_tmp_img, &$params,
0));
?>
<li class="imgOutline thumbnail height-80 width-80 center">
<a class="img-preview"
href="javascript:ImageManager.populateFields('<?php echo
$this->escape($this->_tmp_img->path_relative); ?>')"
title="<?php echo $this->escape($this->_tmp_img->name);
?>" >
<div class="imgThumb">
<div class="imgThumbInside">
<?php echo JHtml::_('image', $this->baseURL .
'/' . $this->escape($this->_tmp_img->path_relative),
JText::sprintf('COM_MEDIA_IMAGE_TITLE',
$this->_tmp_img->title, JHtml::_('number.bytes',
$this->_tmp_img->size)), array('width' =>
$this->_tmp_img->width_60, 'height' =>
$this->_tmp_img->height_60)); ?>
</div>
</div>
<div class="imgDetails small">
<?php echo JHtml::_('string.truncate',
$this->escape($this->_tmp_img->name), 10, false); ?>
</div>
</a>
</li>
<?php
$dispatcher->trigger('onContentAfterDisplay',
array('com_media.file', &$this->_tmp_img, &$params,
0));
layouts/joomla/form/field/contenthistory.php000064400000005270147357347510015404
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Layout variables
* -----------------
* @var string $autocomplete Autocomplete attribute for the field.
* @var boolean $autofocus Is autofocus enabled?
* @var string $class Classes for the input.
* @var string $description Description of the field.
* @var boolean $disabled Is this field disabled?
* @var string $group Group the field belongs to.
<fields> section in form XML.
* @var boolean $hidden Is this field hidden in the form?
* @var string $hint Placeholder for the field.
* @var string $id DOM id of the field.
* @var string $label Label of the field.
* @var string $labelclass Classes to apply to the label.
* @var boolean $multiple Does this field support multiple
values?
* @var string $name Name of the input field.
* @var string $onchange Onchange attribute for the field.
* @var string $onclick Onclick attribute for the field.
* @var string $pattern Pattern (Reg Ex) of value of the form
field.
* @var boolean $readonly Is this field read only?
* @var boolean $repeat Allows extensions to duplicate
elements.
* @var boolean $required Is this field required?
* @var integer $size Size attribute of the input.
* @var boolean $spellcheck Spellcheck state for the form field.
* @var string $validate Validation rules to apply.
* @var string $value Value attribute of the field.
* @var array $checkedOptions Options that will be set as checked.
* @var boolean $hasValue Has this field a value assigned?
* @var array $options Options available for this field.
*
* @var string $link The link for the content history page
* @var string $label The label text
*/
extract($displayData);
echo JHtml::_(
'bootstrap.renderModal',
'versionsModal',
array(
'url' => $link,
'title' => $label,
'height' => '300px',
'width' => '800px',
'footer' => '<button type="button"
class="btn" data-dismiss="modal">'
. JText::_('JLIB_HTML_BEHAVIOR_CLOSE') .
'</button>'
)
);
?>
<button type="button"
onclick="jQuery('#versionsModal').modal('show')"
class="btn versions" data-toggle="modal"
title="<?php echo $label; ?>">
<span class="icon-archive"
aria-hidden="true"></span><?php echo $label; ?>
</button>
layouts/joomla/form/field/media.php000064400000011200147357347510013355
0ustar00<?php
/**
* @package Joomla.Admin
* @subpackage Layout
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Layout variables
* ---------------------
*
* @var string $asset The asset text
* @var string $authorField The label text
* @var integer $authorId The author id
* @var string $class The class text
* @var boolean $disabled True if field is disabled
* @var string $folder The folder text
* @var string $id The label text
* @var string $link The link text
* @var string $name The name text
* @var string $preview The preview image relative path
* @var integer $previewHeight The image preview height
* @var integer $previewWidth The image preview width
* @var string $onchange The onchange text
* @var boolean $readonly True if field is readonly
* @var integer $size The size text
* @var string $value The value text
* @var string $src The path and filename of the image
*/
extract($displayData);
// The button.
if ($disabled != true)
{
JHtml::_('bootstrap.tooltip');
}
$attr = '';
// Initialize some field attributes.
$attr .= !empty($class) ? ' class="input-small hasTooltip
field-media-input ' . $class . '"' : '
class="input-small hasTooltip field-media-input"';
$attr .= !empty($size) ? ' size="' . $size .
'"' : '';
// Initialize JavaScript field attributes.
$attr .= !empty($onchange) ? ' onchange="' . $onchange .
'"' : '';
switch ($preview)
{
case 'no': // Deprecated parameter value
case 'false':
case 'none':
$showPreview = false;
$showAsTooltip = false;
break;
case 'yes': // Deprecated parameter value
case 'true':
case 'show':
$showPreview = true;
$showAsTooltip = false;
break;
case 'tooltip':
default:
$showPreview = true;
$showAsTooltip = true;
break;
}
// Pre fill the contents of the popover
if ($showPreview)
{
if ($value && file_exists(JPATH_ROOT . '/' . $value))
{
$src = JUri::root() . $value;
}
else
{
$src = JText::_('JLIB_FORM_MEDIA_PREVIEW_EMPTY');
}
}
// The URL for the modal
$url = ($readonly ? ''
: ($link ?:
'index.php?option=com_media&view=images&tmpl=component&asset='
. $asset . '&author=' . $authorId)
.
'&fieldid={field-media-id}&ismoo=0&folder='
. $folder);
?>
<div class="field-media-wrapper"
data-basepath="<?php echo JUri::root(); ?>"
data-url="<?php echo $url; ?>"
data-modal=".modal"
data-modal-width="100%"
data-modal-height="645px"
data-input=".field-media-input"
data-button-select=".button-select"
data-button-clear=".button-clear"
data-button-save-selected=".button-save-selected"
data-preview="<?php echo $showPreview ? 'true' :
'false'; ?>"
data-preview-as-tooltip="<?php echo $showAsTooltip ?
'true' : 'false'; ?>"
data-preview-container=".field-media-preview"
data-preview-width="<?php echo $previewWidth; ?>"
data-preview-height="<?php echo $previewHeight; ?>"
>
<?php
// Render the modal
echo JHtml::_(
'bootstrap.renderModal',
'imageModal_' . $id,
array(
'title' =>
JText::_('JLIB_FORM_CHANGE_IMAGE'),
'closeButton' => true,
)
);
JHtml::_('script', 'media/mediafield.min.js',
array('version' => 'auto', 'relative'
=> true));
?>
<?php if ($showPreview && $showAsTooltip) : ?>
<div class="input-prepend input-append">
<span rel="popover" class="add-on pop-helper
field-media-preview"
title="<?php
echo JText::_('JLIB_FORM_MEDIA_PREVIEW_SELECTED_IMAGE');
?>" data-content="<?php echo
JText::_('JLIB_FORM_MEDIA_PREVIEW_EMPTY'); ?>"
data-original-title="<?php echo
JText::_('JLIB_FORM_MEDIA_PREVIEW_SELECTED_IMAGE'); ?>"
data-trigger="hover">
<span class="icon-eye"
aria-hidden="true"></span>
</span>
<?php else: ?>
<div class="input-append">
<?php endif; ?>
<input type="text" name="<?php echo $name;
?>" id="<?php echo $id; ?>" value="<?php
echo htmlspecialchars($value, ENT_COMPAT, 'UTF-8'); ?>"
readonly="readonly"<?php echo $attr; ?>/>
<?php if ($disabled != true) : ?>
<button type="button" class="btn
button-select"><?php echo
JText::_('JLIB_FORM_BUTTON_SELECT'); ?></button>
<button
type="button"
class="btn hasTooltip button-clear"
title="<?php echo JText::_('JLIB_FORM_BUTTON_CLEAR');
?>"
aria-label="<?php echo
JText::_('JLIB_FORM_BUTTON_CLEAR'); ?>"
>
<span class="icon-remove"
aria-hidden="true"></span>
</button>
<?php endif; ?>
</div>
<?php if ($showPreview && !$showAsTooltip) : ?>
<div class="field-media-preview" style="width: <?php
echo $previewWidth; ?>px; max-height: <?php echo $previewHeight;
?>px;margin-top:10px;"></div>
<?php endif; ?>
</div>
layouts/joomla/form/field/user.php000064400000010551147357347510013264
0ustar00<?php
/**
* @package Joomla.Administrator
* @subpackage Layout
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\Utilities\ArrayHelper;
extract($displayData);
/**
* Layout variables
* -----------------
* @var string $autocomplete Autocomplete attribute for the field.
* @var boolean $autofocus Is autofocus enabled?
* @var string $class Classes for the input.
* @var string $description Description of the field.
* @var boolean $disabled Is this field disabled?
* @var string $group Group the field belongs to.
<fields> section in form XML.
* @var boolean $hidden Is this field hidden in the form?
* @var string $hint Placeholder for the field.
* @var string $id DOM id of the field.
* @var string $label Label of the field.
* @var string $labelclass Classes to apply to the label.
* @var boolean $multiple Does this field support multiple
values?
* @var string $name Name of the input field.
* @var string $onchange Onchange attribute for the field.
* @var string $onclick Onclick attribute for the field.
* @var string $pattern Pattern (Reg Ex) of value of the form
field.
* @var boolean $readonly Is this field read only?
* @var boolean $repeat Allows extensions to duplicate
elements.
* @var boolean $required Is this field required?
* @var integer $size Size attribute of the input.
* @var boolean $spellcheck Spellcheck state for the form field.
* @var string $validate Validation rules to apply.
* @var string $value Value attribute of the field.
*
* @var string $userName The user name
* @var mixed $groups The filtering groups (null means no
filtering)
* @var mixed $excluded The users to exclude from the list of
users
*/
if (!$readonly)
{
JHtml::_('script', 'jui/fielduser.min.js',
array('version' => 'auto', 'relative'
=> true));
}
$uri = new
JUri('index.php?option=com_users&view=users&layout=modal&tmpl=component&required=0&field={field-user-id}&ismoo=0');
if ($required)
{
$uri->setVar('required', 1);
}
if (!empty($groups))
{
$uri->setVar('groups', base64_encode(json_encode($groups)));
}
if (!empty($excluded))
{
$uri->setVar('excluded',
base64_encode(json_encode($excluded)));
}
// Invalidate the input value if no user selected
if ($this->escape($userName) ===
JText::_('JLIB_FORM_SELECT_USER'))
{
$userName = '';
}
$inputAttributes = array(
'type' => 'text', 'id' => $id,
'class' => 'field-user-input-name',
'value' => $this->escape($userName)
);
if ($class)
{
$inputAttributes['class'] .= ' ' . $class;
}
if ($size)
{
$inputAttributes['size'] = (int) $size;
}
if ($required)
{
$inputAttributes['required'] = 'required';
}
if (!$readonly)
{
$inputAttributes['placeholder'] =
JText::_('JLIB_FORM_SELECT_USER');
}
?>
<div class="field-user-wrapper"
data-url="<?php echo (string) $uri; ?>"
data-modal=".modal"
data-modal-width="100%"
data-modal-height="400px"
data-input=".field-user-input"
data-input-name=".field-user-input-name"
data-button-select=".button-select">
<div class="input-append">
<input <?php echo ArrayHelper::toString($inputAttributes); ?>
readonly />
<?php if (!$readonly) : ?>
<button
type="button"
class="btn btn-primary button-select"
title="<?php echo JText::_('JLIB_FORM_CHANGE_USER');
?>"
aria-label="<?php echo
JText::_('JLIB_FORM_CHANGE_USER'); ?>"
>
<span class="icon-user"
aria-hidden="true"></span>
</button>
<?php echo JHtml::_(
'bootstrap.renderModal',
'userModal_' . $id,
array(
'title' =>
JText::_('JLIB_FORM_CHANGE_USER'),
'closeButton' => true,
'footer' => '<button type="button"
class="btn" data-dismiss="modal">' .
JText::_('JCANCEL') . '</button>',
)
); ?>
<?php endif; ?>
</div>
<?php if (!$readonly) : ?>
<input type="hidden" id="<?php echo $id;
?>_id" name="<?php echo $name; ?>"
value="<?php echo (int) $value; ?>"
class="field-user-input<?php echo $class ? ' ' . $class :
''; ?>" data-onchange="<?php echo
$this->escape($onchange); ?>" />
<?php endif; ?>
</div>
layouts/joomla/system/message.php000064400000002024147357347510013224
0ustar00<?php
/**
* @package Joomla.Administrator
* @subpackage Template.Isis
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
$msgList = $displayData['msgList'];
$alert = array('error' => 'alert-error',
'warning' => '', 'notice' =>
'alert-info', 'message' =>
'alert-success');
?>
<div id="system-message-container">
<?php if (is_array($msgList) && $msgList) : ?>
<?php foreach ($msgList as $type => $msgs) : ?>
<div class="alert <?php echo isset($alert[$type]) ?
$alert[$type] : 'alert-' . $type; ?>">
<button type="button" class="close"
data-dismiss="alert">×</button>
<?php if (!empty($msgs)) : ?>
<h4 class="alert-heading"><?php echo
JText::_($type); ?></h4>
<?php foreach ($msgs as $msg) : ?>
<div class="alert-message"><?php echo $msg;
?></div>
<?php endforeach; ?>
<?php endif; ?>
</div>
<?php endforeach; ?>
<?php endif; ?>
</div>
modules.php000064400000004045147357347510006750 0ustar00<?php
/**
* @package Joomla.Administrator
* @subpackage Templates.isis
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* This is a file to add template specific chrome to module rendering. To
use it you would
* set the style attribute for the given module(s) include in your template
to use the style
* for each given modChrome function.
*
* eg. To render a module mod_test in the submenu style, you would use the
following include:
* <jdoc:include type="module" name="test"
style="submenu" />
*
* This gives template designers ultimate control over how modules are
rendered.
*
* NOTICE: All chrome wrapping methods should be named: modChrome_{STYLE}
and take the same
* two arguments.
*/
/*
* Module chrome for rendering the module in a submenu
*/
function modChrome_title($module, &$params, &$attribs)
{
if ($module->content)
{
echo '<div class="module-title"><h6>' .
$module->title . '</h6></div>';
echo $module->content;
}
}
function modChrome_no($module, &$params, &$attribs)
{
if ($module->content)
{
echo $module->content;
}
}
function modChrome_well($module, &$params, &$attribs)
{
if ($module->content)
{
$moduleTag = $params->get('module_tag',
'div');
$bootstrapSize = (int) $params->get('bootstrap_size');
$moduleClass = $bootstrapSize ? ' span' . $bootstrapSize :
'';
$headerTag = htmlspecialchars($params->get('header_tag',
'h2'), ENT_COMPAT, 'UTF-8');
// Temporarily store header class in variable
$headerClass = $params->get('header_class');
$headerClass = $headerClass ? ' ' .
htmlspecialchars($headerClass, ENT_COMPAT, 'UTF-8') :
'';
echo '<' . $moduleTag . ' class="well
well-small' . $moduleClass . '">';
if ($module->showtitle)
{
echo '<' . $headerTag . ' class="module-title
nav-header' . $headerClass . '">' .
$module->title . '</' . $headerTag . '>';
}
echo $module->content;
echo '</' . $moduleTag . '>';
}
}
pagination.php000064400000011754147357347510007436 0ustar00<?php
/**
* @package Joomla.Administrator
* @subpackage Template.Isis
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* This is a file to add template specific chrome to pagination rendering.
*
* pagination_list_footer
* Input variable $list is an array with offsets:
* $list[limit] : int
* $list[limitstart] : int
* $list[total] : int
* $list[limitfield] : string
* $list[pagescounter] : string
* $list[pageslinks] : string
*
* pagination_list_render
* Input variable $list is an array with offsets:
* $list[all]
* [data] : string
* [active] : boolean
* $list[start]
* [data] : string
* [active] : boolean
* $list[previous]
* [data] : string
* [active] : boolean
* $list[next]
* [data] : string
* [active] : boolean
* $list[end]
* [data] : string
* [active] : boolean
* $list[pages]
* [{PAGE}][data] : string
* [{PAGE}][active] : boolean
*
* pagination_item_active
* Input variable $item is an object with fields:
* $item->base : integer
* $item->link : string
* $item->text : string
*
* pagination_item_inactive
* Input variable $item is an object with fields:
* $item->base : integer
* $item->link : string
* $item->text : string
*
* This gives template designers ultimate control over how pagination is
rendered.
*
* NOTE: If you override pagination_item_active OR pagination_item_inactive
you MUST override them both
*/
/**
* Renders the pagination list
*
* @param array $list Array containing pagination information
*
* @return string HTML markup for the full pagination object
*
* @since 3.0
*/
function pagination_list_render($list)
{
// Calculate to display range of pages
$currentPage = 1;
$range = 1;
$step = 5;
foreach ($list['pages'] as $k => $page)
{
if (!$page['active'])
{
$currentPage = $k;
}
}
if ($currentPage >= $step)
{
if ($currentPage % $step == 0)
{
$range = ceil($currentPage / $step) + 1;
}
else
{
$range = ceil($currentPage / $step);
}
}
$html = '<ul class="pagination-list">';
$html .= $list['start']['data'];
$html .= $list['previous']['data'];
foreach ($list['pages'] as $k => $page)
{
$html .= $page['data'];
}
$html .= $list['next']['data'];
$html .= $list['end']['data'];
$html .= '</ul>';
return $html;
}
/**
* Renders an active item in the pagination block
*
* @param JPaginationObject $item The current pagination object
*
* @return string HTML markup for active item
*
* @since 3.0
*/
function pagination_item_active(&$item)
{
$class = '';
// Check for "Start" item
if ($item->text == JText::_('JLIB_HTML_START'))
{
$display = '<span
class="icon-first"></span>';
}
// Check for "Prev" item
if ($item->text == JText::_('JPREV'))
{
$item->text = JText::_('JPREVIOUS');
$display = '<span
class="icon-previous"></span>';
}
// Check for "Next" item
if ($item->text == JText::_('JNEXT'))
{
$display = '<span
class="icon-next"></span>';
}
// Check for "End" item
if ($item->text == JText::_('JLIB_HTML_END'))
{
$display = '<span
class="icon-last"></span>';
}
// If the display object isn't set already, just render the item with
its text
if (!isset($display))
{
$display = $item->text;
$class = ' class="hidden-phone"';
}
if ($item->base > 0)
{
$limit = 'limitstart.value=' . $item->base;
}
else
{
$limit = 'limitstart.value=0';
}
$title = '';
if (!is_numeric($item->text))
{
JHtml::_('bootstrap.tooltip');
$title = ' class="hasTooltip" title="' .
$item->text . '"';
}
return '<li' . $class . '><a' . $title .
' href="#" onclick="document.adminForm.' .
$item->prefix . $limit . '; Joomla.submitform();return
false;">' . $display . '</a></li>';
}
/**
* Renders an inactive item in the pagination block
*
* @param JPaginationObject $item The current pagination object
*
* @return string HTML markup for inactive item
*
* @since 3.0
*/
function pagination_item_inactive(&$item)
{
// Check for "Start" item
if ($item->text == JText::_('JLIB_HTML_START'))
{
return '<li class="disabled"><a><span
class="icon-first"></span></a></li>';
}
// Check for "Prev" item
if ($item->text == JText::_('JPREV'))
{
return '<li class="disabled"><a><span
class="icon-previous"></span></a></li>';
}
// Check for "Next" item
if ($item->text == JText::_('JNEXT'))
{
return '<li class="disabled"><a><span
class="icon-next"></span></a></li>';
}
// Check for "End" item
if ($item->text == JText::_('JLIB_HTML_END'))
{
return '<li class="disabled"><a><span
class="icon-last"></span></a></li>';
}
// Check if the item is the active page
if (isset($item->active) && $item->active)
{
return '<li class="active
hidden-phone"><a>' . $item->text .
'</a></li>';
}
// Doesn't match any other condition, render a normal item
return '<li class="disabled
hidden-phone"><a>' . $item->text .
'</a></li>';
}
access.php000064400000017745151156051770006544 0ustar00<?php
/**
* @package Joomla.Libraries
* @subpackage HTML
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('JPATH_PLATFORM') or die;
/**
* Extended Utility class for all HTML drawing classes.
*
* @since 1.6
*/
abstract class JHtmlAccess
{
/**
* A cached array of the asset groups
*
* @var array
* @since 1.6
*/
protected static $asset_groups = null;
/**
* Displays a list of the available access view levels
*
* @param string $name The form field name.
* @param string $selected The name of the selected section.
* @param string $attribs Additional attributes to add to the select
field.
* @param mixed $params True to add "All Sections" option
or an array of options
* @param mixed $id The form field id or false if not used
*
* @return string The required HTML for the SELECT tag.
*
* @see JFormFieldAccessLevel
* @since 1.6
*/
public static function level($name, $selected, $attribs = '',
$params = true, $id = false)
{
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select($db->quoteName('a.id', 'value') .
', ' . $db->quoteName('a.title', 'text'))
->from($db->quoteName('#__viewlevels', 'a'))
->group($db->quoteName(array('a.id',
'a.title', 'a.ordering')))
->order($db->quoteName('a.ordering') . ' ASC')
->order($db->quoteName('title') . ' ASC');
// Get the options.
$db->setQuery($query);
$options = $db->loadObjectList();
// If params is an array, push these options to the array
if (is_array($params))
{
$options = array_merge($params, $options);
}
// If all levels is allowed, push it into the array.
elseif ($params)
{
array_unshift($options, JHtml::_('select.option',
'', JText::_('JOPTION_ACCESS_SHOW_ALL_LEVELS')));
}
return JHtml::_(
'select.genericlist',
$options,
$name,
array(
'list.attr' => $attribs,
'list.select' => $selected,
'id' => $id,
)
);
}
/**
* Displays a list of the available user groups.
*
* @param string $name The form field name.
* @param string $selected The name of the selected section.
* @param string $attribs Additional attributes to add to the select
field.
* @param boolean $allowAll True to add "All Groups" option.
* @param mixed $id The form field id
*
* @return string The required HTML for the SELECT tag.
*
* @see JFormFieldUsergroup
* @since 1.6
*/
public static function usergroup($name, $selected, $attribs =
'', $allowAll = true, $id = false)
{
$options = array_values(JHelperUsergroups::getInstance()->getAll());
for ($i = 0, $n = count($options); $i < $n; $i++)
{
$options[$i]->value = $options[$i]->id;
$options[$i]->text = str_repeat('- ',
$options[$i]->level) . $options[$i]->title;
}
// If all usergroups is allowed, push it into the array.
if ($allowAll)
{
array_unshift($options, JHtml::_('select.option',
'', JText::_('JOPTION_ACCESS_SHOW_ALL_GROUPS')));
}
return JHtml::_('select.genericlist', $options, $name,
array('list.attr' => $attribs, 'list.select' =>
$selected, 'id' => $id));
}
/**
* Returns a UL list of user groups with checkboxes
*
* @param string $name The name of the checkbox controls
array
* @param array $selected An array of the checked boxes
* @param boolean $checkSuperAdmin If false only super admins can add
to super admin groups
*
* @return string
*
* @since 1.6
*/
public static function usergroups($name, $selected, $checkSuperAdmin =
false)
{
static $count;
$count++;
$isSuperAdmin =
JFactory::getUser()->authorise('core.admin');
$groups = array_values(JHelperUsergroups::getInstance()->getAll());
$html = array();
for ($i = 0, $n = count($groups); $i < $n; $i++)
{
$item = &$groups[$i];
// If checkSuperAdmin is true, only add item if the user is superadmin
or the group is not super admin
if ((!$checkSuperAdmin) || $isSuperAdmin ||
(!JAccess::checkGroup($item->id, 'core.admin')))
{
// Setup the variable attributes.
$eid = $count . 'group_' . $item->id;
// Don't call in_array unless something is selected
$checked = '';
if ($selected)
{
$checked = in_array($item->id, $selected) ? '
checked="checked"' : '';
}
$rel = ($item->parent_id > 0) ? ' rel="' . $count
. 'group_' . $item->parent_id . '"' :
'';
// Build the HTML for the item.
$html[] = ' <div class="control-group">';
$html[] = ' <div class="controls">';
$html[] = ' <label class="checkbox"
for="' . $eid . '">';
$html[] = ' <input type="checkbox"
name="' . $name . '[]" value="' .
$item->id . '" id="' . $eid . '"';
$html[] = ' ' . $checked . $rel . ' />';
$html[] = ' ' .
JLayoutHelper::render('joomla.html.treeprefix',
array('level' => $item->level + 1)) . $item->title;
$html[] = ' </label>';
$html[] = ' </div>';
$html[] = ' </div>';
}
}
return implode("\n", $html);
}
/**
* Returns a UL list of actions with checkboxes
*
* @param string $name The name of the checkbox controls array
* @param array $selected An array of the checked boxes
* @param string $component The component the permissions apply to
* @param string $section The section (within a component) the
permissions apply to
*
* @return string
*
* @see JAccess
* @since 1.6
*/
public static function actions($name, $selected, $component, $section =
'global')
{
static $count;
$count++;
$actions = JAccess::getActionsFromFile(
JPATH_ADMINISTRATOR . '/components/' . $component .
'/access.xml',
"/access/section[@name='" . $section .
"']/"
);
$html = array();
$html[] = '<ul class="checklist
access-actions">';
for ($i = 0, $n = count($actions); $i < $n; $i++)
{
$item = &$actions[$i];
// Setup the variable attributes.
$eid = $count . 'action_' . $item->id;
$checked = in_array($item->id, $selected) ? '
checked="checked"' : '';
// Build the HTML for the item.
$html[] = ' <li>';
$html[] = ' <input type="checkbox" name="'
. $name . '[]" value="' . $item->id . '"
id="' . $eid . '"';
$html[] = ' ' . $checked . ' />';
$html[] = ' <label for="' . $eid .
'">';
$html[] = ' ' . JText::_($item->title);
$html[] = ' </label>';
$html[] = ' </li>';
}
$html[] = '</ul>';
return implode("\n", $html);
}
/**
* Gets a list of the asset groups as an array of JHtml compatible
options.
*
* @return mixed An array or false if an error occurs
*
* @since 1.6
*/
public static function assetgroups()
{
if (empty(static::$asset_groups))
{
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select('a.id AS value, a.title AS text')
->from($db->quoteName('#__viewlevels') . ' AS
a')
->group('a.id, a.title, a.ordering')
->order('a.ordering ASC');
$db->setQuery($query);
static::$asset_groups = $db->loadObjectList();
}
return static::$asset_groups;
}
/**
* Displays a Select list of the available asset groups
*
* @param string $name The name of the select element
* @param mixed $selected The selected asset group id
* @param string $attribs Optional attributes for the select field
* @param array $config An array of options for the control
*
* @return mixed An HTML string or null if an error occurs
*
* @since 1.6
*/
public static function assetgrouplist($name, $selected, $attribs = null,
$config = array())
{
static $count;
$options = static::assetgroups();
if (isset($config['title']))
{
array_unshift($options, JHtml::_('select.option',
'', $config['title']));
}
return JHtml::_(
'select.genericlist',
$options,
$name,
array(
'id' => isset($config['id']) ?
$config['id'] : 'assetgroups_' . (++$count),
'list.attr' => $attribs === null ?
'class="inputbox" size="3"' : $attribs,
'list.select' => (int) $selected,
)
);
}
}
actionsdropdown.php000064400000013157151156051770010511 0ustar00<?php
/**
* @package Joomla.Libraries
* @subpackage HTML
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('JPATH_PLATFORM') or die;
/**
* HTML utility class for building a dropdown menu
*
* @since 3.2
*/
abstract class JHtmlActionsDropdown
{
/**
* @var string HTML markup for the dropdown list
* @since 3.2
*/
protected static $dropDownList = array();
/**
* Method to render current dropdown menu
*
* @param string $item An item to render.
*
* @return string HTML markup for the dropdown list
*
* @since 3.2
*/
public static function render($item = '')
{
$html = array();
$html[] = '<button data-toggle="dropdown"
class="dropdown-toggle btn btn-micro">';
$html[] = '<span class="caret"></span>';
if ($item)
{
$html[] = '<span class="element-invisible">' .
JText::sprintf('JACTIONS', $item) . '</span>';
}
$html[] = '</button>';
$html[] = '<ul class="dropdown-menu">';
$html[] = implode('', static::$dropDownList);
$html[] = '</ul>';
static::$dropDownList = null;
return implode('', $html);
}
/**
* Append a publish item to the current dropdown menu
*
* @param string $id ID of corresponding checkbox of the record
* @param string $prefix The task prefix
*
* @return void
*
* @since 3.2
*/
public static function publish($id, $prefix = '')
{
$task = ($prefix ? $prefix . '.' : '') .
'publish';
static::addCustomItem(JText::_('JTOOLBAR_PUBLISH'),
'publish', $id, $task);
}
/**
* Append an unpublish item to the current dropdown menu
*
* @param string $id ID of corresponding checkbox of the record
* @param string $prefix The task prefix
*
* @return void
*
* @since 3.2
*/
public static function unpublish($id, $prefix = '')
{
$task = ($prefix ? $prefix . '.' : '') .
'unpublish';
static::addCustomItem(JText::_('JTOOLBAR_UNPUBLISH'),
'unpublish', $id, $task);
}
/**
* Append a feature item to the current dropdown menu
*
* @param string $id ID of corresponding checkbox of the record
* @param string $prefix The task prefix
*
* @return void
*
* @since 3.2
*/
public static function feature($id, $prefix = '')
{
$task = ($prefix ? $prefix . '.' : '') .
'featured';
static::addCustomItem(JText::_('JFEATURE'),
'featured', $id, $task);
}
/**
* Append an unfeature item to the current dropdown menu
*
* @param string $id ID of corresponding checkbox of the record
* @param string $prefix The task prefix
*
* @return void
*
* @since 3.2
*/
public static function unfeature($id, $prefix = '')
{
$task = ($prefix ? $prefix . '.' : '') .
'unfeatured';
static::addCustomItem(JText::_('JUNFEATURE'),
'unfeatured', $id, $task);
}
/**
* Append an archive item to the current dropdown menu
*
* @param string $id ID of corresponding checkbox of the record
* @param string $prefix The task prefix
*
* @return void
*
* @since 3.2
*/
public static function archive($id, $prefix = '')
{
$task = ($prefix ? $prefix . '.' : '') .
'archive';
static::addCustomItem(JText::_('JTOOLBAR_ARCHIVE'),
'archive', $id, $task);
}
/**
* Append an unarchive item to the current dropdown menu
*
* @param string $id ID of corresponding checkbox of the record
* @param string $prefix The task prefix
*
* @return void
*
* @since 3.2
*/
public static function unarchive($id, $prefix = '')
{
$task = ($prefix ? $prefix . '.' : '') .
'unpublish';
static::addCustomItem(JText::_('JTOOLBAR_UNARCHIVE'),
'unarchive', $id, $task);
}
/**
* Append a duplicate item to the current dropdown menu
*
* @param string $id ID of corresponding checkbox of the record
* @param string $prefix The task prefix
*
* @return void
*
* @since 3.2
*/
public static function duplicate($id, $prefix = '')
{
$task = ($prefix ? $prefix . '.' : '') .
'duplicate';
static::addCustomItem(JText::_('JTOOLBAR_DUPLICATE'),
'copy', $id, $task);
}
/**
* Append a trash item to the current dropdown menu
*
* @param string $id ID of corresponding checkbox of the record
* @param string $prefix The task prefix
*
* @return void
*
* @since 3.2
*/
public static function trash($id, $prefix = '')
{
$task = ($prefix ? $prefix . '.' : '') .
'trash';
static::addCustomItem(JText::_('JTOOLBAR_TRASH'),
'trash', $id, $task);
}
/**
* Append an untrash item to the current dropdown menu
*
* @param string $id ID of corresponding checkbox of the record
* @param string $prefix The task prefix
*
* @return void
*
* @since 3.2
*/
public static function untrash($id, $prefix = '')
{
self::publish($id, $prefix);
}
/**
* Writes a divider between dropdown items
*
* @return void
*
* @since 3.0
*/
public static function divider()
{
static::$dropDownList[] = '<li
class="divider"></li>';
}
/**
* Append a custom item to current dropdown menu.
*
* @param string $label The label of the item.
* @param string $icon The icon classname.
* @param string $id The item id.
* @param string $task The task.
*
* @return void
*
* @since 3.2
*/
public static function addCustomItem($label, $icon = '', $id =
'', $task = '')
{
static::$dropDownList[] = '<li>'
. '<a href = "javascript://"
onclick="listItemTask(\'' . $id . '\',
\'' . $task . '\')">'
. ($icon ? '<span class="icon-' . $icon . '"
aria-hidden="true"></span> ' : '')
. $label
. '</a>'
. '</li>';
}
}
adminlanguage.php000064400000002610151156051770010060 0ustar00<?php
/**
* @package Joomla.Libraries
* @subpackage HTML
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('JPATH_PLATFORM') or die;
/**
* Utility class working with administrator language select lists
*
* @since 3.8.0
*/
abstract class JHtmlAdminLanguage
{
/**
* Cached array of the administrator language items.
*
* @var array
* @since 3.8.0
*/
protected static $items = null;
/**
* Get a list of the available administrator language items.
*
* @param boolean $all True to include All (*)
* @param boolean $translate True to translate All
*
* @return string
*
* @since 3.8.0
*/
public static function existing($all = false, $translate = false)
{
if (empty(static::$items))
{
$languages = array();
$admin_languages =
JLanguageHelper::getKnownLanguages(JPATH_ADMINISTRATOR);
foreach ($admin_languages as $tag => $language)
{
$languages[$tag] = $language['nativeName'];
}
ksort($languages);
static::$items = $languages;
}
if ($all)
{
$all_option = array(new JObject(array('value' =>
'*', 'text' => $translate ?
JText::alt('JALL', 'language') :
'JALL_LANGUAGE')));
return array_merge($all_option, static::$items);
}
else
{
return static::$items;
}
}
}
batch.php000064400000006220151156051770006346 0ustar00<?php
/**
* @package Joomla.Libraries
* @subpackage HTML
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('JPATH_PLATFORM') or die;
/**
* Extended Utility class for batch processing widgets.
*
* @since 1.7
*
* @deprecated 4.0 Use JLayout directly
*/
abstract class JHtmlBatch
{
/**
* Display a batch widget for the access level selector.
*
* @return string The necessary HTML for the widget.
*
* @since 1.7
*
* @deprecated 4.0 instead of JHtml::_('batch.access'); use
JLayoutHelper::render('joomla.html.batch.access', array());
*/
public static function access()
{
JLog::add('The use of JHtml::_("batch.access") is
deprecated use JLayout instead.', JLog::WARNING,
'deprecated');
return JLayoutHelper::render('joomla.html.batch.access',
array());
}
/**
* Displays a batch widget for moving or copying items.
*
* @param string $extension The extension that owns the category.
*
* @return string The necessary HTML for the widget.
*
* @since 1.7
*
* @deprecated 4.0 instead of JHtml::_('batch.item'); use
JLayoutHelper::render('joomla.html.batch.item',
array('extension' => 'com_XXX'));
*/
public static function item($extension)
{
$displayData = array('extension' => $extension);
JLog::add('The use of JHtml::_("batch.item") is deprecated
use JLayout instead.', JLog::WARNING, 'deprecated');
return JLayoutHelper::render('joomla.html.batch.item',
$displayData);
}
/**
* Display a batch widget for the language selector.
*
* @return string The necessary HTML for the widget.
*
* @since 2.5
*
* @deprecated 4.0 instead of JHtml::_('batch.language'); use
JLayoutHelper::render('joomla.html.batch.language', array());
*/
public static function language()
{
JLog::add('The use of JHtml::_("batch.language") is
deprecated use JLayout instead.', JLog::WARNING,
'deprecated');
return JLayoutHelper::render('joomla.html.batch.language',
array());
}
/**
* Display a batch widget for the user selector.
*
* @param boolean $noUser Choose to display a "no user"
option
*
* @return string The necessary HTML for the widget.
*
* @since 2.5
*
* @deprecated 4.0 instead of JHtml::_('batch.user'); use
JLayoutHelper::render('joomla.html.batch.user', array());
*/
public static function user($noUser = true)
{
$displayData = array('noUser' => $noUser);
JLog::add('The use of JHtml::_("batch.user") is deprecated
use JLayout instead.', JLog::WARNING, 'deprecated');
return JLayoutHelper::render('joomla.html.batch.user',
$displayData);
}
/**
* Display a batch widget for the tag selector.
*
* @return string The necessary HTML for the widget.
*
* @since 3.1
*
* @deprecated 4.0 instead of JHtml::_('batch.tag'); use
JLayoutHelper::render('joomla.html.batch.tag', array());
*/
public static function tag()
{
JLog::add('The use of JHtml::_("batch.tag") is deprecated
use JLayout instead.', JLog::WARNING, 'deprecated');
return JLayoutHelper::render('joomla.html.batch.tag', array());
}
}
behavior.php000064400000075601151156051770007075 0ustar00<?php
/**
* @package Joomla.Libraries
* @subpackage HTML
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('JPATH_PLATFORM') or die;
/**
* Utility class for JavaScript behaviors
*
* @since 1.5
*/
abstract class JHtmlBehavior
{
/**
* Array containing information for loaded files
*
* @var array
* @since 2.5
*/
protected static $loaded = array();
/**
* Method to load the MooTools framework into the document head
*
* If debugging mode is on an uncompressed version of MooTools is included
for easier debugging.
*
* @param boolean $extras Flag to determine whether to load MooTools
More in addition to Core
* @param mixed $debug Is debugging mode on? [optional]
*
* @return void
*
* @since 1.6
* @deprecated 4.0 Update scripts to jquery
*/
public static function framework($extras = false, $debug = null)
{
$type = $extras ? 'more' : 'core';
// Only load once
if (!empty(static::$loaded[__METHOD__][$type]))
{
return;
}
JLog::add('JHtmlBehavior::framework is deprecated. Update to jquery
scripts.', JLog::WARNING, 'deprecated');
// If no debugging value is set, use the configuration setting
if ($debug === null)
{
$debug = JDEBUG;
}
if ($type !== 'core' &&
empty(static::$loaded[__METHOD__]['core']))
{
static::framework(false, $debug);
}
JHtml::_('script', 'system/mootools-' . $type .
'.js', array('version' => 'auto',
'relative' => true, 'detectDebug' => $debug));
// Keep loading core.js for BC reasons
static::core();
static::$loaded[__METHOD__][$type] = true;
return;
}
/**
* Method to load core.js into the document head.
*
* Core.js defines the 'Joomla' namespace and contains functions
which are used across extensions
*
* @return void
*
* @since 3.3
*/
public static function core()
{
// Only load once
if (isset(static::$loaded[__METHOD__]))
{
return;
}
JHtml::_('form.csrf');
JHtml::_('script', 'system/core.js',
array('version' => 'auto', 'relative'
=> true));
// Add core and base uri paths so javascript scripts can use them.
JFactory::getDocument()->addScriptOptions('system.paths',
array('root' => JUri::root(true), 'base' =>
JUri::base(true)));
static::$loaded[__METHOD__] = true;
}
/**
* Add unobtrusive JavaScript support for image captions.
*
* @param string $selector The selector for which a caption behaviour
is to be applied.
*
* @return void
*
* @since 1.5
*
* @Deprecated 4.0 Use native HTML figure tags.
*/
public static function caption($selector = 'img.caption')
{
JLog::add('JHtmlBehavior::caption is deprecated. Use native HTML
figure tags.', JLog::WARNING, 'deprecated');
// Only load once
if (isset(static::$loaded[__METHOD__][$selector]))
{
return;
}
// Include jQuery
JHtml::_('jquery.framework');
JHtml::_('script', 'system/caption.js',
array('version' => 'auto', 'relative'
=> true));
// Attach caption to document
JFactory::getDocument()->addScriptDeclaration(
"jQuery(window).on('load', function() {
new JCaption('" . $selector . "');
});"
);
// Set static array
static::$loaded[__METHOD__][$selector] = true;
}
/**
* Add unobtrusive JavaScript support for form validation.
*
* To enable form validation the form tag must have
class="form-validate".
* Each field that needs to be validated needs to have
class="validate".
* Additional handlers can be added to the handler for username, password,
* numeric and email. To use these add class="validate-email"
and so on.
*
* @return void
*
* @since 1.5
*
* @Deprecated 3.4 Use formvalidator instead
*/
public static function formvalidation()
{
JLog::add('The use of formvalidation is deprecated use formvalidator
instead.', JLog::WARNING, 'deprecated');
// Only load once
if (isset(static::$loaded[__METHOD__]))
{
return;
}
// Include MooTools framework
static::framework();
// Load the new jQuery code
static::formvalidator();
}
/**
* Add unobtrusive JavaScript support for form validation.
*
* To enable form validation the form tag must have
class="form-validate".
* Each field that needs to be validated needs to have
class="validate".
* Additional handlers can be added to the handler for username, password,
* numeric and email. To use these add class="validate-email"
and so on.
*
* @return void
*
* @since 3.4
*/
public static function formvalidator()
{
// Only load once
if (isset(static::$loaded[__METHOD__]))
{
return;
}
// Include core
static::core();
// Include jQuery
JHtml::_('jquery.framework');
// Add validate.js language strings
JText::script('JLIB_FORM_FIELD_INVALID');
JHtml::_('script', 'system/punycode.js',
array('version' => 'auto', 'relative'
=> true));
JHtml::_('script', 'system/validate.js',
array('version' => 'auto', 'relative'
=> true));
static::$loaded[__METHOD__] = true;
}
/**
* Add unobtrusive JavaScript support for submenu switcher support
*
* @return void
*
* @since 1.5
*/
public static function switcher()
{
// Only load once
if (isset(static::$loaded[__METHOD__]))
{
return;
}
// Include jQuery
JHtml::_('jquery.framework');
JHtml::_('script', 'system/switcher.js',
array('framework' => true, 'version' =>
'auto', 'relative' => true));
$script = "
document.switcher = null;
jQuery(function($){
var toggler = document.getElementById('submenu');
var element = document.getElementById('config-document');
if (element) {
document.switcher = new JSwitcher(toggler, element);
}
});";
JFactory::getDocument()->addScriptDeclaration($script);
static::$loaded[__METHOD__] = true;
}
/**
* Add unobtrusive JavaScript support for a combobox effect.
*
* Note that this control is only reliable in absolutely positioned
elements.
* Avoid using a combobox in a slider or dynamic pane.
*
* @return void
*
* @since 1.5
*/
public static function combobox()
{
if (isset(static::$loaded[__METHOD__]))
{
return;
}
// Include core
static::core();
JHtml::_('script', 'system/combobox.js',
array('version' => 'auto', 'relative'
=> true));
static::$loaded[__METHOD__] = true;
}
/**
* Add unobtrusive JavaScript support for a hover tooltips.
*
* Add a title attribute to any element in the form
* title="title::text"
*
* Uses the core Tips class in MooTools.
*
* @param string $selector The class selector for the tooltip.
* @param array $params An array of options for the tooltip.
* Options for the tooltip can be:
* - maxTitleChars integer The maximum
number of characters in the tooltip title (defaults to 50).
* - offsets object The distance of
your tooltip from the mouse (defaults to {'x': 16, 'y':
16}).
* - showDelay integer The millisecond
delay the show event is fired (defaults to 100).
* - hideDelay integer The millisecond
delay the hide hide is fired (defaults to 100).
* - className string The className
your tooltip container will get.
* - fixed boolean If set to true,
the toolTip will not follow the mouse.
* - onShow function The default
function for the show event, passes the tip element
* and the currently hovered element.
* - onHide function The default
function for the hide event, passes the currently
* hovered element.
*
* @return void
*
* @since 1.5
*/
public static function tooltip($selector = '.hasTip', $params =
array())
{
$sig = md5(serialize(array($selector, $params)));
if (isset(static::$loaded[__METHOD__][$sig]))
{
return;
}
// Include MooTools framework
static::framework(true);
// Setup options object
$opt['maxTitleChars'] =
isset($params['maxTitleChars']) &&
$params['maxTitleChars'] ? (int)
$params['maxTitleChars'] : 50;
// Offsets needs an array in the format: array('x'=>20,
'y'=>30)
$opt['offset'] = isset($params['offset'])
&& is_array($params['offset']) ?
$params['offset'] : null;
$opt['showDelay'] = isset($params['showDelay']) ?
(int) $params['showDelay'] : null;
$opt['hideDelay'] = isset($params['hideDelay']) ?
(int) $params['hideDelay'] : null;
$opt['className'] = isset($params['className']) ?
$params['className'] : null;
$opt['fixed'] = isset($params['fixed'])
&& $params['fixed'];
$opt['onShow'] = isset($params['onShow']) ?
'\\' . $params['onShow'] : null;
$opt['onHide'] = isset($params['onHide']) ?
'\\' . $params['onHide'] : null;
$options = JHtml::getJSObject($opt);
// Include jQuery
JHtml::_('jquery.framework');
// Attach tooltips to document
JFactory::getDocument()->addScriptDeclaration(
"jQuery(function($) {
$('$selector').each(function() {
var title = $(this).attr('title');
if (title) {
var parts = title.split('::', 2);
var mtelement = document.id(this);
mtelement.store('tip:title', parts[0]);
mtelement.store('tip:text', parts[1]);
}
});
var JTooltips = new Tips($('$selector').get(), $options);
});"
);
// Set static array
static::$loaded[__METHOD__][$sig] = true;
return;
}
/**
* Add unobtrusive JavaScript support for modal links.
*
* @param string $selector The selector for which a modal behaviour is
to be applied.
* @param array $params An array of parameters for the modal
behaviour.
* Options for the modal behaviour can be:
* - ajaxOptions
* - size
* - shadow
* - overlay
* - onOpen
* - onClose
* - onUpdate
* - onResize
* - onShow
* - onHide
*
* @return void
*
* @since 1.5
* @deprecated 4.0 Use the modal equivalent from bootstrap
*/
public static function modal($selector = 'a.modal', $params =
array())
{
$document = JFactory::getDocument();
// Load the necessary files if they haven't yet been loaded
if (!isset(static::$loaded[__METHOD__]))
{
// Include MooTools framework
static::framework(true);
// Load the JavaScript and css
JHtml::_('script', 'system/modal.js',
array('framework' => true, 'version' =>
'auto', 'relative' => true));
JHtml::_('stylesheet', 'system/modal.css',
array('version' => 'auto', 'relative'
=> true));
}
$sig = md5(serialize(array($selector, $params)));
if (isset(static::$loaded[__METHOD__][$sig]))
{
return;
}
JLog::add('JHtmlBehavior::modal is deprecated. Use the modal
equivalent from bootstrap.', JLog::WARNING, 'deprecated');
// Setup options object
$opt['ajaxOptions'] = isset($params['ajaxOptions'])
&& is_array($params['ajaxOptions']) ?
$params['ajaxOptions'] : null;
$opt['handler'] = isset($params['handler']) ?
$params['handler'] : null;
$opt['parseSecure'] = isset($params['parseSecure'])
? (bool) $params['parseSecure'] : null;
$opt['closable'] = isset($params['closable']) ?
(bool) $params['closable'] : null;
$opt['closeBtn'] = isset($params['closeBtn']) ?
(bool) $params['closeBtn'] : null;
$opt['iframePreload'] =
isset($params['iframePreload']) ? (bool)
$params['iframePreload'] : null;
$opt['iframeOptions'] =
isset($params['iframeOptions']) &&
is_array($params['iframeOptions']) ?
$params['iframeOptions'] : null;
$opt['size'] = isset($params['size'])
&& is_array($params['size']) ? $params['size']
: null;
$opt['shadow'] = isset($params['shadow']) ?
$params['shadow'] : null;
$opt['overlay'] = isset($params['overlay']) ?
$params['overlay'] : null;
$opt['onOpen'] = isset($params['onOpen']) ?
$params['onOpen'] : null;
$opt['onClose'] = isset($params['onClose']) ?
$params['onClose'] : null;
$opt['onUpdate'] = isset($params['onUpdate']) ?
$params['onUpdate'] : null;
$opt['onResize'] = isset($params['onResize']) ?
$params['onResize'] : null;
$opt['onMove'] = isset($params['onMove']) ?
$params['onMove'] : null;
$opt['onShow'] = isset($params['onShow']) ?
$params['onShow'] : null;
$opt['onHide'] = isset($params['onHide']) ?
$params['onHide'] : null;
// Include jQuery
JHtml::_('jquery.framework');
if (isset($params['fullScreen']) && (bool)
$params['fullScreen'])
{
$opt['size'] = array('x' =>
'\\jQuery(window).width() - 80', 'y' =>
'\\jQuery(window).height() - 80');
}
$options = JHtml::getJSObject($opt);
// Attach modal behavior to document
$document
->addScriptDeclaration(
"
jQuery(function($) {
SqueezeBox.initialize(" . $options . ");
initSqueezeBox();
$(document).on('subform-row-add', initSqueezeBox);
function initSqueezeBox(event, container)
{
SqueezeBox.assign($(container || document).find('" .
$selector . "').get(), {
parse: 'rel'
});
}
});
window.jModalClose = function () {
SqueezeBox.close();
};
// Add extra modal close functionality for tinyMCE-based editors
document.onreadystatechange = function () {
if (document.readyState == 'interactive' && typeof
tinyMCE != 'undefined' && tinyMCE)
{
if (typeof window.jModalClose_no_tinyMCE === 'undefined')
{
window.jModalClose_no_tinyMCE = typeof(jModalClose) ==
'function' ? jModalClose : false;
jModalClose = function () {
if (window.jModalClose_no_tinyMCE)
window.jModalClose_no_tinyMCE.apply(this, arguments);
tinyMCE.activeEditor.windowManager.close();
};
}
if (typeof window.SqueezeBoxClose_no_tinyMCE === 'undefined')
{
if (typeof(SqueezeBox) == 'undefined') SqueezeBox = {};
window.SqueezeBoxClose_no_tinyMCE = typeof(SqueezeBox.close) ==
'function' ? SqueezeBox.close : false;
SqueezeBox.close = function () {
if (window.SqueezeBoxClose_no_tinyMCE)
window.SqueezeBoxClose_no_tinyMCE.apply(this, arguments);
tinyMCE.activeEditor.windowManager.close();
};
}
}
};
"
);
// Set static array
static::$loaded[__METHOD__][$sig] = true;
return;
}
/**
* JavaScript behavior to allow shift select in grids
*
* @param string $id The id of the form for which a multiselect
behaviour is to be applied.
*
* @return void
*
* @since 1.7
*/
public static function multiselect($id = 'adminForm')
{
// Only load once
if (isset(static::$loaded[__METHOD__][$id]))
{
return;
}
// Include core
static::core();
// Include jQuery
JHtml::_('jquery.framework');
JHtml::_('script', 'system/multiselect.js',
array('version' => 'auto', 'relative'
=> true));
// Attach multiselect to document
JFactory::getDocument()->addScriptDeclaration(
"jQuery(document).ready(function() {
Joomla.JMultiSelect('" . $id . "');
});"
);
// Set static array
static::$loaded[__METHOD__][$id] = true;
return;
}
/**
* Add unobtrusive javascript support for a collapsible tree.
*
* @param string $id An index
* @param array $params An array of options.
* @param array $root The root node
*
* @return void
*
* @since 1.5
*/
public static function tree($id, $params = array(), $root = array())
{
// Include MooTools framework
static::framework();
JHtml::_('script', 'system/mootree.js',
array('framework' => true, 'version' =>
'auto', 'relative' => true));
JHtml::_('stylesheet', 'system/mootree.css',
array('version' => 'auto', 'relative'
=> true));
if (isset(static::$loaded[__METHOD__][$id]))
{
return;
}
// Include jQuery
JHtml::_('jquery.framework');
// Setup options object
$opt['div'] = array_key_exists('div', $params) ?
$params['div'] : $id . '_tree';
$opt['mode'] = array_key_exists('mode', $params) ?
$params['mode'] : 'folders';
$opt['grid'] = array_key_exists('grid', $params) ?
'\\' . $params['grid'] : true;
$opt['theme'] = array_key_exists('theme', $params) ?
$params['theme'] : JHtml::_('image',
'system/mootree.gif', '', array(), true, true);
// Event handlers
$opt['onExpand'] = array_key_exists('onExpand',
$params) ? '\\' . $params['onExpand'] : null;
$opt['onSelect'] = array_key_exists('onSelect',
$params) ? '\\' . $params['onSelect'] : null;
$opt['onClick'] = array_key_exists('onClick',
$params) ? '\\' . $params['onClick']
: '\\function(node){ window.open(node.data.url, node.data.target !=
null ? node.data.target : \'_self\'); }';
$options = JHtml::getJSObject($opt);
// Setup root node
$rt['text'] = array_key_exists('text', $root) ?
$root['text'] : 'Root';
$rt['id'] = array_key_exists('id', $root) ?
$root['id'] : null;
$rt['color'] = array_key_exists('color', $root) ?
$root['color'] : null;
$rt['open'] = array_key_exists('open', $root) ?
'\\' . $root['open'] : true;
$rt['icon'] = array_key_exists('icon', $root) ?
$root['icon'] : null;
$rt['openicon'] = array_key_exists('openicon', $root)
? $root['openicon'] : null;
$rt['data'] = array_key_exists('data', $root) ?
$root['data'] : null;
$rootNode = JHtml::getJSObject($rt);
$treeName = array_key_exists('treeName', $params) ?
$params['treeName'] : '';
$js = ' jQuery(function(){
tree' . $treeName . ' = new MooTreeControl(' . $options .
',' . $rootNode . ');
tree' . $treeName . '.adopt(\'' . $id .
'\');})';
// Attach tooltips to document
$document = JFactory::getDocument();
$document->addScriptDeclaration($js);
// Set static array
static::$loaded[__METHOD__][$id] = true;
return;
}
/**
* Add unobtrusive JavaScript support for a calendar control.
*
* @return void
*
* @since 1.5
*
* @deprecated 4.0
*/
public static function calendar()
{
// Only load once
if (isset(static::$loaded[__METHOD__]))
{
return;
}
JLog::add('JHtmlBehavior::calendar is deprecated as the static
assets are being loaded in the relative layout.', JLog::WARNING,
'deprecated');
$document = JFactory::getDocument();
$tag = JFactory::getLanguage()->getTag();
$attribs = array('title' =>
JText::_('JLIB_HTML_BEHAVIOR_GREEN'), 'media' =>
'all');
JHtml::_('stylesheet', 'system/calendar-jos.css',
array('version' => 'auto', 'relative'
=> true), $attribs);
JHtml::_('script', $tag . '/calendar.js',
array('version' => 'auto', 'relative'
=> true));
JHtml::_('script', $tag . '/calendar-setup.js',
array('version' => 'auto', 'relative'
=> true));
$translation = static::calendartranslation();
if ($translation)
{
$document->addScriptDeclaration($translation);
}
static::$loaded[__METHOD__] = true;
}
/**
* Add unobtrusive JavaScript support for a color picker.
*
* @return void
*
* @since 1.7
*
* @deprecated 4.0 Use directly the field or the layout
*/
public static function colorpicker()
{
// Only load once
if (isset(static::$loaded[__METHOD__]))
{
return;
}
// Include jQuery
JHtml::_('jquery.framework');
JHtml::_('script', 'jui/jquery.minicolors.min.js',
array('version' => 'auto', 'relative'
=> true));
JHtml::_('stylesheet', 'jui/jquery.minicolors.css',
array('version' => 'auto', 'relative'
=> true));
JFactory::getDocument()->addScriptDeclaration("
jQuery(document).ready(function (){
jQuery('.minicolors').each(function() {
jQuery(this).minicolors({
control: jQuery(this).attr('data-control') ||
'hue',
format: jQuery(this).attr('data-validate') ===
'color'
? 'hex'
: (jQuery(this).attr('data-format') === 'rgba'
? 'rgb'
: jQuery(this).attr('data-format'))
|| 'hex',
keywords: jQuery(this).attr('data-keywords') ||
'',
opacity: jQuery(this).attr('data-format') ===
'rgba' ? true : false || false,
position: jQuery(this).attr('data-position') ||
'default',
theme: 'bootstrap'
});
});
});
"
);
static::$loaded[__METHOD__] = true;
}
/**
* Add unobtrusive JavaScript support for a simple color picker.
*
* @return void
*
* @since 3.1
*
* @deprecated 4.0 Use directly the field or the layout
*/
public static function simplecolorpicker()
{
// Only load once
if (isset(static::$loaded[__METHOD__]))
{
return;
}
// Include jQuery
JHtml::_('jquery.framework');
JHtml::_('script', 'jui/jquery.simplecolors.min.js',
array('version' => 'auto', 'relative'
=> true));
JHtml::_('stylesheet', 'jui/jquery.simplecolors.css',
array('version' => 'auto', 'relative'
=> true));
JFactory::getDocument()->addScriptDeclaration("
jQuery(document).ready(function (){
jQuery('select.simplecolors').simplecolors();
});
"
);
static::$loaded[__METHOD__] = true;
}
/**
* Keep session alive, for example, while editing or creating an article.
*
* @return void
*
* @since 1.5
*/
public static function keepalive()
{
// Only load once
if (isset(static::$loaded[__METHOD__]))
{
return;
}
$session = JFactory::getSession();
// If the handler is not 'Database', we set a fixed, small
refresh value (here: 5 min)
$refreshTime = 300;
if ($session->storeName === 'database')
{
$lifeTime = $session->getExpire();
$refreshTime = $lifeTime <= 60 ? 45 : $lifeTime - 60;
// The longest refresh period is one hour to prevent integer overflow.
if ($refreshTime > 3600 || $refreshTime <= 0)
{
$refreshTime = 3600;
}
}
// If we are in the frontend or logged in as a user, we can use the ajax
component to reduce the load
$uri = 'index.php' .
(JFactory::getApplication()->isClient('site') ||
!JFactory::getUser()->guest ?
'?option=com_ajax&format=json' : '');
// Include core and polyfill for browsers lower than IE 9.
static::core();
static::polyfill('event', 'lt IE 9');
// Add keepalive script options.
JFactory::getDocument()->addScriptOptions('system.keepalive',
array('interval' => $refreshTime * 1000, 'uri' =>
JRoute::_($uri)));
// Add script.
JHtml::_('script', 'system/keepalive.js',
array('version' => 'auto', 'relative'
=> true));
static::$loaded[__METHOD__] = true;
return;
}
/**
* Highlight some words via Javascript.
*
* @param array $terms Array of words that should be highlighted.
* @param string $start ID of the element that marks the begin of
the section in which words
* should be highlighted. Note this element
will be removed from the DOM.
* @param string $end ID of the element that end this section.
* Note this element will be removed from the
DOM.
* @param string $className Class name of the element highlights are
wrapped in.
* @param string $tag Tag that will be used to wrap the
highlighted words.
*
* @return void
*
* @since 2.5
*/
public static function highlighter(array $terms, $start =
'highlighter-start', $end = 'highlighter-end',
$className = 'highlight', $tag = 'span')
{
$sig = md5(serialize(array($terms, $start, $end)));
if (isset(static::$loaded[__METHOD__][$sig]))
{
return;
}
$terms = array_filter($terms, 'strlen');
// Nothing to Highlight
if (empty($terms))
{
static::$loaded[__METHOD__][$sig] = true;
return;
}
// Include core
static::core();
// Include jQuery
JHtml::_('jquery.framework');
JHtml::_('script', 'system/highlighter.js',
array('version' => 'auto', 'relative'
=> true));
foreach ($terms as $i => $term)
{
$terms[$i] = JFilterOutput::stringJSSafe($term);
}
$document = JFactory::getDocument();
$document->addScriptDeclaration("
jQuery(function ($) {
var start = document.getElementById('" . $start .
"');
var end = document.getElementById('" . $end . "');
if (!start || !end || !Joomla.Highlighter) {
return true;
}
highlighter = new Joomla.Highlighter({
startElement: start,
endElement: end,
className: '" . $className . "',
onlyWords: false,
tag: '" . $tag . "'
}).highlight([\"" . implode('","',
$terms) . "\"]);
$(start).remove();
$(end).remove();
});
");
static::$loaded[__METHOD__][$sig] = true;
return;
}
/**
* Break us out of any containing iframes
*
* @return void
*
* @since 1.5
*
* @deprecated 4.0 Add a X-Frame-Options HTTP Header with the SAMEORIGIN
value instead.
*/
public static function noframes()
{
JLog::add(__METHOD__ . ' is deprecated, add a X-Frame-Options HTTP
Header with the SAMEORIGIN value instead.', JLog::WARNING,
'deprecated');
// Only load once
if (isset(static::$loaded[__METHOD__]))
{
return;
}
// Include core
static::core();
// Include jQuery
JHtml::_('jquery.framework');
$js = 'jQuery(function () {
if (top == self) {
document.documentElement.style.display = "block";
}
else
{
top.location = self.location;
}
// Firefox fix
jQuery("input[autofocus]").focus();
})';
$document = JFactory::getDocument();
$document->addStyleDeclaration('html { display:none }');
$document->addScriptDeclaration($js);
JFactory::getApplication()->setHeader('X-Frame-Options',
'SAMEORIGIN');
static::$loaded[__METHOD__] = true;
}
/**
* Internal method to get a JavaScript object notation string from an
array
*
* @param array $array The array to convert to JavaScript object
notation
*
* @return string JavaScript object notation representation of the array
*
* @since 1.5
* @deprecated 4.0 - Use JHtml::getJSObject() instead.
*/
protected static function _getJSObject($array = array())
{
JLog::add('JHtmlBehavior::_getJSObject() is deprecated.
JHtml::getJSObject() instead..', JLog::WARNING,
'deprecated');
return JHtml::getJSObject($array);
}
/**
* Add unobtrusive JavaScript support to keep a tab state.
*
* Note that keeping tab state only works for inner tabs if in accordance
with the following example:
*
* ```
* parent tab = permissions
* child tab = permission-<identifier>
* ```
*
* Each tab header `<a>` tag also should have a unique href
attribute
*
* @return void
*
* @since 3.2
*/
public static function tabstate()
{
if (isset(self::$loaded[__METHOD__]))
{
return;
}
// Include jQuery
JHtml::_('jquery.framework');
JHtml::_('behavior.polyfill',
array('filter','xpath'));
JHtml::_('script', 'system/tabs-state.js',
array('version' => 'auto', 'relative'
=> true));
self::$loaded[__METHOD__] = true;
}
/**
* Add javascript polyfills.
*
* @param string|array $polyfillTypes The polyfill type(s).
Examples: event, array('event', 'classlist').
* @param string $conditionalBrowser An IE conditional
expression. Example: lt IE 9 (lower than IE 9).
*
* @return void
*
* @since 3.7.0
*/
public static function polyfill($polyfillTypes = null, $conditionalBrowser
= null)
{
if ($polyfillTypes === null)
{
return;
}
foreach ((array) $polyfillTypes as $polyfillType)
{
$sig = md5(serialize(array($polyfillType, $conditionalBrowser)));
// Only load once
if (isset(static::$loaded[__METHOD__][$sig]))
{
continue;
}
// If include according to browser.
$scriptOptions = array('version' => 'auto',
'relative' => true);
$scriptOptions = $conditionalBrowser !== null ?
array_replace($scriptOptions, array('conditional' =>
$conditionalBrowser)) : $scriptOptions;
JHtml::_('script', 'system/polyfill.' .
$polyfillType . '.js', $scriptOptions);
// Set static array
static::$loaded[__METHOD__][$sig] = true;
}
}
/**
* Internal method to translate the JavaScript Calendar
*
* @return string JavaScript that translates the object
*
* @since 1.5
*/
protected static function calendartranslation()
{
static $jsscript = 0;
// Guard clause, avoids unnecessary nesting
if ($jsscript)
{
return false;
}
$jsscript = 1;
// To keep the code simple here, run strings through JText::_() using
array_map()
$callback = array('JText', '_');
$weekdays_full = array_map(
$callback, array(
'SUNDAY', 'MONDAY', 'TUESDAY',
'WEDNESDAY', 'THURSDAY', 'FRIDAY',
'SATURDAY', 'SUNDAY',
)
);
$weekdays_short = array_map(
$callback,
array(
'SUN', 'MON', 'TUE', 'WED',
'THU', 'FRI', 'SAT', 'SUN',
)
);
$months_long = array_map(
$callback, array(
'JANUARY', 'FEBRUARY', 'MARCH',
'APRIL', 'MAY', 'JUNE',
'JULY', 'AUGUST', 'SEPTEMBER',
'OCTOBER', 'NOVEMBER', 'DECEMBER',
)
);
$months_short = array_map(
$callback, array(
'JANUARY_SHORT', 'FEBRUARY_SHORT',
'MARCH_SHORT', 'APRIL_SHORT', 'MAY_SHORT',
'JUNE_SHORT',
'JULY_SHORT', 'AUGUST_SHORT',
'SEPTEMBER_SHORT', 'OCTOBER_SHORT',
'NOVEMBER_SHORT', 'DECEMBER_SHORT',
)
);
// This will become an object in Javascript but define it first in PHP
for readability
$today = " " . JText::_('JLIB_HTML_BEHAVIOR_TODAY') .
" ";
$text = array(
'INFO' =>
JText::_('JLIB_HTML_BEHAVIOR_ABOUT_THE_CALENDAR'),
'ABOUT' => "DHTML Date/Time Selector\n"
. "(c) dynarch.com 20022005 / Author: Mihai Bazon\n"
. "For latest version visit:
http://www.dynarch.com/projects/calendar/\n"
. "Distributed under GNU LGPL. See
http://gnu.org/licenses/lgpl.html for details."
. "\n\n"
. JText::_('JLIB_HTML_BEHAVIOR_DATE_SELECTION')
. JText::_('JLIB_HTML_BEHAVIOR_YEAR_SELECT')
. JText::_('JLIB_HTML_BEHAVIOR_MONTH_SELECT')
. JText::_('JLIB_HTML_BEHAVIOR_HOLD_MOUSE'),
'ABOUT_TIME' => "\n\n"
. "Time selection:\n"
. " Click on any of the time parts to increase it\n"
. " or Shiftclick to decrease it\n"
. " or click and drag for faster selection.",
'PREV_YEAR' =>
JText::_('JLIB_HTML_BEHAVIOR_PREV_YEAR_HOLD_FOR_MENU'),
'PREV_MONTH' =>
JText::_('JLIB_HTML_BEHAVIOR_PREV_MONTH_HOLD_FOR_MENU'),
'GO_TODAY' =>
JText::_('JLIB_HTML_BEHAVIOR_GO_TODAY'),
'NEXT_MONTH' =>
JText::_('JLIB_HTML_BEHAVIOR_NEXT_MONTH_HOLD_FOR_MENU'),
'SEL_DATE' =>
JText::_('JLIB_HTML_BEHAVIOR_SELECT_DATE'),
'DRAG_TO_MOVE' =>
JText::_('JLIB_HTML_BEHAVIOR_DRAG_TO_MOVE'),
'PART_TODAY' => $today,
'DAY_FIRST' =>
JText::_('JLIB_HTML_BEHAVIOR_DISPLAY_S_FIRST'),
'WEEKEND' =>
JFactory::getLanguage()->getWeekEnd(),
'CLOSE' =>
JText::_('JLIB_HTML_BEHAVIOR_CLOSE'),
'TODAY' =>
JText::_('JLIB_HTML_BEHAVIOR_TODAY'),
'TIME_PART' =>
JText::_('JLIB_HTML_BEHAVIOR_SHIFT_CLICK_OR_DRAG_TO_CHANGE_VALUE'),
'DEF_DATE_FORMAT' => "%Y%m%d",
'TT_DATE_FORMAT' =>
JText::_('JLIB_HTML_BEHAVIOR_TT_DATE_FORMAT'),
'WK' =>
JText::_('JLIB_HTML_BEHAVIOR_WK'),
'TIME' =>
JText::_('JLIB_HTML_BEHAVIOR_TIME'),
);
return 'Calendar._DN = ' . json_encode($weekdays_full) .
';'
. ' Calendar._SDN = ' . json_encode($weekdays_short) .
';'
. ' Calendar._FD = 0;'
. ' Calendar._MN = ' . json_encode($months_long) .
';'
. ' Calendar._SMN = ' . json_encode($months_short) .
';'
. ' Calendar._TT = ' . json_encode($text) . ';';
}
}
bootstrap.php000064400000102166151156051770007310 0ustar00<?php
/**
* @package Joomla.Libraries
* @subpackage HTML
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('JPATH_PLATFORM') or die;
/**
* Utility class for Bootstrap elements.
*
* @since 3.0
*/
abstract class JHtmlBootstrap
{
/**
* @var array Array containing information for loaded files
* @since 3.0
*/
protected static $loaded = array();
/**
* Add javascript support for the Bootstrap affix plugin
*
* @param string $selector Unique selector for the element to be
affixed.
* @param array $params An array of options.
* Options for the affix plugin can be:
* - offset number|function|object Pixels to
offset from screen when calculating position of scroll.
* If a
single number is provided, the offset will be applied in both top
* and left
directions. To listen for a single direction, or multiple
* unique
offsets, just provide an object offset: { x: 10 }.
* Use a
function when you need to dynamically provide an offset
* (useful
for some responsive designs).
*
* @return void
*
* @since 3.1
*
* @deprecated 4.0 Bootstrap 4.0 dropped this so will Joomla.
*/
public static function affix($selector = 'affix', $params =
array())
{
$sig = md5(serialize(array($selector, $params)));
if (!isset(static::$loaded[__METHOD__][$sig]))
{
// Include Bootstrap framework
JHtml::_('bootstrap.framework');
// Setup options object
$opt['offset'] = isset($params['offset']) ?
$params['offset'] : 10;
$options = JHtml::getJSObject($opt);
// Attach affix to document
JFactory::getDocument()->addScriptDeclaration(
'jQuery(function($){ $(' . json_encode('#' .
$selector) . ').affix(' . $options . '); });'
);
// Set static array
static::$loaded[__METHOD__][$sig] = true;
}
return;
}
/**
* Add javascript support for Bootstrap alerts
*
* @param string $selector Common class for the alerts
*
* @return void
*
* @since 3.0
*/
public static function alert($selector = 'alert')
{
// Only load once
if (isset(static::$loaded[__METHOD__][$selector]))
{
return;
}
// Include Bootstrap framework
JHtml::_('bootstrap.framework');
// Attach the alerts to the document
JFactory::getDocument()->addScriptDeclaration(
'jQuery(function($){ $(' . json_encode('.' .
$selector) . ').alert(); });'
);
static::$loaded[__METHOD__][$selector] = true;
return;
}
/**
* Add javascript support for Bootstrap buttons
*
* @param string $selector Common class for the buttons
*
* @return void
*
* @since 3.1
*/
public static function button($selector = 'button')
{
// Only load once
if (isset(static::$loaded[__METHOD__][$selector]))
{
return;
}
// Include Bootstrap framework
JHtml::_('bootstrap.framework');
// Attach the button to the document
JFactory::getDocument()->addScriptDeclaration(
'jQuery(function($){ $(' . json_encode('.' .
$selector) . ').button(); });'
);
static::$loaded[__METHOD__][$selector] = true;
return;
}
/**
* Add javascript support for Bootstrap carousels
*
* @param string $selector Common class for the carousels.
* @param array $params An array of options for the carousel.
* Options for the carousel can be:
* - interval number The amount of time to
delay between automatically cycling an item.
* If false, carousel will
not automatically cycle.
* - pause string Pauses the cycling of
the carousel on mouseenter and resumes the cycling
* of the carousel on
mouseleave.
*
* @return void
*
* @since 3.0
*/
public static function carousel($selector = 'carousel', $params
= array())
{
$sig = md5(serialize(array($selector, $params)));
if (!isset(static::$loaded[__METHOD__][$sig]))
{
// Include Bootstrap framework
JHtml::_('bootstrap.framework');
// Setup options object
$opt['interval'] = isset($params['interval']) ?
(int) $params['interval'] : 5000;
$opt['pause'] = isset($params['pause']) ?
$params['pause'] : 'hover';
$options = JHtml::getJSObject($opt);
// Attach the carousel to document
JFactory::getDocument()->addScriptDeclaration(
'jQuery(function($){ $(' . json_encode('.' .
$selector) . ').carousel(' . $options . '); });'
);
// Set static array
static::$loaded[__METHOD__][$sig] = true;
}
return;
}
/**
* Add javascript support for Bootstrap dropdowns
*
* @param string $selector Common class for the dropdowns
*
* @return void
*
* @since 3.0
*/
public static function dropdown($selector = 'dropdown-toggle')
{
// Only load once
if (isset(static::$loaded[__METHOD__][$selector]))
{
return;
}
// Include Bootstrap framework
JHtml::_('bootstrap.framework');
// Attach the dropdown to the document
JFactory::getDocument()->addScriptDeclaration(
'jQuery(function($){ $(' . json_encode('.' .
$selector) . ').dropdown(); });'
);
static::$loaded[__METHOD__][$selector] = true;
return;
}
/**
* Method to load the Bootstrap JavaScript framework into the document
head
*
* If debugging mode is on an uncompressed version of Bootstrap is
included for easier debugging.
*
* @param mixed $debug Is debugging mode on? [optional]
*
* @return void
*
* @since 3.0
*/
public static function framework($debug = null)
{
// Only load once
if (!empty(static::$loaded[__METHOD__]))
{
return;
}
// Load jQuery
JHtml::_('jquery.framework');
// If no debugging value is set, use the configuration setting
if ($debug === null)
{
$debug = JDEBUG;
}
JHtml::_('script', 'jui/bootstrap.min.js',
array('version' => 'auto', 'relative'
=> true, 'detectDebug' => $debug));
static::$loaded[__METHOD__] = true;
return;
}
/**
* Add javascript support for Bootstrap modals
*
* @param string $selector The ID selector for the modal.
* @param array $params An array of options for the modal.
* Options for the modal can be:
* - backdrop boolean Includes a
modal-backdrop element.
* - keyboard boolean Closes the modal when
escape key is pressed.
* - show boolean Shows the modal when
initialized.
* - remote string An optional remote URL
to load
*
* @return void
*
* @since 3.0
* @deprecated 4.0 This method was used by the old renderModal()
implementation.
* Since the new implementation it is unneeded and the
broken JS it was injecting could create issues
* As a case, please see:
https://github.com/joomla/joomla-cms/pull/6918
*/
public static function modal($selector = 'modal', $params =
array())
{
$sig = md5(serialize(array($selector, $params)));
if (!isset(static::$loaded[__METHOD__][$sig]))
{
// Include Bootstrap framework
JHtml::_('bootstrap.framework');
// Setup options object
$opt['backdrop'] = isset($params['backdrop']) ?
(boolean) $params['backdrop'] : true;
$opt['keyboard'] = isset($params['keyboard']) ?
(boolean) $params['keyboard'] : true;
$opt['show'] = isset($params['show']) ?
(boolean) $params['show'] : false;
$opt['remote'] = isset($params['remote']) ?
$params['remote'] : '';
$options = JHtml::getJSObject($opt);
// Attach the modal to document
JFactory::getDocument()->addScriptDeclaration(
'jQuery(function($){ $(' . json_encode('#' .
$selector) . ').modal(' . $options . '); });'
);
// Set static array
static::$loaded[__METHOD__][$sig] = true;
}
return;
}
/**
* Method to render a Bootstrap modal
*
* @param string $selector The ID selector for the modal.
* @param array $params An array of options for the modal.
* Options for the modal can be:
* - title string The modal title
* - backdrop mixed A boolean select if
a modal-backdrop element should be included (default = true)
* The string
'static' includes a backdrop which doesn't close the modal
on click.
* - keyboard boolean Closes the modal
when escape key is pressed (default = true)
* - closeButton boolean Display modal close
button (default = true)
* - animation boolean Fade in from the
top of the page (default = true)
* - footer string Optional markup for
the modal footer
* - url string URL of a resource
to be inserted as an `<iframe>` inside the modal body
* - height string height of the
`<iframe>` containing the remote resource
* - width string width of the
`<iframe>` containing the remote resource
* @param string $body Markup for the modal body. Appended after
the `<iframe>` if the URL option is set
*
* @return string HTML markup for a modal
*
* @since 3.0
*/
public static function renderModal($selector = 'modal', $params
= array(), $body = '')
{
// Include Bootstrap framework
JHtml::_('bootstrap.framework');
$layoutData = array(
'selector' => $selector,
'params' => $params,
'body' => $body,
);
return JLayoutHelper::render('joomla.modal.main', $layoutData);
}
/**
* Add javascript support for Bootstrap popovers
*
* Use element's Title as popover content
*
* @param string $selector Selector for the popover
* @param array $params An array of options for the popover.
* Options for the popover can be:
* animation boolean apply a css fade
transition to the popover
* html boolean Insert HTML into the
popover. If false, jQuery's text method will be used to insert
* content into the dom.
* placement string|function how to position the
popover - top | bottom | left | right
* selector string If a selector is
provided, popover objects will be delegated to the specified targets.
* trigger string how popover is
triggered - hover | focus | manual
* title string|function default title value if
`title` tag isn't present
* content string|function default content value
if `data-content` attribute isn't present
* delay number|object delay showing and
hiding the popover (ms) - does not apply to manual trigger type
* If a number is
supplied, delay is applied to both hide/show
* Object structure is:
delay: { show: 500, hide: 100 }
* container string|boolean Appends the popover to
a specific element: { container: 'body' }
*
* @return void
*
* @since 3.0
*/
public static function popover($selector = '.hasPopover',
$params = array())
{
// Only load once
if (isset(static::$loaded[__METHOD__][$selector]))
{
return;
}
// Include Bootstrap framework
JHtml::_('bootstrap.framework');
$opt['animation'] = isset($params['animation']) ?
$params['animation'] : null;
$opt['html'] = isset($params['html']) ?
$params['html'] : true;
$opt['placement'] = isset($params['placement']) ?
$params['placement'] : null;
$opt['selector'] = isset($params['selector']) ?
$params['selector'] : null;
$opt['title'] = isset($params['title']) ?
$params['title'] : null;
$opt['trigger'] = isset($params['trigger']) ?
$params['trigger'] : 'hover focus';
$opt['content'] = isset($params['content']) ?
$params['content'] : null;
$opt['delay'] = isset($params['delay']) ?
$params['delay'] : null;
$opt['container'] = isset($params['container']) ?
$params['container'] : 'body';
$options = JHtml::getJSObject($opt);
$initFunction = 'function initPopovers (event, container) { ' .
'$(container || document).find(' . json_encode($selector) .
').popover(' . $options . ');' .
'}';
// Attach the popover to the document
JFactory::getDocument()->addScriptDeclaration(
'jQuery(function($){ initPopovers();
$("body").on("subform-row-add", initPopovers); ' .
$initFunction . ' });'
);
static::$loaded[__METHOD__][$selector] = true;
return;
}
/**
* Add javascript support for Bootstrap ScrollSpy
*
* @param string $selector The ID selector for the ScrollSpy element.
* @param array $params An array of options for the ScrollSpy.
* Options for the ScrollSpy can be:
* - offset number Pixels to offset from top
when calculating position of scroll.
*
* @return void
*
* @since 3.0
*/
public static function scrollspy($selector = 'navbar', $params =
array())
{
$sig = md5(serialize(array($selector, $params)));
if (!isset(static::$loaded[__METHOD__][$sig]))
{
// Include Bootstrap framework
JHtml::_('bootstrap.framework');
// Setup options object
$opt['offset'] = isset($params['offset']) ? (int)
$params['offset'] : 10;
$options = JHtml::getJSObject($opt);
// Attach ScrollSpy to document
JFactory::getDocument()->addScriptDeclaration(
'jQuery(function($){ $(' . json_encode('#' .
$selector) . ').scrollspy(' . $options . '); });'
);
// Set static array
static::$loaded[__METHOD__][$sig] = true;
}
return;
}
/**
* Add javascript support for Bootstrap tooltips
*
* Add a title attribute to any element in the form
* title="title::text"
*
* @param string $selector The ID selector for the tooltip.
* @param array $params An array of options for the tooltip.
* Options for the tooltip can be:
* - animation boolean Apply a CSS
fade transition to the tooltip
* - html boolean Insert HTML
into the tooltip. If false, jQuery's text method will be used to
insert
* content into
the dom.
* - placement string|function How to
position the tooltip - top | bottom | left | right
* - selector string If a selector
is provided, tooltip objects will be delegated to the specified targets.
* - title string|function Default title
value if `title` tag isn't present
* - trigger string How tooltip
is triggered - hover | focus | manual
* - delay integer Delay showing
and hiding the tooltip (ms) - does not apply to manual trigger type
* If a number
is supplied, delay is applied to both hide/show
* Object
structure is: delay: { show: 500, hide: 100 }
* - container string|boolean Appends the
popover to a specific element: { container: 'body' }
*
* @return void
*
* @since 3.0
*/
public static function tooltip($selector = '.hasTooltip',
$params = array())
{
if (!isset(static::$loaded[__METHOD__][$selector]))
{
// Include Bootstrap framework
JHtml::_('bootstrap.framework');
// Setup options object
$opt['animation'] = isset($params['animation']) ?
(boolean) $params['animation'] : null;
$opt['html'] = isset($params['html']) ?
(boolean) $params['html'] : true;
$opt['placement'] = isset($params['placement']) ?
(string) $params['placement'] : null;
$opt['selector'] = isset($params['selector']) ?
(string) $params['selector'] : null;
$opt['title'] = isset($params['title']) ?
(string) $params['title'] : null;
$opt['trigger'] = isset($params['trigger']) ?
(string) $params['trigger'] : null;
$opt['delay'] = isset($params['delay']) ?
(is_array($params['delay']) ? $params['delay'] : (int)
$params['delay']) : null;
$opt['container'] = isset($params['container']) ?
$params['container'] : 'body';
$opt['template'] = isset($params['template']) ?
(string) $params['template'] : null;
$onShow = isset($params['onShow']) ? (string)
$params['onShow'] : null;
$onShown = isset($params['onShown']) ? (string)
$params['onShown'] : null;
$onHide = isset($params['onHide']) ? (string)
$params['onHide'] : null;
$onHidden = isset($params['onHidden']) ? (string)
$params['onHidden'] : null;
$options = JHtml::getJSObject($opt);
// Build the script.
$script = array('$(container).find(' . json_encode($selector)
. ').tooltip(' . $options . ')');
if ($onShow)
{
$script[] = 'on("show.bs.tooltip", ' . $onShow .
')';
}
if ($onShown)
{
$script[] = 'on("shown.bs.tooltip", ' . $onShown .
')';
}
if ($onHide)
{
$script[] = 'on("hide.bs.tooltip", ' . $onHide .
')';
}
if ($onHidden)
{
$script[] = 'on("hidden.bs.tooltip", ' . $onHidden
. ')';
}
$initFunction = 'function initTooltips (event, container) { '
.
'container = container || document;' .
implode('.', $script) . ';' .
'}';
// Attach tooltips to document
JFactory::getDocument()
->addScriptDeclaration('jQuery(function($){ initTooltips();
$("body").on("subform-row-add", initTooltips); ' .
$initFunction . ' });');
// Set static array
static::$loaded[__METHOD__][$selector] = true;
}
return;
}
/**
* Loads js and css files needed by Bootstrap Tooltip Extended plugin
*
* @param boolean $extended If true, bootstrap-tooltip-extended.js and
.css files are loaded
*
* @return void
*
* @since 3.6
*
* @deprecated 4.0 No replacement, use Bootstrap tooltips.
*/
public static function tooltipExtended($extended = true)
{
if ($extended)
{
JHtml::_('script',
'jui/bootstrap-tooltip-extended.min.js',
array('version' => 'auto', 'relative'
=> true));
JHtml::_('stylesheet',
'jui/bootstrap-tooltip-extended.css', array('version'
=> 'auto', 'relative' => true));
}
}
/**
* Add javascript support for Bootstrap typeahead
*
* @param string $selector The selector for the typeahead element.
* @param array $params An array of options for the typeahead
element.
* Options for the tooltip can be:
* - source array, function The data
source to query against. May be an array of strings or a function.
* The
function is passed two arguments, the query value in the input field and
the
* process
callback. The function may be used synchronously by returning the data
* source
directly or asynchronously via the process callback's single argument.
* - items number The max
number of items to display in the dropdown.
* - minLength number The minimum
character length needed before triggering autocomplete suggestions
* - matcher function The method
used to determine if a query matches an item. Accepts a single argument,
* the item
against which to test the query. Access the current query with this.query.
* Return a
boolean true if query is a match.
* - sorter function Method used
to sort autocomplete results. Accepts a single argument items and has
* the scope
of the typeahead instance. Reference the current query with this.query.
* - updater function The method
used to return selected item. Accepts a single argument, the item and
* has the
scope of the typeahead instance.
* - highlighter function Method used
to highlight autocomplete results. Accepts a single argument item and
* has the
scope of the typeahead instance. Should return html.
*
* @return void
*
* @since 3.0
*
* @deprecated 4.0 Bootstrap 4.0 dropped this so will Joomla.
*/
public static function typeahead($selector = '.typeahead',
$params = array())
{
if (!isset(static::$loaded[__METHOD__][$selector]))
{
// Include Bootstrap framework
JHtml::_('bootstrap.framework');
// Setup options object
$opt['source'] = isset($params['source']) ?
$params['source'] : null;
$opt['items'] = isset($params['items']) ?
(int) $params['items'] : 8;
$opt['minLength'] = isset($params['minLength']) ?
(int) $params['minLength'] : 1;
$opt['matcher'] = isset($params['matcher']) ?
(string) $params['matcher'] : null;
$opt['sorter'] = isset($params['sorter']) ?
(string) $params['sorter'] : null;
$opt['updater'] = isset($params['updater']) ?
(string) $params['updater'] : null;
$opt['highlighter'] = isset($params['highlighter'])
? (int) $params['highlighter'] : null;
$options = JHtml::getJSObject($opt);
// Attach typehead to document
JFactory::getDocument()->addScriptDeclaration(
'jQuery(function($){ $(' . json_encode($selector) .
').typeahead(' . $options . '); });'
);
// Set static array
static::$loaded[__METHOD__][$selector] = true;
}
return;
}
/**
* Add javascript support for Bootstrap accordians and insert the
accordian
*
* @param string $selector The ID selector for the tooltip.
* @param array $params An array of options for the tooltip.
* Options for the tooltip can be:
* - parent selector If selector then all
collapsible elements under the specified parent will be closed when this
* collapsible item is
shown. (similar to traditional accordion behavior)
* - toggle boolean Toggles the collapsible
element on invocation
* - active string Sets the active slide
during load
*
* - onShow function This event fires
immediately when the show instance method is called.
* - onShown function This event is fired
when a collapse element has been made visible to the user
* (will wait for css
transitions to complete).
* - onHide function This event is fired
immediately when the hide method has been called.
* - onHidden function This event is fired
when a collapse element has been hidden from the user
* (will wait for css
transitions to complete).
*
* @return string HTML for the accordian
*
* @since 3.0
*/
public static function startAccordion($selector = 'myAccordian',
$params = array())
{
if (!isset(static::$loaded[__METHOD__][$selector]))
{
// Include Bootstrap framework
JHtml::_('bootstrap.framework');
// Setup options object
$opt['parent'] = isset($params['parent']) ?
($params['parent'] == true ? '#' . $selector :
$params['parent']) : false;
$opt['toggle'] = isset($params['toggle']) ?
(boolean) $params['toggle'] : !($opt['parent'] ===
false || isset($params['active']));
$onShow = isset($params['onShow']) ? (string)
$params['onShow'] : null;
$onShown = isset($params['onShown']) ? (string)
$params['onShown'] : null;
$onHide = isset($params['onHide']) ? (string)
$params['onHide'] : null;
$onHidden = isset($params['onHidden']) ? (string)
$params['onHidden'] : null;
$options = JHtml::getJSObject($opt);
$opt['active'] = isset($params['active']) ? (string)
$params['active'] : '';
// Build the script.
$script = array();
$script[] = "jQuery(function($){";
$script[] = "\t$('#" . $selector .
"').collapse(" . $options . ")";
if ($onShow)
{
$script[] = "\t.on('show', " . $onShow .
")";
}
if ($onShown)
{
$script[] = "\t.on('shown', " . $onShown .
")";
}
if ($onHide)
{
$script[] = "\t.on('hideme', " . $onHide .
")";
}
if ($onHidden)
{
$script[] = "\t.on('hidden', " . $onHidden .
")";
}
$parents = array_key_exists(__METHOD__, static::$loaded) ?
array_filter(array_column(static::$loaded[__METHOD__], 'parent'))
: array();
if ($opt['parent'] && empty($parents))
{
$script[] = "
$(document).on('click.collapse.data-api',
'[data-toggle=collapse]', function (e) {
var \$this = $(this), href
var parent = \$this.attr('data-parent')
var \$parent = parent && $(parent)
if (\$parent)
\$parent.find('[data-toggle=collapse][data-parent=' + parent +
']').not(\$this).addClass('collapsed')
})";
}
$script[] = "});";
// Attach accordion to document
JFactory::getDocument()->addScriptDeclaration(implode("\n",
$script));
// Set static array
static::$loaded[__METHOD__][$selector] = $opt;
return '<div id="' . $selector . '"
class="accordion">';
}
}
/**
* Close the current accordion
*
* @return string HTML to close the accordian
*
* @since 3.0
*/
public static function endAccordion()
{
return '</div>';
}
/**
* Begins the display of a new accordion slide.
*
* @param string $selector Identifier of the accordion group.
* @param string $text Text to display.
* @param string $id Identifier of the slide.
* @param string $class Class of the accordion group.
*
* @return string HTML to add the slide
*
* @since 3.0
*/
public static function addSlide($selector, $text, $id, $class =
'')
{
$in = (static::$loaded[__CLASS__ .
'::startAccordion'][$selector]['active'] == $id) ?
' in' : '';
$collapsed = (static::$loaded[__CLASS__ .
'::startAccordion'][$selector]['active'] == $id) ?
'' : ' collapsed';
$parent = static::$loaded[__CLASS__ .
'::startAccordion'][$selector]['parent'] ?
' data-parent="' . static::$loaded[__CLASS__ .
'::startAccordion'][$selector]['parent'] .
'"' : '';
$class = (!empty($class)) ? ' ' . $class : '';
$html = '<div class="accordion-group' . $class .
'">'
. '<div class="accordion-heading">'
. '<strong><a href="#' . $id . '"
data-toggle="collapse"' . $parent . '
class="accordion-toggle' . $collapsed . '">'
. $text
. '</a></strong>'
. '</div>'
. '<div class="accordion-body collapse' . $in .
'" id="' . $id . '">'
. '<div class="accordion-inner">';
return $html;
}
/**
* Close the current slide
*
* @return string HTML to close the slide
*
* @since 3.0
*/
public static function endSlide()
{
return '</div></div></div>';
}
/**
* Creates a tab pane
*
* @param string $selector The pane identifier.
* @param array $params The parameters for the pane
*
* @return string
*
* @since 3.1
*/
public static function startTabSet($selector = 'myTab', $params
= array())
{
$sig = md5(serialize(array($selector, $params)));
if (!isset(static::$loaded[__METHOD__][$sig]))
{
// Include Bootstrap framework
JHtml::_('bootstrap.framework');
// Setup options object
$opt['active'] = (isset($params['active'])
&& $params['active']) ? (string)
$params['active'] : '';
// Attach tabs to document
JFactory::getDocument()
->addScriptDeclaration(JLayoutHelper::render('libraries.cms.html.bootstrap.starttabsetscript',
array('selector' => $selector)));
// Set static array
static::$loaded[__METHOD__][$sig] = true;
static::$loaded[__METHOD__][$selector]['active'] =
$opt['active'];
}
return
JLayoutHelper::render('libraries.cms.html.bootstrap.starttabset',
array('selector' => $selector));
}
/**
* Close the current tab pane
*
* @return string HTML to close the pane
*
* @since 3.1
*/
public static function endTabSet()
{
return
JLayoutHelper::render('libraries.cms.html.bootstrap.endtabset');
}
/**
* Begins the display of a new tab content panel.
*
* @param string $selector Identifier of the panel.
* @param string $id The ID of the div element
* @param string $title The title text for the new UL tab
*
* @return string HTML to start a new panel
*
* @since 3.1
*/
public static function addTab($selector, $id, $title)
{
static $tabScriptLayout = null;
static $tabLayout = null;
$tabScriptLayout = $tabScriptLayout === null ? new
JLayoutFile('libraries.cms.html.bootstrap.addtabscript') :
$tabScriptLayout;
$tabLayout = $tabLayout === null ? new
JLayoutFile('libraries.cms.html.bootstrap.addtab') : $tabLayout;
$active =
(static::$loaded['JHtmlBootstrap::startTabSet'][$selector]['active']
== $id) ? ' active' : '';
// Inject tab into UL
JFactory::getDocument()
->addScriptDeclaration($tabScriptLayout->render(array('selector'
=> $selector, 'id' => $id, 'active' =>
$active, 'title' => $title)));
return $tabLayout->render(array('id' => $id,
'active' => $active));
}
/**
* Close the current tab content panel
*
* @return string HTML to close the pane
*
* @since 3.1
*/
public static function endTab()
{
return
JLayoutHelper::render('libraries.cms.html.bootstrap.endtab');
}
/**
* Creates a tab pane
*
* @param string $selector The pane identifier.
* @param array $params The parameters for the pane
*
* @return string
*
* @since 3.0
* @deprecated 4.0 Use JHtml::_('bootstrap.startTabSet')
instead.
*/
public static function startPane($selector = 'myTab', $params =
array())
{
$sig = md5(serialize(array($selector, $params)));
if
(!isset(static::$loaded['JHtmlBootstrap::startTabSet'][$sig]))
{
// Include Bootstrap framework
JHtml::_('bootstrap.framework');
// Setup options object
$opt['active'] = isset($params['active']) ? (string)
$params['active'] : '';
// Attach tab to document
JFactory::getDocument()->addScriptDeclaration(
'jQuery(function($){
$(' . json_encode('#' . $selector . ' a') .
').click(function (e) {
e.preventDefault();
$(this).tab("show");
});
});'
);
// Set static array
static::$loaded['JHtmlBootstrap::startTabSet'][$sig] = true;
static::$loaded['JHtmlBootstrap::startTabSet'][$selector]['active']
= $opt['active'];
}
return '<div class="tab-content" id="' .
$selector . 'Content">';
}
/**
* Close the current tab pane
*
* @return string HTML to close the pane
*
* @since 3.0
* @deprecated 4.0 Use JHtml::_('bootstrap.endTabSet') instead.
*/
public static function endPane()
{
return '</div>';
}
/**
* Begins the display of a new tab content panel.
*
* @param string $selector Identifier of the panel.
* @param string $id The ID of the div element
*
* @return string HTML to start a new panel
*
* @since 3.0
* @deprecated 4.0 Use JHtml::_('bootstrap.addTab') instead.
*/
public static function addPanel($selector, $id)
{
$active =
(static::$loaded['JHtmlBootstrap::startTabSet'][$selector]['active']
== $id) ? ' active' : '';
return '<div id="' . $id . '"
class="tab-pane' . $active . '">';
}
/**
* Close the current tab content panel
*
* @return string HTML to close the pane
*
* @since 3.0
* @deprecated 4.0 Use JHtml::_('bootstrap.endTab') instead.
*/
public static function endPanel()
{
return '</div>';
}
/**
* Loads CSS files needed by Bootstrap
*
* @param boolean $includeMainCss If true, main bootstrap.css files
are loaded
* @param string $direction rtl or ltr direction. If empty, ltr
is assumed
* @param array $attribs Optional array of attributes to be
passed to JHtml::_('stylesheet')
*
* @return void
*
* @since 3.0
*/
public static function loadCss($includeMainCss = true, $direction =
'ltr', $attribs = array())
{
// Load Bootstrap main CSS
if ($includeMainCss)
{
JHtml::_('stylesheet', 'jui/bootstrap.min.css',
array('version' => 'auto', 'relative'
=> true), $attribs);
JHtml::_('stylesheet',
'jui/bootstrap-responsive.min.css', array('version'
=> 'auto', 'relative' => true), $attribs);
JHtml::_('stylesheet', 'jui/bootstrap-extended.css',
array('version' => 'auto', 'relative'
=> true), $attribs);
}
// Load Bootstrap RTL CSS
if ($direction === 'rtl')
{
JHtml::_('stylesheet', 'jui/bootstrap-rtl.css',
array('version' => 'auto', 'relative'
=> true), $attribs);
}
}
}
category.php000064400000013047151156051770007107 0ustar00<?php
/**
* @package Joomla.Libraries
* @subpackage HTML
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('JPATH_PLATFORM') or die;
use Joomla\Utilities\ArrayHelper;
/**
* Utility class for categories
*
* @since 1.5
*/
abstract class JHtmlCategory
{
/**
* Cached array of the category items.
*
* @var array
* @since 1.5
*/
protected static $items = array();
/**
* Returns an array of categories for the given extension.
*
* @param string $extension The extension option e.g. com_something.
* @param array $config An array of configuration options. By
default, only
* published and unpublished categories are
returned.
*
* @return array
*
* @since 1.5
*/
public static function options($extension, $config =
array('filter.published' => array(0, 1)))
{
$hash = md5($extension . '.' . serialize($config));
if (!isset(static::$items[$hash]))
{
$config = (array) $config;
$db = JFactory::getDbo();
$user = JFactory::getUser();
$groups = implode(',', $user->getAuthorisedViewLevels());
$query = $db->getQuery(true)
->select('a.id, a.title, a.level, a.language')
->from('#__categories AS a')
->where('a.parent_id > 0');
// Filter on extension.
$query->where('extension = ' . $db->quote($extension));
// Filter on user access level
$query->where('a.access IN (' . $groups . ')');
// Filter on the published state
if (isset($config['filter.published']))
{
if (is_numeric($config['filter.published']))
{
$query->where('a.published = ' . (int)
$config['filter.published']);
}
elseif (is_array($config['filter.published']))
{
$config['filter.published'] =
ArrayHelper::toInteger($config['filter.published']);
$query->where('a.published IN (' . implode(',',
$config['filter.published']) . ')');
}
}
// Filter on the language
if (isset($config['filter.language']))
{
if (is_string($config['filter.language']))
{
$query->where('a.language = ' .
$db->quote($config['filter.language']));
}
elseif (is_array($config['filter.language']))
{
foreach ($config['filter.language'] as &$language)
{
$language = $db->quote($language);
}
$query->where('a.language IN (' . implode(',',
$config['filter.language']) . ')');
}
}
// Filter on the access
if (isset($config['filter.access']))
{
if (is_string($config['filter.access']))
{
$query->where('a.access = ' .
$db->quote($config['filter.access']));
}
elseif (is_array($config['filter.access']))
{
foreach ($config['filter.access'] as &$access)
{
$access = $db->quote($access);
}
$query->where('a.access IN (' . implode(',',
$config['filter.access']) . ')');
}
}
$query->order('a.lft');
$db->setQuery($query);
$items = $db->loadObjectList();
// Assemble the list options.
static::$items[$hash] = array();
foreach ($items as &$item)
{
$repeat = ($item->level - 1 >= 0) ? $item->level - 1 : 0;
$item->title = str_repeat('- ', $repeat) .
$item->title;
if ($item->language !== '*')
{
$item->title .= ' (' . $item->language .
')';
}
static::$items[$hash][] = JHtml::_('select.option',
$item->id, $item->title);
}
}
return static::$items[$hash];
}
/**
* Returns an array of categories for the given extension.
*
* @param string $extension The extension option.
* @param array $config An array of configuration options. By
default, only published and unpublished categories are returned.
*
* @return array Categories for the extension
*
* @since 1.6
*/
public static function categories($extension, $config =
array('filter.published' => array(0, 1)))
{
$hash = md5($extension . '.' . serialize($config));
if (!isset(static::$items[$hash]))
{
$config = (array) $config;
$user = JFactory::getUser();
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select('a.id, a.title, a.level, a.parent_id,
a.language')
->from('#__categories AS a')
->where('a.parent_id > 0');
// Filter on extension.
$query->where('extension = ' . $db->quote($extension));
// Filter on user level.
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
// Filter on the published state
if (isset($config['filter.published']))
{
if (is_numeric($config['filter.published']))
{
$query->where('a.published = ' . (int)
$config['filter.published']);
}
elseif (is_array($config['filter.published']))
{
$config['filter.published'] =
ArrayHelper::toInteger($config['filter.published']);
$query->where('a.published IN (' . implode(',',
$config['filter.published']) . ')');
}
}
$query->order('a.lft');
$db->setQuery($query);
$items = $db->loadObjectList();
// Assemble the list options.
static::$items[$hash] = array();
foreach ($items as &$item)
{
$repeat = ($item->level - 1 >= 0) ? $item->level - 1 : 0;
$item->title = str_repeat('- ', $repeat) .
$item->title;
if ($item->language !== '*')
{
$item->title .= ' (' . $item->language .
')';
}
static::$items[$hash][] = JHtml::_('select.option',
$item->id, $item->title);
}
// Special "Add to root" option:
static::$items[$hash][] = JHtml::_('select.option',
'1', JText::_('JLIB_HTML_ADD_TO_ROOT'));
}
return static::$items[$hash];
}
}
content.php000064400000003675151156051770006752 0ustar00<?php
/**
* @package Joomla.Libraries
* @subpackage HTML
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('JPATH_PLATFORM') or die;
/**
* Utility class to fire onContentPrepare for non-article based content.
*
* @since 1.5
*/
abstract class JHtmlContent
{
/**
* Fire onContentPrepare for content that isn't part of an article.
*
* @param string $text The content to be transformed.
* @param array $params The content params.
* @param string $context The context of the content to be
transformed.
*
* @return string The content after transformation.
*
* @since 1.5
*/
public static function prepare($text, $params = null, $context =
'text')
{
if ($params === null)
{
$params = new JObject;
}
$article = new stdClass;
$article->text = $text;
JPluginHelper::importPlugin('content');
$dispatcher = JEventDispatcher::getInstance();
$dispatcher->trigger('onContentPrepare', array($context,
&$article, &$params, 0));
return $article->text;
}
/**
* Returns an array of months.
*
* @param Registry $state The state object.
*
* @return array
*
* @since 3.9.0
*/
public static function months($state)
{
$model = JModelLegacy::getInstance('Articles',
'ContentModel', array('ignore_request' => true));
foreach ($state as $key => $value)
{
$model->setState($key, $value);
}
$model->setState('filter.category_id',
$state->get('category.id'));
$model->setState('list.start', 0);
$model->setState('list.limit', -1);
$model->setState('list.direction', 'asc');
$model->setState('list.filter', '');
$items = array();
foreach ($model->countItemsByMonth() as $item)
{
$date = new JDate($item->d);
$items[] = JHtml::_('select.option', $item->d,
$date->format('F Y') . ' [' . $item->c .
']');
}
return $items;
}
}
contentlanguage.php000064400000003047151156051770010447 0ustar00<?php
/**
* @package Joomla.Libraries
* @subpackage HTML
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('JPATH_PLATFORM') or die;
/**
* Utility class working with content language select lists
*
* @since 1.6
*/
abstract class JHtmlContentLanguage
{
/**
* Cached array of the content language items.
*
* @var array
* @since 1.6
*/
protected static $items = null;
/**
* Get a list of the available content language items.
*
* @param boolean $all True to include All (*)
* @param boolean $translate True to translate All
*
* @return string
*
* @see JFormFieldContentLanguage
* @since 1.6
*/
public static function existing($all = false, $translate = false)
{
if (empty(static::$items))
{
// Get the database object and a new query object.
$db = JFactory::getDbo();
$query = $db->getQuery(true);
// Build the query.
$query->select('a.lang_code AS value, a.title AS text,
a.title_native')
->from('#__languages AS a')
->where('a.published >= 0')
->order('a.title');
// Set the query and load the options.
$db->setQuery($query);
static::$items = $db->loadObjectList();
}
if ($all)
{
$all_option = array(new JObject(array('value' =>
'*', 'text' => $translate ?
JText::alt('JALL', 'language') :
'JALL_LANGUAGE')));
return array_merge($all_option, static::$items);
}
else
{
return static::$items;
}
}
}
date.php000064400000004044151156051770006204 0ustar00<?php
/**
* @package Joomla.Libraries
* @subpackage HTML
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('JPATH_PLATFORM') or die;
/**
* Extended Utility class for handling date display.
*
* @since 2.5
*/
abstract class JHtmlDate
{
/**
* Function to convert a static time into a relative measurement
*
* @param string $date The date to convert
* @param string $unit The optional unit of measurement to return
* if the value of the diff is greater than one
* @param string $time An optional time to compare to, defaults to
now
* @param string $format An optional format for the JHtml::date output
*
* @return string The converted time string
*
* @since 2.5
*/
public static function relative($date, $unit = null, $time = null, $format
= null)
{
if ($time === null)
{
// Get now
$time = new JDate('now');
}
// Get the difference in seconds between now and the time
$diff = strtotime($time) - strtotime($date);
// Less than a minute
if ($diff < 60)
{
return JText::_('JLIB_HTML_DATE_RELATIVE_LESSTHANAMINUTE');
}
// Round to minutes
$diff = round($diff / 60);
// 1 to 59 minutes
if ($diff < 60 || $unit === 'minute')
{
return JText::plural('JLIB_HTML_DATE_RELATIVE_MINUTES',
$diff);
}
// Round to hours
$diff = round($diff / 60);
// 1 to 23 hours
if ($diff < 24 || $unit === 'hour')
{
return JText::plural('JLIB_HTML_DATE_RELATIVE_HOURS', $diff);
}
// Round to days
$diff = round($diff / 24);
// 1 to 6 days
if ($diff < 7 || $unit === 'day')
{
return JText::plural('JLIB_HTML_DATE_RELATIVE_DAYS', $diff);
}
// Round to weeks
$diff = round($diff / 7);
// 1 to 4 weeks
if ($diff <= 4 || $unit === 'week')
{
return JText::plural('JLIB_HTML_DATE_RELATIVE_WEEKS', $diff);
}
// Over a month, return the absolute time
return JHtml::_('date', $date, $format);
}
}
debug.php000064400000002710151156051770006353 0ustar00<?php
/**
* @package Joomla.Libraries
* @subpackage HTML
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('JPATH_PLATFORM') or die;
/**
* Extended Utility class for render debug information.
*
* @since 3.7.0
*/
abstract class JHtmlDebug
{
/**
* xdebug.file_link_format from the php.ini.
*
* Make this property public to support test.
*
* @var string
*
* @since 3.7.0
*/
public static $xdebugLinkFormat;
/**
* Replaces the Joomla! root with "JROOT" to improve
readability.
* Formats a link with a special value xdebug.file_link_format
* from the php.ini file.
*
* @param string $file The full path to the file.
* @param string $line The line number.
*
* @return string
*
* @throws \InvalidArgumentException
*
* @since 3.7.0
*/
public static function xdebuglink($file, $line = '')
{
if (static::$xdebugLinkFormat === null)
{
static::$xdebugLinkFormat =
ini_get('xdebug.file_link_format');
}
$link = str_replace(JPATH_ROOT, 'JROOT', JPath::clean($file));
$link .= $line ? ':' . $line : '';
if (static::$xdebugLinkFormat)
{
$href = static::$xdebugLinkFormat;
$href = str_replace('%f', $file, $href);
$href = str_replace('%l', $line, $href);
$html = JHtml::_('link', $href, $link);
}
else
{
$html = $link;
}
return $html;
}
}
dropdown.php000064400000021451151156051770007124 0ustar00<?php
/**
* @package Joomla.Libraries
* @subpackage HTML
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('JPATH_PLATFORM') or die;
/**
* HTML utility class for building a dropdown menu
*
* @since 3.0
*/
abstract class JHtmlDropdown
{
/**
* @var array Array containing information for loaded files
* @since 3.0
*/
protected static $loaded = array();
/**
* @var string HTML markup for the dropdown list
* @since 3.0
*/
protected static $dropDownList = null;
/**
* Method to inject needed script
*
* @return void
*
* @since 3.0
*/
public static function init()
{
// Only load once
if (isset(static::$loaded[__METHOD__]))
{
return;
}
// Depends on Bootstrap
JHtml::_('bootstrap.framework');
JFactory::getDocument()->addScriptDeclaration("
(function($){
$(document).ready(function (){
$('.has-context')
.mouseenter(function (){
$('.btn-group',$(this)).show();
})
.mouseleave(function (){
$('.btn-group',$(this)).hide();
$('.btn-group',$(this)).removeClass('open');
});
contextAction =function (cbId, task)
{
$('input[name=\"cid[]\"]').removeAttr('checked');
$('#' +
cbId).attr('checked','checked');
Joomla.submitbutton(task);
}
});
})(jQuery);
"
);
// Set static array
static::$loaded[__METHOD__] = true;
return;
}
/**
* Method to start a new dropdown menu
*
* @return void
*
* @since 3.0
*/
public static function start()
{
// Only start once
if (isset(static::$loaded[__METHOD__]) &&
static::$loaded[__METHOD__] == true)
{
return;
}
$dropDownList = '<div class="btn-group"
style="margin-left:6px;display:none">
<a href="#" data-toggle="dropdown"
class="dropdown-toggle btn btn-mini">
<span class="caret"></span>
</a>
<ul class="dropdown-menu">';
static::$dropDownList = $dropDownList;
static::$loaded[__METHOD__] = true;
return;
}
/**
* Method to render current dropdown menu
*
* @return string HTML markup for the dropdown list
*
* @since 3.0
*/
public static function render()
{
$dropDownList = static::$dropDownList;
$dropDownList .= '</ul></div>';
static::$dropDownList = null;
static::$loaded['JHtmlDropdown::start'] = false;
return $dropDownList;
}
/**
* Append an edit item to the current dropdown menu
*
* @param integer $id Record ID
* @param string $prefix Task prefix
* @param string $customLink The custom link if dont use default
Joomla action format
*
* @return void
*
* @since 3.0
*/
public static function edit($id, $prefix = '', $customLink =
'')
{
static::start();
if (!$customLink)
{
$option =
JFactory::getApplication()->input->getCmd('option');
$link = 'index.php?option=' . $option;
}
else
{
$link = $customLink;
}
$link .= '&task=' . $prefix . 'edit&id=' .
$id;
$link = JRoute::_($link);
static::addCustomItem(JText::_('JACTION_EDIT'), $link);
return;
}
/**
* Append a publish item to the current dropdown menu
*
* @param string $checkboxId ID of corresponding checkbox of the
record
* @param string $prefix The task prefix
*
* @return void
*
* @since 3.0
*/
public static function publish($checkboxId, $prefix = '')
{
$task = $prefix . 'publish';
static::addCustomItem(JText::_('JTOOLBAR_PUBLISH'),
'javascript:void(0)',
'onclick="contextAction(\'' . $checkboxId .
'\', \'' . $task . '\')"');
return;
}
/**
* Append an unpublish item to the current dropdown menu
*
* @param string $checkboxId ID of corresponding checkbox of the
record
* @param string $prefix The task prefix
*
* @return void
*
* @since 3.0
*/
public static function unpublish($checkboxId, $prefix = '')
{
$task = $prefix . 'unpublish';
static::addCustomItem(JText::_('JTOOLBAR_UNPUBLISH'),
'javascript:void(0)',
'onclick="contextAction(\'' . $checkboxId .
'\', \'' . $task . '\')"');
return;
}
/**
* Append a featured item to the current dropdown menu
*
* @param string $checkboxId ID of corresponding checkbox of the
record
* @param string $prefix The task prefix
*
* @return void
*
* @since 3.0
*/
public static function featured($checkboxId, $prefix = '')
{
$task = $prefix . 'featured';
static::addCustomItem(JText::_('JFEATURED'),
'javascript:void(0)',
'onclick="contextAction(\'' . $checkboxId .
'\', \'' . $task . '\')"');
return;
}
/**
* Append an unfeatured item to the current dropdown menu
*
* @param string $checkboxId ID of corresponding checkbox of the
record
* @param string $prefix The task prefix
*
* @return void
*
* @since 3.0
*/
public static function unfeatured($checkboxId, $prefix = '')
{
$task = $prefix . 'unfeatured';
static::addCustomItem(JText::_('JUNFEATURED'),
'javascript:void(0)',
'onclick="contextAction(\'' . $checkboxId .
'\', \'' . $task . '\')"');
return;
}
/**
* Append an archive item to the current dropdown menu
*
* @param string $checkboxId ID of corresponding checkbox of the
record
* @param string $prefix The task prefix
*
* @return void
*
* @since 3.0
*/
public static function archive($checkboxId, $prefix = '')
{
$task = $prefix . 'archive';
static::addCustomItem(JText::_('JTOOLBAR_ARCHIVE'),
'javascript:void(0)',
'onclick="contextAction(\'' . $checkboxId .
'\', \'' . $task . '\')"');
return;
}
/**
* Append an unarchive item to the current dropdown menu
*
* @param string $checkboxId ID of corresponding checkbox of the
record
* @param string $prefix The task prefix
*
* @return void
*
* @since 3.0
*/
public static function unarchive($checkboxId, $prefix = '')
{
$task = $prefix . 'unpublish';
static::addCustomItem(JText::_('JTOOLBAR_UNARCHIVE'),
'javascript:void(0)',
'onclick="contextAction(\'' . $checkboxId .
'\', \'' . $task . '\')"');
return;
}
/**
* Append a trash item to the current dropdown menu
*
* @param string $checkboxId ID of corresponding checkbox of the
record
* @param string $prefix The task prefix
*
* @return void
*
* @since 3.0
*/
public static function trash($checkboxId, $prefix = '')
{
$task = $prefix . 'trash';
static::addCustomItem(JText::_('JTOOLBAR_TRASH'),
'javascript:void(0)',
'onclick="contextAction(\'' . $checkboxId .
'\', \'' . $task . '\')"');
return;
}
/**
* Append an untrash item to the current dropdown menu
*
* @param string $checkboxId ID of corresponding checkbox of the
record
* @param string $prefix The task prefix
*
* @return void
*
* @since 3.0
*/
public static function untrash($checkboxId, $prefix = '')
{
$task = $prefix . 'publish';
static::addCustomItem(JText::_('JTOOLBAR_UNTRASH'),
'javascript:void(0)',
'onclick="contextAction(\'' . $checkboxId .
'\', \'' . $task . '\')"');
return;
}
/**
* Append a checkin item to the current dropdown menu
*
* @param string $checkboxId ID of corresponding checkbox of the
record
* @param string $prefix The task prefix
*
* @return void
*
* @since 3.0
*/
public static function checkin($checkboxId, $prefix = '')
{
$task = $prefix . 'checkin';
static::addCustomItem(JText::_('JTOOLBAR_CHECKIN'),
'javascript:void(0)',
'onclick="contextAction(\'' . $checkboxId .
'\', \'' . $task . '\')"');
return;
}
/**
* Writes a divider between dropdown items
*
* @return void
*
* @since 3.0
*/
public static function divider()
{
static::$dropDownList .= '<li
class="divider"></li>';
return;
}
/**
* Append a custom item to current dropdown menu
*
* @param string $label The label of item
* @param string $link The link of item
* @param string $linkAttributes Custom link attributes
* @param string $className Class name of item
* @param boolean $ajaxLoad True if using ajax load when item
clicked
* @param string $jsCallBackFunc Javascript function name, called
when ajax load successfully
*
* @return void
*
* @since 3.0
*/
public static function addCustomItem($label, $link =
'javascript:void(0)', $linkAttributes = '', $className
= '', $ajaxLoad = false,
$jsCallBackFunc = null)
{
static::start();
if ($ajaxLoad)
{
$href = ' href = "javascript:void(0)"
onclick="loadAjax(\'' . $link . '\', \''
. $jsCallBackFunc . '\')"';
}
else
{
$href = ' href = "' . $link . '" ';
}
$dropDownList = static::$dropDownList;
$dropDownList .= '<li class="' . $className .
'"><a ' . $linkAttributes . $href . ' >';
$dropDownList .= $label;
$dropDownList .= '</a></li>';
static::$dropDownList = $dropDownList;
return;
}
}
email.php000064400000007244151156051770006363 0ustar00<?php
/**
* @package Joomla.Libraries
* @subpackage HTML
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('JPATH_PLATFORM') or die;
/**
* Utility class for cloaking email addresses
*
* @since 1.5
*/
abstract class JHtmlEmail
{
/**
* Simple JavaScript email cloaker
*
* By default replaces an email with a mailto link with email cloaked
*
* @param string $mail The -mail address to cloak.
* @param boolean $mailto True if text and mailing address differ
* @param string $text Text for the link
* @param boolean $email True if text is an email address
*
* @return string The cloaked email.
*
* @since 1.5
*/
public static function cloak($mail, $mailto = true, $text = '',
$email = true)
{
// Handle IDN addresses: punycode for href but utf-8 for text displayed.
if ($mailto && (empty($text) || $email))
{
// Use dedicated $text whereas $mail is used as href and must be
punycoded.
$text = JStringPunycode::emailToUTF8($text ?: $mail);
}
elseif (!$mailto)
{
// In that case we don't use link - so convert $mail back to utf-8.
$mail = JStringPunycode::emailToUTF8($mail);
}
// Convert mail
$mail = static::convertEncoding($mail);
// Random hash
$rand = md5($mail . mt_rand(1, 100000));
// Split email by @ symbol
$mail = explode('@', $mail);
$mail_parts = explode('.', $mail[1]);
if ($mailto)
{
// Special handling when mail text is different from mail address
if ($text)
{
// Convert text - here is the right place
$text = static::convertEncoding($text);
if ($email)
{
// Split email by @ symbol
$text = explode('@', $text);
$text_parts = explode('.', $text[1]);
$tmpScript = "var addy_text" . $rand . " = '"
. @$text[0] . "' + '@' + '" .
implode("' + '.' + '", @$text_parts)
. "';";
}
else
{
$tmpScript = "var addy_text" . $rand . " = '"
. $text . "';";
}
$tmpScript .= "document.getElementById('cloak" . $rand .
"').innerHTML += '<a ' + path + '\''
+ prefix + ':' + addy"
. $rand . " + '\'>'+addy_text" . $rand .
"+'<\/a>';";
}
else
{
$tmpScript = "document.getElementById('cloak" . $rand .
"').innerHTML += '<a ' + path + '\''
+ prefix + ':' + addy"
. $rand . " + '\'>' +addy" . $rand .
"+'<\/a>';";
}
}
else
{
$tmpScript = "document.getElementById('cloak" . $rand .
"').innerHTML += addy" . $rand . ";";
}
$script = "
document.getElementById('cloak" . $rand .
"').innerHTML = '';
var prefix = 'ma' + 'il' +
'to';
var path = 'hr' + 'ef' + '=';
var addy" . $rand . " = '" . @$mail[0] .
"' + '@';
addy" . $rand . " = addy" . $rand . " +
'" . implode("' + '.' + '",
$mail_parts) . "';
$tmpScript
";
// TODO: Use inline script for now
$inlineScript = "<script
type='text/javascript'>" . $script .
"</script>";
return '<span id="cloak' . $rand .
'">' . JText::_('JLIB_HTML_CLOAKING') .
'</span>' . $inlineScript;
}
/**
* Convert encoded text
*
* @param string $text Text to convert
*
* @return string The converted text.
*
* @since 1.5
*/
protected static function convertEncoding($text)
{
$text = html_entity_decode($text);
// Replace vowels with character encoding
$text = str_replace('a', 'a', $text);
$text = str_replace('e', 'e', $text);
$text = str_replace('i', 'i', $text);
$text = str_replace('o', 'o', $text);
$text = str_replace('u', 'u', $text);
$text = htmlentities($text, ENT_QUOTES, 'UTF-8', false);
return $text;
}
}
form.php000064400000003302151156051770006226 0ustar00<?php
/**
* @package Joomla.Libraries
* @subpackage HTML
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('JPATH_PLATFORM') or die;
use Joomla\Utilities\ArrayHelper;
/**
* Utility class for form elements
*
* @since 1.5
*/
abstract class JHtmlForm
{
/**
* Array containing information for loaded files.
*
* @var array
*
* @since 3.8.0
*/
protected static $loaded = array();
/**
* Displays a hidden token field to reduce the risk of CSRF exploits
*
* Use in conjunction with JSession::checkToken()
*
* @param array $attribs Input element attributes.
*
* @return string A hidden input field with a token
*
* @see JSession::checkToken()
* @since 1.5
*/
public static function token(array $attribs = array())
{
$attributes = '';
if ($attribs !== array())
{
$attributes .= ' ' . ArrayHelper::toString($attribs);
}
return '<input type="hidden" name="' .
JSession::getFormToken() . '" value="1"' .
$attributes . ' />';
}
/**
* Add CSRF form token to Joomla script options that developers can get it
by Javascript.
*
* @param string $name The script option key name.
*
* @return void
*
* @since 3.8.0
*/
public static function csrf($name = 'csrf.token')
{
if (isset(static::$loaded[__METHOD__][$name]))
{
return;
}
/** @var JDocumentHtml $doc */
$doc = JFactory::getDocument();
if (!$doc instanceof JDocumentHtml || $doc->getType() !==
'html')
{
return;
}
$doc->addScriptOptions($name, JSession::getFormToken());
static::$loaded[__METHOD__][$name] = true;
}
}
formbehavior.php000064400000007415151156051770007757 0ustar00<?php
/**
* @package Joomla.Libraries
* @subpackage HTML
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('JPATH_PLATFORM') or die;
use Joomla\Registry\Registry;
/**
* Utility class for form related behaviors
*
* @since 3.0
*/
abstract class JHtmlFormbehavior
{
/**
* @var array Array containing information for loaded files
* @since 3.0
*/
protected static $loaded = array();
/**
* Method to load the Chosen JavaScript framework and supporting CSS into
the document head
*
* If debugging mode is on an uncompressed version of Chosen is included
for easier debugging.
*
* @param string $selector Class for Chosen elements.
* @param mixed $debug Is debugging mode on? [optional]
* @param array $options the possible Chosen options as name =>
value [optional]
*
* @return void
*
* @since 3.0
*/
public static function chosen($selector = '.advancedSelect',
$debug = null, $options = array())
{
if (isset(static::$loaded[__METHOD__][$selector]))
{
return;
}
// If no debugging value is set, use the configuration setting
if ($debug === null)
{
$debug = JDEBUG;
}
// Default settings
if (!isset($options['disable_search_threshold']))
{
$options['disable_search_threshold'] = 10;
}
// Allow searching contains space in query
if (!isset($options['search_contains']))
{
$options['search_contains'] = true;
}
if (!isset($options['allow_single_deselect']))
{
$options['allow_single_deselect'] = true;
}
if (!isset($options['placeholder_text_multiple']))
{
$options['placeholder_text_multiple'] =
JText::_('JGLOBAL_TYPE_OR_SELECT_SOME_OPTIONS');
}
if (!isset($options['placeholder_text_single']))
{
$options['placeholder_text_single'] =
JText::_('JGLOBAL_SELECT_AN_OPTION');
}
if (!isset($options['no_results_text']))
{
$options['no_results_text'] =
JText::_('JGLOBAL_SELECT_NO_RESULTS_MATCH');
}
$displayData = array(
'debug' => $debug,
'options' => $options,
'selector' => $selector,
);
JLayoutHelper::render('joomla.html.formbehavior.chosen',
$displayData);
static::$loaded[__METHOD__][$selector] = true;
return;
}
/**
* Method to load the AJAX Chosen library
*
* If debugging mode is on an uncompressed version of AJAX Chosen is
included for easier debugging.
*
* @param Registry $options Options in a Registry object
* @param mixed $debug Is debugging mode on? [optional]
*
* @return void
*
* @since 3.0
*/
public static function ajaxchosen(Registry $options, $debug = null)
{
// Retrieve options/defaults
$selector = $options->get('selector',
'.tagfield');
$type = $options->get('type', 'GET');
$url = $options->get('url', null);
$dataType = $options->get('dataType',
'json');
$jsonTermKey = $options->get('jsonTermKey',
'term');
$afterTypeDelay = $options->get('afterTypeDelay',
'500');
$minTermLength = $options->get('minTermLength',
'3');
// Ajax URL is mandatory
if (!empty($url))
{
if (isset(static::$loaded[__METHOD__][$selector]))
{
return;
}
// Requires chosen to work
static::chosen($selector, $debug);
$displayData = array(
'url' => $url,
'debug' => $debug,
'options' => $options,
'selector' => $selector,
'type' => $type,
'dataType' => $dataType,
'jsonTermKey' => $jsonTermKey,
'afterTypeDelay' => $afterTypeDelay,
'minTermLength' => $minTermLength,
);
JLayoutHelper::render('joomla.html.formbehavior.ajaxchosen',
$displayData);
static::$loaded[__METHOD__][$selector] = true;
}
return;
}
}
grid.php000064400000024501151156051770006214 0ustar00<?php
/**
* @package Joomla.Libraries
* @subpackage HTML
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('JPATH_PLATFORM') or die;
/**
* Utility class for creating HTML Grids
*
* @since 1.5
*/
abstract class JHtmlGrid
{
/**
* Display a boolean setting widget.
*
* @param integer $i The row index.
* @param integer $value The value of the boolean field.
* @param string $taskOn Task to turn the boolean setting on.
* @param string $taskOff Task to turn the boolean setting off.
*
* @return string The boolean setting widget.
*
* @since 1.6
*
* @deprecated 4.0 This is only used in hathor and will be removed
without replacement
*/
public static function boolean($i, $value, $taskOn = null, $taskOff =
null)
{
// Load the behavior.
static::behavior();
JHtml::_('bootstrap.tooltip');
// Build the title.
$title = $value ? JText::_('JYES') : JText::_('JNO');
$title = JHtml::_('tooltipText', $title,
JText::_('JGLOBAL_CLICK_TO_TOGGLE_STATE'), 0);
// Build the <a> tag.
$bool = $value ? 'true' : 'false';
$task = $value ? $taskOff : $taskOn;
$toggle = (!$task) ? false : true;
if ($toggle)
{
return '<a class="grid_' . $bool . '
hasTooltip" title="' . $title . '"
rel="{id:\'cb' . $i . '\', task:\'' .
$task
. '\'}" href="#toggle"></a>';
}
else
{
return '<a class="grid_' . $bool .
'"></a>';
}
}
/**
* Method to sort a column in a grid
*
* @param string $title The link title
* @param string $order The order field for the column
* @param string $direction The current direction
* @param string $selected The selected ordering
* @param string $task An optional task override
* @param string $newDirection An optional direction for the new
column
* @param string $tip An optional text shown as tooltip title
instead of $title
* @param string $form An optional form selector
*
* @return string
*
* @since 1.5
*/
public static function sort($title, $order, $direction = 'asc',
$selected = '', $task = null, $newDirection = 'asc',
$tip = '', $form = null)
{
JHtml::_('behavior.core');
JHtml::_('bootstrap.popover');
$direction = strtolower($direction);
$icon = array('arrow-up-3', 'arrow-down-3');
$index = (int) ($direction === 'desc');
if ($order != $selected)
{
$direction = $newDirection;
}
else
{
$direction = $direction === 'desc' ? 'asc' :
'desc';
}
if ($form)
{
$form = ', document.getElementById(\'' . $form .
'\')';
}
$html = '<a href="#"
onclick="Joomla.tableOrdering(\'' . $order .
'\',\'' . $direction . '\',\'' .
$task . '\'' . $form . ');return false;"'
. ' class="hasPopover" title="' .
htmlspecialchars(JText::_($tip ?: $title)) . '"'
. ' data-content="' .
htmlspecialchars(JText::_('JGLOBAL_CLICK_TO_SORT_THIS_COLUMN')) .
'" data-placement="top">';
if (isset($title['0']) && $title['0'] ===
'<')
{
$html .= $title;
}
else
{
$html .= JText::_($title);
}
if ($order == $selected)
{
$html .= '<span class="icon-' . $icon[$index] .
'"></span>';
}
$html .= '</a>';
return $html;
}
/**
* Method to check all checkboxes in a grid
*
* @param string $name The name of the form element
* @param string $tip The text shown as tooltip title instead of
$tip
* @param string $action The action to perform on clicking the
checkbox
*
* @return string
*
* @since 3.1.2
*/
public static function checkall($name = 'checkall-toggle', $tip
= 'JGLOBAL_CHECK_ALL', $action =
'Joomla.checkAll(this)')
{
JHtml::_('behavior.core');
JHtml::_('bootstrap.tooltip');
return '<input type="checkbox" name="' .
$name . '" value="" class="hasTooltip"
title="' . JHtml::_('tooltipText', $tip)
. '" onclick="' . $action . '"
/>';
}
/**
* Method to create a checkbox for a grid row.
*
* @param integer $rowNum The row index
* @param integer $recId The record id
* @param boolean $checkedOut True if item is checked out
* @param string $name The name of the form element
* @param string $stub The name of stub identifier
*
* @return mixed String of html with a checkbox if item is not checked
out, null if checked out.
*
* @since 1.5
*/
public static function id($rowNum, $recId, $checkedOut = false, $name =
'cid', $stub = 'cb')
{
return $checkedOut ? '' : '<input
type="checkbox" id="' . $stub . $rowNum . '"
name="' . $name . '[]" value="' . $recId
. '" onclick="Joomla.isChecked(this.checked);"
/>';
}
/**
* Displays a checked out icon.
*
* @param object &$row A data object (must contain
checkedout as a property).
* @param integer $i The index of the row.
* @param string $identifier The property name of the primary key or
index of the row.
*
* @return string
*
* @since 1.5
*/
public static function checkedOut(&$row, $i, $identifier =
'id')
{
$user = JFactory::getUser();
$userid = $user->get('id');
if ($row instanceof JTable)
{
$result = $row->isCheckedOut($userid);
}
else
{
$result = false;
}
if ($result)
{
return static::_checkedOut($row);
}
else
{
if ($identifier === 'id')
{
return JHtml::_('grid.id', $i, $row->$identifier);
}
else
{
return JHtml::_('grid.id', $i, $row->$identifier, $result,
$identifier);
}
}
}
/**
* Method to create a clickable icon to change the state of an item
*
* @param mixed $value Either the scalar value or an object (for
backward compatibility, deprecated)
* @param integer $i The index
* @param string $img1 Image for a positive or on value
* @param string $img0 Image for the empty or off value
* @param string $prefix An optional prefix for the task
*
* @return string
*
* @since 1.5
*/
public static function published($value, $i, $img1 = 'tick.png',
$img0 = 'publish_x.png', $prefix = '')
{
if (is_object($value))
{
$value = $value->published;
}
$img = $value ? $img1 : $img0;
$task = $value ? 'unpublish' : 'publish';
$alt = $value ? JText::_('JPUBLISHED') :
JText::_('JUNPUBLISHED');
$action = $value ? JText::_('JLIB_HTML_UNPUBLISH_ITEM') :
JText::_('JLIB_HTML_PUBLISH_ITEM');
return '<a href="#" onclick="return
listItemTask(\'cb' . $i . '\',\'' . $prefix .
$task . '\')" title="' . $action .
'">'
. JHtml::_('image', 'admin/' . $img, $alt, null,
true) . '</a>';
}
/**
* Method to create a select list of states for filtering
* By default the filter shows only published and unpublished items
*
* @param string $filterState The initial filter state
* @param string $published The JText string for published
* @param string $unpublished The JText string for Unpublished
* @param string $archived The JText string for Archived
* @param string $trashed The JText string for Trashed
*
* @return string
*
* @since 1.5
*/
public static function state($filterState = '*', $published =
'JPUBLISHED', $unpublished = 'JUNPUBLISHED', $archived
= null, $trashed = null)
{
$state = array('' => '- ' .
JText::_('JLIB_HTML_SELECT_STATE') . ' -',
'P' => JText::_($published), 'U' =>
JText::_($unpublished));
if ($archived)
{
$state['A'] = JText::_($archived);
}
if ($trashed)
{
$state['T'] = JText::_($trashed);
}
return JHtml::_(
'select.genericlist',
$state,
'filter_state',
array(
'list.attr' => 'class="inputbox"
size="1" onchange="Joomla.submitform();"',
'list.select' => $filterState,
'option.key' => null,
)
);
}
/**
* Method to create an icon for saving a new ordering in a grid
*
* @param array $rows The array of rows of rows
* @param string $image The image [UNUSED]
* @param string $task The task to use, defaults to save order
*
* @return string
*
* @since 1.5
*/
public static function order($rows, $image = 'filesave.png',
$task = 'saveorder')
{
return '<a href="javascript:saveorder('
. (count($rows) - 1) . ', \'' . $task .
'\')" rel="tooltip" class="saveorder btn
btn-micro pull-right" title="'
. JText::_('JLIB_HTML_SAVE_ORDER') . '"><span
class="icon-menu-2"></span></a>';
}
/**
* Method to create a checked out icon with optional overlib in a grid.
*
* @param object &$row The row object
* @param boolean $overlib True if an overlib with checkout
information should be created.
*
* @return string HTMl for the icon and overlib
*
* @since 1.5
*/
protected static function _checkedOut(&$row, $overlib = true)
{
$hover = '';
if ($overlib)
{
JHtml::_('bootstrap.tooltip');
$date = JHtml::_('date', $row->checked_out_time,
JText::_('DATE_FORMAT_LC1'));
$time = JHtml::_('date', $row->checked_out_time,
'H:i');
$hover = '<span class="editlinktip hasTooltip"
title="' . JHtml::_('tooltipText',
'JLIB_HTML_CHECKED_OUT', $row->editor)
. '<br />' . $date . '<br />' . $time .
'">';
}
return $hover . JHtml::_('image',
'admin/checked_out.png', null, null, true) .
'</span>';
}
/**
* Method to build the behavior script and add it to the document head.
*
* @return void
*
* @since 1.6
*
* @deprecated 4.0 This is only used in hathor and will be removed
without replacement
*/
public static function behavior()
{
static $loaded;
if (!$loaded)
{
// Include jQuery
JHtml::_('jquery.framework');
// Build the behavior script.
$js = '
jQuery(function($){
$actions = $(\'a.move_up, a.move_down, a.grid_true, a.grid_false,
a.grid_trash\');
$actions.each(function(){
$(this).on(\'click\', function(){
args = JSON.decode(this.rel);
listItemTask(args.id, args.task);
});
});
$(\'input.check-all-toggle\').each(function(){
$(this).on(\'click\', function(){
if (this.checked) {
$(this).closest(\'form\').find(\'input[type="checkbox"]\').each(function(){
this.checked = true;
})
}
else {
$(this).closest(\'form\').find(\'input[type="checkbox"]\').each(function(){
this.checked = false;
})
}
});
});
});';
// Add the behavior to the document head.
$document = JFactory::getDocument();
$document->addScriptDeclaration($js);
$loaded = true;
}
}
}
icons.php000064400000003026151156052000006364 0ustar00<?php
/**
* @package Joomla.Libraries
* @subpackage HTML
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('JPATH_PLATFORM') or die;
/**
* Utility class for icons.
*
* @since 2.5
*/
abstract class JHtmlIcons
{
/**
* Method to generate html code for a list of buttons
*
* @param array $buttons Array of buttons
*
* @return string
*
* @since 2.5
*/
public static function buttons($buttons)
{
$html = array();
foreach ($buttons as $button)
{
$html[] = JHtml::_('icons.button', $button);
}
return implode($html);
}
/**
* Method to generate html code for a list of buttons
*
* @param array $button Button properties
*
* @return string
*
* @since 2.5
*/
public static function button($button)
{
if (isset($button['access']))
{
if (is_bool($button['access']))
{
if ($button['access'] == false)
{
return '';
}
}
else
{
// Get the user object to verify permissions
$user = JFactory::getUser();
// Take each pair of permission, context values.
for ($i = 0, $n = count($button['access']); $i < $n; $i +=
2)
{
if (!$user->authorise($button['access'][$i],
$button['access'][$i + 1]))
{
return '';
}
}
}
}
// Instantiate a new JLayoutFile instance and render the layout
$layout = new JLayoutFile('joomla.quickicons.icon');
return $layout->render($button);
}
}
jgrid.php000064400000040304151156052000006350 0ustar00<?php
/**
* @package Joomla.Libraries
* @subpackage HTML
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('JPATH_PLATFORM') or die;
use Joomla\Utilities\ArrayHelper;
/**
* Utility class for creating HTML Grids
*
* @since 1.6
*/
abstract class JHtmlJGrid
{
/**
* Returns an action on a grid
*
* @param integer $i The row index
* @param string $task The task to fire
* @param string|array $prefix An optional task prefix or an
array of options
* @param string $text An optional text to display
[unused - @deprecated 4.0]
* @param string $activeTitle An optional active tooltip to
display if $enable is true
* @param string $inactiveTitle An optional inactive tooltip to
display if $enable is true
* @param boolean $tip An optional setting for tooltip
* @param string $activeClass An optional active HTML class
* @param string $inactiveClass An optional inactive HTML class
* @param boolean $enabled An optional setting for access
control on the action.
* @param boolean $translate An optional setting for
translation.
* @param string $checkbox An optional prefix for
checkboxes.
*
* @return string The HTML markup
*
* @since 1.6
*/
public static function action($i, $task, $prefix = '', $text =
'', $activeTitle = '', $inactiveTitle = '',
$tip = false, $activeClass = '',
$inactiveClass = '', $enabled = true, $translate = true,
$checkbox = 'cb')
{
if (is_array($prefix))
{
$options = $prefix;
$activeTitle = array_key_exists('active_title', $options) ?
$options['active_title'] : $activeTitle;
$inactiveTitle = array_key_exists('inactive_title', $options)
? $options['inactive_title'] : $inactiveTitle;
$tip = array_key_exists('tip', $options) ?
$options['tip'] : $tip;
$activeClass = array_key_exists('active_class', $options) ?
$options['active_class'] : $activeClass;
$inactiveClass = array_key_exists('inactive_class', $options)
? $options['inactive_class'] : $inactiveClass;
$enabled = array_key_exists('enabled', $options) ?
$options['enabled'] : $enabled;
$translate = array_key_exists('translate', $options) ?
$options['translate'] : $translate;
$checkbox = array_key_exists('checkbox', $options) ?
$options['checkbox'] : $checkbox;
$prefix = array_key_exists('prefix', $options) ?
$options['prefix'] : '';
}
if ($tip)
{
JHtml::_('bootstrap.tooltip');
$title = $enabled ? $activeTitle : $inactiveTitle;
$title = $translate ? JText::_($title) : $title;
$title = JHtml::_('tooltipText', $title, '', 0);
}
if ($enabled)
{
$html[] = '<a class="btn btn-micro' . ($activeClass
=== 'publish' ? ' active' : '') . ($tip ?
' hasTooltip' : '') . '"';
$html[] = ' href="javascript:void(0);"
onclick="return listItemTask(\'' . $checkbox . $i .
'\',\'' . $prefix . $task . '\')"';
$html[] = $tip ? ' title="' . $title . '"'
: '';
$html[] = '>';
$html[] = '<span class="icon-' . $activeClass .
'" aria-hidden="true"></span>';
$html[] = '</a>';
}
else
{
$html[] = '<a class="btn btn-micro disabled jgrid' .
($tip ? ' hasTooltip' : '') . '"';
$html[] = $tip ? ' title="' . $title . '"'
: '';
$html[] = '>';
if ($activeClass === 'protected')
{
$html[] = '<span
class="icon-lock"></span>';
}
else
{
$html[] = '<span class="icon-' . $inactiveClass .
'"></span>';
}
$html[] = '</a>';
}
return implode($html);
}
/**
* Returns a state on a grid
*
* @param array $states array of value/state. Each state is
an array of the form
* (task, text, active title, inactive
title, tip (boolean), HTML active class, HTML inactive class)
* or ('task'=>task,
'text'=>text, 'active_title'=>active title,
*
'inactive_title'=>inactive title, 'tip'=>boolean,
'active_class'=>html active class,
* 'inactive_class'=>html
inactive class)
* @param integer $value The state value.
* @param integer $i The row index
* @param string|array $prefix An optional task prefix or an array
of options
* @param boolean $enabled An optional setting for access
control on the action.
* @param boolean $translate An optional setting for translation.
* @param string $checkbox An optional prefix for checkboxes.
*
* @return string The HTML markup
*
* @since 1.6
*/
public static function state($states, $value, $i, $prefix = '',
$enabled = true, $translate = true, $checkbox = 'cb')
{
if (is_array($prefix))
{
$options = $prefix;
$enabled = array_key_exists('enabled', $options) ?
$options['enabled'] : $enabled;
$translate = array_key_exists('translate', $options) ?
$options['translate'] : $translate;
$checkbox = array_key_exists('checkbox', $options) ?
$options['checkbox'] : $checkbox;
$prefix = array_key_exists('prefix', $options) ?
$options['prefix'] : '';
}
$state = ArrayHelper::getValue($states, (int) $value, $states[0]);
$task = array_key_exists('task', $state) ?
$state['task'] : $state[0];
$text = array_key_exists('text', $state) ?
$state['text'] : (array_key_exists(1, $state) ? $state[1] :
'');
$activeTitle = array_key_exists('active_title', $state) ?
$state['active_title'] : (array_key_exists(2, $state) ? $state[2]
: '');
$inactiveTitle = array_key_exists('inactive_title', $state) ?
$state['inactive_title'] : (array_key_exists(3, $state) ?
$state[3] : '');
$tip = array_key_exists('tip', $state) ?
$state['tip'] : (array_key_exists(4, $state) ? $state[4] :
false);
$activeClass = array_key_exists('active_class', $state) ?
$state['active_class'] : (array_key_exists(5, $state) ? $state[5]
: '');
$inactiveClass = array_key_exists('inactive_class', $state) ?
$state['inactive_class'] : (array_key_exists(6, $state) ?
$state[6] : '');
return static::action(
$i, $task, $prefix, $text, $activeTitle, $inactiveTitle, $tip,
$activeClass, $inactiveClass, $enabled, $translate, $checkbox
);
}
/**
* Returns a published state on a grid
*
* @param integer $value The state value.
* @param integer $i The row index
* @param string|array $prefix An optional task prefix or an
array of options
* @param boolean $enabled An optional setting for access
control on the action.
* @param string $checkbox An optional prefix for checkboxes.
* @param string $publishUp An optional start publishing date.
* @param string $publishDown An optional finish publishing
date.
*
* @return string The HTML markup
*
* @see JHtmlJGrid::state()
* @since 1.6
*/
public static function published($value, $i, $prefix = '',
$enabled = true, $checkbox = 'cb', $publishUp = null,
$publishDown = null)
{
if (is_array($prefix))
{
$options = $prefix;
$enabled = array_key_exists('enabled', $options) ?
$options['enabled'] : $enabled;
$checkbox = array_key_exists('checkbox', $options) ?
$options['checkbox'] : $checkbox;
$prefix = array_key_exists('prefix', $options) ?
$options['prefix'] : '';
}
$states = array(
1 => array('unpublish', 'JPUBLISHED',
'JLIB_HTML_UNPUBLISH_ITEM', 'JPUBLISHED', true,
'publish', 'publish'),
0 => array('publish', 'JUNPUBLISHED',
'JLIB_HTML_PUBLISH_ITEM', 'JUNPUBLISHED', true,
'unpublish', 'unpublish'),
2 => array('unpublish', 'JARCHIVED',
'JLIB_HTML_UNPUBLISH_ITEM', 'JARCHIVED', true,
'archive', 'archive'),
-2 => array('publish', 'JTRASHED',
'JLIB_HTML_PUBLISH_ITEM', 'JTRASHED', true,
'trash', 'trash'),
);
// Special state for dates
if ($publishUp || $publishDown)
{
$nullDate = JFactory::getDbo()->getNullDate();
$nowDate = JFactory::getDate()->toUnix();
$tz = JFactory::getUser()->getTimezone();
$publishUp = ($publishUp != $nullDate) ? JFactory::getDate($publishUp,
'UTC')->setTimeZone($tz) : false;
$publishDown = ($publishDown != $nullDate) ?
JFactory::getDate($publishDown, 'UTC')->setTimeZone($tz) :
false;
// Create tip text, only we have publish up or down settings
$tips = array();
if ($publishUp)
{
$tips[] = JText::sprintf('JLIB_HTML_PUBLISHED_START',
JHtml::_('date', $publishUp,
JText::_('DATE_FORMAT_LC5'), 'UTC'));
}
if ($publishDown)
{
$tips[] = JText::sprintf('JLIB_HTML_PUBLISHED_FINISHED',
JHtml::_('date', $publishDown,
JText::_('DATE_FORMAT_LC5'), 'UTC'));
}
$tip = empty($tips) ? false : implode('<br />', $tips);
// Add tips and special titles
foreach ($states as $key => $state)
{
// Create special titles for published items
if ($key == 1)
{
$states[$key][2] = $states[$key][3] =
'JLIB_HTML_PUBLISHED_ITEM';
if ($publishUp > $nullDate && $nowDate <
$publishUp->toUnix())
{
$states[$key][2] = $states[$key][3] =
'JLIB_HTML_PUBLISHED_PENDING_ITEM';
$states[$key][5] = $states[$key][6] = 'pending';
}
if ($publishDown > $nullDate && $nowDate >
$publishDown->toUnix())
{
$states[$key][2] = $states[$key][3] =
'JLIB_HTML_PUBLISHED_EXPIRED_ITEM';
$states[$key][5] = $states[$key][6] = 'expired';
}
}
// Add tips to titles
if ($tip)
{
$states[$key][1] = JText::_($states[$key][1]);
$states[$key][2] = JText::_($states[$key][2]) . '<br
/>' . $tip;
$states[$key][3] = JText::_($states[$key][3]) . '<br
/>' . $tip;
$states[$key][4] = true;
}
}
return static::state($states, $value, $i, array('prefix' =>
$prefix, 'translate' => !$tip), $enabled, true, $checkbox);
}
return static::state($states, $value, $i, $prefix, $enabled, true,
$checkbox);
}
/**
* Returns an isDefault state on a grid
*
* @param integer $value The state value.
* @param integer $i The row index
* @param string|array $prefix An optional task prefix or an array
of options
* @param boolean $enabled An optional setting for access
control on the action.
* @param string $checkbox An optional prefix for checkboxes.
*
* @return string The HTML markup
*
* @see JHtmlJGrid::state()
* @since 1.6
*/
public static function isdefault($value, $i, $prefix = '',
$enabled = true, $checkbox = 'cb')
{
if (is_array($prefix))
{
$options = $prefix;
$enabled = array_key_exists('enabled', $options) ?
$options['enabled'] : $enabled;
$checkbox = array_key_exists('checkbox', $options) ?
$options['checkbox'] : $checkbox;
$prefix = array_key_exists('prefix', $options) ?
$options['prefix'] : '';
}
$states = array(
0 => array('setDefault', '',
'JLIB_HTML_SETDEFAULT_ITEM', '', 1,
'unfeatured', 'unfeatured'),
1 => array('unsetDefault', 'JDEFAULT',
'JLIB_HTML_UNSETDEFAULT_ITEM', 'JDEFAULT', 1,
'featured', 'featured'),
);
return static::state($states, $value, $i, $prefix, $enabled, true,
$checkbox);
}
/**
* Returns an array of standard published state filter options.
*
* @param array $config An array of configuration options.
* This array can contain a list of key/value
pairs where values are boolean
* and keys can be taken from
'published', 'unpublished', 'archived',
'trash', 'all'.
* These pairs determine which values are
displayed.
*
* @return string The HTML markup
*
* @since 1.6
*/
public static function publishedOptions($config = array())
{
// Build the active state filter options.
$options = array();
if (!array_key_exists('published', $config) ||
$config['published'])
{
$options[] = JHtml::_('select.option', '1',
'JPUBLISHED');
}
if (!array_key_exists('unpublished', $config) ||
$config['unpublished'])
{
$options[] = JHtml::_('select.option', '0',
'JUNPUBLISHED');
}
if (!array_key_exists('archived', $config) ||
$config['archived'])
{
$options[] = JHtml::_('select.option', '2',
'JARCHIVED');
}
if (!array_key_exists('trash', $config) ||
$config['trash'])
{
$options[] = JHtml::_('select.option', '-2',
'JTRASHED');
}
if (!array_key_exists('all', $config) ||
$config['all'])
{
$options[] = JHtml::_('select.option', '*',
'JALL');
}
return $options;
}
/**
* Returns a checked-out icon
*
* @param integer $i The row index.
* @param string $editorName The name of the editor.
* @param string $time The time that the object was
checked out.
* @param string|array $prefix An optional task prefix or an array
of options
* @param boolean $enabled True to enable the action.
* @param string $checkbox An optional prefix for checkboxes.
*
* @return string The HTML markup
*
* @since 1.6
*/
public static function checkedout($i, $editorName, $time, $prefix =
'', $enabled = false, $checkbox = 'cb')
{
JHtml::_('bootstrap.tooltip');
if (is_array($prefix))
{
$options = $prefix;
$enabled = array_key_exists('enabled', $options) ?
$options['enabled'] : $enabled;
$checkbox = array_key_exists('checkbox', $options) ?
$options['checkbox'] : $checkbox;
$prefix = array_key_exists('prefix', $options) ?
$options['prefix'] : '';
}
$text = $editorName . '<br />' .
JHtml::_('date', $time, JText::_('DATE_FORMAT_LC')) .
'<br />' . JHtml::_('date', $time,
'H:i');
$activeTitle = JHtml::_('tooltipText',
JText::_('JLIB_HTML_CHECKIN'), $text, 0);
$inactiveTitle = JHtml::_('tooltipText',
JText::_('JLIB_HTML_CHECKED_OUT'), $text, 0);
return static::action(
$i, 'checkin', $prefix,
JText::_('JLIB_HTML_CHECKED_OUT'),
html_entity_decode($activeTitle, ENT_QUOTES, 'UTF-8'),
html_entity_decode($inactiveTitle, ENT_QUOTES, 'UTF-8'), true,
'checkedout', 'checkedout', $enabled, false, $checkbox
);
}
/**
* Creates an order-up action icon.
*
* @param integer $i The row index.
* @param string $task An optional task to fire.
* @param string|array $prefix An optional task prefix or an array
of options
* @param string $text An optional text to display
* @param boolean $enabled An optional setting for access
control on the action.
* @param string $checkbox An optional prefix for checkboxes.
*
* @return string The HTML markup
*
* @since 1.6
*/
public static function orderUp($i, $task = 'orderup', $prefix =
'', $text = 'JLIB_HTML_MOVE_UP', $enabled = true,
$checkbox = 'cb')
{
if (is_array($prefix))
{
$options = $prefix;
$text = array_key_exists('text', $options) ?
$options['text'] : $text;
$enabled = array_key_exists('enabled', $options) ?
$options['enabled'] : $enabled;
$checkbox = array_key_exists('checkbox', $options) ?
$options['checkbox'] : $checkbox;
$prefix = array_key_exists('prefix', $options) ?
$options['prefix'] : '';
}
return static::action($i, $task, $prefix, $text, $text, $text, false,
'uparrow', 'uparrow_disabled', $enabled, true,
$checkbox);
}
/**
* Creates an order-down action icon.
*
* @param integer $i The row index.
* @param string $task An optional task to fire.
* @param string|array $prefix An optional task prefix or an array
of options
* @param string $text An optional text to display
* @param boolean $enabled An optional setting for access
control on the action.
* @param string $checkbox An optional prefix for checkboxes.
*
* @return string The HTML markup
*
* @since 1.6
*/
public static function orderDown($i, $task = 'orderdown',
$prefix = '', $text = 'JLIB_HTML_MOVE_DOWN', $enabled =
true, $checkbox = 'cb')
{
if (is_array($prefix))
{
$options = $prefix;
$text = array_key_exists('text', $options) ?
$options['text'] : $text;
$enabled = array_key_exists('enabled', $options) ?
$options['enabled'] : $enabled;
$checkbox = array_key_exists('checkbox', $options) ?
$options['checkbox'] : $checkbox;
$prefix = array_key_exists('prefix', $options) ?
$options['prefix'] : '';
}
return static::action($i, $task, $prefix, $text, $text, $text, false,
'downarrow', 'downarrow_disabled', $enabled, true,
$checkbox);
}
}
jquery.php000064400000007251151156052000006574 0ustar00<?php
/**
* @package Joomla.Libraries
* @subpackage HTML
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('JPATH_PLATFORM') or die;
/**
* Utility class for jQuery JavaScript behaviors
*
* @since 3.0
*/
abstract class JHtmlJquery
{
/**
* @var array Array containing information for loaded files
* @since 3.0
*/
protected static $loaded = array();
/**
* Method to load the jQuery JavaScript framework into the document head
*
* If debugging mode is on an uncompressed version of jQuery is included
for easier debugging.
*
* @param boolean $noConflict True to load jQuery in noConflict mode
[optional]
* @param mixed $debug Is debugging mode on? [optional]
* @param boolean $migrate True to enable the jQuery Migrate plugin
*
* @return void
*
* @since 3.0
*/
public static function framework($noConflict = true, $debug = null,
$migrate = true)
{
// Only load once
if (!empty(static::$loaded[__METHOD__]))
{
return;
}
// If no debugging value is set, use the configuration setting
if ($debug === null)
{
$debug = (boolean) JFactory::getConfig()->get('debug');
}
JHtml::_('script', 'jui/jquery.min.js',
array('version' => 'auto', 'relative'
=> true, 'detectDebug' => $debug));
// Check if we are loading in noConflict
if ($noConflict)
{
JHtml::_('script', 'jui/jquery-noconflict.js',
array('version' => 'auto', 'relative'
=> true));
}
// Check if we are loading Migrate
if ($migrate)
{
JHtml::_('script', 'jui/jquery-migrate.min.js',
array('version' => 'auto', 'relative'
=> true, 'detectDebug' => $debug));
}
static::$loaded[__METHOD__] = true;
return;
}
/**
* Method to load the jQuery UI JavaScript framework into the document
head
*
* If debugging mode is on an uncompressed version of jQuery UI is
included for easier debugging.
*
* @param array $components The jQuery UI components to load
[optional]
* @param mixed $debug Is debugging mode on? [optional]
*
* @return void
*
* @since 3.0
*/
public static function ui(array $components = array('core'),
$debug = null)
{
// Set an array containing the supported jQuery UI components handled by
this method
$supported = array('core', 'sortable');
// Include jQuery
static::framework();
// If no debugging value is set, use the configuration setting
if ($debug === null)
{
$debug = JDEBUG;
}
// Load each of the requested components
foreach ($components as $component)
{
// Only attempt to load the component if it's supported in core and
hasn't already been loaded
if (in_array($component, $supported) &&
empty(static::$loaded[__METHOD__][$component]))
{
JHtml::_('script', 'jui/jquery.ui.' . $component .
'.min.js', array('version' => 'auto',
'relative' => true, 'detectDebug' => $debug));
static::$loaded[__METHOD__][$component] = true;
}
}
return;
}
/**
* Auto set CSRF token to ajaxSetup so all jQuery ajax call will contains
CSRF token.
*
* @param string $name The CSRF meta tag name.
*
* @return void
*
* @throws \InvalidArgumentException
*
* @since 3.8.0
*/
public static function token($name = 'csrf.token')
{
// Only load once
if (!empty(static::$loaded[__METHOD__][$name]))
{
return;
}
static::framework();
JHtml::_('form.csrf', $name);
$doc = JFactory::getDocument();
$doc->addScriptDeclaration(
<<<JS
;(function ($) {
$.ajaxSetup({
headers: {
'X-CSRF-Token': Joomla.getOptions('$name')
}
});
})(jQuery);
JS
);
static::$loaded[__METHOD__][$name] = true;
}
}
language/en-GB/en-GB.jhtmldate.ini000064400000001502151156052000012554
0ustar00; Joomla! Project
; Copyright (C) 2005 - 2020 Open Source Matters. All rights reserved.
; License GNU General Public License version 2 or later; see LICENSE.txt
; Note : All ini files need to be saved as UTF-8
JLIB_HTML_DATE_RELATIVE_DAYS="%s days ago"
JLIB_HTML_DATE_RELATIVE_DAYS_1="%s day ago"
JLIB_HTML_DATE_RELATIVE_DAYS_0="%s days ago"
JLIB_HTML_DATE_RELATIVE_HOURS="%s hours ago"
JLIB_HTML_DATE_RELATIVE_HOURS_1="%s hour ago"
JLIB_HTML_DATE_RELATIVE_HOURS_0="%s hours ago"
JLIB_HTML_DATE_RELATIVE_LESSTHANAMINUTE="Less than a minute ago"
JLIB_HTML_DATE_RELATIVE_MINUTES="%s minutes ago"
JLIB_HTML_DATE_RELATIVE_MINUTES_1="%s minute ago"
JLIB_HTML_DATE_RELATIVE_MINUTES_0="%s minutes ago"
JLIB_HTML_DATE_RELATIVE_WEEKS="%s weeks ago"
JLIB_HTML_DATE_RELATIVE_WEEKS_1="%s week ago"
JLIB_HTML_DATE_RELATIVE_WEEKS_0="%s weeks ago"
links.php000064400000005013151156052000006367 0ustar00<?php
/**
* @package Joomla.Libraries
* @subpackage HTML
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('JPATH_PLATFORM') or die;
/**
* Utility class for icons.
*
* @since 3.2
*/
abstract class JHtmlLinks
{
/**
* Method to generate html code for groups of lists of links
*
* @param array $groupsOfLinks Array of links
*
* @return string
*
* @since 3.2
*/
public static function linksgroups($groupsOfLinks)
{
$html = array();
if (count($groupsOfLinks) > 0)
{
$layout = new JLayoutFile('joomla.links.groupsopen');
$html[] = $layout->render('');
foreach ($groupsOfLinks as $title => $links)
{
if (isset($links[0]['separategroup']))
{
$layout = new JLayoutFile('joomla.links.groupseparator');
$html[] = $layout->render($title);
}
$layout = new JLayoutFile('joomla.links.groupopen');
$htmlHeader = $layout->render($title);
$htmlLinks = JHtml::_('links.links', $links);
if ($htmlLinks != '')
{
$html[] = $htmlHeader;
$html[] = $htmlLinks;
$layout = new JLayoutFile('joomla.links.groupclose');
$html[] = $layout->render('');
}
}
$layout = new JLayoutFile('joomla.links.groupsclose');
$html[] = $layout->render('');
}
return implode($html);
}
/**
* Method to generate html code for a list of links
*
* @param array $links Array of links
*
* @return string
*
* @since 3.2
*/
public static function links($links)
{
$html = array();
foreach ($links as $link)
{
$html[] = JHtml::_('links.link', $link);
}
return implode($html);
}
/**
* Method to generate html code for a single link
*
* @param array $link link properties
*
* @return string
*
* @since 3.2
*/
public static function link($link)
{
if (isset($link['access']))
{
if (is_bool($link['access']))
{
if ($link['access'] == false)
{
return '';
}
}
else
{
// Get the user object to verify permissions
$user = JFactory::getUser();
// Take each pair of permission, context values.
for ($i = 0, $n = count($link['access']); $i < $n; $i +=
2)
{
if (!$user->authorise($link['access'][$i],
$link['access'][$i + 1]))
{
return '';
}
}
}
}
// Instantiate a new JLayoutFile instance and render the layout
$layout = new JLayoutFile('joomla.links.link');
return $layout->render($link);
}
}
list.php000064400000015306151156052000006230 0ustar00<?php
/**
* @package Joomla.Libraries
* @subpackage HTML
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('JPATH_PLATFORM') or die;
use Joomla\String\StringHelper;
/**
* Utility class for creating different select lists
*
* @since 1.5
*/
abstract class JHtmlList
{
/**
* Build the select list to choose an image
*
* @param string $name The name of the field
* @param string $active The selected item
* @param string $javascript Alternative javascript
* @param string $directory Directory the images are stored in
* @param string $extensions Allowed extensions
*
* @return array Image names
*
* @since 1.5
*/
public static function images($name, $active = null, $javascript = null,
$directory = null, $extensions = 'bmp|gif|jpg|png')
{
if (!$directory)
{
$directory = '/images/';
}
if (!$javascript)
{
$javascript = "onchange=\"if (document.forms.adminForm."
. $name
. ".options[selectedIndex].value!='')
{document.imagelib.src='..$directory' +
document.forms.adminForm." . $name
. ".options[selectedIndex].value} else
{document.imagelib.src='media/system/images/blank.png'}\"";
}
$imageFiles = new DirectoryIterator(JPATH_SITE . '/' .
$directory);
$images = array(JHtml::_('select.option', '',
JText::_('JOPTION_SELECT_IMAGE')));
foreach ($imageFiles as $file)
{
$fileName = $file->getFilename();
if (!$file->isFile())
{
continue;
}
if (preg_match('#(' . $extensions . ')$#',
$fileName))
{
$images[] = JHtml::_('select.option', $fileName);
}
}
$images = JHtml::_(
'select.genericlist',
$images,
$name,
array(
'list.attr' => 'class="inputbox"
size="1" ' . $javascript,
'list.select' => $active,
)
);
return $images;
}
/**
* Returns an array of options
*
* @param string $query SQL with 'ordering' AS value and
'name field' AS text
* @param integer $chop The length of the truncated headline
*
* @return array An array of objects formatted for JHtml list processing
*
* @since 1.5
*/
public static function genericordering($query, $chop = 30)
{
$db = JFactory::getDbo();
$options = array();
$db->setQuery($query);
$items = $db->loadObjectList();
if (empty($items))
{
$options[] = JHtml::_('select.option', 1,
JText::_('JOPTION_ORDER_FIRST'));
return $options;
}
$options[] = JHtml::_('select.option', 0, '0 ' .
JText::_('JOPTION_ORDER_FIRST'));
for ($i = 0, $n = count($items); $i < $n; $i++)
{
$items[$i]->text = JText::_($items[$i]->text);
if (StringHelper::strlen($items[$i]->text) > $chop)
{
$text = StringHelper::substr($items[$i]->text, 0, $chop) .
'...';
}
else
{
$text = $items[$i]->text;
}
$options[] = JHtml::_('select.option', $items[$i]->value,
$items[$i]->value . '. ' . $text);
}
$options[] = JHtml::_('select.option', $items[$i - 1]->value
+ 1, ($items[$i - 1]->value + 1) . ' ' .
JText::_('JOPTION_ORDER_LAST'));
return $options;
}
/**
* Build the select list for Ordering derived from a query
*
* @param integer $name The scalar value
* @param string $query The query
* @param string $attribs HTML tag attributes
* @param string $selected The selected item
* @param integer $neworder 1 if new and first, -1 if new and last, 0
or null if existing item
*
* @return string HTML markup for the select list
*
* @since 1.6
*/
public static function ordering($name, $query, $attribs = null, $selected
= null, $neworder = null)
{
if (empty($attribs))
{
$attribs = 'class="inputbox" size="1"';
}
if (empty($neworder))
{
$orders = JHtml::_('list.genericordering', $query);
$html = JHtml::_('select.genericlist', $orders, $name,
array('list.attr' => $attribs, 'list.select' =>
(int) $selected));
}
else
{
if ($neworder > 0)
{
$text = JText::_('JGLOBAL_NEWITEMSLAST_DESC');
}
elseif ($neworder <= 0)
{
$text = JText::_('JGLOBAL_NEWITEMSFIRST_DESC');
}
$html = '<input type="hidden" name="' .
$name . '" value="' . (int) $selected . '"
/><span class="readonly">' . $text .
'</span>';
}
return $html;
}
/**
* Select list of active users
*
* @param string $name The name of the field
* @param string $active The active user
* @param integer $nouser If set include an option to select no
user
* @param string $javascript Custom javascript
* @param string $order Specify a field to order by
*
* @return string The HTML for a list of users list of users
*
* @since 1.5
*/
public static function users($name, $active, $nouser = 0, $javascript =
null, $order = 'name')
{
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select('u.id AS value, u.name AS text')
->from('#__users AS u')
->join('LEFT', '#__user_usergroup_map AS m ON
m.user_id = u.id')
->where('u.block = 0')
->order($order)
->group('u.id');
$db->setQuery($query);
if ($nouser)
{
$users[] = JHtml::_('select.option', '0',
JText::_('JOPTION_NO_USER'));
$users = array_merge($users, $db->loadObjectList());
}
else
{
$users = $db->loadObjectList();
}
$users = JHtml::_(
'select.genericlist',
$users,
$name,
array(
'list.attr' => 'class="inputbox"
size="1" ' . $javascript,
'list.select' => $active,
)
);
return $users;
}
/**
* Select list of positions - generally used for location of images
*
* @param string $name Name of the field
* @param string $active The active value
* @param string $javascript Alternative javascript
* @param boolean $none Null if not assigned
* @param boolean $center Null if not assigned
* @param boolean $left Null if not assigned
* @param boolean $right Null if not assigned
* @param boolean $id Null if not assigned
*
* @return array The positions
*
* @since 1.5
*/
public static function positions($name, $active = null, $javascript =
null, $none = true, $center = true, $left = true, $right = true,
$id = false)
{
$pos = array();
if ($none)
{
$pos[''] = JText::_('JNONE');
}
if ($center)
{
$pos['center'] = JText::_('JGLOBAL_CENTER');
}
if ($left)
{
$pos['left'] = JText::_('JGLOBAL_LEFT');
}
if ($right)
{
$pos['right'] = JText::_('JGLOBAL_RIGHT');
}
$positions = JHtml::_(
'select.genericlist', $pos, $name,
array(
'id' => $id,
'list.attr' => 'class="inputbox"
size="1"' . $javascript,
'list.select' => $active,
'option.key' => null,
)
);
return $positions;
}
}
menu.php000064400000023160151156052000006216 0ustar00<?php
/**
* @package Joomla.Libraries
* @subpackage HTML
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('JPATH_PLATFORM') or die;
/**
* Utility class working with menu select lists
*
* @since 1.5
*/
abstract class JHtmlMenu
{
/**
* Cached array of the menus.
*
* @var array
* @since 1.6
*/
protected static $menus = array();
/**
* Cached array of the menus items.
*
* @var array
* @since 1.6
*/
protected static $items = array();
/**
* Get a list of the available menus.
*
* @param int $clientId The client id
*
* @return array
*
* @since 1.6
*/
public static function menus($clientId = 0)
{
$key = serialize($clientId);
if (!isset(static::$menus[$key]))
{
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select($db->qn(array('id', 'menutype',
'title', 'client_id'), array('id',
'value', 'text', 'client_id')))
->from($db->quoteName('#__menu_types'))
->order('client_id, title');
if (isset($clientId))
{
$query->where('client_id = ' . (int) $clientId);
}
static::$menus[$key] = $db->setQuery($query)->loadObjectList();
}
return static::$menus[$key];
}
/**
* Returns an array of menu items grouped by menu.
*
* @param array $config An array of configuration options [published,
checkacl, clientid].
*
* @return array
*
* @since 1.6
*/
public static function menuItems($config = array())
{
$key = serialize($config);
if (empty(static::$items[$key]))
{
// B/C - not passed = 0, null can be passed for both clients
$clientId = array_key_exists('clientid', $config) ?
$config['clientid'] : 0;
$menus = static::menus($clientId);
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select('a.id AS value, a.title AS text, a.level, a.menutype,
a.client_id')
->from('#__menu AS a')
->where('a.parent_id > 0');
// Filter on the client id
if (isset($clientId))
{
$query->where('a.client_id = ' . (int) $clientId);
}
// Filter on the published state
if (isset($config['published']))
{
if (is_numeric($config['published']))
{
$query->where('a.published = ' . (int)
$config['published']);
}
elseif ($config['published'] === '')
{
$query->where('a.published IN (0,1)');
}
}
$query->order('a.lft');
$db->setQuery($query);
$items = $db->loadObjectList();
// Collate menu items based on menutype
$lookup = array();
foreach ($items as &$item)
{
if (!isset($lookup[$item->menutype]))
{
$lookup[$item->menutype] = array();
}
$lookup[$item->menutype][] = &$item;
// Translate the menu item title when client is administrator
if ($clientId === 1)
{
$item->text = JText::_($item->text);
}
$item->text = str_repeat('- ', $item->level) .
$item->text;
}
static::$items[$key] = array();
$user = JFactory::getUser();
$aclcheck = !empty($config['checkacl']) ? (int)
$config['checkacl'] : 0;
foreach ($menus as &$menu)
{
if ($aclcheck)
{
$action = $aclcheck == $menu->id ? 'edit' :
'create';
if (!$user->authorise('core.' . $action,
'com_menus.menu.' . $menu->id))
{
continue;
}
}
// Start group:
static::$items[$key][] = JHtml::_('select.optgroup',
$menu->text);
// Special "Add to this Menu" option:
static::$items[$key][] = JHtml::_('select.option',
$menu->value . '.1',
JText::_('JLIB_HTML_ADD_TO_THIS_MENU'));
// Menu items:
if (isset($lookup[$menu->value]))
{
foreach ($lookup[$menu->value] as &$item)
{
static::$items[$key][] = JHtml::_('select.option',
$menu->value . '.' . $item->value, $item->text);
}
}
// Finish group:
static::$items[$key][] = JHtml::_('select.optgroup',
$menu->text);
}
}
return static::$items[$key];
}
/**
* Displays an HTML select list of menu items.
*
* @param string $name The name of the control.
* @param string $selected The value of the selected option.
* @param string $attribs Attributes for the control.
* @param array $config An array of options for the control [id,
published, checkacl, clientid].
*
* @return string
*
* @since 1.6
*/
public static function menuItemList($name, $selected = null, $attribs =
null, $config = array())
{
static $count;
$options = static::menuItems($config);
return JHtml::_(
'select.genericlist', $options, $name,
array(
'id' => isset($config['id']) ?
$config['id'] : 'assetgroups_' . (++$count),
'list.attr' => $attribs === null ?
'class="inputbox" size="1"' : $attribs,
'list.select' => (int) $selected,
'list.translate' => false,
)
);
}
/**
* Build the select list for Menu Ordering
*
* @param object &$row The row object
* @param integer $id The id for the row. Must exist to enable menu
ordering
*
* @return string
*
* @since 1.5
*/
public static function ordering(&$row, $id)
{
if ($id)
{
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select('ordering AS value, title AS text')
->from($db->quoteName('#__menu'))
->where($db->quoteName('menutype') . ' = ' .
$db->quote($row->menutype))
->where($db->quoteName('parent_id') . ' = ' .
(int) $row->parent_id)
->where($db->quoteName('published') . ' !=
-2')
->order('ordering');
$order = JHtml::_('list.genericordering', $query);
$ordering = JHtml::_(
'select.genericlist', $order, 'ordering',
array('list.attr' => 'class="inputbox"
size="1"', 'list.select' => (int)
$row->ordering)
);
}
else
{
$ordering = '<input type="hidden"
name="ordering" value="' . $row->ordering .
'" />' . JText::_('JGLOBAL_NEWITEMSLAST_DESC');
}
return $ordering;
}
/**
* Build the multiple select list for Menu Links/Pages
*
* @param boolean $all True if all can be selected
* @param boolean $unassigned True if unassigned can be selected
* @param int $clientId The client id
*
* @return string
*
* @since 1.5
*/
public static function linkOptions($all = false, $unassigned = false,
$clientId = 0)
{
$db = JFactory::getDbo();
// Get a list of the menu items
$query = $db->getQuery(true)
->select('m.id, m.parent_id, m.title, m.menutype,
m.client_id')
->from($db->quoteName('#__menu') . ' AS m')
->where($db->quoteName('m.published') . ' =
1')
->order('m.client_id, m.menutype, m.parent_id');
if (isset($clientId))
{
$query->where('m.client_id = ' . (int) $clientId);
}
$db->setQuery($query);
$mitems = $db->loadObjectList();
if (!$mitems)
{
$mitems = array();
}
// Establish the hierarchy of the menu
$children = array();
// First pass - collect children
foreach ($mitems as $v)
{
$pt = $v->parent_id;
$list = @$children[$pt] ? $children[$pt] : array();
$list[] = $v;
$children[$pt] = $list;
}
// Second pass - get an indent list of the items
$list = static::treerecurse((int) $mitems[0]->parent_id, '',
array(), $children, 9999, 0, 0);
// Code that adds menu name to Display of Page(s)
$mitems = array();
if ($all | $unassigned)
{
$mitems[] = JHtml::_('select.option',
'<OPTGROUP>', JText::_('JOPTION_MENUS'));
if ($all)
{
$mitems[] = JHtml::_('select.option', 0,
JText::_('JALL'));
}
if ($unassigned)
{
$mitems[] = JHtml::_('select.option', -1,
JText::_('JOPTION_UNASSIGNED'));
}
$mitems[] = JHtml::_('select.option',
'</OPTGROUP>');
}
$lastMenuType = null;
$tmpMenuType = null;
foreach ($list as $list_a)
{
if ($list_a->menutype != $lastMenuType)
{
if ($tmpMenuType)
{
$mitems[] = JHtml::_('select.option',
'</OPTGROUP>');
}
$mitems[] = JHtml::_('select.option',
'<OPTGROUP>', $list_a->menutype);
$lastMenuType = $list_a->menutype;
$tmpMenuType = $list_a->menutype;
}
$mitems[] = JHtml::_('select.option', $list_a->id,
$list_a->title);
}
if ($lastMenuType !== null)
{
$mitems[] = JHtml::_('select.option',
'</OPTGROUP>');
}
return $mitems;
}
/**
* Build the list representing the menu tree
*
* @param integer $id Id of the menu item
* @param string $indent The indentation string
* @param array $list The list to process
* @param array &$children The children of the current item
* @param integer $maxlevel The maximum number of levels in the tree
* @param integer $level The starting level
* @param int $type Set the type of spacer to use. Use 1 for
|_ or 0 for -
*
* @return array
*
* @since 1.5
*/
public static function treerecurse($id, $indent, $list, &$children,
$maxlevel = 9999, $level = 0, $type = 1)
{
if ($level <= $maxlevel && isset($children[$id]) &&
is_array($children[$id]))
{
if ($type)
{
$pre = '<sup>|_</sup> ';
$spacer =
'.      ';
}
else
{
$pre = '- ';
$spacer = '  ';
}
foreach ($children[$id] as $v)
{
$id = $v->id;
if ($v->parent_id == 0)
{
$txt = $v->title;
}
else
{
$txt = $pre . $v->title;
}
$list[$id] = $v;
$list[$id]->treename = $indent . $txt;
if (isset($children[$id]) && is_array($children[$id]))
{
$list[$id]->children = count($children[$id]);
$list = static::treerecurse($id, $indent . $spacer,
$list, $children, $maxlevel, $level + 1, $type);
}
else
{
$list[$id]->children = 0;
}
}
}
return $list;
}
}
number.php000064400000007000151156052000006535 0ustar00<?php
/**
* @package Joomla.Libraries
* @subpackage HTML
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('JPATH_PLATFORM') or die;
/**
* HTML helper class for rendering numbers.
*
* @since 1.6
*/
abstract class JHtmlNumber
{
/**
* Converts bytes to more distinguishable formats such as:
* kilobytes, megabytes, etc.
*
* By default, the proper format will automatically be chosen.
* However, one of the allowed unit types (viz. 'b',
'kB', 'MB', 'GB', 'TB',
'PB', 'EB', 'ZB', 'YB') may also be
used instead.
* IEC standard unit types ('KiB', 'MiB',
'GiB', 'TiB', 'PiB', 'EiB',
'ZiB', 'YiB') can be used as well.
*
* @param string $bytes The number of bytes. Can be either
numeric or suffixed format: 32M, 60K, 12G or 812b
* @param string $unit The type of unit to return, few special
values are:
* Blank string '' for no unit,
* 'auto' to choose automatically
(default)
* 'binary' to choose
automatically but use binary unit prefix
* @param integer $precision The number of digits to be used after the
decimal place.
* @param bool $iec Whether to be aware of IEC standards. IEC
prefixes are always acceptable in input.
* When IEC is ON: KiB = 1024 B, KB = 1000
B
* When IEC is OFF: KiB = 1024 B, KB = 1024
B
*
* @return string The number of bytes in the proper units.
*
* @since 1.6
* @link https://en.wikipedia.org/wiki/Binary_prefix
*/
public static function bytes($bytes, $unit = 'auto', $precision
= 2, $iec = false)
{
/*
* Allowed 123.45, 123.45 M, 123.45 Mi, 123.45 MB, 123.45 MiB,
1.2345E+12MB, 1.2345E+12 MB , 1.2345E+12 MiB etc.
* i.e. – Any number in decimal digits or in sci. notation, optional
space, optional 1-3 letter unit suffix
*/
if (is_numeric($bytes))
{
$oBytes = $bytes;
}
else
{
preg_match('/(.*?)\s?((?:[KMGTPEZY]i?)?B?)$/i', trim($bytes),
$matches);
list(, $oBytes, $oUnit) = $matches;
if ($oUnit && is_numeric($oBytes))
{
$oBase = $iec && strpos($oUnit, 'i') === false ?
1000 : 1024;
$factor = pow($oBase, stripos('BKMGTPEZY', $oUnit[0]));
$oBytes *= $factor;
}
}
if (empty($oBytes) || !is_numeric($oBytes))
{
return 0;
}
$oBytes = round($oBytes);
// If no unit is requested return early
if ($unit === '')
{
return (string) $oBytes;
}
$stdSuffixes = array('b', 'kB', 'MB',
'GB', 'TB', 'PB', 'EB',
'ZB', 'YB');
$iecSuffixes = array('b', 'KiB', 'MiB',
'GiB', 'TiB', 'PiB', 'EiB',
'ZiB', 'YiB');
// User supplied method
if (in_array($unit, $iecSuffixes))
{
$base = 1024;
$i = array_search($unit, $iecSuffixes, true);
$suffix = $unit;
}
elseif (in_array($unit, $stdSuffixes))
{
$base = $iec ? 1000 : 1024;
$i = array_search($unit, $stdSuffixes, true);
$suffix = $unit;
}
elseif ($unit === 'binary')
{
$base = 1024;
$i = (int) floor(log($oBytes, $base));
$suffix = $iecSuffixes[$i];
}
else
{
// Default method
$base = $iec ? 1000 : 1024;
$i = (int) floor(log($oBytes, $base));
$suffix = $stdSuffixes[$i];
}
return number_format(
round($oBytes / pow($base, $i), (int) $precision), (int) $precision,
JText::_('DECIMALS_SEPARATOR'),
JText::_('THOUSANDS_SEPARATOR')
) . ' ' . $suffix;
}
}
rules.php000064400000020101151156052000006374 0ustar00<?php
/**
* @package Joomla.Libraries
* @subpackage HTML
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('JPATH_PLATFORM') or die;
JLog::add('JHtmlRules is deprecated.', JLog::WARNING,
'deprecated');
/**
* Extended Utility class for all HTML drawing classes.
*
* @since 1.6
* @deprecated 4.0
*/
abstract class JHtmlRules
{
/**
* Creates the HTML for the permissions widget
*
* @param array $actions Array of action objects
* @param integer $assetId Id of a specific asset to create a widget
for.
* @param integer $parent Id of the parent of the asset
* @param string $control The form control
* @param string $idPrefix Prefix for the ids assigned to specific
action-group pairs
*
* @return string HTML for the permissions widget
*
* @see JAccess
* @see JFormFieldRules
* @since 1.6
* @deprecated 4.0
*/
public static function assetFormWidget($actions, $assetId = null, $parent
= null, $control = 'jform[rules]', $idPrefix =
'jform_rules')
{
$images = static::_getImagesArray();
// Get the user groups.
$groups = static::_getUserGroups();
// Get the incoming inherited rules as well as the asset specific rules.
$inheriting = JAccess::getAssetRules($parent ?:
static::_getParentAssetId($assetId), true);
$inherited = JAccess::getAssetRules($assetId, true);
$rules = JAccess::getAssetRules($assetId);
$html = array();
$html[] = '<div class="acl-options">';
$html[] = JHtml::_('tabs.start', 'acl-rules-' .
$assetId, array('useCookie' => 1));
$html[] = JHtml::_('tabs.panel',
JText::_('JLIB_HTML_ACCESS_SUMMARY'), 'summary');
$html[] = ' <p>' .
JText::_('JLIB_HTML_ACCESS_SUMMARY_DESC') .
'</p>';
$html[] = ' <table class="aclsummary-table"
summary="' . JText::_('JLIB_HTML_ACCESS_SUMMARY_DESC')
. '">';
$html[] = ' <caption>' .
JText::_('JLIB_HTML_ACCESS_SUMMARY_DESC_CAPTION') .
'</caption>';
$html[] = ' <tr>';
$html[] = ' <th class="col1 hidelabeltxt">'
. JText::_('JLIB_RULES_GROUPS') . '</th>';
foreach ($actions as $i => $action)
{
$html[] = ' <th class="col' . ($i + 2) .
'">' . JText::_($action->title) .
'</th>';
}
$html[] = ' </tr>';
foreach ($groups as $i => $group)
{
$html[] = ' <tr class="row' . ($i % 2) .
'">';
$html[] = ' <td class="col1">' .
$group->text . '</td>';
foreach ($actions as $j => $action)
{
$html[] = ' <td class="col' . ($j + 2) .
'">'
. ($assetId ? ($inherited->allow($action->name,
$group->identities) ? $images['allow'] :
$images['deny'])
: ($inheriting->allow($action->name, $group->identities) ?
$images['allow'] : $images['deny'])) .
'</td>';
}
$html[] = ' </tr>';
}
$html[] = ' </table>';
foreach ($actions as $action)
{
$actionTitle = JText::_($action->title);
$actionDesc = JText::_($action->description);
$html[] = JHtml::_('tabs.panel', $actionTitle,
$action->name);
$html[] = ' <p>' . $actionDesc .
'</p>';
$html[] = ' <table class="aclmodify-table"
summary="' . strip_tags($actionDesc) . '">';
$html[] = ' <caption>' .
JText::_('JLIB_HTML_ACCESS_MODIFY_DESC_CAPTION_ACL') . '
' . $actionTitle . ' '
. JText::_('JLIB_HTML_ACCESS_MODIFY_DESC_CAPTION_TABLE') .
'</caption>';
$html[] = ' <tr>';
$html[] = ' <th class="col1 hidelabeltxt">'
. JText::_('JLIB_RULES_GROUP') . '</th>';
$html[] = ' <th class="col2">' .
JText::_('JLIB_RULES_INHERIT') . '</th>';
$html[] = ' <th class="col3 hidelabeltxt">'
. JText::_('JMODIFY') . '</th>';
$html[] = ' <th class="col4">' .
JText::_('JCURRENT') . '</th>';
$html[] = ' </tr>';
foreach ($groups as $i => $group)
{
$selected = $rules->allow($action->name, $group->value);
$html[] = ' <tr class="row' . ($i % 2) .
'">';
$html[] = ' <td class="col1">' .
$group->text . '</td>';
$html[] = ' <td class="col2">'
. ($inheriting->allow($action->name, $group->identities) ?
$images['allow-i'] : $images['deny-i']) .
'</td>';
$html[] = ' <td class="col3">';
$html[] = ' <select id="' . $idPrefix .
'_' . $action->name . '_' . $group->value
. '" class="inputbox" size="1"
name="' . $control . '[' . $action->name .
'][' . $group->value . ']" title="'
. JText::sprintf('JLIB_RULES_SELECT_ALLOW_DENY_GROUP',
$actionTitle, $group->text) . '">';
$html[] = ' <option value=""' . ($selected
=== null ? ' selected="selected"' : '') .
'>'
. JText::_('JLIB_RULES_INHERIT') .
'</option>';
$html[] = ' <option value="1"' . ($selected
=== true ? ' selected="selected"' : '') .
'>'
. JText::_('JLIB_RULES_ALLOWED') .
'</option>';
$html[] = ' <option value="0"' . ($selected
=== false ? ' selected="selected"' : '') .
'>'
. JText::_('JLIB_RULES_DENIED') .
'</option>';
$html[] = ' </select>';
$html[] = ' </td>';
$html[] = ' <td class="col4">'
. ($assetId ? ($inherited->allow($action->name,
$group->identities) ? $images['allow'] :
$images['deny'])
: ($inheriting->allow($action->name, $group->identities) ?
$images['allow'] : $images['deny'])) .
'</td>';
$html[] = ' </tr>';
}
$html[] = ' </table>';
}
$html[] = JHtml::_('tabs.end');
// Build the footer with legend and special purpose buttons.
$html[] = ' <div class="clr"></div>';
$html[] = ' <ul class="acllegend fltlft">';
$html[] = ' <li class="acl-allowed">' .
JText::_('JLIB_RULES_ALLOWED') . '</li>';
$html[] = ' <li class="acl-denied">' .
JText::_('JLIB_RULES_DENIED') . '</li>';
$html[] = ' </ul>';
$html[] = '</div>';
return implode("\n", $html);
}
/**
* Get the id of the parent asset
*
* @param integer $assetId The asset for which the parentid will be
returned
*
* @return integer The id of the parent asset
*
* @since 1.6
* @deprecated 4.0
*/
protected static function _getParentAssetId($assetId)
{
// Get a database object.
$db = JFactory::getDbo();
$query = $db->getQuery(true);
// Get the user groups from the database.
$query->select($db->quoteName('parent_id'))
->from($db->quoteName('#__assets'))
->where($db->quoteName('id') . ' = ' . (int)
$assetId);
$db->setQuery($query);
return (int) $db->loadResult();
}
/**
* Get the user groups
*
* @return array Array of user groups
*
* @since 1.6
* @deprecated 4.0
*/
protected static function _getUserGroups()
{
// Get a database object.
$db = JFactory::getDbo();
// Get the user groups from the database.
$db->setQuery(
'SELECT a.id AS value, a.title AS text, b.id as parent'
. ' FROM #__usergroups AS a LEFT JOIN #__usergroups AS b ON a.lft
>= b.lft AND a.rgt <= b.rgt'
. ' ORDER BY a.lft ASC, b.lft ASC'
);
$result = $db->loadObjectList();
$options = array();
// Pre-compute additional values.
foreach ($result as $option)
{
$end = end($options);
if ($end === false || $end->value != $option->value)
{
$end = $option;
$end->level = 0;
$options[] = $end;
}
else
{
$end->level++;
}
$end->identities[] = $option->parent;
}
return $options;
}
/**
* Get the array of images associate with specific permissions
*
* @return array An associative array of permissions and images
*
* @since 1.6
* @deprecated 4.0
*/
protected static function _getImagesArray()
{
$images['allow-l'] = '<label
class="icon-16-allow" title="' .
JText::_('JLIB_RULES_ALLOWED') . '">' .
JText::_('JLIB_RULES_ALLOWED')
. '</label>';
$images['deny-l'] = '<label
class="icon-16-deny" title="' .
JText::_('JLIB_RULES_DENIED') . '">' .
JText::_('JLIB_RULES_DENIED') . '</label>';
$images['allow'] = '<a class="icon-16-allow"
title="' . JText::_('JLIB_RULES_ALLOWED') .
'"> </a>';
$images['deny'] = '<a class="icon-16-deny"
title="' . JText::_('JLIB_RULES_DENIED') .
'"> </a>';
$images['allow-i'] = '<a
class="icon-16-allowinactive" title="' .
JText::_('JRULE_ALLOWED_INHERITED') . '">
</a>';
$images['deny-i'] = '<a
class="icon-16-denyinactive" title="' .
JText::_('JRULE_DENIED_INHERITED') . '">
</a>';
return $images;
}
}
searchtools.php000064400000010231151156052000007573 0ustar00<?php
/**
* @package Joomla.Libraries
* @subpackage HTML
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('JPATH_PLATFORM') or die;
use Joomla\Registry\Registry;
/**
* Searchtools elements.
*
* @since 3.2
*/
abstract class JHtmlSearchtools
{
/**
* @var array Array containing information for loaded files
* @since 3.2
*/
protected static $loaded = array();
/**
* Load the main Searchtools libraries
*
* @return void
*
* @since 3.2
*/
public static function main()
{
// Only load once
if (empty(static::$loaded[__METHOD__]))
{
// Requires jQuery but allows to skip its loading
if ($loadJquery = (!isset($options['loadJquery']) ||
$options['loadJquery'] != 0))
{
JHtml::_('jquery.framework');
}
// Load the jQuery plugin && CSS
JHtml::_('script', 'jui/jquery.searchtools.min.js',
array('version' => 'auto', 'relative'
=> true));
JHtml::_('stylesheet', 'jui/jquery.searchtools.css',
array('version' => 'auto', 'relative'
=> true));
static::$loaded[__METHOD__] = true;
}
return;
}
/**
* Load searchtools for a specific form
*
* @param mixed $selector Is debugging mode on? [optional]
* @param array $options Optional array of parameters for search
tools
*
* @return void
*
* @since 3.2
*/
public static function form($selector = '.js-stools-form',
$options = array())
{
$sig = md5(serialize(array($selector, $options)));
// Only load once
if (!isset(static::$loaded[__METHOD__][$sig]))
{
// Include Bootstrap framework
static::main();
// Add the form selector to the search tools options
$options['formSelector'] = $selector;
// Generate options with default values
$options = static::optionsToRegistry($options);
$doc = JFactory::getDocument();
$script = "
(function($){
$(document).ready(function() {
$('" . $selector . "').searchtools(
" . $options->toString() . "
);
});
})(jQuery);
";
$doc->addScriptDeclaration($script);
static::$loaded[__METHOD__][$sig] = true;
}
return;
}
/**
* Function to receive & pre-process javascript options
*
* @param mixed $options Associative array/Registry object with
options
*
* @return Registry Options converted to Registry object
*/
private static function optionsToRegistry($options)
{
// Support options array
if (is_array($options))
{
$options = new Registry($options);
}
if (!($options instanceof Registry))
{
$options = new Registry;
}
return $options;
}
/**
* Method to sort a column in a grid
*
* @param string $title The link title
* @param string $order The order field for the column
* @param string $direction The current direction
* @param mixed $selected The selected ordering
* @param string $task An optional task override
* @param string $newDirection An optional direction for the new
column
* @param string $tip An optional text shown as tooltip title
instead of $title
* @param string $icon Icon to show
* @param string $formName Name of the form to submit
*
* @return string
*/
public static function sort($title, $order, $direction = 'asc',
$selected = 0, $task = null, $newDirection = 'asc', $tip =
'', $icon = null,
$formName = 'adminForm')
{
$direction = strtolower($direction);
$orderIcons = array('icon-arrow-up-3',
'icon-arrow-down-3');
$index = (int) ($direction === 'desc');
if ($order !== $selected)
{
$direction = $newDirection;
}
else
{
$direction = $direction === 'desc' ? 'asc' :
'desc';
}
// Create an object to pass it to the layouts
$data = new stdClass;
$data->order = $order;
$data->direction = $direction;
$data->selected = $selected;
$data->task = $task;
$data->tip = $tip;
$data->title = $title;
$data->orderIcon = $orderIcons[$index];
$data->icon = $icon;
$data->formName = $formName;
return JLayoutHelper::render('joomla.searchtools.grid.sort',
$data);
}
}
select.php000064400000066761151156052000006547 0ustar00<?php
/**
* @package Joomla.Libraries
* @subpackage HTML
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('JPATH_PLATFORM') or die;
use Joomla\Utilities\ArrayHelper;
/**
* Utility class for creating HTML select lists
*
* @since 1.5
*/
abstract class JHtmlSelect
{
/**
* Default values for options. Organized by option group.
*
* @var array
* @since 1.5
*/
protected static $optionDefaults = array(
'option' => array(
'option.attr' => null,
'option.disable' => 'disable',
'option.id' => null,
'option.key' => 'value',
'option.key.toHtml' => true,
'option.label' => null,
'option.label.toHtml' => true,
'option.text' => 'text',
'option.text.toHtml' => true,
'option.class' => 'class',
'option.onclick' => 'onclick',
),
);
/**
* Generates a yes/no radio list.
*
* @param string $name The value of the HTML name attribute
* @param array $attribs Additional HTML attributes for the
`<select>` tag
* @param string $selected The key that is selected
* @param string $yes Language key for Yes
* @param string $no Language key for no
* @param mixed $id The id for the field or false for no id
*
* @return string HTML for the radio list
*
* @since 1.5
* @see JFormFieldRadio
*/
public static function booleanlist($name, $attribs = array(), $selected =
null, $yes = 'JYES', $no = 'JNO', $id = false)
{
$arr = array(JHtml::_('select.option', '0',
JText::_($no)), JHtml::_('select.option', '1',
JText::_($yes)));
return JHtml::_('select.radiolist', $arr, $name, $attribs,
'value', 'text', (int) $selected, $id);
}
/**
* Generates an HTML selection list.
*
* @param array $data An array of objects, arrays, or scalars.
* @param string $name The value of the HTML name attribute.
* @param mixed $attribs Additional HTML attributes for the
`<select>` tag. This
* can be an array of attributes, or an
array of options. Treated as options
* if it is the last argument passed. Valid
options are:
* Format options, see {@see
JHtml::$formatOptions}.
* Selection options, see {@see
JHtmlSelect::options()}.
* list.attr, string|array: Additional
attributes for the select
* element.
* id, string: Value to use as the select
element id attribute.
* Defaults to the same as the name.
* list.select, string|array: Identifies one
or more option elements
* to be selected, based on the option key
values.
* @param string $optKey The name of the object variable for the
option value. If
* set to null, the index of the value array
is used.
* @param string $optText The name of the object variable for the
option text.
* @param mixed $selected The key that is selected (accepts an
array or a string).
* @param mixed $idtag Value of the field id or null by default
* @param boolean $translate True to translate
*
* @return string HTML for the select list.
*
* @since 1.5
*/
public static function genericlist($data, $name, $attribs = null, $optKey
= 'value', $optText = 'text', $selected = null, $idtag
= false,
$translate = false)
{
// Set default options
$options = array_merge(JHtml::$formatOptions,
array('format.depth' => 0, 'id' => false));
if (is_array($attribs) && func_num_args() === 3)
{
// Assume we have an options array
$options = array_merge($options, $attribs);
}
else
{
// Get options from the parameters
$options['id'] = $idtag;
$options['list.attr'] = $attribs;
$options['list.translate'] = $translate;
$options['option.key'] = $optKey;
$options['option.text'] = $optText;
$options['list.select'] = $selected;
}
$attribs = '';
if (isset($options['list.attr']))
{
if (is_array($options['list.attr']))
{
$attribs = ArrayHelper::toString($options['list.attr']);
}
else
{
$attribs = $options['list.attr'];
}
if ($attribs !== '')
{
$attribs = ' ' . $attribs;
}
}
$id = $options['id'] !== false ? $options['id'] :
$name;
$id = str_replace(array('[', ']', ' '),
'', $id);
$baseIndent = str_repeat($options['format.indent'],
$options['format.depth']++);
$html = $baseIndent . '<select' . ($id !== '' ?
' id="' . $id . '"' : '') . '
name="' . $name . '"' . $attribs .
'>' . $options['format.eol']
. static::options($data, $options) . $baseIndent .
'</select>' . $options['format.eol'];
return $html;
}
/**
* Method to build a list with suggestions
*
* @param array $data An array of objects, arrays, or values.
* @param string $optKey The name of the object variable for the
option value. If
* set to null, the index of the value array
is used.
* @param string $optText The name of the object variable for the
option text.
* @param mixed $idtag Value of the field id or null by default
* @param boolean $translate True to translate
*
* @return string HTML for the select list
*
* @since 3.2
* @deprecated 4.0 Just create the `<datalist>` directly instead
*/
public static function suggestionlist($data, $optKey = 'value',
$optText = 'text', $idtag = null, $translate = false)
{
// Log deprecated message
JLog::add(
sprintf(
'%s() is deprecated. Create the <datalist> tag directly
instead.',
__METHOD__
),
JLog::WARNING,
'deprecated'
);
// Note: $idtag is required but has to be an optional argument in the
funtion call due to argument order
if (!$idtag)
{
throw new InvalidArgumentException('$idtag is a required argument
in deprecated JHtmlSelect::suggestionlist');
}
// Set default options
$options = array_merge(JHtml::$formatOptions,
array('format.depth' => 0, 'id' => false));
// Get options from the parameters
$options['id'] = $idtag;
$options['list.attr'] = null;
$options['list.translate'] = $translate;
$options['option.key'] = $optKey;
$options['option.text'] = $optText;
$options['list.select'] = null;
$id = ' id="' . $idtag . '"';
$baseIndent = str_repeat($options['format.indent'],
$options['format.depth']++);
$html = $baseIndent . '<datalist' . $id . '>' .
$options['format.eol']
. static::options($data, $options) . $baseIndent .
'</datalist>' . $options['format.eol'];
return $html;
}
/**
* Generates a grouped HTML selection list from nested arrays.
*
* @param array $data An array of groups, each of which is an
array of options.
* @param string $name The value of the HTML name attribute
* @param array $options Options, an array of key/value pairs. Valid
options are:
* Format options, {@see
JHtml::$formatOptions}.
* Selection options. See {@see
JHtmlSelect::options()}.
* group.id: The property in each group to use
as the group id
* attribute. Defaults to none.
* group.label: The property in each group to
use as the group
* label. Defaults to "text". If set
to null, the data array index key is
* used.
* group.items: The property in each group to
use as the array of
* items in the group. Defaults to
"items". If set to null, group.id and
* group. label are forced to null and the data
element is assumed to be a
* list of selections.
* id: Value to use as the select element id
attribute. Defaults to
* the same as the name.
* list.attr: Attributes for the select
element. Can be a string or
* an array of key/value pairs. Defaults to
none.
* list.select: either the value of one
selected option or an array
* of selected options. Default: none.
* list.translate: Boolean. If set, text and
labels are translated via
* JText::_().
*
* @return string HTML for the select list
*
* @since 1.5
* @throws RuntimeException If a group has contents that cannot be
processed.
*/
public static function groupedlist($data, $name, $options = array())
{
// Set default options and overwrite with anything passed in
$options = array_merge(
JHtml::$formatOptions,
array('format.depth' => 0, 'group.items' =>
'items', 'group.label' => 'text',
'group.label.toHtml' => true, 'id' => false),
$options
);
// Apply option rules
if ($options['group.items'] === null)
{
$options['group.label'] = null;
}
$attribs = '';
if (isset($options['list.attr']))
{
if (is_array($options['list.attr']))
{
$attribs = ArrayHelper::toString($options['list.attr']);
}
else
{
$attribs = $options['list.attr'];
}
if ($attribs !== '')
{
$attribs = ' ' . $attribs;
}
}
$id = $options['id'] !== false ? $options['id'] :
$name;
$id = str_replace(array('[', ']', ' '),
'', $id);
// Disable groups in the options.
$options['groups'] = false;
$baseIndent = str_repeat($options['format.indent'],
$options['format.depth']++);
$html = $baseIndent . '<select' . ($id !== '' ?
' id="' . $id . '"' : '') . '
name="' . $name . '"' . $attribs .
'>' . $options['format.eol'];
$groupIndent = str_repeat($options['format.indent'],
$options['format.depth']++);
foreach ($data as $dataKey => $group)
{
$label = $dataKey;
$id = '';
$noGroup = is_int($dataKey);
if ($options['group.items'] == null)
{
// Sub-list is an associative array
$subList = $group;
}
elseif (is_array($group))
{
// Sub-list is in an element of an array.
$subList = $group[$options['group.items']];
if (isset($group[$options['group.label']]))
{
$label = $group[$options['group.label']];
$noGroup = false;
}
if (isset($options['group.id']) &&
isset($group[$options['group.id']]))
{
$id = $group[$options['group.id']];
$noGroup = false;
}
}
elseif (is_object($group))
{
// Sub-list is in a property of an object
$subList = $group->{$options['group.items']};
if (isset($group->{$options['group.label']}))
{
$label = $group->{$options['group.label']};
$noGroup = false;
}
if (isset($options['group.id']) &&
isset($group->{$options['group.id']}))
{
$id = $group->{$options['group.id']};
$noGroup = false;
}
}
else
{
throw new RuntimeException('Invalid group contents.', 1);
}
if ($noGroup)
{
$html .= static::options($subList, $options);
}
else
{
$html .= $groupIndent . '<optgroup' . (empty($id) ?
'' : ' id="' . $id . '"') . '
label="'
. ($options['group.label.toHtml'] ? htmlspecialchars($label,
ENT_COMPAT, 'UTF-8') : $label) . '">' .
$options['format.eol']
. static::options($subList, $options) . $groupIndent .
'</optgroup>' . $options['format.eol'];
}
}
$html .= $baseIndent . '</select>' .
$options['format.eol'];
return $html;
}
/**
* Generates a selection list of integers.
*
* @param integer $start The start integer
* @param integer $end The end integer
* @param integer $inc The increment
* @param string $name The value of the HTML name attribute
* @param mixed $attribs Additional HTML attributes for the
`<select>` tag, an array of
* attributes, or an array of options.
Treated as options if it is the last
* argument passed.
* @param mixed $selected The key that is selected
* @param string $format The printf format to be applied to the
number
*
* @return string HTML for the select list
*
* @since 1.5
*/
public static function integerlist($start, $end, $inc, $name, $attribs =
null, $selected = null, $format = '')
{
// Set default options
$options = array_merge(JHtml::$formatOptions,
array('format.depth' => 0, 'option.format' =>
'', 'id' => null));
if (is_array($attribs) && func_num_args() === 5)
{
// Assume we have an options array
$options = array_merge($options, $attribs);
// Extract the format and remove it from downstream options
$format = $options['option.format'];
unset($options['option.format']);
}
else
{
// Get options from the parameters
$options['list.attr'] = $attribs;
$options['list.select'] = $selected;
}
$start = (int) $start;
$end = (int) $end;
$inc = (int) $inc;
$data = array();
for ($i = $start; $i <= $end; $i += $inc)
{
$data[$i] = $format ? sprintf($format, $i) : $i;
}
// Tell genericlist() to use array keys
$options['option.key'] = null;
return JHtml::_('select.genericlist', $data, $name, $options);
}
/**
* Create a placeholder for an option group.
*
* @param string $text The text for the option
* @param string $optKey The returned object property name for the
value
* @param string $optText The returned object property name for the
text
*
* @return stdClass
*
* @deprecated 4.0 Use JHtmlSelect::groupedList()
* @see JHtmlSelect::groupedList()
* @since 1.5
*/
public static function optgroup($text, $optKey = 'value',
$optText = 'text')
{
JLog::add('JHtmlSelect::optgroup() is deprecated, use
JHtmlSelect::groupedList() instead.', JLog::WARNING,
'deprecated');
// Set initial state
static $state = 'open';
// Toggle between open and close states:
switch ($state)
{
case 'open':
$obj = new stdClass;
$obj->$optKey = '<OPTGROUP>';
$obj->$optText = $text;
$state = 'close';
break;
case 'close':
$obj = new stdClass;
$obj->$optKey = '</OPTGROUP>';
$obj->$optText = $text;
$state = 'open';
break;
}
return $obj;
}
/**
* Create an object that represents an option in an option list.
*
* @param string $value The value of the option
* @param string $text The text for the option
* @param mixed $optKey If a string, the returned object property
name for
* the value. If an array, options. Valid
options are:
* attr: String|array. Additional attributes
for this option.
* Defaults to none.
* disable: Boolean. If set, this option is
disabled.
* label: String. The value for the option
label.
* option.attr: The property in each option
array to use for
* additional selection attributes. Defaults
to none.
* option.disable: The property that will hold
the disabled state.
* Defaults to "disable".
* option.key: The property that will hold the
selection value.
* Defaults to "value".
* option.label: The property in each option
array to use as the
* selection label attribute. If a
"label" option is provided, defaults to
* "label", if no label is given,
defaults to null (none).
* option.text: The property that will hold
the the displayed text.
* Defaults to "text". If set to
null, the option array is assumed to be a
* list of displayable scalars.
* @param string $optText The property that will hold the the
displayed text. This
* parameter is ignored if an options array is
passed.
* @param boolean $disable Not used.
*
* @return stdClass
*
* @since 1.5
*/
public static function option($value, $text = '', $optKey =
'value', $optText = 'text', $disable = false)
{
$options = array(
'attr' => null,
'disable' => false,
'option.attr' => null,
'option.disable' => 'disable',
'option.key' => 'value',
'option.label' => null,
'option.text' => 'text',
);
if (is_array($optKey))
{
// Merge in caller's options
$options = array_merge($options, $optKey);
}
else
{
// Get options from the parameters
$options['option.key'] = $optKey;
$options['option.text'] = $optText;
$options['disable'] = $disable;
}
$obj = new stdClass;
$obj->{$options['option.key']} = $value;
$obj->{$options['option.text']} = trim($text) ? $text :
$value;
/*
* If a label is provided, save it. If no label is provided and there is
* a label name, initialise to an empty string.
*/
$hasProperty = $options['option.label'] !== null;
if (isset($options['label']))
{
$labelProperty = $hasProperty ? $options['option.label'] :
'label';
$obj->$labelProperty = $options['label'];
}
elseif ($hasProperty)
{
$obj->{$options['option.label']} = '';
}
// Set attributes only if there is a property and a value
if ($options['attr'] !== null)
{
$obj->{$options['option.attr']} =
$options['attr'];
}
// Set disable only if it has a property and a value
if ($options['disable'] !== null)
{
$obj->{$options['option.disable']} =
$options['disable'];
}
return $obj;
}
/**
* Generates the option tags for an HTML select list (with no select tag
* surrounding the options).
*
* @param array $arr An array of objects, arrays, or values.
* @param mixed $optKey If a string, this is the name of the
object variable for
* the option value. If null, the index of
the array of objects is used. If
* an array, this is a set of options, as
key/value pairs. Valid options are:
* -Format options, {@see
JHtml::$formatOptions}.
* -groups: Boolean. If set, looks for keys
with the value
* "<optgroup>" and
synthesizes groups from them. Deprecated. Defaults
* true for backwards compatibility.
* -list.select: either the value of one
selected option or an array
* of selected options. Default: none.
* -list.translate: Boolean. If set, text
and labels are translated via
* JText::_(). Default is false.
* -option.id: The property in each option
array to use as the
* selection id attribute. Defaults to
none.
* -option.key: The property in each option
array to use as the
* selection value. Defaults to
"value". If set to null, the index of the
* option array is used.
* -option.label: The property in each
option array to use as the
* selection label attribute. Defaults to
null (none).
* -option.text: The property in each option
array to use as the
* displayed text. Defaults to
"text". If set to null, the option array is
* assumed to be a list of displayable
scalars.
* -option.attr: The property in each option
array to use for
* additional selection attributes.
Defaults to none.
* -option.disable: The property that will
hold the disabled state.
* Defaults to "disable".
* -option.key: The property that will hold
the selection value.
* Defaults to "value".
* -option.text: The property that will hold
the the displayed text.
* Defaults to "text". If set to
null, the option array is assumed to be a
* list of displayable scalars.
* @param string $optText The name of the object variable for the
option text.
* @param mixed $selected The key that is selected (accepts an
array or a string)
* @param boolean $translate Translate the option values.
*
* @return string HTML for the select list
*
* @since 1.5
*/
public static function options($arr, $optKey = 'value', $optText
= 'text', $selected = null, $translate = false)
{
$options = array_merge(
JHtml::$formatOptions,
static::$optionDefaults['option'],
array('format.depth' => 0, 'groups' => true,
'list.select' => null, 'list.translate' => false)
);
if (is_array($optKey))
{
// Set default options and overwrite with anything passed in
$options = array_merge($options, $optKey);
}
else
{
// Get options from the parameters
$options['option.key'] = $optKey;
$options['option.text'] = $optText;
$options['list.select'] = $selected;
$options['list.translate'] = $translate;
}
$html = '';
$baseIndent = str_repeat($options['format.indent'],
$options['format.depth']);
foreach ($arr as $elementKey => &$element)
{
$attr = '';
$extra = '';
$label = '';
$id = '';
if (is_array($element))
{
$key = $options['option.key'] === null ? $elementKey :
$element[$options['option.key']];
$text = $element[$options['option.text']];
if (isset($element[$options['option.attr']]))
{
$attr = $element[$options['option.attr']];
}
if (isset($element[$options['option.id']]))
{
$id = $element[$options['option.id']];
}
if (isset($element[$options['option.label']]))
{
$label = $element[$options['option.label']];
}
if (isset($element[$options['option.disable']]) &&
$element[$options['option.disable']])
{
$extra .= ' disabled="disabled"';
}
}
elseif (is_object($element))
{
$key = $options['option.key'] === null ? $elementKey :
$element->{$options['option.key']};
$text = $element->{$options['option.text']};
if (isset($element->{$options['option.attr']}))
{
$attr = $element->{$options['option.attr']};
}
if (isset($element->{$options['option.id']}))
{
$id = $element->{$options['option.id']};
}
if (isset($element->{$options['option.label']}))
{
$label = $element->{$options['option.label']};
}
if (isset($element->{$options['option.disable']})
&& $element->{$options['option.disable']})
{
$extra .= ' disabled="disabled"';
}
if (isset($element->{$options['option.class']}) &&
$element->{$options['option.class']})
{
$extra .= ' class="' .
$element->{$options['option.class']} . '"';
}
if (isset($element->{$options['option.onclick']})
&& $element->{$options['option.onclick']})
{
$extra .= ' onclick="' .
$element->{$options['option.onclick']} . '"';
}
}
else
{
// This is a simple associative array
$key = $elementKey;
$text = $element;
}
/*
* The use of options that contain optgroup HTML elements was
* somewhat hacked for J1.5. J1.6 introduces the grouplist() method
* to handle this better. The old solution is retained through the
* "groups" option, which defaults true in J1.6, but should be
* deprecated at some point in the future.
*/
$key = (string) $key;
if ($key === '<OPTGROUP>' &&
$options['groups'])
{
$html .= $baseIndent . '<optgroup label="' .
($options['list.translate'] ? JText::_($text) : $text) .
'">' . $options['format.eol'];
$baseIndent = str_repeat($options['format.indent'],
++$options['format.depth']);
}
elseif ($key === '</OPTGROUP>' &&
$options['groups'])
{
$baseIndent = str_repeat($options['format.indent'],
--$options['format.depth']);
$html .= $baseIndent . '</optgroup>' .
$options['format.eol'];
}
else
{
// If no string after hyphen - take hyphen out
$splitText = explode(' - ', $text, 2);
$text = $splitText[0];
if (isset($splitText[1]) && $splitText[1] !== ''
&& !preg_match('/^[\s]+$/', $splitText[1]))
{
$text .= ' - ' . $splitText[1];
}
if (!empty($label) && $options['list.translate'])
{
$label = JText::_($label);
}
if ($options['option.label.toHtml'])
{
$label = htmlentities($label);
}
if (is_array($attr))
{
$attr = ArrayHelper::toString($attr);
}
else
{
$attr = trim($attr);
}
$extra = ($id ? ' id="' . $id . '"' :
'') . ($label ? ' label="' . $label .
'"' : '') . ($attr ? ' ' . $attr :
'') . $extra;
if (is_array($options['list.select']))
{
foreach ($options['list.select'] as $val)
{
$key2 = is_object($val) ? $val->{$options['option.key']}
: $val;
if ($key == $key2)
{
$extra .= ' selected="selected"';
break;
}
}
}
elseif ((string) $key === (string) $options['list.select'])
{
$extra .= ' selected="selected"';
}
if ($options['list.translate'])
{
$text = JText::_($text);
}
// Generate the option, encoding as required
$html .= $baseIndent . '<option value="' .
($options['option.key.toHtml'] ? htmlspecialchars($key,
ENT_COMPAT, 'UTF-8') : $key) . '"'
. $extra . '>';
$html .= $options['option.text.toHtml'] ?
htmlentities(html_entity_decode($text, ENT_COMPAT, 'UTF-8'),
ENT_COMPAT, 'UTF-8') : $text;
$html .= '</option>' .
$options['format.eol'];
}
}
return $html;
}
/**
* Generates an HTML radio list.
*
* @param array $data An array of objects
* @param string $name The value of the HTML name attribute
* @param string $attribs Additional HTML attributes for the
`<select>` tag
* @param mixed $optKey The key that is selected
* @param string $optText The name of the object variable for the
option value
* @param string $selected The name of the object variable for the
option text
* @param boolean $idtag Value of the field id or null by default
* @param boolean $translate True if options will be translated
*
* @return string HTML for the select list
*
* @since 1.5
*/
public static function radiolist($data, $name, $attribs = null, $optKey =
'value', $optText = 'text', $selected = null, $idtag =
false,
$translate = false)
{
if (is_array($attribs))
{
$attribs = ArrayHelper::toString($attribs);
}
$id_text = $idtag ?: $name;
$html = '<div class="controls">';
foreach ($data as $obj)
{
$k = $obj->$optKey;
$t = $translate ? JText::_($obj->$optText) : $obj->$optText;
$id = (isset($obj->id) ? $obj->id : null);
$extra = '';
$id = $id ? $obj->id : $id_text . $k;
if (is_array($selected))
{
foreach ($selected as $val)
{
$k2 = is_object($val) ? $val->$optKey : $val;
if ($k == $k2)
{
$extra .= ' selected="selected" ';
break;
}
}
}
else
{
$extra .= ((string) $k === (string) $selected ? '
checked="checked" ' : '');
}
$html .= "\n\t" . '<label for="' . $id .
'" id="' . $id . '-lbl"
class="radio">';
$html .= "\n\t\n\t" . '<input type="radio"
name="' . $name . '" id="' . $id .
'" value="' . $k . '" ' . $extra
. $attribs . ' />' . $t;
$html .= "\n\t" . '</label>';
}
$html .= "\n";
$html .= '</div>';
$html .= "\n";
return $html;
}
}
sidebar.php000064400000006147151156052000006671 0ustar00<?php
/**
* @package Joomla.Libraries
* @subpackage HTML
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('JPATH_PLATFORM') or die;
/**
* Utility class to render a list view sidebar
*
* @since 3.0
*/
abstract class JHtmlSidebar
{
/**
* Menu entries
*
* @var array
* @since 3.0
*/
protected static $entries = array();
/**
* Filters
*
* @var array
* @since 3.0
*/
protected static $filters = array();
/**
* Value for the action attribute of the form.
*
* @var string
* @since 3.0
*/
protected static $action = '';
/**
* Render the sidebar.
*
* @return string The necessary HTML to display the sidebar
*
* @since 3.0
*/
public static function render()
{
// Collect display data
$data = new stdClass;
$data->list = static::getEntries();
$data->filters = static::getFilters();
$data->action = static::getAction();
$data->displayMenu = count($data->list);
$data->displayFilters = count($data->filters);
$data->hide =
JFactory::getApplication()->input->getBool('hidemainmenu');
// Create a layout object and ask it to render the sidebar
$layout = new JLayoutFile('joomla.sidebars.submenu');
return $layout->render($data);
}
/**
* Method to add a menu item to submenu.
*
* @param string $name Name of the menu item.
* @param string $link URL of the menu item.
* @param bool $active True if the item is active, false otherwise.
*
* @return void
*
* @since 3.0
*/
public static function addEntry($name, $link = '', $active =
false)
{
static::$entries[] = array($name, $link, $active);
}
/**
* Returns an array of all submenu entries
*
* @return array
*
* @since 3.0
*/
public static function getEntries()
{
return static::$entries;
}
/**
* Method to add a filter to the submenu
*
* @param string $label Label for the menu item.
* @param string $name Name for the filter. Also used as id.
* @param string $options Options for the select field.
* @param bool $noDefault Don't show the label as the empty
option
*
* @return void
*
* @since 3.0
*/
public static function addFilter($label, $name, $options, $noDefault =
false)
{
static::$filters[] = array('label' => $label,
'name' => $name, 'options' => $options,
'noDefault' => $noDefault);
}
/**
* Returns an array of all filters
*
* @return array
*
* @since 3.0
*/
public static function getFilters()
{
return static::$filters;
}
/**
* Set value for the action attribute of the filter form
*
* @param string $action Value for the action attribute of the form
*
* @return void
*
* @since 3.0
*/
public static function setAction($action)
{
static::$action = $action;
}
/**
* Get value for the action attribute of the filter form
*
* @return string
*
* @since 3.0
*/
public static function getAction()
{
return static::$action;
}
}
sliders.php000064400000010406151156052000006716 0ustar00<?php
/**
* @package Joomla.Libraries
* @subpackage HTML
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('JPATH_PLATFORM') or die;
/**
* Utility class for Sliders elements
*
* @since 1.6
* @deprecated 3.7.0 These helpers are dependent on the deprecated
MooTools support
*/
abstract class JHtmlSliders
{
/**
* Creates a panes and loads the javascript behavior for it.
*
* @param string $group The pane identifier.
* @param array $params An array of options.
*
* @return string
*
* @since 1.6
* @deprecated 3.7.0 These helpers are dependent on the deprecated
MooTools support
*/
public static function start($group = 'sliders', $params =
array())
{
static::loadBehavior($group, $params);
return '<div id="' . $group . '"
class="pane-sliders"><div
style="display:none;"><div>';
}
/**
* Close the current pane.
*
* @return string hTML to close the pane
*
* @since 1.6
* @deprecated 3.7.0 These helpers are dependent on the deprecated
MooTools support
*/
public static function end()
{
return '</div></div></div>';
}
/**
* Begins the display of a new panel.
*
* @param string $text Text to display.
* @param string $id Identifier of the panel.
*
* @return string HTML to start a panel
*
* @since 1.6
* @deprecated 3.7.0 These helpers are dependent on the deprecated
MooTools support
*/
public static function panel($text, $id)
{
return '</div></div><div
class="panel"><h3 class="pane-toggler title"
id="' . $id . '"><a
href="javascript:void(0);"><span>' . $text
. '</span></a></h3><div
class="pane-slider content">';
}
/**
* Load the JavaScript behavior.
*
* @param string $group The pane identifier.
* @param array $params Array of options.
*
* @return void
*
* @since 1.6
* @deprecated 3.7.0 These helpers are dependent on the deprecated
MooTools support
*/
protected static function loadBehavior($group, $params = array())
{
static $loaded = array();
if (!array_key_exists($group, $loaded))
{
// Get the JInput object
$input = JFactory::getApplication()->input;
$loaded[$group] = true;
// Include mootools framework.
JHtml::_('behavior.framework', true);
$document = JFactory::getDocument();
$display = (isset($params['startOffset']) &&
isset($params['startTransition']) &&
$params['startTransition'])
? (int) $params['startOffset'] : null;
$show = (isset($params['startOffset']) &&
!(isset($params['startTransition']) &&
$params['startTransition']))
? (int) $params['startOffset'] : null;
$opt['onActive'] = "\\function(toggler, i)
{toggler.addClass('pane-toggler-down');" .
"toggler.removeClass('pane-toggler');i.addClass('pane-down');i.removeClass('pane-hide');Cookie.write('jpanesliders_"
. $group . "',$$('div#" . $group .
".pane-sliders > .panel > h3').indexOf(toggler));}";
$opt['onBackground'] = "\\function(toggler, i)
{toggler.addClass('pane-toggler');" .
"toggler.removeClass('pane-toggler-down');i.addClass('pane-hide');i.removeClass('pane-down');if($$('div#"
. $group . ".pane-sliders > .panel >
h3').length==$$('div#" . $group
. ".pane-sliders > .panel > h3.pane-toggler').length)
Cookie.write('jpanesliders_" . $group . "',-1);}";
$opt['duration'] = isset($params['duration']) ?
(int) $params['duration'] : 300;
$opt['display'] = (isset($params['useCookie'])
&& $params['useCookie']) ?
$input->cookie->get('jpanesliders_' . $group, $display,
'integer')
: $display;
$opt['show'] = (isset($params['useCookie'])
&& $params['useCookie']) ?
$input->cookie->get('jpanesliders_' . $group, $show,
'integer') : $show;
$opt['opacity'] =
(isset($params['opacityTransition']) &&
$params['opacityTransition']) ? 'true' :
'false';
$opt['alwaysHide'] =
(isset($params['allowAllClose']) &&
(!$params['allowAllClose'])) ? 'false' :
'true';
$options = JHtml::getJSObject($opt);
$js = "window.addEvent('domready', function(){ new
Fx.Accordion($$('div#" . $group
. ".pane-sliders > .panel > h3.pane-toggler'),
$$('div#" . $group . ".pane-sliders > .panel >
div.pane-slider'), " . $options
. "); });";
$document->addScriptDeclaration($js);
}
}
}
sortablelist.php000064400000005741151156052000007766 0ustar00<?php
/**
* @package Joomla.Libraries
* @subpackage HTML
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('JPATH_PLATFORM') or die;
/**
* HTML utility class for creating a sortable table list
*
* @since 3.0
*/
abstract class JHtmlSortablelist
{
/**
* @var array Array containing information for loaded files
* @since 3.0
*/
protected static $loaded = array();
/**
* Method to load the Sortable script and make table sortable
*
* @param string $tableId DOM id of the table
* @param string $formId DOM id of the form
* @param string $sortDir Sort direction
* @param string $saveOrderingUrl Save ordering url, ajax-load
after an item dropped
* @param boolean $proceedSaveOrderButton Set whether a save order
button is displayed
* @param boolean $nestedList Set whether the list is a
nested list
*
* @return void
*
* @since 3.0
*
* @throws InvalidArgumentException
*/
public static function sortable($tableId, $formId, $sortDir =
'asc', $saveOrderingUrl = null, $proceedSaveOrderButton = true,
$nestedList = false)
{
// Only load once
if (isset(static::$loaded[__METHOD__]))
{
return;
}
// Note: $i is required but has to be an optional argument in the
function call due to argument order
if ($saveOrderingUrl === null)
{
throw new InvalidArgumentException(sprintf('$saveOrderingUrl is a
required argument in %s()', __METHOD__));
}
$displayData = array(
'tableId' => $tableId,
'formId' => $formId,
'sortDir' => $sortDir,
'saveOrderingUrl' => $saveOrderingUrl,
'nestedList' => $nestedList,
'proceedSaveOrderButton' => $proceedSaveOrderButton,
);
JLayoutHelper::render('joomla.html.sortablelist',
$displayData);
// Set static array
static::$loaded[__METHOD__] = true;
return;
}
/**
* Method to inject script for enabled and disable Save order button
* when changing value of ordering input boxes
*
* @return void
*
* @since 3.0
*
* @deprecated 4.0 The logic is merged in the JLayout file
*/
public static function _proceedSaveOrderButton()
{
JFactory::getDocument()->addScriptDeclaration(
"(function ($){
$(document).ready(function (){
var saveOrderButton = $('.saveorder');
saveOrderButton.css({'opacity':'0.2',
'cursor':'default'}).attr('onclick','return
false;');
var oldOrderingValue = '';
$('.text-area-order').focus(function ()
{
oldOrderingValue = $(this).attr('value');
})
.keyup(function (){
var newOrderingValue = $(this).attr('value');
if (oldOrderingValue != newOrderingValue)
{
saveOrderButton.css({'opacity':'1',
'cursor':'pointer'}).removeAttr('onclick')
}
});
});
})(jQuery);"
);
return;
}
}
string.php000064400000022340151156052000006557 0ustar00<?php
/**
* @package Joomla.Libraries
* @subpackage HTML
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('JPATH_PLATFORM') or die;
use Joomla\String\StringHelper;
/**
* HTML helper class for rendering manipulated strings.
*
* @since 1.6
*/
abstract class JHtmlString
{
/**
* Truncates text blocks over the specified character limit and closes
* all open HTML tags. The method will optionally not truncate an
individual
* word, it will find the first space that is within the limit and
* truncate at that point. This method is UTF-8 safe.
*
* @param string $text The text to truncate.
* @param integer $length The maximum length of the text.
* @param boolean $noSplit Don't split a word if that is where
the cutoff occurs (default: true).
* @param boolean $allowHtml Allow HTML tags in the output, and close
any open tags (default: true).
*
* @return string The truncated text.
*
* @since 1.6
*/
public static function truncate($text, $length = 0, $noSplit = true,
$allowHtml = true)
{
// Assume a lone open tag is invalid HTML.
if ($length === 1 && $text[0] === '<')
{
return '...';
}
// Check if HTML tags are allowed.
if (!$allowHtml)
{
// Deal with spacing issues in the input.
$text = str_replace('>', '> ', $text);
$text = str_replace(array(' ',
' '), ' ', $text);
$text = StringHelper::trim(preg_replace('#\s+#mui', '
', $text));
// Strip the tags from the input and decode entities.
$text = strip_tags($text);
$text = html_entity_decode($text, ENT_QUOTES, 'UTF-8');
// Remove remaining extra spaces.
$text = str_replace(' ', ' ', $text);
$text = StringHelper::trim(preg_replace('#\s+#mui', '
', $text));
}
// Whether or not allowing HTML, truncate the item text if it is too
long.
if ($length > 0 && StringHelper::strlen($text) > $length)
{
$tmp = trim(StringHelper::substr($text, 0, $length));
if ($tmp[0] === '<' && strpos($tmp,
'>') === false)
{
return '...';
}
// $noSplit true means that we do not allow splitting of words.
if ($noSplit)
{
// Find the position of the last space within the allowed length.
$offset = StringHelper::strrpos($tmp, ' ');
$tmp = StringHelper::substr($tmp, 0, $offset + 1);
// If there are no spaces and the string is longer than the maximum
// we need to just use the ellipsis. In that case we are done.
if ($offset === false && strlen($text) > $length)
{
return '...';
}
if (StringHelper::strlen($tmp) > $length - 3)
{
$tmp = trim(StringHelper::substr($tmp, 0, StringHelper::strrpos($tmp,
' ')));
}
}
if ($allowHtml)
{
// Put all opened tags into an array
preg_match_all("#<([a-z][a-z0-9]*)\b.*?(?!/)>#i", $tmp,
$result);
$openedTags = $result[1];
// Some tags self close so they do not need a separate close tag.
$openedTags = array_diff($openedTags, array('img',
'hr', 'br'));
$openedTags = array_values($openedTags);
// Put all closed tags into an array
preg_match_all("#</([a-z][a-z0-9]*)\b(?:[^>]*?)>#iU",
$tmp, $result);
$closedTags = $result[1];
$numOpened = count($openedTags);
// Not all tags are closed so trim the text and finish.
if (count($closedTags) !== $numOpened)
{
// Closing tags need to be in the reverse order of opening tags.
$openedTags = array_reverse($openedTags);
// Close tags
for ($i = 0; $i < $numOpened; $i++)
{
if (!in_array($openedTags[$i], $closedTags))
{
$tmp .= '</' . $openedTags[$i] . '>';
}
else
{
unset($closedTags[array_search($openedTags[$i], $closedTags)]);
}
}
}
// Check if we are within a tag
if (StringHelper::strrpos($tmp, '<') >
StringHelper::strrpos($tmp, '>'))
{
$offset = StringHelper::strrpos($tmp, '<');
$tmp = StringHelper::trim(StringHelper::substr($tmp, 0, $offset));
}
}
if ($tmp === false || strlen($text) > strlen($tmp))
{
$text = trim($tmp) . '...';
}
}
// Clean up any internal spaces created by the processing.
$text = str_replace(' </', '</', $text);
$text = str_replace(' ...', '...', $text);
return $text;
}
/**
* Method to extend the truncate method to more complex situations
*
* The goal is to get the proper length plain text string with as much of
* the html intact as possible with all tags properly closed.
*
* @param string $html The content of the introtext to be
truncated
* @param integer $maxLength The maximum number of characters to
render
* @param boolean $noSplit Don't split a word if that is where
the cutoff occurs (default: true).
*
* @return string The truncated string. If the string is truncated an
ellipsis
* (...) will be appended.
*
* @note If a maximum length of 3 or less is selected and the text has
more than
* that number of characters an ellipsis will be displayed.
* This method will not create valid HTML from malformed HTML.
*
* @since 3.1
*/
public static function truncateComplex($html, $maxLength = 0, $noSplit =
true)
{
// Start with some basic rules.
$baseLength = strlen($html);
// If the original HTML string is shorter than the $maxLength do nothing
and return that.
if ($baseLength <= $maxLength || $maxLength === 0)
{
return $html;
}
// Take care of short simple cases.
if ($maxLength <= 3 && $html[0] !== '<'
&& strpos(substr($html, 0, $maxLength - 1), '<') ===
false && $baseLength > $maxLength)
{
return '...';
}
// Deal with maximum length of 1 where the string starts with a tag.
if ($maxLength === 1 && $html[0] === '<')
{
$endTagPos = strlen(strstr($html, '>', true));
$tag = substr($html, 1, $endTagPos);
$l = $endTagPos + 1;
if ($noSplit)
{
return substr($html, 0, $l) . '</' . $tag .
'...';
}
// TODO: $character doesn't seem to be used...
$character = substr(strip_tags($html), 0, 1);
return substr($html, 0, $l) . '</' . $tag .
'...';
}
// First get the truncated plain text string. This is the rendered text
we want to end up with.
$ptString = JHtml::_('string.truncate', $html, $maxLength,
$noSplit, $allowHtml = false);
// It's all HTML, just return it.
if ($ptString === '')
{
return $html;
}
// If the plain text is shorter than the max length the variable will not
end in ...
// In that case we use the whole string.
if (substr($ptString, -3) !== '...')
{
return $html;
}
// Regular truncate gives us the ellipsis but we want to go back for text
and tags.
if ($ptString === '...')
{
$stripped = substr(strip_tags($html), 0, $maxLength);
$ptString = JHtml::_('string.truncate', $stripped, $maxLength,
$noSplit, $allowHtml = false);
}
// We need to trim the ellipsis that truncate adds.
$ptString = rtrim($ptString, '.');
// Now deal with more complex truncation.
while ($maxLength <= $baseLength)
{
// Get the truncated string assuming HTML is allowed.
$htmlString = JHtml::_('string.truncate', $html, $maxLength,
$noSplit, $allowHtml = true);
if ($htmlString === '...' && strlen($ptString) + 3
> $maxLength)
{
return $htmlString;
}
$htmlString = rtrim($htmlString, '.');
// Now get the plain text from the HTML string and trim it.
$htmlStringToPtString = JHtml::_('string.truncate',
$htmlString, $maxLength, $noSplit, $allowHtml = false);
$htmlStringToPtString = rtrim($htmlStringToPtString, '.');
// If the new plain text string matches the original plain text string
we are done.
if ($ptString === $htmlStringToPtString)
{
return $htmlString . '...';
}
// Get the number of HTML tag characters in the first $maxLength
characters
$diffLength = strlen($ptString) - strlen($htmlStringToPtString);
if ($diffLength <= 0)
{
return $htmlString . '...';
}
// Set new $maxlength that adjusts for the HTML tags
$maxLength += $diffLength;
}
}
/**
* Abridges text strings over the specified character limit. The
* behavior will insert an ellipsis into the text replacing a section
* of variable size to ensure the string does not exceed the defined
* maximum length. This method is UTF-8 safe.
*
* For example, it transforms "Really long title" to
"Really...title".
*
* Note that this method does not scan for HTML tags so will potentially
break them.
*
* @param string $text The text to abridge.
* @param integer $length The maximum length of the text (default is
50).
* @param integer $intro The maximum length of the intro text
(default is 30).
*
* @return string The abridged text.
*
* @since 1.6
*/
public static function abridge($text, $length = 50, $intro = 30)
{
// Abridge the item text if it is too long.
if (StringHelper::strlen($text) > $length)
{
// Determine the remaining text length.
$remainder = $length - ($intro + 3);
// Extract the beginning and ending text sections.
$beg = StringHelper::substr($text, 0, $intro);
$end = StringHelper::substr($text, StringHelper::strlen($text) -
$remainder);
// Build the resulting string.
$text = $beg . '...' . $end;
}
return $text;
}
}
tabs.php000064400000006236151156052000006210 0ustar00<?php
/**
* @package Joomla.Libraries
* @subpackage HTML
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('JPATH_PLATFORM') or die;
/**
* Utility class for Tabs elements.
*
* @since 1.6
* @deprecated 3.7.0 These helpers are dependent on the deprecated
MooTools support
*/
abstract class JHtmlTabs
{
/**
* Creates a panes and creates the JavaScript object for it.
*
* @param string $group The pane identifier.
* @param array $params An array of option.
*
* @return string
*
* @since 1.6
* @deprecated 3.7.0 These helpers are dependent on the deprecated
MooTools support
*/
public static function start($group = 'tabs', $params = array())
{
static::loadBehavior($group, $params);
return '<dl class="tabs" id="' . $group .
'"><dt style="display:none;"></dt><dd
style="display:none;">';
}
/**
* Close the current pane
*
* @return string HTML to close the pane
*
* @since 1.6
* @deprecated 3.7.0 These helpers are dependent on the deprecated
MooTools support
*/
public static function end()
{
return '</dd></dl>';
}
/**
* Begins the display of a new panel.
*
* @param string $text Text to display.
* @param string $id Identifier of the panel.
*
* @return string HTML to start a new panel
*
* @since 1.6
* @deprecated 3.7.0 These helpers are dependent on the deprecated
MooTools support
*/
public static function panel($text, $id)
{
return '</dd><dt class="tabs ' . $id .
'"><span><h3><a
href="javascript:void(0);">' . $text .
'</a></h3></span></dt><dd
class="tabs">';
}
/**
* Load the JavaScript behavior.
*
* @param string $group The pane identifier.
* @param array $params Array of options.
*
* @return void
*
* @since 1.6
* @deprecated 3.7.0 These helpers are dependent on the deprecated
MooTools support
*/
protected static function loadBehavior($group, $params = array())
{
static $loaded = array();
if (!array_key_exists((string) $group, $loaded))
{
// Include MooTools framework
JHtml::_('behavior.framework', true);
$opt['onActive'] =
isset($params['onActive']) ? '\\' .
$params['onActive'] : null;
$opt['onBackground'] =
isset($params['onBackground']) ? '\\' .
$params['onBackground'] : null;
$opt['display'] =
isset($params['startOffset']) ? (int)
$params['startOffset'] : null;
$opt['titleSelector'] = 'dt.tabs';
$opt['descriptionSelector'] = 'dd.tabs';
// When use storage is set and value is false - By default we allow to
use storage
$opt['useStorage'] = !(isset($params['useCookie'])
&& !$params['useCookie']);
$options = JHtml::getJSObject($opt);
$js = ' window.addEvent(\'domready\', function(){
$$(\'dl#' . $group .
'.tabs\').each(function(tabs){
new JTabs(tabs, ' . $options . ');
});
});';
$document = JFactory::getDocument();
$document->addScriptDeclaration($js);
JHtml::_('script', 'system/tabs.js',
array('version' => 'auto', 'relative'
=> true));
$loaded[(string) $group] = true;
}
}
}
tag.php000064400000011116151156052000006023 0ustar00<?php
/**
* @package Joomla.Libraries
* @subpackage HTML
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('JPATH_PLATFORM') or die;
use Joomla\Utilities\ArrayHelper;
/**
* Utility class for tags
*
* @since 3.1
*/
abstract class JHtmlTag
{
/**
* Cached array of the tag items.
*
* @var array
* @since 3.1
*/
protected static $items = array();
/**
* Returns an array of tags.
*
* @param array $config An array of configuration options. By default,
only
* published and unpublished categories are
returned.
*
* @return array
*
* @since 3.1
*/
public static function options($config =
array('filter.published' => array(0, 1)))
{
$hash = md5(serialize($config));
if (!isset(static::$items[$hash]))
{
$config = (array) $config;
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select('a.id, a.title, a.level')
->from('#__tags AS a')
->where('a.parent_id > 0');
// Filter on the published state
if (isset($config['filter.published']))
{
if (is_numeric($config['filter.published']))
{
$query->where('a.published = ' . (int)
$config['filter.published']);
}
elseif (is_array($config['filter.published']))
{
$config['filter.published'] =
ArrayHelper::toInteger($config['filter.published']);
$query->where('a.published IN (' . implode(',',
$config['filter.published']) . ')');
}
}
// Filter on the language
if (isset($config['filter.language']))
{
if (is_string($config['filter.language']))
{
$query->where('a.language = ' .
$db->quote($config['filter.language']));
}
elseif (is_array($config['filter.language']))
{
foreach ($config['filter.language'] as &$language)
{
$language = $db->quote($language);
}
$query->where('a.language IN (' . implode(',',
$config['filter.language']) . ')');
}
}
$query->order('a.lft');
$db->setQuery($query);
$items = $db->loadObjectList();
// Assemble the list options.
static::$items[$hash] = array();
foreach ($items as &$item)
{
$repeat = ($item->level - 1 >= 0) ? $item->level - 1 : 0;
$item->title = str_repeat('- ', $repeat) .
$item->title;
static::$items[$hash][] = JHtml::_('select.option',
$item->id, $item->title);
}
}
return static::$items[$hash];
}
/**
* Returns an array of tags.
*
* @param array $config An array of configuration options. By default,
only published and unpublished tags are returned.
*
* @return array Tag data
*
* @since 3.1
*/
public static function tags($config = array('filter.published'
=> array(0, 1)))
{
$hash = md5(serialize($config));
$config = (array) $config;
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select('a.id, a.title, a.level, a.parent_id')
->from('#__tags AS a')
->where('a.parent_id > 0');
// Filter on the published state
if (isset($config['filter.published']))
{
if (is_numeric($config['filter.published']))
{
$query->where('a.published = ' . (int)
$config['filter.published']);
}
elseif (is_array($config['filter.published']))
{
$config['filter.published'] =
ArrayHelper::toInteger($config['filter.published']);
$query->where('a.published IN (' . implode(',',
$config['filter.published']) . ')');
}
}
$query->order('a.lft');
$db->setQuery($query);
$items = $db->loadObjectList();
// Assemble the list options.
static::$items[$hash] = array();
foreach ($items as &$item)
{
$repeat = ($item->level - 1 >= 0) ? $item->level - 1 : 0;
$item->title = str_repeat('- ', $repeat) . $item->title;
static::$items[$hash][] = JHtml::_('select.option',
$item->id, $item->title);
}
return static::$items[$hash];
}
/**
* This is just a proxy for the formbehavior.ajaxchosen method
*
* @param string $selector DOM id of the tag field
* @param boolean $allowCustom Flag to allow custom values
*
* @return void
*
* @since 3.1
*/
public static function ajaxfield($selector = '#jform_tags',
$allowCustom = true)
{
// Get the component parameters
$params = JComponentHelper::getParams('com_tags');
$minTermLength = (int) $params->get('min_term_length', 3);
$displayData = array(
'minTermLength' => $minTermLength,
'selector' => $selector,
'allowCustom' =>
JFactory::getUser()->authorise('core.create',
'com_tags') ? $allowCustom : false,
);
JLayoutHelper::render('joomla.html.tag', $displayData);
return;
}
}
tel.php000064400000004215151156052000006036 0ustar00<?php
/**
* @package Joomla.Libraries
* @subpackage HTML
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('JPATH_PLATFORM') or die;
/**
* HTML helper class for rendering telephone numbers.
*
* @since 1.6
*/
abstract class JHtmlTel
{
/**
* Converts strings of integers into more readable telephone format
*
* By default, the ITU-T format will automatically be used.
* However, one of the allowed unit types may also be used instead.
*
* @param integer $number The integers in a phone number with dot
separated country code
* ccc.nnnnnnn where ccc represents
country code and nnn represents the local number.
* @param string $displayplan The numbering plan used to display the
numbers.
*
* @return string The formatted telephone number.
*
* @see JFormRuleTel
* @since 1.6
*/
public static function tel($number, $displayplan)
{
$number = explode('.', $number);
$countrycode = $number[0];
$number = $number[1];
if ($displayplan === 'ITU-T' || $displayplan ===
'International' || $displayplan === 'int' ||
$displayplan === 'missdn' || $displayplan == null)
{
$display[0] = '+';
$display[1] = $countrycode;
$display[2] = ' ';
$display[3] = implode(' ', str_split($number, 2));
}
elseif ($displayplan === 'NANP' || $displayplan ===
'northamerica' || $displayplan === 'US')
{
$display[0] = '(';
$display[1] = substr($number, 0, 3);
$display[2] = ') ';
$display[3] = substr($number, 3, 3);
$display[4] = '-';
$display[5] = substr($number, 6, 4);
}
elseif ($displayplan === 'EPP' || $displayplan ===
'IETF')
{
$display[0] = '+';
$display[1] = $countrycode;
$display[2] = '.';
$display[3] = $number;
}
elseif ($displayplan === 'ARPA' || $displayplan ===
'ENUM')
{
$number = implode('.', str_split(strrev($number), 1));
$display[0] = '+';
$display[1] = $number;
$display[2] = '.';
$display[3] = $countrycode;
$display[4] = '.e164.arpa';
}
return implode('', $display);
}
}
user.php000064400000003221151156052000006224 0ustar00<?php
/**
* @package Joomla.Libraries
* @subpackage HTML
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('JPATH_PLATFORM') or die;
/**
* Utility class working with users
*
* @since 2.5
*/
abstract class JHtmlUser
{
/**
* Displays a list of user groups.
*
* @param boolean $includeSuperAdmin true to include super admin
groups, false to exclude them
*
* @return array An array containing a list of user groups.
*
* @since 2.5
*/
public static function groups($includeSuperAdmin = false)
{
$options = array_values(JHelperUsergroups::getInstance()->getAll());
for ($i = 0, $n = count($options); $i < $n; $i++)
{
$options[$i]->value = $options[$i]->id;
$options[$i]->text = str_repeat('- ',
$options[$i]->level) . $options[$i]->title;
$groups[] = JHtml::_('select.option', $options[$i]->value,
$options[$i]->text);
}
// Exclude super admin groups if requested
if (!$includeSuperAdmin)
{
$filteredGroups = array();
foreach ($groups as $group)
{
if (!JAccess::checkGroup($group->value, 'core.admin'))
{
$filteredGroups[] = $group;
}
}
$groups = $filteredGroups;
}
return $groups;
}
/**
* Get a list of users.
*
* @return string
*
* @since 2.5
*/
public static function userlist()
{
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select('a.id AS value, a.name AS text')
->from('#__users AS a')
->where('a.block = 0')
->order('a.name');
$db->setQuery($query);
return $db->loadObjectList();
}
}
features.php000064400000017265151160116670007112 0ustar00<?php
/**
* This file is part of Joomla Estate Agency - Joomla! extension for real
estate agency
*
* @package Joomla.Administrator
* @subpackage com_jea
* @copyright Copyright (C) 2008 - 2020 PHILIP Sylvain. All rights
reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Fatures html helper class.
*
* @package Joomla.Administrator
* @subpackage com_jea
*
* @since 2.0
*/
abstract class JHtmlFeatures
{
/**
* Method to get property types in a HTML <select> element
*
* @param string $value The selected value
* @param string $name The element name
* @param mixed $attr An array or a string of element attributes
*
* @return string HTML for the select list.
*/
static public function types($value = 0, $name = 'type_id',
$attr = '')
{
$cond = self::getLanguageCondition();
return self::getHTMLSelectList($value, $name,
'COM_JEA_FIELD_PROPERTY_TYPE_LABEL', $attr, 'types',
$cond, 'f.ordering');
}
/**
* Method to get departments in a HTML <select> element
*
* @param string $value The selected value
* @param string $name The element name
* @param mixed $attr An array or a string of element attributes
*
* @return string HTML for the select list.
*/
static public function departments($value = 0, $name =
'department_id', $attr = '')
{
return self::getHTMLSelectList($value, $name,
'COM_JEA_FIELD_DEPARTMENT_LABEL', $attr,
'departments');
}
/**
* Method to get towns in a HTML <select> element
*
* @param string $value The selected value
* @param string $name The element name
* @param mixed $attr An array or a string of element
attributes
* @param string $department_id To get the department town list
*
* @return string HTML for the select list.
*/
static public function towns($value = 0, $name = 'town_id',
$attr = '', $department_id = null)
{
$condition = '';
if ($department_id !== null)
{
// Potentially Too much results so this will give en empty result
$condition = 'f.department_id = -1';
if ($department_id > 0)
{
$condition = 'f.department_id =' . intval($department_id);
}
}
return self::getHTMLSelectList($value, $name,
'COM_JEA_FIELD_TOWN_LABEL', $attr, 'towns',
$condition);
}
/**
* Method to get areas in a HTML <select> element
*
* @param string $value The selected value
* @param string $name The element name
* @param mixed $attr An array or a string of element attributes
* @param string $town_id To get the town area list
*
* @return string HTML for the select list.
*/
static public function areas($value = 0, $name = 'area_id',
$attr = '', $town_id = null)
{
$condition = '';
if ($town_id !== null)
{
$condition = 'f.town_id = -1';
if ($town_id > 0)
{
$condition = 'f.town_id =' . intval($town_id);
}
}
return self::getHTMLSelectList($value, $name,
'COM_JEA_FIELD_AREA_LABEL', $attr, 'areas',
$condition);
}
/**
* Method to get conditions in a HTML <select> element
*
* @param string $value The selected value
* @param string $name The element name
* @param mixed $attr An array or a string of element attributes
*
* @return string HTML for the select list.
*/
static public function conditions($value = 0, $name =
'condition_id', $attr = '')
{
$cond = self::getLanguageCondition();
return self::getHTMLSelectList($value, $name,
'COM_JEA_FIELD_CONDITION_LABEL', $attr, 'conditions',
$cond);
}
/**
* Method to get hot water types in a HTML <select> element
*
* @param string $value The selected value
* @param string $name The element name
* @param mixed $attr An array or a string of element attributes
*
* @return string HTML for the select list.
*/
static public function hotwatertypes($value = 0, $name =
'hot_water_type', $attr = '')
{
$cond = self::getLanguageCondition();
return self::getHTMLSelectList($value, $name,
'COM_JEA_FIELD_HOTWATERTYPE_LABEL', $attr,
'hotwatertypes', $cond);
}
/**
* Method to get hot heating types in a HTML <select> element
*
* @param string $value The selected value
* @param string $name The element name
* @param mixed $attr An array or a string of element attributes
*
* @return string HTML for the select list.
*/
static public function heatingtypes($value = 0, $name =
'heating_type', $attr = '')
{
$cond = self::getLanguageCondition();
return self::getHTMLSelectList($value, $name,
'COM_JEA_FIELD_HEATINGTYPE_LABEL', $attr,
'heatingtypes', $cond);
}
/**
* Method to get slogans in a HTML <select> element
*
* @param string $value The selected value
* @param string $name The element name
* @param mixed $attr An array or a string of element attributes
*
* @return string HTML for the select list.
*/
static public function slogans($value = 0, $name = 'slogan_id',
$attr = '')
{
$cond = self::getLanguageCondition();
return self::getHTMLSelectList($value, $name,
'COM_JEA_FIELD_SLOGAN_LABEL', $attr, 'slogans', $cond);
}
/**
* Generic method to get HTML list of feature in a <select> element
*
* @param string $value The selected value
* @param string $name The element name
* @param string $defaultOptionLabel The first option label
* @param mixed $attr An array or a string of element
attributes
* @param string $featureTable The feature table name without
the prefix "#__jea_"
* @param mixed $conditions A string or an array of where
conditions to filter the database request
* @param string $ordering The list ordering
*
* @return string HTML for the select list.
*/
static public function getHTMLSelectList($value = 0, $name = '',
$defaultOptionLabel = 'JOPTION_ANY',
$attr = '', $featureTable = '', $conditions = null,
$ordering = 'f.value asc'
)
{
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select('f.id , f.value');
$query->from('#__jea_' . $featureTable . ' AS f');
if (! empty($conditions))
{
if (is_string($conditions))
{
$query->where($conditions);
}
elseif (is_array($conditions))
{
foreach ($conditions as $condition)
{
$query->where($condition);
}
}
}
$query->order($ordering);
$db->setQuery($query);
$items = $db->loadObjectList();
// Assemble the list options.
$options = array();
$options[] = JHTML::_('select.option', '', '-
' . JText::_($defaultOptionLabel) . ' - ');
foreach ($items as &$item)
{
$options[] = JHtml::_('select.option', $item->id,
$item->value);
}
// Manage attributes
$idTag = false;
if (is_array($attr))
{
if (isset($attr['id']))
{
$idTag = $attr['id'];
unset($attr['id']);
}
if (empty($attr['size']))
{
$attr['size'] = 1;
}
if (empty($attr['class']))
{
$attr['class'] = 'inputbox';
}
$attr['class'] = trim($attr['class']);
}
else
{
if ((float) JVERSION > 3 &&
JFactory::getApplication()->isClient('administrator'))
{
$attr = 'class="inputbox span12 small"
size="1" ' . $attr;
}
else
{
$attr = 'class="inputbox" size="1" ' .
$attr;
}
}
return JHTML::_('select.genericlist', $options, $name, $attr,
'value', 'text', $value, $idTag);
}
/**
* Get language condition
*
* @return string
*/
protected static function getLanguageCondition()
{
$condition = '';
if (JFactory::getApplication()->isClient('site'))
{
$db = JFactory::getDbo();
$condition = 'f.language in (' .
$db->quote(JFactory::getLanguage()->getTag()) . ',' .
$db->quote('*') . ')';
}
return $condition;
}
}
contentadministrator.php000064400000003070151160116670011534
0ustar00<?php
/**
* This file is part of Joomla Estate Agency - Joomla! extension for real
estate agency
*
* @package Joomla.Administrator
* @subpackage com_jea
* @copyright Copyright (C) 2008 - 2020 PHILIP Sylvain. All rights
reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\Utilities\ArrayHelper;
/**
* Content administrator html helper class.
*
* @package Joomla.Administrator
* @subpackage com_jea
*
* @since 2.0
*/
abstract class JHtmlContentAdministrator
{
/**
* Helper to display the featured icon in a list of items
*
* @param int $value The state value
* @param int $i The list counter value
* @param boolean $canChange The user right to change the state
*
* @return string
*/
static public function featured($value = 0, $i = 0, $canChange = true)
{
// Array of image, task, title, action
$states = array(
0 => array(
'disabled.png',
'properties.featured',
'COM_JEA_UNFEATURED',
'COM_JEA_TOGGLE_TO_FEATURE'
),
1 => array(
'featured.png',
'properties.unfeatured',
'COM_JEA_FEATURED',
'COM_JEA_TOGGLE_TO_UNFEATURE'
)
);
$state = ArrayHelper::getValue($states, (int) $value, $states[1]);
$html = JHtml::_('image', 'admin/' . $state[0],
JText::_($state[2]), null, true);
if ($canChange)
{
$html = '<a href="#" onclick="return
listItemTask(\'cb' . $i . '\',\'' . $state[1]
. '\')" title="' . JText::_($state[3]) .
'">'
. $html . '</a>';
}
return $html;
}
}
mod_phocacart_cart/default.php000064400000004514151163073200012517
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die;
/*?>
<div class="ph-cart-module-box <?php echo $moduleclass_sfx
;?>">xxx
<div class="dropdown parent g-menu-overlay"
data-g-hover-expand="true" style="opacity: 0;">
<div class="g-menu-parent-indicator"
data-toggle="dropdown" data-hover="dropdown"
data-delay="500" data-close-others="true"
data-g-menuparent="true"><span
class="'.PhocacartRenderIcon::getClass('globe').'"></span>
<sup class="ph-cart-count-sup phItemCartBoxCount"
id="phItemCartBoxCount"><?php echo
$cart->getCartCountItems(); ?></sup></div>
<div class="g-dropdown g-dropdown-right g-fade
g-inactive">
<div id="phItemCartBox" class="ph-item-cart-box
phItemCartBox"><?php echo $cart->render(); ?></div>
</div>
</div>
</div> */ ?>
<?php
// tODO:
/*
min-width: 80%
for mobiles
30 % for large
*/
?>
<nav class="g-main-nav g-menu-hastouch ph-main-nav-mod"
role="navigation" data-g-hover-expand="true">
<ul class="g-toplevel">
<li class="g-menu-item g-menu-item-type-component g-parent
g-fullwidth g-menu-item-link-parent ">
<div class="g-menu-item-container"><span
class="g-menu-item-content">
<span class="<?php echo
$d['s']['i']['shopping-cart']
?>"></span>
<sup class="ph-cart-count-sup phItemCartBoxCount"
id="phItemCartBoxCount"><?php echo
$cart->getCartCountItems(); ?></sup></span>
<span class="g-menu-parent-indicator"
data-g-menuparent=""></span>
</div>
<div class="g-dropdown g-inactive g-fade
g-dropdown-left ph-dropdown-cart"><div
id="phItemCartBox" class="ph-item-cart-box
phItemCartBox"><?php echo $cart->render(); ?></div>
</div>
</li>
</ul>
</nav>
<?php
// Get count of items and get Total (include coupons)
// Both variables can be used e.g. if the cart is hidden and slide up is
used
// Add them to DIV ID because they will change per AJAX
//$count = $cart->getCartCountItems(); // <div
id="phItemCartBoxCount"><Xphp echo
$cart->getCartCountItems(); X></div>
//$total = $cart->getCartTotalItems(); // <div
id="phItemCartBoxTotal"><Xphp echo
$cart->getCartTotalItems(); X></div>
?>
mod_phocacart_cart/index.html000064400000000054151163073200012352
0ustar00<html><body
bgcolor="#FFFFFF"></body></html>com_hikashop/checkout/cart.php000064400000057205151163073200012466
0ustar00<?php
/**
* @package HikaShop for Joomla!
* @version 4.4.4
* @author hikashop.com
* @copyright (C) 2010-2021 HIKARI SOFTWARE. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><?php if(empty($this->ajax)) { ?>
<div id="hikashop_checkout_cart_<?php echo $this->step;
?>_<?php echo $this->module_position; ?>"
data-checkout-step="<?php echo $this->step; ?>"
data-checkout-pos="<?php echo $this->module_position;
?>" class="hikashop_checkout_cart">
<?php } ?>
<div class="hikashop_checkout_loading_elem"></div>
<div
class="hikashop_checkout_loading_spinner"></div>
<?php
$this->checkoutHelper->displayMessages('cart');
?>
<div class="table table-striped table-hover"
width="100%">
<div>
<?php
$k = 0;
$group = $this->config->get('group_options', 0);
$thumbnail_x = $this->config->get('thumbnail_x', 100);
$thumbnail_y = $this->config->get('thumbnail_y', 100);
$cart = $this->checkoutHelper->getCart();
$displayingPrices = new stdClass();
$displayingPrices->price_currency_id =
$cart->full_total->prices[0]->price_currency_id;
$displayingPrices->total = new stdClass();
$displayingPrices->total->price_value =
$cart->full_total->prices[0]->price_value;
$displayingPrices->total->price_value_with_tax =
$cart->full_total->prices[0]->price_value_with_tax;
$displayingPrices->taxes = array();
if(isset($cart->full_total->prices[0]->taxes))
$displayingPrices->taxes =
$cart->full_total->prices[0]->taxes;
if(empty($this->options['show_payment'])){
if(isset($cart->payment->payment_price) &&
$cart->payment->payment_price > 0 &&
$cart->payment->payment_price <
$displayingPrices->total->price_value)
$displayingPrices->total->price_value -=
$cart->payment->payment_price;
if(isset($cart->payment->payment_price_with_tax) &&
$cart->payment->payment_price_with_tax > 0 &&
$cart->payment->payment_price_with_tax <
$displayingPrices->total->price_value_with_tax)
$displayingPrices->total->price_value_with_tax -=
$cart->payment->payment_price_with_tax;
if(isset($cart->payment->taxes)){
foreach($cart->payment->taxes as $payment_tax){
if(array_key_exists($payment_tax->tax_namekey,
$displayingPrices->taxes)){
$displayingPrices->taxes[$payment_tax->tax_namekey]->tax_amount
-= $payment_tax->tax_amount;
}
}
}
}
if(empty($this->options['show_shipping']) &&
!empty($cart->shipping)){
$shipping_price = 0;
$shipping_price_with_tax = 0;
foreach($cart->shipping as $shipping) {
if(isset($shipping->shipping_price) &&
$shipping->shipping_price > 0 && $shipping->shipping_price
< $displayingPrices->total->price_value)
$shipping_price += $shipping->shipping_price;
if(isset($shipping->shipping_price_with_tax) &&
$shipping->shipping_price_with_tax > 0 &&
$shipping->shipping_price_with_tax <
$displayingPrices->total->price_value_with_tax)
$shipping_price_with_tax += $shipping->shipping_price_with_tax;
if(isset($shipping->taxes)){
foreach($shipping->taxes as $shipping_tax){
if(array_key_exists($shipping_tax->tax_namekey,
$displayingPrices->taxes)){
$displayingPrices->taxes[$shipping_tax->tax_namekey]->tax_amount
-= $shipping_tax->tax_amount;
}
}
}
if(!empty($this->options['show_coupon']) &&
isset($cart->coupon->taxes) &&
isset($cart->coupon->discount_shipping_percent) &&
$cart->coupon->discount_shipping_percent > 0){
foreach($cart->coupon->taxes as $coupon_tax){
if(array_key_exists($coupon_tax->tax_namekey,
$displayingPrices->taxes)){
$displayingPrices->taxes[$coupon_tax->tax_namekey]->tax_amount
-= $coupon_tax->tax_amount;
}
}
}
}
$displayingPrices->total->price_value -= $shipping_price;
$displayingPrices->total->price_value_with_tax -=
$shipping_price_with_tax;
}
if(empty($this->options['show_coupon'])){
if(isset($cart->coupon->discount_value_without_tax) &&
$cart->coupon->discount_value_without_tax > 0 &&
$cart->coupon->discount_value_without_tax <
$displayingPrices->total->price_value)
$displayingPrices->total->price_value +=
$cart->coupon->discount_value_without_tax;
if(isset($cart->coupon->discount_value) &&
$cart->coupon->discount_value > 0 &&
$cart->coupon->discount_value <
$displayingPrices->total->price_value_with_tax)
$displayingPrices->total->price_value_with_tax +=
$cart->coupon->discount_value;
}
if(empty($this->productClass))
$this->productClass = hikashop_get('class.product');
if(!empty($this->options['show_cart_image']) &&
empty($this->imageHelper))
$this->imageHelper = hikashop_get('helper.image');
if(empty($this->currencyClass)) {
$this->currencyClass = hikashop_get('class.currency');
$this->currencyHelper =& $this->currencyClass;
}
global $Itemid;
$checkout_itemid =
(int)$this->config->get('checkout_itemid');
if(!empty($checkout_itemid))
$Itemid = $checkout_itemid;
$url_itemid='';
if(!empty($Itemid))
$url_itemid = '&Itemid=' . $Itemid;
foreach($cart->products as $i => $product) {
if(empty($product->cart_product_quantity))
continue;
if($group && !empty($product->cart_product_option_parent_id))
continue;
$this->productClass->addAlias($product);
?>
<div class="row<?php echo $k; ?>">
<!-- IMAGE -->
<?php
if(!empty($this->options['show_cart_image'])) {
?>
<div data-title="<?php echo
JText::_('CART_PRODUCT_IMAGE'); ?>"
class="hikashop_cart_product_image_value">
<?php
$image = null;
if(!empty($product->images)) {
$image = reset($product->images);
$this->imageHelper->checkSize($thumbnail_x, $thumbnail_y,
$image);
}
if($image && !$this->config->get('thumbnail'))
{
echo '<img
src="'.$this->imageHelper->uploadFolder_url .
$image->file_path.'" alt="' . $image->file_name .
'"
style="margin-top:10px;margin-bottom:10px;display:inline-block;vertical-align:middle"
/>';
} else {
?>
<div class="hikashop_cart_product_image_thumb"
><?php
$img = $this->imageHelper->getThumbnail(
@$image->file_path,
array(
'width' => $thumbnail_x,
'height' => $thumbnail_y
),
array(
'default' => true,
'forcesize' =>
$this->config->get('image_force_size', true),
'scale' =>
$this->config->get('image_scale_mode', 'inside')
)
);
if($img->success) {
$attributes = '';
if($img->external)
$attributes = '
width="'.$img->req_width.'"
height="'.$img->req_height.'"';
echo '<img
class="hikashop_product_checkout_cart_image"
title="'.$this->escape(@$image->file_description).'"
alt="'.$this->escape(@$image->file_name).'"
src="'.$img->url.'"'.$attributes.'/>';
}
?></div>
<?php
}
?>
</div>
<?php } ?>
<!-- EO IMAGE -->
<!-- NAME -->
<div data-title="<?php echo
JText::_('CART_PRODUCT_NAME'); ?>"
class="hikashop_cart_product_name_value">
<p class="hikashop_cart_product_name"><?php
if(!empty($this->options['link_to_product_page'])) {
?><a class="hikashop_no_print" href="<?php echo
hikashop_contentLink('product&task=show&cid=' .
$product->product_id . '&name=' . $product->alias .
$url_itemid, $product);?>" ><?php
}
echo $product->product_name;
if(!empty($this->options['show_product_code'])) {
?><span
class="hikashop_product_code_checkout"><?php
echo $product->product_code;
?></span><?php
}
if(!empty($this->options['link_to_product_page'])) {
?></a><?php
}
if($group && !empty($this->options['show_price'])){
$display_item_price = false;
foreach($cart->products as $j => $optionElement) {
if(empty($optionElement->cart_product_option_parent_id) ||
(int)$optionElement->cart_product_option_parent_id !=
(int)$product->cart_product_id)
continue;
if(!empty($optionElement->prices[0])) {
$display_item_price = true;
break;
}
}
if($display_item_price)
echo ' <span
class="hikashop_product_base_price">' .
strip_tags($this->getDisplayProductPrice($product, true)) .
'</span>';
}
?>
<?php
$input = '';
$html = '';
$edit = !empty($product->has_options) && $group;
if(!empty($product->product_parent_id))
$edit = true;
if(hikashop_level(2) &&
!empty($this->extraFields['item'])) {
$item = $cart->cart_products[$i];
foreach($this->extraFields['item'] as $field) {
$namekey = $field->field_namekey;
if(empty($item->$namekey) || !strlen($item->$namekey))
continue;
$edit = true;
$html .= '<p
class="hikashop_cart_item_'.$namekey.'">'.$this->fieldClass->getFieldName($field).':
'.$this->fieldClass->show($field,
$item->$namekey).'</p>';
}
}
if($group) {
if(!isset($product->prices[0])) {
$product->prices[0] = new stdClass();
$product->prices[0]->price_value = 0;
$product->prices[0]->price_value_with_tax = 0.0;
$product->prices[0]->price_currency_id = hikashop_getCurrency();
$product->prices[0]->unit_price = new stdClass();
$product->prices[0]->unit_price->price_value = 0;
$product->prices[0]->unit_price->price_value_with_tax = 0.0;
$product->prices[0]->unit_price->price_currency_id =
hikashop_getCurrency();
}
foreach($cart->products as $j => $optionElement) {
if(empty($optionElement->cart_product_option_parent_id) ||
$optionElement->cart_product_option_parent_id !=
$product->cart_product_id)
continue;
if(!empty($optionElement->prices[0]))
$this->addOptionPriceToProduct($product->prices[0],$optionElement->prices[0]);
$html .= '<p
class="hikashop_cart_option_name">' .
$optionElement->product_name;
if(!empty($this->options['show_price']) &&
@$optionElement->prices[0]->price_value_with_tax > 0)
$html .= ' ( + ' .
strip_tags($this->getDisplayProductPrice($optionElement, true)) . '
)';
if($optionElement->cart_product_quantity !=
$product->cart_product_quantity) {
$html .= ' x'.round($optionElement->cart_product_quantity
/ $product->cart_product_quantity, 2);
}
$html .= '</p>';
}
}
if(empty($this->options['status']) && $edit) {
$popupHelper = hikashop_get('helper.popup');
echo ' '.$popupHelper->display(
'<i class="fas fa-pen"></i>',
'HIKASHOP_EDIT_CART_PRODUCT',
hikashop_completeLink('cart&task=product_edit&cart_id='.$cart->cart_id.'&cart_product_id='.$product->cart_product_id.'&tmpl=component&'.hikashop_getFormToken().'=1'),
'edit_cart_product',
576, 480,
'title="'.JText::_('EDIT_THE_OPTIONS_OF_THE_PRODUCT').'"',
'', 'link'
);
}
?>
</p>
<?php
if(!empty($html))
echo '<div
class="hikashop_cart_product_custom_item_fields">'.$html.'</div>';
if(!empty($product->extraData) &&
!empty($product->extraData->checkout))
echo '<div
class="hikashop_cart_product_extradata"><p>' .
implode('</p><p>',
$product->extraData->checkout) . '</p></div>';
?>
</div>
<!-- EO NAME -->
<!-- CUSTOM PRODUCT FIELDS -->
<?php
if(hikashop_level(1) &&
!empty($this->extraFields['product'])) {
foreach($this->extraFields['product'] as $field) {
$namekey = $field->field_namekey;
?> <div data-title="<?php echo
$this->fieldClass->trans($field->field_realname); ?>"
class="hikashop_cart_product_field_<?php echo $namekey;
?>">
<?php
if(!empty($product->$namekey)) {
echo '<p
class="hikashop_checkout_cart_product_'.$namekey.'">'
. $this->fieldClass->show($field, $product->$namekey) .
'</p>';
}
?>
</div>
<?php
}
}
?>
<!-- EO CUSTOM PRODUCT FIELDS -->
<!-- UNIT PRICE -->
<?php
if(!empty($this->options['show_price'])) {
?>
<div data-title="<?php echo
JText::_('CART_PRODUCT_UNIT_PRICE'); ?>"
class="hikashop_cart_product_price_value"><?php
echo $this->getDisplayProductPrice($product, true);
if(HIKASHOP_RESPONSIVE) {
?><span class="visible-phone"><?php echo
JText::_('PER_UNIT'); ?></span><?php
}
?></div>
<?php
}
?>
<!-- EO UNIT PRICE -->
<!-- QUANTITY -->
<div data-title="<?php echo
JText::_('PRODUCT_QUANTITY'); ?>"
class="hikashop_cart_product_quantity_value"><?php
if(empty($this->options['status'])) {
$this->row =& $product;
$cartHelper = hikashop_get('helper.cart');
$this->quantityLayout =
$cartHelper->getProductQuantityLayout($this->row);
$onchange = 'window.hikashop.checkQuantity(this); if (this.value !=
\''.$product->cart_product_quantity.'\'){'.$input.'return
window.checkout.submitCart('.$this->step.','.$this->module_position.');
} return false;';
$onincrement =
'window.hikashop.updateQuantity(this,\'{id}\'); if
(document.getElementById(\'{id}\').value !=
\''.$product->cart_product_quantity.'\'){'.$input.'return
window.checkout.submitCart('.$this->step.','.$this->module_position.');
} return false;';
echo $this->loadHkLayout('quantity', array(
'id_prefix' =>
'hikashop_checkout_'.(int)$this->module_position.'_quantity_field',
'quantity_fieldname' =>
'checkout[cart][item]['.$product->cart_product_id.']',
'onchange_script' => $onchange,
'onincrement_script' => $onincrement,
));
if(!empty($this->options['show_delete'])) {
$url = hikashop_currentURL();
$delete_url =
hikashop_completeLink('product&task=updatecart&product_id='.$product->product_id.'&quantity=0');
$delete_url .= ((strpos($delete_url, '?') === false) ?
'?' : '&') .
'return_url='.urlencode(base64_encode(urldecode($url)));
?>
<div class="hikashop_cart_product_quantity_delete">
<a class="hikashop_no_print" href="<?php echo
$delete_url; ?>" onclick="var qty_field =
document.getElementById('<?php echo
$this->last_quantity_field_id;?>');
if(qty_field){qty_field.value=0; return window.checkout.submitCart(<?php
echo $this->step; ?>,<?php echo $this->module_position; ?>);
} return false;" title="<?php echo
JText::_('HIKA_DELETE'); ?>">
<i class="fa fa-times-circle"></i>
</a>
</div>
<?php
}
}else{
echo $product->cart_product_quantity;
}
?>
</div>
<!-- EO QUANTITY -->
<!-- TOTAL PRICE -->
<?php
if(!empty($this->options['show_price'])) {
?>
<div data-title="<?php echo
JText::_('CART_PRODUCT_TOTAL_PRICE'); ?>"
class="hikashop_cart_product_total_value"><?php
echo $this->getDisplayProductPrice($product, false);
?></div>
<?php
}
?>
<!-- EO TOTAL PRICE -->
</div>
<?php
$k = 1-$k;
}
?>
<?php
$taxes = round($displayingPrices->total->price_value_with_tax -
$displayingPrices->total->price_value,
$this->currencyClass->getRounding($cart->full_total->prices[0]->price_currency_id));
if(!empty($this->options['show_price']) &&
(!empty($cart->coupon) || !empty($cart->shipping) ||
!empty($cart->additional) || $taxes > 0)) {
?>
<!-- SEPARATOR ROW -->
<div class="margin"><div colspan="<?php echo
$row_count; ?>"
class="hikashop_cart_empty_footer"></div></div>
<!-- EO SEPARATOR ROW -->
<!-- SUBTOTAL ROW -->
<div>
<div colspan="<?php echo $row_count - 2; ?>"
class="hikashop_cart_empty_footer"></div>
<div id="hikashop_checkout_cart_total2_title"
class="hikashop_cart_subtotal_title
hikashop_cart_title"><?php
echo JText::_('SUBTOTAL');
?></div>
<div class="hikashop_cart_subtotal_value"
data-title="<?php echo JText::_('SUBTOTAL');
?>">
<span class="hikashop_checkout_cart_subtotal"><?php
if(!empty($this->options['price_with_tax']))
echo
$this->currencyClass->format(@$cart->total->prices[0]->price_value_with_tax,@$cart->total->prices[0]->price_currency_id);
else
echo
$this->currencyClass->format(@$cart->total->prices[0]->price_value,@$cart->total->prices[0]->price_currency_id);
?></span>
</div>
</div>
<!-- EO SUBTOTAL ROW -->
<!-- COUPON ROW -->
<?php
}
if(!empty($this->options['show_price']) &&
!empty($cart->coupon) &&
!empty($this->options['show_coupon'])) {
?>
<div>
<div colspan="<?php echo $row_count - 2; ?>"
class="hikashop_cart_empty_footer"></div>
<div id="hikashop_checkout_cart_coupon_title"
class="hikashop_cart_coupon_title
hikashop_cart_title"><?php
echo JText::_('HIKASHOP_COUPON');
?></div>
<div class="hikashop_cart_coupon_value"
data-title="<?php echo JText::_('HIKASHOP_COUPON');
?>">
<span class="hikashop_checkout_cart_coupon"><?php
if(empty($this->options['price_with_tax']))
echo
$this->currencyClass->format(@$cart->coupon->discount_value_without_tax
* -1, @$cart->coupon->discount_currency_id);
else
echo
$this->currencyClass->format(@$cart->coupon->discount_value *
-1, @$cart->coupon->discount_currency_id);
?></span>
</div>
</div>
<?php
}
?>
<!-- EO COUPON ROW -->
<!-- SHIPPING ROW -->
<?php
if(!empty($this->options['show_price']) &&
!empty($cart->shipping) &&
!empty($this->options['show_shipping'])) {
?>
<div>
<div colspan="<?php echo $row_count - 2; ?>"
class="hikashop_cart_empty_footer"></div>
<div id="hikashop_checkout_cart_shipping_title"
class="hikashop_cart_shipping_title
hikashop_cart_title"><?php
echo JText::_('HIKASHOP_SHIPPING');
?></div>
<div class="hikashop_cart_shipping_value"
data-title="<?php echo JText::_('HIKASHOP_SHIPPING');
?>">
<span class="hikashop_checkout_cart_shipping">
<?php
if(isset($this->value)) {
echo $this->value;
} else {
$shipping_price = null;
foreach($cart->shipping as $shipping) {
if(!isset($shipping->shipping_price) &&
isset($shipping->shipping_price_with_tax) ) {
$shipping->shipping_price =
$shipping->shipping_price_with_tax;
}
if(isset($shipping->shipping_price)) {
if($shipping_price === null)
$shipping_price = 0.0;
if(empty($this->options['price_with_tax']) ||
!isset($shipping->shipping_price_with_tax))
$shipping_price += $shipping->shipping_price;
else
$shipping_price += $shipping->shipping_price_with_tax;
}
}
if($shipping_price !== null)
echo $this->currencyClass->format($shipping_price,
$cart->full_total->prices[0]->price_currency_id);
}
?>
</span>
</div>
</div>
<?php
}
?>
<!-- EO SHIPPING ROW -->
<!-- ADDITIONAL ROW -->
<?php
if(!empty($cart->additional)) {
$exclude_additionnal = explode(',',
$this->config->get('order_additional_hide',
''));
foreach($cart->additional as $k => $additional) {
if(in_array($additional->name, $exclude_additionnal))
continue;
if(empty($this->options['show_price']) &&
!empty($additional->price_value))
continue;
?>
<div id="hikashop_checkout_cart_additional_<?php echo
str_replace(' ','_',$k); ?>_line" >
<div colspan="<?php echo $row_count - 2; ?>"
class="hikashop_cart_empty_footer"></div>
<div id="hikashop_checkout_cart_additional_<?php echo
str_replace(' ','_',$k); ?>_title"
class="hikashop_cart_additional_title
hikashop_cart_title"><?php
echo JText::_($additional->name);
?></div>
<div class="hikashop_cart_additional_value"
data-title="<?php echo JText::_($additional->name);
?>">
<span class="hikashop_checkout_cart_additional">
<?php
if(!empty($additional->price_value) || empty($additional->value))
{
if($taxes == 0 ||
empty($this->options['price_with_tax']))
echo
$this->currencyClass->format(@$additional->price_value,$additional->price_currency_id);
else
echo
$this->currencyClass->format(@$additional->price_value_with_tax,$additional->price_currency_id);
} else
echo $additional->value;
?>
</span>
</div>
</div>
<?php
}
}
?>
<!-- EO ADDITIONAL ROW -->
<!-- TAXES ROW -->
<?php
if(!empty($this->options['show_price']) && $taxes
> 0){
if($this->config->get('detailed_tax_display') &&
isset($displayingPrices->taxes)) {
foreach($displayingPrices->taxes as $tax) {
?>
<div>
<div colspan="<?php echo $row_count - 2; ?>"
class="hikashop_cart_empty_footer"></div>
<div id="hikashop_checkout_cart_tax_title"
class="hikashop_cart_tax_title hikashop_cart_title"><?php
echo hikashop_translate($tax->tax_namekey);
?></div>
<div class="hikashop_cart_tax_value"
data-title="<?php echo $tax->tax_namekey; ?>">
<span class="hikashop_checkout_cart_taxes"><?php
echo $this->currencyClass->format($tax->tax_amount,
$cart->full_total->prices[0]->price_currency_id);
?></span>
</div>
</div>
<?php
}
} else {
?>
<div>
<div colspan="<?php echo $row_count - 2; ?>"
class="hikashop_cart_empty_footer"></div>
<div id="hikashop_checkout_cart_tax_title"
class="hikashop_cart_tax_title hikashop_cart_title"><?php
echo JText::_('TAXES');
?></div>
<div class="hikashop_cart_tax_value"
data-title="<?php echo Jtext::_('TAXES');
?>">
<span class="hikashop_checkout_cart_taxes"><?php
echo $this->currencyClass->format($taxes,
$cart->full_total->prices[0]->price_currency_id);
?></span>
</div>
</div>
<?php
}
}
?>
<!-- EO TAXES ROW -->
<!-- PAYMENT ROW -->
<?php
if(!empty($this->options['show_price']) &&
!empty($cart->payment) && $cart->payment->payment_price !=
0 && !empty($this->options['show_payment'])) {
?>
<div>
<div colspan="<?php echo $row_count - 2; ?>"
class="hikashop_cart_empty_footer"></div>
<div id="hikashop_checkout_cart_payment_title"
class="hikashop_cart_payment_title
hikashop_cart_title"><?php
echo JText::_('HIKASHOP_PAYMENT');
?></div>
<div class="hikashop_cart_payment_value"
data-title="<?php echo Jtext::_('HIKASHOP_PAYMENT');
?>">
<span class="hikashop_checkout_cart_payment"><?php
if(!isset($cart->payment->payment_price) &&
isset($cart->payment->payment_price_with_tax) ) {
if(isset($this->value)) {
echo $this->value;
} else {
$cart->payment->payment_price = 0.0;
$cart->payment->payment_price_with_tax = 0.0;
}
}
if(isset($cart->payment->payment_price)) {
if($taxes == 0 ||
empty($this->options['price_with_tax']) ||
!isset($cart->payment->payment_price_with_tax) )
echo
$this->currencyClass->format(@$cart->payment->payment_price,
$cart->full_total->prices[0]->price_currency_id);
else
echo
$this->currencyClass->format(@$cart->payment->payment_price_with_tax,
$cart->full_total->prices[0]->price_currency_id);
}
?></span>
</div>
</div>
<?php
}
?>
<!-- EO PAYMENT ROW -->
<!-- TOTAL ROW -->
<?php
if(!empty($this->options['show_price'])) {
?>
<div>
<div colspan="<?php echo $row_count - 2; ?>"
class="hikashop_cart_empty_footer"></div>
<div id="hikashop_checkout_cart_final_total_title"
class="hikashop_cart_total_title
hikashop_cart_title"><?php
echo JText::_('HIKASHOP_TOTAL');
?></div>
<div class="hikashop_cart_total_value"
data-title="<?php echo Jtext::_('HIKASHOP_TOTAL');
?>">
<span
class="hikashop_checkout_cart_final_total"><?php
echo
$this->currencyClass->format($displayingPrices->total->price_value_with_tax,
$displayingPrices->price_currency_id);
?></span>
</div>
</div>
<?php
}
?>
<!-- EO TOTAL ROW -->
</div>
</div>
<?php
if(!empty($this->extraData[$this->module_position]) &&
!empty($this->extraData[$this->module_position]->bottom)) { echo
implode("\r\n",
$this->extraData[$this->module_position]->bottom); }
if(false) {
?>
<noscript>
<input id="hikashop_checkout_cart_quantity_button"
class="btn button" type="submit"
name="refresh" value="<?php echo
JText::_('REFRESH_CART');?>"/>
</noscript>
<?php
}
if(empty($this->ajax)) {
?>
</div>
<script type="text/javascript">
if(!window.checkout) window.checkout = {};
window.Oby.registerAjax(['checkout.cart.updated','cart.updated'],
function(params){
if(window.checkout.isSource(params, <?php echo (int)$this->step;
?>, <?php echo (int)$this->module_position; ?>))
return;
window.checkout.refreshCart(<?php echo (int)$this->step; ?>,
<?php echo (int)$this->module_position; ?>);
});
window.checkout.refreshCart = function(step, id) { return
window.checkout.refreshBlock('cart', step, id); };
window.checkout.submitCart = function(step, id) { return
window.checkout.submitBlock('cart', step, id); };
</script>
<?php
}
com_hikashop/checkout/show.php000064400000021713151163073200012510
0ustar00<?php
/**
* @package HikaShop for Joomla!
* @version 4.4.4
* @author hikashop.com
* @copyright (C) 2010-2021 HIKARI SOFTWARE. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?>
<form action="<?php echo
$this->checkoutHelper->completeLink('cid='. $this->step,
false, false, false, $this->itemid); ?>" method="post"
id="hikashop_checkout_form"
name="hikashop_checkout_form"
enctype="multipart/form-data"
onsubmit="if(window.checkout.onFormSubmit){ return
window.checkout.onFormSubmit(this); }">
<input type="hidden" name="task"
value="submitstep"/>
<input type="hidden" name="<?php echo
hikashop_getFormToken(); ?>" id="hikashop_checkout_token"
value="1"/>
<input type="hidden" name="cart_id"
value="<?php echo $this->cart_id; ?>"/>
<input type="submit" style="display:none;"/>
<div id="hikashop_checkout" data-checkout-step="<?php
echo $this->step; ?>" class="hikashop_checkout_page
hikashop_checkout_page_step<?php echo $this->step; ?>">
<div class="hikashop_checkout_loading_elem"></div>
<div
class="hikashop_checkout_loading_spinner"></div>
<!-- PROGRESS BAR -->
<?php
if((int)$this->config->get('display_checkout_bar', 2) >
0) {
echo $this->displayBlock('bar', 0, array(
'display_end' =>
((int)$this->config->get('display_checkout_bar', 2) == 1)
));
}
?>
<!-- EO PROGRESS BAR -->
<?php
if($this->hasSeparator)
echo $this->displayBlock('separator', 0,
array('type' => 'start'));
$handleEnter = array();
$last = 0;
?>
<!-- TOP EXTRA DATA -->
<?php
if(!empty($this->extraData['checkout']) &&
!empty($this->extraData['checkout']->checkout_top)) { echo
implode("\r\n",
$this->extraData['checkout']->checkout_top); }
?>
<!-- EO TOP EXTRA DATA -->
<!-- CHECKOUT -->
<?php
//
dump($this->workflow['steps'][$this->workflow_step]['content']);
$stp=[];
foreach($this->workflow['steps'][$this->workflow_step]['content']
as $k => $content) {
$handleEnter[] =
'window.checkout.handleEnter(\''.$content['task'].'\','.$this->step.','.$k.');';
$stp[]= $content['task'];
ob_start();
echo $this->displayBlock($content['task'], $k,
@$content['params']);
$vn= 'm_'.$content['task'];
$$vn = ob_get_contents();
ob_end_clean();
$last = $k;
}
?>
<div id="login-checkout">
<?= $m_login;?>
</div>
<div id="carts-checkout">
<?php if(in_array('cart',$stp)):?>
<div id="main-checkout">
<?= $m_cart;?>
</div>
<?php endif;?>
<?php if(!(in_array('login',$stp) && count($stp)==
1)):?>
<div id="sidebar-checkout">
<?= $m_payment;?>
<?= $m_status;?>
<?= $m_coupon;?>
<?php
echo $this->displayBlock('buttons', 0, array());
?>
</div>
<?php
$cart_class= hikashop_get('class.cart');
$cart= $cart_class->getFullCart();
?>
<?php endif;?>
</div>
<!-- EO CHECKOUT -->
<!-- BOTTOM EXTRA DATA -->
<?php
if(!empty($this->extraData['checkout']) &&
!empty($this->extraData['checkout']->checkout_bottom)) {
echo implode("\r\n",
$this->extraData['checkout']->checkout_bottom); }
?>
<!-- EO BOTTOM EXTRA DATA -->
<?php
if($this->hasSeparator)
echo $this->displayBlock('separator', $last+1,
array('type' => 'end'));
?>
<!-- BUTTONS -->
<!-- EO BUTTONS -->
<!-- OTHER EXTRA DATA -->
<?php
if(!empty($this->extra_data) &&
!isset($this->extraData['checkout']))
echo implode("\r\n", $this->extra_data);
?>
<!-- EO OTHER EXTRA DATA -->
<?php
$doc = JFactory::getDocument();
$doc->addScript(HIKASHOP_JS.'checkout.js');
$js = '
window.checkout.token = "'.hikashop_getFormToken().'";
window.checkout.urls.show =
"'.hikashop_completeLink('checkout&task=showblock'.$this->cartIdParam.'&Itemid='.$this->itemid,
'ajax', false, true).'";
window.checkout.urls.submit =
"'.hikashop_completeLink('checkout&task=submitblock'.$this->cartIdParam.'&Itemid='.$this->itemid,
'ajax', false, true).'";
window.checkout.urls.submitstep =
"'.hikashop_completeLink('checkout&task=submitstep'.$this->cartIdParam.'&Itemid='.$this->itemid,
'ajax', false, true).'";
window.Oby.registerAjax("checkout.step.completed",function(params){
document.getElementById("hikashop_checkout_form").submit(); });
window.Oby.registerAjax("cart.empty",function(params){
setTimeout(function(){ window.location.reload(); },150); });
window.Oby.registerAjax("cart.updated",function(params){
if(!params || !params.resp || !params.resp.empty) return;
window.Oby.fireAjax("cart.empty",null); });
window.hikashop.ready(function(){
'.implode("\r\n\t", $handleEnter).'
});
';
$doc->addScriptDeclaration($js);
?>
</div>
</form>
<!-- this style in show.php file hikahop -->
<style>
div#carts-checkout {
display: flex;
gap: 2%;
position: relative;
}
div#main-checkout {
flex: 65%;
box-shadow: rgb(0 0 0 / 15%) 0px 3px 15px 0px;
border: 1px solid #e0e0e2;
border-radius: 8px;
padding: 0 20px;
}
div#sidebar-checkout {
flex: 0 35%;
border: 1px solid #e0e0e2;
border-radius: 8px;
padding: 30px 20px;
height: fit-content;
position: sticky;
top: 0px;
box-shadow: rgb(0 0 0 / 15%) 0px 3px 15px 0px;
}
.buttons_right {
width: 100%;
margin-top: 30px;
}
button#hikabtn_checkout_next {
padding: 15px;
width: 100%;
font-size: 1.1rem;
}
.hikashop_checkout_coupon {
margin-top: 30px;
}
.hikashop_checkout_status {
display: block;
font-size: 0.8rem;
color: #9b9b9b;
}
img.hikashop_product_checkout_cart_image {
width: 150px;
height: 150px;
border: 1px solid #e6e6e6;
border-radius: 5px;
margin-bottom: 15px;
}
.hikashop_checkout-list-cart>.row-list-cart {
display: flex;
padding: 30px 0;
position: relative;
}
.hikashop_checkout-list-cart>.row-list-cart:not(:first-child) {
border-top: 1px solid #e0e0e2;
}
span.hikashop_product_price_full {
color: #5eba3f;
font-size: 0.9rem;
font-weight: 300;
}
div#info-product-text{
margin-left: 20px;
}
p.hikashop_cart_product_name a {
font-size: 1.1rem;
color: #777777;
font-weight: bold;
line-height: 1.9;
padding-left: 30px;
display: block;
}
.hikashop_checkout_cart .hikashop_product_quantity_field {
text-align: center;
padding: 10px 30px !important;
margin: 0 !important;
}
.hikashop_product_quantity_change_div_minus_default,
.hikashop_product_quantity_change_div_plus_default {
position: absolute;
padding: 10px;
}
.hikashop_product_quantity_change_div_minus_default {
left: 0;
}
.hikashop_product_quantity_input_div_default {
position: relative;
display: flex;
align-items: center;
}
.hikashop_cart_product_quantity_value {
display: flex;
justify-content: center;
}
.hikashop_cart_product_quantity_delete svg {
width: 17px;
}
.hikashop_cart_product_quantity_delete svg path {
fill: #ef4056;
}
.hikashop_payment_methods_table {
display: flex;
border: unset;
flex-wrap: wrap;
justify-content: center;
align-items: center;
gap: 1%;
}
.item-payment-hikashop {
font-size: 0.7rem;
margin-bottom: 10px;
width: 172px;
position: relative;
}
.item-payment-hikashop label {
border: 1px solid #dddddd;
border-radius: 5px;
padding: 15px 10px;
/* box-shadow: 0px 7px 7px -4px #e1e1e1; */
}
.hikashop_checkout_payment_images {
width: 100%;
text-align: center;
display: block;
margin-bottom: 20px;
}
.hikashop_cart_product_quantity_refresh,
.hikashop_cart_product_quantity_delete {
display: flex;
align-items: center;
}
.hikashop_cart_product_quantity_refresh {
margin-left: 10px;
}
.hikashop_cart_product_quantity_delete {
margin-right: 10px;
position: absolute;
left: 0;
top: 20px;
}
.hikashop_checkout_status span.label.label-info {
color: #545454;
background: unset;
font-size: 0.8rem;
font-weight: 100;
}
.hikashop_checkout_coupon label {
font-size: 0.8rem;
color: #9b9b9b;
margin-bottom: 15px;
}
.hikashop_checkout_coupon_field {
margin-top: 0;
margin-right: 0;
border-radius: 5px !important;
}
.hikabtn_checkout_coupon_add {
color: #a7a7a7;
border: 1px solid #dddddd;
background: #ebebeb;
padding: 7px 15px;
transition: 0.3s;
}
.hikabtn_checkout_coupon_add:hover {
border: 1px solid #dddddd;
background: #dedede;
color: #a7a7a7;
}
.hikashop_checkout_payment_radio {
position: absolute;
right: 10px;
top: 5px;
}
.hikashop_checkout_payment_radio::before {
content: "";
width: 15px;
height: 15px;
background: white;
display: block;
border-radius: 5px;
border: 1px solid #d2d2d2;
}
.hikashop_checkout_payment_radio::after {
content: "\f00c";
font-family: 'FontAwesome';
width: 15px;
height: 15px;
display: block;
position: relative;
top: -20px;
right: -4px;
color: #00c200;
font-size: 20px;
opacity: 0;
transition: 0.3s;
}
.hikashop_checkout_payment_radio:checked::after {
opacity: 1;
}
.hikashop_checkout_payment legend {
font-size: 0.8rem;
color: #9b9b9b;
margin-bottom: 15px;
}
@media only screen and (max-width:1024px) {
div#carts-checkout{
flex-direction: column-reverse;
}
div#sidebar-checkout {
margin: 20px 0;
}
}
</style>com_hikashop/checkout/show_block_payment.php000064400000032474151163073200015425
0ustar00<?php
/**
* @package HikaShop for Joomla!
* @version 4.4.4
* @author hikashop.com
* @copyright (C) 2010-2021 HIKARI SOFTWARE. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><?php if(empty($this->ajax)) { ?>
<div id="hikashop_checkout_payment_<?php echo $this->step;
?>_<?php echo $this->module_position; ?>"
data-checkout-step="<?php echo $this->step; ?>"
data-checkout-pos="<?php echo $this->module_position;
?>" class="hikashop_checkout_payment">
<?php } ?>
<div class="hikashop_checkout_loading_elem"></div>
<div
class="hikashop_checkout_loading_spinner"></div>
<?php
$this->checkoutHelper->displayMessages('payment');
$cart = $this->checkoutHelper->getCart();
if(!empty($cart->usable_methods->payment)) {
if(!empty($this->options['show_title'])) {
?>
<legend><?php echo
JText::_('HIKASHOP_PAYMENT_METHOD');?></legend>
<?php
}
if($this->options['payment_selector'] == 2) {
?>
<fieldset class="hika_payment_field
hikashop_checkout_payment_block">
<select id="hikashop_payment_selector_<?php echo
$this->step.'_'.$this->module_position; ?>"
name="checkout[payment][id]"
class="hikashop_field_dropdown"
onchange="window.checkout.paymentSelected(this.options[this.selectedIndex]);">
<?php
foreach($cart->usable_methods->payment as $payment) {
$selected = (!empty($cart->payment) &&
$payment->payment_id == $cart->payment->payment_id);
$input_data = array(
'step' => $this->step,
'pos' => $this->module_position,
'block' => 'payment',
'type' => $payment->payment_type,
'id' => (int)$payment->payment_id,
);
$payment_name =
Jtext::sprintf('CHECKCOUT_DROPDOWN_PAYMENT_NAME',
$payment->payment_name,
$this->checkoutHelper->getDisplayPrice($payment, 'payment',
$this->options));
?><option value="<?php echo $payment->payment_id;
?>"<?php echo ($selected ? '
selected="selected"' : ''); ?>
data-hk-checkout="<?php echo
$this->escape(json_encode($input_data)); ?>">
<?php echo $payment_name;?>
</option>
<?php
}
?>
</select>
</fieldset>
<?php
}
else {
?>
<div style="width:100%"
class="hikashop_payment_methods_table table table-bordered
table-striped table-hover">
<?php
}
foreach($cart->usable_methods->payment as $payment) {
$input_id =
'payment_radio_'.$this->step.'_'.$this->module_position.'__'.$payment->payment_type.'_'.$payment->payment_id;
$container_id =
'hikashop_checkout_payment_'.$this->step.'_'.$this->module_position.'__'.$payment->payment_id;
$selected = (!empty($cart->payment) && $payment->payment_id
== $cart->payment->payment_id);
if(!empty($this->options['read_only']) &&
!$selected)
continue;
$input_data = array(
'step' => $this->step,
'pos' => $this->module_position,
'block' => 'payment',
'type' => $payment->payment_type,
'id' => (int)$payment->payment_id,
);
?>
<div><div class="item-payment-hikashop">
<?php
if($this->options['payment_selector'] != 2) {
if(empty($this->options['read_only'])) {
?>
<input class="hikashop_checkout_payment_radio"
type="radio" name="checkout[payment][id]"
id="<?php echo $input_id; ?>"
data-hk-checkout="<?php echo
$this->escape(json_encode($input_data)); ?>"
onchange="window.checkout.paymentSelected(this);"
value="<?php echo $payment->payment_id;?>"<?php echo
($selected ? ' checked="checked"' : '');
?>/>
<?php
}
?>
<label for="<?php echo $input_id; ?>"
style="cursor:pointer;">
<span class="hikashop_checkout_payment_images">
<?php
$images = explode(',', $payment->payment_images);
foreach($images as $image) {
$img = $this->checkoutHelper->getPluginImage($image,
'payment');
if(empty($img))
continue;
?>
<img src="<?php echo $img->url; ?>"
alt=""/>
<?php
}
?>
</span>
<span class="hikashop_checkout_payment_name"><?php
echo $payment->payment_name;?></span>
</label>
<span class="hikashop_checkout_payment_cost"><?php
echo $this->checkoutHelper->getDisplayPrice($payment,
'payment', $this->options);
?></span>
<?php
if(!empty($payment->payment_images)) {
?>
<?php
}
?>
<?php
if(!empty($payment->payment_description)) {
?>
<div
class="hikashop_checkout_payment_description"><?php
echo $this->getDescription($payment);
?></div>
<?php
}
}
?>
<?php
if(empty($this->options['read_only']) &&
!empty($payment->ask_cc)) {
?>
<div id="<?php echo $container_id; ?>__card"
class="hikashop_checkout_payment_card" style="<?php echo
$selected ? '' : ' display:none;';
?>"><?php
$cc_data = $this->checkoutHelper->getCreditCard($payment);
if(empty($cc_data))
hikashop_loadJsLib('creditcard');
?>
<dl class="hika_options large">
<?php
if(!empty($payment->ask_owner)) {
?>
<dt><?php echo JText::_('CREDIT_CARD_OWNER');
?></dt>
<dd>
<?php
if(empty($cc_data)) {
?>
<input type="text" autocomplete="off"
name="checkout[payment][card][<?php echo
$payment->payment_id;?>][owner]" value="" />
<?php
} else {
?>
<span
class="hikashop_checkout_payment_card_details"><?php echo
$this->escape(@$cc_data->owner); ?></span>
<?php
}
?>
</dd>
<?php
}
?>
<?php
if(!empty($payment->ask_cctype)) {
?>
<dt><?php echo JText::_('CARD_TYPE');
?></dt>
<dd><?php
if(empty($cc_data)) {
$values = array();
foreach($payment->ask_cctype as $k => $v) {
$values[] = JHTML::_('select.option', $k, $v);
}
echo JHTML::_('select.genericlist', $values,
'checkout[payment][card]['.$payment->payment_id.'][type]',
'', 'value', 'text', '');
} else {
?>
<span
class="hikashop_checkout_payment_card_details"><?php
if(isset($payment->ask_cctype[@$cc_data->type]))
echo $this->escape($payment->ask_cctype[@$cc_data->type]);
else
echo $this->escape(@$cc_data->type);
?></span>
<?php
}
?></dd>
<?php
}
?>
<dt><label for="hk_co_p_c_n_<?php echo
$payment->payment_id; ?>"><?php echo
JText::_('CREDIT_CARD_NUMBER'); ?></label></dt>
<dd>
<?php
if(empty($cc_data)) {
?>
<input type="text" autocomplete="off"
name="checkout[payment][card][<?php echo $payment->payment_id;
?>][num]" value=""
onchange="if(!hikashopCheckCreditCard(this.value)){ this.value =
''; }" id="hk_co_p_c_<?php echo
$payment->payment_id; ?>"/>
<?php
} else {
?>
<span
class="hikashop_checkout_payment_card_details"><?php echo
$this->escape(@$cc_data->num); ?></span>
<?php
}
?>
</dd>
<dt><label for="hk_co_p_c_e_<?php echo
$payment->payment_id; ?>"><?php echo
JText::_('EXPIRATION_DATE'); ?></label></dt>
<dd>
<?php
if(empty($cc_data)) {
?>
<input type="text" autocomplete="off"
name="checkout[payment][card][<?php echo $payment->payment_id;
?>][mm]" class="card_expiration_date_input"
maxlength="2" size="2" value=""
placeholder="<?php $mm = JText::_('CC_MM');
if($mm=='CC_MM') $mm = JText::_('MM'); echo
$mm;?>" id="hk_co_p_c_e_<?php echo $payment->payment_id;
?>"/>
/
<input type="text" autocomplete="off"
name="checkout[payment][card][<?php echo $payment->payment_id;
?>][yy]" class="card_expiration_date_input"
maxlength="2" size="2" value=""
placeholder="<?php echo JText::_('YY');?>" />
<?php
} else {
?>
<span
class="hikashop_checkout_payment_card_details"><?php echo
$this->escape(@$cc_data->mm) . '/' .
$this->escape(@$cc_data->yy); ?></span>
<?php
}
?>
</dd>
<?php
if(!empty($payment->ask_ccv)) {
hikashop_loadJsLib('tooltip');
?>
<dt><label for="hk_co_p_c_v_<?php echo
$payment->payment_id; ?>" data-toggle="hk-tooltip"
data-title="<?php echo
htmlspecialchars('<strong>'.JText::_('CVC_TOOLTIP_TITLE').'</strong><br/>'.JText::_('CVC_TOOLTIP_TEXT'),
ENT_COMPAT, 'UTF-8'); ?>"><?php echo
JText::_('CARD_VALIDATION_CODE'); ?></label></dt>
<dd>
<?php
if(empty($cc_data)) {
?>
<input type="text" autocomplete="off"
name="checkout[payment][card][<?php echo
$payment->payment_id;?>][ccv]" maxlength="4"
size="4" value="" id="hk_co_p_c_v_<?php echo
$payment->payment_id; ?>"/>
<?php
} else {
?>
<span
class="hikashop_checkout_payment_card_details"><?php echo
$this->escape(@$cc_data->ccv); ?></span>
<?php
}
?>
</dd>
<?php
}
?>
</dl>
<?php
if(empty($cc_data)) {
?>
<div class="hikashop_checkout_payment_submit">
<button class="<?php echo
$this->config->get('css_button','hikabtn'); ?>
hikabtn_checkout_payment_submit" onclick="return
window.checkout.submitPayment(<?php echo $this->step; ?>,<?php
echo $this->module_position; ?>);"><?php echo
JText::_('HIKA_SUBMIT'); ?></button>
</div>
<?php
} else {
?>
<div class="hikashop_checkout_payment_submit">
<button class="<?php echo
$this->config->get('css_button','hikabtn'); ?>
hikabtn_checkout_payment_reset" onclick="return
window.checkout.resetPayment(<?php echo $this->step; ?>,<?php
echo $this->module_position; ?>,<?php echo
$payment->payment_id; ?>);"><?php echo
JText::_('RESET'); ?></button>
</div>
<?php
}
?>
</div>
<?php
}
?>
<?php
if(empty($this->options['read_only']) &&
!empty($payment->custom_html)) {
?>
<div id="<?php echo $container_id; ?>__custom"
class="hikashop_checkout_payment_custom" style="<?php
echo $selected ? '' : ' display:none;';
?>">
<?php
echo
$this->checkoutHelper->getCustomHtml($payment->custom_html,
'checkout[payment][custom]['.$payment->payment_id.']');
if(empty($payment->custom_html_no_btn)) {
?>
<div class="hikashop_checkout_payment_submit">
<button class="<?php echo
$this->config->get('css_button','hikabtn'); ?>
hikabtn_checkout_payment_submit"
id="hikabtn_checkout_payment_submit_p<?php echo
$payment->payment_id; ?>" onclick="return
window.checkout.submitCustomPayment('<?php echo
$payment->payment_type; ?>',<?php echo
(int)$payment->payment_id; ?>,<?php echo $this->step;
?>,<?php echo $this->module_position; ?>);"><?php
echo JText::_('HIKA_SUBMIT'); ?></button>
</div>
<?php
}
?>
</div>
<?php
}
?>
</div></div>
<?php
}
?>
</div>
<?php
}
if(empty($this->ajax)) { ?>
</div>
<script type="text/javascript">
if(!window.checkout) window.checkout = {};
window.checkout.selectedPayment = <?php echo
(int)@$cart->payment->payment_id; ?>;
window.Oby.registerAjax(['checkout.payment.updated','cart.updated',
'checkout.cart.updated'], function(params){
if(params && (params.cart_empty || (params.resp &&
params.resp.empty))) return;
if(window.checkout.isSource(params, <?php echo (int)$this->step;
?>, <?php echo (int)$this->module_position; ?>))
return;
window.checkout.refreshPayment(<?php echo (int)$this->step; ?>,
<?php echo (int)$this->module_position; ?>);
});
window.Oby.registerAjax('checkoutFormSubmit', function(params){
var needSubmit = window.Oby.fireAjax('custompayment.needsubmit',
{'step': <?php echo (int)$this->step; ?>,
'payment_id': window.checkout.selectedPayment});
if(needSubmit === false || needSubmit.length == 0)
return;
window.checkout.submitCustomPayment(needSubmit[0],window.checkout.selectedPayment,<?php
echo $this->step; ?>,<?php echo $this->module_position;
?>);
return true;
});
window.checkout.refreshPayment = function(step, id) { return
window.checkout.refreshBlock('payment', step, id); };
window.checkout.submitPayment = function(step, id) { return
window.checkout.submitBlock('payment', step, id); };
window.checkout.submitCustomPayment = function(name, id, step, pos) {
var ret = window.Oby.fireAjax('custompayment.submit', {method:
name, payment_id: id, step: step, pos: pos});
if(ret === false || ret.length == 0) return
window.checkout.submitBlock('payment', step, pos);
return false;
};
window.checkout.paymentSelected = function(el) {
var data =
window.Oby.evalJSON(el.getAttribute('data-hk-checkout')),
prefix = 'hikashop_checkout_payment_' + data.step +
'_' + data.pos + '__',
d = document;
window.checkout.setLoading(null, true);
var url = "<?php echo
hikashop_completeLink('checkout&task=submitblock&blocktask=payment'.$this->cartIdParam.'&Itemid='.$this->itemid,
'ajax', false, true); ?>",
formData = 'cid=' + encodeURIComponent(data.step) +
'&blockpos=' + encodeURIComponent(data.pos) +
'&selectionOnly=1&' +
encodeURI('checkout[payment][id]') + '=' +
encodeURIComponent(data.id) + '&' +
encodeURI(window.checkout.token)+'=1';
window.Oby.xRequest(url, {mode:"POST", data: formData},
function(x,p) {
window.checkout.setLoading(null, false);
var r = window.Oby.evalJSON(x.responseText);
if(r && r.ret > 0) {
window.checkout.selectedPayment = data.id;
}
if(r && r.events)
window.checkout.processEvents(r.events, {step:<?php echo
(int)$this->step; ?>, pos:<?php echo
(int)$this->module_position; ?>});
});
if(window.checkout.selectedPayment > 0) {
var b = prefix + window.checkout.selectedPayment;
window.hikashop.setArrayDisplay([b + '__card', b +
'__custom'], false);
}
var b = prefix + data.id;
window.hikashop.setArrayDisplay([b + '__card', b +
'__custom'], true);
};
window.checkout.resetPayment = function(step, pos, payment_id) {
var formData = encodeURI('checkout[payment][id]') +
'=' + encodeURIComponent(payment_id) + '&' +
encodeURI('checkout[payment][card]['+payment_id+']') +
'=reset';
return window.checkout.submitBlock('payment', step, pos,
formData);
};
var ccHikaErrors = {
3: "<?php echo JText::_('CREDIT_CARD_INVALID', true);
?>",
5: "<?php echo JText::_('CREDIT_CARD_EXPIRED', true);
?>"
};
</script>
<?php }
com_hikashop/checkout/show_block_cart.php000064400000060427151163073200014700
0ustar00<?php
/**
* @package HikaShop for Joomla!
* @version 4.4.4
* @author hikashop.com
* @copyright (C) 2010-2021 HIKARI SOFTWARE. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><?php if(empty($this->ajax)) { ?>
<h4>سبد خرید شما</h4>
<span>Û³ Ù…ØØµÙˆÙ„</span>
<div id="hikashop_checkout_cart_list">
<div id="hikashop_checkout_cart_<?php echo $this->step;
?>_<?php echo $this->module_position; ?>"
data-checkout-step="<?php echo $this->step; ?>"
data-checkout-pos="<?php echo $this->module_position;
?>" class="hikashop_checkout_cart">
<?php } ?>
<div class="hikashop_checkout_loading_elem"></div>
<div
class="hikashop_checkout_loading_spinner"></div>
<?php
$this->checkoutHelper->displayMessages('cart');
?>
<div class="table table-striped table-hover"
width="100%">
<div>
<div>
<?php
$row_count = 2;
?>
<!-- POSITION 0 -->
</div>
</div>
<div class="hikashop_checkout-list-cart">
<?php
$k = 0;
$group = $this->config->get('group_options', 0);
$thumbnail_x = $this->config->get('thumbnail_x', 100);
$thumbnail_y = $this->config->get('thumbnail_y', 100);
$cart = $this->checkoutHelper->getCart();
$displayingPrices = new stdClass();
$displayingPrices->price_currency_id =
$cart->full_total->prices[0]->price_currency_id;
$displayingPrices->total = new stdClass();
$displayingPrices->total->price_value =
$cart->full_total->prices[0]->price_value;
$displayingPrices->total->price_value_with_tax =
$cart->full_total->prices[0]->price_value_with_tax;
$displayingPrices->taxes = array();
if(isset($cart->full_total->prices[0]->taxes))
$displayingPrices->taxes =
$cart->full_total->prices[0]->taxes;
if(empty($this->options['show_payment'])){
if(isset($cart->payment->payment_price) &&
$cart->payment->payment_price > 0 &&
$cart->payment->payment_price <
$displayingPrices->total->price_value)
$displayingPrices->total->price_value -=
$cart->payment->payment_price;
if(isset($cart->payment->payment_price_with_tax) &&
$cart->payment->payment_price_with_tax > 0 &&
$cart->payment->payment_price_with_tax <
$displayingPrices->total->price_value_with_tax)
$displayingPrices->total->price_value_with_tax -=
$cart->payment->payment_price_with_tax;
if(isset($cart->payment->taxes)){
foreach($cart->payment->taxes as $payment_tax){
if(array_key_exists($payment_tax->tax_namekey,
$displayingPrices->taxes)){
$displayingPrices->taxes[$payment_tax->tax_namekey]->tax_amount
-= $payment_tax->tax_amount;
}
}
}
}
if(empty($this->options['show_shipping']) &&
!empty($cart->shipping)){
$shipping_price = 0;
$shipping_price_with_tax = 0;
foreach($cart->shipping as $shipping) {
if(isset($shipping->shipping_price) &&
$shipping->shipping_price > 0 && $shipping->shipping_price
< $displayingPrices->total->price_value)
$shipping_price += $shipping->shipping_price;
if(isset($shipping->shipping_price_with_tax) &&
$shipping->shipping_price_with_tax > 0 &&
$shipping->shipping_price_with_tax <
$displayingPrices->total->price_value_with_tax)
$shipping_price_with_tax += $shipping->shipping_price_with_tax;
if(isset($shipping->taxes)){
foreach($shipping->taxes as $shipping_tax){
if(array_key_exists($shipping_tax->tax_namekey,
$displayingPrices->taxes)){
$displayingPrices->taxes[$shipping_tax->tax_namekey]->tax_amount
-= $shipping_tax->tax_amount;
}
}
}
if(!empty($this->options['show_coupon']) &&
isset($cart->coupon->taxes) &&
isset($cart->coupon->discount_shipping_percent) &&
$cart->coupon->discount_shipping_percent > 0){
foreach($cart->coupon->taxes as $coupon_tax){
if(array_key_exists($coupon_tax->tax_namekey,
$displayingPrices->taxes)){
$displayingPrices->taxes[$coupon_tax->tax_namekey]->tax_amount
-= $coupon_tax->tax_amount;
}
}
}
}
$displayingPrices->total->price_value -= $shipping_price;
$displayingPrices->total->price_value_with_tax -=
$shipping_price_with_tax;
}
if(empty($this->options['show_coupon'])){
if(isset($cart->coupon->discount_value_without_tax) &&
$cart->coupon->discount_value_without_tax > 0 &&
$cart->coupon->discount_value_without_tax <
$displayingPrices->total->price_value)
$displayingPrices->total->price_value +=
$cart->coupon->discount_value_without_tax;
if(isset($cart->coupon->discount_value) &&
$cart->coupon->discount_value > 0 &&
$cart->coupon->discount_value <
$displayingPrices->total->price_value_with_tax)
$displayingPrices->total->price_value_with_tax +=
$cart->coupon->discount_value;
}
if(empty($this->productClass))
$this->productClass = hikashop_get('class.product');
if(!empty($this->options['show_cart_image']) &&
empty($this->imageHelper))
$this->imageHelper = hikashop_get('helper.image');
if(empty($this->currencyClass)) {
$this->currencyClass = hikashop_get('class.currency');
$this->currencyHelper =& $this->currencyClass;
}
global $Itemid;
$checkout_itemid =
(int)$this->config->get('checkout_itemid');
if(!empty($checkout_itemid))
$Itemid = $checkout_itemid;
$url_itemid='';
if(!empty($Itemid))
$url_itemid = '&Itemid=' . $Itemid;
foreach($cart->products as $i => $product) {
if(empty($product->cart_product_quantity))
continue;
if($group && !empty($product->cart_product_option_parent_id))
continue;
$this->productClass->addAlias($product);
?>
<div class="row-list-cart row<?php echo $k; ?>">
<!-- IMAGE -->
<div id="info-product-text">
<?php
if(!empty($this->options['show_cart_image'])) {
?>
<div data-title="<?php echo
JText::_('CART_PRODUCT_IMAGE'); ?>"
class="hikashop_cart_product_image_value">
<?php
$image = null;
if(!empty($product->images)) {
$image = reset($product->images);
$this->imageHelper->checkSize($thumbnail_x, $thumbnail_y,
$image);
}
if($image && !$this->config->get('thumbnail'))
{
echo '<img
src="'.$this->imageHelper->uploadFolder_url .
$image->file_path.'" alt="' . $image->file_name .
'"
style="margin-top:10px;margin-bottom:10px;display:inline-block;vertical-align:middle"
/>';
} else {
?>
<div class="hikashop_cart_product_image_thumb"
><?php
$img = $this->imageHelper->getThumbnail(
@$image->file_path,
array(
'width' => $thumbnail_x,
'height' => $thumbnail_y
),
array(
'default' => true,
'forcesize' =>
$this->config->get('image_force_size', true),
'scale' =>
$this->config->get('image_scale_mode', 'inside')
)
);
if($img->success) {
$attributes = '';
if($img->external)
$attributes = '
width="'.$img->req_width.'"
height="'.$img->req_height.'"';
echo '<img
class="hikashop_product_checkout_cart_image"
title="'.$this->escape(@$image->file_description).'"
alt="'.$this->escape(@$image->file_name).'"
src="'.$img->url.'"'.$attributes.'/>';
}
?></div>
<?php
}
?>
</div>
<?php } ?>
<!-- EO IMAGE -->
<!-- QUANTITY -->
<div data-title="<?php echo
JText::_('PRODUCT_QUANTITY'); ?>"
class="hikashop_cart_product_quantity_value"><?php
if(empty($this->options['status'])) {
$this->row =& $product;
$cartHelper = hikashop_get('helper.cart');
$this->quantityLayout =
$cartHelper->getProductQuantityLayout($this->row);
$onchange = 'window.hikashop.checkQuantity(this); if (this.value
!=
\''.$product->cart_product_quantity.'\'){'.$input.'return
window.checkout.submitCart('.$this->step.','.$this->module_position.');
} return false;';
$onincrement =
'window.hikashop.updateQuantity(this,\'{id}\'); if
(document.getElementById(\'{id}\').value !=
\''.$product->cart_product_quantity.'\'){'.$input.'return
window.checkout.submitCart('.$this->step.','.$this->module_position.');
} return false;';
echo $this->loadHkLayout('quantity', array(
'id_prefix' =>
'hikashop_checkout_'.(int)$this->module_position.'_quantity_field',
'quantity_fieldname' =>
'checkout[cart][item]['.$product->cart_product_id.']',
'onchange_script' => $onchange,
'onincrement_script' => $onincrement,
));
if(!empty($this->options['show_delete'])) {
$url = hikashop_currentURL();
$delete_url =
hikashop_completeLink('product&task=updatecart&product_id='.$product->product_id.'&quantity=0');
$delete_url .= ((strpos($delete_url, '?') === false) ?
'?' : '&') .
'return_url='.urlencode(base64_encode(urldecode($url)));
?>
<div
class="hikashop_cart_product_quantity_delete">
<a class="hikashop_no_print" href="<?php
echo $delete_url; ?>" onclick="var qty_field =
document.getElementById('<?php echo
$this->last_quantity_field_id;?>');
if(qty_field){qty_field.value=0; return window.checkout.submitCart(<?php
echo $this->step; ?>,<?php echo $this->module_position; ?>);
} return false;" title="<?php echo
JText::_('HIKA_DELETE'); ?>">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0
512 512"><!-- Font Awesome Pro 5.15.4 by @fontawesome -
https://fontawesome.com License - https://fontawesome.com/license
(Commercial License) --><path d="M256 8C119 8 8 119 8 256s111
248 248 248 248-111 248-248S393 8 256 8zm0 464c-118.7 0-216-96.1-216-216
0-118.7 96.1-216 216-216 118.7 0 216 96.1 216 216 0 118.7-96.1 216-216
216zm94.8-285.3L281.5 256l69.3 69.3c4.7 4.7 4.7 12.3 0 17l-8.5 8.5c-4.7
4.7-12.3 4.7-17 0L256 281.5l-69.3 69.3c-4.7 4.7-12.3 4.7-17
0l-8.5-8.5c-4.7-4.7-4.7-12.3 0-17l69.3-69.3-69.3-69.3c-4.7-4.7-4.7-12.3
0-17l8.5-8.5c4.7-4.7 12.3-4.7 17 0l69.3 69.3 69.3-69.3c4.7-4.7 12.3-4.7 17
0l8.5 8.5c4.6 4.7 4.6 12.3 0 17z"/></svg>
</a>
</div>
<?php
}
}else{
echo $product->cart_product_quantity;
}
?>
</div>
<!-- EO QUANTITY -->
</div>
<!-- NAME -->
<div id="info-product-hikashop">
<div data-title="<?php echo
JText::_('CART_PRODUCT_NAME'); ?>"
class="hikashop_cart_product_name_value">
<p class="hikashop_cart_product_name"><?php
if(!empty($this->options['link_to_product_page'])) {
?><a class="hikashop_no_print" href="<?php echo
hikashop_contentLink('product&task=show&cid=' .
$product->product_id . '&name=' . $product->alias .
$url_itemid, $product);?>" ><?php
}
echo $product->product_name;
if(!empty($this->options['show_product_code'])) {
?><span
class="hikashop_product_code_checkout"><?php
echo $product->product_code;
?></span><?php
}
if(!empty($this->options['link_to_product_page'])) {
?></a><?php
}
if($group && !empty($this->options['show_price'])){
$display_item_price = false;
foreach($cart->products as $j => $optionElement) {
if(empty($optionElement->cart_product_option_parent_id) ||
(int)$optionElement->cart_product_option_parent_id !=
(int)$product->cart_product_id)
continue;
if(!empty($optionElement->prices[0])) {
$display_item_price = true;
break;
}
}
if($display_item_price)
echo ' <span
class="hikashop_product_base_price">' .
strip_tags($this->getDisplayProductPrice($product, true)) .
'</span>';
}
?>
<?php
$input = '';
$html = '';
$edit = !empty($product->has_options) && $group;
if(!empty($product->product_parent_id))
$edit = true;
if(hikashop_level(2) &&
!empty($this->extraFields['item'])) {
$item = $cart->cart_products[$i];
foreach($this->extraFields['item'] as $field) {
$namekey = $field->field_namekey;
if(empty($item->$namekey) || !strlen($item->$namekey))
continue;
$edit = true;
$html .= '<p
class="hikashop_cart_item_'.$namekey.'">'.$this->fieldClass->getFieldName($field).':
'.$this->fieldClass->show($field,
$item->$namekey).'</p>';
}
}
if($group) {
if(!isset($product->prices[0])) {
$product->prices[0] = new stdClass();
$product->prices[0]->price_value = 0;
$product->prices[0]->price_value_with_tax = 0.0;
$product->prices[0]->price_currency_id = hikashop_getCurrency();
$product->prices[0]->unit_price = new stdClass();
$product->prices[0]->unit_price->price_value = 0;
$product->prices[0]->unit_price->price_value_with_tax = 0.0;
$product->prices[0]->unit_price->price_currency_id =
hikashop_getCurrency();
}
foreach($cart->products as $j => $optionElement) {
if(empty($optionElement->cart_product_option_parent_id) ||
$optionElement->cart_product_option_parent_id !=
$product->cart_product_id)
continue;
if(!empty($optionElement->prices[0]))
$this->addOptionPriceToProduct($product->prices[0],$optionElement->prices[0]);
$html .= '<p
class="hikashop_cart_option_name">' .
$optionElement->product_name;
if(!empty($this->options['show_price']) &&
@$optionElement->prices[0]->price_value_with_tax > 0)
$html .= ' ( + ' .
strip_tags($this->getDisplayProductPrice($optionElement, true)) . '
)';
if($optionElement->cart_product_quantity !=
$product->cart_product_quantity) {
$html .= ' x'.round($optionElement->cart_product_quantity
/ $product->cart_product_quantity, 2);
}
$html .= '</p>';
}
}
if(empty($this->options['status']) && $edit) {
$popupHelper = hikashop_get('helper.popup');
echo ' '.$popupHelper->display(
'<i class="fas fa-pen"></i>',
'HIKASHOP_EDIT_CART_PRODUCT',
hikashop_completeLink('cart&task=product_edit&cart_id='.$cart->cart_id.'&cart_product_id='.$product->cart_product_id.'&tmpl=component&'.hikashop_getFormToken().'=1'),
'edit_cart_product',
576, 480,
'title="'.JText::_('EDIT_THE_OPTIONS_OF_THE_PRODUCT').'"',
'', 'link'
);
}
?>
</p>
<?php
if(!empty($html))
echo '<div
class="hikashop_cart_product_custom_item_fields">'.$html.'</div>';
if(!empty($product->extraData) &&
!empty($product->extraData->checkout))
echo '<div
class="hikashop_cart_product_extradata"><p>' .
implode('</p><p>',
$product->extraData->checkout) . '</p></div>';
?>
</div>
<!-- EO NAME -->
<!-- CUSTOM PRODUCT FIELDS -->
<?php
if(hikashop_level(1) &&
!empty($this->extraFields['product'])) {
foreach($this->extraFields['product'] as $field) {
$namekey = $field->field_namekey;
?> <div data-title="<?php echo
$this->fieldClass->trans($field->field_realname); ?>"
class="hikashop_cart_product_field_<?php echo $namekey;
?>">
<?php
if(!empty($product->$namekey)) {
echo '<p
class="hikashop_checkout_cart_product_'.$namekey.'">'
. $this->fieldClass->show($field, $product->$namekey) .
'</p>';
}
?>
</div>
<?php
}
}
?>
<!-- EO CUSTOM PRODUCT FIELDS -->
<!-- TOTAL PRICE -->
<?php
if(!empty($this->options['show_price'])) {
?>
<div data-title="<?php echo
JText::_('CART_PRODUCT_TOTAL_PRICE'); ?>"
class="hikashop_cart_product_total_value"><?php
echo $this->getDisplayProductPrice($product, false);
?></div>
<?php
}
?>
<!-- EO TOTAL PRICE -->
</div>
</div>
<?php
$k = 1-$k;
}
?>
<?php
$taxes = round($displayingPrices->total->price_value_with_tax -
$displayingPrices->total->price_value,
$this->currencyClass->getRounding($cart->full_total->prices[0]->price_currency_id));
if(!empty($this->options['show_price']) &&
(!empty($cart->coupon) || !empty($cart->shipping) ||
!empty($cart->additional) || $taxes > 0)) {
?>
<!-- SEPARATOR ROW -->
<div class="margin"><div colspan="<?php echo
$row_count; ?>"
class="hikashop_cart_empty_footer"></div></div>
<!-- EO SEPARATOR ROW -->
<!-- SUBTOTAL ROW -->
<div>
<div colspan="<?php echo $row_count - 2; ?>"
class="hikashop_cart_empty_footer"></div>
<div id="hikashop_checkout_cart_total2_title"
class="hikashop_cart_subtotal_title
hikashop_cart_title"><?php
echo JText::_('SUBTOTAL');
?></div>
<div class="hikashop_cart_subtotal_value"
data-title="<?php echo JText::_('SUBTOTAL');
?>">
<span class="hikashop_checkout_cart_subtotal"><?php
if(!empty($this->options['price_with_tax']))
echo
$this->currencyClass->format(@$cart->total->prices[0]->price_value_with_tax,@$cart->total->prices[0]->price_currency_id);
else
echo
$this->currencyClass->format(@$cart->total->prices[0]->price_value,@$cart->total->prices[0]->price_currency_id);
?></span>
</div>
</div>
<!-- EO SUBTOTAL ROW -->
<!-- COUPON ROW -->
<?php
}
if(!empty($this->options['show_price']) &&
!empty($cart->coupon) &&
!empty($this->options['show_coupon'])) {
?>
<div>
<div colspan="<?php echo $row_count - 2; ?>"
class="hikashop_cart_empty_footer"></div>
<div id="hikashop_checkout_cart_coupon_title"
class="hikashop_cart_coupon_title
hikashop_cart_title"><?php
echo JText::_('HIKASHOP_COUPON');
?></div>
<div class="hikashop_cart_coupon_value"
data-title="<?php echo JText::_('HIKASHOP_COUPON');
?>">
<span class="hikashop_checkout_cart_coupon"><?php
if(empty($this->options['price_with_tax']))
echo
$this->currencyClass->format(@$cart->coupon->discount_value_without_tax
* -1, @$cart->coupon->discount_currency_id);
else
echo
$this->currencyClass->format(@$cart->coupon->discount_value *
-1, @$cart->coupon->discount_currency_id);
?></span>
</div>
</div>
<?php
}
?>
<!-- EO COUPON ROW -->
<!-- SHIPPING ROW -->
<?php
if(!empty($this->options['show_price']) &&
!empty($cart->shipping) &&
!empty($this->options['show_shipping'])) {
?>
<div>
<div colspan="<?php echo $row_count - 2; ?>"
class="hikashop_cart_empty_footer"></div>
<div id="hikashop_checkout_cart_shipping_title"
class="hikashop_cart_shipping_title
hikashop_cart_title"><?php
echo JText::_('HIKASHOP_SHIPPING');
?></div>
<div class="hikashop_cart_shipping_value"
data-title="<?php echo JText::_('HIKASHOP_SHIPPING');
?>">
<span class="hikashop_checkout_cart_shipping">
<?php
if(isset($this->value)) {
echo $this->value;
} else {
$shipping_price = null;
foreach($cart->shipping as $shipping) {
if(!isset($shipping->shipping_price) &&
isset($shipping->shipping_price_with_tax) ) {
$shipping->shipping_price =
$shipping->shipping_price_with_tax;
}
if(isset($shipping->shipping_price)) {
if($shipping_price === null)
$shipping_price = 0.0;
if(empty($this->options['price_with_tax']) ||
!isset($shipping->shipping_price_with_tax))
$shipping_price += $shipping->shipping_price;
else
$shipping_price += $shipping->shipping_price_with_tax;
}
}
if($shipping_price !== null)
echo $this->currencyClass->format($shipping_price,
$cart->full_total->prices[0]->price_currency_id);
}
?>
</span>
</div>
</div>
<?php
}
?>
<!-- EO SHIPPING ROW -->
<!-- ADDITIONAL ROW -->
<?php
if(!empty($cart->additional)) {
$exclude_additionnal = explode(',',
$this->config->get('order_additional_hide',
''));
foreach($cart->additional as $k => $additional) {
if(in_array($additional->name, $exclude_additionnal))
continue;
if(empty($this->options['show_price']) &&
!empty($additional->price_value))
continue;
?>
<div id="hikashop_checkout_cart_additional_<?php echo
str_replace(' ','_',$k); ?>_line" >
<div colspan="<?php echo $row_count - 2; ?>"
class="hikashop_cart_empty_footer"></div>
<div id="hikashop_checkout_cart_additional_<?php echo
str_replace(' ','_',$k); ?>_title"
class="hikashop_cart_additional_title
hikashop_cart_title"><?php
echo JText::_($additional->name);
?></div>
<div class="hikashop_cart_additional_value"
data-title="<?php echo JText::_($additional->name);
?>">
<span class="hikashop_checkout_cart_additional">
<?php
if(!empty($additional->price_value) || empty($additional->value))
{
if($taxes == 0 ||
empty($this->options['price_with_tax']))
echo
$this->currencyClass->format(@$additional->price_value,$additional->price_currency_id);
else
echo
$this->currencyClass->format(@$additional->price_value_with_tax,$additional->price_currency_id);
} else
echo $additional->value;
?>
</span>
</div>
</div>
<?php
}
}
?>
<!-- EO ADDITIONAL ROW -->
<!-- TAXES ROW -->
<?php
if(!empty($this->options['show_price']) && $taxes
> 0){
if($this->config->get('detailed_tax_display') &&
isset($displayingPrices->taxes)) {
foreach($displayingPrices->taxes as $tax) {
?>
<div>
<div colspan="<?php echo $row_count - 2; ?>"
class="hikashop_cart_empty_footer"></div>
<div id="hikashop_checkout_cart_tax_title"
class="hikashop_cart_tax_title hikashop_cart_title"><?php
echo hikashop_translate($tax->tax_namekey);
?></div>
<div class="hikashop_cart_tax_value"
data-title="<?php echo $tax->tax_namekey; ?>">
<span class="hikashop_checkout_cart_taxes"><?php
echo $this->currencyClass->format($tax->tax_amount,
$cart->full_total->prices[0]->price_currency_id);
?></span>
</div>
</div>
<?php
}
} else {
?>
<div>
<div colspan="<?php echo $row_count - 2; ?>"
class="hikashop_cart_empty_footer"></div>
<div id="hikashop_checkout_cart_tax_title"
class="hikashop_cart_tax_title hikashop_cart_title"><?php
echo JText::_('TAXES');
?></div>
<div class="hikashop_cart_tax_value"
data-title="<?php echo Jtext::_('TAXES');
?>">
<span class="hikashop_checkout_cart_taxes"><?php
echo $this->currencyClass->format($taxes,
$cart->full_total->prices[0]->price_currency_id);
?></span>
</div>
</div>
<?php
}
}
?>
<!-- EO TAXES ROW -->
<!-- PAYMENT ROW -->
<?php
if(!empty($this->options['show_price']) &&
!empty($cart->payment) && $cart->payment->payment_price !=
0 && !empty($this->options['show_payment'])) {
?>
<div>
<div colspan="<?php echo $row_count - 2; ?>"
class="hikashop_cart_empty_footer"></div>
<div id="hikashop_checkout_cart_payment_title"
class="hikashop_cart_payment_title
hikashop_cart_title"><?php
echo JText::_('HIKASHOP_PAYMENT');
?></div>
<div class="hikashop_cart_payment_value"
data-title="<?php echo Jtext::_('HIKASHOP_PAYMENT');
?>">
<span class="hikashop_checkout_cart_payment"><?php
if(!isset($cart->payment->payment_price) &&
isset($cart->payment->payment_price_with_tax) ) {
if(isset($this->value)) {
echo $this->value;
} else {
$cart->payment->payment_price = 0.0;
$cart->payment->payment_price_with_tax = 0.0;
}
}
if(isset($cart->payment->payment_price)) {
if($taxes == 0 ||
empty($this->options['price_with_tax']) ||
!isset($cart->payment->payment_price_with_tax) )
echo
$this->currencyClass->format(@$cart->payment->payment_price,
$cart->full_total->prices[0]->price_currency_id);
else
echo
$this->currencyClass->format(@$cart->payment->payment_price_with_tax,
$cart->full_total->prices[0]->price_currency_id);
}
?></span>
</div>
</div>
<?php
}
?>
<!-- EO PAYMENT ROW -->
<!-- TOTAL ROW -->
<?php
if(!empty($this->options['show_price'])) {
?>
<div>
<div colspan="<?php echo $row_count - 2; ?>"
class="hikashop_cart_empty_footer"></div>
<div id="hikashop_checkout_cart_final_total_title"
class="hikashop_cart_total_title
hikashop_cart_title"><?php
echo JText::_('HIKASHOP_TOTAL');
?></div>
<div class="hikashop_cart_total_value"
data-title="<?php echo Jtext::_('HIKASHOP_TOTAL');
?>">
<span
class="hikashop_checkout_cart_final_total"><?php
echo
$this->currencyClass->format($displayingPrices->total->price_value_with_tax,
$displayingPrices->price_currency_id);
?></span>
</div>
</div>
<?php
}
?>
<!-- EO TOTAL ROW -->
</div>
</div>
<?php
if(!empty($this->extraData[$this->module_position]) &&
!empty($this->extraData[$this->module_position]->bottom)) { echo
implode("\r\n",
$this->extraData[$this->module_position]->bottom); }
if(false) {
?>
<noscript>
<input id="hikashop_checkout_cart_quantity_button"
class="btn button" type="submit"
name="refresh" value="<?php echo
JText::_('REFRESH_CART');?>"/>
</noscript>
<?php
}
if(empty($this->ajax)) {
?>
</div>
</div>
<script type="text/javascript">
if(!window.checkout) window.checkout = {};
window.Oby.registerAjax(['checkout.cart.updated','cart.updated'],
function(params){
if(window.checkout.isSource(params, <?php echo (int)$this->step;
?>, <?php echo (int)$this->module_position; ?>))
return;
window.checkout.refreshCart(<?php echo (int)$this->step; ?>,
<?php echo (int)$this->module_position; ?>);
});
window.checkout.refreshCart = function(step, id) { return
window.checkout.refreshBlock('cart', step, id); };
window.checkout.submitCart = function(step, id) { return
window.checkout.submitBlock('cart', step, id); };
</script>
<?php
}
?>
<style>
</style>
com_hikashop/layouts/quantity.php000064400000031620151163073210013300
0ustar00<?php
/**
* @package HikaShop for Joomla!
* @version 4.4.4
* @author hikashop.com
* @copyright (C) 2010-2021 HIKARI SOFTWARE. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><?php
if(empty($this->cartHelper))
$this->cartHelper = hikashop_get('helper.cart');
$quantity_counter = $this->cartHelper->getQuantityCounter($this);
$prefix = $this->params->get('id_prefix',
'hikashop_product_quantity_field');
$id = $prefix.'_'.$quantity_counter;
$this->last_quantity_field_id = $id;
$extra_data_attribute = '';
if(!isset($this->config))
$this->config = hikashop_config();
if(isset($this->row) &&
isset($this->row->product_min_per_order)) {
$min_quantity = ($this->row->product_min_per_order ||
empty($this->row->parent_product)) ?
$this->row->product_min_per_order :
$this->row->parent_product->product_min_per_order;
$max_quantity = ($this->row->product_max_per_order ||
empty($this->row->parent_product)) ?
$this->row->product_max_per_order :
$this->row->parent_product->product_max_per_order;
$min_quantity = max($min_quantity, 1);
$max_quantity = max($max_quantity, 0);
if($this->row->product_quantity > 0) {
if($max_quantity == 0)
$max_quantity = $this->row->product_quantity;
else
$max_quantity = min($max_quantity, $this->row->product_quantity);
}
} else {
$min_quantity =
max((int)$this->params->get('min_quantity', 0), 1);
$max_quantity =
max((int)$this->params->get('max_quantity', 0), 0);
}
$current_quantity =
(int)$this->params->get('product_quantity',
$min_quantity);
if(isset($this->row) &&
isset($this->row->cart_product_quantity)) {
$current_quantity = (int)$this->row->cart_product_quantity;
$extra_data_attribute .= '
data-hk-allow-zero="true"';
}
$quantity_fieldname =
$this->params->get('quantity_fieldname',
'quantity');
$quantityLayout = isset($this->quantityLayout) ?
$this->quantityLayout :
$this->params->get('quantityLayout', 'inherit');
if((empty($quantityLayout) || $quantityLayout == 'inherit')
&& isset($this->row))
$quantityLayout =
$this->cartHelper->getProductQuantityLayout($this->row);
if(empty($quantityLayout) || $quantityLayout == 'inherit') {
$quantityLayout =
$this->config->get('product_quantity_display',
'show_default_div');
}
hikashop_loadJslib('notify');
hikashop_loadJslib('translations');
$script = $this->params->get('onchange_script',
'window.hikashop.checkQuantity(this);');
$increment_script = str_replace('{id}', $id,
$this->params->get('onincrement_script', 'return
window.hikashop.updateQuantity(this,
\''.$id.'\');'));
$extra_data = $this->params->get('extra_data',
'');
$in_cart = !empty($this->row->cart_product_id);
if(!isset($this->row->all_prices) &&
isset($this->row->prices))
$this->row->all_prices =& $this->row->prices;
if($quantityLayout == 'show_select_price' &&
!isset($this->row->all_prices)) {
$quantityLayout = 'show_select';
}
$force = $this->params->get('force_input', false);
if($force && $quantityLayout == 'show_none')
$quantityLayout = 'show_simple';
switch($quantityLayout) {
case 'show_none':
?>
<div class="hikashop_product_quantity_div
hikashop_product_quantity_input_div_none">
<input id="<?php echo $id; ?>"
type="hidden" value="<?php echo $current_quantity;
?>" name="<?php echo $quantity_fieldname; ?>"
data-hk-qty-old="<?php echo $current_quantity; ?>"
data-hk-qty-min="<?php echo $min_quantity; ?>"
data-hk-qty-max="<?php echo $max_quantity; ?>"<?php echo
$extra_data_attribute; ?> onchange="<?php echo $script;
?>" <?php echo $extra_data; ?> />
<span><?php echo $current_quantity; ?></span>
</div>
<?php
break;
case 'show_regrouped':
?>
<div class="input-append hikashop_product_quantity_div
hikashop_product_quantity_input_div_regrouped">
<input id="<?php echo $id; ?>" type="text"
value="<?php echo $current_quantity; ?>"
onfocus="this.select()"
class="hikashop_product_quantity_field" name="<?php echo
$quantity_fieldname; ?>" data-hk-qty-old="<?php echo
$current_quantity; ?>" data-hk-qty-min="<?php echo
$min_quantity; ?>" data-hk-qty-max="<?php echo
$max_quantity; ?>"<?php echo $extra_data_attribute; ?>
onchange="<?php echo $script; ?>" <?php echo
$extra_data; ?> />
<div class="add-on hikashop_product_quantity_div
hikashop_product_quantity_change_div_regrouped">
<div
class="hikashop_product_quantity_change_div_plus_regrouped">
<a class="hikashop_product_quantity_field_change_plus
hikashop_product_quantity_field_change" href="#"
data-hk-qty-mod="1" onclick="<?php echo
$increment_script; ?>">+</a>
</div>
<div
class="hikashop_product_quantity_change_div_plus_regrouped">
<a class="hikashop_product_quantity_field_change_minus
hikashop_product_quantity_field_change" href="#"
data-hk-qty-mod="-1" onclick="<?php echo
$increment_script; ?>">–</a>
</div>
</div>
</div>
<?php
break;
case 'show_select':
if(empty($max_quantity))
$max_quantity = (int)$min_quantity *
$this->config->get('quantity_select_max_default_value',
15);
?>
<div class="hikashop_product_quantity_div
hikashop_product_quantity_input_div_select"><?php
$r = range($min_quantity, $max_quantity, $min_quantity);
if(!in_array($current_quantity, $r))
$r[] = $current_quantity;
if(!in_array($max_quantity, $r))
$r[] = $max_quantity;
$values = array_combine($r, $r);
ksort($values);
echo JHTML::_('select.genericlist', $values, '',
'style="width:auto;" class="no-chzn"
onchange="var el =
document.getElementById(\''.$id.'\'); el.value =
this.value; el.onchange();"', 'value',
'text', $current_quantity, $id.'_select');
?>
<input id="<?php echo $id; ?>"
type="hidden" value="<?php echo $current_quantity;
?>" class="hikashop_product_quantity_field"
name="<?php echo $quantity_fieldname; ?>"
data-hk-qty-old="<?php echo $current_quantity; ?>"
data-hk-qty-min="<?php echo $min_quantity; ?>"
data-hk-qty-max="<?php echo $max_quantity; ?>"<?php echo
$extra_data_attribute; ?> onchange="<?php echo $script;
?>" <?php echo $extra_data; ?> />
</div>
<?php
break;
case 'show_select_price':
if(!$max_quantity)
$max_quantity = (int)$min_quantity *
$this->config->get('quantity_select_max_default_value',
15);
?>
<div class="hikashop_product_quantity_div
hikashop_product_quantity_input_div_select"><?php
$values = array();
foreach($this->row->all_prices as $price) {
$price_min_qty = max((int)$price->price_min_quantity,
$min_quantity);
$values[$price_min_qty] = $price_min_qty;
}
if(empty($values)) {
$r = range($min_quantity, $max_quantity, $min_quantity);
if(!in_array($max_quantity, $r))
$r[] = $max_quantity;
$values = array_combine($r, $r);
}else{
$min_quantity = min($values);
$max_quantity = max($values);
if($current_quantity < $min_quantity)
$current_quantity = $min_quantity;
}
ksort($values);
echo JHTML::_('select.genericlist', $values, '',
'onchange="var el =
document.getElementById(\''.$id.'\'); el.value =
this.value; el.onchange();"', 'value',
'text', $current_quantity);
?>
<input id="<?php echo $id; ?>"
type="hidden" value="<?php echo $current_quantity;
?>" class="hikashop_product_quantity_field"
name="<?php echo $quantity_fieldname; ?>"
data-hk-qty-old="<?php echo $current_quantity; ?>"
data-hk-qty-min="<?php echo $min_quantity; ?>"
data-hk-qty-max="<?php echo $max_quantity; ?>"<?php echo
$extra_data_attribute; ?> onchange="<?php echo $script;
?>" <?php echo $extra_data; ?> />
</div>
<?php
break;
case 'show_simple':
?>
<input id="<?php echo $id; ?>" type="text"
value="<?php echo $current_quantity; ?>"
class="hikashop_product_quantity_field" name="<?php echo
$quantity_fieldname; ?>" data-hk-qty-old="<?php echo
$current_quantity; ?>" data-hk-qty-min="<?php echo
$min_quantity; ?>" data-hk-qty-max="<?php echo
$max_quantity; ?>"<?php echo $extra_data_attribute; ?>
onchange="<?php echo $script; ?>" <?php echo
$extra_data; ?> />
<?php
break;
case 'show_leftright':
$extra_class = '';
if (HIKASHOP_J40) {
$extra_class = 'hika_j4';
}
?>
<div class="input-prepend input-append
hikashop_product_quantity_div
hikashop_product_quantity_change_div_leftright <?php echo $extra_class;
?>">
<span class="add-on">
<a class="hikashop_product_quantity_field_change_minus
hikashop_product_quantity_field_change" href="#"
data-hk-qty-mod="-1" onclick="<?php echo
$increment_script; ?>">–</a>
</span>
<input id="<?php echo $id; ?>" type="text"
value="<?php echo $current_quantity; ?>"
onfocus="this.select()"
class="hikashop_product_quantity_field" name="<?php echo
$quantity_fieldname; ?>" data-hk-qty-old="<?php echo
$current_quantity; ?>" data-hk-qty-min="<?php echo
$min_quantity; ?>" data-hk-qty-max="<?php echo
$max_quantity; ?>"<?php echo $extra_data_attribute; ?>
onchange="<?php echo $script; ?>" <?php echo
$extra_data; ?> />
<span class="add-on">
<a class="hikashop_product_quantity_field_change_plus
hikashop_product_quantity_field_change" href="#"
data-hk-qty-mod="1" onclick="<?php echo
$increment_script; ?>">+</a>
</span>
</div>
<?php
break;
case 'show_simplified':
?>
<div class="hikashop_product_quantity_div
hikashop_product_quantity_input_div_simplified">
<input id="<?php echo $id; ?>" type="text"
value="<?php echo $current_quantity; ?>"
onfocus="this.select()"
class="hikashop_product_quantity_field" name="<?php echo
$quantity_fieldname; ?>" data-hk-qty-old="<?php echo
$current_quantity; ?>" data-hk-qty-min="<?php echo
$min_quantity; ?>" data-hk-qty-max="<?php echo
$max_quantity; ?>"<?php echo $extra_data_attribute; ?>
onchange="<?php echo $script; ?>" <?php echo
$extra_data; ?> />
</div>
<?php
break;
case 'show_html5':
$html5_data = ((int)$max_quantity > 0) ?
'max="'.(int)$max_quantity.'"' :
'';
?>
<div class="hikashop_product_quantity_div
hikashop_product_quantity_input_div_simplified">
<input id="<?php echo $id; ?>"
type="number" min="<?php echo $min_quantity; ?>"
value="<?php echo $current_quantity; ?>"
class="hikashop_product_quantity_field" name="<?php echo
$quantity_fieldname; ?>" data-hk-qty-old="<?php echo
$current_quantity; ?>" data-hk-qty-min="<?php echo
$min_quantity; ?>" data-hk-qty-max="<?php echo
$max_quantity; ?>"<?php echo $extra_data_attribute; ?>
onchange="<?php echo $script; ?>" <?php echo
$extra_data; ?> />
</div>
<?php
break;
case 'show_default':
?>
<table class="hikashop_product_quantity_table">
<tr>
<td rowspan="2">
<input id="<?php echo $id; ?>"
type="text" value="<?php echo $current_quantity;
?>" onfocus="this.select()"
class="hikashop_product_quantity_field" name="<?php echo
$quantity_fieldname; ?>" data-hk-qty-old="<?php echo
$current_quantity; ?>" data-hk-qty-min="<?php echo
$min_quantity; ?>" data-hk-qty-max="<?php echo
$max_quantity; ?>"<?php echo $extra_data_attribute; ?>
onchange="<?php echo $script; ?>" <?php echo
$extra_data; ?> />
</td>
<td>
<a class="hikashop_product_quantity_field_change_plus
hikashop_product_quantity_field_change" href="#"
data-hk-qty-mod="1" onclick="<?php echo
$increment_script; ?>">+</a>
</td>
</tr>
<tr>
<td>
<a class="hikashop_product_quantity_field_change_minus
hikashop_product_quantity_field_change" href="#"
data-hk-qty-mod="-1" onclick="<?php echo
$increment_script; ?>">–</a>
</td>
</tr>
</table>
<?php
break;
default:
case 'show_default_div':
?>
<?php
if($in_cart && !in_array($quantityLayout,
array('show_none','show_select','show_select_price')))
{
?>
<div class="hikashop_cart_product_quantity_refresh">
<a class="hikashop_no_print" href="#"
onclick="var input = document.getElementById('<?php echo $id;
?>'); if(input.form.onsubmit && !input.form.onsubmit())
return; input.form.submit();" title="<?php echo
JText::_('HIKA_REFRESH'); ?>">
<i class="fa fa-sync"></i>
</a>
</div>
<?php
}
?>
<div class="hikashop_product_quantity_div
hikashop_product_quantity_input_div_default">
<input id="<?php echo $id; ?>" type="text"
value="<?php echo $current_quantity; ?>"
onfocus="this.select()"
class="hikashop_product_quantity_field" name="<?php echo
$quantity_fieldname; ?>" data-hk-qty-old="<?php echo
$current_quantity; ?>" data-hk-qty-min="<?php echo
$min_quantity; ?>" data-hk-qty-max="<?php echo
$max_quantity; ?>"<?php echo $extra_data_attribute; ?>
onchange="<?php echo $script; ?>" <?php echo
$extra_data; ?> />
<div
class="hikashop_product_quantity_change_div_plus_default">
<a class="hikashop_product_quantity_field_change_plus
hikashop_product_quantity_field_change" href="#"
data-hk-qty-mod="1" onclick="<?php echo
$increment_script; ?>">+</a>
</div>
<div
class="hikashop_product_quantity_change_div_minus_default">
<a class="hikashop_product_quantity_field_change_minus
hikashop_product_quantity_field_change" href="#"
data-hk-qty-mod="-1" onclick="<?php echo
$increment_script; ?>">–</a>
</div>
</div>
<?php
break;
}
?>
com_media/medialist/thumbs_folders.php000064400000003157151163446410014200
0ustar00<?php
/**
* @package Joomla.Administrator
* @subpackage com_media
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
?>
<?php foreach ($this->folders as $i => $folder) : ?>
<li class="imgOutline thumbnail height-80 width-80
center">
<?php if ($this->canDelete):?>
<a class="close delete-item" target="_top"
href="index.php?option=com_media&task=folder.delete&tmpl=index&<?php
echo JSession::getFormToken(); ?>=1&folder=<?php echo
rawurlencode($this->state->folder); ?>&rm[]=<?php echo
$this->escape($folder->name); ?>" rel="<?php echo
$this->escape($folder->name); ?> :: <?php echo
$this->escape($folder->files) +
$this->escape($folder->folders); ?>" title="<?php
echo
JText::_('JACTION_DELETE');?>">×</a>
<div class="pull-left">
<?php echo JHtml::_('grid.id', $i,
$this->escape($folder->name), false, 'rm',
'cb-folder'); ?>
</div>
<div class="clearfix"></div>
<?php endif;?>
<div class="height-50">
<a
href="index.php?option=com_media&view=mediaList&tmpl=component&folder=<?php
echo rawurlencode($folder->path_relative); ?>"
target="folderframe">
<span class="icon-folder-2"></span>
</a>
</div>
<div class="small">
<a
href="index.php?option=com_media&view=mediaList&tmpl=component&folder=<?php
echo rawurlencode($folder->path_relative); ?>"
target="folderframe">
<?php echo JHtml::_('string.truncate',
$this->escape($folder->name), 10, false); ?>
</a>
</div>
</li>
<?php endforeach; ?>
com_media/medialist/thumbs_imgs.php000064400000004025151163446410013474
0ustar00<?php
/**
* @package Joomla.Administrator
* @subpackage com_media
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\Registry\Registry;
$params = new Registry;
$dispatcher = JEventDispatcher::getInstance();
?>
<?php foreach ($this->images as $i => $img) : ?>
<?php $dispatcher->trigger('onContentBeforeDisplay',
array('com_media.file', &$img, &$params, 0)); ?>
<li class="imgOutline thumbnail center">
<?php if ($this->canDelete):?>
<div class="imgDelete">
<a class="close delete-item" target="_top"
href="index.php?option=com_media&task=file.delete&tmpl=index&<?php
echo JSession::getFormToken(); ?>=1&folder=<?php echo
rawurlencode($this->state->folder); ?>&rm[]=<?php echo
$this->escape($img->name); ?>"
rel="<?php echo $this->escape($img->name); ?>"
title="<?php echo JText::_('JACTION_DELETE');
?>"><span class="icon-delete">
</span></a>
</div>
<?php endif; ?>
<div class="imgThumb imgInput">
<?php if ($this->canDelete):?>
<?php echo JHtml::_('grid.id', $i,
$this->escape($img->name), false, 'rm',
'cb-image'); ?>
<?php endif; ?>
<label for="cb-image<?php echo $i ?>">
<?php echo JHtml::_('image', COM_MEDIA_BASEURL .
'/' . $this->escape($img->path_relative),
JText::sprintf('COM_MEDIA_IMAGE_TITLE',
$this->escape($img->title), JHtml::_('number.bytes',
$img->size)), array('width' => $img->width_60,
'height' => $img->height_60)); ?>
</label>
</div>
<div class="imgPreview nowrap small">
<a href="<?php echo COM_MEDIA_BASEURL . '/' .
str_replace('%2F', '/',
rawurlencode($img->path_relative)); ?>" title="<?php
echo $this->escape($img->name); ?>" class="preview
truncate">
<span class="icon-search"
aria-hidden="true"></span><?php echo
$this->escape($img->name); ?>
</a>
</div>
</li>
<?php $dispatcher->trigger('onContentAfterDisplay',
array('com_media.file', &$img, &$params, 0)); ?>
<?php endforeach; ?>
com_users/user/edit.php000064400000002161151163446420011165
0ustar00<?php
/* ======================================================
# Login as User for Joomla! - v3.5.9 (pro version)
# -------------------------------------------------------
# For Joomla! CMS (v3.x)
# Author: Web357 (Yiannis Christodoulou)
# Copyright (©) 2014-2022 Web357. All rights reserved.
# License: GNU/GPLv3, http://www.gnu.org/licenses/gpl-3.0.html
# Website: https:/www.web357.com
# Demo: https://demo.web357.com/joomla/login-as-user
# Support: support@web357.com
# Last modified: Wednesday 07 December 2022, 11:05:26 AM
========================================================= */
defined('_JEXEC') or die;
require_once
(JPATH_PLUGINS.'/system/loginasuser/com_users_helper_files/joomla_com_users/common.php');
if (version_compare(JVERSION, '3.0', 'gt') &&
version_compare(JVERSION, '4.0', 'lt'))
{
// Joomla! 3.x
require_once(JPATH_PLUGINS.'/system/loginasuser/com_users_helper_files/joomla_com_users/j3-default-edit.php');
}
else if (version_compare(JVERSION, '4.0', 'gt'))
{
// Joomla! 4.x
require_once
(JPATH_PLUGINS.'/system/loginasuser/com_users_helper_files/joomla_com_users/j4-default-edit.php');
}com_users/users/default.php000064400000002147151163446420012053
0ustar00<?php
/* ======================================================
# Login as User for Joomla! - v3.5.9 (pro version)
# -------------------------------------------------------
# For Joomla! CMS (v3.x)
# Author: Web357 (Yiannis Christodoulou)
# Copyright (©) 2014-2022 Web357. All rights reserved.
# License: GNU/GPLv3, http://www.gnu.org/licenses/gpl-3.0.html
# Website: https:/www.web357.com
# Demo: https://demo.web357.com/joomla/login-as-user
# Support: support@web357.com
# Last modified: Wednesday 07 December 2022, 11:05:26 AM
========================================================= */
defined('_JEXEC') or die;
require_once
(JPATH_PLUGINS.'/system/loginasuser/com_users_helper_files/joomla_com_users/common.php');
if (version_compare(JVERSION, '3.0', 'gt') &&
version_compare(JVERSION, '4.0', 'lt'))
{
// Joomla! 3.x
require_once(JPATH_PLUGINS.'/system/loginasuser/com_users_helper_files/joomla_com_users/j3-default.php');
}
else if (version_compare(JVERSION, '4.0', 'gt'))
{
// Joomla! 4.x
require_once
(JPATH_PLUGINS.'/system/loginasuser/com_users_helper_files/joomla_com_users/j4-default.php');
}editor_content.css000064400000002001151163446420010275 0ustar00body {
background: #000;
font-family: Arial,sans-serif;
line-height: 1.3em;
font-size: 96%;
color: #333;
}
h1 {
font-family:Helvetica ,Arial,sans-serif;
font-size: 16px;
font-weight: bold;
color: #ff0000;
}
h2 {
font-family: Arial, Helvetica,sans-serif;
font-size: 14px;
font-weight: normal;
color: #333;
}
h3 {
font-weight: bold;
font-family: Helvetica,Arial,sans-serif;
font-size: 19px;
color: #135cae;
}
h4 {
font-weight: bold;
font-family: Arial, Helvetica, sans-serif;
color: #333;
}
a:link, a:visited {
color: #1B57B1; text-decoration: none;
font-weight: normal;
}
a:hover {
color: #00c; text-decoration: underline;
font-weight: normal;
}
div.caption { padding: 0 10px 0 10px; }
div.caption img { border: 1px solid #CCC; }
div.caption p { font-size: .90em; color: #666; text-align: center; }
div.teaser { background:#ccc; }
layouts/joomla/pagination/link.php000064400000005512151163446430013336
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
/** @var JPaginationObject $item */
$item = $displayData['data'];
if (!empty($displayData['pagOptions']))
{
$options = new
Joomla\Registry\Registry($displayData['pagOptions']);
$liClass = $options->get('liClass', '');
$addText = $options->get('addText', '');
}
else
{
$liClass = $addText = '';
}
$display = $item->text;
switch ((string) $item->text)
{
// Check for "Start" item
case JText::_('JLIB_HTML_START') :
$icon = 'icon-backward icon-first';
$aria = JText::sprintf('JLIB_HTML_GOTO_POSITION',
strtolower($item->text));
break;
// Check for "Prev" item
case JText::_('JPREV') :
$item->text = JText::_('JPREVIOUS');
$icon = 'icon-step-backward icon-previous';
$aria = JText::sprintf('JLIB_HTML_GOTO_POSITION',
strtolower($item->text));
break;
// Check for "Next" item
case JText::_('JNEXT') :
$icon = 'icon-step-forward icon-next';
$aria = JText::sprintf('JLIB_HTML_GOTO_POSITION',
strtolower($item->text));
break;
// Check for "End" item
case JText::_('JLIB_HTML_END') :
$icon = 'icon-forward icon-last';
$aria = JText::sprintf('JLIB_HTML_GOTO_POSITION',
strtolower($item->text));
break;
default:
$icon = null;
$aria = JText::sprintf('JLIB_HTML_GOTO_PAGE', $item->text);
break;
}
$item->text .= $addText ?: '';
if ($icon !== null)
{
$display = '<span class="' . $icon . '"
aria-hidden="true"></span>';
}
if ($displayData['active'])
{
if ($item->base > 0)
{
$limit = 'limitstart.value=' . $item->base;
}
else
{
$limit = 'limitstart.value=0';
}
$cssClasses = array();
$title = '';
if (!is_numeric($item->text))
{
JHtml::_('bootstrap.tooltip');
$cssClasses[] = 'hasTooltip';
$title = ' title="' . $item->text . '"
';
}
$onClick = 'document.adminForm.' . $item->prefix .
'limitstart.value=' . ($item->base > 0 ? $item->base :
'0') . '; Joomla.submitform();return false;';
}
else
{
$class = (property_exists($item, 'active') &&
$item->active) ? 'active' : 'disabled';
if ($class != 'active')
{
$class .= $liClass ? ($class ? ' ' : '') . $liClass :
'';
}
}
?>
<?php if ($displayData['active']) : ?>
<li<?php echo $liClass ? ' class="' . $liClass .
'"' : ''; ?>>
<a aria-label="<?php echo $aria; ?>" <?php echo
$cssClasses ? 'class="' . implode(' ',
$cssClasses) . '"' : ''; ?> <?php echo
$title; ?> href="#" onclick="<?php echo $onClick;
?>">
<?php echo $display; ?>
</a>
</li>
<?php else : ?>
<li class="<?php echo $class; ?>">
<span <?php echo $class == 'active' ?
'aria-current="true" aria-label="' .
JText::sprintf('JLIB_HTML_PAGE_CURRENT', $item->text) .
'"' : ''; ?>>
<?php echo $display; ?>
</span>
</li>
<?php endif;
layouts/joomla/pagination/links.php000064400000003722151163446430013522
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\Registry\Registry;
$list = $displayData['list'];
$pages = $list['pages'];
$pagesTotal = $list['pagesTotal'];
$options = new Registry($displayData['options']);
$showLimitBox = $options->get('showLimitBox', 0);
$showPagesLinks = $options->get('showPagesLinks', true);
$showLimitStart = $options->get('showLimitStart', true);
?>
<div class="pagination pagination-toolbar clearfix">
<?php if ($showLimitBox) : ?>
<div class="limit pull-right">
<?php echo $list['limitfield']; ?>
</div>
<?php endif; ?>
<?php if ($showPagesLinks && (!empty($pages))) : ?>
<nav role="navigation" aria-label="<?php echo
JText::_('JLIB_HTML_PAGINATION'); ?>">
<ul class="pagination-list">
<?php
$pages['start']['pagOptions'] =
array('addText' => ' (' .
JText::sprintf('JLIB_HTML_PAGE_CURRENT_OF_TOTAL', 1, $pagesTotal)
. ')');
echo JLayoutHelper::render('joomla.pagination.link',
$pages['start']);
echo JLayoutHelper::render('joomla.pagination.link',
$pages['previous']); ?>
<?php foreach ($pages['pages'] as $page) :
$page['pagOptions'] = array('liClass' =>
'hidden-phone');
?>
<?php echo
JLayoutHelper::render('joomla.pagination.link', $page); ?>
<?php endforeach; ?>
<?php
echo JLayoutHelper::render('joomla.pagination.link',
$pages['next']);
$pages['end']['pagOptions'] =
array('addText' => ' (' .
JText::sprintf('JLIB_HTML_PAGE_CURRENT_OF_TOTAL', $pagesTotal,
$pagesTotal) . ')');
echo JLayoutHelper::render('joomla.pagination.link',
$pages['end']); ?>
</ul>
</nav>
<?php endif; ?>
<?php if ($showLimitStart) : ?>
<input type="hidden" name="<?php echo
$list['prefix']; ?>limitstart" value="<?php echo
$list['limitstart']; ?>" />
<?php endif; ?>
</div>
layouts/joomla/toolbar/versions.php000064400000002562151163446430013564
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Layout variables
* ---------------------
*
* @var string $itemId The item id number
* @var string $typeId The type id number
* @var string $title The link text
* @var string $typeAlias The component type
*/
extract($displayData);
JHtml::_('script',
'com_contenthistory/admin-history-versions.js',
array('version' => 'auto', 'relative'
=> true));
$link =
'index.php?option=com_contenthistory&view=history&layout=modal&tmpl=component&item_id='
. (int) $itemId . '&type_id=' . $typeId .
'&type_alias='
. $typeAlias . '&' . JSession::getFormToken() .
'=1';
echo JHtml::_(
'bootstrap.renderModal',
'versionsModal',
array(
'url' => $link,
'title' =>
JText::_('COM_CONTENTHISTORY_MODAL_TITLE'),
'height' => '300px',
'width' => '800px',
'footer' => '<button type="button"
class="btn" data-dismiss="modal">'
. JText::_('JTOOLBAR_CLOSE') . '</button>'
)
);
?>
<button type="button"
onclick="jQuery('#versionsModal').modal('show')"
class="btn btn-small" data-toggle="modal">
<span class="icon-archive"
aria-hidden="true"></span><?php echo $title; ?>
</button>
mod_version/default.php000064400000000610151163446430011231
0ustar00<?php
/**
* @package Joomla.Administrator
* @subpackage mod_version
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
?>
<?php if (!empty($version)) : ?>
<?php echo $version; ?>
<?php echo ' — '; ?>
<?php endif; ?>
com_hikashop/category/listing.php000064400000014406151163544340013222
0ustar00<?php
/**
* @package HikaShop for Joomla!
* @version 4.4.1
* @author hikashop.com
* @copyright (C) 2010-2021 HIKARI SOFTWARE. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><?php
ob_start();
$title_key = 'show_page_heading';
$titleType = 'h1';
if($this->module) {
$title_key = 'showtitle';
$titleType = 'h2';
}
$title = $this->params->get($title_key);
if(empty($title) && $title_key == 'show_page_heading') {
$params = JComponentHelper::getParams('com_menus');
$title = $params->get($title_key);
}
if(!empty($title) &&
hikaInput::get()->getVar('hikashop_front_end_main', 0)){
if($this->module) {
$heading = $this->params->get('title');
} else {
$heading = $this->params->get('page_title');
if($this->params->get('page_heading')){
$heading = $this->params->get('page_heading');
}
}
?>
<<?php echo $titleType; ?>>
<?php echo $heading; ?>
</<?php echo $titleType; ?>>
<?php
}
if(!$this->module){
$val =
hikaInput::get()->getVar('hikashop_front_end_main',0);
hikaInput::get()->set('hikashop_front_end_main',0);
if(isset($this->element->category_canonical) &&
!empty($this->element->category_canonical)){
$canonicalUrl =
hikashop_cleanURL(hikashop_translate($this->element->category_canonical));
$doc = JFactory::getDocument();
$doc->addHeadLink($canonicalUrl, 'canonical');
}
if(($this->params->get('show_image') &&
!empty($this->element->file_path))||
($this->params->get('show_description')&&!empty($this->element->category_description))){
?>
<div class="hikashop_category_description">
<?php
if($this->params->get('show_image') &&
!empty($this->element->file_path)){
jimport('joomla.filesystem.file');
if(JFile::exists($this->image->getPath($this->element->file_path,false))){
?>
<img src="<?php echo
$this->image->getPath($this->element->file_path); ?>"
class="hikashop_category_image" title="<?php echo
$this->escape(@$this->element->file_description); ?>"
alt="<?php echo $this->escape(@$this->element->file_name);
?>"/>
<?php
}
}
if($this->params->get('show_description',1)&&!empty($this->element->category_description)){
?>
<div
class="hikashop_category_description_content">
<?php echo
JHTML::_('content.prepare',$this->element->category_description);
?>
</div>
<?php
}
?>
</div>
<?php
}
if(!empty($this->fields)){ ?>
<?php
ob_start();
$this->fieldsClass->prefix = '';
foreach($this->fields as $fieldName => $oneExtraField) {
if(!empty($this->element->$fieldName)){ ?>
<tr class="hikashop_category_custom_<?php echo
$oneExtraField->field_namekey;?>_line">
<td class="key">
<span id="hikashop_category_custom_name_<?php echo
$oneExtraField->field_id;?>"
class="hikashop_category_custom_name">
<?php echo
$this->fieldsClass->getFieldName($oneExtraField);?>
</span>
</td>
<td>
<span id="hikashop_category_custom_value_<?php echo
$oneExtraField->field_id;?>"
class="hikashop_category_custom_value">
<?php echo
$this->fieldsClass->show($oneExtraField,$this->element->$fieldName);
?>
</span>
</td>
</tr>
<?php }
}
$custom_fields_html = ob_get_clean();
if(!empty($custom_fields_html)){ ?>
<div id="hikashop_category_custom_info_main"
class="hikashop_category_custom_info_main">
<h4><?php echo
JText::_('CATEGORY_ADDITIONAL_INFORMATION');?></h4>
<table
class="hikashop_category_custom_info_main_table">
<?php echo $custom_fields_html; ?>
</table>
</div>
<?php }
}
hikaInput::get()->set('hikashop_front_end_main',$val);
}
$layout_type = $this->params->get('layout_type');
if(empty($layout_type) || $layout_type=='table') $layout_type =
'div';
$html = $this->loadTemplate($layout_type);
if(!empty($html)) echo '<div
class="hikashop_subcategories_listing">'.$html.'</div>';
if(!$this->module){
$data = $this->params->get('data');
if(empty($data)) {
$hk_p = $this->params->get('hk_product');
if(!empty($hk_p)) {
$data = new stdClass();
$data->hk_product = $hk_p;
}
}
if(isset($data->hk_product) &&
(is_object($data->hk_product) || is_array($data->hk_product))) {
$js = '';
$empty='';
jimport('joomla.html.parameter');
$params = new HikaParameter($empty);
foreach($data->hk_product as $k => $v){
$params->set($k,$v);
}
$params->set('content_synchronize', 1);
$main_div_name =
'hikashop_category_information_module_'.$params->get('id');
$params->set('main_div_name',$main_div_name);
echo '<div class="hikashop_submodules"
style="clear:both">'.hikashop_getLayout('product',
'listing', $params, $js).'</div>';
}
else if(!empty($this->modules)){
$html = '';
jimport('joomla.application.module.helper');
foreach($this->modules as $module){
$html .= JModuleHelper::renderModule($module);
}
if(!empty($html)){
echo '<div class="hikashop_submodules"
style="clear:both">'.$html.'</div>';
}
}
}
$html = ob_get_clean();
if(!empty($html)){
$category_id = 0;
if(!empty($this->element->category_id))
$category_id = $this->element->category_id;
if(!empty($this->row->category_id))
$category_id = $this->row->category_id;
?>
<div id="<?php echo
$this->params->get('main_div_name');?>"
class="hikashop_category_information hikashop_categories_listing_main
hikashop_category_listing_<?php echo $category_id; ?>">
<?php echo $html; ?>
</div>
<?php } ?>
com_virtuemart/category/default.php000064400000015563151163544340013576
0ustar00<?php
/**
*
* Show the products in a category
*
* @package VirtueMart
* @subpackage
* @author RolandD
* @author Max Milbers
* @todo add pagination
* @link https://virtuemart.net
* @copyright Copyright (c) 2004 - 2010 VirtueMart Team. All rights
reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* VirtueMart is free software. This version may have been modified
pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* @version $Id: default.php 10307 2020-04-29 08:31:27Z Milbo $
*/
defined ('_JEXEC') or die('Restricted access');
if (vRequest::getInt('dynamic',false) and
vRequest::getInt('virtuemart_product_id',false)) {
if (!empty($this->products)) {
if($this->fallback){
$p = $this->products;
$this->products = array();
$this->products[0] = $p;
vmdebug('Refallback');
}
echo
shopFunctionsF::renderVmSubLayout($this->productsLayout,array('products'=>$this->products,'currency'=>$this->currency,'products_per_row'=>$this->perRow,'showRating'=>$this->showRating));
}
return ;
}
?> <div class="category-view"> <?php
$js = "
jQuery(document).ready(function () {
jQuery('.orderlistcontainer').hover(
function() { jQuery(this).find('.orderlist').stop().show()},
function() { jQuery(this).find('.orderlist').stop().hide()}
)
});
";
vmJsApi::addJScript('vm-hover',$js);
if ($this->show_store_desc and
!empty($this->vendor->vendor_store_desc)) { ?>
<div class="vendor-store-desc">
<?php echo $this->vendor->vendor_store_desc; ?>
</div>
<?php }
if (!empty($this->showcategory_desc) and empty($this->keyword)){
if(!empty($this->category)) {
?>
<div class="category_description">
<?php echo $this->category->category_description; ?>
</div>
<?php }
if(!empty($this->manu_descr)) {
?>
<div class="manufacturer-description">
<?php echo $this->manu_descr; ?>
</div>
<?php }
}
// Show child categories
if ($this->showcategory and empty($this->keyword)) {
if (!empty($this->category->haschildren)) {
echo
ShopFunctionsF::renderVmSubLayout('categories',array('categories'=>$this->category->children,
'categories_per_row'=>$this->categories_per_row));
}
}
if (!empty($this->products) or ($this->showsearch or
$this->keyword !== false)) {
?>
<div class="browse-view">
<?php
if ($this->showsearch or $this->keyword !== false) {
//id taken in the view.html.php could be modified
$category_id = vRequest::getInt ('virtuemart_category_id', 0);
?>
<!--BEGIN Search Box -->
<div class="virtuemart_search">
<form action="<?php echo JRoute::_
('index.php?option=com_virtuemart&view=category&limitstart=0',
FALSE); ?>" method="get">
<?php if(!empty($this->searchCustomList)) { ?>
<div class="vm-search-custom-list">
<?php echo $this->searchCustomList ?>
</div>
<?php } ?>
<?php if(!empty($this->searchCustomValuesAr)) { ?>
<div class="vm-search-custom-values">
<?php
echo ShopFunctionsF::renderVmSubLayoutAsGrid(
'searchcustomvalues',
array (
'searchcustomvalues' =>
$this->searchCustomValuesAr,
'options' => array (
'items_per_row' => array (
'xs' => 2,
'sm' => 2,
'md' => 2,
'lg' => 2,
'xl' => 2,
),
),
)
);
?>
</div>
<?php } ?>
<div class="vm-search-custom-search-input">
<input name="keyword" class="inputbox"
type="text" size="40" value="<?php echo
$this->keyword ?>"/>
<input type="submit" value="<?php echo vmText::_
('COM_VIRTUEMART_SEARCH') ?>" class="button"
onclick="this.form.keyword.focus();"/>
<?php //echo VmHtml::checkbox ('searchAllCats',
(int)$this->searchAllCats, 1, 0,
'class="changeSendForm"'); ?>
<span class="vm-search-descr"> <?php echo
vmText::_('COM_VM_SEARCH_DESC') ?></span>
</div>
<!-- input type="hidden" name="showsearch"
value="true"/ -->
<input type="hidden" name="view"
value="category"/>
<input type="hidden" name="option"
value="com_virtuemart"/>
<input type="hidden"
name="virtuemart_category_id" value="<?php echo
$category_id; ?>"/>
<input type="hidden" name="Itemid"
value="<?php echo $this->Itemid; ?>"/>
</form>
</div>
<!-- End Search Box -->
<?php
/*if($this->keyword !== false){
?><h3><?php echo
vmText::sprintf('COM_VM_SEARCH_KEYWORD_FOR', $this->keyword);
?></h3><?php
}*/
$j = 'jQuery(document).ready(function() {
jQuery(".changeSendForm")
.off("change",Virtuemart.sendCurrForm)
.on("change",Virtuemart.sendCurrForm);
})';
vmJsApi::addJScript('sendFormChange',$j);
} ?>
<?php // Show child categories
if(!empty($this->orderByList)) { ?>
<div class="orderby-displaynumber">
<div class="floatleft vm-order-list">
<?php echo $this->orderByList['orderby']; ?>
<?php echo $this->orderByList['manufacturer']; ?>
</div>
<div class="vm-pagination vm-pagination-top">
<?php echo $this->vmPagination->getPagesLinks (); ?>
<span class="vm-page-counter"><?php echo
$this->vmPagination->getPagesCounter (); ?></span>
</div>
<div class="floatright display-number"><?php echo
$this->vmPagination->getResultsCounter ();?><br/><?php
echo $this->vmPagination->getLimitBox
($this->category->limit_list_step); ?></div>
<div class="clear"></div>
</div> <!-- end of orderby-displaynumber -->
<?php } ?>
<?php if (!empty($this->category->category_name)) { ?>
<h1><?php echo vmText::_($this->category->category_name);
?></h1>
<?php } ?>
<?php
if (!empty($this->products)) {
//revert of the fallback in the view.html.php, will be removed vm3.2
if($this->fallback){
$p = $this->products;
$this->products = array();
$this->products[0] = $p;
vmdebug('Refallback');
}
echo
shopFunctionsF::renderVmSubLayout($this->productsLayout,array('products'=>$this->products,'currency'=>$this->currency,'products_per_row'=>$this->perRow,'showRating'=>$this->showRating));
if(!empty($this->orderByList)) { ?>
<div class="vm-pagination vm-pagination-bottom"><?php
echo $this->vmPagination->getPagesLinks (); ?><span
class="vm-page-counter"><?php echo
$this->vmPagination->getPagesCounter ();
?></span></div>
<?php }
} elseif ($this->keyword !== false) {
echo vmText::_ ('COM_VIRTUEMART_NO_RESULT') . ($this->keyword
? ' : (' . $this->keyword . ')' : '');
}
?>
</div>
<?php } ?>
</div>
<?php
if(VmConfig::get ('ajax_category', false)){
$j = "Virtuemart.container = jQuery('.category-view');
Virtuemart.containerSelector = '.category-view';";
/*$j = "Virtuemart.container = jQuery('.main');
Virtuemart.containerSelector = '.main';";*/
vmJsApi::addJScript('ajax_category',$j);
vmJsApi::jDynUpdate();
}
?>
<!-- end browse-view -->
com_virtuemart/sublayouts/productss.php000064400000000035151163544340014561
0ustar00<?php
var_dump($viewData);
index.html000064400000000204151163544340006543 0ustar00<!DOCTYPE
html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
</body>
</html>mod_menu/default.php000064400000003613151163544340010515
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage mod_menu
*
* @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
$id = '';
if ($tagId = $params->get('tag_id', ''))
{
$id = ' id="' . $tagId . '"';
}
// The menu class is deprecated. Use nav instead
?>
<ul class="navbar-nav mr-auto mt-2 mt-lg-0 <?php echo
$class_sfx; ?> mod-list"<?php echo $id; ?>>
<?php foreach ($list as $i => &$item)
{
$class = 'item-' . $item->id;
if ($item->id == $default_id)
{
$class .= ' default';
}
if ($item->id == $active_id || ($item->type === 'alias'
&& $item->params->get('aliasoptions') ==
$active_id))
{
$class .= ' current';
}
if (in_array($item->id, $path))
{
$class .= ' active';
}
elseif ($item->type === 'alias')
{
$aliasToId = $item->params->get('aliasoptions');
if (count($path) > 0 && $aliasToId == $path[count($path) - 1])
{
$class .= ' active';
}
elseif (in_array($aliasToId, $path))
{
$class .= ' alias-parent-active';
}
}
if ($item->type === 'separator')
{
$class .= ' divider';
}
if ($item->deeper)
{
$class .= ' deeper';
}
if ($item->parent)
{
$class .= ' parent';
}
echo '<li class="nav-item ' . $class .
'">';
switch ($item->type) :
case 'separator':
case 'component':
case 'heading':
case 'url':
require JModuleHelper::getLayoutPath('mod_menu',
'default_' . $item->type);
break;
default:
require JModuleHelper::getLayoutPath('mod_menu',
'default_url');
break;
endswitch;
// The next item is deeper.
if ($item->deeper)
{
echo '<ul class="nav-child unstyled small">';
}
// The next item is shallower.
elseif ($item->shallower)
{
echo '</li>';
echo str_repeat('</ul></li>',
$item->level_diff);
}
// The next item is on the same level.
else
{
echo '</li>';
}
}
?></ul>
mod_menu/default_component.php000064400000002660151163544340012600
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage mod_menu
*
* @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
$attributes = array();
if ($item->anchor_title)
{
$attributes['title'] = $item->anchor_title;
}
if ($item->anchor_css)
{
$attributes['class'] = $item->anchor_css;
}
if ($item->anchor_rel)
{
$attributes['rel'] = $item->anchor_rel;
}
$linktype = $item->title;
if ($item->menu_image)
{
if ($item->menu_image_css)
{
$image_attributes['class'] = $item->menu_image_css;
$linktype = JHtml::_('image', $item->menu_image,
$item->title, $image_attributes);
}
else
{
$linktype = JHtml::_('image', $item->menu_image,
$item->title);
}
if ($item->params->get('menu_text', 1))
{
$linktype .= '<span class="image-title">' .
$item->title . '</span>';
}
}
if ($item->browserNav == 1)
{
$attributes['target'] = '_blank';
}
elseif ($item->browserNav == 2)
{
$options =
'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes';
$attributes['onclick'] = "window.open(this.href,
'targetWindow', '" . $options . "'); return
false;";
}
$attributes['class'] = isset($attributes['class']) ?
$attributes['class'] : '' . 'nav-link';
echo JHtml::_('link',
JFilterOutput::ampReplace(htmlspecialchars($item->flink, ENT_COMPAT,
'UTF-8', false)), $linktype, $attributes);
mod_menu/default_heading.php000064400000001633151163544340012174
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage mod_menu
*
* @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
$title = $item->anchor_title ? ' title="' .
$item->anchor_title . '"' : '';
$anchor_css = $item->anchor_css ?: '';
$linktype = $item->title;
if ($item->menu_image)
{
if ($item->menu_image_css)
{
$image_attributes['class'] = $item->menu_image_css;
$linktype = JHtml::_('image', $item->menu_image,
$item->title, $image_attributes);
}
else
{
$linktype = JHtml::_('image', $item->menu_image,
$item->title);
}
if ($item->params->get('menu_text', 1))
{
$linktype .= '<span class="image-title">' .
$item->title . '</span>';
}
}
?>
<span class="nav-header <?php echo $anchor_css;
?>"<?php echo $title; ?>><?php echo $linktype;
?></span>
mod_menu/default_separator.php000064400000001632151163544340012574
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage mod_menu
*
* @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
$title = $item->anchor_title ? ' title="' .
$item->anchor_title . '"' : '';
$anchor_css = $item->anchor_css ?: '';
$linktype = $item->title;
if ($item->menu_image)
{
if ($item->menu_image_css)
{
$image_attributes['class'] = $item->menu_image_css;
$linktype = JHtml::_('image', $item->menu_image,
$item->title, $image_attributes);
}
else
{
$linktype = JHtml::_('image', $item->menu_image,
$item->title);
}
if ($item->params->get('menu_text', 1))
{
$linktype .= '<span class="image-title">' .
$item->title . '</span>';
}
}
?>
<span class="separator <?php echo $anchor_css;
?>"<?php echo $title; ?>><?php echo $linktype;
?></span>
mod_menu/default_url.php000064400000002757151163544340011407
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage mod_menu
*
* @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
$attributes = array();
if ($item->anchor_title)
{
$attributes['title'] = $item->anchor_title;
}
if ($item->anchor_css)
{
$attributes['class'] = $item->anchor_css;
}
if ($item->anchor_rel)
{
$attributes['rel'] = $item->anchor_rel;
}
$linktype = $item->title;
if ($item->menu_image)
{
if ($item->menu_image_css)
{
$image_attributes['class'] = $item->menu_image_css;
$linktype = JHtml::_('image', $item->menu_image,
$item->title, $image_attributes);
}
else
{
$linktype = JHtml::_('image', $item->menu_image,
$item->title);
}
if ($item->params->get('menu_text', 1))
{
$linktype .= '<span class="image-title">' .
$item->title . '</span>';
}
}
if ($item->browserNav == 1)
{
$attributes['target'] = '_blank';
$attributes['rel'] = 'noopener noreferrer';
if ($item->anchor_rel == 'nofollow')
{
$attributes['rel'] .= ' nofollow';
}
}
elseif ($item->browserNav == 2)
{
$options =
'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,'
. $params->get('window_open');
$attributes['onclick'] = "window.open(this.href,
'targetWindow', '" . $options . "'); return
false;";
}
echo JHtml::_('link',
JFilterOutput::ampReplace(htmlspecialchars($item->flink, ENT_COMPAT,
'UTF-8', false)), $linktype, $attributes);
com_contact/categories/default.php000064400000002464151163626040013331
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage com_contact
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers');
JHtml::_('behavior.caption');
?>
<div class="categories-list<?php echo
$this->pageclass_sfx;?>">
<?php if ($this->params->get('show_page_heading')) :
?>
<h1>
<?php echo
$this->escape($this->params->get('page_heading')); ?>
</h1>
<?php endif; ?>
<?php if ($this->params->get('show_base_description'))
: ?>
<?php //If there is a description in the menu parameters use that;
?>
<?php if
($this->params->get('categories_description')) : ?>
<div class="category-desc base-desc">
<?php echo JHtml::_('content.prepare',
$this->params->get('categories_description'), '',
'com_contact.categories'); ?>
</div>
<?php else: ?>
<?php //Otherwise get one from the database if it exists. ?>
<?php if ($this->parent->description) : ?>
<div class="category-desc base-desc">
<?php echo JHtml::_('content.prepare',
$this->parent->description, '',
'com_contact.categories'); ?>
</div>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>
<?php
echo $this->loadTemplate('items');
?>
</div>
com_contact/categories/default_items.php000064400000003226151163626040014527
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage com_contact
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
$class = ' class="first"';
if ($this->maxLevelcat != 0 &&
count($this->items[$this->parent->id]) > 0) :
?>
<ul>
<?php foreach ($this->items[$this->parent->id] as $id =>
$item) : ?>
<?php
if ($item->numitems ||
$this->params->get('show_empty_categories_cat') ||
count($item->getChildren())) :
if (!isset($this->items[$this->parent->id][$id + 1]))
{
$class = ' class="last"';
}
?>
<li<?php echo $class; ?>>
<?php $class = ''; ?>
<span class="item-title"><a href="<?php echo
JRoute::_(ContactHelperRoute::getCategoryRoute($item->id));?>">
<?php echo $this->escape($item->title); ?></a>
</span>
<?php if ($this->params->get('show_subcat_desc_cat')
== 1) :?>
<?php if ($item->description) : ?>
<div class="category-desc">
<?php echo JHtml::_('content.prepare',
$item->description, '', 'com_contact.categories');
?>
</div>
<?php endif; ?>
<?php endif; ?>
<?php if ($this->params->get('show_cat_items_cat') ==
1) :?>
<dl><dt>
<?php echo JText::_('COM_CONTACT_COUNT'); ?></dt>
<dd><?php echo $item->numitems; ?></dd>
</dl>
<?php endif; ?>
<?php if (count($item->getChildren()) > 0) :
$this->items[$item->id] = $item->getChildren();
$this->parent = $item;
$this->maxLevelcat--;
echo $this->loadTemplate('items');
$this->parent = $item->getParent();
$this->maxLevelcat++;
endif; ?>
</li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
<?php endif; ?>
com_contact/category/default.php000064400000003050151163626040013011
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage com_contact
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
?>
<div class="contact-category<?php echo
$this->pageclass_sfx;?>">
<?php if ($this->params->get('show_page_heading')) :
?>
<h1>
<?php echo
$this->escape($this->params->get('page_heading')); ?>
</h1>
<?php endif; ?>
<?php if ($this->params->get('show_category_title', 1))
: ?>
<h2>
<?php echo JHtml::_('content.prepare',
$this->category->title, '',
'com_contact.category.title'); ?>
</h2>
<?php endif; ?>
<?php if ($this->params->def('show_description', 1) ||
$this->params->def('show_description_image', 1)) : ?>
<div class="category-desc">
<?php if ($this->params->get('show_description_image')
&& $this->category->getParams()->get('image')) :
?>
<img src="<?php echo
$this->category->getParams()->get('image');
?>"/>
<?php endif; ?>
<?php if ($this->category->description &&
$this->params->get('show_description')) : ?>
<?php echo JHtml::_('content.prepare',
$this->category->description, '',
'com_contact.category.description'); ?>
<?php endif; ?>
<div class="clr"></div>
</div>
<?php endif; ?>
<?php echo $this->loadTemplate('items'); ?>
<?php if ($this->maxLevel != 0 &&
!empty($this->children[$this->category->id])) : ?>
<div class="cat-children">
<h3><?php echo JText::_('JGLOBAL_SUBCATEGORIES');
?></h3>
<?php echo $this->loadTemplate('children'); ?>
</div>
<?php endif; ?>
</div>
com_contact/category/default_children.php000064400000003276151163626040014673
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage com_contact
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
$class = ' class="first"';
if ($this->maxLevel != 0 &&
count($this->children[$this->category->id]) > 0) :
?>
<ul>
<?php foreach ($this->children[$this->category->id] as $id
=> $child) : ?>
<?php
if ($child->numitems ||
$this->params->get('show_empty_categories') ||
count($child->getChildren())) :
if (!isset($this->children[$this->category->id][$id + 1]))
{
$class = ' class="last"';
}
?>
<li<?php echo $class; ?>>
<?php $class = ''; ?>
<span class="item-title"><a href="<?php echo
JRoute::_(ContactHelperRoute::getCategoryRoute($child->id));?>">
<?php echo $this->escape($child->title); ?></a>
</span>
<?php if ($this->params->get('show_subcat_desc') ==
1) :?>
<?php if ($child->description) : ?>
<div class="category-desc">
<?php echo JHtml::_('content.prepare',
$child->description, '', 'com_contact.category');
?>
</div>
<?php endif; ?>
<?php endif; ?>
<?php if ($this->params->get('show_cat_items') == 1)
:?>
<dl><dt>
<?php echo JText::_('COM_CONTACT_CAT_NUM');
?></dt>
<dd><?php echo $child->numitems; ?></dd>
</dl>
<?php endif; ?>
<?php if (count($child->getChildren()) > 0 ) :
$this->children[$child->id] = $child->getChildren();
$this->category = $child;
$this->maxLevel--;
echo $this->loadTemplate('children');
$this->category = $child->getParent();
$this->maxLevel++;
endif; ?>
</li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
<?php endif;
com_contact/category/default_items.php000064400000013064151163626040014220
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage com_contact
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::_('behavior.framework');
$listOrder =
$this->escape($this->state->get('list.ordering'));
$listDirn =
$this->escape($this->state->get('list.direction'));
?>
<?php if (empty($this->items)) : ?>
<p> <?php echo JText::_('COM_CONTACT_NO_CONTACTS');
?> </p>
<?php else : ?>
<form action="<?php echo
htmlspecialchars(JUri::getInstance()->toString()); ?>"
method="post" name="adminForm"
id="adminForm">
<?php if ($this->params->get('show_pagination_limit')) :
?>
<fieldset class="filters">
<legend class="hidelabeltxt"><?php echo
JText::_('JGLOBAL_FILTER_LABEL'); ?></legend>
<div class="display-limit">
<?php echo JText::_('JGLOBAL_DISPLAY_NUM'); ?> 
<?php echo $this->pagination->getLimitBox(); ?>
</div>
</fieldset>
<?php endif; ?>
<table class="category">
<?php if ($this->params->get('show_headings')) : ?>
<thead><tr>
<?php if ($this->params->get('show_image_heading')) :
?>
<th class="item-image">
</th>
<?php endif; ?>
<th class="item-title">
<?php echo JHtml::_('grid.sort',
'COM_CONTACT_CONTACT_EMAIL_NAME_LABEL', 'a.name',
$listDirn, $listOrder); ?>
</th>
<?php if
($this->params->get('show_position_headings')) : ?>
<th class="item-position">
<?php echo JHtml::_('grid.sort',
'COM_CONTACT_POSITION', 'a.con_position', $listDirn,
$listOrder); ?>
</th>
<?php endif; ?>
<?php if ($this->params->get('show_email_headings'))
: ?>
<th class="item-email">
<?php echo JText::_('JGLOBAL_EMAIL'); ?>
</th>
<?php endif; ?>
<?php if
($this->params->get('show_telephone_headings')) : ?>
<th class="item-phone">
<?php echo JText::_('COM_CONTACT_TELEPHONE'); ?>
</th>
<?php endif; ?>
<?php if ($this->params->get('show_mobile_headings'))
: ?>
<th class="item-phone">
<?php echo JText::_('COM_CONTACT_MOBILE'); ?>
</th>
<?php endif; ?>
<?php if ($this->params->get('show_fax_headings')) :
?>
<th class="item-phone">
<?php echo JText::_('COM_CONTACT_FAX'); ?>
</th>
<?php endif; ?>
<?php if ($this->params->get('show_suburb_headings'))
: ?>
<th class="item-suburb">
<?php echo JHtml::_('grid.sort',
'COM_CONTACT_SUBURB', 'a.suburb', $listDirn,
$listOrder); ?>
</th>
<?php endif; ?>
<?php if ($this->params->get('show_state_headings'))
: ?>
<th class="item-state">
<?php echo JHtml::_('grid.sort',
'COM_CONTACT_STATE', 'a.state', $listDirn, $listOrder);
?>
</th>
<?php endif; ?>
<?php if
($this->params->get('show_country_headings')) : ?>
<th class="item-state">
<?php echo JHtml::_('grid.sort',
'COM_CONTACT_COUNTRY', 'a.country', $listDirn,
$listOrder); ?>
</th>
<?php endif; ?>
</tr>
</thead>
<?php endif; ?>
<tbody>
<?php foreach ($this->items as $i => $item) : ?>
<?php if ($this->items[$i]->published == 0) : ?>
<tr class="system-unpublished cat-list-row<?php echo $i %
2; ?>">
<?php else: ?>
<tr class="cat-list-row<?php echo $i % 2; ?>" >
<?php endif; ?>
<?php if ($this->params->get('show_image_heading'))
: ?>
<td class="item-image">
<?php if ($this->items[$i]->image) : ?>
<?php echo JHtml::_('image',
$this->items[$i]->image,
JText::_('COM_CONTACT_IMAGE_DETAILS'), array('class'
=> 'contact-thumbnail img-thumbnail')); ?>
<?php endif; ?>
</td>
<?php endif; ?>
<td class="item-title">
<a href="<?php echo
JRoute::_(ContactHelperRoute::getContactRoute($item->slug,
$item->catid)); ?>">
<?php echo $item->name; ?></a>
</td>
<?php if
($this->params->get('show_position_headings')) : ?>
<td class="item-position">
<?php echo $item->con_position; ?>
</td>
<?php endif; ?>
<?php if
($this->params->get('show_email_headings')) : ?>
<td class="item-email">
<?php echo $item->email_to; ?>
</td>
<?php endif; ?>
<?php if
($this->params->get('show_telephone_headings')) : ?>
<td class="item-phone">
<?php echo $item->telephone; ?>
</td>
<?php endif; ?>
<?php if
($this->params->get('show_mobile_headings')) : ?>
<td class="item-phone">
<?php echo $item->mobile; ?>
</td>
<?php endif; ?>
<?php if ($this->params->get('show_fax_headings'))
: ?>
<td class="item-phone">
<?php echo $item->fax; ?>
</td>
<?php endif; ?>
<?php if
($this->params->get('show_suburb_headings')) : ?>
<td class="item-suburb">
<?php echo $item->suburb; ?>
</td>
<?php endif; ?>
<?php if
($this->params->get('show_state_headings')) : ?>
<td class="item-state">
<?php echo $item->state; ?>
</td>
<?php endif; ?>
<?php if
($this->params->get('show_country_headings')) : ?>
<td class="item-state">
<?php echo $item->country; ?>
</td>
<?php endif; ?>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php if ($this->params->get('show_pagination')) :
?>
<div class="pagination">
<?php if
($this->params->def('show_pagination_results', 1)) : ?>
<p class="counter">
<?php echo $this->pagination->getPagesCounter(); ?>
</p>
<?php endif; ?>
<?php echo $this->pagination->getPagesLinks(); ?>
</div>
<?php endif; ?>
<div>
<input type="hidden" name="filter_order"
value="<?php echo $listOrder; ?>" />
<input type="hidden" name="filter_order_Dir"
value="<?php echo $listDirn; ?>" />
</div>
</form>
<?php endif; ?>
com_contact/contact/default.php000064400000016411151163626040012634
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage com_contact
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
$cparams = JComponentHelper::getParams('com_media');
?>
<div class="contact<?php echo
$this->pageclass_sfx?>">
<?php if ($this->params->get('show_page_heading')) :
?>
<h1>
<?php echo
$this->escape($this->params->get('page_heading')); ?>
</h1>
<?php endif; ?>
<?php if ($this->contact->name &&
$this->params->get('show_name')) : ?>
<div class="page-header">
<h2>
<span class="contact-name"><?php echo
$this->contact->name; ?></span>
</h2>
</div>
<?php endif; ?>
<?php if ($this->params->get('show_contact_category')
=== 'show_no_link') : ?>
<h3>
<span class="contact-category"><?php echo
$this->contact->category_title; ?></span>
</h3>
<?php endif; ?>
<?php if ($this->params->get('show_contact_category')
=== 'show_with_link') : ?>
<?php $contactLink =
ContactHelperRoute::getCategoryRoute($this->contact->catid);?>
<h3>
<span class="contact-category"><a href="<?php
echo $contactLink; ?>">
<?php echo $this->escape($this->contact->category_title);
?></a>
</span>
</h3>
<?php endif; ?>
<?php echo $this->item->event->afterDisplayTitle; ?>
<?php if ($this->params->get('show_contact_list')
&& count($this->contacts) > 1) : ?>
<form action="#" method="get"
name="selectForm" id="selectForm">
<label for="select_contact"><?php echo
JText::_('COM_CONTACT_SELECT_CONTACT'); ?></label>
<?php echo JHtml::_('select.genericlist',
$this->contacts, 'select_contact',
'class="inputbox" onchange="document.location.href =
this.value"', 'link', 'name',
$this->contact->link); ?>
</form>
<?php endif; ?>
<?php if (!empty($this->item->tags->itemTags) &&
$this->params->get('show_tags', 1)) : ?>
<?php $this->item->tagLayout = new
JLayoutFile('joomla.content.tags'); ?>
<?php echo
$this->item->tagLayout->render($this->item->tags->itemTags);
?>
<?php endif; ?>
<?php echo $this->item->event->beforeDisplayContent; ?>
<?php if ($this->params->get('presentation_style') ===
'sliders') : ?>
<?php echo JHtml::_('sliders.start',
'panel-sliders', array('useCookie' =>
'1')); ?>
<?php echo JHtml::_('sliders.panel',
JText::_('COM_CONTACT_DETAILS'), 'basic-details');
?>
<?php endif; ?>
<?php if ($this->params->get('presentation_style') ===
'tabs') : ?>
<?php echo JHtml::_('tabs.start', 'tabs',
array('useCookie' => '1')); ?>
<?php echo JHtml::_('tabs.panel',
JText::_('COM_CONTACT_DETAILS'), 'basic-details');
?>
<?php endif; ?>
<?php if ($this->params->get('presentation_style') ===
'plain'):?>
<?php echo '<h3>' .
JText::_('COM_CONTACT_DETAILS') . '</h3>'; ?>
<?php endif; ?>
<?php if ($this->contact->image &&
$this->params->get('show_image')) : ?>
<div class="thumbnail pull-right">
<?php echo JHtml::_('image', $this->contact->image,
htmlspecialchars($this->contact->name, ENT_QUOTES,
'UTF-8'), array('style' => 'vertical-align:
middle;')); ?>
</div>
<?php endif; ?>
<?php if ($this->contact->con_position &&
$this->params->get('show_position')) : ?>
<dl class="contact-position dl-horizontal">
<dt><?php echo JText::_('COM_CONTACT_POSITION');
?>:</dt>
<dd>
<?php echo $this->contact->con_position; ?>
</dd>
</dl>
<?php endif; ?>
<?php echo $this->loadTemplate('address'); ?>
<?php if ($this->params->get('allow_vcard')) : ?>
<?php echo
JText::_('COM_CONTACT_DOWNLOAD_INFORMATION_AS');?>
<a href="<?php echo
JRoute::_('index.php?option=com_contact&view=contact&id='.$this->contact->id
. '&format=vcf'); ?>">
<?php echo JText::_('COM_CONTACT_VCARD');?></a>
<?php endif; ?>
<?php if (($this->contact->email_to ||
$this->contact->user_id) &&
$this->params->get('show_email_form')) : ?>
<?php if ($this->params->get('presentation_style') ===
'sliders') : ?>
<?php echo JHtml::_('sliders.panel',
JText::_('COM_CONTACT_EMAIL_FORM'), 'display-form');
?>
<?php endif; ?>
<?php if ($this->params->get('presentation_style') ===
'tabs') : ?>
<?php echo JHtml::_('tabs.panel',
JText::_('COM_CONTACT_EMAIL_FORM'), 'display-form');
?>
<?php endif; ?>
<?php if ($this->params->get('presentation_style') ===
'plain'):?>
<?php echo '<h3>'.
JText::_('COM_CONTACT_EMAIL_FORM').'</h3>';
?>
<?php endif; ?>
<?php echo $this->loadTemplate('form'); ?>
<?php endif; ?>
<?php if ($this->params->get('show_links')) : ?>
<?php echo $this->loadTemplate('links'); ?>
<?php endif; ?>
<?php if ($this->contact->user_id &&
$this->contact->articles &&
$this->params->get('show_articles')) : ?>
<?php if ($this->params->get('presentation_style') ===
'sliders') :
echo JHtml::_('sliders.panel',
JText::_('JGLOBAL_ARTICLES'), 'display-articles');
?>
<?php endif; ?>
<?php if ($this->params->get('presentation_style') ===
'tabs') : ?>
<?php echo JHtml::_('tabs.panel',
JText::_('JGLOBAL_ARTICLES'), 'display-articles');
?>
<?php endif; ?>
<?php if ($this->params->get('presentation_style')
=== 'plain'):?>
<?php echo '<h3>'.
JText::_('JGLOBAL_ARTICLES').'</h3>'; ?>
<?php endif; ?>
<?php echo $this->loadTemplate('articles'); ?>
<?php endif; ?>
<?php if ($this->contact->user_id &&
$this->params->get('show_profile') &&
JPluginHelper::isEnabled('user', 'profile')) : ?>
<?php if ($this->params->get('presentation_style') ===
'sliders') :
echo JHtml::_('sliders.panel',
JText::_('COM_CONTACT_PROFILE'), 'display-profile');
?>
<?php endif; ?>
<?php if ($this->params->get('presentation_style') ===
'tabs') : ?>
<?php echo JHtml::_('tabs.panel',
JText::_('COM_CONTACT_PROFILE'), 'display-profile');
?>
<?php endif; ?>
<?php if ($this->params->get('presentation_style') ===
'plain'):?>
<?php echo '<h3>'.
JText::_('COM_CONTACT_PROFILE').'</h3>'; ?>
<?php endif; ?>
<?php echo $this->loadTemplate('profile'); ?>
<?php endif; ?>
<?php if ($this->contactUser &&
$this->params->get('show_user_custom_fields')) : ?>
<?php echo $this->loadTemplate('user_custom_fields');
?>
<?php endif; ?>
<?php if ($this->contact->misc &&
$this->params->get('show_misc')) : ?>
<?php if ($this->params->get('presentation_style') ===
'sliders') :
echo JHtml::_('sliders.panel',
JText::_('COM_CONTACT_OTHER_INFORMATION'),
'display-misc'); ?>
<?php endif; ?>
<?php if ($this->params->get('presentation_style') ===
'tabs') : ?>
<?php echo JHtml::_('tabs.panel',
JText::_('COM_CONTACT_OTHER_INFORMATION'),
'display-misc'); ?>
<?php endif; ?>
<?php if ($this->params->get('presentation_style') ===
'plain'):?>
<?php echo '<h3>'.
JText::_('COM_CONTACT_OTHER_INFORMATION').'</h3>';
?>
<?php endif; ?>
<div class="contact-miscinfo">
<dl class="dl-horizontal">
<dt>
<span class="<?php echo
$this->params->get('marker_class'); ?>">
<?php echo $this->params->get('marker_misc');
?>
</span>
</dt>
<dd>
<span class="contact-misc">
<?php echo $this->contact->misc; ?>
</span>
</dd>
</dl>
</div>
<?php endif; ?>
<?php if ($this->params->get('presentation_style') ===
'sliders') : ?>
<?php echo JHtml::_('sliders.end'); ?>
<?php elseif ($this->params->get('presentation_style')
=== 'tabs') : ?>
<?php echo JHtml::_('tabs.end'); ?>
<?php endif; ?>
<?php echo $this->item->event->afterDisplayContent; ?>
</div>
com_contact/contact/default_address.php000064400000007042151163626040014341
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage com_contact
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
/* marker_class: Class based on the selection of text, none, or icons
* jicon-text, jicon-none, jicon-icon
*/
?>
<dl class="contact-address dl-horizontal">
<?php if (($this->contact->address || $this->contact->suburb
|| $this->contact->state || $this->contact->country ||
$this->contact->postcode) && ($addressCheck =
$this->params->get('address_check') > 0)) : ?>
<?php if ($addressCheck === true) : ?>
<dt>
<span class="<?php echo
$this->params->get('marker_class'); ?>" >
<?php echo $this->params->get('marker_address');
?>
</span>
</dt>
<dd>
<address>
<?php endif; ?>
<?php if ($this->contact->address &&
$this->params->get('show_street_address')) : ?>
<span class="contact-street">
<?php echo nl2br($this->contact->address); ?>
</span>
<?php endif; ?>
<?php if ($this->contact->suburb &&
$this->params->get('show_suburb')) : ?>
<span class="contact-suburb">
<?php echo $this->contact->suburb; ?>
</span>
<?php endif; ?>
<?php if ($this->contact->state &&
$this->params->get('show_state')) : ?>
<span class="contact-state">
<?php echo $this->contact->state; ?>
</span>
<?php endif; ?>
<?php if ($this->contact->postcode &&
$this->params->get('show_postcode')) : ?>
<span class="contact-postcode">
<?php echo $this->contact->postcode; ?>
</span>
<?php endif; ?>
<?php if ($this->contact->country &&
$this->params->get('show_country')) : ?>
<span class="contact-country">
<?php echo $this->contact->country; ?>
</span>
<?php endif; ?>
<?php endif; ?>
<?php if ($this->params->get('address_check') > 0) :
?>
</address>
</dd>
<?php endif; ?>
<?php if ($this->contact->email_to &&
$this->params->get('show_email')) : ?>
<dt>
<span class="<?php echo
$this->params->get('marker_class'); ?>" >
<?php echo $this->params->get('marker_email'); ?>
</span>
</dt>
<dd>
<span class="contact-emailto">
<?php echo $this->contact->email_to; ?>
</span>
</dd>
<?php endif; ?>
<?php if ($this->contact->telephone &&
$this->params->get('show_telephone')) : ?>
<dt>
<span class="<?php echo
$this->params->get('marker_class'); ?>" >
<?php echo $this->params->get('marker_telephone');
?>
</span>
</dt>
<dd>
<span class="contact-telephone">
<?php echo nl2br($this->contact->telephone); ?>
</span>
</dd>
<?php endif; ?>
<?php if ($this->contact->fax &&
$this->params->get('show_fax')) : ?>
<dt>
<span class="<?php echo
$this->params->get('marker_class'); ?>" >
<?php echo $this->params->get('marker_fax'); ?>
</span>
</dt>
<dd>
<span class="contact-fax">
<?php echo nl2br($this->contact->fax); ?>
</span>
</dd>
<?php endif; ?>
<?php if ($this->contact->mobile &&
$this->params->get('show_mobile')) :?>
<dt>
<span class="<?php echo
$this->params->get('marker_class'); ?>" >
<?php echo $this->params->get('marker_mobile'); ?>
</span>
</dt>
<dd>
<span class="contact-mobile">
<?php echo nl2br($this->contact->mobile); ?>
</span>
</dd>
<?php endif; ?>
<?php if ($this->contact->webpage &&
$this->params->get('show_webpage')) : ?>
<dt>
<span class="<?php echo
$this->params->get('marker_class'); ?>" >
</span>
</dt>
<dd>
<span class="contact-webpage">
<a href="<?php echo $this->contact->webpage;
?>" target="_blank" rel="noopener
noreferrer">
<?php echo $this->contact->webpage; ?></a>
</span>
</dd>
<?php endif; ?>
</dl>
com_contact/contact/default_articles.php000064400000001416151163626040014521
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage com_contact
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
JLoader::register('ContentHelperRoute', JPATH_SITE .
'/components/com_content/helpers/route.php');
?>
<?php if ($this->params->get('show_articles')) : ?>
<div class="contact-articles">
<ol>
<?php foreach ($this->item->articles as $article) : ?>
<li>
<?php echo JHtml::_('link',
JRoute::_(ContentHelperRoute::getArticleRoute($article->slug,
$article->catid, $article->language)),
htmlspecialchars($article->title, ENT_COMPAT, 'UTF-8')); ?>
</li>
<?php endforeach; ?>
</ol>
</div>
<?php endif; ?>
com_contact/contact/default_form.php000064400000006400151163626040013654
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage com_contact
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::_('behavior.keepalive');
JHtml::_('behavior.formvalidation');
if (isset($this->error)) : ?>
<div class="contact-error">
<?php echo $this->error; ?>
</div>
<?php endif; ?>
<div class="contact-form">
<form id="contact-form" action="<?php echo
JRoute::_('index.php'); ?>" method="post"
class="form-validate form-horizontal">
<fieldset>
<legend><?php echo
JText::_('COM_CONTACT_FORM_LABEL'); ?></legend>
<div class="control-group">
<div class="control-label"><?php echo
$this->form->getLabel('contact_name'); ?></div>
<div class="controls"><?php echo
$this->form->getInput('contact_name'); ?></div>
</div>
<div class="control-group">
<div class="control-label"><?php echo
$this->form->getLabel('contact_email'); ?></div>
<div class="controls"><?php echo
$this->form->getInput('contact_email'); ?></div>
</div>
<div class="control-group">
<div class="control-label"><?php echo
$this->form->getLabel('contact_subject'); ?></div>
<div class="controls"><?php echo
$this->form->getInput('contact_subject'); ?></div>
</div>
<div class="control-group">
<div class="control-label"><?php echo
$this->form->getLabel('contact_message'); ?></div>
<div class="controls"><?php echo
$this->form->getInput('contact_message'); ?></div>
</div>
<?php if ($this->params->get('show_email_copy', 0)){
?>
<div class="control-group">
<div class="control-label"><?php echo
$this->form->getLabel('contact_email_copy');
?></div>
<div class="controls"><?php echo
$this->form->getInput('contact_email_copy');
?></div>
</div>
<?php } ?>
<?php //Dynamically load any additional fields from plugins. ?>
<?php foreach ($this->form->getFieldsets() as $fieldset) :
?>
<?php if ($fieldset->name !== 'contact'):?>
<?php $fields =
$this->form->getFieldset($fieldset->name);?>
<?php foreach ($fields as $field) : ?>
<div class="control-group">
<?php if ($field->hidden) : ?>
<div class="controls">
<?php echo $field->input;?>
</div>
<?php else:?>
<div class="control-label">
<?php echo $field->label; ?>
<?php if (!$field->required && $field->type !==
'Spacer') : ?>
<span class="optional"><?php echo
JText::_('COM_CONTACT_OPTIONAL');?></span>
<?php endif; ?>
</div>
<div class="controls"><?php echo
$field->input;?></div>
<?php endif;?>
</div>
<?php endforeach;?>
<?php endif ?>
<?php endforeach;?>
<div class="form-actions"><button class="btn
btn-primary validate" type="submit"><?php echo
JText::_('COM_CONTACT_CONTACT_SEND'); ?></button>
<input type="hidden" name="option"
value="com_contact" />
<input type="hidden" name="task"
value="contact.submit" />
<input type="hidden" name="return"
value="<?php echo $this->return_page;?>" />
<input type="hidden" name="id"
value="<?php echo $this->contact->slug; ?>" />
<?php echo JHtml::_('form.token'); ?>
</div>
</fieldset>
</form>
</div>
com_contact/contact/default_links.php000064400000002504151163626050014033
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage com_contact
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
if ($this->params->get('presentation_style') ===
'sliders') : ?>
<?php echo JHtml::_('sliders.panel',
JText::_('COM_CONTACT_LINKS'), 'display-links'); ?>
<?php endif; ?>
<?php if ($this->params->get('presentation_style') ===
'tabs') : ?>
<?php echo JHtml::_('tabs.panel',
JText::_('COM_CONTACT_LINKS'), 'display-links'); ?>
<?php endif; ?>
<?php if ($this->params->get('presentation_style') ===
'plain'):?>
<?php echo '<h3>'.
JText::_('COM_CONTACT_LINKS').'</h3>'; ?>
<?php endif; ?>
<div class="contact-links">
<ul class="nav nav-list">
<?php foreach (range('a', 'e') as $char) ://
letters 'a' to 'e'
$link = $this->contact->params->get('link'.$char);
$label =
$this->contact->params->get('link'.$char.'_name');
if (!$link) :
continue;
endif;
// Add 'http://' if not present
$link = (0 === strpos($link, 'http')) ? $link :
'http://'.$link;
// If no label is present, take the link
$label = $label ?: $link;
?>
<li>
<a href="<?php echo $link; ?>">
<?php echo $label; ?>
</a>
</li>
<?php endforeach; ?>
</ul>
</div>
com_contact/contact/default_profile.php000064400000002144151163626050014353
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage com_contact
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
?>
<?php if (JPluginHelper::isEnabled('user',
'profile')) :
$fields = $this->item->profile->getFieldset('profile');
?>
<div class="contact-profile"
id="users-profile-custom">
<dl class="dl-horizontal">
<?php foreach ($fields as $profile) :
if ($profile->value) :
echo '<dt>'.$profile->label.'</dt>';
$profile->text = htmlspecialchars($profile->value, ENT_COMPAT,
'UTF-8');
switch ($profile->id) :
case 'profile_website' :
$v_http = substr($profile->profile_value, 0, 4);
if ($v_http === 'http') :
echo '<dd><a
href="'.$profile->text.'">'.$profile->text.'</a></dd>';
else :
echo '<dd><a
href="http://'.$profile->text.'">'.$profile->text.'</a></dd>';
endif;
break;
default:
echo '<dd>'.$profile->text.'</dd>';
break;
endswitch;
endif;
endforeach; ?>
</dl>
</div>
<?php endif; ?>
com_contact/contact/default_user_custom_fields.php000064400000003740151163626050016614
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage com_contact
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
$params = $this->params;
$displayGroups = $params->get('show_user_custom_fields');
$userFieldGroups = array();
?>
<?php if (!$displayGroups || !$this->contactUser) : ?>
<?php return; ?>
<?php endif; ?>
<?php foreach ($this->contactUser->jcfields as $field) :?>
<?php if (!in_array('-1', $displayGroups) &&
(!$field->group_id || !in_array($field->group_id, $displayGroups))) :
?>
<?php continue; ?>
<?php endif; ?>
<?php if (!array_key_exists($field->group_title, $userFieldGroups))
: ?>
<?php $userFieldGroups[$field->group_title] = array();?>
<?php endif; ?>
<?php $userFieldGroups[$field->group_title][] = $field;?>
<?php endforeach; ?>
<?php foreach ($userFieldGroups as $groupTitle => $fields) :?>
<?php $id = JApplicationHelper::stringURLSafe($groupTitle); ?>
<?php if ($this->params->get('presentation_style') ===
'sliders') :
echo JHtml::_('sliders.panel', $groupTitle ?:
JText::_('COM_CONTACT_USER_FIELDS'), 'display-' . $id);
?>
<?php endif; ?>
<?php if ($this->params->get('presentation_style') ===
'tabs') : ?>
<?php echo JHtml::_('tabs.panel', $groupTitle ?:
JText::_('COM_CONTACT_USER_FIELDS'), 'display-' . $id);
?>
<?php endif; ?>
<?php if ($this->params->get('presentation_style') ===
'plain'):?>
<?php echo '<h3>' . ($groupTitle ?:
JText::_('COM_CONTACT_USER_FIELDS')) . '</h3>';
?>
<?php endif; ?>
<div class="contact-profile"
id="user-custom-fields-<?php echo $id; ?>">
<dl class="dl-horizontal">
<?php foreach ($fields as $field) :?>
<?php if (!$field->value) : ?>
<?php continue; ?>
<?php endif; ?>
<?php echo '<dt>' . $field->label .
'</dt>'; ?>
<?php echo '<dd>' . $field->value .
'</dd>'; ?>
<?php endforeach; ?>
</dl>
</div>
<?php endforeach; ?>
com_contact/contact/encyclopedia.php000064400000005616151163626050013655
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Templates.beez3
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
$cparams = JComponentHelper::getParams('com_media');
?>
<div class="contact<?php echo
$this->pageclass_sfx?>">
<?php $contactLink =
ContactHelperRoute::getCategoryRoute($this->contact->catid);?>
<h3>
<span class="contact-category"><a href="<?php
echo $contactLink; ?>">
<?php echo $this->escape($this->contact->category_title);
?></a>
</span>
</h3>
<?php if ($this->contact->name &&
$this->params->get('show_name')) : ?>
<h2>
<span class="contact-name"><?php echo
$this->contact->name; ?></span>
</h2>
<?php endif; ?>
<?php echo $this->item->event->afterDisplayTitle; ?>
<?php echo $this->item->event->beforeDisplayContent; ?>
<div class="encyclopedia_col1">
<?php if ($this->contact->image ) : ?>
<div class="contact-image">
<?php // We are going to use the contact address field for the main
image caption.
// If we have a caption load the caption behavior. ?>
<?php if ($this->contact->address)
{
JHtml::_('behavior.caption');
}?>
<?php echo JHtml::_('image', $this->contact->image,
$this->contact->name, array('align' =>
'middle', 'class' => 'caption',
'title' => $this->contact->address)); ?>
</div>
<?php endif; ?>
</div>
<div class="encyclopedia_col2">
<?php // We are going to use some of the standard content fields in
non standard ways. ?>
<div class="contact-miscinfo">
<div class="contact-misc">
<?php echo $this->contact->misc; ?>
</div>
</div>
<?php //Let's use position for the scientific name. ?>
<?php if ($this->contact->con_position &&
$this->params->get('show_position')) : ?>
<p class="contact-position"><?php echo
$this->contact->con_position; ?></p>
<?php endif; ?>
<?php //Let's use state to put the family name. ?>
<?php if ($this->contact->state &&
$this->params->get('show_state')) : ?>
<p class="contact-state"><?php echo
$this->contact->state; ?></p>
<?php endif; ?>
<?php // Let's use country to list the main countries it grows
in. ?>
<?php if ($this->contact->country &&
$this->params->get('show_country')) : ?>
<p class="contact-country"><?php echo
$this->contact->country; ?></p>
<?php endif; ?>
</div>
<div class="clr"> </div>
<?php if ($this->params->get('presentation_style') !==
'plain'):?>
<?php echo
JHtml::_($this->params->get('presentation_style').'.start',
'contact-slider'); ?>
<?php endif ?>
<div class="encyclopedia_links">
<?php echo $this->loadTemplate('links'); ?>
</div>
<?php if ($this->params->get('presentation_style') !==
'plain'):?>
<?php echo
JHtml::_($this->params->get('presentation_style').'.end');
?>
<?php endif; ?>
</div>
<?php echo $this->item->event->afterDisplayContent; ?>
com_content/archive/default.php000064400000003664151163626050012650
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Template.beez5
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
$app = JFactory::getApplication();
$templateparams = $app->getTemplate(true)->params;
if (!$templateparams->get('html5', 0))
{
require
JPATH_BASE.'/components/com_content/views/archive/tmpl/default.php';
// possibly replace with JPATH_COMPONENT.'/views/...'
} else {
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers');
JHtml::_('behavior.caption');
?><div class="archive<?php echo
$this->pageclass_sfx;?>">
<?php if ($this->params->get('show_page_heading')) :
?>
<h1>
<?php echo
$this->escape($this->params->get('page_heading')); ?>
</h1>
<?php endif; ?>
<form id="adminForm" action="<?php echo
JRoute::_('index.php')?>" method="post">
<fieldset class="filters">
<legend class="hidelabeltxt"><?php echo
JText::_('JGLOBAL_FILTER_LABEL'); ?></legend>
<div class="filter-search">
<?php if ($this->params->get('filter_field') !==
'hide') : ?>
<label class="filter-search-lbl"
for="filter-search"><?php echo
JText::_('COM_CONTENT_'.$this->params->get('filter_field').'_FILTER_LABEL').' ';
?></label>
<input type="text" name="filter-search"
id="filter-search" value="<?php echo
$this->escape($this->filter); ?>" class="inputbox"
onchange="document.getElementById('adminForm').submit();"
/>
<?php endif; ?>
<?php echo $this->form->monthField; ?>
<?php echo $this->form->yearField; ?>
<?php echo $this->form->limitField; ?>
<button type="submit" class="button"><?php
echo JText::_('JGLOBAL_FILTER_BUTTON'); ?></button>
</div>
<input type="hidden" name="view"
value="archive" />
<input type="hidden" name="option"
value="com_content" />
<input type="hidden" name="limitstart"
value="0" />
</fieldset>
<?php echo $this->loadTemplate('items'); ?>
</form>
</div>
<?php } ?>
com_content/archive/default_items.php000064400000010507151163626050014043
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Template.beez5
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
$app = JFactory::getApplication();
$templateparams = $app->getTemplate(true)->params;
if (!$templateparams->get('html5', 0))
{
require
JPATH_BASE.'/components/com_content/views/archive/tmpl/default_items.php';
// possibly replace with JPATH_COMPONENT.'/views/...'
} else {
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers');
$params = &$this->params;
?>
<ul id="archive-items">
<?php foreach ($this->items as $i => $item) : ?>
<li class="row<?php echo $i % 2; ?>">
<h2>
<?php if ($params->get('link_titles')) : ?>
<a href="<?php echo
JRoute::_(ContentHelperRoute::getArticleRoute($item->slug,
$item->catid, $item->language)); ?>">
<?php echo $this->escape($item->title); ?></a>
<?php else: ?>
<?php echo $this->escape($item->title); ?>
<?php endif; ?>
</h2>
<?php if ($params->get('show_author') or
$params->get('show_parent_category') or
$params->get('show_category') or
$params->get('show_create_date') or
$params->get('show_modify_date') or
$params->get('show_publish_date') or
$params->get('show_hits')) : ?>
<dl class="article-info">
<dt class="article-info-term"><?php echo
JText::_('COM_CONTENT_ARTICLE_INFO'); ?></dt>
<?php endif; ?>
<?php if ($params->get('show_parent_category')) : ?>
<dd class="parent-category-name">
<?php $title = $this->escape($item->parent_title);
$url = '<a
href="'.JRoute::_(ContentHelperRoute::getCategoryRoute($item->parent_slug)).'">'.$title.'</a>';?>
<?php if ($item->parent_slug &&
$params->get('link_parent_category')) : ?>
<?php echo JText::sprintf('COM_CONTENT_PARENT', $url);
?>
<?php else : ?>
<?php echo JText::sprintf('COM_CONTENT_PARENT', $title);
?>
<?php endif; ?>
</dd>
<?php endif; ?>
<?php if ($params->get('show_category')) : ?>
<dd class="category-name">
<?php $title = $this->escape($item->category_title);
$url = '<a href="' .
JRoute::_(ContentHelperRoute::getCategoryRoute($item->catslug)) .
'">' . $title . '</a>'; ?>
<?php if ($item->catslug &&
$params->get('link_category')) : ?>
<?php echo JText::sprintf('COM_CONTENT_CATEGORY', $url);
?>
<?php else : ?>
<?php echo JText::sprintf('COM_CONTENT_CATEGORY', $title);
?>
<?php endif; ?>
</dd>
<?php endif; ?>
<?php if ($params->get('show_create_date')) : ?>
<dd class="create">
<?php echo JText::sprintf('COM_CONTENT_CREATED_DATE_ON',
JHtml::_('date', $item->created,
JText::_('DATE_FORMAT_LC2'))); ?>
</dd>
<?php endif; ?>
<?php if ($params->get('show_modify_date')) : ?>
<dd class="modified">
<?php echo JText::sprintf('COM_CONTENT_LAST_UPDATED',
JHtml::_('date', $item->modified,
JText::_('DATE_FORMAT_LC2'))); ?>
</dd>
<?php endif; ?>
<?php if ($params->get('show_publish_date')) : ?>
<dd class="published">
<?php echo JText::sprintf('COM_CONTENT_PUBLISHED_DATE_ON',
JHtml::_('date', $item->publish_up,
JText::_('DATE_FORMAT_LC2'))); ?>
</dd>
<?php endif; ?>
<?php if (!empty($item->author) &&
$params->get('show_author')) : ?>
<dd class="createdby">
<?php $author = $item->created_by_alias ?: $item->author; ?>
<?php if (!empty($item->contact_link ) &&
$params->get('link_author') == true):?>
<?php echo JText::sprintf('COM_CONTENT_WRITTEN_BY',
JHtml::_('link', $item->contact_link, $author)); ?>
<?php else :?>
<?php echo JText::sprintf('COM_CONTENT_WRITTEN_BY',
$author); ?>
<?php endif; ?>
</dd>
<?php endif; ?>
<?php if ($params->get('show_hits')) : ?>
<dd class="hits">
<?php echo JText::sprintf('COM_CONTENT_ARTICLE_HITS',
$item->hits); ?>
</dd>
<?php endif; ?>
<?php if ($params->get('show_author') or
$params->get('show_category') or
$params->get('show_create_date') or
$params->get('show_modify_date') or
$params->get('show_publish_date') or
$params->get('show_hits')) :?>
</dl>
<?php endif; ?>
<?php if ($params->get('show_intro')) :?>
<div class="intro">
<?php echo JHtml::_('string.truncate', $item->introtext,
$params->get('introtext_limit')); ?>
</div>
<?php endif; ?>
</li>
<?php endforeach; ?>
</ul>
<div id="pagination">
<span><?php echo $this->pagination->getPagesLinks();
?></span>
<span><?php echo $this->pagination->getPagesCounter();
?></span>
</div>
<?php } ?>
com_content/article/default.php000064400000022576151163626050012655
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Templates.beez3
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
$app = JFactory::getApplication();
$templateparams = $app->getTemplate(true)->params;
$images = json_decode($this->item->images);
$urls = json_decode($this->item->urls);
$user = JFactory::getUser();
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers');
JHtml::_('behavior.caption');
// Create shortcut to parameters.
$params = $this->item->params;
$accessEdit = $params->get('access-edit');
$showPrintIcon = $params->get('show_print_icon');
$showEmailIcon = $params->get('show_email_icon');
?>
<article class="item-page<?php echo
$this->pageclass_sfx?>">
<?php if ($showPageHeading =
$this->params->get('show_page_heading')) : ?>
<?php if ($showPageHeading and $params->get('show_title'))
:?>
<hgroup>
<?php endif; ?>
<h1>
<?php echo
$this->escape($this->params->get('page_heading')); ?>
</h1>
<?php endif; ?>
<?php
if (!empty($this->item->pagination) &&
$this->item->pagination &&
!$this->item->paginationposition &&
$this->item->paginationrelative)
{
echo $this->item->pagination;
}
if ($params->get('show_title')) : ?>
<h2>
<?php echo $this->escape($this->item->title); ?>
</h2>
<?php endif; ?>
<?php if ($showPageHeading and $params->get('show_title'))
:?>
</hgroup>
<?php endif; ?>
<?php // Content is generated by content plugin event
"onContentAfterTitle" ?>
<div class="pull-left"><?php echo
$this->item->event->afterDisplayTitle; ?></div>
<?php
if ($accessEdit || $showPrintIcon || $showEmailIcon) : ?>
<ul class="actions">
<?php if (!$this->print) : ?>
<?php if ($showPrintIcon) : ?>
<li class="print-icon">
<?php echo JHtml::_('icon.print_popup', $this->item,
$params, array(), true); ?>
</li>
<?php endif; ?>
<?php if ($showEmailIcon) : ?>
<li class="email-icon">
<?php echo JHtml::_('icon.email', $this->item,
$params, array(), true); ?>
</li>
<?php endif; ?>
<?php if ($this->user->authorise('core.edit',
'com_content.article.' . $this->item->id)) : ?>
<li class="edit-icon">
<?php echo JHtml::_('icon.edit', $this->item,
$params, array(), true); ?>
</li>
<?php endif; ?>
<?php else : ?>
<li>
<?php echo JHtml::_('icon.print_screen', $this->item,
$params, array(), true); ?>
</li>
<?php endif; ?>
</ul>
<?php endif; ?>
<?php echo $this->item->event->beforeDisplayContent; ?>
<?php $useDefList = ($params->get('show_author') or
$params->get('show_category') or
$params->get('show_parent_category')
or $params->get('show_create_date') or
$params->get('show_modify_date') or
$params->get('show_publish_date')
or $params->get('show_hits')); ?>
<?php if ($useDefList) : ?>
<dl class="article-info">
<dt class="article-info-term"><?php echo
JText::_('COM_CONTENT_ARTICLE_INFO'); ?></dt>
<?php endif; ?>
<?php if ($this->item->parent_slug !== '1:root'
&& $params->get('show_parent_category')) : ?>
<dd class="parent-category-name">
<?php $title = $this->escape($this->item->parent_title);
$url = '<a href="' .
JRoute::_(ContentHelperRoute::getCategoryRoute($this->item->parent_slug))
. '">' . $title . '</a>';?>
<?php if ($params->get('link_parent_category') and
$this->item->parent_slug) : ?>
<?php echo JText::sprintf('COM_CONTENT_PARENT', $url);
?>
<?php else : ?>
<?php echo JText::sprintf('COM_CONTENT_PARENT', $title);
?>
<?php endif; ?>
</dd>
<?php endif; ?>
<?php if ($params->get('show_category')) : ?>
<dd class="category-name">
<?php $title = $this->escape($this->item->category_title);
$url = '<a href="' .
JRoute::_(ContentHelperRoute::getCategoryRoute($this->item->catslug))
. '">' . $title . '</a>';?>
<?php if ($params->get('link_category') and
$this->item->catslug) : ?>
<?php echo JText::sprintf('COM_CONTENT_CATEGORY', $url);
?>
<?php else : ?>
<?php echo JText::sprintf('COM_CONTENT_CATEGORY', $title);
?>
<?php endif; ?>
</dd>
<?php endif; ?>
<?php if ($params->get('show_create_date')) : ?>
<dd class="create">
<?php echo JText::sprintf('COM_CONTENT_CREATED_DATE_ON',
JHtml::_('date', $this->item->created,
JText::_('DATE_FORMAT_LC2'))); ?>
</dd>
<?php endif; ?>
<?php if ($params->get('show_modify_date')) : ?>
<dd class="modified">
<?php echo JText::sprintf('COM_CONTENT_LAST_UPDATED',
JHtml::_('date', $this->item->modified,
JText::_('DATE_FORMAT_LC2'))); ?>
</dd>
<?php endif; ?>
<?php if ($params->get('show_publish_date')) : ?>
<dd class="published">
<?php echo JText::sprintf('COM_CONTENT_PUBLISHED_DATE_ON',
JHtml::_('date', $this->item->publish_up,
JText::_('DATE_FORMAT_LC2'))); ?>
</dd>
<?php endif; ?>
<?php if (!empty($this->item->author) &&
$params->get('show_author')) : ?>
<dd class="createdby">
<?php $author = $this->item->created_by_alias ?:
$this->item->author; ?>
<?php if (!empty($this->item->contact_link) &&
$params->get('link_author') == true) : ?>
<?php echo JText::sprintf('COM_CONTENT_WRITTEN_BY',
JHtml::_('link', $this->item->contact_link, $author));
?>
<?php else : ?>
<?php echo JText::sprintf('COM_CONTENT_WRITTEN_BY',
$author); ?>
<?php endif; ?>
</dd>
<?php endif; ?>
<?php if ($params->get('show_hits')) : ?>
<dd class="hits">
<?php echo JText::sprintf('COM_CONTENT_ARTICLE_HITS',
$this->item->hits); ?>
</dd>
<?php endif; ?>
<?php if ($useDefList) : ?>
</dl>
<?php endif; ?>
<?php if (isset ($this->item->toc)) : ?>
<?php echo $this->item->toc; ?>
<?php endif; ?>
<?php if (isset($urls) AND ((!empty($urls->urls_position) AND
($urls->urls_position == '0')) OR
($params->get('urls_position') == '0' AND
empty($urls->urls_position)))
OR (empty($urls->urls_position) AND
(!$params->get('urls_position')))) : ?>
<?php echo $this->loadTemplate('links'); ?>
<?php endif; ?>
<?php if (isset($images->image_fulltext) and
!empty($images->image_fulltext)) : ?>
<?php $imgfloat = empty($images->float_fulltext) ?
$params->get('float_fulltext') : $images->float_fulltext;
?>
<div class="img-fulltext-<?php echo htmlspecialchars($imgfloat,
ENT_COMPAT, 'UTF-8'); ?>">
<img
<?php if ($images->image_fulltext_caption):
echo 'class="caption"'.' title="'
.htmlspecialchars($images->image_fulltext_caption, ENT_COMPAT,
'UTF-8') .'"';
endif; ?>
src="<?php echo htmlspecialchars($images->image_fulltext,
ENT_COMPAT, 'UTF-8'); ?>" alt="<?php echo
htmlspecialchars($images->image_fulltext_alt, ENT_COMPAT,
'UTF-8'); ?>"/>
</div>
<?php endif; ?>
<?php
if (!empty($this->item->pagination) AND $this->item->pagination
AND !$this->item->paginationposition AND
!$this->item->paginationrelative):
echo $this->item->pagination;
endif;
?>
<?php if ($params->get('access-view')):?>
<?php echo $this->item->text; ?>
<?php // Optional teaser intro text for guests ?>
<?php elseif ($params->get('show_noauth') == true
&& $user->get('guest')) : ?>
<?php echo
JLayoutHelper::render('joomla.content.intro_image',
$this->item); ?>
<?php echo JHtml::_('content.prepare',
$this->item->introtext); ?>
<?php // Optional link to let them register to see the whole article.
?>
<?php if ($this->item->fulltext != null &&
$params->get('show_readmore')) : ?>
<?php $menu = JFactory::getApplication()->getMenu(); ?>
<?php $active = $menu->getActive(); ?>
<?php $itemId = $active->id; ?>
<?php $link = new
JUri(JRoute::_('index.php?option=com_users&view=login&Itemid='
. $itemId, false)); ?>
<?php $link->setVar('return',
base64_encode(ContentHelperRoute::getArticleRoute($this->item->slug,
$this->item->catid, $this->item->language))); ?>
<p class="readmore">
<a href="<?php echo $link; ?>"
class="register">
<?php $attribs = json_decode($this->item->attribs); ?>
<?php if ($attribs->alternative_readmore == null) : ?>
<?php echo JText::_('COM_CONTENT_REGISTER_TO_READ_MORE');
?>
<?php elseif ($readmore = $attribs->alternative_readmore) : ?>
<?php echo $readmore; ?>
<?php if ($params->get('show_readmore_title', 0) != 0)
: ?>
<?php echo JHtml::_('string.truncate',
$this->item->title, $params->get('readmore_limit'));
?>
<?php endif; ?>
<?php elseif ($params->get('show_readmore_title', 0) ==
0) : ?>
<?php echo JText::sprintf('COM_CONTENT_READ_MORE_TITLE');
?>
<?php else : ?>
<?php echo JText::_('COM_CONTENT_READ_MORE'); ?>
<?php echo JHtml::_('string.truncate',
$this->item->title, $params->get('readmore_limit'));
?>
<?php endif; ?>
</a>
</p>
<?php endif; ?>
<?php endif; ?>
<?php // TAGS ?>
<?php if (!empty($this->item->tags->itemTags) &&
$params->get('show_tags', 1)) : ?>
<?php $this->item->tagLayout = new
JLayoutFile('joomla.content.tags'); ?>
<?php echo
$this->item->tagLayout->render($this->item->tags->itemTags);
?>
<?php endif; ?>
<?php if (!empty($this->item->pagination) AND
$this->item->pagination AND $this->item->paginationposition
AND!$this->item->paginationrelative) : ?>
<?php echo $this->item->pagination; ?>
<?php endif; ?>
<?php if (isset($urls) AND ((!empty($urls->urls_position) AND
($urls->urls_position == '1')) OR (
$params->get('urls_position') == '1'))) : ?>
<?php echo $this->loadTemplate('links'); ?>
<?php endif; ?>
<?php if (!empty($this->item->pagination) AND
$this->item->pagination AND $this->item->paginationposition AND
$this->item->paginationrelative) : ?>
<?php echo $this->item->pagination; ?>
<?php endif; ?>
<?php echo $this->item->event->afterDisplayContent; ?>
</article>
com_content/article/default_links.php000064400000005005151163626050014041
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Templates.beez3
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
// Create shortcut
$urls = json_decode($this->item->urls);
// Create shortcuts to some parameters.
$params = $this->item->params;
if ($urls && (!empty($urls->urla) || !empty($urls->urlb) ||
!empty($urls->urlc))) :
?>
<div class="content-links">
<ul class="nav nav-tabs nav-stacked">
<?php
$urlarray = array(
array($urls->urla, $urls->urlatext, $urls->targeta,
'a'),
array($urls->urlb, $urls->urlbtext, $urls->targetb,
'b'),
array($urls->urlc, $urls->urlctext, $urls->targetc,
'c')
);
foreach ($urlarray as $url) :
$link = $url[0];
$label = $url[1];
$target = $url[2];
$id = $url[3];
if (!$link) :
continue;
endif;
// If no label is present, take the link
$label = $label ?: $link;
// If no target is present, use the default
$target = $target ?: $params->get('target'.$id);
?>
<li class="content-links-<?php echo $id; ?>">
<?php
// Compute the correct link
switch ($target)
{
case 1:
// open in a new window
echo '<a href="' . htmlspecialchars($link,
ENT_COMPAT, 'UTF-8') . '" target="_blank"
rel="nofollow noopener noreferrer">' .
htmlspecialchars($label, ENT_COMPAT, 'UTF-8')
.'</a>';
break;
case 2:
// open in a popup window
$attribs =
'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=600,height=600';
echo "<a href=\"" . htmlspecialchars($link,
ENT_COMPAT, 'UTF-8') . "\"
onclick=\"window.open(this.href, 'targetWindow',
'".$attribs."'); return false;\"
rel=\"noopener noreferrer\">".
htmlspecialchars($label, ENT_COMPAT,
'UTF-8').'</a>';
break;
case 3:
// open in a modal window
JHtml::_('behavior.modal', 'a.modal');
echo '<a class="modal" href="' .
htmlspecialchars($link, ENT_COMPAT, 'UTF-8') . '"
rel="{handler: \'iframe\', size: {x:600, y:600}} noopener
noreferrer">'.
htmlspecialchars($label, ENT_COMPAT, 'UTF-8') . '
</a>';
break;
default:
// open in parent window
echo '<a href="' . htmlspecialchars($link,
ENT_COMPAT, 'UTF-8') . '"
rel="nofollow">'.
htmlspecialchars($label, ENT_COMPAT, 'UTF-8') . '
</a>';
break;
}
?>
</li>
<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>
com_content/categories/default.php000064400000002435151163626050013347
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Template.beez5
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
$app = JFactory::getApplication();
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers');
JHtml::_('behavior.caption');
?>
<div class="categories-list<?php echo
$this->pageclass_sfx;?>">
<?php if ($this->params->get('show_page_heading')) :
?>
<h1>
<?php echo
$this->escape($this->params->get('page_heading')); ?>
</h1>
<?php endif; ?>
<?php if ($this->params->get('show_base_description')) :
?>
<?php //If there is a description in the menu parameters use that;
?>
<?php if
($this->params->get('categories_description')) : ?>
<?php echo JHtml::_('content.prepare',
$this->params->get('categories_description'), '',
'com_content.categories'); ?>
<?php else: ?>
<?php //Otherwise get one from the database if it exists. ?>
<?php if ($this->parent->description) : ?>
<div class="category-desc">
<?php echo JHtml::_('content.prepare',
$this->parent->description, '',
'com_content.categories'); ?>
</div>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>
<?php
echo $this->loadTemplate('items');
?>
</div>
com_content/categories/default_items.php000064400000003246151163626050014551
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage com_content
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
// no direct access
defined('_JEXEC') or die;
$class = ' class="first"';
if ($this->maxLevelcat != 0 &&
count($this->items[$this->parent->id]) > 0) :
?>
<ul>
<?php foreach ($this->items[$this->parent->id] as $id =>
$item) : ?>
<?php
if ($item->numitems ||
$this->params->get('show_empty_categories_cat') ||
count($item->getChildren())) :
if (!isset($this->items[$this->parent->id][$id + 1]))
{
$class = ' class="last"';
}
?>
<li<?php echo $class; ?>>
<?php $class = ''; ?>
<h3 class="item-title"><a href="<?php echo
JRoute::_(ContentHelperRoute::getCategoryRoute($item->id));?>">
<?php echo $this->escape($item->title); ?></a>
</h3>
<?php if ($this->params->get('show_subcat_desc_cat')
== 1) :?>
<?php if ($item->description) : ?>
<div class="category-desc">
<?php echo JHtml::_('content.prepare',
$item->description); ?>
</div>
<?php endif; ?>
<?php endif; ?>
<?php if
($this->params->get('show_cat_num_articles_cat') == 1)
:?>
<dl class="article-count"><dt>
<?php echo JText::_('COM_CONTENT_NUM_ITEMS');
?></dt>
<dd><?php echo $item->numitems; ?></dd>
</dl>
<?php endif; ?>
<?php if (count($item->getChildren()) > 0) :
$this->items[$item->id] = $item->getChildren();
$this->parent = $item;
$this->maxLevelcat--;
echo $this->loadTemplate('items');
$this->parent = $item->getParent();
$this->maxLevelcat++;
endif; ?>
</li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
<?php endif; ?>
com_content/category/blog.php000064400000010041151163626050012326
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Templates.beez3
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
$app = JFactory::getApplication();
$templateparams = $app->getTemplate(true)->params;
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers');
JHtml::_('behavior.caption');
$cparams = JComponentHelper::getParams('com_media');
// If the page class is defined, add to class as suffix.
// It will be a separate class if the user starts it with a space
?>
<section class="blog<?php echo
$this->pageclass_sfx;?>">
<?php if ($this->params->get('show_page_heading') != 0)
: ?>
<h1>
<?php echo
$this->escape($this->params->get('page_heading')); ?>
</h1>
<?php endif; ?>
<?php if ($this->params->get('show_category_title')) :
?>
<h2 class="subheading-category">
<?php echo JHtml::_('content.prepare',
$this->category->title, '',
'com_content.category.title'); ?>
</h2>
<?php endif; ?>
<?php if ($this->params->get('show_description', 1) ||
$this->params->def('show_description_image', 1)) : ?>
<div class="category-desc">
<?php if ($this->params->get('show_description_image')
&& $this->category->getParams()->get('image')) :
?>
<img src="<?php echo
$this->category->getParams()->get('image');
?>"/>
<?php endif; ?>
<?php if ($this->category->description &&
$this->params->get('show_description')) : ?>
<?php echo JHtml::_('content.prepare',
$this->category->description, '',
'com_content.category'); ?>
<?php endif; ?>
<div class="clr"></div>
</div>
<?php endif; ?>
<?php if (empty($this->lead_items) &&
empty($this->link_items) && empty($this->intro_items)) :
?>
<?php if ($this->params->get('show_no_articles', 1)) :
?>
<p><?php echo JText::_('COM_CONTENT_NO_ARTICLES');
?></p>
<?php endif; ?>
<?php endif; ?>
<?php $leadingcount = 0; ?>
<?php if (!empty($this->lead_items)) : ?>
<div class="items-leading">
<?php foreach ($this->lead_items as &$item) : ?>
<article class="leading-<?php echo $leadingcount;
?><?php echo $item->state == 0 ? 'system-unpublished' :
null; ?>">
<?php
$this->item = &$item;
echo $this->loadTemplate('item');
?>
</article>
<?php $leadingcount++; ?>
<?php endforeach; ?>
</div>
<?php endif; ?>
<?php if (!empty($this->intro_items)) : ?>
<?php $introcount = count($this->intro_items); ?>
<?php $counter = 0; ?>
<?php foreach ($this->intro_items as $key => &$item) : ?>
<?php $rowcount = ((int) $key % (int) $this->columns) + 1; ?>
<?php if ($rowcount === 1) : ?>
<?php $row = $counter / $this->columns; ?>
<div class="items-row cols-<?php echo (int)
$this->columns;?> <?php echo 'row-'.$row;
?>">
<?php endif; ?>
<article class="item column-<?php echo $rowcount;?><?php
echo $item->state == 0 ? ' system-unpublished' : null;
?>">
<?php
$this->item = &$item;
echo $this->loadTemplate('item');
?>
</article>
<?php $counter++; ?>
<?php if ($rowcount === (int) $this->columns or $counter ===
$introcount) : ?>
<span class="row-separator"></span>
</div>
<?php endif; ?>
<?php endforeach; ?>
<?php endif; ?>
<?php if (!empty($this->link_items)) : ?>
<?php echo $this->loadTemplate('links'); ?>
<?php endif; ?>
<?php if ($this->params->get('maxLevel') != 0 &&
is_array($this->children[$this->category->id]) &&
count($this->children[$this->category->id]) > 0) : ?>
<div class="cat-children">
<?php if
($this->params->get('show_category_heading_title_text', 1)
== 1) : ?>
<h3>
<?php echo JText::_('JGLOBAL_SUBCATEGORIES'); ?>
</h3>
<?php endif; ?>
<?php echo $this->loadTemplate('children'); ?>
</div>
<?php endif; ?>
<?php if ($this->pagination->pagesTotal > 1 &&
($this->params->def('show_pagination', 1) == 1 ||
$this->params->get('show_pagination') == 2)) : ?>
<div class="pagination">
<?php if ($this->params->def('show_pagination_results',
1)) : ?>
<p class="counter">
<?php echo $this->pagination->getPagesCounter(); ?>
</p>
<?php endif; ?>
<?php echo $this->pagination->getPagesLinks(); ?>
</div>
<?php endif; ?>
</section>
com_content/category/blog_children.php000064400000004255151163626050014210
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Templates.beez3
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
$app = JFactory::getApplication();
$templateparams = $app->getTemplate(true)->params;
$class = ' class="first"';
$user = JFactory::getUser();
$groups = $user->getAuthorisedViewLevels();
?>
<?php if (count($this->children[$this->category->id]) > 0) :
?>
<ul>
<?php foreach ($this->children[$this->category->id] as $id
=> $child) : ?>
<?php // Check whether category access level allows access to
subcategories. ?>
<?php if (in_array($child->access, $groups)) : ?>
<?php
if ($child->numitems ||
$this->params->get('show_empty_categories') ||
count($child->getChildren())) :
if (!isset($this->children[$this->category->id][$id + 1])) :
$class = ' class="last"';
endif;
?>
<li<?php echo $class; ?>>
<?php $class = ''; ?>
<span class="item-title"><a href="<?php
echo
JRoute::_(ContentHelperRoute::getCategoryRoute($child->id));?>">
<?php echo $this->escape($child->title); ?></a>
</span>
<?php if ($this->params->get('show_subcat_desc') ==
1) :?>
<?php if ($child->description) : ?>
<div class="category-desc">
<?php echo JHtml::_('content.prepare',
$child->description, '', 'com_content.category');
?>
</div>
<?php endif; ?>
<?php endif; ?>
<?php if (
$this->params->get('show_cat_num_articles', 1)) : ?>
<dl>
<dt>
<?php echo JText::_('COM_CONTENT_NUM_ITEMS'); ?>
</dt>
<dd>
<?php echo $child->getNumItems(true); ?>
</dd>
</dl>
<?php endif; ?>
<?php if (count($child->getChildren()) > 0):
$this->children[$child->id] = $child->getChildren();
$this->category = $child;
$this->maxLevel--;
if ($this->maxLevel !== 0) :
echo $this->loadTemplate('children');
endif;
$this->category = $child->getParent();
$this->maxLevel++;
endif; ?>
</li>
<?php endif; ?>
<?php endif; ?>
<?php endforeach; ?>
</ul>
<?php endif; ?>
com_content/category/blog_item.php000064400000016356151163626050013363
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Templates.beez3
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
$params = &$this->item->params;
$images = json_decode($this->item->images);
$app = JFactory::getApplication();
$canEdit = $this->item->params->get('access-edit');
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers');
$currentDate = JFactory::getDate()->format('Y-m-d H:i:s');
$isUnpublished = ($this->item->state == 0 ||
$this->item->publish_up > $currentDate)
|| ($this->item->publish_down < $currentDate &&
$this->item->publish_down !== JFactory::getDbo()->getNullDate());
?>
<?php if ($isUnpublished) : ?>
<div class="system-unpublished">
<?php endif; ?>
<?php if ($params->get('show_title')) : ?>
<h2>
<?php if ($params->get('link_titles') &&
$params->get('access-view')) : ?>
<a href="<?php echo
JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug,
$this->item->catid, $this->item->language)); ?>">
<?php echo $this->escape($this->item->title);
?></a>
<?php else : ?>
<?php echo $this->escape($this->item->title); ?>
<?php endif; ?>
</h2>
<?php endif; ?>
<?php // Content is generated by content plugin event
"onContentAfterTitle" ?>
<div class="pull-left"><?php echo
$this->item->event->afterDisplayTitle; ?></div>
<?php if ($canEdit || $params->get('show_print_icon') ||
$params->get('show_email_icon')) : ?>
<ul class="actions">
<?php if ($params->get('show_print_icon')) : ?>
<li class="print-icon">
<?php echo JHtml::_('icon.print_popup', $this->item,
$params, array(), true); ?>
</li>
<?php endif; ?>
<?php if ($params->get('show_email_icon')) : ?>
<li class="email-icon">
<?php echo JHtml::_('icon.email', $this->item, $params,
array(), true); ?>
</li>
<?php endif; ?>
<?php if ($canEdit) : ?>
<li class="edit-icon">
<?php echo JHtml::_('icon.edit', $this->item, $params,
array(), true); ?>
</li>
<?php endif; ?>
</ul>
<?php endif; ?>
<?php echo $this->item->event->beforeDisplayContent; ?>
<?php // to do not that elegant would be nice to group the params ?>
<?php if ($params->get('show_author') ||
$params->get('show_category') ||
$params->get('show_create_date') ||
$params->get('show_modify_date') ||
$params->get('show_publish_date') ||
$params->get('show_parent_category') ||
$params->get('show_hits')) : ?>
<dl class="article-info">
<dt class="article-info-term"><?php echo
JText::_('COM_CONTENT_ARTICLE_INFO'); ?></dt>
<?php endif; ?>
<?php if ($params->get('show_parent_category') &&
$this->item->parent_id != 1) : ?>
<dd class="parent-category-name">
<?php $title = $this->escape($this->item->parent_title);
$url = '<a href="' .
JRoute::_(ContentHelperRoute::getCategoryRoute($this->item->parent_id))
. '">' . $title . '</a>'; ?>
<?php if ($params->get('link_parent_category')) : ?>
<?php echo JText::sprintf('COM_CONTENT_PARENT', $url);
?>
<?php else : ?>
<?php echo JText::sprintf('COM_CONTENT_PARENT', $title);
?>
<?php endif; ?>
</dd>
<?php endif; ?>
<?php if ($params->get('show_category')) : ?>
<dd class="category-name">
<?php $title = $this->escape($this->item->category_title);
$url = '<a href="' .
JRoute::_(ContentHelperRoute::getCategoryRoute($this->item->catid)) .
'">' . $title . '</a>'; ?>
<?php if ($params->get('link_category')) : ?>
<?php echo JText::sprintf('COM_CONTENT_CATEGORY', $url);
?>
<?php else : ?>
<?php echo JText::sprintf('COM_CONTENT_CATEGORY', $title);
?>
<?php endif; ?>
</dd>
<?php endif; ?>
<?php if ($params->get('show_create_date')) : ?>
<dd class="create">
<?php echo JText::sprintf('COM_CONTENT_CREATED_DATE_ON',
JHtml::_('date', $this->item->created,
JText::_('DATE_FORMAT_LC2'))); ?>
</dd>
<?php endif; ?>
<?php if ($params->get('show_modify_date')) : ?>
<dd class="modified">
<?php echo JText::sprintf('COM_CONTENT_LAST_UPDATED',
JHtml::_('date', $this->item->modified,
JText::_('DATE_FORMAT_LC2'))); ?>
</dd>
<?php endif; ?>
<?php if ($params->get('show_publish_date')) : ?>
<dd class="published">
<?php echo JText::sprintf('COM_CONTENT_PUBLISHED_DATE_ON',
JHtml::_('date', $this->item->publish_up,
JText::_('DATE_FORMAT_LC2'))); ?>
</dd>
<?php endif; ?>
<?php if ($params->get('show_author') &&
!empty($this->item->author )) : ?>
<dd class="createdby">
<?php $author = $this->item->created_by_alias ?:
$this->item->author; ?>
<?php if (!empty($this->item->contact_link) &&
$params->get('link_author') == true) : ?>
<?php echo JText::sprintf('COM_CONTENT_WRITTEN_BY',
JHtml::_('link', $this->item->contact_link, $author));
?>
<?php else :?>
<?php echo JText::sprintf('COM_CONTENT_WRITTEN_BY',
$author); ?>
<?php endif; ?>
</dd>
<?php endif; ?>
<?php if ($params->get('show_hits')) : ?>
<dd class="hits">
<?php echo JText::sprintf('COM_CONTENT_ARTICLE_HITS',
$this->item->hits); ?>
</dd>
<?php endif; ?>
<?php if ($params->get('show_author') ||
$params->get('show_category') ||
$params->get('show_create_date') ||
$params->get('show_modify_date') ||
$params->get('show_publish_date') ||
$params->get('show_parent_category') ||
$params->get('show_hits')) :?>
</dl>
<?php endif; ?>
<?php if (isset($images->image_intro) &&
!empty($images->image_intro)) : ?>
<?php $imgfloat = empty($images->float_intro) ?
$params->get('float_intro') : $images->float_intro; ?>
<div class="img-intro-<?php echo htmlspecialchars($imgfloat);
?>">
<img
<?php if ($images->image_intro_caption):
echo 'class="caption"'.' title="' .
htmlspecialchars($images->image_intro_caption, ENT_COMPAT,
'UTF-8') . '"';
endif; ?>
src="<?php echo htmlspecialchars($images->image_intro,
ENT_COMPAT, 'UTF-8'); ?>" alt="<?php echo
htmlspecialchars($images->image_intro_alt, ENT_COMPAT,
'UTF-8'); ?>"/>
</div>
<?php endif; ?>
<?php echo $this->item->introtext; ?>
<?php if ($params->get('show_readmore') &&
$this->item->readmore) :
if ($params->get('access-view')) :
$link =
JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug,
$this->item->catid, $this->item->language));
else :
$menu = JFactory::getApplication()->getMenu();
$active = $menu->getActive();
$itemId = $active->id;
$link = new
JUri(JRoute::_('index.php?option=com_users&view=login&Itemid='
. $itemId, false));
$link->setVar('return',
base64_encode(ContentHelperRoute::getArticleRoute($this->item->slug,
$this->item->catid, $this->item->language)));
endif;
?>
<p class="readmore">
<a href="<?php echo $link; ?>">
<?php if (!$params->get('access-view')) :
echo JText::_('COM_CONTENT_REGISTER_TO_READ_MORE');
elseif ($readmore = $this->item->alternative_readmore) :
echo $readmore;
if ($params->get('show_readmore_title', 0) != 0) :
echo JHtml::_('string.truncate', $this->item->title,
$params->get('readmore_limit'));
endif;
elseif ($params->get('show_readmore_title', 0) == 0) :
echo JText::sprintf('COM_CONTENT_READ_MORE_TITLE');
else :
echo JText::_('COM_CONTENT_READ_MORE');
echo JHtml::_('string.truncate', $this->item->title,
$params->get('readmore_limit'));
endif; ?></a>
</p>
<?php endif; ?>
<?php if ($isUnpublished) : ?>
</div>
<?php endif; ?>
<div class="item-separator"></div>
<?php echo $this->item->event->afterDisplayContent; ?>
com_content/category/blog_links.php000064400000001251151163626050013531
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Templates.beez3
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers');
?>
<div class="items-more">
<h3><?php echo JText::_('COM_CONTENT_MORE_ARTICLES');
?></h3>
<ol>
<?php foreach ($this->link_items as &$item) : ?>
<li>
<a href="<?php echo
JRoute::_(ContentHelperRoute::getArticleRoute($item->slug,
$item->catid, $item->language)); ?>">
<?php echo $item->title; ?></a>
</li>
<?php endforeach; ?>
</ol>
</div>
com_content/category/default.php000064400000005533151163626050013041
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Templates.beez3
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
$app = JFactory::getApplication();
$templateparams = $app->getTemplate(true)->params;
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers');
JHtml::_('behavior.caption');
$showCategoryTitle =
$this->params->get('show_category_title') == 1;
$showCategoryHeadingTitleText =
$this->params->get('show_category_heading_title_text', 1)
== 1;
$pageSubHeading =
$this->params->get('page_subheading');
?>
<section class="category-list<?php echo
$this->pageclass_sfx;?>">
<?php
if ($showPageHeading =
$this->params->get('show_page_heading')) : ?>
<?php if ($showPageHeading and ($showCategoryTitle === true or
$pageSubHeading)) : ?>
<hgroup>
<?php endif; ?>
<h1>
<?php echo
$this->escape($this->params->get('page_heading')); ?>
</h1>
<?php endif; ?>
<?php if ($showCategoryTitle === true or $pageSubHeading) : ?>
<h2>
<?php echo $this->escape($pageSubHeading); ?>
<?php if ($showCategoryTitle === true)
{
echo '<span
class="subheading-category">'.JHtml::_('content.prepare',
$this->category->title, '',
'com_content.category.title').'</span>';
}
?>
</h2>
<?php if ($this->params->get('show_page_heading') and
($this->params->get('show_category_title', 1) or
$pageSubHeading)) : ?>
</hgroup>
<?php endif; ?>
<?php endif; ?>
<?php if ($this->params->get('show_description', 1) ||
$this->params->def('show_description_image', 1)) : ?>
<div class="category-desc">
<?php if ($this->params->get('show_description_image')
&& $this->category->getParams()->get('image')) :
?>
<img src="<?php echo
$this->category->getParams()->get('image');
?>"/>
<?php endif; ?>
<?php if ($this->category->description &&
$this->params->get('show_description')) : ?>
<?php echo JHtml::_('content.prepare',
$this->category->description, '',
'com_content.category'); ?>
<?php endif; ?>
<div class="clr"></div>
</div>
<?php endif; ?>
<?php if ($this->params->get('maxLevel') != 0 &&
is_array($this->children[$this->category->id]) &&
count($this->children[$this->category->id]) > 0) : ?>
<div class="cat-children">
<?php if ($showCategoryTitle === true or $pageSubHeading)
{
echo '<h3>';
}
elseif ($showCategoryHeadingTitleText === true)
{
echo '<h2>';
} ?>
<?php if ($showCategoryHeadingTitleText === true) : ?>
<?php echo JText::_('JGLOBAL_SUBCATEGORIES'); ?>
<?php endif; ?>
<?php if ($showCategoryTitle === true or $pageSubHeading)
{
echo '</h3>';
}
elseif ($showCategoryHeadingTitleText === true)
{
echo '</h2>';
} ?>
</div>
<?php endif; ?>
<?php echo $this->loadTemplate('children'); ?>
<div class="cat-items">
<?php echo $this->loadTemplate('articles'); ?>
</div>
</section>
com_content/category/default_articles.php000064400000021343151163626050014724
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Templates.beez3
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
$app = JFactory::getApplication();
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.framework');
$n = count($this->items);
$listOrder =
$this->escape($this->state->get('list.ordering'));
$listDirn =
$this->escape($this->state->get('list.direction'));
// Check for at least one editable article
$isEditable = false;
if (!empty($this->items))
{
foreach ($this->items as $article)
{
if ($article->params->get('access-edit'))
{
$isEditable = true;
break;
}
}
}
?>
<?php if (empty($this->items)) : ?>
<?php if ($this->params->get('show_no_articles', 1)) :
?>
<p><?php echo JText::_('COM_CONTENT_NO_ARTICLES');
?></p>
<?php endif; ?>
<?php else : ?>
<form action="<?php echo
htmlspecialchars(JUri::getInstance()->toString()); ?>"
method="post" name="adminForm"
id="adminForm">
<?php if ($this->params->get('filter_field') !==
'hide') : ?>
<fieldset class="filters">
<legend class="hidelabeltxt">
<?php echo JText::_('JGLOBAL_FILTER_LABEL'); ?>
</legend>
<div class="filter-search">
<?php if ($this->params->get('filter_field') ===
'tag') :?>
<select name="filter_tag" id="filter_tag"
onchange="document.adminForm.submit();">
<option value=""><?php echo
JText::_('JOPTION_SELECT_TAG'); ?></option>
<?php echo JHtml::_('select.options',
JHtml::_('tag.options', true, true), 'value',
'text', $this->state->get('filter.tag')); ?>
</select>
<?php elseif ($this->params->get('filter_field') ===
'month') : ?>
<select name="filter-search" id="filter-search"
onchange="document.adminForm.submit();">
<option value=""><?php echo
JText::_('JOPTION_SELECT_MONTH'); ?></option>
<?php echo JHtml::_('select.options',
JHtml::_('content.months', $this->state), 'value',
'text', $this->state->get('list.filter')); ?>
</select>
<?php else : ?>
<label class="filter-search-lbl element-invisible"
for="filter-search">
<?php echo
JText::_('COM_CONTENT_'.$this->params->get('filter_field').'_FILTER_LABEL').' ';
?>
</label>
<input type="text" name="filter-search"
id="filter-search" value="<?php echo
$this->escape($this->state->get('list.filter'));
?>" class="inputbox"
onchange="document.adminForm.submit();" title="<?php echo
JText::_('COM_CONTENT_FILTER_SEARCH_DESC'); ?>"
placeholder="<?php echo
JText::_('COM_CONTENT_'.$this->params->get('filter_field').'_FILTER_LABEL');
?>" />
<?php endif; ?>
</div>
<?php endif; ?>
<?php if ($this->params->get('show_pagination_limit'))
: ?>
<div class="display-limit">
<?php echo JText::_('JGLOBAL_DISPLAY_NUM'); ?> 
<?php echo $this->pagination->getLimitBox(); ?>
</div>
<?php endif; ?>
<?php if ($this->params->get('filter_field') !==
'hide') :?>
</fieldset>
<?php endif; ?>
<div class="clr"></div>
<table class="category">
<?php if ($this->params->get('show_headings')) : ?>
<thead>
<tr>
<th class="list-title" id="tableOrdering">
<?php echo JHtml::_('grid.sort',
'COM_CONTENT_HEADING_TITLE', 'a.title', $listDirn,
$listOrder); ?>
</th>
<?php if ($date =
$this->params->get('list_show_date')) : ?>
<th class="list-date" id="tableOrdering2">
<?php if ($date === 'created') : ?>
<?php echo JHtml::_('grid.sort',
'COM_CONTENT_'.$date.'_DATE', 'a.created',
$listDirn, $listOrder); ?>
<?php elseif ($date === 'modified') : ?>
<?php echo JHtml::_('grid.sort',
'COM_CONTENT_'.$date.'_DATE', 'a.modified',
$listDirn, $listOrder); ?>
<?php elseif ($date === 'published') : ?>
<?php echo JHtml::_('grid.sort',
'COM_CONTENT_'.$date.'_DATE', 'a.publish_up',
$listDirn, $listOrder); ?>
<?php endif; ?>
</th>
<?php endif; ?>
<?php if ($this->params->get('list_show_author', 1))
: ?>
<th class="list-author" id="tableOrdering3">
<?php echo JHtml::_('grid.sort', 'JAUTHOR',
'author', $listDirn, $listOrder); ?>
</th>
<?php endif; ?>
<?php if ($this->params->get('list_show_hits', 1)) :
?>
<th class="list-hits" id="tableOrdering4">
<?php echo JHtml::_('grid.sort',
'JGLOBAL_HITS', 'a.hits', $listDirn, $listOrder); ?>
</th>
<?php endif; ?>
<?php if ($this->params->get('list_show_votes', 0)
&& $this->vote) : ?>
<th id="categorylist_header_votes">
<?php echo JHtml::_('grid.sort',
'COM_CONTENT_VOTES', 'rating_count', $listDirn,
$listOrder); ?>
</th>
<?php endif; ?>
<?php if ($this->params->get('list_show_ratings', 0)
&& $this->vote) : ?>
<th id="categorylist_header_ratings">
<?php echo JHtml::_('grid.sort',
'COM_CONTENT_RATINGS', 'rating', $listDirn,
$listOrder); ?>
</th>
<?php endif; ?>
<?php if ($isEditable) : ?>
<th id="categorylist_header_edit"><?php echo
JText::_('COM_CONTENT_EDIT_ITEM'); ?></th>
<?php endif; ?>
</tr>
</thead>
<?php endif; ?>
<tbody>
<?php foreach ($this->items as $i => &$article) : ?>
<tr class="cat-list-row<?php echo $i % 2; ?>">
<?php if (in_array($article->access,
$this->user->getAuthorisedViewLevels())) : ?>
<td class="list-title">
<a href="<?php echo
JRoute::_(ContentHelperRoute::getArticleRoute($article->slug,
$article->catid, $article->language)); ?>">
<?php echo $this->escape($article->title); ?></a>
</td>
<?php if ($this->params->get('list_show_date')) :
?>
<td class="list-date">
<?php
echo JHtml::_(
'date', $article->displayDate, $this->escape(
$this->params->get('date_format',
JText::_('DATE_FORMAT_LC3'))
)
);
?>
</td>
<?php endif; ?>
<?php if ($this->params->get('list_show_author',
1)) : ?>
<td class="list-author">
<?php if (!empty($article->author) ||
!empty($article->created_by_alias)) : ?>
<?php $author = $article->created_by_alias ?:
$article->author; ?>
<?php if (!empty($article->contact_link) &&
$this->params->get('link_author') == true):?>
<?php echo JText::sprintf('COM_CONTENT_WRITTEN_BY',
JHtml::_('link', $article->contact_link, $author)); ?>
<?php else :?>
<?php echo JText::sprintf('COM_CONTENT_WRITTEN_BY',
$author); ?>
<?php endif; ?>
<?php endif; ?>
</td>
<?php endif; ?>
<?php if ($this->params->get('list_show_hits', 1))
: ?>
<td class="list-hits">
<?php echo $article->hits; ?>
</td>
<?php endif; ?>
<?php if ($this->params->get('list_show_votes', 0)
&& $this->vote) : ?>
<td class="list-votes">
<?php echo $article->rating_count; ?>
</td>
<?php endif; ?>
<?php if ($this->params->get('list_show_ratings',
0) && $this->vote) : ?>
<td class="list-ratings">
<?php echo $article->rating; ?>
</td>
<?php endif; ?>
<?php if ($isEditable) : ?>
<td class="list-edit">
<?php if ($article->params->get('access-edit')) :
?>
<?php echo JHtml::_('icon.edit', $article,
$article->params, array(), true); ?>
<?php endif; ?>
</td>
<?php endif; ?>
<?php else : ?>
<td>
<?php
echo $this->escape($article->title).' : ';
$menu = JFactory::getApplication()->getMenu();
$active = $menu->getActive();
$itemId = $active->id;
$link = new
JUri(JRoute::_('index.php?option=com_users&view=login&Itemid='
. $itemId, false));
$link->setVar('return',
base64_encode(ContentHelperRoute::getArticleRoute($article->slug,
$article->catid, $article->language)));
?>
<a href="<?php echo $link; ?>"
class="register">
<?php echo JText::_('COM_CONTENT_REGISTER_TO_READ_MORE');
?></a>
</td>
<?php endif; ?>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
<?php // Code to add a link to submit an article. ?>
<?php if
($this->category->getParams()->get('access-create')) :
?>
<?php echo JHtml::_('icon.create', $this->category,
$this->category->params, array(), true); ?>
<?php endif; ?>
<?php // Add pagination links ?>
<?php if (!empty($this->items)) : ?>
<?php if (($this->params->def('show_pagination', 2) ==
1 || ($this->params->get('show_pagination') == 2))
&& ($this->pagination->pagesTotal > 1)) : ?>
<div class="pagination">
<?php if
($this->params->def('show_pagination_results', 1)) : ?>
<p class="counter">
<?php echo $this->pagination->getPagesCounter(); ?>
</p>
<?php endif; ?>
<?php echo $this->pagination->getPagesLinks(); ?>
</div>
<?php endif; ?>
<div>
<input type="hidden" name="task"
value="" />
<input type="hidden" name="filter_order"
value="" />
<input type="hidden" name="filter_order_Dir"
value="" />
<input type="hidden" name="limitstart"
value="" />
</div>
</form>
<?php endif; ?>
com_content/category/default_children.php000064400000004454151163626050014712
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Templates.beez3
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
$app = JFactory::getApplication();
$templateparams = $app->getTemplate(true)->params;
$class = ' class="first"';
$user = JFactory::getUser();
$groups = $user->getAuthorisedViewLevels();
?>
<?php if (count($this->children[$this->category->id]) > 0)
:?>
<ul>
<?php foreach ($this->children[$this->category->id] as $id
=> $child) : ?>
<?php // Check whether category access level allows access to
subcategories. ?>
<?php if (in_array($child->access, $groups)) : ?>
<?php
if ($this->params->get('show_empty_categories') ||
$child->getNumItems(true) || count($child->getChildren())) :
if (!isset($this->children[$this->category->id][$id + 1])) :
$class = ' class="last"';
endif;
?>
<li<?php echo $class; ?>>
<?php $class = ''; ?>
<h3 class="item-title"><a href="<?php echo
JRoute::_(ContentHelperRoute::getCategoryRoute($child->id));?>">
<?php echo $this->escape($child->title); ?></a>
</h3>
<?php if ($this->params->get('show_subcat_desc') ==
1) :?>
<?php if ($child->description and
$this->params->get('show_description') != 0 ) : ?>
<div class="category-desc">
<?php echo JHtml::_('content.prepare',
$child->description, '', 'com_content.category');
?>
</div>
<?php endif; ?>
<?php endif; ?>
<?php if
($this->params->get('show_cat_num_articles', 1)) : ?>
<?php if ($child->getNumItems() == true) : ?>
<dl>
<dt>
<?php echo JText::_('COM_CONTENT_NUM_ITEMS'); ?>
</dt>
<dd>
<?php echo $child->getNumItems(true); ?>
</dd>
</dl>
<?php endif; ?>
<?php endif; ?>
<?php if (count($child->getChildren()) > 0 ) :
$this->children[$child->id] = $child->getChildren();
$this->category = $child;
$this->maxLevel--;
if ($this->maxLevel !== 0) :
echo $this->loadTemplate('children');
endif;
$this->category = $child->getParent();
$this->maxLevel++;
endif; ?>
</li>
<?php endif; ?>
<?php endif; ?>
<?php endforeach; ?>
</ul>
<?php endif; ?>
com_content/featured/default.php000064400000004654151163626050013026
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Templates.beez3
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers');
JHtml::_('behavior.caption');
?>
<section class="blog-featured<?php echo
$this->pageclass_sfx;?>">
<?php if ( $this->params->get('show_page_heading') != 0)
: ?>
<h1>
<?php echo
$this->escape($this->params->get('page_heading')); ?>
</h1>
<?php endif; ?>
<?php $leadingcount = 0; ?>
<?php if (!empty($this->lead_items)) : ?>
<div class="items-leading">
<?php foreach ($this->lead_items as &$item) : ?>
<article class="leading-<?php echo $leadingcount;
?><?php echo $item->state == 0 ? ' system-unpublished' :
null; ?>">
<?php
$this->item = &$item;
echo $this->loadTemplate('item');
?>
</article>
<?php
$leadingcount++;
?>
<?php endforeach; ?>
</div>
<?php endif; ?>
<?php
$introcount = count($this->intro_items);
$counter = 0;
?>
<?php if (!empty($this->intro_items)) : ?>
<?php foreach ($this->intro_items as $key => &$item) : ?>
<?php
$key = ($key - $leadingcount) + 1;
$rowcount = (((int) $key - 1) % (int) $this->columns) + 1;
$row = $counter / $this->columns;
if ($rowcount === 1) : ?>
<div class="items-row cols-<?php echo (int)
$this->columns;?> <?php echo 'row-'.$row;
?>">
<?php endif; ?>
<article class="item column-<?php echo $rowcount;?><?php
echo $item->state == 0 ? ' system-unpublished"' : null;
?>">
<?php
$this->item = &$item;
echo $this->loadTemplate('item');
?>
</article>
<?php $counter++; ?>
<?php if (($rowcount == $this->columns) or ($counter ==
$introcount)) : ?>
<span class="row-separator"></span>
</div>
<?php endif; ?>
<?php endforeach; ?>
<?php endif; ?>
<?php if (!empty($this->link_items)) : ?>
<div class="items-more">
<?php echo $this->loadTemplate('links'); ?>
</div>
<?php endif; ?>
<?php if ($this->params->def('show_pagination', 2) == 1
|| ($this->params->get('show_pagination') == 2 &&
$this->pagination->pagesTotal > 1)) : ?>
<div class="pagination">
<?php if
($this->params->def('show_pagination_results', 1)) : ?>
<p class="counter">
<?php echo $this->pagination->getPagesCounter(); ?>
</p>
<?php endif; ?>
<?php echo $this->pagination->getPagesLinks(); ?>
</div>
<?php endif; ?>
</section>
com_content/featured/default_item.php000064400000017006151163626050014037
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Templates.beez3
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
// Create a shortcut for params.
$canEdit = $this->item->params->get('access-edit');
$params = &$this->item->params;
$showPrintIcon = $params->get('show_print_icon');
$showEmailIcon = $params->get('show_email_icon');
$images = json_decode($this->item->images);
$app = JFactory::getApplication();
$templateparams = $app->getTemplate(true)->params;
$currentDate = JFactory::getDate()->format('Y-m-d H:i:s');
$isUnpublished = ($this->item->state == 0 ||
$this->item->publish_up > $currentDate)
|| ($this->item->publish_down < $currentDate &&
$this->item->publish_down !== JFactory::getDbo()->getNullDate());
?>
<?php if ($isUnpublished) : ?>
<div class="system-unpublished">
<?php endif; ?>
<?php if ($params->get('show_title')) : ?>
<h2>
<?php if ($params->get('link_titles') &&
$params->get('access-view')) : ?>
<a href="<?php echo
JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug,
$this->item->catid, $this->item->language)); ?>">
<?php echo $this->escape($this->item->title);
?></a>
<?php else : ?>
<?php echo $this->escape($this->item->title); ?>
<?php endif; ?>
</h2>
<?php endif; ?>
<?php // Content is generated by content plugin event
"onContentAfterTitle" ?>
<div class="pull-left"><?php echo
$this->item->event->afterDisplayTitle; ?></div>
<?php if ($canEdit || $showPrintIcon || $showEmailIcon) : ?>
<ul class="actions">
<?php if ($showPrintIcon) : ?>
<li class="print-icon">
<?php echo JHtml::_('icon.print_popup', $this->item,
$params, array(), true); ?>
</li>
<?php endif; ?>
<?php if ($showEmailIcon) : ?>
<li class="email-icon">
<?php echo JHtml::_('icon.email', $this->item, $params,
array(), true); ?>
</li>
<?php endif; ?>
<?php if ($canEdit) : ?>
<li class="edit-icon">
<?php echo JHtml::_('icon.edit', $this->item, $params,
array(), true); ?>
</li>
<?php endif; ?>
</ul>
<?php endif; ?>
<?php echo $this->item->event->beforeDisplayContent; ?>
<?php // to do not that elegant would be nice to group the params ?>
<?php if ($params->get('show_author') or
$params->get('show_category') or
$params->get('show_create_date') or
$params->get('show_modify_date') or
$params->get('show_publish_date') or
$params->get('show_parent_category') or
$params->get('show_hits')) : ?>
<dl class="article-info">
<dt class="article-info-term"><?php echo
JText::_('COM_CONTENT_ARTICLE_INFO'); ?></dt>
<?php endif; ?>
<?php if ($this->item->parent_id != 1 &&
$params->get('show_parent_category')) : ?>
<dd class="parent-category-name">
<?php $title = $this->escape($this->item->parent_title);
$title = $title ?: JText::_('JGLOBAL_UNCATEGORISED');
$url = '<a href="' .
JRoute::_(ContentHelperRoute::getCategoryRoute($this->item->parent_slug))
. '">' . $title . '</a>'; ?>
<?php if ($params->get('link_parent_category') and
$this->item->parent_slug) : ?>
<?php echo JText::sprintf('COM_CONTENT_PARENT', $url);
?>
<?php else : ?>
<?php echo JText::sprintf('COM_CONTENT_PARENT', $title);
?>
<?php endif; ?>
</dd>
<?php endif; ?>
<?php if ($params->get('show_category')) : ?>
<dd class="category-name">
<?php $title = $this->escape($this->item->category_title);
$title = $title ?: JText::_('JGLOBAL_UNCATEGORISED');
$url = '<a
href="'.JRoute::_(ContentHelperRoute::getCategoryRoute($this->item->catslug)).'">'.$title.'</a>';?>
<?php if ($params->get('link_category') and
$this->item->catslug) : ?>
<?php echo JText::sprintf('COM_CONTENT_CATEGORY', $url);
?>
<?php else : ?>
<?php echo JText::sprintf('COM_CONTENT_CATEGORY', $title);
?>
<?php endif; ?>
</dd>
<?php endif; ?>
<?php if ($params->get('show_create_date')) : ?>
<dd class="create">
<?php echo JText::sprintf('COM_CONTENT_CREATED_DATE_ON',
JHtml::_('date', $this->item->created,
JText::_('DATE_FORMAT_LC2'))); ?>
</dd>
<?php endif; ?>
<?php if ($params->get('show_modify_date')) : ?>
<dd class="modified">
<?php echo JText::sprintf('COM_CONTENT_LAST_UPDATED',
JHtml::_('date', $this->item->modified,
JText::_('DATE_FORMAT_LC2'))); ?>
</dd>
<?php endif; ?>
<?php if ($params->get('show_publish_date')) : ?>
<dd class="published">
<?php echo JText::sprintf('COM_CONTENT_PUBLISHED_DATE_ON',
JHtml::_('date', $this->item->publish_up,
JText::_('DATE_FORMAT_LC2'))); ?>
</dd>
<?php endif; ?>
<?php if (!empty($this->item->author) &&
$params->get('show_author')) : ?>
<dd class="createdby">
<?php $author = $this->item->created_by_alias ?:
$this->item->author; ?>
<?php if (!empty($this->item->contact_link ) &&
$params->get('link_author') == true) : ?>
<?php echo JText::sprintf('COM_CONTENT_WRITTEN_BY',
JHtml::_('link', $this->item->contact_link, $author));
?>
<?php else :?>
<?php echo JText::sprintf('COM_CONTENT_WRITTEN_BY',
$author); ?>
<?php endif; ?>
</dd>
<?php endif; ?>
<?php if ($params->get('show_hits')) : ?>
<dd class="hits">
<?php echo JText::sprintf('COM_CONTENT_ARTICLE_HITS',
$this->item->hits); ?>
</dd>
<?php endif; ?>
<?php if ($params->get('show_author') or
$params->get('show_category') or
$params->get('show_create_date') or
$params->get('show_modify_date') or
$params->get('show_publish_date') or
$params->get('show_parent_category') or
$params->get('show_hits')) : ?>
</dl>
<?php endif; ?>
<?php if (isset($images->image_intro) and
!empty($images->image_intro)) : ?>
<?php $imgfloat = empty($images->float_intro) ?
$params->get('float_intro') : $images->float_intro; ?>
<div class="img-intro-<?php echo htmlspecialchars($imgfloat,
ENT_COMPAT, 'UTF-8'); ?>">
<img
<?php if ($images->image_intro_caption):
echo 'class="caption"'.' title="' .
htmlspecialchars($images->image_intro_caption, ENT_COMPAT,
'UTF-8') .'"';
endif; ?>
src="<?php echo htmlspecialchars($images->image_intro,
ENT_COMPAT, 'UTF-8'); ?>" alt="<?php echo
htmlspecialchars($images->image_intro_alt, ENT_COMPAT,
'UTF-8'); ?>"/>
</div>
<?php endif; ?>
<?php echo $this->item->introtext; ?>
<?php if ($this->item->readmore &&
$params->get('show_readmore')) :
if ($params->get('access-view')) :
$link =
JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug,
$this->item->catid, $this->item->language));
else :
$menu = JFactory::getApplication()->getMenu();
$active = $menu->getActive();
$itemId = $active->id;
$link = new
JUri(JRoute::_('index.php?option=com_users&view=login&Itemid='
. $itemId, false));
$link->setVar('return',
base64_encode(ContentHelperRoute::getArticleRoute($this->item->slug,
$this->item->catid, $this->item->language)));
endif;
?>
<p class="readmore">
<a href="<?php echo $link; ?>">
<?php if (!$params->get('access-view')) :
echo JText::_('COM_CONTENT_REGISTER_TO_READ_MORE');
elseif ($readmore = $this->item->alternative_readmore) :
echo $readmore;
if ($params->get('show_readmore_title', 0) != 0) :
echo JHtml::_('string.truncate', $this->item->title,
$params->get('readmore_limit'));
endif;
elseif ($params->get('show_readmore_title', 0) == 0) :
echo JText::sprintf('COM_CONTENT_READ_MORE_TITLE');
else :
echo JText::_('COM_CONTENT_READ_MORE');
echo JHtml::_('string.truncate', $this->item->title,
$params->get('readmore_limit'));
endif; ?></a>
</p>
<?php endif; ?>
<?php if ($isUnpublished) : ?>
</div>
<?php endif; ?>
<div class="item-separator"></div>
<?php echo $this->item->event->afterDisplayContent; ?>
com_content/featured/default_links.php000064400000001133151163626050014213
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Templates.beez3
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
?>
<h3><?php echo JText::_('COM_CONTENT_MORE_ARTICLES');
?></h3>
<ol class="links">
<?php foreach ($this->link_items as &$item) : ?>
<li>
<a href="<?php echo
JRoute::_(ContentHelperRoute::getArticleRoute($item->slug,
$item->catid, $item->language)); ?>">
<?php echo $item->title; ?></a>
</li>
<?php endforeach; ?>
</ol>
com_content/form/edit.php000064400000026365151163626050011476
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Templates.beez3
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
// no direct access
defined('_JEXEC') or die;
JHtml::_('behavior.keepalive');
JHtml::_('behavior.formvalidation');
// Create shortcut to parameters.
$params = $this->state->get('params');
//$images = json_decode($this->item->images);
//$urls = json_decode($this->item->urls);
// This checks if the editor config options have ever been saved. If they
haven't they will fall back to the original settings.
$editoroptions = isset($params->show_publishing_options);
if (!$editoroptions):
$params->show_urls_images_frontend = '0';
endif;
$ignoredFieldsets = array('image-intro', 'image-full',
'jmetadata', 'item_associations');
?>
<script type="text/javascript">
Joomla.submitbutton = function(task)
{
if (task === 'article.cancel' ||
document.formvalidator.isValid(document.getElementById('adminForm')))
{
<?php echo
$this->form->getField('articletext')->save(); ?>
Joomla.submitform(task);
}
}
</script>
<div class="edit item-page<?php echo $this->pageclass_sfx;
?>">
<?php if ($params->get('show_page_heading')) : ?>
<h1>
<?php echo $this->escape($params->get('page_heading'));
?>
</h1>
<?php endif; ?>
<form action="<?php echo
JRoute::_('index.php?option=com_content&a_id='.(int)
$this->item->id); ?>" method="post"
name="adminForm" id="adminForm"
class="form-validate">
<fieldset>
<legend><?php echo
JText::_('COM_CONTENT_ARTICLE_CONTENT'); ?></legend>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('title'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('title'); ?>
</div>
</div>
<?php if ($this->item->id === null):?>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('alias'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('alias'); ?>
</div>
</div>
<?php endif; ?>
<div class="btn-group">
<button type="button" class="btn btn-primary"
onclick="Joomla.submitbutton('article.save')">
<?php echo JText::_('JSAVE') ?>
</button>
<button type="button" class="btn"
onclick="Joomla.submitbutton('article.cancel')">
<?php echo JText::_('JCANCEL') ?>
</button>
</div>
<?php if ($this->captchaEnabled) : ?>
<?php echo $this->form->renderField('captcha');
?>
<?php endif; ?>
<?php echo $this->form->getInput('articletext');
?>
</fieldset>
<?php if ($params->get('show_urls_images_frontend') ) :
?>
<fieldset>
<legend><?php echo
JText::_('COM_CONTENT_IMAGES_AND_URLS'); ?></legend>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('image_intro',
'images'); ?>
<?php echo $this->form->getInput('image_intro',
'images'); ?>
</div>
</div>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('image_intro_alt',
'images'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('image_intro_alt',
'images'); ?>
</div>
</div>
<div class="control-group">
<div class="control-label">
<?php echo
$this->form->getLabel('image_intro_caption',
'images'); ?>
</div>
<div class="controls">
<?php echo
$this->form->getInput('image_intro_caption',
'images'); ?>
</div>
</div>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('float_intro',
'images'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('float_intro',
'images'); ?>
</div>
</div>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('image_fulltext',
'images'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('image_fulltext',
'images'); ?>
</div>
</div>
<div class="control-group">
<div class="control-label">
<?php echo
$this->form->getLabel('image_fulltext_alt',
'images'); ?>
</div>
<div class="controls">
<?php echo
$this->form->getInput('image_fulltext_alt',
'images'); ?>
</div>
</div>
<div class="control-group">
<div class="control-label">
<?php echo
$this->form->getLabel('image_fulltext_caption',
'images'); ?>
</div>
<div class="controls">
<?php echo
$this->form->getInput('image_fulltext_caption',
'images'); ?>
</div>
</div>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('float_fulltext',
'images'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('float_fulltext',
'images'); ?>
</div>
</div>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('urla',
'urls'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('urla',
'urls'); ?>
</div>
</div>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('urlatext',
'urls'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('urlatext',
'urls'); ?>
</div>
</div>
<div class="control-group">
<div class="controls">
<?php echo $this->form->getInput('targeta',
'urls'); ?>
</div>
</div>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('urlb',
'urls'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('urlb',
'urls'); ?>
</div>
</div>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('urlbtext',
'urls'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('urlbtext',
'urls'); ?>
</div>
</div>
<div class="control-group">
<div class="controls">
<?php echo $this->form->getInput('targetb',
'urls'); ?>
</div>
</div>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('urlc',
'urls'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('urlc',
'urls'); ?>
</div>
</div>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('urlctext',
'urls'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('urlctext',
'urls'); ?>
</div>
</div>
<div class="control-group">
<div class="controls">
<?php echo $this->form->getInput('targetc',
'urls'); ?>
</div>
</div>
</fieldset>
<?php endif; ?>
<?php // Render additional fieldsets added by plugins. ?>
<?php foreach ($this->form->getFieldsets() as $fieldset) : ?>
<?php if (in_array($fieldset->name, $ignoredFieldsets)) : ?>
<?php continue; ?>
<?php endif; ?>
<fieldset>
<legend><?php echo JText::_($fieldset->label);
?></legend>
<?php $this->fieldset = $fieldset->name; ?>
<?php echo JLayoutHelper::render('joomla.edit.fieldset',
$this); ?>
</fieldset>
<?php endforeach; ?>
<fieldset>
<legend><?php echo JText::_('COM_CONTENT_PUBLISHING');
?></legend>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('catid'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('catid'); ?>
</div>
</div>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('tags'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('tags'); ?>
</div>
</div>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('note'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('note'); ?>
</div>
</div>
<?php if ($params->get('save_history', 0)) : ?>
<div class="control-label">
<?php echo $this->form->getLabel('version_note');
?>
</div>
<div class="controls">
<?php echo $this->form->getInput('version_note');
?>
</div>
<?php endif; ?>
<?php if ($params->get('show_publishing_options', 1) ==
1) : ?>
<div class="control-group">
<div class="control-label">
<?php echo
$this->form->getLabel('created_by_alias'); ?>
</div>
<div class="controls">
<?php echo
$this->form->getInput('created_by_alias'); ?>
</div>
</div>
<?php endif; ?>
<?php if
($this->item->params->get('access-change')) : ?>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('state'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('state'); ?>
</div>
</div>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('featured');
?>
</div>
<div class="controls">
<?php echo $this->form->getInput('featured');
?>
</div>
</div>
<?php if ($params->get('show_publishing_options', 1) ==
1) : ?>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('publish_up');
?>
</div>
<div class="controls">
<?php echo $this->form->getInput('publish_up');
?>
</div>
</div>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('publish_down');
?>
</div>
<div class="controls">
<?php echo $this->form->getInput('publish_down');
?>
</div>
</div>
<?php endif; ?>
<?php endif; ?>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('access'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('access'); ?>
</div>
</div>
<?php if ($this->item->id === null):?>
<div class="control-group">
<div class="control-label">
</div>
<div class="controls">
<?php echo JText::_('COM_CONTENT_ORDERING'); ?>
</div>
</div>
<?php endif; ?>
</fieldset>
<fieldset>
<legend><?php echo JText::_('JFIELD_LANGUAGE_LABEL');
?></legend>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('language'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('language'); ?>
</div>
</div>
</fieldset>
<?php if ($params->get('show_publishing_options', 1) == 1)
: ?>
<fieldset>
<legend><?php echo JText::_('COM_CONTENT_METADATA');
?></legend>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('metadesc'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('metadesc'); ?>
</div>
</div>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('metakey'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('metakey'); ?>
</div>
</div>
</fieldset>
<?php endif; ?>
<input type="hidden" name="task"
value="" />
<input type="hidden" name="return"
value="<?php echo $this->return_page;?>" />
<?php if ($this->params->get('enable_category', 0) ==
1) : ?>
<input type="hidden" name="jform[catid]"
value="<?php echo $this->params->get('catid',
1);?>"/>
<?php endif;?>
<?php echo JHtml::_('form.token'); ?>
</form>
</div>
com_newsfeeds/categories/default.php000064400000002516151163626060013661
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage com_newsfeeds
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers');
JHtml::_('behavior.caption');
?>
<div class="categories-list<?php echo
$this->pageclass_sfx;?>">
<?php if ($this->params->get('show_page_heading')) :
?>
<h1>
<?php echo
$this->escape($this->params->get('page_heading')); ?>
</h1>
<?php endif; ?>
<?php if ($this->params->get('show_base_description'))
: ?>
<?php // If there is a description in the menu parameters use that.
?>
<?php if
($this->params->get('categories_description')) : ?>
<div class="category-desc base-desc">
<?php echo JHtml::_('content.prepare',
$this->params->get('categories_description'), '',
'com_newsfeeds.categories'); ?>
</div>
<?php else : ?>
<?php // Otherwise get one from the database if it exists. ?>
<?php if ($this->parent->description) : ?>
<div class="category-desc base-desc">
<?php echo JHtml::_('content.prepare',
$this->parent->description, '',
'com_newsfeeds.categories'); ?>
</div>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>
<?php echo $this->loadTemplate('items'); ?>
</div>
com_newsfeeds/categories/default_items.php000064400000003266151163626060015065
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage com_newsfeeds
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
$class = ' class="first"';
if ($this->maxLevelcat != 0 &&
count($this->items[$this->parent->id]) > 0) :
?>
<ul>
<?php foreach ($this->items[$this->parent->id] as $id =>
$item) : ?>
<?php
if ($item->numitems ||
$this->params->get('show_empty_categories_cat') ||
count($item->getChildren())) :
if (!isset($this->items[$this->parent->id][$id + 1]))
{
$class = ' class="last"';
}
?>
<li<?php echo $class; ?>>
<?php $class = ''; ?>
<span class="item-title"><a href="<?php echo
JRoute::_(NewsfeedsHelperRoute::getCategoryRoute($item->id));?>">
<?php echo $this->escape($item->title); ?></a>
</span>
<?php if ($this->params->get('show_subcat_desc_cat')
== 1) :?>
<?php if ($item->description) : ?>
<div class="category-desc">
<?php echo JHtml::_('content.prepare',
$item->description, '', 'com_newsfeeds.categories');
?>
</div>
<?php endif; ?>
<?php endif; ?>
<?php if ($this->params->get('show_cat_items_cat') ==
1) : ?>
<dl class="newsfeed-count"><dt>
<?php echo JText::_('COM_NEWSFEEDS_CAT_NUM');
?></dt>
<dd><?php echo $item->numitems; ?></dd>
</dl>
<?php endif; ?>
<?php if (count($item->getChildren()) > 0) :
$this->items[$item->id] = $item->getChildren();
$this->parent = $item;
$this->maxLevelcat--;
echo $this->loadTemplate('items');
$this->parent = $item->getParent();
$this->maxLevelcat++;
endif; ?>
</li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
<?php endif; ?>
com_newsfeeds/category/default.php000064400000003164151163626060013351
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage com_newsfeeds
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers');
JHtml::_('behavior.caption');
?>
<div class="newsfeed-category<?php echo
$this->pageclass_sfx;?>">
<?php if ($this->params->get('show_page_heading')) :
?>
<h1>
<?php echo
$this->escape($this->params->get('page_heading')); ?>
</h1>
<?php endif; ?>
<?php if ($this->params->get('show_category_title', 1))
: ?>
<h2>
<?php echo JHtml::_('content.prepare',
$this->category->title, '',
'com_newsfeeds.category.title'); ?>
</h2>
<?php endif; ?>
<?php if ($this->params->get('show_description', 1) ||
$this->params->def('show_description_image', 1)) : ?>
<div class="category-desc">
<?php if ($this->params->get('show_description_image')
&& $this->category->getParams()->get('image')) :
?>
<img src="<?php echo
$this->category->getParams()->get('image');
?>"/>
<?php endif; ?>
<?php if ($this->category->description &&
$this->params->get('show_description')) : ?>
<?php echo JHtml::_('content.prepare',
$this->category->description, '',
'com_newsfeeds.category'); ?>
<?php endif; ?>
<div class="clr"></div>
</div>
<?php endif; ?>
<?php echo $this->loadTemplate('items'); ?>
<?php if ($this->maxLevel != 0 &&
!empty($this->children[$this->category->id])) : ?>
<div class="cat-children">
<h3><?php echo JText::_('JGLOBAL_SUBCATEGORIES');
?></h3>
<?php echo $this->loadTemplate('children'); ?>
</div>
<?php endif; ?>
</div>
com_newsfeeds/category/default_children.php000064400000003341151163626060015216
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage com_newsfeeds
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
$class = ' class="first"';
if ($this->maxLevel != 0 &&
count($this->children[$this->category->id]) > 0) :
?>
<ul>
<?php foreach ($this->children[$this->category->id] as $id
=> $child) : ?>
<?php
if ($child->numitems ||
$this->params->get('show_empty_categories') ||
count($child->getChildren())) :
if (!isset($this->children[$this->category->id][$id + 1]))
{
$class = ' class="last"';
}
?>
<li<?php echo $class; ?>>
<?php $class = ''; ?>
<span class="item-title"><a href="<?php echo
JRoute::_(NewsfeedsHelperRoute::getCategoryRoute($child->id));?>">
<?php echo $this->escape($child->title); ?></a>
</span>
<?php if ($this->params->get('show_subcat_desc') ==
1) : ?>
<?php if ($child->description) : ?>
<div class="category-desc">
<?php echo JHtml::_('content.prepare',
$child->description, '', 'com_newsfeeds.category');
?>
</div>
<?php endif; ?>
<?php endif; ?>
<?php if ($this->params->get('show_cat_items') == 1)
: ?>
<dl class="newsfeed-count"><dt>
<?php echo JText::_('COM_NEWSFEEDS_CAT_NUM');
?></dt>
<dd><?php echo $child->numitems; ?></dd>
</dl>
<?php endif; ?>
<?php if (count($child->getChildren()) > 0) :
$this->children[$child->id] = $child->getChildren();
$this->category = $child;
$this->maxLevel--;
echo $this->loadTemplate('children');
$this->category = $child->getParent();
$this->maxLevel++;
endif; ?>
</li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
<?php endif;
com_newsfeeds/category/default_items.php000064400000006262151163626060014554
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage com_newsfeeds
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::_('behavior.framework');
$n = count($this->items);
$listOrder =
$this->escape($this->state->get('list.ordering'));
$listDirn =
$this->escape($this->state->get('list.direction'));
?>
<?php if (empty($this->items)) : ?>
<p><?php echo JText::_('COM_NEWSFEEDS_NO_ARTICLES');
?></p>
<?php else : ?>
<form action="<?php echo
htmlspecialchars(JUri::getInstance()->toString(), ENT_COMPAT,
'UTF-8'); ?>" method="post"
name="adminForm" id="adminForm">
<fieldset class="filters">
<legend class="hidelabeltxt"><?php echo
JText::_('JGLOBAL_FILTER_LABEL'); ?></legend>
<?php if ($this->params->get('show_pagination_limit'))
: ?>
<div class="display-limit">
<?php echo JText::_('JGLOBAL_DISPLAY_NUM'); ?> 
<?php echo $this->pagination->getLimitBox(); ?>
</div>
<?php endif; ?>
<input type="hidden" name="filter_order"
value="<?php echo $listOrder; ?>" />
<input type="hidden" name="filter_order_Dir"
value="<?php echo $listDirn; ?>" />
</fieldset>
<table class="category">
<?php if ($this->params->get('show_headings') == 1) :
?>
<thead><tr>
<th class="item-title" id="tableOrdering">
<?php echo JHtml::_('grid.sort',
'COM_NEWSFEEDS_FEED_NAME', 'a.name', $listDirn,
$listOrder); ?>
</th>
<?php if ($this->params->get('show_articles')) :
?>
<th class="item-num-art" id="tableOrdering2">
<?php echo JHtml::_('grid.sort',
'COM_NEWSFEEDS_NUM_ARTICLES', 'a.numarticles',
$listDirn, $listOrder); ?>
</th>
<?php endif; ?>
<?php if ($this->params->get('show_link')) : ?>
<th class="item-link" id="tableOrdering3">
<?php echo JHtml::_('grid.sort',
'COM_NEWSFEEDS_FEED_LINK', 'a.link', $listDirn,
$listOrder); ?>
</th>
<?php endif; ?>
</tr>
</thead>
<?php endif; ?>
<tbody>
<?php foreach ($this->items as $i => $item) : ?>
<?php if ($this->items[$i]->published == 0) : ?>
<tr class="system-unpublished cat-list-row<?php echo $i %
2; ?>">
<?php else: ?>
<tr class="cat-list-row<?php echo $i % 2; ?>" >
<?php endif; ?>
<td class="item-title">
<a href="<?php echo
JRoute::_(NewsFeedsHelperRoute::getNewsfeedRoute($item->slug,
$item->catid)); ?>">
<?php echo $item->name; ?></a>
</td>
<?php if ($this->params->get('show_articles')) :
?>
<td class="item-num-art">
<?php echo $item->numarticles; ?>
</td>
<?php endif; ?>
<?php if ($this->params->get('show_link')) : ?>
<td class="item-link">
<a href="<?php echo $item->link;
?>"><?php echo $item->link; ?></a>
</td>
<?php endif; ?>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php if ($this->params->get('show_pagination')) :
?>
<div class="pagination">
<?php if
($this->params->def('show_pagination_results', 1)) : ?>
<p class="counter">
<?php echo $this->pagination->getPagesCounter(); ?>
</p>
<?php endif; ?>
<?php echo $this->pagination->getPagesLinks(); ?>
</div>
<?php endif; ?>
</form>
<?php endif; ?>
com_weblinks/categories/default.php000064400000002465151163626060013517
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage com_weblinks
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers');
JHtml::_('behavior.caption');
?>
<div class="categories-list<?php echo
$this->pageclass_sfx;?>">
<?php if ($this->params->get('show_page_heading')) :
?>
<h1>
<?php echo
$this->escape($this->params->get('page_heading')); ?>
</h1>
<?php endif; ?>
<?php if ($this->params->get('show_base_description')) :
?>
<?php //If there is a description in the menu parameters use that;
?>
<?php if
($this->params->get('categories_description')) : ?>
<div class="category-desc base-desc">
<?php echo JHtml::_('content.prepare',
$this->params->get('categories_description'), '',
'com_weblinks.categories'); ?>
</div>
<?php else: ?>
<?php //Otherwise get one from the database if it exists. ?>
<?php if ($this->parent->description) : ?>
<div class="category-desc base-desc">
<?php echo JHtml::_('content.prepare',
$this->parent->description, '',
'com_weblinks.categories'); ?>
</div>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>
<?php
echo $this->loadTemplate('items');
?>
</div>
com_weblinks/categories/default_items.php000064400000003264151163626070014717
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage com_weblinks
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
$class = ' class="first"';
if ($this->maxLevelcat != 0 &&
count($this->items[$this->parent->id]) > 0) :
?>
<ul>
<?php foreach ($this->items[$this->parent->id] as $id =>
$item) : ?>
<?php
if ($item->numitems ||
$this->params->get('show_empty_categories_cat') ||
count($item->getChildren())) :
if (!isset($this->items[$this->parent->id][$id + 1]))
{
$class = ' class="last"';
}
?>
<li<?php echo $class; ?>>
<?php $class = ''; ?>
<span class="item-title"><a href="<?php echo
JRoute::_(WeblinksHelperRoute::getCategoryRoute($item->id));
?>">
<?php echo $this->escape($item->title); ?></a>
</span>
<?php if ($this->params->get('show_subcat_desc_cat')
== 1) : ?>
<?php if ($item->description) : ?>
<div class="category-desc">
<?php echo JHtml::_('content.prepare',
$item->description, '', 'com_weblinks.categories');
?>
</div>
<?php endif; ?>
<?php endif; ?>
<?php if ($this->params->get('show_cat_num_links_cat')
== 1) : ?>
<dl class="weblink-count"><dt>
<?php echo JText::_('COM_WEBLINKS_NUM'); ?></dt>
<dd><?php echo $item->numitems; ?></dd>
</dl>
<?php endif; ?>
<?php if (count($item->getChildren()) > 0) :
$this->items[$item->id] = $item->getChildren();
$this->parent = $item;
$this->maxLevelcat--;
echo $this->loadTemplate('items');
$this->parent = $item->getParent();
$this->maxLevelcat++;
endif; ?>
</li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
<?php endif; ?>
com_weblinks/category/default.php000064400000003160151163626070013201
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage com_weblinks
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers');
JHtml::_('behavior.caption');
?>
<div class="weblink-category<?php echo
$this->pageclass_sfx;?>">
<?php if ($this->params->get('show_page_heading')) :
?>
<h1>
<?php echo
$this->escape($this->params->get('page_heading')); ?>
</h1>
<?php endif; ?>
<?php if ($this->params->get('show_category_title', 1))
: ?>
<h2>
<?php echo JHtml::_('content.prepare',
$this->category->title, '',
'com_weblinks.category.title'); ?>
</h2>
<?php endif; ?>
<?php if ($this->params->get('show_description', 1) ||
$this->params->def('show_description_image', 1)) : ?>
<div class="category-desc">
<?php if ($this->params->get('show_description_image')
&& $this->category->getParams()->get('image')) :
?>
<img src="<?php echo
$this->category->getParams()->get('image');
?>"/>
<?php endif; ?>
<?php if ($this->category->description &&
$this->params->get('show_description')) : ?>
<?php echo JHtml::_('content.prepare',
$this->category->description, '',
'com_weblinks.category'); ?>
<?php endif; ?>
<div class="clr"></div>
</div>
<?php endif; ?>
<?php echo $this->loadTemplate('items'); ?>
<?php if ($this->maxLevel != 0 &&
!empty($this->children[$this->category->id])) : ?>
<div class="cat-children">
<h3><?php echo JText::_('JGLOBAL_SUBCATEGORIES');
?></h3>
<?php echo $this->loadTemplate('children'); ?>
</div>
<?php endif; ?>
</div>
com_weblinks/category/default_children.php000064400000003336151163626070015056
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage com_weblinks
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
$class = ' class="first"';
if ($this->maxLevel != 0 &&
count($this->children[$this->category->id]) > 0) :
?>
<ul>
<?php foreach ($this->children[$this->category->id] as $id
=> $child) : ?>
<?php
if ($child->numitems ||
$this->params->get('show_empty_categories') ||
count($child->getChildren())) :
if (!isset($this->children[$this->category->id][$id + 1]))
{
$class = ' class="last"';
}
?>
<li<?php echo $class; ?>>
<?php $class = ''; ?>
<span class="item-title"><a href="<?php echo
JRoute::_(WeblinksHelperRoute::getCategoryRoute($child->id));
?>">
<?php echo $this->escape($child->title); ?></a>
</span>
<?php if ($this->params->get('show_subcat_desc') ==
1) : ?>
<?php if ($child->description) : ?>
<div class="category-desc">
<?php echo JHtml::_('content.prepare',
$child->description, '', 'com_weblinks.category');
?>
</div>
<?php endif; ?>
<?php endif; ?>
<?php if ($this->params->get('show_cat_num_links') ==
1) : ?>
<dl class="weblink-count"><dt>
<?php echo JText::_('COM_WEBLINKS_NUM'); ?></dt>
<dd><?php echo $child->numitems; ?></dd>
</dl>
<?php endif; ?>
<?php if (count($child->getChildren()) > 0 ) :
$this->children[$child->id] = $child->getChildren();
$this->category = $child;
$this->maxLevel--;
echo $this->loadTemplate('children');
$this->category = $child->getParent();
$this->maxLevel++;
endif; ?>
</li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
<?php endif;
com_weblinks/category/default_items.php000064400000016333151163626070014410
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage com_weblinks
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
// Code to support edit links for weblinks
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.framework');
// Get the user object.
$user = JFactory::getUser();
// Check if user is allowed to add/edit based on weblinks permissinos.
$canEdit = $user->authorise('core.edit',
'com_weblinks');
$canCreate = $user->authorise('core.create',
'com_weblinks');
$canEditState = $user->authorise('core.edit.state',
'com_weblinks');
$n = count($this->items);
$listOrder =
$this->escape($this->state->get('list.ordering'));
$listDirn =
$this->escape($this->state->get('list.direction'));
?>
<?php if (empty($this->items)) : ?>
<p> <?php echo JText::_('COM_WEBLINKS_NO_WEBLINKS');
?></p>
<?php else : ?>
<form action="<?php echo
htmlspecialchars(JUri::getInstance()->toString(), ENT_COMPAT,
'UTF-8'); ?>" method="post"
name="adminForm" id="adminForm">
<?php if ($this->params->get('show_pagination_limit'))
: ?>
<fieldset class="filters">
<legend class="hidelabeltxt"><?php echo
JText::_('JGLOBAL_FILTER_LABEL'); ?></legend>
<div class="display-limit">
<?php echo JText::_('JGLOBAL_DISPLAY_NUM'); ?> 
<?php echo $this->pagination->getLimitBox(); ?>
</div>
<input type="hidden" name="filter_order"
value="<?php echo $listOrder; ?>" />
<input type="hidden" name="filter_order_Dir"
value="<?php echo $listDirn; ?>" />
</fieldset>
<?php endif; ?>
<table class="category">
<?php if ($this->params->get('show_headings') == 1) :
?>
<thead><tr>
<th class="title">
<?php echo JHtml::_('grid.sort',
'COM_WEBLINKS_GRID_TITLE', 'title', $listDirn,
$listOrder); ?>
</th>
<?php if ($this->params->get('show_link_hits')) :
?>
<th class="hits">
<?php echo JHtml::_('grid.sort',
'JGLOBAL_HITS', 'hits', $listDirn, $listOrder); ?>
</th>
<?php endif; ?>
</tr>
</thead>
<?php endif; ?>
<tbody>
<?php foreach ($this->items as $i => $item) : ?>
<?php if ($this->items[$i]->state == 0) : ?>
<tr class="system-unpublished cat-list-row<?php echo $i % 2;
?>">
<?php else: ?>
<tr class="cat-list-row<?php echo $i % 2; ?>" >
<?php endif; ?>
<td class="title">
<p>
<?php if ($this->params->get('icons') == 0) : ?>
<?php echo JText::_('COM_WEBLINKS_LINK'); ?>
<?php elseif ($this->params->get('icons') == 1) :
?>
<?php if (!$this->params->get('link_icons')) :
?>
<?php echo JHtml::_('image',
'system/'.$this->params->get('link_icons',
'weblink.png'), JText::_('COM_WEBLINKS_LINK'), null,
true); ?>
<?php else: ?>
<?php echo '<img
src="'.$this->params->get('link_icons').'"
alt="'.JText::_('COM_WEBLINKS_LINK').'"
/>'; ?>
<?php endif; ?>
<?php endif; ?>
<?php
// Compute the correct link
$menuclass = 'category' . $this->pageclass_sfx;
$link = $item->link;
$width = $item->params->get('width');
$height = $item->params->get('height');
if ($width == null || $height == null)
{
$width = 600;
$height = 500;
}
switch ($item->params->get('target',
$this->params->get('target')))
{
case 1:
// open in a new window
echo '<a href="'. $link .'"
target="_blank" class="'. $menuclass .'"
rel="nofollow">'.
$this->escape($item->title) .'</a>';
break;
case 2:
// open in a popup window
$attribs =
'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width='.$this->escape($width).',height='.$this->escape($height).'';
echo "<a href=\"$link\"
onclick=\"window.open(this.href, 'targetWindow',
'".$attribs."'); return false;\">".
$this->escape($item->title).'</a>';
break;
case 3:
// open in a modal window
JHtml::_('behavior.modal', 'a.modal');
echo '<a class="modal"
href="'.$link.'" rel="{handler:
\'iframe\', size: {x:'.$this->escape($width).',
y:'.$this->escape($height).'}}">'.
$this->escape($item->title). ' </a>';
break;
default:
// open in parent window
echo '<a href="'. $link . '"
class="'. $menuclass .'"
rel="nofollow">'.
$this->escape($item->title) . ' </a>';
break;
}
?>
<?php // Code to add the edit link for the weblink. ?>
<?php if ($canEdit) : ?>
<ul class="actions">
<li class="edit-icon">
<?php echo JHtml::_('icon.edit', $item,
$item->params); ?>
</li>
</ul>
<?php endif; ?>
</p>
<?php $tagsData =
$item->tags->getItemTags('com_weblinks.weblink',
$item->id); ?>
<?php if ($this->params->get('show_tags', 1)) : ?>
<?php $this->item->tagLayout = new
JLayoutFile('joomla.content.tags'); ?>
<?php echo $this->item->tagLayout->render($tagsData); ?>
<?php endif; ?>
<?php if ($this->params->get('show_link_description')
and ($item->description != '')) : ?>
<?php $images = json_decode($item->images); ?>
<?php if (isset($images->image_first) and
!empty($images->image_first)) : ?>
<?php $imgfloat = empty($images->float_first) ?
$this->params->get('float_first') :
$images->float_first; ?>
<div class="img-intro-<?php echo htmlspecialchars($imgfloat,
ENT_COMPAT, 'UTF-8'); ?>"> <img
<?php if ($images->image_first_caption):
echo 'class="caption"'.' title="'
.htmlspecialchars($images->image_first_caption, ENT_COMPAT,
'UTF-8') .'"';
endif; ?>
src="<?php echo htmlspecialchars($images->image_first,
ENT_COMPAT, 'UTF-8'); ?>" alt="<?php echo
htmlspecialchars($images->image_first_alt, ENT_COMPAT,
'UTF-8'); ?>"/> </div>
<?php endif; ?>
<?php if (isset($images->image_second) and
!empty($images->image_second)) : ?>
<?php $imgfloat = empty($images->float_second) ?
$this->params->get('float_second') :
$images->float_second; ?>
<div class="pull-<?php echo htmlspecialchars($imgfloat,
ENT_COMPAT, 'UTF-8'); ?> item-image"> <img
<?php if ($images->image_second_caption):
echo 'class="caption"'.' title="'
.htmlspecialchars($images->image_second_caption, ENT_COMPAT,
'UTF-8') .'"';
endif; ?>
src="<?php echo htmlspecialchars($images->image_second,
ENT_COMPAT, 'UTF-8'); ?>" alt="<?php echo
htmlspecialchars($images->image_second_alt, ENT_COMPAT,
'UTF-8'); ?>"/> </div>
<?php endif; ?>
<?php echo $item->description; ?>
<?php endif; ?>
</td>
<?php if ($this->params->get('show_link_hits')) :
?>
<td class="hits">
<?php echo $item->hits; ?>
</td>
<?php endif; ?>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php // Code to add a link to submit a weblink. ?>
<?php /* if ($canCreate) : // TODO This is not working due to some
problem in the router, I think. Ref issue #23685 ?>
<?php echo JHtml::_('icon.create', $item, $item->params);
?>
<?php endif; */ ?>
<?php if ($this->params->get('show_pagination')) :
?>
<div class="pagination">
<?php if
($this->params->def('show_pagination_results', 1)) : ?>
<p class="counter">
<?php echo $this->pagination->getPagesCounter(); ?>
</p>
<?php endif; ?>
<?php echo $this->pagination->getPagesLinks(); ?>
</div>
<?php endif; ?>
</form>
<?php endif; ?>
com_weblinks/form/edit.php000064400000007135151163626070011636
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage com_weblinks
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::_('behavior.keepalive');
JHtml::_('behavior.formvalidation');
// Create shortcut to parameters.
$params = $this->state->get('params');
?>
<script type="text/javascript">
Joomla.submitbutton = function(task)
{
if (task === 'weblink.cancel' ||
document.formvalidator.isValid(document.getElementById('adminForm')))
{
<?php echo
$this->form->getField('description')->save(); ?>
Joomla.submitform(task);
}
}
</script>
<div class="edit<?php echo $this->pageclass_sfx;
?>">
<?php if ($this->params->get('show_page_heading')) :
?>
<h1>
<?php echo
$this->escape($this->params->get('page_heading')); ?>
</h1>
<?php endif; ?>
<form action="<?php echo
JRoute::_('index.php?option=com_weblinks&view=form&w_id='.(int)
$this->item->id); ?>" method="post"
name="adminForm" id="adminForm"
class="form-validate form-vertical">
<div class="btn-toolbar">
<div class="btn-group">
<button type="button" class="btn btn-primary"
onclick="Joomla.submitbutton('weblink.save')">
<span class="icon-ok"
aria-hidden="true"></span> <?php echo
JText::_('JSAVE') ?>
</button>
</div>
<div class="btn-group">
<button type="button" class="btn"
onclick="Joomla.submitbutton('weblink.cancel')">
<span class="icon-cancel"
aria-hidden="true"></span> <?php echo
JText::_('JCANCEL') ?>
</button>
</div>
</div>
<hr class="hr-condensed" />
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('title'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('title'); ?>
</div>
</div>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('alias'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('alias'); ?>
</div>
</div>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('catid'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('catid'); ?>
</div>
</div>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('tags'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('tags'); ?>
</div>
</div>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('url'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('url'); ?>
</div>
</div>
<?php if ($this->user->authorise('core.edit.state',
'com_weblinks.weblink')) : ?>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('state'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('state'); ?>
</div>
</div>
<?php endif; ?>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('language'); ?>
</div>
<div class="controls">
<?php echo $this->form->getInput('language'); ?>
</div>
</div>
<div class="control-group">
<div class="control-label">
<?php echo $this->form->getLabel('description');
?>
</div>
<div class="controls">
<?php echo $this->form->getInput('description');
?>
</div>
</div>
<input type="hidden" name="return"
value="<?php echo $this->return_page;?>" />
<input type="hidden" name="task"
value="" />
<?php echo JHtml::_('form.token'); ?>
</form>
</div>
mod_breadcrumbs/default.php000064400000002746151163626070012051
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Templates.beez3
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
?>
<div class = "breadcrumbs<?php echo $moduleclass_sfx;
?>">
<?php if ($params->get('showHere', 1))
{
echo '<span class="showHere">'
.JText::_('MOD_BREADCRUMBS_HERE').'</span>';
}
// 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);
// Generate the trail
foreach ($list as $key => $item) :
// Make a link if not the last item in the breadcrumbs
$show_last = $params->get('showLast', 1);
if ($key !== $last_item_key)
{
// Render all but last item - along with separator
if (!empty($item->link))
{
echo '<a href="' . $item->link . '"
class="pathway">' . $item->name .
'</a>';
}
else
{
echo '<span>' . $item->name .
'</span>';
}
if ($key !== $penult_item_key || $show_last)
{
echo ' '.$separator.' ';
}
}
elseif ($show_last)
{
// Render last item if reqd.
echo '<span>' . $item->name .
'</span>';
}
endforeach; ?>
</div>
mod_languages/default.php000064400000003712151163626070011520
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage mod_languages
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::_('stylesheet', 'mod_languages/template.css',
array('version' => 'auto', 'relative'
=> true));
?>
<div class="mod-languages<?php echo $moduleclass_sfx;
?>">
<?php if ($headerText) : ?>
<div class="pretext"><p><?php echo $headerText;
?></p></div>
<?php endif; ?>
<?php if ($params->get('dropdown', 1)) : ?>
<form name="lang" method="post"
action="<?php echo htmlspecialchars(JUri::current(), ENT_COMPAT,
'UTF-8'); ?>">
<select class="inputbox"
onchange="document.location.replace(this.value);" >
<?php foreach ($list as $language) : ?>
<option dir=<?php echo $language->rtl ?
'"rtl"' : '"ltr"'; ?>
value="<?php echo $language->link; ?>" <?php echo
$language->active ? 'selected="selected"' :
''; ?>>
<?php echo $language->title_native; ?></option>
<?php endforeach; ?>
</select>
</form>
<?php else : ?>
<ul class="<?php echo $params->get('inline', 1) ?
'lang-inline' : 'lang-block'; ?>">
<?php foreach ($list as $language) : ?>
<?php if (!$language->active ||
$params->get('show_active', 0)) : ?>
<li class="<?php echo $language->active ?
'lang-active' : ''; ?>" dir="<?php echo
$language->rtl ? 'rtl' : 'ltr'; ?>">
<a href="<?php echo $language->link; ?>">
<?php if ($params->get('image', 1)) : ?>
<?php echo JHtml::_('image', 'mod_languages/' .
$language->image . '.gif', $language->title_native,
array('title' => $language->title_native), true); ?>
<?php else : ?>
<?php echo $params->get('full_name', 1) ?
$language->title_native : strtoupper($language->sef); ?>
<?php endif; ?>
</a>
</li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<?php if ($footerText) : ?>
<div class="posttext"><p><?php echo $footerText;
?></p></div>
<?php endif; ?>
</div>
mod_login/default.php000064400000006052151163626070010662 0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Templates.beez3
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
// no direct access
defined('_JEXEC') or die;
JHtml::_('behavior.keepalive');
?>
<form action="<?php echo JRoute::_('index.php', true,
$params->get('usesecure')); ?>"
method="post" id="login-form" >
<?php if ($params->get('pretext')) : ?>
<div class="pretext">
<p><?php echo $params->get('pretext');
?></p>
</div>
<?php endif; ?>
<fieldset class="userdata">
<p id="form-login-username">
<label for="modlgn-username"><?php echo
JText::_('MOD_LOGIN_VALUE_USERNAME') ?></label>
<input id="modlgn-username" type="text"
name="username" class="inputbox" size="18"
/>
</p>
<p id="form-login-password">
<label for="modlgn-passwd"><?php echo
JText::_('JGLOBAL_PASSWORD') ?></label>
<input id="modlgn-passwd" type="password"
name="password" class="inputbox" size="18"
/>
</p>
<?php if (count($twofactormethods) > 1) : ?>
<div id="form-login-secretkey"
class="control-group">
<div class="controls">
<?php if (!$params->get('usetext')) : ?>
<div class="input-prepend input-append">
<label for="modlgn-secretkey"><?php echo
JText::_('JGLOBAL_SECRETKEY'); ?></label>
<input id="modlgn-secretkey"
autocomplete="one-time-code" type="text"
name="secretkey" class="input-small"
tabindex="0" size="18" />
</div>
<?php else: ?>
<label for="modlgn-secretkey"><?php echo
JText::_('JGLOBAL_SECRETKEY') ?></label>
<input id="modlgn-secretkey"
autocomplete="one-time-code" type="text"
name="secretkey" class="input-small"
tabindex="0" size="18" />
<?php endif; ?>
</div>
</div>
<?php endif; ?>
<?php if (JPluginHelper::isEnabled('system',
'remember')) : ?>
<p id="form-login-remember">
<label for="modlgn-remember"><?php echo
JText::_('MOD_LOGIN_REMEMBER_ME') ?></label>
<input id="modlgn-remember" type="checkbox"
name="remember" class="inputbox"
value="yes"/>
</p>
<?php endif; ?>
<input type="submit" name="Submit"
class="button" value="<?php echo
JText::_('JLOGIN') ?>" />
<input type="hidden" name="option"
value="com_users" />
<input type="hidden" name="task"
value="user.login" />
<input type="hidden" name="return"
value="<?php echo $return; ?>" />
<?php echo JHtml::_('form.token'); ?>
<ul>
<li>
<a href="<?php echo
JRoute::_('index.php?option=com_users&view=reset');
?>">
<?php echo JText::_('MOD_LOGIN_FORGOT_YOUR_PASSWORD');
?></a>
</li>
<li>
<a href="<?php echo
JRoute::_('index.php?option=com_users&view=remind');
?>">
<?php echo JText::_('MOD_LOGIN_FORGOT_YOUR_USERNAME');
?></a>
</li>
<?php if
(JComponentHelper::getParams('com_users')->get('allowUserRegistration'))
: ?>
<li>
<a href="<?php echo
JRoute::_('index.php?option=com_users&view=registration');
?>">
<?php echo JText::_('MOD_LOGIN_REGISTER'); ?></a>
</li>
<?php endif; ?>
</ul>
<?php if ($params->get('posttext')) : ?>
<div class="posttext">
<p><?php echo $params->get('posttext');
?></p>
</div>
<?php endif; ?>
</fieldset>
</form>
mod_login/default_logout.php000064400000002637151163626070012260
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Templates.beez3
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
// no direct access
defined('_JEXEC') or die;
JHtml::_('behavior.keepalive');
?>
<form action="<?php echo JRoute::_('index.php', true,
$params->get('usesecure')); ?>"
method="post" id="login-form">
<?php if ($params->get('greeting')) : ?>
<div class="login-greeting">
<?php if ($params->get('name') == 0) : ?>
<?php echo JText::sprintf('MOD_LOGIN_HINAME',
htmlspecialchars($user->get('name'), ENT_COMPAT,
'UTF-8')); ?>
<?php else : ?>
<?php echo JText::sprintf('MOD_LOGIN_HINAME',
htmlspecialchars($user->get('username'), ENT_COMPAT,
'UTF-8')); ?>
<?php endif; ?>
</div>
<?php endif; ?>
<?php if ($params->get('profilelink')) : ?>
<div class="login-profilelink">
<a href="<?php echo
JRoute::_('index.php?option=com_users&view=profile');
?>">
<?php echo JText::_('MOD_LOGIN_PROFILE'); ?></a>
</div>
<?php endif; ?>
<div class="logout-button">
<input type="submit" name="Submit"
class="button" value="<?php echo
JText::_('JLOGOUT'); ?>" />
<input type="hidden" name="option"
value="com_users" />
<input type="hidden" name="task"
value="user.logout" />
<input type="hidden" name="return"
value="<?php echo $return; ?>" />
<?php echo JHtml::_('form.token'); ?>
</div>
</form>
bootstrap/addtab.php000064400000000724151163753230010522 0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
$id = empty($displayData['id']) ? '' :
$displayData['id'];
$active = empty($displayData['active']) ? '' :
$displayData['active'];
?>
<div id="<?php echo $id; ?>"
class="tab-pane<?php echo $active; ?>">
bootstrap/addtabscript.php000064400000001365151163753230011751
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
$selector = empty($displayData['selector']) ? '' :
$displayData['selector'];
$id = empty($displayData['id']) ? '' :
$displayData['id'];
$active = empty($displayData['active']) ? '' :
$displayData['active'];
$title = empty($displayData['title']) ? '' :
$displayData['title'];
$li = '<li class="' . $active . '"><a
href="#' . $id . '"
data-toggle="tab">' . $title .
'</a></li>';
echo 'jQuery(function($){ $(', json_encode('#' .
$selector . 'Tabs'), ').append($(', json_encode($li),
')); });';
bootstrap/endtab.php000064400000000422151163753230010533 0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
?>
</div>bootstrap/endtabset.php000064400000000422151163753230011247
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
?>
</div>bootstrap/starttabset.php000064400000000731151163753230011641
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
$selector = empty($displayData['selector']) ? '' :
$displayData['selector'];
?>
<ul class="nav nav-tabs" id="<?php echo $selector;
?>Tabs"></ul>
<div class="tab-content" id="<?php echo $selector;
?>Content">bootstrap/starttabsetscript.php000064400000001013151163753230013060
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
$selector = empty($displayData['selector']) ? '' :
$displayData['selector'];
echo
'jQuery(function($){ ',
'$(', json_encode('#' . $selector . ' a'),
')',
'.click(function (e) {',
'e.preventDefault();',
'$(this).tab("show");',
'});',
'});';