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