/**
  * Detect the active module and setup our
  * environment with it.
  */
 public function handle()
 {
     /**
      * In order to detect we MUST have a route
      * and we MUST have a namespace in the
      * streams::addon action parameter.
      *
      * @var Route $route
      */
     $route = $this->request->route();
     /* @var Module $module */
     if ($route && ($module = $this->modules->get(array_get($route->getAction(), 'streams::addon')))) {
         $module->setActive(true);
     }
     if (!$module && $this->request->segment(1) == 'admin' && ($module = $this->modules->findBySlug($this->request->segment(2)))) {
         $module->setActive(true);
     }
     if (!$module) {
         return;
     }
     $this->container->make('view')->addNamespace('module', $module->getPath('resources/views'));
     $this->container->make('translator')->addNamespace('module', $module->getPath('resources/lang'));
     $this->asset->addPath('module', $module->getPath('resources'));
     $this->image->addPath('module', $module->getPath('resources'));
 }
 public function index(Asset $asset)
 {
     $asset->add('scripts.js', 'bloveless.module.migrator::js/admin/column.js');
     $tables = DB::select('SHOW TABLES');
     $tables = array_flatten(array_map(function ($table) {
         return array_values((array) $table);
     }, $tables));
     return view('bloveless.module.migrator::admin/columns/index', compact('tables'));
 }
예제 #3
0
 /**
  * Handle the command.
  *
  * @param Asset $asset
  * @throws \Exception
  */
 public function handle(Asset $asset)
 {
     foreach ($this->builder->getAssets() as $collection => $assets) {
         if (!is_array($assets)) {
             $assets = [$assets];
         }
         foreach ($assets as $file) {
             $filters = explode('|', $file);
             $file = array_shift($filters);
             $asset->add($collection, $file, $filters);
         }
     }
 }
예제 #4
0
 /**
  * Add the page and page type assets.
  *
  * @param PostInterface $post
  * @throws \Exception
  */
 public function add(PostInterface $post)
 {
     /* @var EditorFieldTypePresenter $js */
     /* @var EditorFieldTypePresenter $css */
     $js = $post->getFieldTypePresenter('js');
     $css = $post->getFieldTypePresenter('css');
     $this->asset->add('styles.css', $css->path());
     $this->asset->add('scripts.js', $js->path());
     $type = $post->getType();
     $js = $type->getFieldTypePresenter('js');
     $css = $type->getFieldTypePresenter('css');
     $this->asset->add('styles.css', $css->path());
     $this->asset->add('scripts.js', $js->path());
 }
 /**
  * Handle the command.
  */
 public function handle(Asset $asset, Container $container, Application $application)
 {
     $asset->addPath('public', public_path());
     $asset->addPath('node', base_path('node_modules'));
     $asset->addPath('asset', $application->getAssetsPath());
     $asset->addPath('storage', $application->getStoragePath());
     $asset->addPath('download', $application->getAssetsPath('assets/downloads'));
     $asset->addPath('streams', $container->make('streams.path') . '/resources');
     $asset->addPath('bower', $container->make('path.base') . '/bin/bower_components');
 }
 /**
  * Detect the active theme and set up
  * our environment with it.
  */
 public function handle()
 {
     $admin = $this->themes->get($this->config->get('streams::themes.admin'));
     $standard = $this->themes->get($this->config->get('streams::themes.standard'));
     if ($admin) {
         $admin->setActive(true);
     }
     if ($standard) {
         $standard->setActive(true);
     }
     if ($admin && in_array($this->request->segment(1), ['installer', 'admin'])) {
         $admin->setCurrent(true);
     } elseif ($standard) {
         $standard->setCurrent(true);
     }
     if ($theme = $this->themes->current()) {
         $this->view->addNamespace('theme', $theme->getPath('resources/views'));
         $this->translator->addNamespace('theme', $theme->getPath('resources/lang'));
         $this->asset->addPath('theme', $theme->getPath('resources'));
         $this->image->addPath('theme', $theme->getPath('resources'));
     }
 }
 public function migrate(Asset $assets)
 {
     $assets->add('scripts.js', 'bloveless.module.migrator::js/admin/file.js');
     $files = $this->getFilesToMigrate($this->baseUrl);
     return view('bloveless.module.migrator::admin/file/progress', compact('files'));
 }