array('text')); /** * put your comment there... * * @var mixed */ protected static $onimport = array('parameters' => array('vpaths')); /** * put your comment there... * * @var mixed */ protected static $oninstantiate = array('parameters' => array('instance')); /** * put your comment there... * * @var mixed */ protected $onloadconfiguration = array('parameters' => array('configuration')); /** * put your comment there... * * @var mixed */ protected $onloaddbdriver = array('parameters' => array('dbdriver')); /** * put your comment there... * * @var mixed */ protected static $onresolvepath = array('parameters' => array('path', 'vpath')); /** * Initialize Plugin. * * @return void */ protected function __construct() { // Initialize hookable! parent::__construct(); // Load configuration. self::$config = $this->onloadconfiguration(require(self::resolvePath('configuration.inc.php'))); // Initialize vars! self::import('framework:db:mysql:queue-driver.inc.php'); $this->dbDriver = $this->onloaddbdriver(new CJTMYSQLQueueDriver($GLOBALS['wpdb'])); } /** * put your comment there... * */ public function getCJTWebSiteURL($path = null) { $domain = self::CJT_WEB_SITE_DOMAIN; return "http://{$domain}/{$path}"; } /** * put your comment there... * */ public function getDBDriver() { return $this->dbDriver; } /** * Get CJT Plugin object. * * @return cssJSToolbox */ public static function getInstance() { if (!self::$instance) { self::$instance = self::trigger('cssJSToolbox.instantiate', (new cssJSToolbox())); } return self::$instance; } /** * put your comment there... * */ public function getSecurityToken() { return wp_create_nonce(CJTController::NONCE_ACTION); } /** * put your comment there... * * @param mixed $text */ public function getText($text) { // Make sure to don't use $this while calling! // $this might be an object other than CssJSToolbox! return self::__callStatic('cssJSToolbox.ongettext', array(__($text, CJTOOLBOX_TEXT_DOMAIN))); } /** * put your comment there... * * @param mixed $path */ public static function getURI($vPath, $uriBase = null) { // PHP wrapper however its not imlpemented as wrapper yet // because this is not the point right now! if (strpos($vPath, 'extension://') === 0) { // Expression for getting plugin/extension name! $exp = '/^extension\:\/\/([^\/]+)/'; preg_match($exp, $vPath, $extensionPath); // Get base URI + removing extension:// wrapper! $uriBase = plugins_url($extensionPath[1]); $uri = self::getURI(preg_replace($exp, '', $vPath), $uriBase); } else { // Translate Virtual path to real path. $path = str_replace(':', '/', $vPath); // Get full URI. if (!isset($uriBase)) { $uriBase = plugin_dir_url(__FILE__); } $uri = "{$uriBase}{$path}"; } return $uri; } /** * put your comment there... * */ public static function import() { // Initialize! $params = func_get_args(); // Allow vriables list parameters. $vPaths = self::trigger('cssJSToolbox.import', $params); foreach ($vPaths as $vPath) { // Import file. require_once self::resolvePath($vPath); } } /** * put your comment there... * * @param mixed $vPath * @param mixed $base */ public static function resolvePath($vPath, $base = CJTOOLBOX_PATH) { // Replace all :'s with /'s. $path = str_replace(':', '/', $vPath); $path = "{$base}/{$path}"; return self::trigger('cssJSToolbox.resolvepath', $path, $vPath); } }// End Class // Hookable! cssJSToolbox::define('cssJSToolbox', array('hookType' => CJTWordpressEvents::HOOK_FILTER));