function setTemplateInfo() { $objUtils = JSNUtils::getInstance(); $objReadXMLFile = new JSNReadXMLFile(); $templateManifest = $objReadXMLFile->getTemplateManifestFileInformation(); if ($templateManifest['edition'] != '' && $templateManifest['edition'] != 'free') { $edition = 'pro ' . $templateManifest['edition']; } else { $edition = 'free'; } $this->_edition = $edition; $this->_based_identified_name = ''; $this->_identified_name = str_replace('jsn', 'tpl', strtolower($templateManifest['name'])); $this->_joomla_version = $objUtils->getJoomlaVersion(true); $this->_full_name = strtolower($templateManifest['full_name']); $this->_name = strtolower($templateManifest['name']); $this->_template_version = $templateManifest['version']; }
* @author JoomlaShine.com http://www.joomlashine.com * @copyright Copyright (C) 2008 - 2011 JoomlaShine.com. All rights reserved. * @license GNU/GPL v2 http://www.gnu.org/licenses/gpl-2.0.html * @version $Id: jsn_autoupdater.php 11613 2012-03-08 09:31:14Z hieudm $ */ // No direct access defined('_JEXEC') or die('Restricted access'); require_once 'includes' . DS . 'jsn_defines.php'; require_once 'includes' . DS . 'lib' . DS . 'jsn_utils.php'; require_once 'includes' . DS . 'lib' . DS . 'jsn_readxmlfile.php'; require_once 'includes' . DS . 'lib' . DS . 'jsn_auto_updater_helper.php'; $session = JFactory::getSession(); $obj_read_xml_file = new JSNReadXMLFile(); $obj_utils = new JSNUtils(); $obj_updater_helper = new JSNAutoUpdaterHelper(); $template_manifest = $obj_read_xml_file->getTemplateManifestFileInformation(); $manifest_cache = $obj_utils->getTemplateManifestCache(); $manifest_cache = json_decode($manifest_cache); /* Determine front-end index path, including lang sef if available */ $frontIndexPath = JURI::root() . $obj_utils->determineFrontendIndex(); /* Form template identified_name */ $explodedName = explode('_', $template_manifest['name']); $templateIdName = 'tpl_' . $explodedName[1]; /* Get template latest version from session if possible */ $templateVersionSesId = md5('template_version_' . strtolower($template_manifest['full_name'])); $versionFromSes = $session->get($templateVersionSesId, null, 'jsntemplatesession'); if (!is_null($versionFromSes)) { $latest_version = $versionFromSes; } else { $latest_version = $obj_utils->getLatestProductVersion($templateIdName, 'template'); }
/** * @author JoomlaShine.com http://www.joomlashine.com * @copyright Copyright (C) 2008 - 2012 JoomlaShine.com. All rights reserved. * @license GNU/GPL v2 http://www.gnu.org/licenses/gpl-2.0.html * @version $Id: jsn_upgrade.php 13532 2012-06-26 03:20:42Z ngocpm $ */ // No direct access defined('_JEXEC') or die('Restricted access'); require_once 'includes' . DS . 'jsn_defines.php'; require_once 'includes' . DS . 'lib' . DS . 'jsn_utils.php'; require_once 'includes' . DS . 'lib' . DS . 'jsn_readxmlfile.php'; require_once 'includes' . DS . 'lib' . DS . 'jsn_proupgrade_helper.php'; $jsnUtils = new JSNUtils(); $jsnReadXml = new JSNReadXMLFile(); $joomlaVersion = $jsnUtils->getJoomlaVersion(true); $templateManifest = $jsnReadXml->getTemplateManifestFileInformation(); $templateLowName = strtolower($templateManifest['full_name']); $jsnUpgradeHelper = new JSNProUpgradeHelper($templateManifest, $joomlaVersion); $task = JRequest::getVar('task', ''); $manualUpgrade = JRequest::getVar('manual', 0); $autoUpgradeTried = JRequest::getVar('auto_tried', 0, 'GET'); $templateStyleId = JRequest::getInt('template_style_id', 0, 'GET'); $frontIndexPath = JURI::root() . $jsnUtils->determineFrontendIndex(); /* Session variables */ $session = JFactory::getSession(); $sessionTemp = array(); $sessionTemp['upgrader'] = md5('jsn_upgrader_' . $templateLowName); $sessionTemp['joomla_login'] = md5('joomla_login_' . $templateLowName); $sessionTemp['jsn_login'] = md5('jsn_login_' . $templateLowName); $sessionTemp['multiple_edition'] = md5('multiple_edition_' . $templateLowName); $sessionTemp['customer_post'] = md5('customer_post_' . $templateLowName);
function unpackPackage($p_file) { jimport('joomla.filesystem.archive'); $obj_read_xml_file = new JSNReadXMLFile(); $template_manifest = $obj_read_xml_file->getTemplateManifestFileInformation(); $tmp_dest = JPATH_ROOT . DS . 'tmp'; $prefix = $template_manifest['name'] . '_sample_data_'; $tmpdir = uniqid($prefix); $archive_name = $p_file; $extract_dir = JPath::clean($tmp_dest . DS . $tmpdir); $archive_name = JPath::clean($tmp_dest . DS . $archive_name); $result = @JArchive::extract($archive_name, $extract_dir); if ($result) { $path = $tmp_dest . DS . $tmpdir; return $path; } return false; }