Example #1
0
 /**
  * Assign template vars related to page content
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     parent::initContent();
     $this->addJS(_THEME_JS_DIR_ . 'index.js');
     $this->addJS(_THEME_JS_DIR_ . 'modernizr.custom.js');
     $this->addJS(_THEME_JS_DIR_ . 'toucheffects.js');
     $this->addJS(_THEME_JS_DIR_ . 'supplier_list.js');
     $this->addJS(_THEME_JS_DIR_ . 'jquery.bxslider.js');
     $this->addJS(_THEME_JS_DIR_ . 'header.js');
     $this->addJS(_THEME_JS_DIR_ . 'waypoints.min.js');
     $this->addJS(_THEME_JS_DIR_ . 'jquery.counterup.min.js');
     $this->addJS(_THEME_JS_DIR_ . 'front.js');
     $supplier = new SupplierControllerCore();
     if ($idCategory == null) {
         $supplier->initContent($this->idCategory);
     } else {
         $supplier->initContent($this->idCategory);
     }
     /**
      * get categories level 2 for present them in header
      **/
     $categories = Category::getChildrenWithNbSelectedSubCat(2, '', true, null, true);
     $this->context->smarty->assign(array('categories' => $categories));
     $this->assignKPI();
     /*$this->context->smarty->assign(array('HOOK_HOME' => Hook::exec('displayHome'),
           'HOOK_HOME_TAB' => Hook::exec('displayHomeTab'),
           'HOOK_HOME_TAB_CONTENT' => Hook::exec('displayHomeTabContent')
       ));*/
     $this->setTemplate(_PS_THEME_DIR_ . 'index.tpl');
 }
Example #2
0
    if ($content[0] == 'OK' && Validate::isCleanHtml($content[1])) {
        Configuration::updateValue('PS_PREACTIVATION_PAYPAL_WARNING', $content[1]);
    } else {
        Configuration::updateValue('PS_PREACTIVATION_PAYPAL_WARNING', '');
    }
    // DISCOVER PRESTASHOP
    $content = @file_get_contents($protocol . '://www.prestashop.com/partner/prestashop/prestashop-link.php?iso_country=' . $isoCountry . '&iso_lang=' . Tools::strtolower($isoUser) . '&id_lang=' . (int) $cookie->id_lang, false, $stream_context);
    if (!$content) {
        $result['discover_prestashop'] = 'NOK';
    } else {
        $content = explode('|', $content);
        if ($content[0] == 'OK' && Validate::isCleanHtml($content[1])) {
            $result['discover_prestashop'] = $content[1];
        } else {
            $result['discover_prestashop'] = 'NOK';
        }
        if (@fsockopen('www.prestashop.com', 80, $errno, $errst, 3)) {
            $result['discover_prestashop'] .= '<iframe frameborder="no" style="margin: 0px; padding: 0px; width: 315px; height: 290px;" src="' . $protocol . '://www.prestashop.com/rss/news2.php?v=' . _PS_VERSION_ . '&lang=' . $isoUser . '"></iframe>';
        }
        $content = @file_get_contents($protocol . '://www.prestashop.com/partner/paypal/paypal-tips.php?protocol=' . $protocol . '&iso_country=' . $isoCountry . '&iso_lang=' . Tools::strtolower($isoUser) . '&id_lang=' . (int) $cookie->id_lang, false, $stream_context);
        $content = explode('|', $content);
        if ($content[0] == 'OK' && Validate::isCleanHtml($content[1])) {
            $result['discover_prestashop'] .= $content[1];
        }
    }
    die(Tools::jsonEncode($result));
}
if (Tools::isSubmit('getChildrenCategories') && Tools::getValue('id_category_parent')) {
    $children_categories = Category::getChildrenWithNbSelectedSubCat(Tools::getValue('id_category_parent'), Tools::getValue('selectedCat'), $cookie->id_lang);
    die(Tools::jsonEncode($children_categories));
}
Example #3
0
}
if (Tools::isSubmit('submitTrackClickOnHelp')) {
    $label = Tools::getValue('label');
    $version = Tools::getValue('version');
    if (!empty($label) && !empty($version)) {
        HelpAccess::trackClick($label, $version);
    }
}
if (Tools::isSubmit('toggleScreencast')) {
    if (Validate::isLoadedObject($context->employee)) {
        $context->employee->bo_show_screencast = !$context->employee->bo_show_screencast;
        $context->employee->update();
    }
}
if (Tools::isSubmit('getChildrenCategories') && Tools::isSubmit('id_category_parent')) {
    $children_categories = Category::getChildrenWithNbSelectedSubCat(Tools::getValue('id_category_parent'), Tools::getValue('selectedCat'), Context::getContext()->language->id, null, Tools::getValue('use_shop_context'));
    die(Tools::jsonEncode($children_categories));
}
if (Tools::isSubmit('getNotifications')) {
    $notification = new Notification();
    die(Tools::jsonEncode($notification->getLastElements()));
}
if (Tools::isSubmit('updateElementEmployee') && Tools::getValue('updateElementEmployeeType')) {
    $notification = new Notification();
    die($notification->updateEmployeeLastElement(Tools::getValue('updateElementEmployeeType')));
}
if (Tools::isSubmit('syncImapMail')) {
    if (!($url = Configuration::get('PS_SAV_IMAP_URL')) || !($port = Configuration::get('PS_SAV_IMAP_PORT')) || !($user = Configuration::get('PS_SAV_IMAP_USER')) || !($password = Configuration::get('PS_SAV_IMAP_PWD'))) {
        die('{"hasError" : true, "errors" : ["Configuration is not correct"]}');
    }
    $conf = Configuration::getMultiple(array('PS_SAV_IMAP_OPT_NORSH', 'PS_SAV_IMAP_OPT_SSL', 'PS_SAV_IMAP_OPT_VALIDATE-CERT', 'PS_SAV_IMAP_OPT_NOVALIDATE-CERT', 'PS_SAV_IMAP_OPT_TLS', 'PS_SAV_IMAP_OPT_NOTLS'));
Example #4
0
        }
        $fqueaphvbpr = "isoCountry";
        ${${"GLOBALS"}["grmfrbfnrn"]} = @file_get_contents(${${"GLOBALS"}["oepdpfmev"]} . "://api.prestashop.com/partner/paypal/paypal-tips.php?protocol=" . ${$uhgwjoc} . "&iso_country=" . ${$fqueaphvbpr} . "&iso_lang=" . Tools::strtolower(${${"GLOBALS"}["gypmxmh"]}) . "&id_lang=" . (int) Context::getContext()->language->id, false, ${${"GLOBALS"}["zpolpqttfcxq"]});
        ${${"GLOBALS"}["zpzinojcrv"]} = explode("|", ${${"GLOBALS"}["kfezji"]});
        if (${${"GLOBALS"}["kfezji"]}[0] == "OK" && Validate::isCleanHtml(${${"GLOBALS"}["kfezji"]}[1])) {
            $gsmeyiuozrx = "content";
            ${${"GLOBALS"}["jrixcvbkc"]}["discover_prestashop"] .= ${$gsmeyiuozrx}[1];
        }
    }
    die(Tools::jsonEncode(${${"GLOBALS"}["jrixcvbkc"]}));
}
${"GLOBALS"}["ipfuqyxs"] = "id_category";
if (Tools::isSubmit("getChildrenCategories") && Tools::isSubmit("id_category_parent")) {
    ${"GLOBALS"}["ilmvfxp"] = "children_categories";
    ${"GLOBALS"}["udfxdtjbxmt"] = "children_categories";
    ${${"GLOBALS"}["udfxdtjbxmt"]} = Category::getChildrenWithNbSelectedSubCat(Tools::getValue("id_category_parent"), Tools::getValue("selectedCat"), Context::getContext()->language->id, null, Tools::getValue("use_shop_context"));
    die(Tools::jsonEncode(${${"GLOBALS"}["ilmvfxp"]}));
}
if (Tools::isSubmit("getNotifications")) {
    ${"GLOBALS"}["hndusafuhb"] = "notification";
    ${${"GLOBALS"}["hndusafuhb"]} = new Notification();
    die(Tools::jsonEncode($notification->getLastElements()));
}
if (Tools::isSubmit("updateElementEmployee") && Tools::getValue("updateElementEmployeeType")) {
    $uxxsfgklgqzt = "notification";
    ${$uxxsfgklgqzt} = new Notification();
    die($notification->updateEmployeeLastElement(Tools::getValue("updateElementEmployeeType")));
}
if (Tools::isSubmit("syncImapMail")) {
    ${"GLOBALS"}["rkbhyaoubiul"] = "conf_str";
    ${"GLOBALS"}["hrejyty"] = "conf";
Example #5
0
            $list .= '<option value="' . (int) $state['id_state'] . '"' . ((isset($_GET['id_state']) and $_GET['id_state'] == $state['id_state']) ? ' selected="selected"' : '') . '>' . $state['name'] . '</option>' . "\n";
        }
    } else {
        $list = 'false';
    }
    die($list);
}
/**
 * Jquery tree动态获取子目信息
 */
if (Tools::isSubmit('getChildrenCategories') && Tools::getRequest('id_category_parent')) {
    if (Tools::getRequest('type') == 'CMSTree') {
        $children_categories = CMSCategory::getChildrenWithNbSelectedSubCat(Tools::getRequest('id_category_parent'), Tools::getRequest('selectedCat'));
        die(json_encode($children_categories));
    } elseif (Tools::getRequest('type') == 'Tree') {
        $children_categories = Category::getChildrenWithNbSelectedSubCat(Tools::getRequest('id_category_parent'), Tools::getRequest('selectedCat'));
        die(json_encode($children_categories));
    }
}
/*CMS Category position*/
if (array_key_exists('ajaxCMSCategoriesPositions', $_POST)) {
    $id_cms_category_to_move = (int) Tools::getRequest('id_cms_category_to_move');
    $id_cms_category_parent = (int) Tools::getRequest('id_cms_category_parent');
    $way = (int) Tools::getRequest('way');
    $positions = Tools::getRequest('cms_category');
    if (is_array($positions)) {
        foreach ($positions as $key => $value) {
            $pos = explode('_', $value);
            if (isset($pos[1]) and isset($pos[2]) and ($pos[1] == $id_cms_category_parent and $pos[2] == $id_cms_category_to_move)) {
                $position = $key;
                break;