Пример #1
0
 /**
  * Constructor.
  */
 public function __construct(Warp $warp)
 {
     parent::__construct($warp);
     // load data
     $this->file = $this['system']->cache_path . sprintf('/%s.php', basename($this['path']->path('theme:')));
     $this->data = (file_exists($this->file) and $data = json_decode(file_get_contents($this->file), true) and is_array($data)) ? $data : array();
 }
Пример #2
0
 /**
  * Constructor
  */
 public function __construct(Warp $warp)
 {
     parent::__construct($warp);
     // init vars
     $this->assets = array();
     $this->options = array('base_path' => $this['system']->path, 'base_url' => rtrim($this['path']->url('site:'), '/'));
 }
Пример #3
0
 /**
  * Constructor.
  */
 public function __construct(Warp $warp)
 {
     parent::__construct($warp);
     // register menus
     foreach ($this['config']->get('menu', array()) as $name => $renderer) {
         $this->register($name, $renderer);
     }
 }
Пример #4
0
 /**
  * Constructor.
  */
 public function __construct(Warp $warp)
 {
     parent::__construct($warp);
     // register paths
     foreach ($this['config']->get('path', array()) as $namespace => $paths) {
         foreach ($paths as $path) {
             $this->register($path, $namespace);
         }
     }
 }
Пример #5
0
 /**
  * Constructor.
  *
  * @param Warp $warp
  */
 public function __construct(Warp $warp)
 {
     parent::__construct($warp);
     jimport('joomla.filesystem.folder');
     // init vars
     $this->application = \JFactory::getApplication();
     $this->document = \JFactory::getDocument();
     $this->language = \JFactory::getLanguage();
     $this->path = JPATH_ROOT;
     $this->url = rtrim(\JURI::root(false), '/');
     $this->cache_path = $this->path . '/cache/template';
     $this->cache_time = max(\JFactory::getConfig()->get('cachetime') * 60, 86400);
     // set config or load defaults
     $this['config']->load($this['path']->path('theme:config.json') ?: $this['path']->path('theme:config.default.json'));
     // set cache directory
     if (!file_exists($this->cache_path)) {
         \JFolder::create($this->cache_path);
     }
 }
Пример #6
0
 /**
  * Constructor.
  *
  * @param Warp $warp
  */
 public function __construct(Warp $warp)
 {
     parent::__construct($warp);
     // init vars
     $this->path = rtrim(str_replace(DIRECTORY_SEPARATOR, '/', ABSPATH), '/');
     $this->url = rtrim(site_url(), '/');
     $this->cache_path = rtrim(str_replace(DIRECTORY_SEPARATOR, '/', get_template_directory()), '/') . '/cache';
     $this->cache_time = 86400;
     // set config or load defaults
     if (defined('WP_ALLOW_MULTISITE') && WP_ALLOW_MULTISITE) {
         if ($settings = $this['option']->get('warp_theme_options', false) and is_array($settings)) {
             $this['config']->setValues($settings);
         } else {
             $this['config']->load($this['path']->path('theme:config.default.json'));
         }
     } else {
         $this['config']->load($this['path']->path('theme:config.json') ?: $this['path']->path('theme:config.default.json'));
     }
     // set cache directory
     if (!file_exists($this->cache_path)) {
         mkdir($this->cache_path, 0755);
     }
 }
Пример #7
0
 /**
  * Constructor.
  */
 public function __construct(Warp $warp)
 {
     parent::__construct($warp);
     $this->client = new Client();
 }
Пример #8
0
 /**
  * Constructor.
  */
 public function __construct(Warp $warp)
 {
     parent::__construct($warp);
     $this->document = \JFactory::getDocument();
     $this->renderer = $this->document->loadRenderer('module');
 }
Пример #9
0
 /**
  * Class constructor.
  *
  * @param Warp $warp
  */
 public function __construct(Warp $warp)
 {
     parent::__construct($warp);
     // set prefix
     $this->prefix = basename($this['path']->path('theme:'));
 }
Пример #10
0
 /**
  * Class constructor.
  *
  * @param Warp $warp
  */
 public function __construct(Warp $warp)
 {
     parent::__construct($warp);
 }