| 1 |
<?php |
| 2 |
/** |
| 3 |
* Moove_Importer_View File Doc Comment |
| 4 |
* |
| 5 |
* @category Moove_Importer_View |
| 6 |
* @package moove-feed-importer |
| 7 |
* @author Gaspar Nemes |
| 8 |
*/ |
| 9 |
|
| 10 |
/** |
| 11 |
* Moove_Importer_View Class Doc Comment |
| 12 |
* |
| 13 |
* @category Class |
| 14 |
* @package Moove_Importer_View |
| 15 |
* @author Gaspar Nemes |
| 16 |
*/ |
| 17 |
class Moove_Importer_View { |
| 18 |
/** |
| 19 |
* Load and update view |
| 20 |
* |
| 21 |
* Parameters: |
| 22 |
* |
| 23 |
* @param string $view // the view to load, dot used as directory separator, no file extension given. |
| 24 |
* @param mixed $data // The data to display in the view (could be anything, even an object). |
| 25 |
*/ |
| 26 |
public static function load( $view, $data ) { |
| 27 |
$view_file_origin = dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'views'; |
| 28 |
$view_name = str_replace( '.' , DIRECTORY_SEPARATOR , $view ) . '.php'; |
| 29 |
if ( locate_template( 'moove-externals' . DIRECTORY_SEPARATOR . $view_name ) ) : |
| 30 |
$view_file_origin = get_template_directory() . DIRECTORY_SEPARATOR . 'moove-externals'; |
| 31 |
endif; |
| 32 |
ob_start(); |
| 33 |
include $view_file_origin . DIRECTORY_SEPARATOR . $view_name; |
| 34 |
return ob_get_clean(); |
| 35 |
} |
| 36 |
} |
| 37 |
|