function wptouch_render_general_page($page_options)
{
    wptouch_add_sub_page(WPTOUCH_ADMIN_SETUP_GENERAL, 'setup-general-general', $page_options);
    wptouch_add_sub_page(WPTOUCH_ADMIN_SETUP_COMPAT, 'setup-general-compat', $page_options);
    $these_settings = array(wptouch_add_setting('text', 'site_title', wptouchize_it(__('WPtouch Pro site title', 'wptouch-pro')), __('If the title of your site is long, you can shorten it for display within WPtouch Pro themes.', 'wptouch-pro'), WPTOUCH_SETTING_BASIC, '3.0'), wptouch_add_setting('checkbox', 'show_wptouch_in_footer', wptouchize_it(sprintf(__('Display %sPowered by WPtouch Pro%s in footer', 'wptouch-pro'), '"', '"')), '', WPTOUCH_SETTING_BASIC, 3.0));
    if (!defined('WPTOUCH_IS_FREE')) {
        $these_settings[] = wptouch_add_setting('checkbox', 'add_referral_code', __('Use my WPtouch Pro referral code to earn commission', 'wptouch-pro'), __('Licensed users of WPtouch Pro can earn a commission for each sale they generate from their mobile website', 'wptouch-pro'), WPTOUCH_SETTING_BASIC, 3.2);
    }
    wptouch_add_page_section(WPTOUCH_ADMIN_SETUP_GENERAL, __('Site Title & Byline', 'wptouch-pro'), 'setup-title-byline', $these_settings, $page_options);
    // Build admin panel page here
    wptouch_add_page_section(WPTOUCH_ADMIN_SETUP_GENERAL, __('Regionalization', 'wptouch-pro'), 'setup-regionalization', array(wptouch_add_setting('list', 'force_locale', __('Language', 'wptouch-pro'), wptouchize_it(__('The WPtouch Pro admin panel & supported themes will be shown in this locale.', 'wptouch-pro')), WPTOUCH_SETTING_BASIC, '3.0', wptouch_admin_get_languages()), wptouch_add_setting('checkbox', 'translate_admin', __('Translate administration panel text', 'wptouch-pro'), '', WPTOUCH_SETTING_ADVANCED, '3.0.2')), $page_options);
    wptouch_add_page_section(WPTOUCH_ADMIN_SETUP_GENERAL, __('Display Mode', 'wptouch-pro'), 'setup-display-mode', array(wptouch_add_setting('radiolist', 'display_mode', __('Theme Display', 'wptouch-pro'), '', WPTOUCH_SETTING_BASIC, '3.1', array('normal' => __('Normal (active for all mobile visitors)', 'wptouch-pro'), 'preview' => __('Preview (active only for logged-in site administrators)', 'wptouch-pro'), 'disabled' => __('Disabled (mobile theme will never show)', 'wptouch-pro')))), $page_options);
    wptouch_add_page_section(WPTOUCH_ADMIN_SETUP_GENERAL, __('Landing Page', 'wptouch-pro'), 'setup-landing-page', array(wptouch_add_setting('radiolist', 'homepage_landing', wptouchize_it(__('WPtouch Pro landing page', 'wptouch-pro')), '', WPTOUCH_SETTING_BASIC, '3.0', array('none' => __('Default (same as WordPress)', 'wptouch-pro'), 'select' => __('Select from WordPress pages', 'wptouch-pro'), 'custom' => _x('Custom', 'Refers to a custom landing page', 'wptouch-pro'))), wptouch_add_setting('redirect', 'homepage_redirect_wp_target', '', '', WPTOUCH_SETTING_BASIC, '3.0'), wptouch_add_setting('text', 'homepage_redirect_custom_target', __('Custom Slug or URL', 'wptouch-pro'), __('Enter a Slug (i.e. "/home") or a full URL path', 'wptouch-pro'), WPTOUCH_SETTING_BASIC, '3.0')), $page_options);
    wptouch_add_page_section(WPTOUCH_ADMIN_SETUP_GENERAL, __('Desktop / Mobile Switching', 'wptouch-pro'), 'setup-general', array(wptouch_add_setting('checkbox', 'desktop_is_first_view', __('1st time visitors see desktop theme', 'wptouch-pro'), __('Your regular theme will be shown to 1st time mobile visitors.', 'wptouch-pro'), WPTOUCH_SETTING_ADVANCED, '3.0'), wptouch_add_setting('checkbox', 'show_switch_link', __('Show switch link in mobile view', 'wptouch-pro'), __('Will show toggle buttons in the theme\'s footer allowing users to switch to your desktop theme. Is not shown in Web-App Mode.', 'wptouch-pro'), WPTOUCH_SETTING_ADVANCED, '3.0'), wptouch_add_pro_setting('radiolist', 'mobile_switch_link_target', __('Choose the target for the mobile switch link', 'wptouch-pro'), '', WPTOUCH_SETTING_ADVANCED, '3.0.1', array('current_page' => __('Current page', 'wptouch-pro'), 'home_page' => __('Home page', 'wptouch-pro '))), wptouch_add_pro_setting('radiolist', 'switch_link_method', __('Desktop theme switch buttons', 'wptouch-pro'), __('Allows visitors to switch from your desktop theme to your mobile theme. You can also customize the placement of Switch buttons by placing the wptouch_desktop_switch_link() template tag somewhere in your desktop theme.', 'wptouch-pro'), WPTOUCH_SETTING_ADVANCED, '3.0', array('automatic' => __('Automatically inserted inline', 'wptouch-pro'), 'ajax' => __('Automatically inserted with AJAX (better for caching)', 'wptouch-pro'), 'template_tag' => __('Template tag', 'wptouch-pro')))), $page_options);
    wptouch_add_page_section(WPTOUCH_ADMIN_SETUP_GENERAL, __('Custom Code', 'wptouch-pro'), 'setup-custom-code', array(wptouch_add_setting('textarea', 'custom_stats_code', __('HTML, JavaScript, statistics or custom code', 'wptouch-pro'), __('Enter any custom code here to be output in the theme footer.', 'wptouch-pro'), WPTOUCH_SETTING_BASIC, '3.0')), $page_options);
    wptouch_add_page_section(WPTOUCH_ADMIN_SETUP_GENERAL, __('Custom Stylesheet', 'wptouch-pro'), 'setup-custom-styles', array(wptouch_add_pro_setting('text', 'custom_css_file', __('URL to a custom CSS file to load', 'wptouch-pro'), __('Useful if you have specific compatibility CSS you need to add.', 'wptouch-pro'), WPTOUCH_SETTING_ADVANCED, '3.0')), $page_options);
    wptouch_add_page_section(WPTOUCH_ADMIN_SETUP_COMPAT, __('Shortcodes', 'wptouch-pro'), 'shortcodes-compatibility', array(wptouch_add_pro_setting('checkbox', 'enable_shortcode_compatibility', wptouchize_it(__('Enable shortcode handling', 'wptouch-pro')), __('For shortcodes registered by your desktop theme', 'wptouch-pro'), WPTOUCH_SETTING_BASIC, '3.7'), wptouch_add_pro_setting('radiolist', 'shortcode_compatibility_method', __('Shortcode handling', 'wptouch-pro'), '', WPTOUCH_SETTING_BASIC, '3.7', array('load_content_by_ajax' => wptouchize_it(__('Load content as output by desktop theme (you may need to load CSS/JavaScript)', 'wptouch-pro')), 'remove_shortcodes' => wptouchize_it(__('Remove selected shortcodes from content', 'wptouch-pro')))), wptouch_add_pro_setting('text', 'remove_shortcodes', wptouchize_it(__('Remove these shortcodes when WPtouch Pro is active', 'wptouch-pro')), __('Enter a comma separated list of shortcodes to remove.', 'wptouch-pro'), WPTOUCH_SETTING_BASIC, '3.0')), $page_options);
    wptouch_add_page_section(WPTOUCH_ADMIN_SETUP_COMPAT, __('Filter URLs', 'wptouch-pro'), 'filtered-urls-compatibility', array(wptouch_add_setting('checkbox', 'enable_url_filter', wptouchize_it(__('Limit the function of WPtouch Pro on specific URLs/Pages', 'wptouch-pro')), '', WPTOUCH_SETTING_BASIC, '3.5.3'), wptouch_add_setting('list', 'url_filter_behaviour', '', '', WPTOUCH_SETTING_BASIC, '3.5.3', array('exclude_urls' => wptouchize_it(__('Do not load WPtouch Pro on these URLs/pages', 'wptouch-pro')), 'exclusive_urls' => wptouchize_it(__('Only load WPtouch Pro on these URLs/pages', 'wptouch-pro')))), wptouch_add_setting('textarea', 'filtered_urls', wptouchize_it(__('Apply filter to these URLs/Pages', 'wptouch-pro')), __('Each permalink URL fragment should be on its own line and relative, e.g. "/about" or "/products/store"', 'wptouch-pro'), WPTOUCH_SETTING_BASIC, '3.5.3')), $page_options);
    wptouch_add_page_section(WPTOUCH_ADMIN_SETUP_COMPAT, __('Desktop Theme', 'wptouch-pro'), 'desktop-theme-compatibility', array(wptouch_add_pro_setting('checkbox', 'include_functions_from_desktop_theme', __('Try to include desktop theme functions.php file', 'wptouch-pro'), wptouchize_it(__('This may be required for desktop themes with unique features that are not showing when WPtouch Pro is active.', 'wptouch-pro')), WPTOUCH_SETTING_ADVANCED, '3.0'), wptouch_add_setting('radiolist', 'functions_php_loading_method', __('Method to load file', 'wptouch-pro'), '', WPTOUCH_SETTING_ADVANCED, '3.0', array('direct' => __('Include file directly', 'wptouch-pro'), 'translate' => __('Translate and create new files', 'wptouch-pro')))), $page_options);
    wptouch_add_page_section(WPTOUCH_ADMIN_SETUP_COMPAT, __('Custom User-Agents', 'wptouch-pro'), 'custom-user-agents', array(wptouch_add_setting('textarea', 'custom_user_agents', __('User-agents (line separated)', 'wptouch-pro'), wptouchize_it(__('Adding additional user-agents will force WPtouch Pro to be active for matching browsers.', 'wptouch-pro')), WPTOUCH_SETTING_BASIC, '3.0'), wptouch_add_setting('user-agent-list', '')), $page_options);
    wptouch_add_page_section(WPTOUCH_ADMIN_SETUP_GENERAL, __('Backup &amp; Import', 'wptouch-pro'), 'setup-backup', array(wptouch_add_pro_setting('checkbox', 'automatically_backup_settings', sprintf(__('Automatically backup settings to the %s folder', 'wptouch-pro'), '<em>/wptouch-data/backups</em>'), wptouchize_it(__('WPtouch Pro backups your settings each time they are saved.', 'wptouch-pro')), WPTOUCH_SETTING_BASIC, '3.0'), wptouch_add_pro_setting('custom', 'backup')), $page_options);
    $page_options = apply_filters('wptouch_settings_compat', $page_options);
    wptouch_add_page_section(WPTOUCH_ADMIN_SETUP_GENERAL, __('Tools &amp; Debug', 'wptouch-pro'), 'setup-tools-debug', array(wptouch_add_setting('checkbox', 'use_jquery_2', __('Use jQuery 2.x in themes (faster for mobile devices) instead of WordPress\' version', 'wptouch-pro'), __('jQuery 2.x is significantly smaller and faster than previous jQuery versions - may cause problems with other plugins, use carefully.', 'wptouch-pro'), WPTOUCH_SETTING_ADVANCED, '3.0'), wptouch_add_setting('checkbox', 'show_footer_load_times', __('Show load times and query counts in the footer', 'wptouch-pro'), __('Helps you find slow pages/posts on your site.', 'wptouch-pro'), WPTOUCH_SETTING_ADVANCED, '3.0'), wptouch_add_setting('checkbox', 'debug_log', __('Enable debug log', 'wptouch-pro'), __('Creates a debug file to help diagnose installation issues.', 'wptouch-pro'), WPTOUCH_SETTING_ADVANCED, '3.0'), wptouch_add_setting('debuginfo', 'debug-info', '', '', WPTOUCH_SETTING_ADVANCED, '3.0')), $page_options);
    wptouch_add_page_section(WPTOUCH_ADMIN_SETUP_COMPAT, __('WordPress Plugins', 'wptouch-pro'), 'setup-general-plugin-compat', array(wptouch_add_pro_setting('custom', 'plugin-compat')), $page_options);
    wptouch_add_page_section(WPTOUCH_ADMIN_SETUP_GENERAL, __('Admin Mode', 'wptouch-pro'), 'admin-mode', array(wptouch_add_setting('radiolist', 'settings_mode', __('Admin panel settings shown', 'wptouch-pro'), '', WPTOUCH_SETTING_BASIC, '3.0', array('0' => __('Default', 'wptouch-pro'), '1' => __('Advanced', 'wptouch-pro')))), $page_options);
    return $page_options;
}
function wptouch_render_general_page($page_options)
{
    $settings = wptouch_get_settings();
    wptouch_add_sub_page(WPTOUCH_ADMIN_SETUP_GENERAL, 'setup-general-general', $page_options);
    wptouch_add_page_section(WPTOUCH_ADMIN_SETUP_GENERAL, __('Mobile Site Title', 'wptouch-pro'), 'mobile-site-title', array(wptouch_add_setting('text', 'site_title', wptouchize_it(__('WPtouch Pro site title', 'wptouch-pro')), false, WPTOUCH_SETTING_BASIC, '3.0')), $page_options, 'wptouch_pro', false, false);
    if (defined('WPTOUCH_IS_FREE')) {
        $display_text = wptouchize_it(__('If disabled WPtouch Pro will be off for visitors but can be configured.', 'wptouch-pro'));
    } else {
        $display_text = wptouchize_it(__('If disabled WPtouch Pro will be off for visitors but can be configured in the Customizer.', 'wptouch-pro'));
    }
    wptouch_add_page_section(WPTOUCH_ADMIN_SETUP_GENERAL, __('Display', 'wptouch-pro'), 'filtered-urls-compatibility', array(wptouch_add_setting('checkbox', 'new_display_mode', wptouchize_it(__('Display WPtouch Pro for mobile visitors', 'wptouch-pro')), $display_text, WPTOUCH_SETTING_BASIC, '3.1'), wptouch_add_pro_setting('list', 'url_filter_behaviour', __('URL filtering', 'wptouch-pro'), false, WPTOUCH_SETTING_BASIC, '3.5.3', array('disabled' => wptouchize_it(__('Show WPtouch Pro for all URLs', 'wptouch-pro')), 'exclude_urls' => wptouchize_it(__('Exclude WPtouch Pro on these URLs', 'wptouch-pro')), 'exclusive_urls' => wptouchize_it(__('Only show WPtouch Pro on these URLs', 'wptouch-pro')))), wptouch_add_pro_setting('multiline-newline', 'filtered_urls', __('Apply filter to these URLs/Pages', 'wptouch-pro'), 'e.g. "/about", "/products/store"', WPTOUCH_SETTING_BASIC, '3.5.3'), wptouch_add_pro_setting('checkbox', 'filtered_urls_exact', __('Require exact match', 'wptouch-pro'), false, WPTOUCH_SETTING_BASIC, '3.5.3')), $page_options);
    $landing_settings = array(wptouch_add_setting('list', 'homepage_landing', __('Mobile front page', 'wptouch-pro'), wptouchize_it(__('You can set a different front page for WPtouch Pro visitors.', 'wptouch-pro')), WPTOUCH_SETTING_BASIC, '3.0', array('none' => __('WordPress Reading Settings', 'wptouch-pro'), 'select' => __('Redirect to a page', 'wptouch-pro'), 'custom' => _x('Redirect to a custom URL', 'Refers to a custom landing page', 'wptouch-pro'))), wptouch_add_setting('text', 'homepage_redirect_custom_target', __('Custom Slug or URL', 'wptouch-pro'), __('Enter a Slug (i.e. "/home") or a full URL path', 'wptouch-pro'), WPTOUCH_SETTING_BASIC, '3.0'), wptouch_add_setting('redirect', 'homepage_redirect_wp_target', false, false, WPTOUCH_SETTING_BASIC, '3.0'));
    $landing_settings = apply_filters('foundation_settings_pages', $landing_settings);
    wptouch_add_page_section(WPTOUCH_ADMIN_SETUP_GENERAL, __('Landing Pages', 'wptouch-pro'), 'setup-landing-page', $landing_settings, $page_options, 'wptouch_pro');
    wptouch_add_page_section(WPTOUCH_ADMIN_SETUP_GENERAL, __('Desktop / Mobile Switching', 'wptouch-pro'), 'setup-general', array(wptouch_add_pro_setting('checkbox', 'show_switch_link', _x('Theme switch toggle', 'switches between desktop and mobile themes', 'wptouch-pro'), false, WPTOUCH_SETTING_BASIC, '4.0')), $page_options, 'wptouch-pro', false, __('Shows a toggle in both the desktop mobile theme footers allowing users to switch between them.', 'wptouch-pro'));
    wptouch_add_page_section(WPTOUCH_ADMIN_SETUP_GENERAL, __('Page Zoom', 'wptouch-pro'), 'foundation-zoom', array(wptouch_add_setting('checkbox', 'allow_zoom', __('Allow mobile browser zooming', 'wptouch-pro'), wptouchize_it(__('By default WPtouch Pro disables browser zooming.')), WPTOUCH_SETTING_BASIC, '2.0')), $page_options, FOUNDATION_SETTING_DOMAIN);
    wptouch_add_page_section(WPTOUCH_ADMIN_SETUP_GENERAL, __('Smart App Banner', 'wptouch-pro'), 'foundation-smart-app-banner', array(wptouch_add_pro_setting('text', 'smart_app_banner', 'App Store ID', false, WPTOUCH_SETTING_BASIC, '2.0')), $page_options, FOUNDATION_SETTING_DOMAIN, false, sprintf(__('Find your ID from the %siTunes Link Maker%s.', 'wptouch-pro'), '<a href="http://itunes.apple.com/linkmaker/" target="_blank">', '</a>'));
    wptouch_add_page_section(WPTOUCH_ADMIN_SETUP_GENERAL, __('Analytics', 'wptouch-pro'), 'setup-custom-code', array(wptouch_add_pro_setting('list', 'analytics_embed_method', __('Analytics Code', 'wptouch-pro'), false, WPTOUCH_SETTING_BASIC, '4.0', array('disabled' => __('None', 'wptouch-pro'), 'simple' => 'Google Analytics', 'custom' => __('Custom', 'wptouch-pro'))), wptouch_add_pro_setting('text', 'analytics_google_id', __('Site ID', 'wptouch-pro'), false, WPTOUCH_SETTING_BASIC, '3.0'), wptouch_add_pro_setting('textarea', 'custom_stats_code', false, false, WPTOUCH_SETTING_BASIC, '3.0')), $page_options, 'wptouch_pro');
    wptouch_add_page_section(WPTOUCH_ADMIN_SETUP_GENERAL, wptouchize_it(__('WPtouch Pro Love', 'wptouch-pro')), 'setup-powered-by', array(wptouch_add_setting('checkbox', 'show_wptouch_in_footer', wptouchize_it(__('Show powered by WPtouch Pro link in theme footer', 'wptouch-pro')), false, WPTOUCH_SETTING_BASIC, '3.0')), $page_options, 'wptouch_pro');
    wptouch_add_page_section(WPTOUCH_ADMIN_SETUP_GENERAL, __('Language', 'wptouch-pro'), 'setup-regionalization', array(wptouch_add_setting('list', 'force_locale', __('Theme Language', 'wptouch-pro'), false, WPTOUCH_SETTING_BASIC, '3.0', wptouch_admin_get_languages()), wptouch_add_setting('checkbox', 'translate_admin', __('Also applies to admin', 'wptouch-pro'), false, WPTOUCH_SETTING_BASIC, '3.0')), $page_options, 'wptouch_pro');
    return $page_options;
}
function wptouch_setup_general_tab()
{
    global $wptouch_pro;
    $settings = $wptouch_pro->get_settings();
    $active_plugins = get_option('active_plugins');
    $new_plugin_list = array();
    foreach ($active_plugins as $plugin) {
        $dir = explode('/', $plugin);
        $new_plugin_list[] = $dir[0];
    }
    $plugin_compat_settings = array();
    $plugin_compat_settings[] = array('section-start', 'warnings-and-conflicts', __('Warnings or Conflicts', 'wptouch-pro'));
    $plugin_compat_settings[] = array('plugin-compat');
    $plugin_compat_settings[] = array('section-end');
    $plugin_compat_settings[] = array('spacer');
    $plugin_compat_settings[] = array('section-start', 'plugin-compat-options', __('Theme &amp; Page Compatibility', 'wptouch-pro'));
    $plugin_compat_settings[] = array('checkbox', 'include_functions_from_desktop_theme', __('Include functions.php from the active desktop theme', 'wptouch-pro'), __('This option will include and load the functions.php from the active WordPress theme.  This may be required for themes with custom field features like post images, etc.', 'wptouch-pro'));
    $plugin_compat_settings[] = array('list', 'functions_php_inclusion_method', __('Method to use when included functions.php', 'wptouch-pro'), __('The direct method loads functions.php directly, and is the recommended option.  If that method fails, an alternative method is provided which attempts to clean up the functions.php for inclusion - this method requires write access to your desktop theme directory and will cause hidden files to be written there.', 'wptouch-pro'), array('direct' => __('Include file directly', 'wptouch-pro'), 'translate' => __('Translate constants and create new files', 'wptouch-pro')));
    $plugin_compat_settings[] = array('checkbox', 'convert_menu_links_to_internal', __('Convert permalinks into internal URLs', 'wptouch-pro'), __('This option reduces the loading time for pages, but may cause issues with the menu when permalinks are non-standard or on another domain.', 'wptouch-pro'));
    $plugin_compat_settings[] = array('text', 'remove_shortcodes', __('Remove these shortcodes when WPtouch Pro is active', 'wptouch-pro'), __('Enter a comma separated list of shortcodes to remove.', 'wptouch_pro'));
    $plugin_compat_settings[] = array('spacer');
    $plugin_compat_settings[] = array('textarea', 'ignore_urls', __('Do not use WPtouch Pro on these URLs/Pages', 'wptouch-pro'), __('Each permalink URL fragment should be on its own line and relative, e.g. "/about" or "/products/store"', 'wptouch-pro'));
    $plugin_compat_settings[] = array('checkbox', 'enable_buddypress_mobile_support', __('Allow BuddyPress Mobile AJAX to bypass WPtouch Pro', 'wptouch-pro'), '');
    $plugin_compat_settings[] = array('section-end');
    $plugin_compat_settings[] = array('spacer');
    $plugin_compat_settings[] = array('section-start', 'plugin-compatibility', __('Plugin Compatibility', 'wptouch-pro'));
    if ($wptouch_pro->plugin_hooks && count($wptouch_pro->plugin_hooks)) {
        $plugin_compat_settings[] = array('copytext', 'plugin-compat-copy', __("WPtouch will attempt to disable selected plugin hooks when WPtouch and your mobile theme are active. Check plugins to disable:", "wptouch-pro"));
        foreach ($wptouch_pro->plugin_hooks as $plugin_name => $hooks) {
            if (in_array($plugin_name, $new_plugin_list)) {
                $proper_name = "plugin_disable_" . str_replace('-', '_', $plugin_name);
                $plugin_compat_settings[] = array('checkbox', $proper_name, $wptouch_pro->get_friendly_plugin_name($plugin_name));
            }
        }
    } else {
        $plugin_compat_settings[] = array('copytext', 'plugin-compat-copy-none', __("There are currently no active plugins to disable.", "wptouch-pro") . "<br />" . __("If you have recently installed or reset WPtouch Pro, it must gather active plugin information first.", "wptouch-pro"));
    }
    $plugin_compat_settings[] = array('copytext', 'plugin-compat-refresh', sprintf(__("%sRegenerate Plugin List%s", "wptouch-pro"), '<a href="#" class="regenerate-plugin-list round-24">', ' &raquo;</a>'));
    $plugin_compat_settings[] = array('section-end');
    $wptouch_advertising_types = array('none' => __('No advertising', 'wptouch-pro'), 'google' => __('Google Adsense', 'wptouch-pro'), 'admob' => __('Admob Ads', 'wptouch-pro'), 'custom' => __('Custom', 'wptouch-pro'));
    $wptouch_advertising_types = apply_filters('wptouch_advertising_types', $wptouch_advertising_types);
    wptouch_add_tab(__('General', 'wptouch-pro'), 'general', array(__('Overview', "wptouch-pro") => array('overview', array(array('section-start', 'touchboard', __('WPtouchboard', "wptouch-pro")), array('wptouch-board'), array('section-end'))), __('Global General', 'wptouch-pro') => array('general-options', array(array('section-start', 'site-branding', __('Site Branding', 'wptouch-pro')), array('text', 'site_title', __('WPtouch site title', 'wptouch-pro'), __('If the title of your site is long, you can shorten it for display within WPtouch.', 'wptouch-pro')), array('checkbox', 'show_wptouch_in_footer', __('Display "Powered by WPtouch Pro" in footer', 'wptouch-pro')), array('section-end'), array('spacer'), array('section-start', 'language-text', __('Regionalization', 'wptouch-pro')), array('list', 'force_locale', __('WPtouch Pro language', 'wptouch-pro'), __('The WPtouch Pro admin panel / supported themes will be shown in this locale', 'wptouch-pro'), wptouch_admin_get_languages()), array('section-end'), array('spacer'), array('section-start', 'landing-page', __('WPtouch Landing Page', 'wptouch-pro')), array('checkbox', 'enable_home_page_redirect', __('Enable landing redirect (overrides default WordPress settings for landing page)', 'wptouch-pro'), __('When checked WPtouch overrides your WordPress homepage settings, and uses another page you select for its homepage.', 'wptouch-pro')), array('redirect'), array('text', 'home_page_redirect_custom', __('Custom home page URL', 'wptouch-pro'), ''), array('section-end'), array('spacer'), array('section-start', 'switch-link', __('Switch Link', 'wptouch-pro')), array('checkbox', 'show_switch_link', __('Show switch link', 'wptouch-pro'), __('When unchecked WPtouch will not show a switch link allowing users to switch between the mobile view and your regular theme view', 'wptouch-pro')), array('list', 'home_page_redirect_address', __('Switch link destination', 'wptouch-pro'), __('Choose between the same URL from which a user chooses to switch, or your Homepage as the switch link destination.', 'wptouch-pro'), array('same' => __('Same URL', 'wptouch-pro'), 'homepage' => __('Site Homepage', 'wptouch-pro'))), array('textarea', 'desktop_switch_css', __('Theme switch styling', 'wptouch-pro'), __('Here you can edit the CSS output to style the switch link appearance in the footer of your regular theme.', 'wptouch-pro')), array('section-end'), array('spacer'), array('section-start', 'welcome-four-footer', __('Welcome, 404, Footer', 'wptouch-pro')), array('textarea', 'welcome_alert', __('Welcome message shown on 1st visit (HTML is OK)', 'wptouch-pro'), __('The welcome message shows below the header for visitors until dismissed.', 'wptouch-pro')), array('textarea', 'fourohfour_message', __('Custom 404 message (HTML is OK)', 'wptouch-pro'), __('Change this to whatever you\'d like for your 404 page message.', 'wptouch-pro')), array('textarea', 'footer_message', __('Custom footer content (HTML is OK)', 'wptouch-pro'), __('Enter additional content to be displayed in the WPtouch footer. Everything here is wrapped in a paragraph tag.', 'wptouch-pro')), array('section-end'), array('spacer'), array('section-start', 'misc', __('Advanced', 'wptouch-pro')), array('checkbox', 'desktop_is_first_view', __('1st time visitors see desktop theme', 'wptouch-pro'), __('Your regular theme will be shown to 1st time mobile visitors first, with the Mobile View switch link available in the footer.', 'wptouch-pro')), array('checkbox', 'multisite_force_enable', __('Force multisite detection', 'wptouch-pro'), __('This option will force  the WordPress multisite panels to be displayed. This option should only be used on an actual multisite installation.', 'wptouch-pro')), array('checkbox', 'make_links_clickable', __('Convert all plain-text links in post content to clickable links', 'wptouch-pro'), __('Normally links posted into post content are plain-text and cannot be clicked.  Enabling this option will make these links clickable, similar to the P2 theme.', 'wptouch-pro')), array('checkbox', 'respect_wordpress_date_format', __('Respect WordPress setting for date format in themes', 'wptouch-pro'), __('When checked WPtouch will use the WordPress date format in themes that support it (set in WordPress -> Settings - > General).', 'wptouch-pro')), array('text', 'custom_css_file', __('URL to a custom CSS file', 'wptouch-pro'), __('Full URL to a custom CSS file to be loaded last in themes. Will override existing styles, preserving updateability of themes.', 'wptouch-pro')), array('section-end'))), __('Advertising &amp; Stats', 'wptouch-pro') => array('advertising-stats-options', array(array('section-start', 'advertising', __('Mobile Advertising', 'wptouch-pro')), array('list', 'advertising_type', __('Mobile advertising support', 'wptouch-pro'), __('WPtouch natively supports ads from Google Adsense or Admob. May not show on all devices (limitations of these services).', 'wptouch-pro'), $wptouch_advertising_types), array('textarea', 'custom_advertising_code', __('Advertising code (HTML or JavaScript)', 'wptouch-pro'), __('You can enter custom advertising code (images, links, scripts, etc.) here', 'wptouch-pro')), array('text', 'adsense_id', __('Adsense Publisher ID', 'wptouch-pro'), __('Enter your full Publisher ID - this is the value of the "google_ad_client" parameter in the Adsense code that Google supplies.', 'wptouch-pro')), array('text', 'adsense_slot_id', __('Adsense Slot ID', 'wptouch-pro'), __('Your Adsense Slot ID - this is the value of the "google_ad_slot" parameter in the Adsense code that Google supplies.', 'wptouch-pro')), array('text', 'adsense_channel', __('Adsense Channel ID', 'wptouch-pro'), __('Your Adsense channel (deprecated when using the new Google ad method)', 'wptouch-pro')), array('text', 'admob_publisher_id', __('Admob Publisher ID', 'wptouch-pro'), __('Enter your full Admob Publisher ID', 'wptouch-pro')), array('section-end'), array('section-start', 'ipad_advertising', __('iPad Advertising', 'wptouch-pro')), array('list', 'ipad_advertising_type', __('iPad advertising support', 'wptouch-pro'), '', array('none' => __('No advertising', 'wptouch-pro'), 'custom' => __('Custom', 'wptouch-pro'))), array('textarea', 'custom_ipad_advertising_code', __('Advertising code (HTML or JavaScript)', 'wptouch-pro'), __('You can enter custom advertising code (images, links, scripts, etc.) here', 'wptouch-pro')), array('section-end'), array('section-start', 'ad-display', __('Advertising Display', 'wptouch-pro')), array('list', 'advertising_location', __('Advertising display location', 'wptouch-pro'), __('Choose where you would like your ads positioned.', 'wptouch-pro'), array('header' => __('Below the header', 'wptouch-pro'), 'footer' => __('In the footer', 'wptouch-pro'))), array('list', 'advertising_pages', __('Show ads in these places', 'wptouch-pro'), __('Choose which page views you\'d like ads displayed on', 'wptouch-pro'), array('ads_single' => __('Single Post Only', 'wptouch-pro'), 'main_single_pages' => __('Home, Blog, Single Post, Pages', 'wptouch-pro'), 'all_views' => __('All Pages (Home, Blog, Single Post, Pages, Search)', 'wptouch-pro'), 'home_page_only' => __('Home Page Only', 'wptouch-pro'))), array('copytext', 'copytext-ads', sprintf(__('%sNote: Adsense and Admob ads only show on service supported devices, and do NOT work in Web-App Mode%s', 'wptouch-pro'), '<small>', '</small>')), array('copytext', 'copytext-ads3', sprintf(__('%sAlso, ads will not be shown in Developer Mode on desktop browsers unless the user agent is changed in the browser to a supported device.%s', 'wptouch-pro'), '<small>', '</small>')), array('section-end'), array('spacer'), array('section-start', 'site-stats', __('Site Statistics', 'wptouch-pro')), array('textarea', 'custom_stats_code', __('Custom statistics code (HTML and/or JavaScript only)', 'wptouch-pro'), __('Enter your custom statistics tracking code snippets (Google Analytics, MINT, etc.)', 'wptouch-pro')), array('section-end'))), __('Push Notifications', 'wptouch-pro') => array('push-notifications', array(array('section-start', 'prowl-notifications', __('Prowl Push Notifications', 'wptouch-pro')), array('text-array', 'push_prowl_api_keys', __('Prowl API keys', 'wptouch-pro'), __('Enter your Prowl API key here to enable push notifications from WPtouch to your iPhone/iPod touch via the Prowl app, or Mac with Growl installed and configured for Prowl. If you have multiple keys, enter and save each one for a new input to appear.', 'wptouch-pro')), array('checkbox', 'push_prowl_comments_enabled', __('Notify of new comments &amp; pingbacks/trackbacks', 'wptouch-pro'), __('Requires Discussion settings to be enabled in the WordPress settings.', 'wptouch-pro')), array('checkbox', 'push_prowl_registrations', __('Notify of new account registrations', 'wptouch-pro'), __('Requires the "Anyone can register" WordPress setting to be enabled.', 'wptouch-pro')), array('checkbox', 'push_prowl_direct_messages', __('Allow users to send direct messages', 'wptouch-pro'), __('Adds a push message form in the header to allow visitors to send messages to you.', 'wptouch-pro')), array('copytext', 'copytext-info-prowl', '<small>' . __('(Requires Prowl app on iPhone / iPod touch, or Growl setup with Prowl on a Mac)', 'wptouch-pro') . '</small>'), array('copytext', 'copytext-info-itunes', '<a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=320876271" target="_blank">' . __("Get Prowl (App Store)", "wptouch-pro") . '</a> | <a href="http://prowl.weks.net/" target="_blank">' . __("Prowl Website", "wptouch-pro") . '</a> | <a href="http://growl.info/" target="_blank">' . __("Get Growl", "wptouch-pro") . '</a>'), array('section-end'))), __('Compatibility', 'wptouch-pro') => array('compatibility', $plugin_compat_settings), __('Tools and Debug', 'wptouch-pro') => array('tools-and-debug', array(array('section-start', 'tools-and-development', __('General', 'wptouch-pro')), array('checkbox', 'show_footer_load_times', __('Show load times and query counts in the footer', 'wptouch-pro'), __('WPtouch will show the load time and query count to help you find slow pages/posts on your site.', 'wptouch-pro')), array('checkbox', 'always_refresh_css_js_files', __('Always refresh theme JS and CSS files', 'wptouch-pro'), __('Useful when developing. Will make sure WPtouch Pro browser cache of Javascript and CSS files is updated on every page refresh.', 'wptouch-pro')), array('checkbox', 'put_wptouch_in_appearance_menu', __('Move WPtouch admin settings to Appearance menu', 'wptouch-pro'), __('Moves WPtouch admin settings from the top-level to the WordPress Appearance settings. Refresh your browser after saving.', 'wptouch-pro')), array('list', 'developer_mode', __('Developer mode', 'wptouch-pro'), __('Shows WPtouch in ALL browsers when enabled. Please remember to disable this option when finished!', 'wptouch-pro'), array('off' => __('Disabled', 'wptouch-pro'), 'admins' => __('Enabled for admins only', 'wptouch-pro'), 'on' => __('Enabled for all users', 'wptouch-pro'))), array('list', 'developer_mode_device_class', __('&harr; Developer Mode for', 'wptouch-pro'), '', wptouch_get_available_theme_variants()), array('section-end'), array('spacer'), array('section-start', 'clientmode', __('Client Mode', 'wptouch-pro')), array('checkbox', 'admin_client_mode_hide_licenses', __('Hide Licenses tab, and other license related content', 'wptouch-pro'), __('Hides all license settings and references. Allows client to see and upgrade the plugin, adjust active theme and global settings, but not see and/or change license and domain settings.', 'wptouch-pro')), array('checkbox', 'admin_client_mode_hide_browser', __('Hide Theme Browser tab', 'wptouch-pro'), __('Hides the theme browser tab, and prevents theme switching', 'wptouch-pro')), array('checkbox', 'admin_client_mode_hide_tools', __('Hide Tools and Debug section', 'wptouch-pro'), __('Hides the Tools and Debug settings completely. Once checked only resetting WPtouch Pro settings will show them again.', 'wptouch-pro')), array('section-end'), array('spacer'), array('section-start', 'debugging', __('Debugging', 'wptouch-pro')), array('sysinfo'), array('checkbox', 'debug_log', __('Debug log', 'wptouch-pro'), __('Creates a debug file to help diagnose issues with WPtouch. This file is located in ...wp-content/wptouch-data/debug. ', 'wptouch-pro')), array('list', 'debug_log_level', __('Debug log level', 'wptouch-pro'), __('Increasing this above Level 1 (Errors) should only be done when troubleshooting.', 'wptouch-pro'), array(WPTOUCH_ERROR => __('Errors (1)', 'wptouch-pro'), WPTOUCH_SECURITY => __('Security (2)', 'wptouch-pro'), WPTOUCH_WARNING => __('Warnings (3)', 'wptouch-pro'), WPTOUCH_INFO => __('Information (4)', 'wptouch-pro'), WPTOUCH_VERBOSE => __('Verbose (5)', 'wptouch-pro'))), array('section-end'))), __('Backup/Import', 'wptouch-pro') => array('backup-restore', array(array('section-start', 'site_backup_restore', __('Settings Backup and Import', 'wptouch-pro')), array('list', 'backup_or_restore', __('&harr; On this site I want to', 'wptouch-pro'), '', array('backup' => __('Backup Settings', 'wptouch-pro'), 'restore' => __('Import Settings', 'wptouch-pro'))), array('section-end'), array('spacer'), array('section-start', 'backup', __('Backup', 'wptouch-pro')), array('copytext', 'backup-instructions', __('This key represents a backup of all WPtouch Pro settings.<br />You can cut and paste it into another installation, or save the data to restore at a later time.', 'wptouch-pro')), array('backup'), array('copytext', 'backup-copy-all', sprintf(__('%sCopy Backup Key To Clipboard%s', 'wptouch-pro'), '<a id="copy-text-button" class="ajax-button">', '</a>')), array('copytext', 'backup-instructions-2', sprintf(__('%sNOTE: A settings backup/restore does NOT include saved files, icons or themes inside the "wp-content/wptouch-data/" directory.%s', 'wptouch-pro'), '<small>', '</small>')), array('section-end'), array('section-start', 'import', __('Import', 'wptouch-pro')), array('restore', 'restore_string', sprintf(__('Paste a backup key, then save: %s(Right click in textarea, choose "Paste")%s', 'wptouch-pro'), '<small>', '</small>')), array('section-end')))));
}
function wptouch_addon_multisite_render_settings($page_options)
{
    wptouch_add_sub_page(ADDON_MULTISITE_OPTIONS_PAGENAME, 'wptouch-addon-multisite', $page_options);
    wptouch_add_page_section(ADDON_MULTISITE_OPTIONS_PAGENAME, __('General Options', 'wptouch-pro'), 'mutisite-setup', array(wptouch_add_setting('list', 'force_network_locale', __('Admin Language', 'wptouch-pro'), false, WPTOUCH_SETTING_BASIC, '3.0', wptouch_admin_get_languages(), 'wptouch_pro'), wptouch_add_setting('checkbox', 'multisite_control', __('Control themes and extension downloads and updates', 'wptouch-pro'), __('If enabled, sub-sites can only activate/deactivate themes and extensions that have been downloaded in the network admin.', 'wptouch-pro'), WPTOUCH_SETTING_BASIC, '4.0', false, 'bncid')), $page_options);
    if (wptouch_has_multisite_support_licensed()) {
        wptouch_add_sub_page(ADDON_MULTISITE_DEPLOYMENT_PAGENAME, 'wptouch-addon-deployment', $page_options);
        wptouch_add_page_section(ADDON_MULTISITE_OPTIONS_PAGENAME, __('Network Defaults', 'wptouch-pro'), 'multisite-options', array(wptouch_add_pro_setting('checkbox', 'multisite_use_master_settings', __('Use my settings for new sites', 'wptouch-pro'), '', WPTOUCH_SETTING_BASIC, '1.0.0'), wptouch_add_pro_setting('list', 'multisite_master_site', __('Source site', 'wptouch-pro'), '', WPTOUCH_SETTING_BASIC, '1.0.0', wptouch_multisite_get_site_array())), $page_options, WPTOUCH_MULTISITE_DOMAIN, false, __('Configure WPtouch to use a site for defaults on new network sites instead of its defaults', 'wptouch-pro'));
        wptouch_add_page_section(ADDON_MULTISITE_OPTIONS_PAGENAME, __('Subsite Customizable Settings', 'wptouch-pro'), 'multisite-options', array(wptouch_add_pro_setting('checkbox', 'multisite_show_general_settings', __('General Settings', 'wptouch-pro'), '', WPTOUCH_SETTING_BASIC, '1.0.0'), wptouch_add_pro_setting('checkbox', 'multisite_show_site_compat', __('Site Compatibility', 'wptouch-pro'), '', WPTOUCH_SETTING_BASIC, '1.0.0'), wptouch_add_pro_setting('checkbox', 'multisite_show_devices', __('Devices', 'wptouch-pro'), '', WPTOUCH_SETTING_BASIC, '1.0.0'), wptouch_add_pro_setting('checkbox', 'multisite_show_menus', __('Menu Settings', 'wptouch-pro'), '', WPTOUCH_SETTING_BASIC, '1.0.0'), wptouch_add_pro_setting('checkbox', 'multisite_show_themes', __('Themes', 'wptouch-pro'), '', WPTOUCH_SETTING_BASIC, '1.0.0'), wptouch_add_pro_setting('checkbox', 'multisite_show_extensions', __('Extensions', 'wptouch-pro'), '', WPTOUCH_SETTING_BASIC, '1.0.0'), wptouch_add_pro_setting('checkbox', 'multisite_show_colors', __('Colors', 'wptouch-pro'), '', WPTOUCH_SETTING_BASIC, '1.0.0'), wptouch_add_pro_setting('checkbox', 'multisite_show_social_media', __('Social Media Links', 'wptouch-pro'), '', WPTOUCH_SETTING_BASIC, '1.0.0'), wptouch_add_pro_setting('checkbox', 'multisite_show_social_sharing', __('Social Sharing', 'wptouch-pro'), '', WPTOUCH_SETTING_BASIC, '1.0.0')), $page_options, WPTOUCH_MULTISITE_DOMAIN, false, __('Select which settings sections are available to users in network subsites (network admins always see settings).', 'wptouch-pro'));
        wptouch_add_page_section(ADDON_MULTISITE_DEPLOYMENT_PAGENAME, __('Source Site', 'wptouch-pro'), 'multisite-deployment-source', array(wptouch_add_pro_setting('list', 'multisite_deployment_source', __('Source site', 'wptouch-pro'), '', WPTOUCH_SETTING_BASIC, '1.0.0', wptouch_multisite_get_site_array()), wptouch_add_pro_setting('checkbox', 'multisite_deploy_general_settings', __('General Settings', 'wptouch-pro'), '', WPTOUCH_SETTING_BASIC, '1.0.0'), wptouch_add_pro_setting('checkbox', 'multisite_deploy_site_compat', __('Site Compatibility', 'wptouch-pro'), '', WPTOUCH_SETTING_BASIC, '1.0.0'), wptouch_add_pro_setting('checkbox', 'multisite_deploy_devices', __('Devices', 'wptouch-pro'), '', WPTOUCH_SETTING_BASIC, '1.0.0'), wptouch_add_pro_setting('checkbox', 'multisite_deploy_menus', __('Menu Settings', 'wptouch-pro'), '', WPTOUCH_SETTING_BASIC, '1.0.0'), wptouch_add_pro_setting('checkbox', 'multisite_deploy_themes', __('Themes', 'wptouch-pro'), '', WPTOUCH_SETTING_BASIC, '1.0.0'), wptouch_add_pro_setting('checkbox', 'multisite_deploy_extensions', __('Extensions', 'wptouch-pro'), '', WPTOUCH_SETTING_BASIC, '1.0.0'), wptouch_add_pro_setting('checkbox', 'multisite_deploy_colors', __('Colors', 'wptouch-pro'), '', WPTOUCH_SETTING_BASIC, '1.0.0'), wptouch_add_pro_setting('checkbox', 'multisite_deploy_social_media', __('Social Media Links', 'wptouch-pro'), '', WPTOUCH_SETTING_BASIC, '1.0.0'), wptouch_add_pro_setting('checkbox', 'multisite_deploy_social_sharing', __('Social Sharing', 'wptouch-pro'), '', WPTOUCH_SETTING_BASIC, '1.0.0')), $page_options, WPTOUCH_MULTISITE_DOMAIN);
        wptouch_add_page_section(ADDON_MULTISITE_DEPLOYMENT_PAGENAME, __('Destination Sites', 'wptouch-pro'), 'multisite-deployment-sites', array(wptouch_add_pro_setting('sites', 'multisite_sites', '', '', WPTOUCH_SETTING_BASIC, '1.0.0')), $page_options, WPTOUCH_MULTISITE_DOMAIN);
    }
    return $page_options;
}
Example #5
0
</h2>
			<p class="set-language"><?php 
    _e('Setting Language...', 'wptouch-pro');
    ?>
</p>
			<img src="<?php 
    echo WPTOUCH_ADMIN_URL . '/images/wizard/wizard-globe.png';
    ?>
" class="animated" alt="<?php 
    _e('Ornamental Image');
    ?>
" />
			<br />
			<select name="force_locale" id="language-force_locale">
				<?php 
    $languages = wptouch_admin_get_languages();
    foreach ($languages as $locale => $name) {
        if (is_network_admin()) {
            $current_language = $settings['wptouch_pro']->force_network_locale;
        } else {
            $current_language = $settings['wptouch_pro']->force_locale;
        }
        ?>
					<option value="<?php 
        echo $locale;
        ?>
" <?php 
        if ($locale == $current_language) {
            echo ' selected';
        }
        ?>