Ejemplo n.º 1
0
 /**
  * The main plugin constructor
  * 
  * @global type $syn_restaurant_config
  */
 public function __construct()
 {
     global $syn_restaurant_config;
     parent::__construct($syn_restaurant_config);
     add_action('admin_enqueue_scripts', array($this, 'admin_scripts'));
     add_action('wp_enqueue_scripts', array($this, 'frontend_scripts'));
     add_action('init', array($this, 'add_actions_and_filters'));
     add_action('init', array($this, 'register_script_files'));
     add_action('init', array($this, 'register_roles'), 5);
 }
Ejemplo n.º 2
0
$cache = getcache($identification, 'plugins');
if (!$cache['disable'] || $filename == 'plugin_admin' || $filename == 'hook') {
    showmessage(L('plugin_not_exist', '', 'plugin'));
} else {
    $status = plugin_stat($cache['appid']);
    if ($status == 0 || $app_status == 1) {
        showmessage(L('plugin_developing', '', 'plugin'));
    } elseif ($status == 3) {
        showmessage(L('plugin_be_locked', '', 'plugin'));
    }
    $iframe = string2array($cache['iframe']);
    if ($iframe['url']) {
        $cache_var = getcache($identification . '_var', 'plugins');
        plugin_base::creat_iframe($cache, $cache_var);
    } else {
        plugin_base::creat_app($identification, $filename, $action);
    }
}
class plugin_base
{
    /**
     * 初始化插件
     */
    public static function creat_app($id, $file, $action)
    {
        define('PLUGIN_ID', $id);
        define('PLUGIN_FILE', $file);
        define('PLUGIN_ACTION', $action);
        self::plugin_init();
    }
    /**