/** * init base variables of the globals */ public static function initGlobalsBase($pluginFolder) { global $wpdb; GlobalsUG::$isScriptsInFooter = true; $tablePrefix = $wpdb->prefix; GlobalsUG::$table_galleries = $tablePrefix . GlobalsUG::TABLE_GALLERIES_NAME; GlobalsUG::$table_categories = $tablePrefix . GlobalsUG::TABLE_CATEGORIES_NAME; GlobalsUG::$table_items = $tablePrefix . GlobalsUG::TABLE_ITEMS_NAME; $pluginName = "unitegallery"; GlobalsUG::$pathPlugin = realpath($pluginFolder) . "/"; GlobalsUG::$path_media_ug = GlobalsUG::$pathPlugin . "unitegallery-plugin/"; GlobalsUG::$path_base = ABSPATH; $arrUploadDir = wp_upload_dir(); $pathImages = $arrUploadDir["basedir"]; GlobalsUG::$path_images = realpath($pathImages) . "/"; GlobalsUG::$path_cache = GlobalsUG::$pathPlugin . "cache/"; GlobalsUG::$urlPlugin = plugin_dir_url($pluginFolder . "/unitegallery.php"); GlobalsUG::$url_component_client = ""; GlobalsUG::$url_component_admin = admin_url() . "admin.php?page={$pluginName}"; GlobalsUG::$url_base = site_url() . "/"; GlobalsUG::$url_media_ug = GlobalsUG::$urlPlugin . "unitegallery-plugin/"; GlobalsUG::$url_images = content_url() . "/"; GlobalsUG::$url_ajax = admin_url() . "/admin-ajax.php"; GlobalsUG::$url_ajax_front = GlobalsUG::$url_ajax; }
/** * init client side text for globals */ public static function initClientSideText() { self::$arrClientSideText = array("please_fill_item_title" => __("Please fill in item title", UNITEGALLERY_TEXTDOMAIN), "updating_item_data" => __("Updating item data...", UNITEGALLERY_TEXTDOMAIN), "loading_item_data" => __("Loading item data...", UNITEGALLERY_TEXTDOMAIN), "edit_item" => __("Edit Item", UNITEGALLERY_TEXTDOMAIN), "edit_media_item" => __("Edit Media Item", UNITEGALLERY_TEXTDOMAIN), "add_image" => __("Add image (use shift or ctrl for choosing multiple images)", UNITEGALLERY_TEXTDOMAIN), "adding_category" => __("Adding Category...", UNITEGALLERY_TEXTDOMAIN), "do_you_sure_remove" => __("Do you sure to remove this category and it's items?", UNITEGALLERY_TEXTDOMAIN), "removing_category" => __("Removing Category...", UNITEGALLERY_TEXTDOMAIN), "cancel" => __("Cancel", UNITEGALLERY_TEXTDOMAIN), "update" => __("Update", UNITEGALLERY_TEXTDOMAIN), "restore" => __("Restore", UNITEGALLERY_TEXTDOMAIN), "updating" => __("Updating...", UNITEGALLERY_TEXTDOMAIN), "restoring" => __("Restoring...", UNITEGALLERY_TEXTDOMAIN), "updating_category" => __("Updating Category...", UNITEGALLERY_TEXTDOMAIN), "adding_item" => __("Adding Item...", UNITEGALLERY_TEXTDOMAIN), "updating_categories_order" => __("Updating Categories Order...", UNITEGALLERY_TEXTDOMAIN), "removing_items" => __("Removing Items...", UNITEGALLERY_TEXTDOMAIN), "updating_title" => __("Updating Title...", UNITEGALLERY_TEXTDOMAIN), "duplicating_items" => __("Duplicating Items...", UNITEGALLERY_TEXTDOMAIN), "updating_items_order" => __("Updating Items Order...", UNITEGALLERY_TEXTDOMAIN), "copying_items" => __("Copying Items...", UNITEGALLERY_TEXTDOMAIN), "moving_items" => __("Moving Items...", UNITEGALLERY_TEXTDOMAIN), "confirm_remove_items" => __("Are you sure you want to delete these items?", UNITEGALLERY_TEXTDOMAIN), "confirm_remove_gallery" => __("Are you sure you want to delete this gallery?", UNITEGALLERY_TEXTDOMAIN)); }
/** * * init all actions */ public function init() { GlobalsUG::$is_admin = true; $this->initCurrentGallery(); }