Esempio n. 1
0
 public static function add($scName, $funcName)
 {
     $data = debug_backtrace();
     $path = dirname($data[0]['file']) . '/';
     $post = array();
     $post['content'] = $scName;
     $post['func'] = $funcName;
     $pluginPath = $path;
     $folderName = basename($path);
     $post['foldername'] = $folderName;
     $post['zonename'] = 'shortcode';
     $post['type'] = 'shortcode';
     // Plugins::add('shortcode',$post);
     if (!PluginsMeta::insert($post)) {
         return false;
     }
     PluginsZone::addPlugin($post['zonename'], $post);
 }
Esempio n. 2
0
 public static function add($zoneName, $funcName)
 {
     $inputData = array();
     $data = debug_backtrace();
     $pluginPath = dirname($data[0]['file']) . '/';
     $foldername = basename($pluginPath);
     if (!isset($foldername[2])) {
         // throw new Exception("Plugin folder name must have to large than 2 character.");
         self::writeError("Plugin folder name must have to large than 2 character.");
         return false;
     }
     // $inputData['status']=1;
     self::$canAddZone = 'yes';
     $inputData['foldername'] = $foldername;
     $inputData['zonename'] = $zoneName;
     $inputData['func'] = $funcName;
     if (!PluginsMeta::insert($inputData)) {
         self::writeError("Error. " . Database::$error);
         return false;
     }
     PluginsZone::addPlugin($inputData['zonename'], $inputData);
 }