コード例 #1
0
ファイル: index.php プロジェクト: cmsmypage/phuocpham
        }
        $reflector = new ReflectionClass($p_obj);
        $plugin_path = dirname($reflector->getFileName());
        $controller_file = implode('-', $controller_array) . '-controller.php';
        $controller_class = '';
        foreach ($controller_array as $v) {
            $controller_class .= ucfirst($v) . '_';
        }
        $controller_class .= 'Controller';
        if (is_file($plugin_path . '/admin/controllers/' . $controller_file)) {
            require $plugin_path . '/admin/controllers/' . $controller_file;
            $controller_obj = new $controller_class();
            $action = !empty($_GET[$controller_obj->action]) ? $_GET[$controller_obj->action] : 'index';
            $_call_back = array($controller_obj, $action);
            if (method_exists($controller_obj, $action) && is_callable($_call_back, true)) {
                call_user_func($_call_back);
            }
        }
        $_admin_plugin_content = ob_get_contents();
        ob_end_clean();
    } else {
        // Error: Plugin load fails
    }
}
if (is_ajax()) {
    die($_admin_plugin_content);
}
require ABSPATH . '/' . ADMIN_FOLDER . '/themes/default/template.php';
if (true === DEBUG) {
    Pf::database()->show_debug_console();
}