function mobileview_locate_template($param1, $param2, $param3, $param4 = false, $param5 = false) { $template_path = false; $current_path = false; $require_once = true; if ($param4) { if ($param5) { // 5 parameters $template_path = $param4; $current_path = $param5; $require_once = $param3; } else { // 4 parameters $template_path = $param3; $current_path = $param4; } } else { // 3 parameters $template_path = $param2; $current_path = $param3; } $template_file = $template_path . '/' . $param1; if (!file_exists($template_file)) { $template_file = $current_path . '/' . $param1; } if (file_exists($template_path)) { $current_path = dirname($template_file); if ($require_once) { mobileview_include_functions_file($template_file, $template_path, $current_path, 'require_once'); } else { mobileview_include_functions_file($template_file, $template_path, $current_path, 'require'); } } else { // add debug statement } }
function load_functions_file_for_desktop() { $settings = mobileview_get_settings(); // Check to see if we should include the functions.php file from the desktop theme if ($settings->include_functions_from_desktop_theme) { $desktop_theme_directory = get_theme_root() . '/' . get_template(); $desktop_functions_file = $desktop_theme_directory . '/functions.php'; // Check to see if the theme has a functions.php file if (file_exists($desktop_functions_file)) { if ($settings->functions_php_inclusion_method != 'translate') { require_once $desktop_functions_file; } else { mobileview_include_functions_file($desktop_functions_file, dirname($desktop_functions_file), dirname($desktop_functions_file), 'require_once'); } } } }