Example #1
0
 protected function preAdmin()
 {
     if (class_exists('\\Modules\\Factory')) {
         \Modules\Factory::registerPositions(array('blog-tag-cloud'));
     }
     if (class_exists('\\Search\\Factory')) {
         \Search\Factory::registerSource(new \Search\Models\Source(array('id' => 'blog.posts', 'title' => 'Blog Posts', 'class' => '\\Blog\\Models\\Posts')));
     }
 }
Example #2
0
 protected function runAdmin()
 {
     $f3 = \Base::instance();
     if (!is_dir($f3->get('PATH_ROOT') . 'public/AdminTheme')) {
         $publictheme = $f3->get('PATH_ROOT') . 'public/AdminTheme';
         $admintheme = $f3->get('PATH_ROOT') . 'vendor/dioscouri/f3-admin/AdminTheme';
         $res = symlink($admintheme, $publictheme);
     }
     \Dsc\System::instance()->get('theme')->setTheme('AdminTheme', $this->dir . '/src/Admin/Theme/');
     if (class_exists('\\Modules\\Factory')) {
         \Modules\Factory::registerPositions(array('admin-dashboard'));
     }
     if (class_exists('\\Search\\Factory')) {
         \Search\Factory::registerSource(new \Search\Models\Source(array('id' => 'navigation', 'title' => 'Navigation Items', 'class' => '\\Admin\\Models\\Navigation', 'priority' => 40)));
     }
     parent::runAdmin();
 }
Example #3
0
 protected function preAdmin()
 {
     if (class_exists('\\Search\\Factory')) {
         \Search\Factory::registerSource(new \Search\Models\Source(array('id' => 'modules', 'title' => 'Modules', 'class' => '\\Modules\\Models\\Modules', 'priority' => 40)));
     }
     $path = $this->app->hive()['PATH'];
     if (strpos($path, '/admin/module/edit') !== false) {
         // Bootstrap the reports
         \Modules\Models\Conditions::bootstrap();
     }
     $custom_nav_items = (new \Admin\Models\Navigation())->emptyState()->setState('filter.root', false)->setState('filter.published', true)->setState('order_clause', array('tree' => 1, 'lft' => 1))->setCondition('details.type', 'module-custom')->getList();
     if ($custom_nav_items) {
         foreach ($custom_nav_items as $nav_item) {
             if ($position = $nav_item->{'details.module_position'}) {
                 \Modules\Factory::registerPositions(array($position));
             }
         }
     }
 }
Example #4
0
 /**
  * Renders a theme, template, and view, defaulting to the currently set theme if none is specified
  */
 public function renderTheme($view, array $params = array(), $theme_name = null)
 {
     if (\Base::instance()->get('VERB') == 'HEAD') {
         return;
     }
     $params = $params + array('mime' => 'text/html', 'hive' => null, 'ttl' => 0);
     // Render the view.  Happens before the Theme so that app view files can set values in \Base::instance that get used later by the Theme (e.g. the head)
     $view_string = $this->renderView($view, $params);
     // TODO Before loading the variant file, ensure it exists. If not, load index.php or throw a 500 error
     // Render the theme
     $theme = $this->loadFile($this->getThemePath($this->getCurrentTheme()) . $this->getCurrentVariant());
     // render the system messages
     $messages = \Dsc\System::instance()->renderMessages();
     $this->setBuffer($messages, 'system.messages');
     // get the view and the theme tags
     $view_tags = $this->getTags($view_string);
     $theme_tags = $this->getTags($theme);
     $all_tags = array_merge($theme_tags, $view_tags);
     // Render any modules
     if (class_exists('\\Modules\\Factory')) {
         // Render the requested modules
         foreach ($all_tags as $full_string => $args) {
             if (in_array(strtolower($args['type']), array('modules')) && !empty($args['name'])) {
                 // get the requested module position content
                 $content = \Modules\Factory::render($args['name'], \Base::instance()->get('PARAMS.0'));
                 $this->setBuffer($content, $args['type'], $args['name']);
             }
         }
     }
     // and replace the tags in the view with their appropriate buffers
     $view_string = $this->replaceTagsWithBuffers($view_string, $view_tags);
     $this->setBuffer($view_string, 'view');
     // render the loaded views, if debug is enabled
     $loaded_views = null;
     if (\Dsc\System::instance()->app->get('DEBUG')) {
         $loaded_views = $this->renderLoadedViews();
     }
     $this->setBuffer($loaded_views, 'system.loaded_views');
     // Finally replace any of the tags in the theme with their appropriate buffers
     $string = $this->replaceTagsWithBuffers($theme, $theme_tags);
     return $string;
 }
Example #5
0
<?php

echo \Modules\Factory::render($nav_item->{'details.module_position'}, \Base::instance()->get('PARAMS.0'));
Example #6
0
        </li>
        <li class="active">Invite Friends</li>
    </ol>
    
    <h3>
        Invite friends
        <a class="btn btn-link pull-right" href="./affiliate/dashboard"><i class="fa fa-chevron-left"></i> Back</a>
    </h3>
    
    <hr/>

    <tmpl type="modules" name="above-invite-friend" />
    
    <?php 
$left = \Modules\Factory::render('left-invite-friend', \Base::instance()->get('PARAMS.0'));
$right = \Modules\Factory::render('right-invite-friend', \Base::instance()->get('PARAMS.0'));
$width = '12';
if ($left && $right) {
    $width = '4';
} elseif ($left && !$right || $right && !$left) {
    $width = '8';
}
?>
        
    <div class="row">
        <?php 
if ($left) {
    ?>
        <div class="col-md-4">
            <?php 
    echo $left;
Example #7
0
 /**
  * This method takesccase of registration all modules
  *
  * @param $app Name
  *            of the part of application
  */
 protected function registerModules($app)
 {
     if (!class_exists('\\Modules\\Factory')) {
         return;
     }
     // register the modules path, if you can
     $modules_path = $this->dir . "/src/" . $this->namespace . "/Modules/";
     if (!file_exists($modules_path)) {
         // let's try more specific route
         $modules_path = $this->dir . "/src/" . $this->namespace . '/' . $app . "/Modules/";
         if (!file_exists($modules_path)) {
             // not even here? maybe more luck next time
             $modules_path = '';
         }
     }
     if (strlen($modules_path)) {
         \Modules\Factory::registerPath($modules_path);
     }
 }
Example #8
0
 protected function preAdmin()
 {
     parent::preAdmin();
     \Modules\Factory::registerPositions(array('left-invite-friend', 'right-invite-friend', 'above-invite-friend', 'below-invite-friend', 'above-affiliate-dashboard', 'right-affiliate-dashboard'));
     \Dsc\System::instance()->getDispatcher()->addListener(\Affiliates\Listeners\Shop::instance());
 }
Example #9
0
 public function onPreflight($event)
 {
     // bootstrap all modules
     \Modules\Factory::instance()->bootstrap();
 }