Example #1
0
 protected function preAdmin()
 {
     parent::preAdmin();
     if (class_exists('\\Search\\Factory')) {
         \Search\Factory::registerSource(new \Search\Models\Source(array('id' => 'users', 'title' => 'Users', 'class' => '\\Users\\Models\\Users', 'priority' => 20)));
     }
     static::setActive();
 }
Example #2
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 #3
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 #4
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 #5
0
 protected function preSite()
 {
     if (class_exists('\\Search\\Factory')) {
         \Search\Factory::registerSource(new \Search\Models\Source(array('id' => 'shop.products', 'title' => 'Products', 'class' => '\\Shop\\Models\\Products')));
     }
     if (class_exists('\\Minify\\Factory')) {
         \Minify\Factory::registerPath($this->dir . "/src/");
         $files = array('Shop/Assets/js/class.js', 'Shop/Assets/js/validation.js', 'Shop/Assets/js/site.js', 'Shop/Assets/js/jquery.popupoverlay.js', 'Shop/Assets/js/jquery.scrollTo.js', 'Shop/Assets/js/jquery.payment.js', 'Shop/Assets/js/jquery.star-rating.js');
         if ($check_campaigns = \Dsc\System::instance()->get('session')->get('shop.check_campaigns')) {
             $files[] = 'Shop/Assets/js/check_campaigns.js';
         }
         foreach ($files as $file) {
             \Minify\Factory::js($file);
         }
         $files = array('Shop/Assets/css/jquery.star-rating.css');
         foreach ($files as $file) {
             \Minify\Factory::css($file);
         }
     }
     $app = \Base::instance();
     $request_kmi = \Dsc\System::instance()->get('input')->get('kmi', null, 'string');
     $cookie_kmi = $app->get('COOKIE.kmi');
     if (!empty($request_kmi)) {
         if ($cookie_kmi != $request_kmi) {
             $app->set('COOKIE.kmi', $request_kmi);
         }
         $cart = \Shop\Models\Carts::fetch();
         if (empty($cart->user_email)) {
             $cart->user_email = $request_kmi;
             $cart->store();
         }
     }
     // symlink to the public folder if necessary
     if (!is_dir($this->app->get('PATH_ROOT') . 'public/ShopAssets')) {
         $public_assets = $this->app->get('PATH_ROOT') . 'public/ShopAssets';
         $app_assets = realpath(__DIR__ . '/src/Shop/Assets');
         $res = symlink($app_assets, $public_assets);
     }
     static::diagnostics();
 }
Example #6
0
 protected function preAdmin()
 {
     if (class_exists('\\Search\\Factory')) {
         \Search\Factory::registerSource(new \Search\Models\Source(array('id' => 'pages', 'title' => 'Pages', 'class' => '\\Pages\\Models\\Pages')));
     }
 }