function replaceCallback($attrs, $content) { AriKernel::import('DocsViewer.DocsViewer'); $params = $this->getParams($attrs, $content); $engine = AriUtils::getParam($attrs, 'engine', $this->_processParams->get('engine', 'iframe')); $model = AriDocsViewerHelper::getModel($engine); return $model ? $model->processContent($params, $content) : ''; }
function getModel($model, $prefix = 'DocsViewer') { $modelInstance = null; $model = ucfirst(JFilterInput::clean($model, 'WORD')); if (empty($model)) { return $modelInstance; } else { $modelName = $prefix . $model . 'Model'; $modelPath = dirname(__FILE__) . DS . 'Models' . DS . 'class.' . $modelName . '.php'; if (!@file_exists($modelPath)) { return $modelInstance; } else { AriKernel::import('DocsViewer.Models.' . $modelName); $modelClass = 'Ari' . $modelName; $modelInstance = new $modelClass(); } } return $modelInstance; }
function import($namespace) { $inst =& AriKernel::instance(); if (isset($inst->_loadedNamespace[$namespace])) { return; } $part = explode('.', $namespace); $lastPos = count($part) - 1; $part[$lastPos] = 'class.' . $part[$lastPos] . '.php'; $pathList = $inst->_frameworkPathList; $fileLocalPath = join('/', $part); foreach ($pathList as $path) { $filePath = $path . $fileLocalPath; if (file_exists($filePath)) { require_once $filePath; $inst->_loadedNamespace[$namespace] = true; break; } } }
<?php defined('ARI_FRAMEWORK_LOADED') or die('Direct Access to this location is not allowed.'); AriKernel::import('Flickr.Flickr'); class AriFlickrProvider extends AriObject { var $_cacheDir; var $_flickr; var $_typeMapping = array( 'thumbnail' => 't', 'square' => 'sq', 'small' => 's', 'medium' => 'm', 'large' => 'l' ); function __construct($params, $cacheDir = null, $ext = null) { if (is_null($cacheDir)) { $cacheDir = JPATH_ROOT . DS . 'cache'; if (!is_null($ext)) { $extCacheDir = $cacheDir . DS . $ext; if (file_exists($extCacheDir) && is_dir($extCacheDir)) $cacheDir = $extCacheDir; } }
function getLightboxEngine($params) { $engine = null; $engineName = ucfirst(JFilterInput::clean($params->get('lightboxEngine'), 'WORD')); if (empty($engineName)) { return null; } AriKernel::import('CloudCarousel.Lightbox.' . $engineName); $className = $engineName . 'CarouselEngine'; if (class_exists($className)) { $engine = new $className(); if (!$engine->preCheck()) { $engine = null; } } return $engine; }
* */ defined('_JEXEC') or die('Restricted access'); require_once dirname(__FILE__) . '/includes/kernel/class.AriKernel.php'; AriKernel::import('Utils.Utils2'); AriKernel::import('Joomla.JoomlaUtils'); AriKernel::import('Document.DocumentHelper'); AriKernel::import('Template.Template'); AriKernel::import('SimpleTemplate.SimpleTemplate'); AriKernel::import('Web.HtmlHelper'); AriKernel::import('Web.JSON.JSONHelper'); AriKernel::import('Parameters.ParametersHelper'); AriKernel::import('SexyLightbox.SexyLightbox'); $params->set('key', 'arisexybox_mod_' . $module->id); $params->set('checkSum', md5($module->params)); $groupName = $params->get('groupName'); $thumbQuality = intval($params->get('thumbQuality', 80), 10); if (!defined('ASIDO_GD_JPEG_QUALITY')) define('ASIDO_GD_JPEG_QUALITY', $thumbQuality); if (empty($groupName)) $params->set('groupName', uniqid('asexy_')); $autoShow = $params->get('autoShow'); $showOnClose = $params->get('showOnClose'); $mParams = AriParametersHelper::flatParametersToArray($params); AriSexyLightboxHelper::includeAssets( AriUtils2::parseValueBySample($params->get('includeJQuery'), true), AriUtils2::parseValueBySample($params->get('noConflict'), true),
public static function getLightboxEngine($params) { $engine = null; $filter = JFilterInput::getInstance(); $engineName = ucfirst($filter->clean($params->get('lightboxEngine'), 'WORD')); if (empty($engineName)) { return null; } AriKernel::import('ImageSlider.Lightbox.' . $engineName); $className = $engineName . 'ImageSliderEngine'; if (class_exists($className)) { $engine = new $className(); if (!$engine->preCheck()) { $engine = null; } } return $engine; }
<?php /* * ARI Framework Lite * * @package ARI Framework Lite * @version 1.0.0 * @author ARI Soft * @copyright Copyright (c) 2009 www.ari-soft.com. All rights reserved * @license GNU/GPL (http://www.gnu.org/copyleft/gpl.html) * */ defined('ARI_FRAMEWORK_LOADED') or die('Direct Access to this location is not allowed.'); AriKernel::import('Core.Error'); class AriObject { var $_lastError = null; var $_configProps = array(); function AriObject() { $args = func_get_args(); call_user_func_array(array(&$this, '__construct'), $args); } function __construct() { } function _registerErrorHandler() { set_error_handler(array(&$this, 'errorHandler')); } function errorHandler($errNo, $errStr, $errFile, $errLine)
<?php defined('ARI_FRAMEWORK_LOADED') or die('Direct Access to this location is not allowed.'); AriKernel::import('Picasa.Picasa'); class AriPicasaProvider extends AriObject { var $_cacheDir; var $_picasa; function __construct($params, $cacheDir = null, $ext = null) { if (is_null($cacheDir)) { $cacheDir = JPATH_ROOT . DS . 'cache'; if (!is_null($ext)) { $extCacheDir = $cacheDir . DS . $ext; if (file_exists($extCacheDir) && is_dir($extCacheDir)) $cacheDir = $extCacheDir; } } $this->_cacheDir = $cacheDir; $cachePeriod = @intval($params['cachePeriod'], 10); $picasa = new AriPicasa(); if ($cachePeriod > 0 && $this->_cacheDir) $picasa->enableCache($this->_cacheDir, $cachePeriod);
<?php /* * ARI Framework Lite * * @package ARI Framework Lite * @version 1.0.0 * @author ARI Soft * @copyright Copyright (c) 2009 www.ari-soft.com. All rights reserved * @license GNU/GPL (http://www.gnu.org/copyleft/gpl.html) * */ defined('ARI_FRAMEWORK_LOADED') or die('Direct Access to this location is not allowed.'); if (!class_exists('Asido')) { AriKernel::import('Image.Asido.asido'); } class AriAsidoHelper extends AriObject { function init($preferDrivers = array('gd', 'imagick2', 'imagick', 'magickwand')) { $alias = array('imagick2' => 'imagick2_ext', 'imagick' => 'imagick_ext', 'magickwand' => 'magick_wand'); reset($preferDrivers); foreach ($preferDrivers as $driver) { if (AriAsidoHelper::isExtensionLoaded(array($driver))) { if (array_key_exists($driver, $alias)) { $driver = $alias[$driver]; } asido::driver($driver); return true; } }
/* * ARI Sexy Lightbox * * @package ARI Sexy Lightbox * @version 1.0.0 * @author ARI Soft * @copyright Copyright (c) 2010 www.ari-soft.com. All rights reserved * @license GNU/GPL (http://www.gnu.org/copyleft/gpl.html) * */ defined('ARI_FRAMEWORK_LOADED') or die('Direct Access to this location is not allowed.'); AriKernel::import('Module.Providers.PicasaProvider'); AriKernel::import('Module.Lightbox.Models.GalleryModel'); AriKernel::import('SexyLightbox.Models.Templates.SimpleGalleryTemplate'); class AriSexyLightboxPicasaModel extends AriGalleryModel { var $_prefix = 'AriSexyLightbox'; function execute($modelParams, $params, $templatePath) { if (!$this->checkCompatibility()) return ; $picasaProvider = new AriPicasaProvider($modelParams, null, 'mod_arisexylightbox'); if ($modelParams['type'] == 'customtext') { $cId = uniqid('asb_', false);
<?php defined('ARI_FRAMEWORK_LOADED') or die('Direct Access to this location is not allowed.'); AriKernel::import('SimpleTemplate.Filters.Truncate'); AriKernel::import('SimpleTemplate.Filters.HtmlTruncate'); AriKernel::import('SimpleTemplate.Filters.RestoreTags'); AriKernel::import('SimpleTemplate.Filters.StripTags'); AriKernel::import('SimpleTemplate.Filters.UpperCase'); AriKernel::import('SimpleTemplate.Filters.LowerCase'); AriKernel::import('SimpleTemplate.Filters.Empty'); ?>
<?php /* * ARI Framework Lite * * @package ARI Framework Lite * @version 1.0.0 * @author ARI Soft * @copyright Copyright (c) 2009 www.ari-soft.com. All rights reserved * @license GNU/GPL (http://www.gnu.org/copyleft/gpl.html) * */ defined('ARI_FRAMEWORK_LOADED') or die('Direct Access to this location is not allowed.'); if (!class_exists('Asido')) AriKernel::import('Image.Asido.asido'); class AriAsidoHelper extends AriObject { function init($preferDrivers = array('gd', 'imagick2', 'imagick', 'magickwand')) { $alias = array('imagick2' => 'imagick2_ext', 'imagick' => 'imagick_ext', 'magickwand' => 'magick_wand'); reset($preferDrivers); foreach ($preferDrivers as $driver) { if (AriAsidoHelper::isExtensionLoaded(array($driver))) { if (array_key_exists($driver, $alias)) $driver = $alias[$driver]; asido::driver($driver);
<?php defined('ARI_FRAMEWORK_LOADED') or die('Direct Access to this location is not allowed.'); AriKernel::import('Image.ImageHelper'); AriKernel::import('CSV.CSVParser'); AriKernel::import('SimpleTemplate.SimpleTemplate'); AriKernel::import('Utils.AppUtils'); jimport('joomla.filesystem.path'); jimport('joomla.filesystem.folder'); class AriThumbnailProvider extends AriObject { var $_prefix; var $_cacheDir; function __construct($prefix = 'arithumb', $cacheDir = null, $ext = null) { if (is_null($cacheDir)) { $cacheDir = JPATH_ROOT . DS . 'cache'; if (!is_null($ext)) { $extCacheDir = $cacheDir . DS . $ext; if (file_exists($extCacheDir) && is_dir($extCacheDir)) $cacheDir = $extCacheDir; } } $this->_prefix = $prefix;
<?php defined('ARI_FRAMEWORK_LOADED') or die('Direct Access to this location is not allowed.'); AriKernel::import('SimpleTemplate.Filters.FilterBase'); AriKernel::import('Text.Text'); class AriSimpleTemplateHtmlTruncateFilter extends AriSimpleTemplateFilterBase { function getFilterName() { return 'html_truncate'; } function parse($string, $length = null, $addstring = '...') { $length = @intval($length, 10); if ($length < 1 || empty($string) || strlen($string) <= $length) return $string; if (empty($addstring)) $addstring = ''; $isText = true; $ret = ''; $i = 0; $currentChar = ''; $lastSpacePosition = -1; $lastChar = ''; $tagsArray = array(); $currentTag = '';
<?php defined('ARI_FRAMEWORK_LOADED') or die('Direct Access to this location is not allowed.'); $id = uniqid('asg_', false); $repeater = $params['repeater']; $modParams = $params['params']; $slickGalleryPath = JPATH_ROOT . DS . 'modules' . DS . 'mod_arislickgallery' . DS . 'mod_arislickgallery' . DS . 'kernel' . DS . 'class.AriKernel.php'; require_once $slickGalleryPath; AriKernel::import('SlickGallery.SlickGallery'); $sgParams = new JParameter(''); $sgParams->def('includeJQuery', '0'); $sgParams->def('width', intval($modParams['width'], 10)); $sgParams->def('height', intval($modParams['height'], 10)); $showTitle = (bool)AriUtils::getParam($modParams, 'showTitle', true); if (!$showTitle) { $cssStyles = '#' . $id . ' .arislickgallery-title{text-indent:-9999em}'; $document =& JFactory::getDocument(); $document->addStyleDeclaration($cssStyles); } AriSlickGalleryHelper::initGallery($id, $sgParams); ?> <div class="ari-slick-gallery" id="<?php echo $id; ?>">
<?php /* * ARI Sexy Lightbox * * @package ARI Sexy Lightbox * @version 1.0.0 * @author ARI Soft * @copyright Copyright (c) 2010 www.ari-soft.com. All rights reserved * @license GNU/GPL (http://www.gnu.org/copyleft/gpl.html) * */ defined('ARI_FRAMEWORK_LOADED') or die('Direct Access to this location is not allowed.'); AriKernel::import('Module.Model'); class AriSexyLightboxModel extends AriModuleModelBase { var $_prefix = 'AriSexyLightbox'; } ?>
* @package ARI Image Slider Joomla! module. * @version 1.0.0 * @author ARI Soft * @copyright Copyright (c) 2010 www.ari-soft.com. All rights reserved * @license GNU/GPL (http://www.gnu.org/copyleft/gpl.html) * */ defined('_JEXEC') or die('Restricted access'); if (version_compare(PHP_VERSION, '5.3.0') >= 0) { $error_reporting = ini_get('error_reporting'); $error_reporting &= ~E_STRICT; error_reporting($error_reporting); } require_once dirname(__FILE__) . '/mod_ariimageslider/kernel/class.AriKernel.php'; AriKernel::import('ImageSlider.ImageSlider'); AriKernel::import('Web.HtmlHelper'); $sliderId = 'ais_' . $module->id;//uniqid('ais_', false); AriImageSliderHelper::initSlider($sliderId, $params); $slides = AriImageSliderHelper::prepareSlides( AriImageSliderHelper::getSlides($params), $params); require JModuleHelper::getLayoutPath('mod_ariimageslider'); ?>
<?php /* * ARI Framework Lite * * @package ARI Framework Lite * @version 1.0.0 * @author ARI Soft * @copyright Copyright (c) 2009 www.ari-soft.com. All rights reserved * @license GNU/GPL (http://www.gnu.org/copyleft/gpl.html) * */ defined('_JEXEC') or die('Restricted access'); require_once dirname(__FILE__) . '/../kernel/class.AriKernel.php'; AriKernel::import('Xml.XmlHelper'); jimport('joomla.html.html'); jimport('joomla.form.formfield'); class JFormFieldAriheader extends JFormField { protected $type = 'Ariheader'; function getInput() { $this->_includeAssets(); return $this->fetchElement($this->element['name'], $this->value, $this->element, $this->name); } function fetchElement($name, $value, &$node, $control_name) { $options = array(JText::_($value)); foreach ($node->children() as $option) { $options[] = AriXmlHelper::getData($option); }
/* * ARI Ext menu Joomla! module * * @package ARI Ext Menu Joomla! module. * @version 1.0.0 * @author ARI Soft * @copyright Copyright (c) 2009 www.ari-soft.com. All rights reserved * @license GNU/GPL (http://www.gnu.org/copyleft/gpl.html) * */ defined('_JEXEC') or die('Restricted access'); require_once dirname(__FILE__) . '/mod_ariextmenu/kernel/class.AriKernel.php'; AriKernel::import('Utils.Utils'); AriKernel::import('Menu.Menu'); AriKernel::import('Web.HtmlHelper'); AriKernel::import('ExtMenu.ExtMenu'); AriKernel::import('Template.Template'); $menu = new AriMenu($params->get('menutype', 'mainmenu')); $menuLevel = $menuStartLevel = intval($params->get('startLevel', 0), 10); $menuEndLevel = intval($params->get('endLevel', 0), 10); $uniqueId = (bool) $params->get('uniqId', false); $activeMenuItem = $menu->getActive(); // Template parameters $menuDirection = $params->get('direction'); $menuId = !$uniqueId ? 'ariext' . $module->id : uniqid('aext', false); $hlCurrentItem = (bool) $params->get('highlightCurrent', true) && !is_null($activeMenuItem); $hlOnlyActiveItems = (bool) $params->get('onlyActiveItems', false); $activeTopId = $activeMenuItem ? $activeMenuItem->id : 0; AriExtMenuHelper::initMenu($menuId, $params); require JModuleHelper::getLayoutPath('mod_ariextmenu');
<?php defined('ARI_FRAMEWORK_LOADED') or die('Direct Access to this location is not allowed.'); AriKernel::import('Mambot.MambotBase'); AriKernel::import('SimpleTemplate.SimpleTemplate'); class AriRepeaterWebControl extends AriObject { var $_template; var $_data; function __construct($template, $data) { $this->_template = $template; $this->_data = $data; } function render($attrs = null) { $rpt = new AriRepeaterMainTemplate(); $rpt->processContent($this->_template); echo $rpt->render($this->_data); } } class AriRepeaterMainTemplate extends AriMambotBase { var $_headerTemplate; var $_footerTemplate; var $_rowTemplate;
<?php /* * ARI Framework Lite * * @package ARI Framework Lite * @version 1.0.0 * @author ARI Soft * @copyright Copyright (c) 2009 www.ari-soft.com. All rights reserved * @license GNU/GPL (http://www.gnu.org/copyleft/gpl.html) * */ defined('ARI_FRAMEWORK_LOADED') or die('Direct Access to this location is not allowed.'); AriKernel::import('Image.ImageHelper'); AriKernel::import('CSV.CSVParser'); jimport('joomla.filesystem.path'); jimport('joomla.filesystem.folder'); class AriFolder { function files($path, $filter = '.', $recurse = false, $fullpath = false, $sort = null, $exclude = array('.svn', 'CVS')) { $files = JFolder::files($path, $filter, $recurse, $fullpath, $exclude); if (!is_null($sort) && !empty($sort['sortBy']) && !empty($files)) { $files = AriFolderSorter::sort($files, $sort['sortBy'], !empty($sort['sortDir']) ? $sort['sortDir'] : 'asc'); } return $files; } function clean(&$path) { $path = JPath::clean($path); $path = trim($path, '\\/');
<?php /* * ARI Sexy Lightbox * * @package ARI Sexy Lightbox * @version 1.0.0 * @author ARI Soft * @copyright Copyright (c) 2010 www.ari-soft.com. All rights reserved * @license GNU/GPL (http://www.gnu.org/copyleft/gpl.html) * */ defined('ARI_FRAMEWORK_LOADED') or die('Direct Access to this location is not allowed.'); AriKernel::import('SexyLightbox.Models.SexyLightboxModel'); class AriSexyLightboxIcontentModel extends AriSexyLightboxModel { function execute($modelParams, $params, $templatePath) { $modelParams['modal'] = $params['_default']['modal']; $modelParams['group'] = $params['_default']['groupName']; $modelParams['bgColor'] = isset($params['_default']['bgColor']) ? $params['_default']['bgColor'] : ''; parent::execute($modelParams, $params, $templatePath); } } ?>
<?php defined('_JEXEC') or die ('Restricted access'); require_once dirname(__FILE__) . '/../kernel/class.AriKernel.php'; AriKernel::import('Web.JSON.JSONHelper'); jimport('joomla.html.html'); jimport('joomla.form.formfield'); jimport('joomla.form.form'); class JFormFieldFieldsgroups extends JFormField { protected $type = 'Fieldsgroups'; public function getInput() { return $this->fetchElement($this->element['name'], $this->value, $this->element, $this->name); } public function getLabel() { return ''; } protected function fetchElement($name, $value, $node, $control_name) { $selectId = str_replace(array('[', ']'), array('_', ''), $control_name); $this->includeAssets(); $containerId = uniqid('groups', false);
<?php /* * ARI Image Slider * * @package ARI Image Slider * @version 1.0.0 * @author ARI Soft * @copyright Copyright (c) 2010 www.ari-soft.com. All rights reserved * @license GNU/GPL (http://www.gnu.org/copyleft/gpl.html) * */ defined('ARI_FRAMEWORK_LOADED') or die('Direct Access to this location is not allowed.'); AriKernel::import('ImageSlider.Lightbox.LightboxEngine'); class RokboxImageSliderEngine extends AriImageSliderLightboxEngine { function preCheck() { $plgPath = JPATH_ROOT . DS . 'plugins' . DS . 'system' . DS . 'rokbox.php'; if (!@file_exists($plgPath)) { global $mainframe; $mainframe->enqueueMessage('<b>ARI Image Slider</b>: "System - RokBox" plugin isn\'t installed.'); return false; } return true; } function modifyAttrs($lnkAttrs, $imgAttrs, $group, $params) { $lnkAttrs['rel'] = sprintf('rokbox[%d %d]', intval($params->get('lightbox_width'), 10), intval($params->get('lightbox_height'), 10)); if ($group) { $lnkAttrs['rel'] .= '(' . str_replace('_', '', $group) . ')';
array_unshift($params, $value); $value = call_user_func_array(array($filter, 'parse'), $params); } return $value; } function filterExists($name) { return isset($this->_filters[$name]); } function registerFilter($name, $filter) { $this->_filters[$name] = $filter; } function getFilter($name) { $filter = null; if ($this->filterExists($name)) { $filter = $this->_filters[$name]; } return $filter; } } AriKernel::import('SimpleTemplate.Filters.LoadAll'); ?>
<?php /* * ARI Framework Lite * * @package ARI Framework Lite * @version 1.0.0 * @author ARI Soft * @copyright Copyright (c) 2009 www.ari-soft.com. All rights reserved * @license GNU/GPL (http://www.gnu.org/copyleft/gpl.html) * */ defined('ARI_FRAMEWORK_LOADED') or die('Direct Access to this location is not allowed.'); AriKernel::import('Web.JSON.JSON'); class AriJSONHelper { function encode($data) { $jsonHandler =& AriJSONHelper::_getJSONHandler(); return $jsonHandler->encode($data); } function decode($str) { if (empty($str)) return null; $jsonHandler =& AriJSONHelper::_getJSONHandler();
<?php /* * ARI Cloud Carousel * * @package ARI Cloud Carousel * @version 1.0.0 * @author ARI Soft * @copyright Copyright (c) 2010 www.ari-soft.com. All rights reserved * @license GNU/GPL (http://www.gnu.org/copyleft/gpl.html) * */ defined('ARI_FRAMEWORK_LOADED') or die('Direct Access to this location is not allowed.'); AriKernel::import('CloudCarousel.Lightbox.LightboxEngine'); class AriprettyphotoCarouselEngine extends AriCloudCarouselLightboxEngine { function preCheck() { $version = new JVersion(); $j15 = version_compare($version->getShortVersion(), '1.6.0', '<'); $plgPath = JPATH_ROOT . DS . 'plugins' . DS . 'system' . DS . (!$j15 ? 'ariprettyphoto' . DS : '') . 'ariprettyphoto.php'; if (!@file_exists($plgPath)) { $mainframe =& JFactory::getApplication(); $mainframe->enqueueMessage('<b>ARI Cloud Carousel</b>: "System - ARI Pretty Photo" plugin isn\'t installed.'); return false; } return true; } function modifyAttrs($lnkAttrs, $imgAttrs, $group, $params) { $lnkAttrs['rel'] = 'prettyPhoto';
<?php defined('ARI_FRAMEWORK_LOADED') or die('Direct Access to this location is not allowed.'); AriKernel::import('Image.Asido.AsidoHelper'); AriKernel::import('Utils.Utils'); class AriImageHelper extends AriObject { function getThumbnailDimension($path, $w, $h) { $dim = array('w' => $w, 'h' => $h); if ($w && $h || (!$w && !$h)) return $dim; if (@is_readable($path) && function_exists('getimagesize')) { $info = @getimagesize($path); if (!empty($info) && count($info) > 1) { if (empty($w)) { $w = round($h * $info[0] / $info[1]); $dim['w'] = $w; } else { $h = round($w * $info[1] / $info[0]); $dim['h'] = $h; } } }
<?php defined('ARI_FRAMEWORK_LOADED') or die('Direct Access to this location is not allowed.'); AriKernel::import('SimpleTemplate.Filters.FilterBase'); class AriSimpleTemplateUpperCaseFilter extends AriSimpleTemplateFilterBase { function getFilterName() { return 'upper_case'; } function parse($value) { return strtoupper($value); } } new AriSimpleTemplateUpperCaseFilter(); ?>