Ejemplo n.º 1
0
function Core_getJQueryScripts()
{
    global $DBVARS;
    $jquery_versions = array('1.6', '1.8');
    if (isset($DBVARS['offline']) && $DBVARS['offline']) {
        require SCRIPTBASE . '/ww.incs/get-offline-files.php';
        $jurls = Core_getOfflineJQueryScripts($jquery_versions);
    } else {
        $jurls = array('https://ajax.googleapis.com/ajax/libs/jquery/' . $jquery_versions[0] . '/jquery.min.js', 'https://ajax.googleapis.com/ajax/libs/jqueryui/' . $jquery_versions[1] . '/jquery-ui.min.js', 'http://ajax.googleapis.com/ajax/libs/jqueryui/' . $jquery_versions[1] . '/themes/base/jquery-ui.css');
    }
    return '<script src="' . $jurls[0] . '"></script>' . '<script src="' . $jurls[1] . '"></script>' . '<link href="' . $jurls[2] . '" rel="stylesheet" />';
}
Ejemplo n.º 2
0
/**
 * link to current jQuery/jQuery-UI scripts
 *
 * @return string HTML of the links
 */
function Core_getJQueryScripts()
{
    global $DBVARS;
    $jquery_versions = array('1.9.1', '1.10.3');
    if (@$DBVARS['offline']) {
        require SCRIPTBASE . '/ww.incs/get-offline-files.php';
        $jurls = Core_getOfflineJQueryScripts($jquery_versions);
    } else {
        $h = 'https://ajax.googleapis.com/ajax/libs/jquery';
        $jurls = array($h . '/' . $jquery_versions[0] . '/jquery.min.js', $h . 'ui/' . $jquery_versions[1] . '/jquery-ui.min.js', $h . 'ui/' . $jquery_versions[1] . '/themes/smoothness/jquery-ui.min.css');
    }
    $uicssbits = (int) @$DBVARS['disable-jqueryui-css'];
    $uicss = defined('IN_ADMIN') ? $uicssbits & 2 ? '' : '<link href="' . $jurls[2] . '" rel="stylesheet" />' : ($uicssbits & 1 ? '' : '<link href="' . $jurls[2] . '" rel="stylesheet" />');
    return $uicss . '<script src="' . $jurls[0] . '"></script>' . '<script src="' . $jurls[1] . '"></script>';
}