예제 #1
0
 */
// 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');
}
if ($template_manifest['edition'] != '' && $template_manifest['edition'] != 'free') {
    $edition = $template_manifest['edition'];
} else {
    $edition = 'free';