Spade
Mini Shell
PK�h�[o7��
�
html/utility.phpnu�[���<?php
/**
* This file is part of Joomla Estate Agency - Joomla! extension for real
estate agency
*
* @package Joomla.Site
* @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;
/**
* Jea Utility helper
*
* @package Joomla.Site
* @subpackage com_jea
*
* @since 2.0
*/
abstract class JHtmlUtility
{
/**
* @var Joomla\Registry\Registry
*/
protected static $params = null;
/**
* Format price following the component configuration.
* If price is empty, return a default string value.
*
* @param float|int $price The price as number
* @param string $default Default value if price equals 0
*
* @return string
*/
public static function formatPrice($price = 0, $default = '')
{
$params = self::getParams();
if (! empty($price))
{
$currency_symbol = $params->get('currency_symbol',
'€');
$price = self::formaNumber($price);
// Is currency symbol before or after price ?
if ($params->get('symbol_position', 1))
{
$price = $price . ' ' . $currency_symbol;
}
else
{
$price = $currency_symbol . ' ' . $price;
}
return $price;
}
else
{
return $default;
}
}
/**
* Format surface following the component configuration.
* If surface is empty, return a default string value.
*
* @param float|int $surface The surface as number
* @param string $default Default value if surface equals 0
*
* @return string
*/
public static function formatSurface($surface = 0, $default =
'')
{
$params = self::getParams();
if (!empty($surface))
{
$surfaceMeasure = $params->get('surface_measure',
'm²');
$surface = self::formaNumber($surface);
return $surface . ' ' . $surfaceMeasure;
}
return $default;
}
/**
* Format number following the component configuration.
*
* @param float|int $number The number to format
*
* @return string
*/
public static function formaNumber($number = O)
{
$params = self::getParams();
$number = (float) $number;
$decimal_separator = $params->get('decimals_separator',
',');
$thousands_separator = $params->get('thousands_separator',
' ');
$decimals = (int) $params->get('decimals_number',
'0');
return number_format($number, $decimals, $decimal_separator,
$thousands_separator);
}
/**
* Get JEA params
*
* @return Joomla\Registry\Registry
*/
protected static function getParams()
{
if (self::$params == null)
{
self::$params = JComponentHelper::getParams('com_jea');
}
return self::$params;
}
}
PK�h�[6����html/amenities.phpnu�[���<?php
/**
* This file is part of Joomla Estate Agency - Joomla! extension for real
estate agency
*
* @package Joomla.Site
* @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;
/**
* Jea Amenities HTML helper
*
* @package Joomla.Site
* @subpackage com_jea
*
* @since 2.0
*/
abstract class JHtmlAmenities
{
/**
* @var stdClass[]
*/
protected static $amenities = null;
/**
* Method to get an HTML list of amenities
*
* @param mixed $value string or array of amenities ids
* @param string $format The wanted format (ol, li, raw (default))
*
* @return string HTML for the list.
*/
static public function bindList($value = 0, $format = 'raw')
{
if (is_string($value) && !empty($value))
{
$ids = explode('-', $value);
}
elseif (empty($value))
{
$ids = array();
}
else
{
$ids = ArrayHelper::toInteger($value);
}
$html = '';
$amenities = self::getAmenities();
$items = array();
foreach ($amenities as $row)
{
if (in_array($row->id, $ids))
{
if ($format == 'ul')
{
$items[] = "<li>{$row->value}</li>\n";
}
else
{
$items[] = $row->value;
}
}
}
if ($format == 'ul')
{
$html = "<ul>\n" . implode("\n", $items) .
"</ul>\n";
}
else
{
$html = implode(', ', $items);
}
return $html;
}
/**
* Return HTML list of amenities as checkboxes
*
* @param array $values The checkboxes values
* @param string $name The attribute name for the checkboxes
* @param string $idSuffix An optional ID suffix for the checkboxes
*
* @return string Html list
*/
static public function checkboxes($values = array(), $name =
'amenities', $idSuffix = '')
{
$amenities = self::getAmenities();
$values = (array) $values;
$html = '';
if (!empty($amenities))
{
$html .= "<ul>\n";
foreach ($amenities as $row)
{
$checked = '';
$id = 'amenity' . $row->id . $idSuffix;
if (in_array($row->id, $values))
{
$checked = 'checked="checked"';
}
$html .= '<li><input name="' . $name .
'[]" id="' . $id . '"
type="checkbox" value="' . $row->id . '"
' . $checked . ' /> '
. '<label for="' . $id . '">' .
$row->value . '</label></li>' . "\n";
}
$html .= "</ul>";
}
return $html;
}
/**
* Get Jea amenities from database
*
* @return array An array of amenity row objects
*/
static public function getAmenities()
{
if (self::$amenities === null)
{
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select('a.id , a.value');
$query->from('#__jea_amenities AS a');
$query->where('a.language in (' .
$db->quote(JFactory::getLanguage()->getTag()) . ',' .
$db->quote('*') . ')');
$query->order('a.ordering');
$db->setQuery($query);
self::$amenities = $db->loadObjectList();
}
return self::$amenities;
}
}
PK�3�[�A�h�
�
associations.phpnu�[���<?php
/**
* @package Joomla.Administrator
* @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
*/
defined('_JEXEC') or die;
use Joomla\CMS\Association\AssociationExtensionHelper;
/**
* Content associations helper.
*
* @since 3.7.0
*/
class ContentAssociationsHelper extends AssociationExtensionHelper
{
/**
* The extension name
*
* @var array $extension
*
* @since 3.7.0
*/
protected $extension = 'com_content';
/**
* Array of item types
*
* @var array $itemTypes
*
* @since 3.7.0
*/
protected $itemTypes = array('article', 'category');
/**
* Has the extension association support
*
* @var boolean $associationsSupport
*
* @since 3.7.0
*/
protected $associationsSupport = true;
/**
* Get the associated items for an item
*
* @param string $typeName The item type
* @param int $id The id of item for which we need the
associated items
*
* @return array
*
* @since 3.7.0
*/
public function getAssociations($typeName, $id)
{
$type = $this->getType($typeName);
$context = $this->extension . '.item';
$catidField = 'catid';
if ($typeName === 'category')
{
$context = 'com_categories.item';
$catidField = '';
}
// Get the associations.
$associations = JLanguageAssociations::getAssociations(
$this->extension,
$type['tables']['a'],
$context,
$id,
'id',
'alias',
$catidField
);
return $associations;
}
/**
* Get item information
*
* @param string $typeName The item type
* @param int $id The id of item for which we need the
associated items
*
* @return JTable|null
*
* @since 3.7.0
*/
public function getItem($typeName, $id)
{
if (empty($id))
{
return null;
}
$table = null;
switch ($typeName)
{
case 'article':
$table = JTable::getInstance('Content');
break;
case 'category':
$table = JTable::getInstance('Category');
break;
}
if (is_null($table))
{
return null;
}
$table->load($id);
return $table;
}
/**
* Get information about the type
*
* @param string $typeName The item type
*
* @return array Array of item types
*
* @since 3.7.0
*/
public function getType($typeName = '')
{
$fields = $this->getFieldsTemplate();
$tables = array();
$joins = array();
$support = $this->getSupportTemplate();
$title = '';
if (in_array($typeName, $this->itemTypes))
{
switch ($typeName)
{
case 'article':
$support['state'] = true;
$support['acl'] = true;
$support['checkout'] = true;
$support['category'] = true;
$support['save2copy'] = true;
$tables = array(
'a' => '#__content'
);
$title = 'article';
break;
case 'category':
$fields['created_user_id'] = 'a.created_user_id';
$fields['ordering'] = 'a.lft';
$fields['level'] = 'a.level';
$fields['catid'] = '';
$fields['state'] = 'a.published';
$support['state'] = true;
$support['acl'] = true;
$support['checkout'] = true;
$support['level'] = true;
$tables = array(
'a' => '#__categories'
);
$title = 'category';
break;
}
}
return array(
'fields' => $fields,
'support' => $support,
'tables' => $tables,
'joins' => $joins,
'title' => $title
);
}
}
PK�3�[�ד��content.phpnu�[���<?php
/**
* @package Joomla.Administrator
* @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
*/
defined('_JEXEC') or die;
/**
* Content component helper.
*
* @since 1.6
*/
class ContentHelper extends JHelperContent
{
public static $extension = 'com_content';
/**
* Configure the Linkbar.
*
* @param string $vName The name of the active view.
*
* @return void
*
* @since 1.6
*/
public static function addSubmenu($vName)
{
JHtmlSidebar::addEntry(
JText::_('JGLOBAL_ARTICLES'),
'index.php?option=com_content&view=articles',
$vName == 'articles'
);
JHtmlSidebar::addEntry(
JText::_('COM_CONTENT_SUBMENU_CATEGORIES'),
'index.php?option=com_categories&extension=com_content',
$vName == 'categories'
);
JHtmlSidebar::addEntry(
JText::_('COM_CONTENT_SUBMENU_FEATURED'),
'index.php?option=com_content&view=featured',
$vName == 'featured'
);
if (JComponentHelper::isEnabled('com_fields') &&
JComponentHelper::getParams('com_content')->get('custom_fields_enable',
'1'))
{
JHtmlSidebar::addEntry(
JText::_('JGLOBAL_FIELDS'),
'index.php?option=com_fields&context=com_content.article',
$vName == 'fields.fields'
);
JHtmlSidebar::addEntry(
JText::_('JGLOBAL_FIELD_GROUPS'),
'index.php?option=com_fields&view=groups&context=com_content.article',
$vName == 'fields.groups'
);
}
}
/**
* Applies the content tag filters to arbitrary text as per settings for
current user group
*
* @param text $text The string to filter
*
* @return string The filtered string
*
* @deprecated 4.0 Use JComponentHelper::filterText() instead.
*/
public static function filterText($text)
{
try
{
JLog::add(
sprintf('%s() is deprecated. Use JComponentHelper::filterText()
instead', __METHOD__),
JLog::WARNING,
'deprecated'
);
}
catch (RuntimeException $exception)
{
// Informational log only
}
return JComponentHelper::filterText($text);
}
/**
* Adds Count Items for Category Manager.
*
* @param stdClass[] &$items The category objects
*
* @return stdClass[]
*
* @since 3.5
*/
public static function countItems(&$items)
{
$config = (object) array(
'related_tbl' => 'content',
'state_col' => 'state',
'group_col' => 'catid',
'relation_type' => 'category_or_group',
);
return parent::countRelations($items, $config);
}
/**
* Adds Count Items for Tag Manager.
*
* @param stdClass[] &$items The tag objects
* @param string $extension The name of the active view.
*
* @return stdClass[]
*
* @since 3.6
*/
public static function countTagItems(&$items, $extension)
{
$parts = explode('.', $extension);
$section = count($parts) > 1 ? $parts[1] : null;
$config = (object) array(
'related_tbl' => ($section === 'category' ?
'categories' : 'content'),
'state_col' => ($section === 'category' ?
'published' : 'state'),
'group_col' => 'tag_id',
'extension' => $extension,
'relation_type' => 'tag_assigments',
);
return parent::countRelations($items, $config);
}
/**
* Returns a valid section for articles. If it is not valid then null
* is returned.
*
* @param string $section The section to get the mapping for
*
* @return string|null The new section
*
* @since 3.7.0
*/
public static function validateSection($section)
{
if (JFactory::getApplication()->isClient('site'))
{
// On the front end we need to map some sections
switch ($section)
{
// Editing an article
case 'form':
// Category list view
case 'featured':
case 'category':
$section = 'article';
}
}
if ($section != 'article')
{
// We don't know other sections
return null;
}
return $section;
}
/**
* Returns valid contexts
*
* @return array
*
* @since 3.7.0
*/
public static function getContexts()
{
JFactory::getLanguage()->load('com_content',
JPATH_ADMINISTRATOR);
$contexts = array(
'com_content.article' =>
JText::_('COM_CONTENT'),
'com_content.categories' => JText::_('JCATEGORY')
);
return $contexts;
}
}
PK�3�[H����html/contentadministrator.phpnu�[���<?php
/**
* @package Joomla.Administrator
* @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
*/
defined('_JEXEC') or die;
use Joomla\Utilities\ArrayHelper;
JLoader::register('ContentHelper', JPATH_ADMINISTRATOR .
'/components/com_content/helpers/content.php');
/**
* Content HTML helper
*
* @since 3.0
*/
abstract class JHtmlContentAdministrator
{
/**
* Render the list of associated items
*
* @param integer $articleid The article item id
*
* @return string The language HTML
*
* @throws Exception
*/
public static function association($articleid)
{
// Defaults
$html = '';
// Get the associations
if ($associations =
JLanguageAssociations::getAssociations('com_content',
'#__content', 'com_content.item', $articleid))
{
foreach ($associations as $tag => $associated)
{
$associations[$tag] = (int) $associated->id;
}
// Get the associated menu items
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select('c.*')
->select('l.sef as lang_sef')
->select('l.lang_code')
->from('#__content as c')
->select('cat.title as category_title')
->join('LEFT', '#__categories as cat ON
cat.id=c.catid')
->where('c.id IN (' . implode(',',
array_values($associations)) . ')')
->where('c.id != ' . $articleid)
->join('LEFT', '#__languages as l ON
c.language=l.lang_code')
->select('l.image')
->select('l.title as language_title');
$db->setQuery($query);
try
{
$items = $db->loadObjectList('id');
}
catch (RuntimeException $e)
{
throw new Exception($e->getMessage(), 500, $e);
}
if ($items)
{
foreach ($items as &$item)
{
$text = $item->lang_sef ? strtoupper($item->lang_sef) :
'XX';
$url =
JRoute::_('index.php?option=com_content&task=article.edit&id='
. (int) $item->id);
$tooltip = htmlspecialchars($item->title, ENT_QUOTES,
'UTF-8') . '<br />' .
JText::sprintf('JCATEGORY_SPRINTF', $item->category_title);
$classes = 'hasPopover label label-association label-' .
$item->lang_sef;
$item->link = '<a href="' . $url . '"
title="' . $item->language_title . '"
class="' . $classes
. '" data-content="' . $tooltip . '"
data-placement="top">'
. $text . '</a>';
}
}
JHtml::_('bootstrap.popover');
$html = JLayoutHelper::render('joomla.content.associations',
$items);
}
return $html;
}
/**
* Show the feature/unfeature links
*
* @param integer $value The state value
* @param integer $i Row number
* @param boolean $canChange Is user allowed to change?
*
* @return string HTML code
*/
public static function featured($value = 0, $i = 0, $canChange = true)
{
JHtml::_('bootstrap.tooltip');
// Array of image, task, title, action
$states = array(
0 => array('unfeatured', 'articles.featured',
'COM_CONTENT_UNFEATURED', 'JGLOBAL_TOGGLE_FEATURED'),
1 => array('featured', 'articles.unfeatured',
'COM_CONTENT_FEATURED', 'JGLOBAL_TOGGLE_FEATURED'),
);
$state = ArrayHelper::getValue($states, (int) $value, $states[1]);
$icon = $state[0];
if ($canChange)
{
$html = '<a href="#" onclick="return
listItemTask(\'cb' . $i . '\',\'' . $state[1]
. '\')" class="btn btn-micro hasTooltip'
. ($value == 1 ? ' active' : '') . '"
title="' . JHtml::_('tooltipText', $state[3])
. '"><span class="icon-' . $icon .
'" aria-hidden="true"></span></a>';
}
else
{
$html = '<a class="btn btn-micro hasTooltip disabled'
. ($value == 1 ? ' active' : '') . '"
title="'
. JHtml::_('tooltipText', $state[2]) .
'"><span class="icon-' . $icon . '"
aria-hidden="true"></span></a>';
}
return $html;
}
}
PK�h�[o7��
�
html/utility.phpnu�[���PK�h�[6�����
html/amenities.phpnu�[���PK�3�[�A�h�
�
associations.phpnu�[���PK�3�[�ד��%content.phpnu�[���PK�3�[H����86html/contentadministrator.phpnu�[���PK��E