Example #1
0
function com_install()
{
    global $cloneManifest, $mainframe, $cloneParent;
    $session =& JFactory::getSession();
    $si = new SubInstaller();
    $ret = $si->install();
    $errorArray = $si->getError();
    $session->set('jsn_install_error', $errorArray);
    $document =& $cloneManifest->document;
    $version =& $document->getElementByPath('version');
    $edition =& $document->getElementByPath('edition');
    $version = $version->data();
    $edition = str_replace(' ', '_', JString::strtolower($edition->data()));
    $packageFile = JPATH_ROOT . DS . 'tmp' . DS . 'jsn_imageshow_' . $edition . '_' . $version . '_install.zip';
    $packageExtDir = $cloneParent->getPath('source');
    $flagInstallation = false;
    $disable = '';
    $resultCheckManifestFile = checkManifestFileExist();
    if ($resultCheckManifestFile == true) {
        $objUpgradeHelper = new JSNUpgradeHelper($cloneManifest);
        $objUpgradeHelper->executeUpgrade();
        $objUpgradeDBUtil = new JSNISUpgradeDBUtil($cloneManifest);
        $objUpgradeDBUtil->executeUpgradeDB();
    }
    if (!$cloneParent->copyManifest()) {
        $cloneParent->abort(JText::_('Component') . ' ' . JText::_('Install') . ': ' . JText::_('Could not copy setup file'));
        return false;
    }
    removeFile($packageFile);
    removeFolder($packageExtDir);
    $mainframe->redirect('index.php?option=com_imageshow&controller=installer&task=installcore');
}
 public function preflight($mode, $parent)
 {
     $this->_parent = $parent->getParent();
     $this->_manifest = $this->_parent->getManifest();
     $this->_currentVersion = $this->_manifest->version;
     $this->_currentEdition = $this->_manifest->edition;
     $errorFolders = $this->_checkFolderUnwritable();
     if (count($errorFolders)) {
         $msg = '</li><li>Following folder(s) must have Writable permission during installation process:</li><li><br/></li>';
         foreach ($errorFolders as $folder) {
             $msg .= '<li>' . $folder;
             if ($folder == '/language' || $folder == '/administrator/language') {
                 $msg .= ' (including all subfolders)';
             }
             $msg .= '</li>';
         }
         $msg .= '<li><br/></li><li>Please set Writable permission to appropriate folder(s) and reinstall the extension.';
         $this->_parent->abort($msg);
         return false;
     }
     if ($this->_checkManifestFileExist()) {
         $file = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_imageshow' . DS . 'classes' . DS . 'jsn_is_readxmldetails.php';
         if (JFile::exists($file)) {
             include_once $file;
             $objectReadxmlDetail = new JSNISReadXmlDetails();
             $info = $objectReadxmlDetail->parserXMLDetails();
             $this->_previousVersion = $info['version'];
             $tmpCurrentVersion = (double) str_replace('.', '', $this->_currentVersion);
             $tmpPrevioustVersion = (double) str_replace('.', '', $this->_previousVersion);
             if ($tmpCurrentVersion < $tmpPrevioustVersion) {
                 $msg = JText::sprintf('You cannot install an older version %s on top of the newer version %s', $this->_currentVersion, $this->_previousVersion);
                 $this->_parent->abort($msg);
                 return false;
             }
         }
         $fileUpgrade = $this->_parent->getPath('source') . DS . 'admin' . DS . 'subinstall' . DS . 'upgrade.helper.php';
         if (JFile::exists($fileUpgrade)) {
             require_once $fileUpgrade;
             $objUpgradeHelper = new JSNUpgradeHelper($this->_manifest);
             $objUpgradeHelper->executeUpgrade();
         }
         $this->_updateSchema($this->_previousVersion);
         $this->_updateMenu();
     } else {
         $session = JFactory::getSession();
         $session->set('preversion', null, 'jsnimageshow');
     }
     return true;
 }
 /**
  * Implement preflight hook.
  *
  * This step will be verify permission for install/update process.
  *
  * @param   string  $mode    Install or update?
  * @param   object  $parent  JInstaller object.
  *
  * @return  boolean
  */
 public function preflight($mode, $parent)
 {
     // Initialize variables
     $installer = $parent->getParent();
     $this->parentInstaller = $parent->getParent();
     $this->app = JFactory::getApplication();
     $this->manifest = $this->parentInstaller->getManifest();
     // Get installed extension directory and name
     $this->path = $this->parentInstaller->getPath('extension_administrator');
     $this->name = substr(basename($this->path), 4);
     // Check if installed Joomla version is compatible
     $joomlaVersion = new JVersion();
     $canInstall = substr($joomlaVersion->RELEASE, 0, 1) == substr((string) $this->manifest['version'], 0, 1) ? true : false;
     if (!$canInstall) {
         $this->app->enqueueMessage(sprintf('Cannot install "%s" because the installation package is not compatible with your installed Joomla version', (string) $this->manifest->name), 'error');
     }
     // Parse dependency
     $this->parseDependency($this->parentInstaller);
     // Check environment
     $canInstallExtension = true;
     $canInstallSiteLanguage = is_writable(JPATH_SITE . '/language');
     $canInstallAdminLanguage = is_writable(JPATH_ADMINISTRATOR . '/language');
     if (!$canInstallSiteLanguage) {
         $this->app->enqueueMessage(sprintf('Cannot install language file at "%s"', JPATH_SITE . '/language'), 'error');
     } else {
         foreach (glob(JPATH_SITE . '/language/*', GLOB_ONLYDIR) as $dir) {
             if (!is_writable($dir)) {
                 $canInstallSiteLanguage = false;
                 $this->app->enqueueMessage(sprintf('Cannot install language file at "%s"', $dir), 'error');
             }
         }
     }
     if (!$canInstallAdminLanguage) {
         $this->app->enqueueMessage(sprintf('Cannot install language file at "%s"', JPATH_ADMINISTRATOR . '/language'), 'error');
     } else {
         foreach (glob(JPATH_ADMINISTRATOR . '/language/*', GLOB_ONLYDIR) as $dir) {
             if (!is_writable($dir)) {
                 $canInstallAdminLanguage = false;
                 $this->app->enqueueMessage(sprintf('Cannot install language file at "%s"', $dir), 'error');
             }
         }
     }
     // Checking directory permissions for dependency installation
     foreach ($this->dependencies as &$extension) {
         // Simply continue if extension is set to be removed
         if (isset($extension->remove) and (int) $extension->remove > 0) {
             continue;
         }
         // Check if dependency can be installed
         switch ($extension->type = strtolower($extension->type)) {
             case 'component':
                 $sitePath = JPATH_SITE . '/components';
                 $adminPath = JPATH_ADMINISTRATOR . '/components';
                 if (!is_dir($sitePath) or !is_writable($sitePath)) {
                     $canInstallExtension = false;
                     $this->app->enqueueMessage(sprintf('Cannot install "%s" %s because "%s" is not writable', $extension->name, $extension->type, $sitePath), 'error');
                 }
                 if (!is_dir($adminPath) or !is_writable($adminPath)) {
                     $canInstallExtension = false;
                     $this->app->enqueueMessage(sprintf('Cannot install "%s" %s because "%s" is not writable', $extension->name, $extension->type, $adminPath), 'error');
                 }
                 break;
             case 'plugin':
                 $path = JPATH_ROOT . '/plugins/' . $extension->folder;
                 if (is_dir($path) and !is_writable($path) or !is_dir($path) and !is_writable(dirname($path))) {
                     $canInstallExtension = false;
                     $this->app->enqueueMessage(sprintf('Cannot install "%s" %s because "%s" is not writable', $extension->name, $extension->type, $path), 'error');
                 }
                 break;
             case 'module':
             case 'template':
                 $path = ($extension->client == 'site' ? JPATH_SITE : JPATH_ADMINISTRATOR) . "/{$extension->type}s";
                 if (!is_dir($path) or !is_writable($path)) {
                     $canInstallExtension = false;
                     $this->app->enqueueMessage(sprintf('Cannot install "%s" %s because "%s" is not writable', $extension->name, $extension->type, $path), 'error');
                 }
                 break;
         }
         if ($canInstall and $canInstallExtension and $canInstallSiteLanguage and $canInstallAdminLanguage and isset($extension->source)) {
             // Backup dependency parameters
             $db = JFactory::getDbo();
             $q = $db->getQuery(true);
             $q->select('params');
             $q->from('#__extensions');
             $q->where("element = '{$extension->name}'");
             $q->where("type = '{$extension->type}'");
             $extension->type != 'plugin' or $q->where("folder = '{$extension->folder}'");
             $db->setQuery($q);
             $extension->params = $db->loadResult();
         }
     }
     /******************************* JSN IMAGESHOW ***************************************/
     if ($canInstall && $canInstallExtension && $canInstallSiteLanguage && $canInstallAdminLanguage) {
         $extInfo = $this->getExtInfo();
         if (!is_null($extInfo)) {
             $info = json_decode($extInfo->manifest_cache);
             if (version_compare($info->version, '4.0.0') == -1) {
                 $this->app->enqueueMessage('JSN ImageShow no longer supports all versions that are older than 4.0.0. Please make a backup file and uninstall current version, then install the latest version and restore data', 'error');
                 return false;
             }
             if (version_compare($this->manifest->version, $info->version) == -1) {
                 $this->app->enqueueMessage(sprintf('You cannot install an older version %s on top of the newer version %s', $this->manifest->version, $info->version), 'error');
                 return false;
             }
             $session = JFactory::getSession();
             $session->set('preversion', $info->version, 'jsnimageshow');
             /*The code portion only to maintain for version 4.5.0. Dreprecated*/
             if ($this->manifest->version == '4.5.0') {
                 $fileISData = $this->parentInstaller->getPath('source') . DIRECTORY_SEPARATOR . 'admin' . DIRECTORY_SEPARATOR . 'classes' . DIRECTORY_SEPARATOR . 'jsn_is_data.php';
                 if (is_file($fileISData)) {
                     $dest = JPATH_ADMINISTRATOR . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_imageshow' . DIRECTORY_SEPARATOR . 'classes' . DIRECTORY_SEPARATOR . 'jsn_is_data.php';
                     @copy($fileISData, $dest);
                 }
             }
             /*The code portion only to maintain for version 4.5.0. Dreprecated*/
             /*include_once JPATH_ROOT . DIRECTORY_SEPARATOR . 'administrator' . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_imageshow'. DIRECTORY_SEPARATOR . 'classes' . DIRECTORY_SEPARATOR . 'jsn_is_factory.php';
             
             				$objJSNBackUp = JSNISFactory::getObj('classes.jsn_is_backup');
             				$objJSNBackUp->createBackUpFileForMigrate();*/
             $fileUpgradeHelper = $this->parentInstaller->getPath('source') . DIRECTORY_SEPARATOR . 'admin' . DIRECTORY_SEPARATOR . 'subinstall' . DIRECTORY_SEPARATOR . 'upgrade.helper.php';
             if (is_file($fileUpgradeHelper)) {
                 $httpRequestFile = JPATH_ADMINISTRATOR . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_imageshow' . DIRECTORY_SEPARATOR . 'classes' . DIRECTORY_SEPARATOR . 'jsn_is_httprequest.php';
                 $readxmlDetailsFile = JPATH_ADMINISTRATOR . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_imageshow' . DIRECTORY_SEPARATOR . 'classes' . DIRECTORY_SEPARATOR . 'jsn_is_readxmldetails.php';
                 $comparefilesFile = JPATH_ADMINISTRATOR . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_imageshow' . DIRECTORY_SEPARATOR . 'classes' . DIRECTORY_SEPARATOR . 'jsn_is_comparefiles.php';
                 if (is_file($httpRequestFile) && is_file($readxmlDetailsFile) && is_file($comparefilesFile)) {
                     include_once $fileUpgradeHelper;
                     $objUpgradeHelper = new JSNUpgradeHelper($this->manifest);
                     $objUpgradeHelper->executeUpgrade();
                 }
             }
             $this->updateSchema($info->version);
         } else {
             $session = JFactory::getSession();
             $session->set('preversion', null, 'jsnimageshow');
         }
     }
     /******************************* JSN IMAGESHOW ***************************************/
     if ($canInstall and $canInstallExtension and $canInstallSiteLanguage and $canInstallAdminLanguage) {
         // Try to backup user edited language file
         return $this->backupLanguage();
     } else {
         return false;
     }
 }
Example #4
0
<?php

/**
 * @version    $Id$
 * @package    JSN_PageBuilder
 * @author     JoomlaShine Team <*****@*****.**>
 * @copyright  Copyright (C) 2012 JoomlaShine.com. All Rights Reserved.
 * @license    GNU/GPL v2 or later http://www.gnu.org/licenses/gpl-2.0.html
 *
 * Websites: http://www.joomlashine.com
 * Technical Support:  Feedback - http://www.joomlashine.com/contact-us/get-support.html
 */
//No direct access
defined('_JEXEC') or die('Restricted access');
JSNUpgradeHelper::render($this->product, JText::_('UPGRADER_STANDARD_BENEFITS'), JText::_('UPGRADER_UNLIMITED_BENEFITS'));
Example #5
0
<?php

/**
 * @version    $Id$
 * @package    JSN_EasySlider
 * @author     JoomlaShine Team <*****@*****.**>
 * @copyright  Copyright (C) 2012 JoomlaShine.com. All Rights Reserved.
 * @license    GNU/GPL v2 or later http://www.gnu.org/licenses/gpl-2.0.html
 *
 * Websites: http://www.joomlashine.com
 * Technical Support:  Feedback - http://www.joomlashine.com/contact-us/get-support.html
 */
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// Display upgrade form
JSNUpgradeHelper::render($this->product, JText::_('JSN_EASYSLIDER_UPGRADE_BENEFITS_FREE'), JText::_('JSN_EASYSLIDER_UPGRADE_BENEFITS_PRO'));
Example #6
0
 * @package     JSNUniform
 * @subpackage  Upgrade
 * @author      JoomlaShine Team <*****@*****.**>
 * @copyright   Copyright (C) 2015 JoomlaShine.com. All Rights Reserved.
 * @license     GNU/GPL v2 or later http://www.gnu.org/licenses/gpl-2.0.html
 *
 * Websites: http://www.joomlashine.com
 * Technical Support:  Feedback - http://www.joomlashine.com/contact-us/get-support.html
 */
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// Display messagess
if (JFactory::getApplication()->input->getInt('ajax') != 1) {
    echo $this->msgs;
}
$upgradeBenefitsFree = '<ul>';
$upgradeBenefitsFree .= '<li>' . JText::_('JSN_UNIFORM_UPGRADE_UNLIMITED_NUMBER_OF_FORM_AND_FIELDS_IN_A_FORM') . '</li>';
$upgradeBenefitsFree .= '<li>' . JText::_('JSN_UNIFORM_UPGRADE_UNLIMITED_NUMBER_OF_SUBMISSION_IN_A_FORM') . '</li>';
$upgradeBenefitsFree .= '<li>' . JText::_('JSN_UNIFORM_UPGRADE_ABILITY_TO_PRESENT_FORM_FIELDS_IN_MULTIPLE_PAGES') . '</li>';
$upgradeBenefitsFree .= '<li>' . JText::_('JSN_UNIFORM_UPGRADE_REMOVED_BRANDLINK_FROM_FORM_PRESENTATION') . '</li>';
$upgradeBenefitsFree .= '<li>' . JText::_('JSN_UNIFORM_UPGRADE_PROFESSIONAL_SUPPORT_FOR_01_DOMAIN') . '</li>';
$upgradeBenefitsFree .= '<li>' . JText::_('JSN_UNIFORM_UPGRADE_FREE_PRODUCT_UPDATE_FOR_06_MONTHS') . '</li>';
$upgradeBenefitsFree .= '</ul>';
$upgradeBenefitsPro = '<ul>';
$upgradeBenefitsPro .= '<li>' . JText::_('JSN_UNIFORM_UPGRADE_ALL_BENEFITS_OF_PRO_STADARD_EDITION') . '</li>';
$upgradeBenefitsPro .= '<li>' . JText::_('JSN_UNIFORM_UPGRADE_FASTER_DEDICATED_SUPPORT_FOR_UNLIMITED_DOMAINS') . '</li>';
$upgradeBenefitsPro .= '<li>' . JText::_('JSN_UNIFORM_UPGRADE_FREE_PRODUCT_UPDATE_FOR_01_YEAR') . '</li>';
$upgradeBenefitsPro .= '</ul>';
// Display config form
JSNUpgradeHelper::render($this->product, $upgradeBenefitsFree, $upgradeBenefitsPro);
Example #7
0
/**
 * @version     $Id: default.php 19013 2012-11-28 04:48:47Z thailv $
 * @package     JSNUniform
 * @subpackage  Upgrade
 * @author      JoomlaShine Team <*****@*****.**>
 * @copyright   Copyright (C) 2012 JoomlaShine.com. All Rights Reserved.
 * @license     GNU/GPL v2 or later http://www.gnu.org/licenses/gpl-2.0.html
 *
 * Websites: http://www.joomlashine.com
 * Technical Support:  Feedback - http://www.joomlashine.com/contact-us/get-support.html
 */
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// Display messagess
if (JFactory::getApplication()->input->getInt('ajax') != 1) {
    echo $this->msgs;
}
$upgradeBenefitsProUnlimitedStandard = '<ul>';
$upgradeBenefitsProUnlimitedStandard .= '<li>' . JText::_('JSN_MOBILIZE_UPGRADE_BENEFITS_PRO_STANDARD_LINE_1') . '</li>';
$upgradeBenefitsProUnlimitedStandard .= '<li>' . JText::_('JSN_MOBILIZE_UPGRADE_BENEFITS_PRO_STANDARD_LINE_2') . '</li>';
$upgradeBenefitsProUnlimitedStandard .= '<li>' . JText::_('JSN_MOBILIZE_UPGRADE_BENEFITS_PRO_STANDARD_LINE_3') . '</li>';
$upgradeBenefitsProUnlimitedStandard .= '<li>' . JText::_('JSN_MOBILIZE_UPGRADE_BENEFITS_PRO_STANDARD_LINE_4') . '</li>';
$upgradeBenefitsProUnlimitedStandard .= '</ul>';
$upgradeBenefitsProUnlimited = '<ul>';
$upgradeBenefitsProUnlimited .= '<li>' . JText::_('JSN_MOBILIZE_UPGRADE_BENEFITS_PRO_UNLIMITED_LINE_1') . '</li>';
$upgradeBenefitsProUnlimited .= '<li>' . JText::_('JSN_MOBILIZE_UPGRADE_BENEFITS_PRO_UNLIMITED_LINE_2') . '</li>';
$upgradeBenefitsProUnlimited .= '</ul>';
// Display config form
JSNUpgradeHelper::render($this->product, $upgradeBenefitsProUnlimitedStandard, $upgradeBenefitsProUnlimited);