示例#1
0
function includeDatepicker($id, $time = false)
{
    global $cookie;
    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) $cookie->id_lang);
    if ($iso != 'en') {
        echo '<script type="text/javascript" src="' . __PS_BASE_URI__ . 'js/jquery/datepicker/ui/i18n/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 includeDatepicker($id, $time = false)
{
    global $cookie;
    echo '<script type="text/javascript" src="' . __PS_BASE_URI__ . 'js/jquery/datepicker/jquery-ui-personalized-1.6rc4.packed.js"></script>';
    $iso = Db::getInstance()->getValue('SELECT iso_code FROM ' . _DB_PREFIX_ . 'lang WHERE `id_lang` = ' . intval($cookie->id_lang));
    if ($iso != 'en') {
        echo '<script type="text/javascript" src="' . __PS_BASE_URI__ . 'js/jquery/datepicker/ui/i18n/ui.datepicker-' . $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>';
}
示例#3
0
/**
 * 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/ui/jquery.ui.core.min.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>';
}