Пример #1
0
function wptouch_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)) {
        global $wptouch_pro;
        require_once WPTOUCH_DIR . '/core/desktop-functions.php';
        $current_path = dirname($template_file);
        if ($require_once) {
            wptouch_include_functions_file($wptouch_pro, $template_file, $template_path, $current_path, 'require_once');
        } else {
            wptouch_include_functions_file($wptouch_pro, $template_file, $template_path, $current_path, 'require');
        }
    } else {
        // add debug statement
    }
}
Пример #2
0
 function load_functions_file_for_desktop()
 {
     $settings = wptouch_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)) {
             //$desktop_functions_contents = $this->load_and_expand_functions_file( $desktop_functions_file, dirname( $desktop_functions_file ), dirname( $desktop_functions_file ) );
             // This eval is deliberately here
             //eval( $desktop_functions_contents );
             wptouch_include_functions_file($desktop_functions_file, dirname($desktop_functions_file), dirname($desktop_functions_file), 'require_once');
         }
     }
 }
Пример #3
0
 function load_functions_file_for_desktop()
 {
     $settings = wptouch_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)) {
             switch ($settings->functions_php_loading_method) {
                 case 'direct':
                     WPTOUCH_DEBUG(WPTOUCH_INFO, 'Include desktop functions file using DIRECT method');
                     require_once $desktop_functions_file;
                     break;
                 case 'translate':
                     WPTOUCH_DEBUG(WPTOUCH_INFO, 'Include desktop functions file using TRANSLATE method');
                     require_once WPTOUCH_DIR . '/core/desktop-functions.php';
                     wptouch_include_functions_file($desktop_functions_file, dirname($desktop_functions_file), dirname($desktop_functions_file), 'require_once');
                     break;
             }
         }
     }
 }
Пример #4
0
 function load_functions_file_for_desktop()
 {
     $settings = wptouch_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 {
                 wptouch_include_functions_file($desktop_functions_file, dirname($desktop_functions_file), dirname($desktop_functions_file), 'require_once');
             }
         }
     }
 }