/**
  * {@inheritdoc}
  */
 public function registerAssets(array $config, ContainerBuilder $containerBuilder)
 {
     $assets = [];
     $assets[] = AssetFactory::asset('jquery', 'bundles/ynloframework/vendor/jquery/jquery.min.js');
     $assets[] = AssetFactory::module('underscore', 'bundles/ynloframework/vendor/underscore/underscore-min.js');
     if ($config['ajax_forms']) {
         $assets[] = AssetFactory::module('jquery_form', 'bundles/ynloframework/vendor/jquery.form/jquery.form.js');
     }
     if ($config['pace']) {
         $assets[] = AssetFactory::module('pace_js', 'bundles/ynloframework/vendor/pace/pace.js');
         $assets[] = AssetFactory::asset('pace_config', 'bundles/ynloframework/js/pace_settings.js', ['pace_settings_dumper']);
         $assets[] = AssetFactory::asset('pace_css', 'bundles/ynloframework/vendor/pace/pace.css');
     }
     //$assets[] = AssetFactory::asset('fastclick', 'bundles/ynloframework/vendor/fastclick/fastclick.js');
     $assets[] = AssetFactory::module('bootstrap_js', 'bundles/ynloframework/vendor/bootstrap/js/bootstrap.min.js')->setCdn('https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js');
     $assets[] = AssetFactory::asset('bootstrap_css', 'bundles/ynloframework/vendor/bootstrap/css/bootstrap.min.css');
     $assets[] = AssetFactory::asset('fontawesome', 'bundles/ynloframework/vendor/font-awesome/css/font-awesome.min.css');
     $assets[] = AssetFactory::asset('glyphicons', 'bundles/ynloframework/vendor/glyphicons/css/glyphicons.css');
     $assets[] = AssetFactory::asset('icomoon', 'bundles/ynloframework/vendor/icomoon/icomoon.css');
     $assets[] = AssetFactory::asset('ynlo_framework_js', 'bundles/ynloframework/js/framework.js');
     $assets[] = AssetFactory::asset('ynlo_framework_core_js', 'bundles/ynloframework/js/core.yfp.js', ['yfp_config_dumper']);
     $assets[] = AssetFactory::asset('ynlo_framework_libraries_js', 'bundles/ynloframework/js/lib/*.js');
     if ($config['debug']) {
         $assets[] = AssetFactory::asset('ynlo_debugger_js', 'bundles/ynloframework/js/debugger.yfp.js', ['yfp_config_dumper']);
         $assets[] = AssetFactory::asset('ynlo_debugger_css', 'bundles/ynloframework/css/debugger.css');
     }
     if ($config['animate_css']) {
         $assets[] = AssetFactory::asset('animate_css', 'bundles/ynloframework/vendor/animate/animate.min.css');
     }
     return $assets;
 }
 /**
  * {@inheritdoc}
  */
 public function registerAssets(array $config, ContainerBuilder $containerBuilder)
 {
     $assets = [];
     //vendor
     $assets[] = AssetFactory::module('bootstrap_dialog_js', 'bundles/ynlomodal/vendor/bootstrap-dialog/bootstrap-dialog.min.js')->setModuleName('bootstrap-dialog')->setDependencies(['bootstrap']);
     $assets[] = AssetFactory::asset('bootstrap_dialog_css', 'bundles/ynlomodal/vendor/bootstrap-dialog/bootstrap-dialog.min.css');
     //internal
     $assets[] = AssetFactory::asset('ynlo_modal_js', 'bundles/ynlomodal/js/modal.yfp.js', ['yfp_config_dumper']);
     $assets[] = AssetFactory::asset('ynlo_modal_css', 'bundles/ynlomodal/css/modals.css', ['yfp_config_dumper']);
     return $assets;
 }
Пример #3
0
 /**
  * {@inheritdoc}
  */
 public function registerAssets(array $config, ContainerBuilder $containerBuilder)
 {
     $assets = [];
     //vendor
     $assets[] = AssetFactory::module('moment_js', 'bundles/ynloform/vendor/moment.min.js');
     if (array_key_value($config, 'datetimepicker')) {
         $assets[] = AssetFactory::module('bootstrap_datetimepicker_js', 'bundles/ynloform/vendor/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js')->setDependencies(['bootstrap', 'moment'])->addJqueryPlugin('datetimepicker');
         $assets[] = AssetFactory::asset('bootstrap_datetimepicker_css', 'bundles/ynloform/vendor/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css');
         $assets[] = AssetFactory::asset('ynlo_form_date_time_picker_js', 'bundles/ynloform/js/form_date_time_picker.yfp.js', ['yfp_config_dumper']);
     }
     $assets[] = AssetFactory::module('spectrum_colorpicker_js', 'bundles/ynloform/vendor/spectrum/spectrum.js')->addJqueryPlugin('spectrum');
     $assets[] = AssetFactory::asset('spectrum_colorpicker_css', 'bundles/ynloform/vendor/spectrum/spectrum.css');
     $assets[] = AssetFactory::asset('spectrum_colorpicker_theme_css', 'bundles/ynloform/vendor/spectrum/themes/bootstrap.css');
     //switchery does not work as module, why?
     $assets[] = AssetFactory::asset('switchery_js', 'bundles/ynloform/vendor/switchery/switchery.min.js');
     $assets[] = AssetFactory::asset('switchery_css', 'bundles/ynloform/vendor/switchery/switchery.min.css');
     if (array_key_value($config, 'select2.enabled')) {
         $assets[] = AssetFactory::module('select2_js', 'bundles/ynloform/vendor/select2/js/select2.full.min.js');
         $assets[] = AssetFactory::asset('select2_css', 'bundles/ynloform/vendor/select2/css/select2.min.css');
         if (array_key_value($config, 'select2.theme') === 'bootstrap') {
             $assets[] = AssetFactory::asset('select2_bootstrap_theme_css', 'bundles/ynloform/vendor/select2/css/select2-bootstrap.min.css');
         }
         $assets[] = AssetFactory::asset('ynlo_form_select2_js', 'bundles/ynloform/js/form_select2.yfp.js', ['yfp_config_dumper']);
     }
     $assets[] = AssetFactory::module('angular', 'bundles/ynloform/vendor/angular/angular.min.js');
     $assets[] = AssetFactory::module('angular_animate', 'bundles/ynloform/vendor/angular/angular-animate.min.js')->setModuleName('ngAnimate')->setDependencies(['angular']);
     $assets[] = AssetFactory::module('bootstrap_typeahead_js', 'bundles/ynloform/vendor/bootstrap_typeahead/bootstrap3-typeahead.min.js')->addJqueryPlugin('typeahead');
     $assets[] = AssetFactory::asset('typeahead_css', 'bundles/ynloform/vendor/typeahead/typeahead.css');
     $assets[] = AssetFactory::module('jquery_form_toggle', 'bundles/ynloform/vendor/jquery-form-toggle/jquery-form-toggle.js')->addJqueryPlugin('formToggle');
     $assets[] = AssetFactory::asset('ynlo_form_js', 'bundles/ynloform/js/form.yfp.js', ['yfp_config_dumper']);
     $assets[] = AssetFactory::asset('ynlo_form_color_picker_js', 'bundles/ynloform/js/form_color_picker.yfp.js', ['yfp_config_dumper']);
     $assets[] = AssetFactory::asset('ynlo_form_switchery_js', 'bundles/ynloform/js/form_switchery.yfp.js', ['yfp_config_dumper']);
     $assets[] = AssetFactory::asset('ynlo_form_angular_controller_js', 'bundles/ynloform/js/form_angular_controller.yfp.js', ['yfp_config_dumper']);
     $assets[] = AssetFactory::asset('ynlo_form_typeahead_js', 'bundles/ynloform/js/form_typeahead.yfp.js', ['yfp_config_dumper']);
     $assets[] = AssetFactory::asset('ynlo_form_toggle_js', 'bundles/ynloform/js/form_toggle.yfp.js', ['yfp_config_dumper']);
     return $assets;
 }
Пример #4
0
 /**
  * Register all assets and modules given in the asset configuration.
  */
 private static function registerConfigAssets()
 {
     $config = self::$container->getExtensionConfig('ynlo_assets')[0];
     if (isset($config['assets'])) {
         foreach ($config['assets'] as $name => $asset) {
             self::addAsset(AssetFactory::asset($name, $asset));
         }
     }
     if (isset($config['modules'])) {
         foreach ($config['modules'] as $name => $assetConfig) {
             if (!array_key_value($assetConfig, 'asset')) {
                 $msg = sprintf('The registered javascript module `%s` don`t have a valid asset associated.', $name);
                 throw new \RuntimeException($msg);
             }
             $module = AssetFactory::module($name, $assetConfig['asset']);
             $module->setDependencies(array_key_value($assetConfig, 'deps', []));
             $module->setCdn(array_key_value($assetConfig, 'cdn'));
             $module->setExports(array_key_value($assetConfig, 'exports', []));
             $module->setInit(array_key_value($assetConfig, 'init'));
             $module->setJqueryPlugins(array_key_value($assetConfig, 'jquery_plugins', []));
             self::addAsset($module);
         }
     }
 }
 /**
  * {@inheritdoc}
  */
 public function registerAssets(array $config, ContainerBuilder $containerBuilder)
 {
     $assets = [];
     //Vendor
     $assets[] = AssetFactory::asset('admin_lte_css', 'bundles/ynloadmin/vendor/admin-lte/css/AdminLTE.min.css');
     $assets[] = AssetFactory::asset('admin_lte_skins_css', 'bundles/ynloadmin/vendor/admin-lte/css/skins/_all-skins.min.css');
     $assets[] = AssetFactory::module('admin_lte_js', 'bundles/ynloadmin/vendor/admin-lte/js/app.min.js')->setDependencies(['bootstrap']);
     $assets[] = AssetFactory::module('jquery_slim_scroll_js', 'bundles/ynloadmin/vendor/admin-lte/plugins/slimScroll/jquery.slimscroll.min.js')->setJqueryPlugins(['slimScroll', 'slimscroll']);
     $assets[] = AssetFactory::asset('jquery_confirm_exit_js', 'bundles/sonataadmin/jquery/jquery.confirmExit.js');
     if ($config['icheck']) {
         $assets[] = AssetFactory::module('icheck_js', 'bundles/ynloadmin/vendor/admin-lte/plugins/iCheck/icheck.min.js');
         $theme = 'flat-blue';
         if (is_string($config['icheck']) && $config['icheck'] !== $theme) {
             $theme = $config['icheck'];
         }
         if (strpos($theme, '-') !== false) {
             $theme = str_replace('-', '/', $theme);
         } else {
             $theme = $theme . '/' . $theme;
         }
         $assets[] = AssetFactory::asset('icheck_theme_css', "bundles/ynloadmin/vendor/admin-lte/plugins/iCheck/{$theme}.css");
     }
     $assets[] = AssetFactory::module('bootstrap_editable_js', 'bundles/sonataadmin/vendor/x-editable/dist/bootstrap3-editable/js/bootstrap-editable.min.js')->setDependencies(['bootstrap'])->setJqueryPlugins(['editable']);
     $assets[] = AssetFactory::asset('bootstrap_editable_css', 'bundles/sonataadmin/vendor/x-editable/dist/bootstrap3-editable/css/bootstrap-editable.css');
     $assets[] = AssetFactory::module('jquery_ui_js', 'bundles/sonataadmin/vendor/jqueryui/ui/minified/jquery-ui.min.js')->setJqueryPlugins(['sortable']);
     $assets[] = AssetFactory::asset('jquery_ui_css', 'bundles/sonataadmin/vendor/jqueryui/themes/base/jquery-ui.css');
     $assets[] = AssetFactory::asset('tree_view_js', 'bundles/sonataadmin/treeview.js');
     $assets[] = AssetFactory::asset('jquery_waypoints_js', 'bundles/sonataadmin/vendor/waypoints/lib/jquery.waypoints.min.js');
     $assets[] = AssetFactory::asset('jquery_waypoints_sticky_js', 'bundles/sonataadmin/vendor/waypoints/lib/shortcuts/sticky.min.js');
     $assets[] = AssetFactory::module('sonata_admin_js', 'bundles/sonataadmin/Admin.js');
     $assets[] = AssetFactory::asset('jquery_visible_js', 'bundles/ynloadmin/vendor/plugins/js/jquery_visible.js');
     //Internal
     $assets[] = AssetFactory::asset('ynlo_admin_js', 'bundles/ynloadmin/js/admin.yfp.js', ['yfp_config_dumper']);
     $assets[] = AssetFactory::asset('ynlo_admin_css', 'bundles/ynloadmin/css/ynlo-admin.css', ['yfp_config_dumper']);
     $assets[] = AssetFactory::asset('sonata_admin_override_js', 'bundles/ynloadmin/js/sonata_admin_override.js');
     $assets[] = AssetFactory::asset('ynlo_admin_list_batch_js', 'bundles/ynloadmin/js/admin_list_batch.yfp.js', ['yfp_config_dumper']);
     $assets[] = AssetFactory::asset('ynlo_admin_list_details_js', 'bundles/ynloadmin/js/admin_list_details.yfp.js', ['yfp_config_dumper']);
     return $assets;
 }