Exemple #1
0
 /**
  * 
  * the constructor
  */
 public function __construct($mainFile, $t)
 {
     global $wpdb;
     self::$is_multisite = UniteFunctionsWPBiz::isMultisite();
     self::$wpdb = $wpdb;
     self::$table_prefix = self::$wpdb->prefix;
     self::$mainFile = $mainFile;
     self::$t = $t;
     //set plugin dirname (as the main filename)
     $info = pathinfo($mainFile);
     $baseName = $info["basename"];
     $filename = str_replace(".php", "", $baseName);
     self::$dir_plugin = $filename;
     self::$url_plugin = plugins_url(self::$dir_plugin) . "/";
     self::$url_ajax = admin_url("admin-ajax.php");
     self::$url_ajax_actions = self::$url_ajax . "?action=" . self::$dir_plugin . "_ajax_action";
     self::$url_ajax_showimage = self::$url_ajax . "?action=" . self::$dir_plugin . "_show_image";
     self::$path_plugin = dirname(self::$mainFile) . "/";
     self::$path_settings = self::$path_plugin . "settings/";
     self::$path_temp = self::$path_plugin . "temp/";
     self::$path_init_data = self::$path_plugin . "init_data/";
     self::$path_languages = self::$path_plugin . "languages/";
     self::$dir_languages = self::$dir_plugin . "/languages/";
     //set cache path:
     self::setPathCache();
     self::$path_views = self::$path_plugin . "views/";
     self::$path_templates = self::$path_views . "/templates/";
     self::$path_base = ABSPATH;
     load_plugin_textdomain(self::$dir_plugin, false, self::$dir_languages);
     //update globals oldversion flag
     GlobalsShowBiz::$isNewVersion = false;
     $version = get_bloginfo("version");
     $version = (double) $version;
     if ($version >= 3.5) {
         GlobalsShowBiz::$isNewVersion = true;
     }
 }