Exemplo n.º 1
0
 public function __construct($path, $name = '')
 {
     $gantry = \Gantry\Framework\Gantry::instance();
     $relpath = Folder::getRelativePath($path);
     // Initialize admin streams.
     /** @var Platform $patform */
     $patform = $gantry['platform'];
     $nucleus = $patform->getEnginePaths('nucleus')[''];
     $patform->set('streams.gantry-admin.prefixes', ['' => ['gantry-theme://admin', $relpath, $relpath . '/common', 'gantry-engine://admin'], 'assets/' => array_merge([$relpath, $relpath . '/common'], $nucleus, ['gantry-assets://'])]);
     $gantry['particles'] = function ($c) {
         return new Particles($c);
     };
     $gantry['styles'] = function ($c) {
         return new Styles($c);
     };
     $gantry['defaults'] = function ($c) {
         /** @var UniformResourceLocator $locator */
         $locator = $c['locator'];
         $cache = $locator->findResource('gantry-cache://theme/compiled/config', true, true);
         $paths = $locator->findResources('gantry-config://default');
         $files = (new ConfigFileFinder())->locateFiles($paths);
         $config = new CompiledConfig($cache, $files, function () use($c) {
             return $c['blueprints'];
         });
         return $config->load(true);
     };
     parent::__construct($path, $name);
     $this->boot();
 }
Exemplo n.º 2
0
 public function __construct($path, $name = '')
 {
     parent::__construct($path, $name);
     $gantry = Gantry::instance();
     /** @var UniformResourceLocator $locator */
     $locator = $gantry['locator'];
     \Timber::$locations = $locator->findResources('gantry-engine://views');
     add_theme_support('html5', ['comment-list', 'comment-form', 'search-form', 'gallery', 'caption', 'widgets']);
     add_theme_support('title-tag');
     add_theme_support('post-formats');
     add_theme_support('post-thumbnails');
     add_theme_support('menus');
     add_theme_support('widgets');
     add_filter('timber_context', [$this, 'add_to_context']);
     add_filter('get_twig', [$this, 'add_to_twig']);
     add_action('template_redirect', [$this, 'set_template_layout'], -10000);
     add_action('init', [$this, 'register_post_types']);
     add_action('init', [$this, 'register_taxonomies']);
     add_action('widgets_init', [$this, 'widgets_init']);
     add_action('wp_enqueue_scripts', [$this, 'enqueue_scripts']);
     add_action('admin_enqueue_scripts', [$this, 'enqueue_scripts']);
     add_action('wp_head', [$this, 'print_styles'], 20);
     add_action('wp_head', [$this, 'print_scripts'], 30);
     add_action('admin_print_styles', [$this, 'print_styles'], 200);
     add_action('admin_print_scripts', [$this, 'print_scripts'], 200);
     add_action('wp_footer', [$this, 'print_inline_scripts']);
 }
Exemplo n.º 3
0
 public function __construct($path, $name = '')
 {
     $gantry = \Gantry\Framework\Gantry::instance();
     $relpath = Folder::getRelativePath($path);
     // Initialize admin streams.
     $gantry['platform']->set('streams.gantry-admin.prefixes', ['' => [$relpath, $relpath . '/common'], 'assets/' => [$relpath, $relpath . '/common']]);
     parent::__construct($path, $name);
     // FIXME:
     $this->url = '/templates/' . $this->name;
     $this->boot();
 }
Exemplo n.º 4
0
 public function __construct($path, $name = '')
 {
     parent::__construct($path, $name);
     add_theme_support('post-formats');
     add_theme_support('post-thumbnails');
     add_theme_support('menus');
     add_filter('timber_context', array($this, 'add_to_context'));
     add_filter('get_twig', array($this, 'add_to_twig'));
     add_action('init', array($this, 'register_post_types'));
     add_action('init', array($this, 'register_taxonomies'));
     add_action('widgets_init', array($this, 'widgets_init'));
 }
Exemplo n.º 5
0
 public function __construct($path, $name = '')
 {
     parent::__construct($path, $name);
     add_theme_support('html5', array('comment-list', 'comment-form', 'search-form', 'gallery', 'caption', 'widgets'));
     add_theme_support('title-tag');
     add_theme_support('post-formats');
     add_theme_support('post-thumbnails');
     add_theme_support('menus');
     add_filter('timber_context', array($this, 'add_to_context'));
     add_filter('get_twig', array($this, 'add_to_twig'));
     add_action('init', array($this, 'register_post_types'));
     add_action('init', array($this, 'register_taxonomies'));
     add_action('widgets_init', array($this, 'widgets_init'));
 }
Exemplo n.º 6
0
 public function __construct($path, $name = '')
 {
     global $pagenow;
     parent::__construct($path, $name);
     $gantry = Gantry::instance();
     $global = $gantry['global'];
     /** @var UniformResourceLocator $locator */
     $locator = $gantry['locator'];
     \Timber::$locations = $locator->findResources('gantry-engine://views');
     add_theme_support('html5', ['comment-list', 'comment-form', 'search-form', 'gallery', 'caption', 'widgets']);
     add_theme_support('title-tag');
     add_theme_support('post-formats');
     add_theme_support('post-thumbnails');
     add_theme_support('menus');
     add_theme_support('widgets');
     add_theme_support('woocommerce');
     add_filter('timber_context', [$this, 'add_to_context']);
     add_filter('get_twig', [$this, 'add_to_twig']);
     add_filter('the_content', [$this, 'url_filter'], 0);
     add_filter('the_excerpt', [$this, 'url_filter'], 0);
     add_filter('widget_text', [$this, 'url_filter'], 0);
     add_filter('widget_content', [$this, 'url_filter'], 0);
     add_action('template_redirect', [$this, 'set_template_layout'], -10000);
     add_action('init', [$this, 'register_post_types']);
     add_action('init', [$this, 'register_taxonomies']);
     add_action('template_redirect', [$this, 'disable_wpautop'], 10000);
     add_action('widgets_init', [$this, 'widgets_init']);
     add_action('wp_enqueue_scripts', [$this, 'enqueue_scripts']);
     add_action('admin_enqueue_scripts', [$this, 'enqueue_scripts']);
     add_action('wp_head', [$this, 'print_styles'], 20);
     add_action('wp_head', [$this, 'print_scripts'], 30);
     add_action('admin_print_styles', [$this, 'print_styles'], 200);
     add_action('admin_print_scripts', [$this, 'print_scripts'], 200);
     add_action('wp_footer', [$this, 'print_inline_scripts']);
     add_action('widgets_init', function () {
         register_widget('\\Gantry\\WordPress\\Widget\\Particle');
     });
     // Offline support.
     add_action('init', function () use($global, $pagenow) {
         if ($global->get('offline') && !(is_super_admin() || current_user_can('manage_options') || $pagenow == 'wp-login.php')) {
             if (locate_template(['offline.php'])) {
                 add_filter('template_include', function () {
                     return locate_template(['offline.php']);
                 });
             } else {
                 wp_die($global->get('offline_message'), get_bloginfo('title'));
             }
         }
     });
 }
Exemplo n.º 7
0
 public function __construct($path, $name = '')
 {
     parent::__construct($path, $name);
     $this->boot();
 }
Exemplo n.º 8
0
 public function __construct($path, $name = '')
 {
     parent::__construct($path, $name);
     $this->url = dirname($_SERVER['SCRIPT_NAME']);
 }
Exemplo n.º 9
0
 public function __construct($path, $name = '')
 {
     parent::__construct($path, $name);
     $this->url = \JUri::root(true) . '/templates/' . $this->name;
 }
Exemplo n.º 10
0
 public function __construct($path, $name = '')
 {
     parent::__construct($path, $name);
     $this->url = \Mage::getBaseUrl(\Mage_Core_Model_Store::URL_TYPE_SKIN);
 }
Exemplo n.º 11
0
 public function __construct($path, $name = '')
 {
     parent::__construct($path, $name);
     $this->url = './styles/' . $name;
 }