<?php
/**
 * 插件模块
 *
 */
class plugin_mod extends mogvs_mod {
     
    /**
     * 插件入口
     *
     * @param unknown_type $p1
     * @param unknown_type $p2
     */
    public function __call($p1 , $p2){
        $pcls = substr($p1 , 0 , -3);
        if(preg_match('/^\w+$/i',  $pcls)){
            if(!is_file(DATA_PATH . $pcls . '.lock')){
                $this->show404(1 , '该插件尚未安装!');
            }
            $row = OBJ('plugin_tab')->where("dir = '{$pcls}'")->get();
            if($row['status'] != '1'){
                $this->show404(1 , '该插件尚未启用!');
            }
            $plu = PLU($pcls);
            $method = $this->has('op') ? $this->get('op') : "index";
            if(!method_exists($plu , $method)){
                $this->show404(1 , '该页面不存在!');
            }
            call_user_func(array($plu , $method));
        }
    }
}
?>