예제 #1
0
/**
 * Register Global Admin Javascript Variables
 *
 * Register JS variables used by theme options admin Javascript.
 *
 * @global	array	Settings Page Tab definitions
 *
 */
function upfw_register_admin_js_globals()
{
    global $up_tabs;
    $tab = '';
    $selected_tab = '';
    $selected_tab = $selected_tab ? $up_tabs[0]['name'] : $tab;
    $theme_name = strtolower(THEME_TITLE);
    $theme_url = upfw_get_theme_dir();
    echo "<script type=\"text/javascript\">\n";
    echo "var upfw = {\n";
    echo "\t\t'theme' : '{$theme_name}',\n";
    if (isset($_GET['page']) && esc_attr($_GET['page']) == 'upfw-settings' && $selected_tab) {
        echo "\t\t'current_tab' : '{$selected_tab}',\n";
    }
    echo "\t\t'theme_url' : '{$theme_url}'\n";
    echo "}" . "\n";
    echo "</script>" . "\n";
}
예제 #2
0
/**
 * Return current theme options directory URI.
 *
 * Checks the location of the theme options directory to determine if
 * it is located in the parent or child theme.
 *
 * @uses	upfw_get_theme_dir() 	Returns theme options theme directory.
 * @return	string 	$theme_dir		Stylesheet directory URI.
 */
function upfw_get_theme_options_directory_uri()
{
    $theme_dir = upfw_get_theme_dir();
    return trailingslashit(trailingslashit($theme_dir) . basename(THEME_OPTIONS_DIR));
}