Esempio n. 1
0
function foundation_body_classes($classes)
{
    global $wptouch_pro;
    $global_settings = $wptouch_pro->get_settings();
    $settings = foundation_get_settings();
    if ($settings->video_handling_type != 'none') {
        $classes[] = 'css-videos';
    }
    if ($settings->typography_sets != 'default') {
        $classes[] = 'body-font';
    }
    if (isset($_COOKIE['wptouch-device-type'])) {
        if ($_COOKIE['wptouch-device-type'] == 'smartphone') {
            $classes[] = 'smartphone';
        } else {
            if ($_COOKIE['wptouch-device-type'] == 'tablet') {
                $classes[] = 'tablet';
            }
        }
    }
    if (isset($_COOKIE['wptouch-device-orientation'])) {
        if ($_COOKIE['wptouch-device-orientation'] == 'portrait') {
            $classes[] = 'portrait';
        } else {
            if ($_COOKIE['wptouch-device-orientation'] == 'landscape') {
                $classes[] = 'landscape';
            }
        }
    }
    // iOS Device
    if (strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone') || strpos($_SERVER['HTTP_USER_AGENT'], 'iPod') || strpos($_SERVER['HTTP_USER_AGENT'], 'iPad')) {
        $classes[] = 'ios';
    }
    // Android Device
    if (strpos($_SERVER['HTTP_USER_AGENT'], 'Android')) {
        $classes[] = 'android';
    }
    if (wptouch_should_load_rtl()) {
        $classes[] = 'rtl';
    }
    if (wptouch_fdn_iOS_7() || wptouch_fdn_iOS_8()) {
        $classes[] = 'ios7';
    }
    $classes[] = 'theme-' . $global_settings->current_theme_name;
    return $classes;
}
Esempio n. 2
0
function foundation_setup_meta_area()
{
    $settings = foundation_get_settings();
    echo '<link rel="manifest" href="' . site_url() . '?wptouch_app_manifest">';
    echo '<meta name="apple-mobile-web-app-title" content="' . $settings->homescreen_icon_title . '">' . "\n";
    if (foundation_webapp_mode_enabled()) {
        // We're web-app capable
        echo '<meta name="apple-mobile-web-app-capable" content="yes">' . "\n";
        echo '<meta name="mobile-web-app-capable" content="yes">' . "\n";
        if (wptouch_fdn_is_web_app_mode()) {
            echo '<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" media="(device-height: 568px)" />';
        }
        // iOS7
        if (wptouch_fdn_iOS_7() || wptouch_fdn_iOS_8()) {
            echo '<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">' . "\n";
        } else {
            echo '<meta name="apple-mobile-web-app-status-bar-style" content="black">' . "\n";
        }
        // Check for startup screens
        if (wptouch_is_device_real_ipad()) {
            // Only output iPad startup screens
            // iPad Portrait
            if ($settings->startup_screen_ipad_1_portrait) {
                echo '<link href="' . WPTOUCH_BASE_CONTENT_URL . $settings->startup_screen_ipad_1_portrait . '" media="(device-width: 768px) and (device-height: 1024px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 1)" rel="apple-touch-startup-image">' . "\n";
            }
            // iPad Landscape
            if ($settings->startup_screen_ipad_1_landscape) {
                echo '<link href="' . WPTOUCH_BASE_CONTENT_URL . $settings->startup_screen_ipad_1_landscape . '" media="(device-width: 768px) and (device-height: 1024px) and (orientation: landscape) and (-webkit-device-pixel-ratio: 1)" rel="apple-touch-startup-image">' . "\n";
            }
            // iPad Retina Portrait
            if ($settings->startup_screen_ipad_3_portrait) {
                echo '<link href="' . WPTOUCH_BASE_CONTENT_URL . $settings->startup_screen_ipad_3_portrait . '" media="(device-width: 768px) and (device-height: 1024px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image">' . "\n";
            }
            // iPad Retina Landscape
            if ($settings->startup_screen_ipad_3_landscape) {
                echo '<link href="' . WPTOUCH_BASE_CONTENT_URL . $settings->startup_screen_ipad_3_landscape . '" media="(device-width: 768px) and (device-height: 1024px) and (orientation: landscape) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image">' . "\n";
            }
        } else {
            // iPhone
            if ($settings->startup_screen_iphone_2g_3g) {
                echo '<link href="' . WPTOUCH_BASE_CONTENT_URL . $settings->startup_screen_iphone_2g_3g . '" media="(device-width: 320px) and (device-height: 480px) and (-webkit-device-pixel-ratio: 1)" rel="apple-touch-startup-image">' . "\n";
            }
            // iPhone Retina
            if ($settings->startup_screen_iphone_4_4s) {
                echo '<link href="' . WPTOUCH_BASE_CONTENT_URL . $settings->startup_screen_iphone_4_4s . '" media="(device-width: 320px) and (device-height: 480px) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image">' . "\n";
            }
            // iPhone 5
            if ($settings->startup_screen_iphone_5) {
                echo '<link href="' . WPTOUCH_BASE_CONTENT_URL . $settings->startup_screen_iphone_5 . '"  media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image">' . "\n";
            }
            // iPhone 6
            if ($settings->startup_screen_iphone_6) {
                echo '<link href="' . WPTOUCH_BASE_CONTENT_URL . $settings->startup_screen_iphone_6 . '"  media="(device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image">' . "\n";
                echo '<style>html{background-image:url("' . WPTOUCH_BASE_CONTENT_URL . $settings->startup_screen_iphone_6 . '") no-repeat top left;}</style>';
            }
            // iPhone 6+
            if ($settings->startup_screen_iphone_6plus) {
                echo '<link href="' . WPTOUCH_BASE_CONTENT_URL . $settings->startup_screen_iphone_6plus . '"  media="(device-width: 414px) and (device-height: 736px) and (-webkit-device-pixel-ratio: 3)" rel="apple-touch-startup-image">' . "\n";
            }
        }
    }
}