define('DS', DIRECTORY_SEPARATOR); // Define base directory define('JPATH_BASE', str_replace('/', DIRECTORY_SEPARATOR, str_replace('plugins/system/jsnmobilize/libraries/joomlashine/response/image/resizer.php', '', str_replace('\\', '/', __FILE__)))); // Initialize Joomla framework require_once JPATH_BASE . '/includes/defines.php'; require_once JPATH_BASE . '/includes/framework.php'; // Instantiate the application $app = JFactory::getApplication('site'); // Initialize JSN Framework require_once JPATH_ROOT . DS . 'plugins' . DS . 'system' . DS . 'jsnframework' . DS . 'jsnframework.php'; $dispatcher = JDispatcher::getInstance(); $jsnframework = new PlgSystemJSNFramework($dispatcher); $jsnframework->onAfterInitialise(); // Initialize JSN Mobilize require_once JPATH_ROOT . DS . 'plugins' . DS . 'system' . DS . 'jsnmobilize' . DS . 'jsnmobilize.php'; $jsnmobilize = new PlgSystemJSNMobilize($dispatcher); $jsnmobilize->onAfterInitialise(); // Initialize variables if (!isset($_REQUEST['src']) or !isset($_REQUEST['width']) or !isset($_REQUEST['dest'])) { jexit(JText::_('JSN_MOBILIZE_INVALID_REQUEST')); } $src = $_REQUEST['src']; $width = $_REQUEST['width']; $dest = $_REQUEST['dest']; // Load necessary Joomla libraries jimport('joomla.filesystem.file'); jimport('joomla.filesystem.folder'); // Load image manipulation library require_once JPATH_ROOT . DS . 'plugins' . DS . 'system' . DS . 'jsnmobilize' . DS . 'libraries' . DS . '3rd-party' . DS . 'ace-media-image' . DS . 'image.php'; // Resize the original image to requested width $image = new Ace_Media_Image($_SERVER['DOCUMENT_ROOT'] . DS . str_replace('/', DS, $src));
/** * Load plugin language. * * @return void */ private function _loadLanguage() { // Get active language $language = JFactory::getLanguage(); self::$_app = JFactory::getApplication(); // Check if language file exists for active language if (!file_exists(JPATH_ROOT . '/administrator/language/' . $language->getDefault() . '/' . $language->getDefault() . '.plg_system_jsnmobilize.ini')) { // If requested component has the language file, install then load it if (file_exists(JPATH_ROOT . '/administrator/components/' . self::$_app->input->getCmd('option') . '/language/admin/' . $language->getDefault() . '/' . $language->getDefault() . '.plg_system_jsnmobilize.ini')) { JSNLanguageHelper::install((array) $language->getDefault(), false, true); $language->load('plg_system_jsnmobilize', JPATH_BASE, null, true); } else { $language->load('plg_system_jsnmobilize', dirname(__FILE__), null, true); } } else { $language->load('plg_system_jsnmobilize', JPATH_BASE, null, true); } }