| 1 |
<?php |
| 2 |
namespace FileBird\Controller; |
| 3 |
|
| 4 |
defined( 'ABSPATH' ) || exit; |
| 5 |
|
| 6 |
class Controller { |
| 7 |
|
| 8 |
protected $folder_table = 'fbv'; |
| 9 |
protected $relation_table = 'fbv_attachment_folder'; |
| 10 |
|
| 11 |
public function __construct() { |
| 12 |
|
| 13 |
} |
| 14 |
|
| 15 |
protected function loadView( $view, $data = array(), $return_html = false ) { |
| 16 |
$viewPath = NJFB_PLUGIN_PATH . 'views/' . $view . '.php'; |
| 17 |
if ( ! file_exists( $viewPath ) ) { |
| 18 |
die( 'View <strong>' . esc_html( $viewPath ) . '</strong> not found!' ); |
| 19 |
} |
| 20 |
extract( $data ); |
| 21 |
if ( $return_html === true ) { |
| 22 |
ob_start(); |
| 23 |
include_once $viewPath; |
| 24 |
return ob_get_clean(); |
| 25 |
} |
| 26 |
include_once $viewPath; |
| 27 |
} |
| 28 |
protected function getTable( $table ) { |
| 29 |
global $wpdb; |
| 30 |
return $wpdb->prefix . $table; |
| 31 |
} |
| 32 |
protected function getNodeClass( $id, $count = 0 ) { |
| 33 |
return "fbv_$id fbvc_$count"; |
| 34 |
} |
| 35 |
} |