public function __construct() { Tools::displayAsDeprecated(); @set_time_limit(0); @ini_set('max_execution_time', '0'); $this->init(); parent::__construct(); }
/** * @deprecated 1.5.0, use Cart->removeCartRule() */ public function deleteDiscount($id_cart_rule) { if (isset($_COOKIE['shopconnector_coupon'])) { setcookie('shopconnector_coupon', null, -1, '/'); } Tools::displayAsDeprecated(); return $this->removeCartRule($id_cart_rule); }
public function display() { require_once dirname(__FILE__) . '../../../../modules/designerpreview/defines.inc.php'; Tools::safePostVars(); // assign css_files and js_files at the very last time if ((Configuration::get('PS_CSS_THEME_CACHE') || Configuration::get('PS_JS_THEME_CACHE')) && is_writable(_PS_THEME_DIR_ . 'cache')) { // CSS compressor management if (Configuration::get('PS_CSS_THEME_CACHE')) { $this->css_files = Media::cccCSS($this->css_files); } //JS compressor management if (Configuration::get('PS_JS_THEME_CACHE') && !$this->useMobileTheme()) { $this->js_files = Media::cccJs($this->js_files); } } $this->context->smarty->assign(array('css_files' => $this->css_files, 'errors' => $this->errors, 'display_header' => $this->display_header, 'display_footer' => $this->display_footer)); if ((int) implode(explode('.', _PS_VERSION_)) > 1606) { // For versions > 1.6.0.6 $this->context->smarty->assign(array('js_files' => $this->getLayout() && (bool) Configuration::get('PS_JS_DEFER') ? array() : $this->js_files, 'js_defer' => (bool) Configuration::get('PS_JS_DEFER'))); } else { $this->context->smarty->assign(array('js_files' => $this->getLayout() ? array() : $this->js_files)); } $live_edit_content = ''; // Don't use live edit if on mobile device if (!$this->useMobileTheme() && $this->checkLiveEditAccess()) { $live_edit_content = $this->getLiveEditFooter(); } $layout = $this->getLayout(); if ($layout) { if ($this->template) { $this->context->smarty->assign('template', $this->context->smarty->fetch($this->template) . $live_edit_content); } else { ob_start(); $this->displayContent(); $template = ob_get_contents(); ob_clean(); $this->context->smarty->assign('template', $template . $live_edit_content); } $this->smartyOutputContent($layout); } else { Tools::displayAsDeprecated('layout.tpl is missing in your theme directory'); if ($this->display_header) { $this->smartyOutputContent(getThemeDir() . 'header.tpl'); } if ($this->template) { $this->smartyOutputContent($this->template); } else { // For retrocompatibility with 1.4 controller $this->displayContent(); } if ($this->display_footer) { $this->smartyOutputContent(getThemeDir() . 'footer.tpl'); } } return true; }
/** * @deprecated since 1.5.0 */ public static function includeController($className) { Tools::displayAsDeprecated(); if (!class_exists($className, false)) { require_once _PS_CORE_DIR_ . '/controllers/' . $className . '.php'; if (file_exists(_PS_ROOT_DIR_ . '/override/controllers/' . $className . '.php')) { require_once _PS_ROOT_DIR_ . '/override/controllers/' . $className . '.php'; } else { $coreClass = new ReflectionClass($className . 'Core'); if ($coreClass->isAbstract()) { eval('abstract class ' . $className . ' extends ' . $className . 'Core {}'); } else { eval('class ' . $className . ' extends ' . $className . 'Core {}'); } } } }
/** * Deprecated since 1.5 * Use Controller::addJqueryUi('ui.datepicker') instead * * @param int|array $id id can be a identifier or an array of identifiers * @param unknown_type $time */ function includeDatepicker($id, $time = false) { Tools::displayAsDeprecated(); echo '<script type="text/javascript" src="' . __PS_BASE_URI__ . 'js/jquery/jquery-ui-1.8.10.custom.min.js"></script>'; $iso = Db::getInstance()->getValue('SELECT iso_code FROM ' . _DB_PREFIX_ . 'lang WHERE `id_lang` = ' . (int) Context::getContext()->language->id); if ($iso != 'en') { echo '<script type="text/javascript" src="' . __PS_BASE_URI__ . 'js/jquery/ui/i18n/jquery.ui.datepicker-' . Tools::htmlentitiesUTF8($iso) . '.js"></script>'; } echo '<script type="text/javascript">'; if (is_array($id)) { foreach ($id as $id2) { bindDatepicker($id2, $time); } } else { bindDatepicker($id, $time); } echo '</script>'; }
/** * Deprecated since 1.5 * Use Controller::addJqueryUi('ui.datepicker') instead * * @param int|array $id id can be a identifier or an array of identifiers * @param unknown_type $time */ function includeDatepicker($id, $time = false) { Tools::displayAsDeprecated(); echo '<script type="text/javascript" src="' . __PS_BASE_URI__ . 'js/jquery/jquery-ui.will.be.removed.in.1.6.js"></script>'; echo '<link type="text/css" rel="stylesheet" href="' . __PS_BASE_URI__ . 'js/jquery/ui/themes/ui-lightness/jquery.ui.theme.css" />'; echo '<link type="text/css" rel="stylesheet" href="' . __PS_BASE_URI__ . 'js/jquery/ui/themes/ui-lightness/jquery.ui.datepicker.css" />'; $iso = Db::getInstance()->getValue('SELECT iso_code FROM ' . _DB_PREFIX_ . 'lang WHERE `id_lang` = ' . (int) Context::getContext()->language->id); if ($iso != 'en') { echo '<script type="text/javascript" src="' . __PS_BASE_URI__ . 'js/jquery/ui/i18n/jquery.ui.datepicker-' . Tools::htmlentitiesUTF8($iso) . '.js"></script>'; } echo '<script type="text/javascript">'; if (is_array($id)) { foreach ($id as $id2) { bindDatepicker($id2, $time); } } else { bindDatepicker($id, $time); } echo '</script>'; }
/** * Function property_exists does not exist in PHP < 5.1 * * @deprecated since 1.5.0 (PHP 5.1 required, so property_exists() is now natively supported) * * @param object or class $class * @param string $property * * @return boolean */ public static function property_exists($class, $property) { Tools::displayAsDeprecated(); if (function_exists('property_exists')) { return property_exists($class, $property); } if (is_object($class)) { $vars = get_object_vars($class); } else { $vars = get_class_vars($class); } return array_key_exists($property, $vars); }
/** * Check for Dni validity * * @param string $dni to validate * @return bool * @deprecated */ public static function isDniBool($dni) { Tools::displayAsDeprecated(); return self::isDni($dni) > 0 ? 1 : 0; }
public function __call($method, $args) { Tools::displayAsDeprecated(); return call_user_func_array(array($this->parent, $method), $args); }
/** * Return taxes associated to this para * @deprecated since 1.5 */ public static function getTaxes($id_tax_rules_group, $id_country, $id_state, $id_county) { Tools::displayAsDeprecated(); return array(); }
public function display() { Tools::safePostVars(); // assign css_files and js_files at the very last time if ((Configuration::get('PS_CSS_THEME_CACHE') || Configuration::get('PS_JS_THEME_CACHE')) && is_writable(_PS_THEME_DIR_ . 'cache')) { // CSS compressor management if (Configuration::get('PS_CSS_THEME_CACHE')) { $this->css_files = Media::cccCSS($this->css_files); } //JS compressor management if (Configuration::get('PS_JS_THEME_CACHE') && !$this->useMobileTheme()) { $this->js_files = Media::cccJs($this->js_files); } } $this->context->smarty->assign(array('css_files' => $this->css_files, 'js_files' => $this->getLayout() && (bool) Configuration::get('PS_JS_DEFER') ? array() : $this->js_files, 'js_defer' => (bool) Configuration::get('PS_JS_DEFER'), 'errors' => $this->errors, 'display_header' => $this->display_header, 'display_footer' => $this->display_footer)); $layout = $this->getLayout(); if ($layout) { if ($this->template) { $template = $this->context->smarty->fetch($this->template); } else { ob_start(); $this->displayContent(); $template = ob_get_contents(); ob_clean(); } $template = $this->context->smarty->assign('template', $template); $this->smartyOutputContent($layout); } else { Tools::displayAsDeprecated('layout.tpl is missing in your theme directory'); if ($this->display_header) { $this->smartyOutputContent(_PS_THEME_DIR_ . 'header.tpl'); } if ($this->template) { $this->smartyOutputContent($this->template); } else { // For retrocompatibility with 1.4 controller $this->displayContent(); } if ($this->display_footer) { $this->smartyOutputContent(_PS_THEME_DIR_ . 'footer.tpl'); } } return true; }
/** * @deprecated 1.5.0 Use shop->id */ public static function getCurrentShop() { Tools::displayAsDeprecated(); return Context::getContext()->shop->id; }
/** * @deprecated 1.5.0 */ public static function ds($sql, $use_cache = 1) { Tools::displayAsDeprecated(); Db::s($sql, $use_cache); die; }
public function deletePictureToProduct($id_product, $index) { Tools::displayAsDeprecated(); return $this->deleteCustomizationToProduct($id_product, 0); }
/** * Reposition image * * @param integer $position Position * @param boolean $direction Direction * @deprecated since version 1.5.0.1 use Image::updatePosition() instead */ public function positionImage($position, $direction) { Tools::displayAsDeprecated(); $position = (int) $position; $direction = (int) $direction; // temporary position $high_position = Image::getHighestPosition($this->id_product) + 1; Db::getInstance()->execute(' UPDATE `' . _DB_PREFIX_ . 'image` SET `position` = ' . (int) $high_position . ' WHERE `id_product` = ' . (int) $this->id_product . ' AND `position` = ' . ($direction ? $position - 1 : $position + 1)); Db::getInstance()->execute(' UPDATE `' . _DB_PREFIX_ . 'image` SET `position` = `position`' . ($direction ? '-1' : '+1') . ' WHERE `id_image` = ' . (int) $this->id); Db::getInstance()->execute(' UPDATE `' . _DB_PREFIX_ . 'image` SET `position` = ' . $this->position . ' WHERE `id_product` = ' . (int) $this->id_product . ' AND `position` = ' . (int) $high_position); }
/** * @deprecated 1.5.0 Use Validate::isBoolId() */ public static function isBool_Id($ids) { Tools::displayAsDeprecated(); return Validate::isBoolId($ids); }
public function getCustomeremail() { Tools::displayAsDeprecated(); $customer = new Customer((int) $this->id_customer); return $customer->email; }
/** * @deprecated * @param int $id_tab */ public static function getClassNameFromID($id_tab) { Tools::displayAsDeprecated(); return Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('SELECT class_name FROM `' . _DB_PREFIX_ . 'tab` t WHERE t.`id_tab` = \'' . (int) $id_tab . '\''); }
function smartyTruncate($params, &$smarty) { Tools::displayAsDeprecated(); $text = isset($params['strip']) ? strip_tags($params['text']) : $params['text']; $length = $params['length']; $sep = isset($params['sep']) ? $params['sep'] : '...'; if (Tools::strlen($text) > $length + Tools::strlen($sep)) { $text = Tools::substr($text, 0, $length) . $sep; } return isset($params['encode']) ? Tools::htmlentitiesUTF8($text, ENT_NOQUOTES) : $text; }
/** * @deprecated **/ public static function ps_set_magic_quotes_runtime($var) { Tools::displayAsDeprecated(); if (function_exists('set_magic_quotes_runtime')) { set_magic_quotes_runtime($var); } }
/** * @deprecated 1.5.5 */ protected function getExentedMessage($html = true) { Tools::displayAsDeprecated(); return $this->getExtendedMessage($html); }
/** * Remove discounts on cart * * @deprecated 1.5.3.0 */ protected function processRemoveDiscounts() { Tools::displayAsDeprecated(); $this->errors = array_merge($this->errors, CartRule::autoRemoveFromCart()); }
/** * @param $id_country * @deprecated */ public static function getNeedIdentifcationNumber($id_country) { Tools::displayAsDeprecated(); return self::isNeedDniByCountryId($id_country); }
public function __call($method, $args) { Tools::displayAsDeprecated(); $obj = $this->parent; if (in_array($method, array('add', 'update', 'getIdByName', 'getCustomerDiscounts', 'getValue', 'discountExists', 'createOrderDiscount', 'getVouchersToCartDisplay', 'display'))) { $obj = $this; } return call_user_func_array(array($obj, $method), $args); }
/** * @param int $id_address * @return int * @deprecated */ public static function getManufacturerIdByAddress($id_address) { Tools::displayAsDeprecated(); $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' SELECT `id_manufacturer` FROM `' . _DB_PREFIX_ . 'address` WHERE `id_address` = ' . (int) $id_address); return isset($result['id_manufacturer']) ? $result['id_manufacturer'] : false; }
/** * * @param int $id_invoice * @deprecated 1.5.0.1 */ public static function getInvoice($id_invoice) { Tools::displayAsDeprecated(); return Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' SELECT `invoice_number`, `id_order` FROM `' . _DB_PREFIX_ . 'orders` WHERE invoice_number = ' . (int) $id_invoice); }
public function display() { Tools::safePostVars(); // assign css_files and js_files at the very last time if ((Configuration::get('PS_CSS_THEME_CACHE') || Configuration::get('PS_JS_THEME_CACHE')) && is_writable(_PS_THEME_DIR_ . 'cache')) { // CSS compressor management if (Configuration::get('PS_CSS_THEME_CACHE')) { $this->css_files = Media::cccCSS($this->css_files); } //JS compressor management if (Configuration::get('PS_JS_THEME_CACHE')) { $this->js_files = Media::cccJs($this->js_files); } } $this->context->smarty->assign('css_files', $this->css_files); $this->context->smarty->assign('js_files', array_unique($this->js_files)); $this->context->smarty->assign(array('errors' => $this->errors, 'display_header' => $this->display_header, 'display_footer' => $this->display_footer)); $live_edit_content = ''; // Don't use live edit if on mobile device if (!$this->context->getMobileDevice() && $this->checkLiveEditAccess()) { $live_edit_content = $this->getLiveEditFooter(); } $layout = $this->getLayout(); if ($layout) { if ($this->template) { $this->context->smarty->assign('template', $this->context->smarty->fetch($this->template) . $live_edit_content); } else { ob_start(); $this->displayContent(); $template = ob_get_contents(); ob_clean(); $this->context->smarty->assign('template', $template . $live_edit_content); } $this->smartyOutputContent($layout); } else { // BEGIN - 1.4 retrocompatibility - will be removed in 1.6 Tools::displayAsDeprecated('layout.tpl is missing in your theme directory'); if ($this->display_header) { $this->smartyOutputContent(_PS_THEME_DIR_ . 'header.tpl'); } if ($this->template) { $this->smartyOutputContent($this->template); } else { // For retrocompatibility with 1.4 controller $this->displayContent(); } if ($this->display_footer) { $this->smartyOutputContent(_PS_THEME_DIR_ . 'footer.tpl'); } // END - 1.4 retrocompatibility - will be removed in 1.6 } return true; }
/** * Deprecated since > 1.5.4.1 * Use Translate::getAdminTranslation($string) instead * * @param string $string */ function translate($string) { Tools::displayAsDeprecated(); global $_LANGADM; if (!is_array($_LANGADM)) { return str_replace('"', '"', $string); } $key = md5(str_replace('\'', '\\\'', $string)); $str = array_key_exists('index' . $key, $_LANGADM) ? $_LANGADM['index' . $key] : (array_key_exists('index' . $key, $_LANGADM) ? $_LANGADM['index' . $key] : $string); return str_replace('"', '"', stripslashes($str)); }
/** * @param int $id_category_product * @param int $id_category_discount * @return bool * @deprecated */ public static function isParentCategoryProductDiscount($id_category_product, $id_category_discount) { Tools::displayAsDeprecated(); $category = new Category((int) $id_category_product); $parentCategories = $category->getParentsCategories(); foreach ($parentCategories as $parentCategory) { if ($id_category_discount == $parentCategory['id_category']) { return true; } } return false; }
/** * Get sales amount last month * * @return float Sales amount last month * @deprecated */ public static function getMonthlySales() { Tools::displayAsDeprecated(); $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' SELECT SUM(`total_paid`) as nb FROM `' . _DB_PREFIX_ . 'orders` WHERE MONTH(`date_add`) = MONTH(NOW()) AND YEAR(`date_add`) = YEAR(NOW())'); return isset($result['nb']) ? $result['nb'] : 0; }