function show_desktop_switch_link($ajax_request = false)
 {
     require_once WPTOUCH_DIR . '/core/theme.php';
     require_once WPTOUCH_DIR . '/core/globals.php';
     if ($ajax_request) {
         // Do the actual output
         if ($this->is_mobile_device && !$this->showing_mobile_theme) {
             if (file_exists(WPTOUCH_DIR . '/include/html/desktop-switch.php')) {
                 $settings = wptouch_get_settings();
                 if ($settings->switch_link_method != 'template_tag') {
                     wptouch_show_desktop_switch_link();
                 }
             }
         }
     } else {
         $settings = wptouch_get_settings();
         if ($settings->switch_link_method == 'ajax') {
             echo "<div id='wptouch_desktop_switch'></div>\n";
             echo "<script type='text/javascript'>var wptouchAjaxUrl = '" . admin_url('admin-ajax.php') . "'; wptouchAjaxNonce = '" . $this->desktop_ajax_nonce . "'; wptouchAjaxSwitchLocation = '" . esc_attr($_SERVER['REQUEST_URI']) . "';</script>\n";
             echo "<script type='text/javascript' src='" . WPTOUCH_URL . "/include/js/desktop-switch.js'></script>\n";
         } else {
             if ($this->is_mobile_device && !$this->showing_mobile_theme) {
                 wptouch_show_desktop_switch_link();
             }
         }
     }
 }
Example #2
0
 function show_desktop_switch_link()
 {
     require_once WPTOUCH_DIR . '/core/theme.php';
     require_once WPTOUCH_DIR . '/core/globals.php';
     if ($this->is_mobile_device && !$this->showing_mobile_theme) {
         if (file_exists(WPTOUCH_DIR . '/include/html/desktop-switch.php')) {
             wptouch_show_desktop_switch_link();
         }
     }
 }