Esempio n. 1
0
 public function __construct($registry)
 {
     parent::__construct($registry);
     Journal2DBUpgrade::check();
     if (isset($this->request->server['HTTPS']) && ($this->request->server['HTTPS'] == 'on' || $this->request->server['HTTPS'] == '1')) {
         $this->data['base'] = HTTPS_CATALOG;
     } else {
         $this->data['base'] = HTTP_CATALOG;
     }
     $this->data['base_href'] = $this->url->link('module/journal2', 'token=' . $this->session->data['token'], 'SSL');
     $this->data['export_href'] = $this->url->link('module/journal2/rest/data/export', 'token=' . $this->session->data['token'], 'SSL');
     $this->data['import_href'] = $this->url->link('tool/backup', 'token=' . $this->session->data['token'], 'SSL');
     $this->data['export_csv'] = $this->url->link('module/journal2/rest/newsletter/export_csv', 'token=' . $this->session->data['token'], 'SSL');
     $this->data['transition_gallery_href'] = $this->url->link('module/journal2/transition_gallery', 'token=' . $this->session->data['token'], 'SSL');
     $this->data['journal2_config'] = array();
     $this->data['journal2_config']['token'] = $this->session->data['token'];
     $this->data['journal2_config']['version'] = defined('JOURNAL_VERSION') ? JOURNAL_VERSION : null;
     $this->data['journal2_config']['user_id'] = $this->user->getId();
     $this->data['journal2_config']['items_per_page'] = 20;
     if (!property_exists('Front', 'IS_OC2')) {
         echo '
             <h3>Journal Installation Error</h3>
             <p>Make sure you have uploaded all Journal files to your server and successfully replaced <b>system/engine/front.php</b> file.</p>
             <p>You can find more information <a href="http://docs.digital-atelier.com/opencart/journal/#/settings/install" target="_blank">here</a>.</p>
         ';
         exit;
     }
     $this->data['journal2_config']['oc2'] = Front::$IS_OC2;
 }
             echo '<script>location = "' . $url . '";</script>';
         }
         exit;
     }
 }
 /* load journal2 */
 require_once DIR_SYSTEM . 'journal2/classes/journal2.php';
 Journal2::startTimer('Engine');
 define('JOURNAL_INSTALLED', true);
 /* Get current route */
 $current_route = isset($this->registry->get('request')->get['route']) ? $this->registry->get('request')->get['route'] : null;
 /* Utils */
 require_once DIR_SYSTEM . 'journal2/classes/journal2_utils.php';
 /* DB Upgrade */
 require_once DIR_SYSTEM . 'journal2/classes/journal2_db_upgrade.php';
 Journal2DBUpgrade::check();
 /* Load journal2 class */
 $journal2 = new Journal2();
 $this->registry->set('journal2', $journal2);
 /* Load Cache class */
 require_once DIR_SYSTEM . 'journal2/classes/journal2_cache.php';
 $journal2->cache = new Journal2Cache($this->registry);
 /* Html Classes */
 require_once DIR_SYSTEM . 'journal2/classes/journal2_html_classes.php';
 $journal2->html_classes = new Journal2HtmlClasses($this->registry);
 /* Add mobile / tablet class */
 if (Journal2Cache::$mobile_detect->isMobile()) {
     if (Journal2Cache::$mobile_detect->isTablet()) {
         $journal2->html_classes->addClass('tablet');
     } else {
         $journal2->html_classes->addClass('mobile');
 public static function check()
 {
     $obj = new Journal2DBUpgrade();
     $obj->checkNewsletterStoreId();
 }