Файловый менеджер - Редактировать - /var/www/html/html.zip
Ðазад
PK ! ��q| overlay.phpnu �[��� <?php /** * @package Foundry * @copyright Copyright (C) Stack Ideas Sdn Bhd. All rights reserved. * @license GNU/GPL, see LICENSE.php * Foundry 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. * See COPYRIGHT.php for copyright notices and details. */ namespace Foundry\Html; defined('_JEXEC') or die('Unauthorized Access'); use Foundry\Html\Base; use Foundry\Libraries\Scripts; class Overlay extends Base { /** * Generates a grid's Upgrade to Pro overlay in backend * * @since 1.1.0 * @access public */ public function grid($buttonText = 'FD_UPGRADE_TO_PRO', $description = '', $upgradeUrl = '') { $theme = $this->getTemplate(); $theme->set('buttonText', $buttonText); $theme->set('description', $description); $theme->set('upgradeUrl', $upgradeUrl); $html = $theme->output('html/overlay/grid'); return $html; } /** * Generates a form's Upgrade to Pro overlay in backend * * @since 1.1.0 * @access public */ public function form($showOverlay = false, $buttonText = '', $upgradeUrl = '') { if (empty($buttonText)) { $buttonText = 'FD_UPGRADE_TO_PRO'; } $theme = $this->getTemplate(); $theme->set('showOverlay', $showOverlay); $theme->set('buttonText', $buttonText); $theme->set('upgradeUrl', $upgradeUrl); $html = $theme->output('html/overlay/form'); return $html; } } PK ! ��(� � panel.phpnu �[��� <?php /** * @package Foundry * @copyright Copyright (C) Stack Ideas Sdn Bhd. All rights reserved. * @license GNU/GPL, see LICENSE.php * Foundry 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. * See COPYRIGHT.php for copyright notices and details. */ namespace Foundry\Html; defined('_JEXEC') or die('Unauthorized Access'); use Foundry\Html\Base; class Panel extends Base { /** * Generates a panel heading used at the back end * * @since 1.0.0 * @access public */ public function heading($header, $description = '', $helpLink = '') { if (!$description && $description !== false) { $description = $header . '_DESC'; } $header = \JText::_($header); $description = \JText::_($description); if ($helpLink) { $helpLink = $this->fd->getDocumentationLink() . '/' . ltrim($helpLink, '/'); } $theme = $this->getTemplate(); $theme->set('header', $header); $theme->set('desc', $description); $theme->set('helpLink', $helpLink); $output = $theme->output('html/panel/heading'); return $output; } /** * Generates an info section within a panel * * @since 1.0.0 * @access public */ public function info($text, $link = '', $buttonText = '', $buttonSize = 'sm', $image = '', $imageSize = 64) { $text = \JText::_($text); $buttonText = \JText::_($buttonText); // Backwards compatibility if ($buttonSize === 'btn-sm') { $buttonSize = 'sm'; } $theme = $this->getTemplate(); $theme->set('image', $image); $theme->set('imageSize', $imageSize); $theme->set('buttonText', $buttonText); $theme->set('text', $text); $theme->set('link', $link); $theme->set('buttonSize', $buttonSize); $output = $theme->output('html/panel/info'); return $output; } } PK ! u��w� � filter.phpnu �[��� <?php /** * @package Foundry * @copyright Copyright (C) Stack Ideas Sdn Bhd. All rights reserved. * @license GNU/GPL, see LICENSE.php * Foundry 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. * See COPYRIGHT.php for copyright notices and details. */ namespace Foundry\Html; defined('_JEXEC') or die('Unauthorized Access'); use Foundry\Html\Base; use Foundry\Libraries\Stylesheets; use Foundry\Libraries\Scripts; class Filter extends Base { public function __construct($fd) { parent::__construct($fd); // We need the following dependencies from js Scripts::load('admin'); Scripts::load('select2'); } /** * Allow caller to pass in html codes to be added into the filter bar * * @since 1.0.0 * @access public */ public function custom($html) { Stylesheets::load('select2'); $theme = $this->getTemplate(); $theme->set('html', $html); $output = $theme->output('html/filter/custom'); return $output; } /** * Renders a dropdown to filter number of items per page * * @since 1.0.0 * @access public */ public function limit($selected = 5, $name = 'limit', $stepping = 5, $min = 5, $max = 100, $showAll = true, $options = []) { Stylesheets::load('select2'); $theme = $this->getTemplate(); $items = []; for ($i = $stepping; $i <= $max; $i = $i + $stepping) { $items[$i] = $i; } if ($showAll) { $items['all'] = \JText::_(\FH::normalize($options, 'showAllText', 'JALL')); } $theme->set('items', $items); $theme->set('selected', $selected); $theme->set('name', $name); $theme->set('showAll', $showAll); $contents = $theme->output('html/filter/limit'); return $contents; } /** * Renders a generic dropdown for filters * * @since 1.0.0 * @access public */ public function lists($name, $items = [], $selected = 'all', $options = []) { Stylesheets::load('select2'); $initial = \FH::normalize($options, 'initial', ''); $initialValue = \FH::normalize($options, 'initialValue', 'all'); $minWidth = \FH::normalize($options, 'minWidth', false); $identicalMatch = \FH::normalize($options, 'identicalMatch', false); $theme = $this->getTemplate(); $theme->set('identicalMatch', $identicalMatch); $theme->set('minWidth', $minWidth); $theme->set('initialValue', $initialValue); $theme->set('initial', $initial); $theme->set('name', $name); $theme->set('items', $items); $theme->set('selected', $selected); $contents = $theme->output('html/filter/lists'); return $contents; } /** * Renders the published dropdown list on the filter bar * * @since 1.0.0 * @access public */ public function published($name = 'state', $selected = 'all', $options = []) { Stylesheets::load('select2'); $selectText = \FH::normalize($options, 'selectText', 'JSELECT'); $publishedText = \FH::normalize($options, 'publishedText', 'JPUBLISHED'); $unpublishedText = \FH::normalize($options, 'unpublishedText', 'JUNPUBLISHED'); $valueType = \FH::normalize($options, 'valueType', 'letter'); $publishedValue = 'P'; $unpublishedValue = 'U'; if ($valueType === 'numeric') { $publishedValue = '1'; $unpublishedValue = '0'; } $theme = $this->getTemplate(); $theme->set('selectText', $selectText); $theme->set('name', $name); $theme->set('selected', $selected); $theme->set('publishedText', $publishedText); $theme->set('unpublishedText', $unpublishedText); $theme->set('publishedValue', $publishedValue); $theme->set('unpublishedValue', $unpublishedValue); $contents = $theme->output('html/filter/published'); return $contents; } /** * Renders a search box in the filter * * @since 1.0.0 * @access public */ public function search($value = '', $name = 'search', $options = []) { $tooltip = \FH::normalize($options, 'tooltip', ''); $placeholder = \FH::normalize($options, 'placeholder', 'JSEARCH_FILTER'); $theme = $this->getTemplate(); $theme->set('placeholder', $placeholder); $theme->set('tooltip', $tooltip); $theme->set('value', $value); $theme->set('name', $name); $contents = $theme->output('html/filter/search'); return $contents; } /** * Renders a space on the filters bar * * @since 1.0.0 * @access public */ public function spacer() { $theme = $this->getTemplate(); $contents = $theme->output('html/filter/spacer'); return $contents; } /** * Renders a date range filter * * @since 1.0.0 * @access public */ public function dateRange($selected = '', $name = 'dateRange', $placeholder = '', $options = []) { // Import the stylesheet Stylesheets::load('daterangepicker'); if (!$placeholder) { $placeholder = 'FD_SELECT_DATE_RANGE'; } $placeholder = \JText::_($placeholder); // Get today $start = false; $end = false; if ($selected && is_array($selected)) { $start = $selected['start']; $end = $selected['end']; } $class = \FH::normalize($options, 'class', ''); $appearance = \FH::normalize($options, 'appearance', 'light'); $accent = \FH::normalize($options, 'accent', 'foundry'); $submitonclick = \FH::normalize($options, 'submitonclick', true); $uid = uniqid(); $theme = $this->getTemplate(); $theme->set('uid', $uid); $theme->set('start', $start); $theme->set('end', $end); $theme->set('name', $name); $theme->set('class', $class); $theme->set('appearance', $appearance); $theme->set('accent', $accent); $theme->set('placeholder', $placeholder); $theme->set('selected', $selected); $theme->set('submitonclick', $submitonclick); $output = $theme->output('html/filter/daterange'); return $output; } }PK ! e�� � loader.phpnu �[��� <?php /** * @package Foundry * @copyright Copyright (C) Stack Ideas Sdn Bhd. All rights reserved. * @license GNU/GPL, see LICENSE.php * Foundry 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. * See COPYRIGHT.php for copyright notices and details. */ namespace Foundry\Html; defined('_JEXEC') or die('Unauthorized Access'); use Foundry\Html\Base; class Loader extends Base { /** * Renders an inline loader on the site * * @since 1.0.0 * @access public */ public function inline($options = []) { $class = \FH::normalize($options, 'class', ''); $themes = $this->getTemplate(); $themes->set('class', $class); $loader = $themes->output('html/loader/inline'); return $loader; } /** * Renders a loader on the site * * @since 1.0.0 * @access public */ public function block($options = []) { $class = \FH::normalize($options, 'class', ''); $loaderClass = \FH::normalize($options, 'loaderClass', ''); $themes = $this->getTemplate(); $themes->set('class', $class); $themes->set('loaderClass', $loaderClass); $loader = $themes->output('html/loader/block'); return $loader; } /** * Renders a standard loader on the site * * @since 1.1.3 * @access public */ public function standard($options = []) { $class = \FH::normalize($options, 'class', ''); $themes = $this->getTemplate(); $themes->set('class', $class); $loader = $themes->output('html/loader/standard'); return $loader; } } PK ! �cP P progress.phpnu �[��� <?php /** * @package Foundry * @copyright Copyright (C) Stack Ideas Sdn Bhd. All rights reserved. * @license GNU/GPL, see LICENSE.php * Foundry 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. * See COPYRIGHT.php for copyright notices and details. */ namespace Foundry\Html; defined('_JEXEC') or die('Unauthorized Access'); use Foundry\Html\Base; class Progress extends Base { /** * Renders a progress bar * * @since 1.1.4 * @access public */ public function bar($progress = 0) { $theme = $this->getTemplate(); $theme->set('progress', $progress); $output = $theme->output('html/progress/bar'); return $output; } }PK ! S��� � icon.phpnu �[��� <?php /** * @package Foundry * @copyright Copyright (C) Stack Ideas Sdn Bhd. All rights reserved. * @license GNU/GPL, see LICENSE.php * Foundry 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. * See COPYRIGHT.php for copyright notices and details. */ namespace Foundry\Html; defined('_JEXEC') or die('Unauthorized Access'); use Foundry\Html\Base; use Foundry\Libraries\Scripts; class Icon extends Base { /** * Renders a font icon on the page * * @since 1.0.0 * @access public */ public function font($icon, $iconLoading = false, $customLoadingIcon = '', $options = []) { static $icons = []; $index = $icon . $iconLoading . $customLoadingIcon; if (!isset($icons[$index])) { $icon = 'fdi ' . $icon; $class = \FH::normalize($options, 'class', ''); $theme = $this->getTemplate(); $theme->set('icon', $icon); $theme->set('iconLoading', $iconLoading); $theme->set('customLoadingIcon', $customLoadingIcon); $theme->set('class', $class); $icons[$index] = $theme->output('html/icon/font'); } return $icons[$index]; } } PK ! ��q�| | alert.phpnu �[��� <?php /** * @package Foundry * @copyright Copyright (C) Stack Ideas Sdn Bhd. All rights reserved. * @license GNU/GPL, see LICENSE.php * Foundry 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. * See COPYRIGHT.php for copyright notices and details. */ namespace Foundry\Html; defined('_JEXEC') or die('Unauthorized Access'); use Foundry\Html\Base; use Foundry\Libraries\Scripts; class Alert extends Base { /** * Renders the standard alert with foundry. Supports the following classes: * * success, info, warning and danger * * @since 1.0.0 * @access public */ public function standard($text, $class = 'info', $options = []) { Scripts::load('shared'); $allowed = ['success', 'info', 'warning', 'danger']; if (!in_array($class, $allowed)) { $class = 'info'; } $icon = \FH::normalize($options, 'icon', ''); $dismissible = \FH::normalize($options, 'dismissible', true); $button = \FH::normalize($options, 'button', null); $attributes = \FH::normalize($options, 'attributes', ''); $customClass = \FH::normalize($options, 'customClass', ''); $theme = $this->getTemplate(); $theme->set('customClass', $customClass); $theme->set('dismissible', $dismissible); $theme->set('text', $text); $theme->set('class', $class); $theme->set('icon', $icon); $theme->set('button', $button); $theme->set('attributes', $attributes); $output = $theme->output('html/alert/standard'); return $output; } /** * Renders extended alert with foundry to display text, icon, close and buton. Supports the following classes: * * success, info, warning and danger * * @since 1.0.0 * @access public */ public function extended($title, $description = null, $class = 'info', $options = []) { Scripts::load('shared'); $allowed = ['success', 'info', 'warning', 'danger']; if (!in_array($class, $allowed)) { $class = 'info'; } $icon = \FH::normalize($options, 'icon', null); $button = \FH::normalize($options, 'button', null); $dismissible = \FH::normalize($options, 'dismissible', true); $customClass = \FH::normalize($options, 'class', ''); $theme = $this->getTemplate(); $theme->set('icon', $icon); $theme->set('button', $button); $theme->set('dismissible', $dismissible); $theme->set('title', $title); $theme->set('description', $description); $theme->set('class', $class); $theme->set('customClass', $customClass); $output = $theme->output('html/alert/extended'); return $output; } }PK ! :��c c button.phpnu �[��� <?php /** * @package Foundry * @copyright Copyright (C) Stack Ideas Sdn Bhd. All rights reserved. * @license GNU/GPL, see LICENSE.php * Foundry 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. * See COPYRIGHT.php for copyright notices and details. */ namespace Foundry\Html; defined('_JEXEC') or die('Unauthorized Access'); use Foundry\Html\Base; class Button extends Base { /** * Renders a social button on the page based on the type given * * @since 1.0.0 * @access public */ private function social($type, $icon, $text, $size = 'sm', $options = []) { $url = \FH::normalize($options, 'url', 'javascript:void(0);'); $attributes = \FH::normalize($options, 'attributes', ''); $class = \FH::normalize($options, 'class', ''); $block = \FH::normalize($options, 'block', false); $imageIcon = \FH::normalize($options, 'imageIcon', false); $iconOnly = \FH::normalize($options, 'iconOnly', false); // Ensure that it is translated $text = \JText::_($text); $theme = $this->getTemplate(); $theme->set('iconOnly', $iconOnly); $theme->set('size', $size); $theme->set('type', $type); $theme->set('icon', $icon); $theme->set('text', $text); $theme->set('attributes', $attributes); $theme->set('url', $url); $theme->set('class', $class); $theme->set('block', $block); $theme->set('imageIcon', $imageIcon); return $theme->output('html/button/social'); } /** * Renders a sign in with Apple button * * @since 1.0.0 * @access public */ public function apple($text = '', $options = [], $size = 'sm') { if ($text === '') { $text = 'FD_SIGN_IN_WITH_APPLE'; } $mode = \FH::normalize($options, 'mode', 'light'); $options['class'] = $mode === 'light' ? 'o-btn--apple--l' : 'o-btn--apple--d'; return $this->social('apple', 'fdi fab fa-apple', $text, $size, $options); } /** * Renders an e-mail social button * * @since 1.1.3 * @access public */ public function email($text = '', $options = [], $size = 'sm') { return $this->social('email', 'fdi fa fa-fw fa-envelope mr-2xs', $text, $size, $options); } /** * Renders a sign in with Facebook button * * @since 1.0.0 * @access public */ public function facebook($text = '', $options = [], $size = 'sm') { if ($text === '') { $text = 'FD_SIGN_IN_WITH_FB'; } // Backward compatibility $authorizedUrl = \FH::normalize($options, 'authorizedUrl', 'javascript:void(0);'); $options['url'] = $authorizedUrl; return $this->social('facebook', 'fdi fab fa-facebook', $text, $size, $options); } /** * Renders a sign in with Google button * * @since 1.0.0 * @access public */ public function google($text = '', $options = [], $size = 'sm') { if ($text === '') { $text = 'FD_SIGN_IN_WITH_GOOGLE'; } $options['imageIcon'] = FD_URI_MEDIA . '/images/logo-google.svg'; return $this->social('google', false, $text, $size, $options); } /** * Renders a sign in with LinkedIn button * * @since 1.0.0 * @access public */ public function linkedin($text = '', $options = [], $size = 'sm') { if ($text === '') { $text = 'FD_SIGN_IN_WITH_LINKEDIN'; } return $this->social('linkedin', 'fdi fab fa-linkedin', $text, $size, $options); } /** * Renders a sign in with Pinterest button * * @since 1.0.0 * @access public */ public function pinterest($text = '', $options = [], $size = 'sm') { return $this->social('pinterest', 'fdi fab fa-pinterest', $text, $size, $options); } /** * Renders a Pocket button * * @since 1.0.0 * @access public */ public function pocket($text = '', $options = [], $size = 'sm') { return $this->social('pocket', 'fdi fab fa-get-pocket', $text, $size, $options); } /** * Renders a Reddit button * * @since 1.0.0 * @access public */ public function reddit($text = '', $options = [], $size = 'sm') { return $this->social('reddit', 'fdi fab fa-reddit', $text, $size, $options); } /** * Renders a hyperlink that behaves like a button * * @since 1.0.0 * @access public */ public function link($link, $text, $class = 'default', $size = 'default', $options = [], $newWindow = false) { if (is_null($link)) { $link = 'javascript:void(0);'; } $options = array_merge($options, [ 'type' => 'link', 'link' => $link ]); if ($newWindow) { $options['attributes'] = \FH::normalize($options, 'attributes', ''); $options['attributes'] .= ' target="_blank"'; } return $this->standard($text, $class, $size, $options); } /** * Renders a submit button on the page * * @since 1.0.0 * @access public */ public function submit($text, $class = 'default', $size = 'default', $options = []) { $options = array_merge($options, [ 'type' => 'submit' ]); return $this->standard($text, $class, $size, $options); } /** * Renders a standard button on the page * * @since 1.0.0 * @access public */ public function standard($text, $class = 'default', $size = 'default', $options = []) { $icon = \FH::normalize($options, 'icon', null); $attributes = \FH::normalize($options, 'attributes', \FH::normalize($options, 'attr', '')); $link = \FH::normalize($options, 'link', ''); $type = \FH::normalize($options, 'type', 'standard'); $outline = \FH::normalize($options, 'outline', false); $ghost = \FH::normalize($options, 'ghost', false); $block = \FH::normalize($options, 'block', false); $extraClass = \FH::normalize($options, 'class', ''); $iconOnly = \FH::normalize($options, 'iconOnly', false); // Normalize the button type if (!in_array($type, ['standard', 'link', 'submit'])) { $type = 'standard'; } // Normalize the button class if (!in_array($class, ['default', 'override', 'primary', 'success', 'info', 'warning', 'danger'])) { $class = 'default'; } // Normalize the button sizes if (!in_array($size, ['custom', 'xs', 'sm', 'md', 'lg', 'xl', '2xl'])) { $size = 'md'; } if ($outline) { $class .= '-o'; } if ($ghost) { $class .= '-ghost'; } $text = \JText::_($text); $namespace = 'standard'; if ($type === 'link') { $namespace = 'link'; } $theme = $this->getTemplate(); $theme->set('iconOnly', $iconOnly); $theme->set('type', $type); $theme->set('size', $size); $theme->set('block', $block); $theme->set('extraClass', $extraClass); $theme->set('attributes', $attributes); $theme->set('icon', $icon); $theme->set('link', $link); $theme->set('text', $text); $theme->set('class', $class); $namespace = 'html/button/' . $namespace; return $theme->output($namespace); } /** * Renders a sign in with Twitter button * * @since 1.0.0 * @access public */ public function twitter($text = '', $options = [], $size = 'sm') { if ($text === '') { $text = 'FD_SIGN_IN_WITH_TWITTER'; } return $this->social('twitter', 'fdi fab fa-twitter', $text, $size, $options); } /** * Renders a sign in with Twitch button * * @since 1.0.0 * @access public */ public function twitch($text = '', $options = [], $size = 'sm') { return $this->social('twitch', 'fdi fab fa-twitch', $text, $size, $options); } /** * Renders a vk button * * @since 1.0.0 * @access public */ public function vk($text = '', $options = [], $size = 'sm') { return $this->social('vk', 'fdi fab fa-vk', $text, $size, $options); } /** * Renders a xing button * * @since 1.0.0 * @access public */ public function xing($text = '', $options = [], $size = 'sm') { return $this->social('xing', 'fdi fab fa-xing', $text, $size, $options); } } PK ! ���� � html.phpnu �[��� <?php /** * @package Foundry * @copyright Copyright (C) Stack Ideas Sdn Bhd. All rights reserved. * @license GNU/GPL, see LICENSE.php * Foundry 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. * See COPYRIGHT.php for copyright notices and details. */ namespace Foundry\Html; defined('_JEXEC') or die('Unauthorized Access'); use Foundry\Html\Base; use Foundry\Libraries\Scripts; class Html extends Base { /** * Renders the empty state * * @since 1.0.0 * @access public */ public function emptyList($message, $options = []) { $class = \FH::normalize($options, 'class', ''); $icon = \FH::normalize($options, 'icon', ''); $attributes = \FH::normalize($options, 'attributes', \FH::normalize($options, 'attr')); $action = \FH::normalize($options, 'action', false); $actionLink = \FH::normalize($options, 'actionLink', 'javascript:void(0);'); $actionMessage = \FH::normalize($options, 'actionMessage', ''); $themes = $this->getTemplate(); $themes->set('icon', $icon); $themes->set('class', $class); $themes->set('message', $message); $themes->set('attributes', $attributes); $themes->set('action', $action); $themes->set('actionLink', $actionLink); $themes->set('actionMessage', $actionMessage); $output = $themes->output('html/html/empty.list'); return $output; } /** * Renders name of the object * * @since 1.0.0 * @access public */ public function name($name, $options = []) { $useAnchorTag = \FH::normalize($options, 'useAnchorTag', true); $permalink = \FH::normalize($options, 'permalink', 'javascript:void(0);'); $verified = \FH::normalize($options, 'verified', false); $attributes = \FH::normalize($options, 'attributes', \FH::normalize($options, 'attr')); $class = \FH::normalize($options, 'class', ''); $theme = $this->getTemplate(); $theme->set('class', $class); $theme->set('name', $name); $theme->set('useAnchorTag', $useAnchorTag); $theme->set('permalink', $permalink); $theme->set('verified', $verified); $theme->set('attributes', $attributes); $output = $theme->output('html/html/name'); return $output; } /** * Renders the tooltip markup * * @since 1.0.0 * @access public */ public function tooltip($appearance = 'light', $accent = 'foundry') { static $isLoaded = false; // Return nothing when it has been loaded on the page once if ($isLoaded) { return ''; } Scripts::load('popper'); Scripts::load('tippy'); $theme = $this->getTemplate(); $theme->set('appearance', $appearance); $theme->set('accent', $accent); $tooltip = $theme->output('html/html/tooltip'); $isLoaded = true; return $tooltip; } /** * Renders the popover markup * * @since 1.0.0 * @access public */ public function popover($appearance = 'light', $accent = 'foundry') { static $isLoaded = false; // Return nothing when it has been loaded on the page once if ($isLoaded) { return ''; } Scripts::load('popper'); Scripts::load('tippy'); $theme = $this->getTemplate(); $theme->set('appearance', $appearance); $theme->set('accent', $accent); $output = $theme->output('html/html/popover'); $isLoaded = true; return $output; } /** * Renders a well container for text * * @since 1.1.3 * @access public */ public function well($contents, $options = []) { $class = \FH::normalize($options, 'class', ''); $theme = $this->getTemplate(); $theme->set('contents', $contents); $theme->set('class', $class); $output = $theme->output('html/html/well'); return $output; } }PK ! x�� � email.phpnu �[��� <?php /** * @package Foundry * @copyright Copyright (C) Stack Ideas Sdn Bhd. All rights reserved. * @license GNU/GPL, see LICENSE.php * Foundry 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. * See COPYRIGHT.php for copyright notices and details. */ namespace Foundry\Html; defined('_JEXEC') or die('Unauthorized Access'); use Foundry\Html\Base; class Email extends Base { /** * Generates an attachment in the e-mail content * * @since 1.1.2 * @access public */ public function attachment($link, $title) { $theme = $this->getTemplate(); $theme->set('link', $link); $theme->set('title', $title); $html = $theme->output('html/email/attachment'); return $html; } /** * Generates a blog post preview * * @since 1.0.0 * @access public */ public function blog($title, $content, $date = '', $authorName = '', $authorLink = '', $authorAvatar = '') { $author = false; if ($authorName) { $author = (object) [ 'name' => $authorName, 'link' => $authorLink, 'avatar' => $authorAvatar ]; } $theme = $this->getTemplate(); $theme->set('author', $author); $theme->set('date', $date); $theme->set('title', $title); $theme->set('content', $content); $html = $theme->output('html/email/blog'); return $html; } /** * Generates a blog post preview * * @since 1.1.2 * @access public */ public function comment($comment, $date = '', $authorName = '', $authorLink = 'javascript:void(0)') { $author = false; if ($authorName) { $author = (object) [ 'name' => $authorName, 'link' => $authorLink ]; } $theme = $this->getTemplate(); $theme->set('author', $author); $theme->set('date', $date); $theme->set('comment', $comment); $html = $theme->output('html/email/comment'); return $html; } /** * Generates a button in the e-mail template * * @since 1.0.0 * @access public */ public function button($text, $link, $style = 'default') { $allowedStyles = [ 'primary', 'danger', 'default' ]; $buttonColors = [ 'primary' => [ 'background' => '#4e72e2', 'text' => '#fff', 'border' => false ], 'danger' => [ 'background' => '#d9534f', 'text' => '#fff', 'border' => false ], 'default' => [ 'background' => '#fff', 'text' => '#4e72e2', 'border' => '#E1E4ED' ] ]; $buttonColor = $buttonColors['default']; if (in_array($style, $allowedStyles)) { $buttonColor = (object) $buttonColors[$style]; } $theme = $this->getTemplate(); $theme->set('text', $text); $theme->set('link', $link); $theme->set('buttonColor', $buttonColor); $html = $theme->output('html/email/button'); return $html; } /** * Generates a standard content with wrapper for e-mails * * @since 1.0.0 * @access public */ public function content($content, $style = 'clear', $options = []) { $content = \JText::_($content); $previewContent = \FH::normalize($options, 'previewContent', 'Lorem Ipsum is simply dummy text of the printing'); $spacer = \FH::normalize($options, 'spacer', true); $theme = $this->getTemplate(); $theme->set('content', $content); $theme->set('spacer', $spacer); $namespace = 'content.' . $style; $html = $theme->output('html/email/' . $namespace); return $html; } /** * Generates the divider section of an e-mail * * @since 1.0.0 * @access public */ public function divider() { static $html = null; if (is_null($html)) { $theme = $this->getTemplate(); $html = $theme->output('html/email/divider'); } return $html; } /** * Generates the heading section of an e-mail * * @since 1.0.0 * @access public */ public function heading($title, $subtitle = '') { $title = \JText::_($title); $subtitle = \JText::_($subtitle); $theme = $this->getTemplate(); $theme->set('title', $title); $theme->set('subtitle', $subtitle); $html = $theme->output('html/email/heading'); return $html; } /** * Generates the logo section of an e-mail * * @since 1.0.0 * @access public */ public function logo($logo) { static $html = null; if (is_null($html)) { $theme = $this->getTemplate(); $theme->set('logo', $logo); $html = $theme->output('html/email/logo'); } return $html; } /** * Generates a section heading in an e-mail * * @since 1.0.0 * @access public */ public function sectionHeading($title, $subtitle = '') { $theme = $this->getTemplate(); $theme->set('title', $title); $theme->set('subtitle', $subtitle); $html = $theme->output('html/email/section.heading'); return $html; } /** * Generates the logo section of an e-mail * * @since 1.0.0 * @access public */ public function spacer() { static $html = null; if (is_null($html)) { $theme = $this->getTemplate(); $html = $theme->output('html/email/spacer'); } return $html; } /** * Generates the date string section used in digest email * * @since 1.0.0 * @access public */ public function digestDate($datestr = '') { if (!$datestr) { $datestr = \FH::date()->format('l, d F Y'); } $theme = $this->getTemplate(); $theme->set('datestring', $datestr); $html = $theme->output('html/email/digest.date'); return $html; } /** * Generates the digest item used in digest email * * @since 1.0.0 * @access public */ public function digestItem($title, $content = '', $options = []) { $title = \JText::_($title); $content = \JText::_($content); $icon = \FH::normalize($options, 'icon', false); $divider = \FH::normalize($options, 'divider', false); $theme = $this->getTemplate(); $theme->set('title', $title); $theme->set('content', $content); $theme->set('icon', $icon); $theme->set('divider', $divider); $html = $theme->output('html/email/digest.item'); return $html; } /** * Generates the unsubscribe link in email * * @since 1.0.0 * @access public */ public function unsubscribe($unsubcribeLink, $linkLabel = null, $text = null) { if (!$linkLabel) { $linkLabel = 'FD_EMAILS_UNSUBSCRIBE_LINK_LABEL'; } // if calller pass in an empty string, this mean caller do now want to display the text. // so we will use is_null to test against the string. if (is_null($text)) { $text = 'FD_EMAILS_UNSUBSCRIBE_TEXT'; } $text = \JText::_($text); $linkLabel = \JText::_($linkLabel); $theme = $this->getTemplate(); $theme->set('unsubcribeLink', $unsubcribeLink); $theme->set('linkLabel', $linkLabel); $theme->set('text', $text); $html = $theme->output('html/email/unsubscribe'); return $html; } }PK ! C<|M giphy.phpnu �[��� <?php /** * @package Foundry * @copyright Copyright (C) Stack Ideas Sdn Bhd. All rights reserved. * @license GNU/GPL, see LICENSE.php * Foundry 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. * See COPYRIGHT.php for copyright notices and details. */ namespace Foundry\Html; defined('_JEXEC') or die('Unauthorized Access'); use Foundry\Html\Base; class Giphy extends Base { /** * Renders the GIPHY browser markup * * @since 1.1.2 * @access public */ public function browser($options = []) { $appearance = \FH::normalize($options, 'appearance', 'light'); $accent = \FH::normalize($options, 'theme', 'foundry'); $theme = $this->getTemplate(); $theme->set('accent', $accent); $theme->set('appearance', $appearance); $output = $theme->output('html/giphy/browser'); return $output; } /** * Renders the GIPHY list markup * * @since 1.1.2 * @access public */ public function list($items, $type) { $themes = $this->getTemplate(); $themes->set('giphies', $items); $themes->set('type', $type); $output = $themes->output('html/giphy/list'); return $output; } /** * Renders the GIPHY item markup * * @since 1.1.2 * @access public */ public function item($url) { $themes = $this->getTemplate(); $themes->set('url', $url); $output = $themes->output('html/giphy/item'); return $output; } }PK ! �q�H H rank.phpnu �[��� <?php /** * @package Foundry * @copyright Copyright (C) Stack Ideas Sdn Bhd. All rights reserved. * @license GNU/GPL, see LICENSE.php * Foundry 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. * See COPYRIGHT.php for copyright notices and details. */ namespace Foundry\Html; defined('_JEXEC') or die('Unauthorized Access'); use Foundry\Html\Base; class Rank extends Base { /** * Renders a progress bar * * @since 1.1.4 * @access public */ public function bar($progress = 0) { $theme = $this->getTemplate(); $theme->set('progress', $progress); $output = $theme->output('html/rank/bar'); return $output; } }PK ! ���ؕ � base.phpnu �[��� <?php /** * @package Foundry * @copyright Copyright (C) Stack Ideas Sdn Bhd. All rights reserved. * @license GNU/GPL, see LICENSE.php * Foundry 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. * See COPYRIGHT.php for copyright notices and details. */ namespace Foundry\Html; defined('_JEXEC') or die('Unauthorized Access'); use Foundry\Libraries\Themes; class Base { protected $fd = null; public function __construct($fd) { $this->fd = $fd; } /** * Central method to generate a new theme object so that we can centralize and inject variables into the library * * @since 1.0.0 * @access public */ public function getTemplate() { $theme = new Themes($this->fd); return $theme; } } PK ! ��~a a avatar.phpnu �[��� <?php /** * @package Foundry * @copyright Copyright (C) Stack Ideas Sdn Bhd. All rights reserved. * @license GNU/GPL, see LICENSE.php * Foundry 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. * See COPYRIGHT.php for copyright notices and details. */ namespace Foundry\Html; defined('_JEXEC') or die('Unauthorized Access'); use Foundry\Html\Base; class Avatar extends Base { /** * Centralized method of retrieving the html output of the avatar * * @since 1.0.0 * @access private */ private function render($url, $size, $useAnchorTag, $options = []) { $sizes = [ 'xs' => 16, 'sm' => 24, 'md' => 32, 'lg' => 64, 'xl' => 120, 'default' => 40 ]; // Ensure that the size provided, truly exists if (!in_array($size, array_keys($sizes))) { $size = 'default'; } $name = \FH::normalize($options, 'name', ''); $permalink = \FH::normalize($options, 'permalink', 'javascript:void(0)'); $attributes = \FH::normalize($options, 'attributes', ''); $anchorAttributes = \FH::normalize($options, 'anchorAttributes', ''); $tooltip = \FH::normalize($options, 'tooltip', false); $isOnline = \FH::normalize($options, 'isOnline', false); $isMobile = \FH::normalize($options, 'isMobile', false); $showOnlineState = \FH::normalize($options, 'showOnlineState', false); $class = \FH::normalize($options, 'class', ''); $fallback = \FH::normalize($options, 'fallback', null); $wrapperAttributes = \FH::normalize($options, 'wrapperAttributes', null); // Allow caller to force a style $avatarStyle = \FH::normalize($options, 'style', 'rounded'); $style = ''; $class .= $size == 'default' ? '' : ' o-avatar--' . $size; $width = $sizes[$size]; $height = $sizes[$size]; if ($avatarStyle === 'rounded') { $style = 'o-avatar--rounded'; } if ($showOnlineState) { $isOnline = $isOnline ? ' is-online' : ' is-offline'; $isMobile = $isMobile ? ' is-mobile' : ''; $class .= $isOnline . $isMobile; } $theme = $this->getTemplate(); $theme->set('style', $style); $theme->set('url', $url); $theme->set('class', $class); $theme->set('name', $name); $theme->set('useAnchorTag', $useAnchorTag); $theme->set('anchorAttributes', $anchorAttributes); $theme->set('permalink', $permalink); $theme->set('attributes', $attributes); $theme->set('tooltip', $tooltip); $theme->set('width', $width); $theme->set('height', $height); $theme->set('isOnline', $isOnline); $theme->set('isMobile', $isMobile); $theme->set('fallback', $fallback); $theme->set('wrapperAttributes', $wrapperAttributes); $output = $theme->output('html/avatar/default'); return $output; } /** * Renders the extra small avatar * * @since 1.0.0 * @access public */ public function xs($url, $useAnchorTag = true, $options = []) { return $this->render($url, __FUNCTION__, $useAnchorTag, $options); } /** * Renders the avatar of the user * * @since 1.0.0 * @access public */ public function sm($url, $useAnchorTag = true, $options = []) { return $this->render($url, __FUNCTION__, $useAnchorTag, $options); } /** * Renders the medium avatar * * @since 1.0.0 * @access public */ public function md($url, $useAnchorTag = true, $options = []) { return $this->render($url, __FUNCTION__, $useAnchorTag, $options); } /** * Renders the large avatar * * @since 1.0.0 * @access public */ public function lg($url, $useAnchorTag = true, $options = []) { return $this->render($url, __FUNCTION__, $useAnchorTag, $options); } /** * Renders the extra large avatar * * @since 1.0.0 * @access public */ public function xl($url, $useAnchorTag = true, $options = []) { return $this->render($url, __FUNCTION__, $useAnchorTag, $options); } /** * Renders the default avatar * * @since 1.0.0 * @access public */ public function default($url, $useAnchorTag = true, $options = []) { return $this->render($url, __FUNCTION__, $useAnchorTag, $options); } } PK ! �z�� snackbar.phpnu �[��� <?php /** * @package Foundry * @copyright Copyright (C) Stack Ideas Sdn Bhd. All rights reserved. * @license GNU/GPL, see LICENSE.php * Foundry 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. * See COPYRIGHT.php for copyright notices and details. */ namespace Foundry\Html; defined('_JEXEC') or die('Unauthorized Access'); use Foundry\Html\Base; class Snackbar extends Base { /** * Renders a standard snackbar * * @since 1.1.3 * @access public */ public function standard($text, $actions = [], $options = []) { $attributes = \FH::normalize($options, 'attributes', ''); $textClass = \FH::normalize($options, 'textClass', 'text-gray-800'); $wrapperClass = \FH::normalize($options, 'wrapperClass', ''); if (is_callable($text)) { $text = $text(); } if (is_callable($actions)) { $actions = $actions(); } $theme = $this->getTemplate(); $theme->set('wrapperClass', $wrapperClass); $theme->set('actions', $actions); $theme->set('text', $text); $theme->set('textClass', $textClass); return $theme->output('html/snackbar/standard'); } } PK ! %(�x x tabs.phpnu �[��� <?php /** * @package Foundry * @copyright Copyright (C) Stack Ideas Sdn Bhd. All rights reserved. * @license GNU/GPL, see LICENSE.php * Foundry 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. * See COPYRIGHT.php for copyright notices and details. */ namespace Foundry\Html; defined('_JEXEC') or die('Unauthorized Access'); use Foundry\Html\Base; use Foundry\Libraries\Scripts; class Tabs extends Base { /** * Generates tabs for the back-end * * @since 1.1.2 * @access public */ public function render($tabs, $style = 'line', $position = 'horizontal', $options = []) { Scripts::load('shared'); $tabHeaderClass = \FH::normalize($options, 'tabHeaderClass', ''); $tabHeaderItemClass = \FH::normalize($options, 'tabHeaderItemClass', ''); $tabContentClass = \FH::normalize($options, 'tabContentClass', ''); $tabContentItemClass = \FH::normalize($options, 'tabContentItemClass', ''); // Style supports pill and line if (!in_array($style, ['line', 'pill'])) { $style = 'line'; } // Position supports horizontal and vertical if (!in_array($position, ['horizontal', 'vertical'])) { $position = 'horizontal'; } $theme = $this->getTemplate(); $theme->set('tabs', $tabs); $theme->set('style', $style); $theme->set('position', $position); $theme->set('tabHeaderClass', $tabHeaderClass); $theme->set('tabHeaderItemClass', $tabHeaderItemClass); $theme->set('tabContentClass', $tabContentClass); $theme->set('tabContentItemClass', $tabContentItemClass); $html = $theme->output('html/tabs/render'); return $html; } /** * Generates tabs for the back-end * * @since 1.1.2 * @access public */ public function item($id, $label, $contentsCallback, $active = false) { Scripts::load('shared'); $tab = (object) [ 'id' => $id, 'label' => $label, 'active' => $active ]; ob_start(); $contentsCallback(); $tab->contents = ob_get_contents(); ob_end_clean(); return $tab; } } PK ! ��D�} } adminwidgets.phpnu �[��� <?php /** * @package Foundry * @copyright Copyright (C) Stack Ideas Sdn Bhd. All rights reserved. * @license GNU/GPL, see LICENSE.php * Foundry 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. * See COPYRIGHT.php for copyright notices and details. */ namespace Foundry\Html; defined('_JEXEC') or die('Unauthorized Access'); use Foundry\Html\Base; use Foundry\Libraries\Scripts; class AdminWidgets extends Base { /** * Generates recent comments widget at the backend * * @since 1.1.0 * @access public */ public function comments($comments, $emptyText = 'FD_NO_COMMENTS_YET') { // Comment properties must consist of // // $comment->authorLink - Link to the author // $comment->authorName - Name of the author // $comment->permalink - Permalink to the comment item // $comment->itemTitle - Title of the article // $comment->created - Posted date $theme = $this->getTemplate(); $theme->set('comments', $comments); $theme->set('emptyText', $emptyText); $html = $theme->output('html/admin.widgets/comments'); return $html; } /** * Generates news widget on the dashboard * * @since 1.1.0 * @access public */ public function news() { Scripts::load('admin'); $theme = $this->getTemplate(); $html = $theme->output('html/admin.widgets/news'); return $html; } /** * Generates statistics widget at the backend * * @since 1.1.0 * @access public */ public function statistics($title, $description, $items) { if (!$description) { $description = $title . '_DESC'; } $theme = $this->getTemplate(); $theme->set('title', $title); $theme->set('description', $description); $theme->set('items', $items); $html = $theme->output('html/admin.widgets/statistics'); return $html; } /** * Generates tabs for the back-end * * @since 1.1.0 * @access public */ public function tabs($tabs) { // In order for EasyBlog dashboard widget to operate correctly, this is a duplicate of tabs.render Scripts::load('shared'); // Tab properties must contain the following: // - id // - title // - active (bool) $theme = $this->getTemplate(); $theme->set('tabs', $tabs); $html = $theme->output('html/admin.widgets/tabs'); return $html; } /** * Generates versioning widget on the dashboard * * @since 1.1.0 * @access public */ public function version($apiKey, $installedVersion, $apiUrl, $updateTaskUrl) { Scripts::load('admin'); $theme = $this->getTemplate(); $theme->set('apiKey', $apiKey); $theme->set('apiUrl', $apiUrl); $theme->set('installedVersion', $installedVersion); $theme->set('updateTaskUrl', $updateTaskUrl); $html = $theme->output('html/admin.widgets/version'); return $html; } } PK ! ��R� � str.phpnu �[��� <?php /** * @package Foundry * @copyright Copyright (C) Stack Ideas Sdn Bhd. All rights reserved. * @license GNU/GPL, see LICENSE.php * Foundry 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. * See COPYRIGHT.php for copyright notices and details. */ namespace Foundry\Html; defined('_JEXEC') or die('Unauthorized Access'); use Joomla\String\StringHelper; use Foundry\Libraries\Date; use Foundry\Libraries\Scripts; class Str extends Base { /** * Formats a given date string with a given date format * * @since 1.0.0 * @access public */ public function date($timestamp, $format = 'DATE_FORMAT_LC2', $withOffset = true) { $date = new Date($timestamp, $withOffset); $string = $date->format(\JText::_($format)); return $string; } /** * Escapes a string * * @since 1.0.0 * @access public */ public function escape($str) { return \FH::escape($str); } /** * Truncates a string to a specific length specified by caller * * @since 1.0.0 * @access public */ public function truncate($text, $max = 250, $ellipses = '...', $options = []) { Scripts::load('shared'); $stripTags = \FH::normalize($options, 'stripTags', false); $exact = \FH::normalize($options, 'exact', false); $showMore = \FH::normalize($options, 'showMore', true); $overrideReadmore = \FH::normalize($options, 'overrideReadmore', false); $readMoreText = \FH::normalize($options, 'readMoreText', 'FD_TRUNCATE_MORE'); // If the plain text is shorter than the maximum length, return the whole text if ((StringHelper::strlen(preg_replace('/<.*?>/', '', $text)) <= $max) || !$max) { return $text; } // Truncate the string natively without retaining the original format. if ($stripTags) { $truncate = StringHelper::trim(strip_tags($text)); $truncate = StringHelper::substr($truncate, 0, $max) . $ellipses; } if (!$stripTags) { $truncate = \FH::truncateWithHtml($text, $max, $ellipses, $exact); } $theme = $this->getTemplate(); $theme->set('readMoreText', $readMoreText); $theme->set('truncated', $truncate); $theme->set('original', $text); $theme->set('showMore', $showMore); $theme->set('overrideReadmore', $overrideReadmore); $output = $theme->output('html/string/truncate'); return $output; } } PK ! �ӓ� � radio.phpnu �[��� <?php /** * @package Foundry * @copyright Copyright (C) Stack Ideas Sdn Bhd. All rights reserved. * @license GNU/GPL, see LICENSE.php * Foundry 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. * See COPYRIGHT.php for copyright notices and details. */ namespace Foundry\Html; defined('_JEXEC') or die('Unauthorized Access'); use Foundry\Html\Base; class Radio extends Base { /** * Renders a simple radio form * * @since 1.1.10 * @access public */ public function standard($name, $checked = false, $value = 1, $id = null, $label = '', $options = []) { $inline = \FH::normalize($options, 'inline', false); $class = \FH::normalize($options, 'class', ''); if (!$id) { $id = $name; } $theme = $this->getTemplate(); $theme->set('inline', $inline); $theme->set('class', $class); $theme->set('id', $id); $theme->set('name', $name); $theme->set('value', $value); $theme->set('checked', $checked); $theme->set('label', $label); $output = $theme->output('html/radio/standard'); return $output; } /** * Renders a radio form with image together * * @since 1.1.10 * @access public */ public function image($url, $name, $checked = false, $value = 1, $id = null, $label = '', $options = []) { $inline = \FH::normalize($options, 'inline', false); $class = \FH::normalize($options, 'class', ''); if (!$id) { $id = $name; } $theme = $this->getTemplate(); $theme->set('inline', $inline); $theme->set('class', $class); $theme->set('url', $url); $theme->set('id', $id); $theme->set('name', $name); $theme->set('value', $value); $theme->set('checked', $checked); $theme->set('label', $label); $output = $theme->output('html/radio/image'); return $output; } }PK ! �:�/� � layout.phpnu �[��� <?php /** * @package Foundry * @copyright Copyright (C) Stack Ideas Sdn Bhd. All rights reserved. * @license GNU/GPL, see LICENSE.php * Foundry 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. * See COPYRIGHT.php for copyright notices and details. */ namespace Foundry\Html; defined('_JEXEC') or die('Unauthorized Access'); use Foundry\Html\Base; class Layout extends Base { /** * Renders a standard box layout on the page * * @since 1.1.4 * @access public */ public function box($title, $icon = null, $actions = null, $options = []) { $rounded = \FH::normalize($options, 'rounded', null); $padding = \FH::normalize($options, 'padding', 'p-3xl'); $wrapperClass = \FH::normalize($options, 'wrapperClass', ''); $theme = $this->getTemplate(); $theme->set('title', $title); $theme->set('icon', $icon); $theme->set('actions', $actions); $theme->set('rounded', $rounded); $theme->set('padding', $padding); $theme->set('wrapperClass', $wrapperClass); return $theme->output('html/layout/box'); } } PK ! t�J� � dialog.phpnu �[��� <?php /** * @package Foundry * @copyright Copyright (C) Stack Ideas Sdn Bhd. All rights reserved. * @license GNU/GPL, see LICENSE.php * Foundry 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. * See COPYRIGHT.php for copyright notices and details. */ namespace Foundry\Html; defined('_JEXEC') or die('Unauthorized Access'); use Foundry\Html\Base; use Foundry\Libraries\Scripts; class Dialog extends Base { /** * Renders a dialog button * * @since 1.0.0 * @access public */ public function button($title, $type = 'default', $options = []) { $attributes = \FH::normalize($options, 'attributes', ''); $class = \FH::normalize($options, 'class', ''); $theme = $this->getTemplate(); $theme->set('title', $title); $theme->set('type', $type); $theme->set('attributes', $attributes); $theme->set('class', $class); $output = $theme->output('html/dialog/button'); return $output; } /** * Initializes dialog on the site * * @since 1.1.2 * @access public */ public function init() { Scripts::load('shared'); } } PK ! �n�zL L label.phpnu �[��� <?php /** * @package Foundry * @copyright Copyright (C) Stack Ideas Sdn Bhd. All rights reserved. * @license GNU/GPL, see LICENSE.php * Foundry 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. * See COPYRIGHT.php for copyright notices and details. */ namespace Foundry\Html; defined('_JEXEC') or die('Unauthorized Access'); use Foundry\Html\Base; class Label extends Base { /** * Renders the standard label * * @since 1.0.0 * @access public */ public function standard($text = '', $type = 'info', $options = []) { $showRemove = \FH::normalize($options, 'showRemove', false); $rounded = \FH::normalize($options, 'rounded', true); $icon = \FH::normalize($options, 'icon', ''); $class = \FH::normalize($options, 'class', ''); $class .= $rounded ? ' rounded-full' : ''; // Ensure that it is translated $text = \JText::_($text); $themes = $this->getTemplate(); $themes->set('text', $text); $themes->set('class', $class); $themes->set('type', $type); $themes->set('icon', $icon); $themes->set('showRemove', $showRemove); $output = $themes->output('html/label/standard'); return $output; } /** * Renders the avatar label * * @since 1.0.0 * @access public */ public function avatar($url, $text = '', $type = 'info', $options = []) { $showRemove = \FH::normalize($options, 'showRemove', false); // Ensure that it is translated $text = \JText::_($text); $themes = $this->getTemplate(); $themes->set('text', $text); $themes->set('url', $url); $themes->set('type', $type); $themes->set('showRemove', $showRemove); $output = $themes->output('html/label/avatar'); return $output; } }PK ! ��2�� � admin.phpnu �[��� <?php /** * @package Foundry * @copyright Copyright (C) Stack Ideas Sdn Bhd. All rights reserved. * @license GNU/GPL, see LICENSE.php * Foundry 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. * See COPYRIGHT.php for copyright notices and details. */ namespace Foundry\Html; defined('_JEXEC') or die('Unauthorized Access'); use Foundry\Html\Base; use Foundry\Libraries\Scripts; class Admin extends Base { /** * Generates a panel heading used at the back end * * @since 1.1.0 * @access public */ public function headers($title, $description = '') { if (!$description && $description !== false) { $description = $title . '_DESC'; } $theme = $this->getTemplate(); $theme->set('title', $title); $theme->set('description', $description); $html = $theme->output('html/admin/headers'); return $html; } /** * Renders an outdated notice on the back-end * * @since 1.1.0 * @access public */ public function notice($message, $type = 'info', $button = null, $options = []) { $attributes = \FH::normalize($options, 'attributes', ''); $class = \FH::normalize($options, 'class', ''); $icon = \FH::normalize($options, 'icon', 'fdi fa fa-bolt'); $dismissible = \FH::normalize($options, 'dismissible', false); $dismissAttribute = \FH::normalize($options, 'dismissAttribute', 'data-fd-dismiss'); // Ensure that the button truly has the correct properties if ($button && !is_object($button)) { $button = null; } if ($button) { $button->text = \FH::normalize($button, 'text', ''); $button->type = \FH::normalize($button, 'type', ''); $button->url = \FH::normalize($button, 'url', ''); $button->attributes = \FH::normalize($button, 'attributes', ''); } $theme = $this->getTemplate(); $theme->set('class', $class); $theme->set('message', $message); $theme->set('button', $button); $theme->set('type', $type); $theme->set('attributes', $attributes); $theme->set('icon', $icon); $theme->set('dismissible', $dismissible); $theme->set('dismissAttribute', $dismissAttribute); $html = $theme->output('html/admin/notice'); return $html; } /** * Renders an outdated notice on the back-end * * @since 1.1.0 * @access public */ public function outdated($message, $updateTaskUrl, $buttonText = 'FD_UPDATE_NOW') { Scripts::load('admin'); $options = [ 'attributes' => 'data-fd-outdated-notice', 'class' => 'hidden' ]; $button = (object) [ 'text' => $buttonText, 'url' => $updateTaskUrl, 'type' => 'danger', 'attributes' => 'data-fd-update-button' ]; return $this->notice($message, 'danger', $button, $options); } /** * Generates the sidebar for the back-end * * @since 1.1.0 * @access public */ public function sidebar($menus, $view, $layout) { Scripts::load('admin'); $theme = $this->getTemplate(); $theme->set('menus', $menus); $theme->set('layout', $layout); $theme->set('view', $view); $html = $theme->output('html/admin/sidebar'); return $html; } /** * Generates tabs for the back-end * * @since 1.1.0 * @access public */ public function tabs($tabs) { Scripts::load('shared'); // Tab properties must contain the following: // - id // - title // - active (bool) if (is_callable($tabs)) { $tabs = $tabs(); } $theme = $this->getTemplate(); $theme->set('tabs', $tabs); $html = $theme->output('html/admin/tabs'); return $html; } /** * Generates the help button for the back-end * * @since 1.1.0 * @access public */ public function toolbarHelp($link, $title = 'JHELP') { $theme = $this->getTemplate(); $theme->set('link', $link); $theme->set('title', $title); $html = $theme->output('html/admin/toolbar.help'); return $html; } /** * Generates the template for adding a dropdown actions on the toolbar * * @since 1.1.0 * @access public */ public function toolbarActions($title = 'FD_OTHER_ACTIONS', $actions = []) { // Actions should consist the following properties // // $action->title // $action->cmd $theme = $this->getTemplate(); $theme->set('title', $title); $theme->set('actions', $actions); $html = $theme->output('html/admin/toolbar.actions'); return $html; } /** * Generates the template for grouping save buttons on the toolbar * * @since 1.1.0 * @access public */ public function toolbarSaveGroup() { $theme = $this->getTemplate(); $html = $theme->output('html/admin/toolbar.save'); return $html; } /** * Renders the search DOM in the toolbar * * @since 1.1.0 * @access public */ public function toolbarSearch($placeholder = 'FD_SEARCH_FOR_SETTINGS') { $theme = $this->getTemplate(); $theme->set('placeholder', $placeholder); $html = $theme->output('html/admin/toolbar.search'); return $html; } /** * Renders the search search result in the toolbar * * @since 1.1.0 * @access public */ public function toolbarSearchResults($result) { $theme = $this->getTemplate(); $theme->set('result', $result); $html = $theme->output('html/admin/toolbar.searchresult'); return $html; } } PK ! � �C� � stats.phpnu �[��� <?php /** * @package Foundry * @copyright Copyright (C) Stack Ideas Sdn Bhd. All rights reserved. * @license GNU/GPL, see LICENSE.php * Foundry 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. * See COPYRIGHT.php for copyright notices and details. */ namespace Foundry\Html; defined('_JEXEC') or die('Unauthorized Access'); use Foundry\Html\Base; class Stats extends Base { /** * Renders a simple card for statistical purposes * * @since 1.1.2 * @access public */ public function card($label, $count, $icon, $url = null) { $theme = $this->getTemplate(); $theme->set('url', $url); $theme->set('label', $label); $theme->set('count', $count); $theme->set('icon', $icon); $contents = $theme->output('html/stats/card'); return $contents; } } PK ! ��/� location.phpnu �[��� <?php /** * @package Foundry * @copyright Copyright (C) Stack Ideas Sdn Bhd. All rights reserved. * @license GNU/GPL, see LICENSE.php * Foundry 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. * See COPYRIGHT.php for copyright notices and details. */ namespace Foundry\Html; defined('_JEXEC') or die('Unauthorized Access'); use Foundry\Html\Base; use Foundry\Libraries\Scripts; class Location extends Base { /** * Renders the location html wrapper that is used by respective extensions * * @since 1.1.3 * @access public */ public function wrapper($options = []) { $preview = \FH::normalize($options, 'preview', true); $title = \FH::normalize($options, 'title', true); $footer = \FH::normalize($options, 'footer', true); $value = \FH::normalize($options, 'value', ''); $latitude = \FH::normalize($options, 'latitude', ''); $longitude = \FH::normalize($options, 'longitude', ''); $type = \FH::normalize($options, 'type', 'inline'); $theme = $this->getTemplate(); $theme->set('preview', $preview); $theme->set('title', $title); $theme->set('footer', $footer); $theme->set('value', $value); $theme->set('latitude', $latitude); $theme->set('longitude', $longitude); $output = $theme->output('html/location/' . $type); return $output; } /** * Renders the location item HTML * * @since 1.1.3 * @access public */ public function list($options = []) { $locations = \FH::normalize($options, 'locations', []); $theme = $this->getTemplate(); $theme->set('locations', $locations); $output = $theme->output('html/location/list'); return $output; } } PK ! �]< 0c 0c form.phpnu �[��� <?php /** * @package Foundry * @copyright Copyright (C) Stack Ideas Sdn Bhd. All rights reserved. * @license GNU/GPL, see LICENSE.php * Foundry 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. * See COPYRIGHT.php for copyright notices and details. */ namespace Foundry\Html; defined('_JEXEC') or die('Unauthorized Access'); use Foundry\Html\Base; use Foundry\Libraries\StyleSheets; use Foundry\Libraries\Scripts; use Joomla\CMS\HTML\HTMLHelper; class Form extends Base { /** * Generates generic hidden input with actions for form submission * * @since 1.0.0 * @access public */ public function action($task = '', $controller = '', $view ='', $layout = '') { $token = \JFactory::getSession()->getFormToken(); $theme = $this->getTemplate(); $theme->set('controller', $controller); $theme->set('view', $view); $theme->set('token', $token); $theme->set('task', $task); $theme->set('layout', $layout); $output = $theme->output('html/form/action'); return $output; } /** * Renders an article browser form * * @since 1.0.0 * @access public */ public function article($name, $value, $id = null, $attributes = [], $options = []) { if (is_null($id)) { $id = $name; } $articleTitle = ''; if ($value) { $article = \JTable::getInstance('Content'); $article->load((int) $value); $articleTitle = $article->title; } $attributes = implode(' ', $attributes); $theme = $this->getTemplate(); $theme->set('articleTitle', $articleTitle); $theme->set('id', $id); $theme->set('name', $name); $theme->set('value', $value); $theme->set('attributes', $attributes); return $theme->output('html/form/article'); } /** * Renders the color picker input * * @since 1.0.0 * @access public */ public function colorpicker($name, $value = '', $revert = '') { Scripts::load('shared'); \FH::renderColorPicker(); $theme = $this->getTemplate(); $theme->set('name', $name); $theme->set('value', $value); $theme->set('revert', $revert); $output = $theme->output('html/form/colorpicker'); return $output; } /** * Renders a simple checkbox form * * @since 1.1.2 * @access public */ public function checkbox($name, $checked = false, $value = 1, $id = null, $label = '', $options = []) { $inline = \FH::normalize($options, 'inline', false); $attributes = \FH::normalize($options, 'attributes', ''); $theme = $this->getTemplate(); $theme->set('attributes', $attributes); $theme->set('inline', $inline); $theme->set('name', $name); $theme->set('value', $value); $theme->set('checked', $checked); $theme->set('label', $label); $output = $theme->output('html/form/checkbox'); return $output; } /** * Renders a datetimepicker input * * @since 1.1.2 * @access public */ public function datetimepicker($name, $value = '', $options = []) { StyleSheets::load('flatpickr'); Scripts::load('flatpickr'); // Figure out the language tag to be used for the picker static $languageTag = false; if (!$languageTag) { $languageTag = strtolower(\JFactory::getLanguage()->getTag()); if ($languageTag !== 'zh-tw') { $parts = explode('-', $languageTag); $languageTag = $parts[0]; if ($languageTag === 'en') { $languageTag = 'default'; } } } if ($languageTag !== 'default') { $path = \FH::getMediaPath('scripts') . '/vendor/flatpickr/' . $languageTag; $localeScript = Scripts::appendExtension($path); Scripts::add($localeScript, 'others'); } $id = \FH::normalize($options, 'id', $name); $attributes = \FH::normalize($options, 'attributes', ''); $class = \FH::normalize($options, 'class', ''); $appearance = \FH::normalize($options, 'appearance', 'light'); $mode = \FH::normalize($options, 'mode', 'single'); $enableTime = \FH::normalize($options, 'enableTime', true); // return empty if it return the following default value if ($value === '0000-00-00 00:00:00') { $value = ''; } // Generate a unique id so that it will only be implemented once $uid = uniqid(); $theme = $this->getTemplate(); $theme->set('appearance', $appearance); $theme->set('languageTag', $languageTag); $theme->set('uid', $uid); $theme->set('value', $value); $theme->set('attributes', $attributes); $theme->set('name', $name); $theme->set('id', $id); $theme->set('class', $class); $theme->set('mode', $mode); $theme->set('enableTime', $enableTime); return $theme->output('html/form/datetimepicker'); } /** * Renders a dropdown input * * @since 1.0.0 * @access public */ public function dropdown($name, $selected = '', $values = [], $options = [], $useValue = false) { $id = \FH::normalize($options, 'id', ''); $attributes = \FH::normalize($options, 'attributes', \FH::normalize($options, 'attr')); $class = \FH::normalize($options, 'class', ''); $multiple = \FH::normalize($options, 'multiple', false); $baseClass = \FH::normalize($options, 'baseClass', ''); $theme = $this->getTemplate(); $theme->set('multiple', $multiple); $theme->set('baseClass', $baseClass); $theme->set('values', $values); $theme->set('attributes', $attributes); $theme->set('name', $name); $theme->set('id', $id); $theme->set('class', $class); $theme->set('selected', $selected); $theme->set('useValue', $useValue); return $theme->output('html/form/dropdown'); } /** * Renders an e-mail text input * * @since 1.0.0 * @access public */ public function email($name, $value = '', $id = null, $options = []) { $class = \FH::normalize($options, 'class', ''); $placeholder = \FH::normalize($options, 'placeholder', ''); $attributes = \FH::normalize($options, 'attributes', \FH::normalize($options, 'attr', '')); $theme = $this->getTemplate(); $theme->set('attributes', $attributes); $theme->set('name', $name); $theme->set('id', $id); $theme->set('value', $value); $theme->set('class', $class); $theme->set('placeholder', $placeholder); return $theme->output('html/form/email'); } /** * Renders a dropdown list of editors for the site * * @since 1.0.0 * @access public */ public function editors($element, $selected = null, $options = []) { $editors = \FH::getEditors(); $language = \JFactory::getLanguage(); $default = \FH::normalize($options, 'default', 'tinymce'); $additionalEditors = \FH::normalize($options, 'additional', []); // There are some cases where the editor selected is not exists in the database $selectedExists = false; foreach ($editors as $editor) { $language->load($editor->text . '.sys', JPATH_ADMINISTRATOR, null, false, false); $editor->text = \JText::_($editor->text); if ($selected === $editor->value) { $selectedExists = true; } } // If editor not exist, we automatically select composer as default editor. if (!$selectedExists) { $selected = $default; } $availableEditors = array_merge([], $additionalEditors); foreach ($editors as $editor) { $availableEditors[$editor->value] = $editor->text; } $theme = $this->getTemplate(); $theme->set('availableEditors', $availableEditors); $theme->set('element', $element); $theme->set('selected', $selected); $output = $theme->output('html/form/editors'); return $output; } /** * Renders a floating label with input form * * @since 1.0.0 * @access public */ public function floatingLabel($label, $name, $type = 'text', $value = '', $uniqueID = false, $options = []) { $class = \FH::normalize($options, 'class', ''); $trailIcon = \FH::normalize($options, 'trailIcon', null); $leadIcon = \FH::normalize($options, 'leadIcon', null); $autocomplete = \FH::normalize($options, 'autocomplete', false); $attributes = \FH::normalize($options, 'attributes', ''); $fieldAttributes = \FH::normalize($options, 'fieldAttributes', false); $readOnly = \FH::normalize($options, 'readOnly', false); $html = \FH::normalize($options, 'html', false); $error = \FH::normalize($options, 'error', null); $errorAttributes = \FH::normalize($options, 'errorAttributes', ''); // Backward compatibility if (in_array($type, ['text', 'password'])) { $html = false; } $class .= $leadIcon ? ' has-leading-icon' : ''; $class .= $trailIcon ? ' has-trailing-icon' : ''; $label = \JText::_($label); $id = 'fd-' . str_ireplace(['.'], '', $name); // DOM found elements with non-unique id. // https://goo.gl/9p2vKq if ($uniqueID) { $id = $uniqueID; } $theme = $this->getTemplate(); $theme->set('type', $type); $theme->set('value', $value); $theme->set('label', $label); $theme->set('name', $name); $theme->set('id', $id); $theme->set('class', $class); $theme->set('leadIcon', $leadIcon); $theme->set('trailIcon', $trailIcon); $theme->set('autocomplete', $autocomplete); $theme->set('attributes', $attributes); $theme->set('fieldAttributes', $fieldAttributes); $theme->set('readOnly', $readOnly); $theme->set('html', $html); $theme->set('error', $error); $theme->set('errorAttributes', $errorAttributes); $output = $theme->output('html/form/floating.label'); return $output; } /** * Renders a hidden input on the site * * @since 1.0.0 * @access public */ public function hidden($name = '', $value = '', $id = '', $attributes = []) { if (is_array($attributes)) { $attributes = implode(' ', $attributes); } $theme = $this->getTemplate(); $theme->set('attributes', $attributes); $theme->set('id', $id); $theme->set('name', $name); $theme->set('value', $value); $output = $theme->output('html/form/hidden'); return $output; } /** * Renders the label for generic forms * * @since 1.0.0 * @access public */ public function label($text, $id, $helpTitle = '', $helpContent = '', $tooltip = true, $options = []) { //$key = strtoupper($text); $translatedText = \JText::_($text); if (!$helpTitle) { $helpTitle = $translatedText; } if (!$helpContent) { $helpContent = \JText::_($text . '_DESC'); } $columns = \FH::normalize($options, 'columns', 5); $classes = \FH::normalize($options, 'class', ''); // Generate a short unique id for each label $uniqueId = substr(md5($translatedText), 0, 16); $theme = $this->getTemplate(); $theme->set('columns', $columns); $theme->set('id', $id); $theme->set('uniqueId', $uniqueId); $theme->set('text', $translatedText); $theme->set('helpTitle', $helpTitle); $theme->set('helpContent', $helpContent); $theme->set('tooltip', $tooltip); $theme->set('classes', $classes); $output = $theme->output('html/form/label'); return $output; } /** * Renders the languages dropdown * * @since 1.0.0 * @access public */ public function languages($name, $selected = '', $attributes = '', $options = []) { $languages = [ '' => 'JOPTION_SELECT_LANGUAGE' ]; $joomlaLanguages = \JHtml::_('contentlanguage.existing', true, true); foreach ($joomlaLanguages as $language) { $languages[$language->value] = $language->text; } $baseClass = \FH::normalize($options, 'baseClass', ''); $theme = $this->getTemplate(); $theme->set('baseClass', $baseClass); $theme->set('name', $name); $theme->set('selected', $selected); $theme->set('languages', $languages); $theme->set('attributes', $attributes); $output = $theme->output('html/form/languages'); return $output; } /** * Renders a dropdown of menus * * @since 1.0.0 * @access public */ public function menus($name, $value = '', $id = null, $options = []) { require_once(JPATH_ADMINISTRATOR . '/components/com_menus/helpers/menus.php'); $items = \MenusHelper::getMenuLinks(); $menus = []; foreach ($items as $menu) { $menus[$menu->menutype] = $menu->title; } $theme = $this->getTemplate(); $theme->set('options', $options); $theme->set('menus', $menus); $theme->set('name', $name); $theme->set('value', $value); $output = $theme->output('html/form/menus'); return $output; } /** * Renders a select list (multiple) * * @since 1.1.2 * @access public */ public function multilist($name, $selected = '', $values = [], $options = [], $useValue = false) { $id = \FH::normalize($options, 'id', ''); $attributes = \FH::normalize($options, 'attributes', \FH::normalize($options, 'attr')); $class = \FH::normalize($options, 'class', ''); $baseClass = \FH::normalize($options, 'baseClass', ''); $selected = is_array($selected) ? $selected : explode(',',$selected); $theme = $this->getTemplate(); $theme->set('baseClass', $baseClass); $theme->set('values', $values); $theme->set('attributes', $attributes); $theme->set('name', $name); $theme->set('id', $id); $theme->set('class', $class); $theme->set('selected', $selected); $theme->set('useValue', $useValue); return $theme->output('html/form/multilist'); } /** * Renders a password input * * @since 1.0.0 * @access public */ public function password($name, $value = '', $id = null, $options = []) { $class = \FH::normalize($options, 'class', ''); $placeholder = \FH::normalize($options, 'placeholder', ''); $attributes = \FH::normalize($options, 'attributes', ''); $autocomplete = \FH::normalize($options, 'autocomplete', false); // Caller wants to disable autocomplete if ($autocomplete === false) { $autocomplete = 'new-password'; } $theme = $this->getTemplate(); $theme->set('autocomplete', $autocomplete); $theme->set('attributes', $attributes); $theme->set('name', $name); $theme->set('id', $id); $theme->set('value', $value); $theme->set('class', $class); $theme->set('placeholder', $placeholder); return $theme->output('html/form/password'); } /** * Renders an ordering input * * @since 1.1.0 * @access public */ public function ordering($name = 'ordering', $value = '') { return $this->fd->html('form.hidden', $name, $value, '', 'data-fd-table-ordering'); } /** * Renders an ordering direction hidden input * * @since 1.1.0 * @access public */ public function orderingDirection($name = 'direction', $value = '') { return $this->fd->html('form.hidden', $name, $value, '', 'data-fd-table-direction'); } /** * Generates a hidden input for encoded return urls * * @since 1.1.2 * @access public */ public function returnUrl($name = '', $url = null) { if (!$name) { $name = 'currentUrl'; } if (is_null($url)) { $app = \JFactory::getApplication(); $url = $app->input->get($name, '', 'default'); } return $this->fd->html('form.hidden', $name, $url); } /** * Renders a simple radio form * * @since 1.1.2 * @access public */ public function radio($name, $checked = false, $value = 1, $id = null, $label = '', $options = []) { // Backward compatibility return $this->fd->html('radio.standard', $name, $checked, $value, $id, $label, $options); } /** * Renders a robots dropdown selection * * @since 1.0.0 * @access public */ public function robots($name, $selected = null, $options = []) { $baseClass = \FH::normalize($options, 'baseClass', ''); $theme = $this->getTemplate(); $theme->set('baseClass', $baseClass); $theme->set('name', $name); $theme->set('selected', $selected); $output = $theme->output('html/form/robots'); return $output; } /** * Renders a select2 input * * @since 1.0.0 * @access public */ public function select2($name, $selected = '', $values = [], $options = [], $useValue = false) { Scripts::load('select2'); StyleSheets::load('select2'); $attributes = \FH::normalize($options, 'attributes', ''); $theme = \FH::normalize($options, 'theme', 'backend'); $width = \FH::normalize($options, 'width', ''); $appearance = \FH::normalize($options, 'appearance', $this->fd->getAppearance()); $multiple = \FH::normalize($options, 'multiple', false); $extraAttributes = [ 'data-fd-select2' => $this->fd->getName(), 'data-theme' => $theme, 'data-appearance' => $appearance ]; if ($width) { $extraAttributes['data-width'] = $width; } if ($multiple) { $extraAttributes['data-fd-select2-multiple'] = ''; } $language = \JFactory::getLanguage(); if ($language->isRTL()) { $extraAttributes['data-dir'] = 'rtl'; } foreach ($extraAttributes as $attributeKey => $attributeValue) { $attributes .= ' ' . $attributeKey . '="' . $attributeValue . '"'; } $options['attributes'] = $attributes; return $this->fd->html('form.dropdown', $name, $selected, $values, $options, $useValue); } /** * Renders a simple text input * * @since 1.0.0 * @access public */ public function text($name, $value = '', $id = null, $options = []) { $class = \FH::normalize($options, 'class', ''); $customClass = \FH::normalize($options, 'customClass', ''); $baseClass = \FH::normalize($options, 'baseClass', ''); $placeholder = \FH::normalize($options, 'placeholder', ''); $attributes = \FH::normalize($options, 'attributes', \FH::normalize($options, 'attr', '')); $help = \FH::normalize($options, 'help', false); $disabled = \FH::normalize($options, 'disabled', false); $readOnly = \FH::normalize($options, 'readOnly', false); $size = \FH::normalize($options, 'size', ''); $prefix = \FH::normalize($options, 'prefix', ''); $postfix = \FH::normalize($options, 'postfix', ''); // Override class if custom class is available. if ($customClass) { $class = $customClass; } $theme = $this->getTemplate(); $theme->set('size', $size); $theme->set('postfix', $postfix); $theme->set('prefix', $prefix); $theme->set('help', $help); $theme->set('attributes', $attributes); $theme->set('name', $name); $theme->set('id', $id); $theme->set('value', $value); $theme->set('class', $class); $theme->set('placeholder', $placeholder); $theme->set('disabled', $disabled); $theme->set('readOnly', $readOnly); $theme->set('baseClass', $baseClass); return $theme->output('html/form/text'); } /** * Renders a textarea input * * @since 1.0.0 * @access public */ public function textarea($name, $value = '', $id = null, $options = []) { $class = \FH::normalize($options, 'class', ''); $placeholder = \FH::normalize($options, 'placeholder', ''); $attributes = \FH::normalize($options, 'attributes', \FH::normalize($options, 'attr', '')); $rows = \FH::normalize($options, 'rows', 3); $baseClass = \FH::normalize($options, 'baseClass', ''); $theme = $this->getTemplate(); $theme->set('baseClass', $baseClass); $theme->set('attributes', $attributes); $theme->set('rows', $rows); $theme->set('name', $name); $theme->set('id', $id); $theme->set('value', $value); $theme->set('class', $class); $theme->set('placeholder', $placeholder); return $theme->output('html/form/textarea'); } /** * Renders a grouped text input with copy behavior * * @since 1.0.0 * @access public */ public function textCopy($name, $value = '', $id = null, $options = []) { Scripts::load('shared'); $attributes = \FH::normalize($options, 'attributes', \FH::normalize($options, 'attr', '')); $class = \FH::normalize($options, 'class', ''); $copyTooltips = \FH::normalize($options, 'tooltipsCopy', \JText::_('FD_COPY')); $copiedTooltips = \FH::normalize($options, 'tooltipsCopied', \JText::_('FD_COPIED')); $tooltips = (object) [ 'copy' => \JText::_($copyTooltips), 'copied' => \JText::_($copiedTooltips) ]; $theme = $this->getTemplate(); $theme->set('tooltips', $tooltips); $theme->set('attributes', $attributes); $theme->set('name', $name); $theme->set('id', $id); $theme->set('value', $value); $theme->set('class', $class); return $theme->output('html/form/text.copy'); } /** * Generates the toggler switch * * @since 1.0.0 * @access public */ public function toggler($name, $checked = false, $id = '', $attributes = '', $options = []) { Scripts::load('shared'); $disabled = false; if (is_array($attributes)) { $attributes = implode(' ', $attributes); } // Target dependencies option allows this option to display / hide dependency items // based on the current toggle value $dependency = \FH::normalize($options, 'dependency', ''); $dependencyValue = \FH::normalize($options, 'dependencyValue', 1); // Ensure it does not have any double quotes if ($dependency) { $dependency = str_ireplace('"', '\'', $dependency); } // Determines if the input has been disabled $disabled = \FH::normalize($options, 'disabled', false); $disabledDesc = \FH::normalize($options, 'disabledDesc', ''); $disabledTitle = \FH::normalize($options, 'disabledTitle', ''); if (!$id) { $id = $name; } $theme = $this->getTemplate(); $theme->set('id', $id); $theme->set('name', $name); $theme->set('checked', $checked); $theme->set('disabled', $disabled); $theme->set('disabledTitle', $disabledTitle); $theme->set('disabledDesc', $disabledDesc); $theme->set('attributes', $attributes); $theme->set('dependency', $dependency); $theme->set('dependencyValue', $dependencyValue); $output = $theme->output('html/form/toggler'); return $output; } /** * Renders a hidden input with Joomla's token * * @since 1.0.0 * @access public */ public function token() { $token = \JFactory::getSession()->getFormToken(); $theme = $this->getTemplate(); $theme->set('token', $token); $output = $theme->output('html/form/token'); return $output; } /** * Renders user browser form * * @since 1.0.0 * @access public */ public function user($name, $value, $id = null, $options = []) { Scripts::load('shared'); $userName = ''; $attributes = \FH::normalize($options, 'attributes', ''); $browseTitle = \FH::normalize($options, 'browseTitle', \JText::_('FD_BROWSE')); $columns = \FH::normalize($options, 'columns', 10); // Id cannot be null since it is used to link the hidden input if (!$id) { $id = $name; } if ($value) { $user = \JFactory::getUser((int) $value); $userName = $user->name; } $theme = $this->getTemplate(); $theme->set('columns', $columns); $theme->set('browseTitle', $browseTitle); $theme->set('id', $id); $theme->set('userName', $userName); $theme->set('name', $name); $theme->set('value', $value); $theme->set('attributes', $attributes); return $theme->output('html/form/user'); } /** * Renders the user groups tree checkbox * * @since 1.1.2 * @access public */ public function userGroupsTree($name, $selected = '', $checkSuperAdmin = false) { if (is_string($selected)) { $selected = explode(',', $selected); } $groups = \FH::getUserGroupsTree(); $theme = $this->getTemplate(); $theme->set('name', $name); $theme->set('checkSuperAdmin', $checkSuperAdmin); $theme->set('selected', $selected); $theme->set('groups', $groups); return $theme->output('html/form/user.groups.tree'); } /** * Renders a dropdown list of languages available to the user * * @since 1.0.0 * @access public */ public function userLanguages($name, $selected) { $availableLanguages = \FH::getLanguages(); $languages = [ '' => 'FD_USE_DEFAULT' ]; foreach ($availableLanguages as $language) { $languages[$language->value] = $language->text; } $theme = $this->getTemplate(); $theme->set('name', $name); $theme->set('selected', $selected); $theme->set('languages', $languages); return $theme->output('html/form/user.languages'); } /** * Renders a dropdown list of user timezone available to the user * * @since 1.0.0 * @access public */ public function userTimezone($name, $selected) { $joomlaTimezones = \FH::getJoomlaTimezones(); $timezones = [ 'UTC' => 'FD_USE_DEFAULT' ]; foreach ($joomlaTimezones as $group => $countries) { $timezones[$group] = []; foreach ($countries as $country) { $timezones[$group][$country] = $country; } } // UTC timezone is only meant for server. if ($selected == null || $selected === '') { $selected = 'UTC'; } $theme = $this->getTemplate(); $theme->set('name', $name); $theme->set('selected', $selected); $theme->set('timezones', $timezones); return $theme->output('html/form/user.timezone'); } /** * Renders the emoji picker markup * * @since 1.1.2 * @access public */ public function emoji($options = []) { Scripts::load('perfect-scrollbar'); Scripts::load('popper'); Scripts::load('tippy'); Scripts::load('emoji'); $appearance = \FH::normalize($options, 'appearance', 'light'); $accent = \FH::normalize($options, 'theme', 'foundry'); $theme = $this->getTemplate(); $theme->set('appearance', $appearance); $theme->set('accent', $accent); $output = $theme->output('html/form/emoji'); return $output; } /** * Renders a date range form * * @since 1.0.0 * @access public */ public function dateRange($selected = '', $name = 'dateRange', $placeholder = '', $options = []) { $options = array_merge($options, ['submitonclick' => false]); return $this->fd->html('filter.dateRange', $selected, $name, $placeholder, $options); } } PK ! ����+ + table.phpnu �[��� <?php /** * @package Foundry * @copyright Copyright (C) Stack Ideas Sdn Bhd. All rights reserved. * @license GNU/GPL, see LICENSE.php * Foundry 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. * See COPYRIGHT.php for copyright notices and details. */ namespace Foundry\Html; defined('_JEXEC') or die('Unauthorized Access'); use Foundry\Html\Base; use Joomla\CMS\Pagination\Pagination; class Table extends Base { /** * Renders a check all checkbox in a table * * @since 1.0.0 * @access public */ public function checkall() { $theme = $this->getTemplate(); $output = $theme->output('html/table/checkall'); return $output; } /** * Renders a checkbox for each table row. * * @since 1.0.0 * @access public */ public function id($number, $value, $allowed = true, $checkedOut = false, $name = 'cid') { $theme = $this->getTemplate(); $theme->set('allowed', $allowed); $theme->set('number', $number); $theme->set('name', $name); $theme->set('checkedOut', $checkedOut); $theme->set('value', $value); $contents = $theme->output('html/table/id'); return $contents; } /** * Renders a lock/unlock icon in a grid * * @since 1.0.0 * @access public */ public function locked($isLocked, $actionAllowed, $options = []) { $tooltip = \FH::normalize($options, 'tooltip', ''); $task = \FH::normalize($options, 'task', ''); $class = $isLocked ? 'locked' : 'unlocked'; $themes = $this->getTemplate(); $themes->set('actionAllowed', $actionAllowed); $themes->set('tooltip', $tooltip); $themes->set('task', $task); $themes->set('class', $class); return $themes->output('html/table/locked'); } /** * Renders core icon. * * @since 1.0.0 * @access public */ public function core($isCore, $options = []) { $tooltip = \FH::normalize($options, 'tooltip', ''); $class = $isCore ? 'publish' : 'unpublish'; $themes = $this->getTemplate(); $themes->set('tooltip', $tooltip); $themes->set('class', $class); return $themes->output('html/table/core'); } /** * Renders publish/unpublish icon. * * @since 1.0.0 * @access public */ public function published($class, $actionAllowed, $options = []) { $tooltip = \FH::normalize($options, 'tooltip', ''); $task = \FH::normalize($options, 'task', ''); // Ensure that it is translated $tooltip = \JText::_($tooltip); $themes = $this->getTemplate(); $themes->set('actionAllowed', $actionAllowed); $themes->set('tooltip', $tooltip); $themes->set('task', $task); $themes->set('class', $class); return $themes->output('html/table/published'); } /** * Renders a pending moderation icon * * @since 1.0.0 * @access public */ public function moderation($task) { $themes = $this->getTemplate(); $themes->set('task', $task); return $themes->output('html/table/moderation'); } /** * Renders a sortable table column * * @since 1.1.0 * @access public */ public function sort($title, $column, $currentOrdering, $currentDirection, $options = []) { $class = \FH::normalize($options, 'class', ''); $title = \JText::_($title); $currentOrdering = strtolower($currentOrdering); $currentDirection = strtolower($currentDirection); $column = strtolower($column); $themes = $this->getTemplate(); $themes->set('class', $class); $themes->set('column', $column); $themes->set('title', $title); $themes->set('currentOrdering', $currentOrdering); $themes->set('currentDirection', $currentDirection); return $themes->output('html/table/sort'); } /** * Renders a button to save order for the table column * * @since 1.1.0 * @access public */ public function saveOrder($task) { $themes = $this->getTemplate(); $themes->set('task', $task); return $themes->output('html/table/save.order'); } /** * Renders an order for each of the table items * * @since 1.1.0 * @access public */ public function order(Pagination $pagination, $name, $key, $saveOrder = false, $options = []) { $class = \FH::normalize($options, 'class', ''); $rowIndex = \FH::normalize($options, 'rowIndex', 0); $showArrowIcon = \FH::normalize($options, 'showArrowIcon', true); $orderUpTask = \FH::normalize($options, 'orderUpTask', ''); $orderDownTask = \FH::normalize($options, 'orderDownTask', ''); $showOrderUpIcon = \FH::normalize($options, 'showOrderUpIcon', true); $showOrderDownIcon = \FH::normalize($options, 'showOrderDownIcon', true); $accessControl = \FH::normalize($options, 'accessControl', true); $total = \FH::normalize($options, 'total', true); $themes = $this->getTemplate(); $themes->set('pagination', $pagination); $themes->set('name', $name); $themes->set('key', $key); $themes->set('saveOrder', $saveOrder); $themes->set('class', $class); $themes->set('rowIndex', $rowIndex); $themes->set('showArrowIcon', $showArrowIcon); $themes->set('orderUpTask', $orderUpTask); $themes->set('orderDownTask', $orderDownTask); $themes->set('showOrderUpIcon', $showOrderUpIcon); $themes->set('showOrderDownIcon', $showOrderDownIcon); $themes->set('accessControl', $accessControl); $themes->set('total', $total); return $themes->output('html/table/order'); } }PK ! � N� � placeholder.phpnu �[��� <?php /** * @package Foundry * @copyright Copyright (C) Stack Ideas Sdn Bhd. All rights reserved. * @license GNU/GPL, see LICENSE.php * Foundry 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. * See COPYRIGHT.php for copyright notices and details. */ namespace Foundry\Html; defined('_JEXEC') or die('Unauthorized Access'); use Foundry\Html\Base; class Placeholder extends Base { /** * Renders a placeholder for polls * * @since 1.0.0 * @access public */ public function polls() { static $output = null; if (is_null($output)) { $theme = $this->getTemplate(); $output = $theme->output('html/placeholder/polls'); } return $output; } /** * Renders the main placeholder. * * @since 1.0.0 * @access public */ public function box($shape = 'rounded', int $rows = 1, $aspectRatio = false, $args = []) { if (!in_array($shape, ['rounded', 'square'])) { $shape = 'rounded'; } $class = 'rounded-full'; if ($shape === 'square') { $class = 'rounded-md'; } $ratio = \FH::normalize($args, 'ratio', false); $roundedAspectRatio = \FH::normalize($args, 'roundedAspectRatio', true); $shrinkAspectRatio = \FH::normalize($args, 'shrinkAspectRatio', true); $aspectRatioSize = \FH::normalize($args, 'aspectRatioSize', '64'); $avatar = \FH::normalize($args, 'avatar', true); if (!in_array($aspectRatioSize, ['64', '300'])) { $aspectRatioSize = '64'; } if ($aspectRatio && !in_array($ratio, ['1/1', '16/9', '4/3', '3/4'])) { $ratio = '1/1'; } // standard or full $width = \FH::normalize($args, 'width', 'standard'); $widthModifier = 0; if ($width === 'full') { $widthModifier = 5; } // standard width $widthRatio = [ 'row_1' => 6 + $widthModifier . '/12', 'row_2' => 7 + $widthModifier . '/12', 'row_3' => 4 + $widthModifier . '/12', 'row_4' => 3 + $widthModifier . '/12', ]; $theme = $this->getTemplate(); $theme->set('class', $class); $theme->set('rows', $rows); $theme->set('aspectRatio', $aspectRatio); $theme->set('ratio', $ratio); $theme->set('roundedAspectRatio', $roundedAspectRatio); $theme->set('shrinkAspectRatio', $shrinkAspectRatio); $theme->set('aspectRatioSize', $aspectRatioSize); $theme->set('avatar', $avatar); $theme->set('widthRatio', $widthRatio); $output = $theme->output('html/placeholder/box'); return $output; } /** * Renders the standard placeholder. * * @since 1.0.0 * @access public */ public function standard($shape = 'rounded', int $rows = 3) { return $this->box($shape, $rows); } /** * Renders the placeholder with no avatar. * * @since 1.0.0 * @access public */ public function line(int $rows = 3) { // Avatar shape will be ignored when loading line. $shape = 'rounded'; return $this->box($shape, $rows, false, [ 'avatar' => false ]); } }PK ! N�E&& & attachment.phpnu �[��� <?php /** * @package Foundry * @copyright Copyright (C) Stack Ideas Sdn Bhd. All rights reserved. * @license GNU/GPL, see LICENSE.php * Foundry 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. * See COPYRIGHT.php for copyright notices and details. */ namespace Foundry\Html; defined('_JEXEC') or die('Unauthorized Access'); use Foundry\Html\Base; use Foundry\Libraries\Scripts; class Attachment extends Base { /** * Renders the attachment html output * * @since 1.1.3 * @access public */ public function item($attachment) { Scripts::load('lightbox'); $themes = $this->getTemplate(); $themes->set('attachment', $attachment); $output = $themes->output('html/attachment/item'); return $output; } /** * Renders the attachment html template that is used by respective extensions * * @since 1.1.3 * @access public */ public function template($options = []) { $download = \FH::normalize($options, 'download', false); $theme = $this->getTemplate(); $theme->set('download', $download); $output = $theme->output('html/attachment/template'); return $output; } } PK ! �"��&