├── MAINTAINERS ├── Assets ├── vendor │ ├── jquery │ │ ├── src │ │ │ ├── outro.js │ │ │ ├── selector.js │ │ │ ├── var │ │ │ │ ├── arr.js │ │ │ │ ├── rnotwhite.js │ │ │ │ ├── strundefined.js │ │ │ │ ├── push.js │ │ │ │ ├── class2type.js │ │ │ │ ├── concat.js │ │ │ │ ├── indexOf.js │ │ │ │ ├── slice.js │ │ │ │ ├── pnum.js │ │ │ │ ├── toString.js │ │ │ │ ├── hasOwn.js │ │ │ │ └── support.js │ │ │ ├── ajax │ │ │ │ ├── var │ │ │ │ │ ├── rquery.js │ │ │ │ │ └── nonce.js │ │ │ │ ├── parseJSON.js │ │ │ │ ├── parseXML.js │ │ │ │ ├── script.js │ │ │ │ ├── load.js │ │ │ │ ├── jsonp.js │ │ │ │ └── xhr.js │ │ │ ├── css │ │ │ │ ├── var │ │ │ │ │ ├── rmargin.js │ │ │ │ │ ├── cssExpand.js │ │ │ │ │ ├── rnumnonpx.js │ │ │ │ │ ├── isHidden.js │ │ │ │ │ └── getStyles.js │ │ │ │ ├── hiddenVisibleSelectors.js │ │ │ │ ├── addGetHookIf.js │ │ │ │ ├── swap.js │ │ │ │ ├── curCSS.js │ │ │ │ ├── defaultDisplay.js │ │ │ │ └── support.js │ │ │ ├── data │ │ │ │ ├── var │ │ │ │ │ ├── data_priv.js │ │ │ │ │ └── data_user.js │ │ │ │ └── accepts.js │ │ │ ├── manipulation │ │ │ │ ├── var │ │ │ │ │ └── rcheckableType.js │ │ │ │ ├── _evalUrl.js │ │ │ │ └── support.js │ │ │ ├── core │ │ │ │ ├── var │ │ │ │ │ └── rsingleTag.js │ │ │ │ ├── parseHTML.js │ │ │ │ ├── access.js │ │ │ │ ├── ready.js │ │ │ │ └── init.js │ │ │ ├── traversing │ │ │ │ ├── var │ │ │ │ │ └── rneedsContext.js │ │ │ │ └── findFilter.js │ │ │ ├── event │ │ │ │ ├── support.js │ │ │ │ ├── ajax.js │ │ │ │ └── alias.js │ │ │ ├── attributes.js │ │ │ ├── deprecated.js │ │ │ ├── effects │ │ │ │ ├── animatedSelector.js │ │ │ │ └── Tween.js │ │ │ ├── selector-sizzle.js │ │ │ ├── queue │ │ │ │ └── delay.js │ │ │ ├── jquery.js │ │ │ ├── exports │ │ │ │ ├── global.js │ │ │ │ └── amd.js │ │ │ ├── attributes │ │ │ │ ├── support.js │ │ │ │ ├── prop.js │ │ │ │ └── attr.js │ │ │ ├── intro.js │ │ │ ├── wrap.js │ │ │ ├── dimensions.js │ │ │ ├── serialize.js │ │ │ └── queue.js │ │ ├── bower.json │ │ ├── .bower.json │ │ └── MIT-LICENSE.txt │ ├── microplugin │ │ ├── .gitignore │ │ ├── .npmignore │ │ ├── package.json │ │ ├── bower.json │ │ ├── .bower.json │ │ └── src │ │ │ └── microplugin.js │ ├── sifter │ │ ├── .npmignore │ │ ├── .gitignore │ │ ├── bower.json │ │ ├── .bower.json │ │ └── package.json │ └── selectize │ │ ├── .gitignore │ │ ├── dist │ │ └── less │ │ │ ├── plugins │ │ │ ├── optgroup_columns.less │ │ │ ├── drag_drop.less │ │ │ ├── dropdown_header.less │ │ │ └── remove_button.less │ │ │ ├── selectize.default.less │ │ │ └── selectize.legacy.less │ │ ├── bower.json │ │ └── .bower.json └── js │ ├── vendor │ └── datatables │ │ ├── nl.json │ │ ├── zh.json │ │ ├── en.json │ │ ├── es.json │ │ ├── pt-BR.json │ │ ├── de.json │ │ └── fr.json │ └── keypressAction.js ├── Tests ├── Theme │ ├── Fixture │ │ └── Themes │ │ │ ├── demo │ │ │ └── .gitkeep │ │ │ └── testassets │ │ │ ├── .gitkeep │ │ │ └── assets │ │ │ ├── css │ │ │ └── main.css │ │ │ └── js │ │ │ └── main.js │ ├── ThemeTest.php │ └── ThemeManagerTest.php └── BaseTestCase.php ├── .bowerrc ├── .gitignore ├── start.php ├── bower.json ├── package.json ├── .sensiolabs.yml ├── Foundation ├── Asset │ ├── AssetNotFoundException.php │ ├── Manager │ │ ├── AssetManager.php │ │ └── AsgardAssetManager.php │ └── Pipeline │ │ └── AssetPipeline.php └── Theme │ ├── Theme.php │ ├── AssetPublisher.php │ └── ThemeManager.php ├── Http ├── Middleware │ ├── LocalizationMiddleware.php │ ├── AsgardInstalledMiddleware.php │ ├── PublicMiddleware.php │ ├── Authorization.php │ ├── AdminMiddleware.php │ └── PermissionMiddleware.php ├── routes.php └── Controllers │ ├── BasePublicController.php │ └── Admin │ └── AdminBaseController.php ├── Providers ├── EventServiceProvider.php ├── AsgardServiceProvider.php ├── SidebarServiceProvider.php ├── AssetServiceProvider.php └── RoutingServiceProvider.php ├── Composers ├── SettingLocalesComposer.php ├── LocaleComposer.php ├── CurrentUserViewComposer.php ├── ThemeComposer.php ├── SidebarViewCreator.php ├── MasterViewComposer.php └── ApplicationVersionViewComposer.php ├── Console ├── Installers │ ├── SetupScript.php │ ├── Traits │ │ ├── SectionMessage.php │ │ └── BlockMessage.php │ ├── Scripts │ │ ├── SetAppKey.php │ │ ├── ThemeAssets.php │ │ ├── ProtectInstaller.php │ │ ├── ModuleSeeders.php │ │ ├── ModuleAssets.php │ │ ├── ModuleMigrator.php │ │ ├── ConfigureUserProvider.php │ │ ├── UnignoreComposerLock.php │ │ └── UserProviders │ │ │ ├── SentryInstaller.php │ │ │ ├── SentinelInstaller.php │ │ │ └── UsherInstaller.php │ ├── Installer.php │ └── Writers │ │ └── EnvFileWriter.php ├── PublishModuleAssetsCommand.php ├── PublishThemeAssetsCommand.php └── InstallCommand.php ├── stylistPublishMix.js ├── Support └── SupportsCacheTags.php ├── Database └── Seeders │ └── CoreDatabaseSeeder.php ├── Config ├── config.php └── settings.php ├── .travis.yml ├── .php_cs ├── Resources └── views │ ├── fields │ ├── select-theme.blade.php │ └── select-locales.blade.php │ └── partials │ └── delete-modal.blade.php ├── phpunit.xml ├── composers.php ├── helpers.php ├── Contracts ├── Setting.php └── Authentication.php ├── Navigation └── NavigationOrdener.php ├── LICENSE.md ├── module.json ├── bootstrap └── autoload.php ├── Internationalisation ├── Translatable.php ├── Helper.php └── BaseFormRequest.php ├── composer.json ├── readme.md ├── Sidebar └── AdminSidebar.php ├── Repositories └── BaseRepository.php ├── Services └── Composer.php └── Doctrine └── Translatable.php /MAINTAINERS: -------------------------------------------------------------------------------- 1 | nwidart 2 | -------------------------------------------------------------------------------- /Assets/vendor/jquery/src/outro.js: -------------------------------------------------------------------------------- 1 | })); 2 | -------------------------------------------------------------------------------- /Tests/Theme/Fixture/Themes/demo/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Tests/Theme/Fixture/Themes/testassets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.bowerrc: -------------------------------------------------------------------------------- 1 | { 2 | "directory": "Assets/vendor" 3 | } 4 | -------------------------------------------------------------------------------- /Assets/vendor/microplugin/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_store 2 | node_modules -------------------------------------------------------------------------------- /Assets/vendor/microplugin/.npmignore: -------------------------------------------------------------------------------- 1 | *.md 2 | .git* 3 | test/ -------------------------------------------------------------------------------- /Assets/vendor/jquery/src/selector.js: -------------------------------------------------------------------------------- 1 | define([ "./selector-sizzle" ]); 2 | -------------------------------------------------------------------------------- /Assets/vendor/sifter/.npmignore: -------------------------------------------------------------------------------- 1 | *.md 2 | .git* 3 | benchmark/ 4 | test/ -------------------------------------------------------------------------------- /Assets/vendor/jquery/src/var/arr.js: -------------------------------------------------------------------------------- 1 | define(function() { 2 | return []; 3 | }); 4 | -------------------------------------------------------------------------------- /Assets/vendor/sifter/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_store 2 | node_modules 3 | benchmark/report.json -------------------------------------------------------------------------------- /Assets/vendor/jquery/src/ajax/var/rquery.js: -------------------------------------------------------------------------------- 1 | define(function() { 2 | return (/\?/); 3 | }); 4 | -------------------------------------------------------------------------------- /Assets/vendor/jquery/src/var/rnotwhite.js: -------------------------------------------------------------------------------- 1 | define(function() { 2 | return (/\S+/g); 3 | }); 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .php_cs.cache 3 | /vendor/ 4 | composer.lock 5 | node_modules/ 6 | Modules/ 7 | -------------------------------------------------------------------------------- /Assets/vendor/jquery/src/css/var/rmargin.js: -------------------------------------------------------------------------------- 1 | define(function() { 2 | return (/^margin/); 3 | }); 4 | -------------------------------------------------------------------------------- /Assets/vendor/selectize/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .DAV 3 | node_modules 4 | bower_components 5 | *.log -------------------------------------------------------------------------------- /Tests/Theme/Fixture/Themes/testassets/assets/css/main.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: #ff0000; 3 | } 4 | -------------------------------------------------------------------------------- /Assets/vendor/jquery/src/var/strundefined.js: -------------------------------------------------------------------------------- 1 | define(function() { 2 | return typeof undefined; 3 | }); 4 | -------------------------------------------------------------------------------- /Tests/Theme/Fixture/Themes/testassets/assets/js/main.js: -------------------------------------------------------------------------------- 1 | $( document ).ready(function() { 2 | 3 | }); 4 | -------------------------------------------------------------------------------- /start.php: -------------------------------------------------------------------------------- 1 | =0.12.0" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Assets/vendor/jquery/src/var/class2type.js: -------------------------------------------------------------------------------- 1 | define(function() { 2 | // [[Class]] -> type pairs 3 | return {}; 4 | }); 5 | -------------------------------------------------------------------------------- /Assets/vendor/jquery/src/var/concat.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "./arr" 3 | ], function( arr ) { 4 | return arr.concat; 5 | }); 6 | -------------------------------------------------------------------------------- /Assets/vendor/jquery/src/var/indexOf.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "./arr" 3 | ], function( arr ) { 4 | return arr.indexOf; 5 | }); 6 | -------------------------------------------------------------------------------- /Assets/vendor/jquery/src/var/slice.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "./arr" 3 | ], function( arr ) { 4 | return arr.slice; 5 | }); 6 | -------------------------------------------------------------------------------- /Assets/vendor/jquery/src/css/var/cssExpand.js: -------------------------------------------------------------------------------- 1 | define(function() { 2 | return [ "Top", "Right", "Bottom", "Left" ]; 3 | }); 4 | -------------------------------------------------------------------------------- /Assets/vendor/jquery/src/var/pnum.js: -------------------------------------------------------------------------------- 1 | define(function() { 2 | return (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source; 3 | }); 4 | -------------------------------------------------------------------------------- /Assets/vendor/jquery/src/data/var/data_priv.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../Data" 3 | ], function( Data ) { 4 | return new Data(); 5 | }); 6 | -------------------------------------------------------------------------------- /Assets/vendor/jquery/src/data/var/data_user.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../Data" 3 | ], function( Data ) { 4 | return new Data(); 5 | }); 6 | -------------------------------------------------------------------------------- /Assets/vendor/jquery/src/manipulation/var/rcheckableType.js: -------------------------------------------------------------------------------- 1 | define(function() { 2 | return (/^(?:checkbox|radio)$/i); 3 | }); 4 | -------------------------------------------------------------------------------- /Assets/vendor/jquery/src/ajax/var/nonce.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../../core" 3 | ], function( jQuery ) { 4 | return jQuery.now(); 5 | }); 6 | -------------------------------------------------------------------------------- /Assets/vendor/jquery/src/var/toString.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "./class2type" 3 | ], function( class2type ) { 4 | return class2type.toString; 5 | }); 6 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "devDependencies": { 3 | "gulp": "^3.8.8", 4 | "gulp-shell": "^0.3.0", 5 | "laravel-elixir": "*" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /.sensiolabs.yml: -------------------------------------------------------------------------------- 1 | rules: 2 | php.interface_has_no_interface_suffix: 3 | enabled: false 4 | global_exclude_dirs: 5 | - vendor 6 | - Tests 7 | -------------------------------------------------------------------------------- /Assets/vendor/jquery/src/var/hasOwn.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "./class2type" 3 | ], function( class2type ) { 4 | return class2type.hasOwnProperty; 5 | }); 6 | -------------------------------------------------------------------------------- /Assets/vendor/jquery/src/core/var/rsingleTag.js: -------------------------------------------------------------------------------- 1 | define(function() { 2 | // Match a standalone tag 3 | return (/^<(\w+)\s*\/?>(?:<\/\1>|)$/); 4 | }); 5 | -------------------------------------------------------------------------------- /Assets/vendor/jquery/src/var/support.js: -------------------------------------------------------------------------------- 1 | define(function() { 2 | // All support tests are defined in their respective modules. 3 | return {}; 4 | }); 5 | -------------------------------------------------------------------------------- /Foundation/Asset/AssetNotFoundException.php: -------------------------------------------------------------------------------- 1 | with('locales', config('asgard.core.available-locales')); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Assets/vendor/jquery/src/ajax/parseJSON.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../core" 3 | ], function( jQuery ) { 4 | 5 | // Support: Android 2.3 6 | // Workaround failure to string-cast null input 7 | jQuery.parseJSON = function( data ) { 8 | return JSON.parse( data + "" ); 9 | }; 10 | 11 | return jQuery.parseJSON; 12 | 13 | }); 14 | -------------------------------------------------------------------------------- /Composers/LocaleComposer.php: -------------------------------------------------------------------------------- 1 | with('currentLocale', App::getLocale()); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Assets/vendor/jquery/src/effects/animatedSelector.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../core", 3 | "../selector", 4 | "../effects" 5 | ], function( jQuery ) { 6 | 7 | jQuery.expr.filters.animated = function( elem ) { 8 | return jQuery.grep(jQuery.timers, function( fn ) { 9 | return elem === fn.elem; 10 | }).length; 11 | }; 12 | 13 | }); 14 | -------------------------------------------------------------------------------- /Console/Installers/SetupScript.php: -------------------------------------------------------------------------------- 1 | getHelperSet()->get('formatter'); 8 | $formattedLine = $formatter->formatSection( 9 | $title, 10 | $message 11 | ); 12 | $this->line($formattedLine); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Console/Installers/Traits/BlockMessage.php: -------------------------------------------------------------------------------- 1 | getHelperSet()->get('formatter'); 8 | $errorMessages = [$title, $message]; 9 | $formattedBlock = $formatter->formatBlock($errorMessages, $style, true); 10 | $this->line($formattedBlock); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Assets/vendor/jquery/src/css/hiddenVisibleSelectors.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../core", 3 | "../selector" 4 | ], function( jQuery ) { 5 | 6 | jQuery.expr.filters.hidden = function( elem ) { 7 | // Support: Opera <= 12.12 8 | // Opera reports offsetWidths and offsetHeights less than zero on some elements 9 | return elem.offsetWidth <= 0 && elem.offsetHeight <= 0; 10 | }; 11 | jQuery.expr.filters.visible = function( elem ) { 12 | return !jQuery.expr.filters.hidden( elem ); 13 | }; 14 | 15 | }); 16 | -------------------------------------------------------------------------------- /Assets/vendor/jquery/src/css/var/getStyles.js: -------------------------------------------------------------------------------- 1 | define(function() { 2 | return function( elem ) { 3 | // Support: IE<=11+, Firefox<=30+ (#15098, #14150) 4 | // IE throws on elements created in popups 5 | // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" 6 | if ( elem.ownerDocument.defaultView.opener ) { 7 | return elem.ownerDocument.defaultView.getComputedStyle( elem, null ); 8 | } 9 | 10 | return window.getComputedStyle( elem, null ); 11 | }; 12 | }); 13 | -------------------------------------------------------------------------------- /Config/config.php: -------------------------------------------------------------------------------- 1 | [ 10 | 'core', 11 | 'dashboard', 12 | 'user', 13 | 'workshop', 14 | 'setting', 15 | 'media', 16 | ], 17 | ]; 18 | -------------------------------------------------------------------------------- /Assets/vendor/jquery/src/data/accepts.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../core" 3 | ], function( jQuery ) { 4 | 5 | /** 6 | * Determines whether an object can have data 7 | */ 8 | jQuery.acceptData = function( owner ) { 9 | // Accepts only: 10 | // - Node 11 | // - Node.ELEMENT_NODE 12 | // - Node.DOCUMENT_NODE 13 | // - Object 14 | // - Any 15 | /* jshint -W018 */ 16 | return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); 17 | }; 18 | 19 | return jQuery.acceptData; 20 | }); 21 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: php 2 | 3 | php: 4 | - 7 5 | - 5.6 6 | - 5.5 7 | - hhvm 8 | 9 | env: 10 | - LARAVEL_VERSION="~5.1" TESTBENCH_VERSION="~3.1" 11 | 12 | before_script: 13 | - travis_retry composer install --no-interaction --prefer-source 14 | 15 | script: phpunit 16 | 17 | sudo: false 18 | 19 | notifications: 20 | slack: asgardcms:KxCIbNZLKtq8gqQ18aw7RO23 21 | email: 22 | - n.widart@gmail.com 23 | - josh@joshbrown.me 24 | 25 | matrix: 26 | allow_failures: 27 | - php: hhvm 28 | -------------------------------------------------------------------------------- /Composers/CurrentUserViewComposer.php: -------------------------------------------------------------------------------- 1 | auth = $auth; 16 | } 17 | 18 | public function compose(View $view) 19 | { 20 | $view->with('currentUser', $this->auth->check()); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Assets/vendor/selectize/dist/less/plugins/drag_drop.less: -------------------------------------------------------------------------------- 1 | .selectize-control.plugin-drag_drop { 2 | &.multi > .selectize-input > div.ui-sortable-placeholder { 3 | visibility: visible !important; 4 | background: #f2f2f2 !important; 5 | background: rgba(0,0,0,0.06) !important; 6 | border: 0 none !important; 7 | .selectize-box-shadow(inset 0 0 12px 4px #fff); 8 | } 9 | .ui-sortable-placeholder::after { 10 | content: '!'; 11 | visibility: hidden; 12 | } 13 | .ui-sortable-helper { 14 | .selectize-box-shadow(0 2px 5px rgba(0,0,0,0.2)); 15 | } 16 | } -------------------------------------------------------------------------------- /Assets/vendor/microplugin/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "microplugin", 3 | "keywords": ["extensibility","plugins","architecture","require","dependencies"], 4 | "description": "A lightweight plugin / dependency system for javascript libraries.", 5 | "version": "0.0.3", 6 | "author": "Brian Reavis ", 7 | "main": "src/microplugin.js", 8 | "repository": { 9 | "type": "git", 10 | "url": "git://github.com/brianreavis/microplugin.js.git" 11 | }, 12 | "dependencies": {}, 13 | "devDependencies": {}, 14 | "engines": {"node": "*"} 15 | } 16 | -------------------------------------------------------------------------------- /.php_cs: -------------------------------------------------------------------------------- 1 | exclude('Modules') 5 | ->exclude('vendor') 6 | ->in(__DIR__) 7 | ; 8 | 9 | return Symfony\CS\Config\Config::create() 10 | ->setUsingCache(true) 11 | ->level(Symfony\CS\FixerInterface::PSR2_LEVEL) 12 | ->fixers(array( 13 | 'concat_with_spaces', 14 | 'ordered_use', 15 | 'extra_empty_lines', 16 | 'remove_lines_between_uses', 17 | 'return', 18 | 'unused_use', 19 | 'whitespacy_lines', 20 | )) 21 | ->finder($finder); 22 | -------------------------------------------------------------------------------- /Composers/ThemeComposer.php: -------------------------------------------------------------------------------- 1 | themeManager = $themeManager; 16 | } 17 | 18 | public function compose(View $view) 19 | { 20 | $view->with('themes', $this->themeManager->allPublicThemes()); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Resources/views/fields/select-theme.blade.php: -------------------------------------------------------------------------------- 1 |
2 | 3 | 10 |
11 | -------------------------------------------------------------------------------- /Assets/vendor/jquery/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery", 3 | "version": "2.1.4", 4 | "main": "dist/jquery.js", 5 | "license": "MIT", 6 | "ignore": [ 7 | "**/.*", 8 | "build", 9 | "dist/cdn", 10 | "speed", 11 | "test", 12 | "*.md", 13 | "AUTHORS.txt", 14 | "Gruntfile.js", 15 | "package.json" 16 | ], 17 | "devDependencies": { 18 | "sizzle": "2.1.1-jquery.2.1.2", 19 | "requirejs": "2.1.10", 20 | "qunit": "1.14.0", 21 | "sinon": "1.8.1" 22 | }, 23 | "keywords": [ 24 | "jquery", 25 | "javascript", 26 | "library" 27 | ] 28 | } 29 | -------------------------------------------------------------------------------- /Http/Controllers/BasePublicController.php: -------------------------------------------------------------------------------- 1 | locale = App::getLocale(); 17 | $this->auth = app('Modules\Core\Contracts\Authentication'); 18 | view()->share('currentUser', $this->auth->check()); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Console/Installers/Scripts/SetAppKey.php: -------------------------------------------------------------------------------- 1 | option('verbose')) { 16 | $command->call('key:generate'); 17 | 18 | return; 19 | } 20 | $command->callSilent('key:generate'); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Assets/vendor/jquery/src/ajax/parseXML.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../core" 3 | ], function( jQuery ) { 4 | 5 | // Cross-browser xml parsing 6 | jQuery.parseXML = function( data ) { 7 | var xml, tmp; 8 | if ( !data || typeof data !== "string" ) { 9 | return null; 10 | } 11 | 12 | // Support: IE9 13 | try { 14 | tmp = new DOMParser(); 15 | xml = tmp.parseFromString( data, "text/xml" ); 16 | } catch ( e ) { 17 | xml = undefined; 18 | } 19 | 20 | if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) { 21 | jQuery.error( "Invalid XML: " + data ); 22 | } 23 | return xml; 24 | }; 25 | 26 | return jQuery.parseXML; 27 | 28 | }); 29 | -------------------------------------------------------------------------------- /Assets/vendor/jquery/src/css/addGetHookIf.js: -------------------------------------------------------------------------------- 1 | define(function() { 2 | 3 | function addGetHookIf( conditionFn, hookFn ) { 4 | // Define the hook, we'll check on the first run if it's really needed. 5 | return { 6 | get: function() { 7 | if ( conditionFn() ) { 8 | // Hook not needed (or it's not possible to use it due 9 | // to missing dependency), remove it. 10 | delete this.get; 11 | return; 12 | } 13 | 14 | // Hook needed; redefine it so that the support test is not executed again. 15 | return (this.get = hookFn).apply( this, arguments ); 16 | } 17 | }; 18 | } 19 | 20 | return addGetHookIf; 21 | 22 | }); 23 | -------------------------------------------------------------------------------- /Assets/vendor/microplugin/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "microplugin", 3 | "keywords": ["extensibility","plugins","architecture","require","dependencies"], 4 | "description": "A lightweight plugin / dependency system for javascript libraries.", 5 | "version": "0.0.3", 6 | "license": "Apache License, Version 2.0", 7 | "readmeFilename": "README.md", 8 | "repository": { 9 | "type": "git", 10 | "url": "git://github.com/brianreavis/microplugin.js.git" 11 | }, 12 | "main": [ 13 | "src/microplugin.js" 14 | ], 15 | "ignore": [ 16 | "Makefile", 17 | "test", 18 | ".travis.yml", 19 | ".npmignore.yml" 20 | ], 21 | "dependencies": {} 22 | } 23 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 15 | ./Tests/ 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /Console/PublishModuleAssetsCommand.php: -------------------------------------------------------------------------------- 1 | call('module:publish', ['module' => $this->argument('module')]); 14 | } 15 | 16 | protected function getArguments() 17 | { 18 | return [ 19 | ['module', InputArgument::REQUIRED, 'The module name'], 20 | ]; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /composers.php: -------------------------------------------------------------------------------- 1 | creator('partials.sidebar-nav', \Modules\Core\Composers\SidebarViewCreator::class); 4 | view()->composer('partials.footer', \Modules\Core\Composers\ApplicationVersionViewComposer::class); 5 | view()->composer('layouts.master', \Modules\Core\Composers\MasterViewComposer::class); 6 | view()->composer('core::fields.select-theme', \Modules\Core\Composers\ThemeComposer::class); 7 | view()->composer('core::fields.select-locales', \Modules\Core\Composers\SettingLocalesComposer::class); 8 | view()->composer('*', \Modules\Core\Composers\LocaleComposer::class); 9 | view()->composer('layouts.master', \Modules\Core\Composers\CurrentUserViewComposer::class); 10 | -------------------------------------------------------------------------------- /Assets/vendor/jquery/src/queue/delay.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../core", 3 | "../queue", 4 | "../effects" // Delay is optional because of this dependency 5 | ], function( jQuery ) { 6 | 7 | // Based off of the plugin by Clint Helfers, with permission. 8 | // http://blindsignals.com/index.php/2009/07/jquery-delay/ 9 | jQuery.fn.delay = function( time, type ) { 10 | time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; 11 | type = type || "fx"; 12 | 13 | return this.queue( type, function( next, hooks ) { 14 | var timeout = setTimeout( next, time ); 15 | hooks.stop = function() { 16 | clearTimeout( timeout ); 17 | }; 18 | }); 19 | }; 20 | 21 | return jQuery.fn.delay; 22 | }); 23 | -------------------------------------------------------------------------------- /helpers.php: -------------------------------------------------------------------------------- 1 | getLocale(); 15 | } 16 | 17 | app()->setLocale($locale); 18 | 19 | return app()->getLocale(); 20 | } 21 | } 22 | 23 | if (! function_exists('is_module_enabled')) { 24 | function is_module_enabled($module) 25 | { 26 | return array_key_exists($module, app('modules')->enabled()); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Assets/vendor/jquery/src/css/swap.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../core" 3 | ], function( jQuery ) { 4 | 5 | // A method for quickly swapping in/out CSS properties to get correct calculations. 6 | jQuery.swap = function( elem, options, callback, args ) { 7 | var ret, name, 8 | old = {}; 9 | 10 | // Remember the old values, and insert the new ones 11 | for ( name in options ) { 12 | old[ name ] = elem.style[ name ]; 13 | elem.style[ name ] = options[ name ]; 14 | } 15 | 16 | ret = callback.apply( elem, args || [] ); 17 | 18 | // Revert the old values 19 | for ( name in options ) { 20 | elem.style[ name ] = old[ name ]; 21 | } 22 | 23 | return ret; 24 | }; 25 | 26 | return jQuery.swap; 27 | 28 | }); 29 | -------------------------------------------------------------------------------- /Assets/js/vendor/datatables/nl.json: -------------------------------------------------------------------------------- 1 | { 2 | "sProcessing": "Bezig...", 3 | "sLengthMenu": "_MENU_ resultaten weergeven", 4 | "sZeroRecords": "Geen resultaten gevonden", 5 | "sInfo": "_START_ tot _END_ van _TOTAL_ resultaten", 6 | "sInfoEmpty": "Geen resultaten om weer te geven", 7 | "sInfoFiltered": " (gefilterd uit _MAX_ resultaten)", 8 | "sInfoPostFix": "", 9 | "sSearch": "Zoeken:", 10 | "sEmptyTable": "Geen resultaten aanwezig in de tabel", 11 | "sInfoThousands": ".", 12 | "sLoadingRecords": "Een moment geduld aub - bezig met laden...", 13 | "oPaginate": { 14 | "sFirst": "Eerste", 15 | "sLast": "Laatste", 16 | "sNext": "Volgende", 17 | "sPrevious": "Vorige" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Assets/vendor/sifter/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sifter", 3 | "keywords": ["search","filter","sift","data","results","match","sort","autocomplete"], 4 | "description": "A library for textually searching arrays and hashes of objects by property (or multiple properties). Designed specifically for autocomplete.", 5 | "version": "0.4.5", 6 | "license": "Apache License, Version 2.0", 7 | "readmeFilename": "README.md", 8 | "repository": { 9 | "type": "git", 10 | "url": "git://github.com/brianreavis/sifter.js.git" 11 | }, 12 | "main": ["sifter.js"], 13 | "ignore": [ 14 | "Makefile", 15 | "test", 16 | "lib", 17 | "bin", 18 | "benchmark", 19 | "node_modules", 20 | ".travis.yml" 21 | ], 22 | "dependencies": {} 23 | } 24 | -------------------------------------------------------------------------------- /Http/Middleware/AsgardInstalledMiddleware.php: -------------------------------------------------------------------------------- 1 | app->register(TranslationServiceProvider::class); 15 | } 16 | $this->app->register(ModulesServiceProvider::class); 17 | 18 | $loader = AliasLoader::getInstance(); 19 | $loader->alias('Module', Module::class); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Assets/vendor/selectize/dist/less/plugins/dropdown_header.less: -------------------------------------------------------------------------------- 1 | .selectize-dropdown-header { 2 | position: relative; 3 | padding: @selectize-padding-dropdown-item-y @selectize-padding-dropdown-item-x; 4 | border-bottom: 1px solid @selectize-color-border; 5 | background: mix(@selectize-color-dropdown, @selectize-color-border, 85%); 6 | .selectize-border-radius(@selectize-border-radius @selectize-border-radius 0 0); 7 | } 8 | .selectize-dropdown-header-close { 9 | position: absolute; 10 | right: @selectize-padding-dropdown-item-x; 11 | top: 50%; 12 | color: @selectize-color-text; 13 | opacity: 0.4; 14 | margin-top: -12px; 15 | line-height: 20px; 16 | font-size: 20px !important; 17 | } 18 | .selectize-dropdown-header-close:hover { 19 | color: darken(@selectize-color-text, 25%); 20 | } -------------------------------------------------------------------------------- /Console/Installers/Scripts/ThemeAssets.php: -------------------------------------------------------------------------------- 1 | option('verbose')) { 16 | $command->blockMessage('Themes', 'Publishing theme assets ...', 'comment'); 17 | } 18 | 19 | if ($command->option('verbose')) { 20 | $command->call('stylist:publish'); 21 | 22 | return; 23 | } 24 | $command->callSilent('stylist:publish'); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Contracts/Setting.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | 19 | -------------------------------------------------------------------------------- /Console/PublishThemeAssetsCommand.php: -------------------------------------------------------------------------------- 1 | argument('theme', null); 14 | 15 | if (!empty($theme)) { 16 | $this->call('stylist:publish', ['theme' => $this->argument('theme')]); 17 | } else { 18 | $this->call('stylist:publish'); 19 | } 20 | } 21 | 22 | protected function getArguments() 23 | { 24 | return [ 25 | ['theme', InputArgument::OPTIONAL, 'Name of the theme you wish to publish'] 26 | ]; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Assets/js/vendor/datatables/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "sEmptyTable": "No data available in table", 3 | "sInfo": "Showing _START_ to _END_ of _TOTAL_ entries", 4 | "sInfoEmpty": "Showing 0 to 0 of 0 entries", 5 | "sInfoFiltered": "(filtered from _MAX_ total entries)", 6 | "sInfoPostFix": "", 7 | "sInfoThousands": ",", 8 | "sLengthMenu": "Show _MENU_ entries", 9 | "sLoadingRecords": "Loading...", 10 | "sProcessing": "Processing...", 11 | "sSearch": "Search:", 12 | "sZeroRecords": "No matching records found", 13 | "oPaginate": { 14 | "sFirst": "First", 15 | "sLast": "Last", 16 | "sNext": "Next", 17 | "sPrevious": "Previous" 18 | }, 19 | "oAria": { 20 | "sSortAscending": ": activate to sort column ascending", 21 | "sSortDescending": ": activate to sort column descending" 22 | } 23 | } -------------------------------------------------------------------------------- /Assets/js/vendor/datatables/es.json: -------------------------------------------------------------------------------- 1 | { 2 | "sEmptyTable": "No hay datos disponibles en la tabla", 3 | "sInfo": "Mostrando _START_ de _END_ a _TOTAL_ registros", 4 | "sInfoEmpty": "Mostrando 0 de 0 a 0 registros", 5 | "sInfoFiltered": "(filtrado de _MAX_ registros)", 6 | "sInfoPostFix": "", 7 | "sInfoThousands": ",", 8 | "sLengthMenu": "Mostrar _MENU_ registros", 9 | "sLoadingRecords": "Cargando...", 10 | "sProcessing": "Procesando...", 11 | "sSearch": "Buscar:", 12 | "sZeroRecords": "No se encontró ningún registro.", 13 | "oPaginate": { 14 | "sFirst": "Primero", 15 | "sLast": "Último", 16 | "sNext": "Siguiente", 17 | "sPrevious": "Anterior" 18 | }, 19 | "oAria": { 20 | "sSortAscending": ": activar el orden ascendente", 21 | "sSortDescending": ": activar el orden descendente" 22 | } 23 | } -------------------------------------------------------------------------------- /Config/settings.php: -------------------------------------------------------------------------------- 1 | [ 5 | 'description' => 'core::settings.site-name', 6 | 'view' => 'text', 7 | 'translatable' => true, 8 | ], 9 | 'site-description' => [ 10 | 'description' => 'core::settings.site-description', 11 | 'view' => 'textarea', 12 | 'translatable' => true, 13 | ], 14 | 'template' => [ 15 | 'description' => 'core::settings.template', 16 | 'view' => 'core::fields.select-theme', 17 | ], 18 | 'google-analytics' => [ 19 | 'description' => 'core::settings.google-analytics', 20 | 'view' => 'textarea', 21 | 'translatable' => false, 22 | ], 23 | 'locales' => [ 24 | 'description' => 'core::settings.locales', 25 | 'view' => 'core::fields.select-locales', 26 | 'translatable' => false, 27 | ], 28 | ]; 29 | -------------------------------------------------------------------------------- /Assets/js/vendor/datatables/pt-BR.json: -------------------------------------------------------------------------------- 1 | { 2 | "sEmptyTable": "Nenhum registro cadastrado", 3 | "sInfo": "Visualizando _START_ a _END_ de _TOTAL_ registros", 4 | "sInfoEmpty": "Visualizando 0 a 0 de 0 registros", 5 | "sInfoFiltered": "(filtrado de _MAX_ registros)", 6 | "sInfoPostFix": "", 7 | "sInfoThousands": ",", 8 | "sLengthMenu": "Exibir _MENU_ registros por página", 9 | "sLoadingRecords": "Carregando...", 10 | "sProcessing": "Processando...", 11 | "sSearch": "Busca:", 12 | "sZeroRecords": "Nenhum registro encontrado", 13 | "oPaginate": { 14 | "sFirst": "Primeira", 15 | "sLast": "Última", 16 | "sNext": "Próxima", 17 | "sPrevious": "Anterior" 18 | }, 19 | "oAria": { 20 | "sSortAscending": ": ativar ordenação crescente", 21 | "sSortDescending": ": ativar ordenação decrescente" 22 | } 23 | } -------------------------------------------------------------------------------- /Composers/SidebarViewCreator.php: -------------------------------------------------------------------------------- 1 | sidebar = $sidebar; 25 | $this->renderer = $renderer; 26 | } 27 | 28 | public function create($view) 29 | { 30 | $view->prefix = config('asgard.core.core.admin-prefix'); 31 | $view->sidebar = $this->renderer->render($this->sidebar); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Assets/js/vendor/datatables/de.json: -------------------------------------------------------------------------------- 1 | { 2 | "sEmptyTable": "Keine Daten in der Tabelle vorhanden", 3 | "sInfo": "_START_ bis _END_ von _TOTAL_ Einträgen", 4 | "sInfoEmpty": "0 bis 0 von 0 Einträgen", 5 | "sInfoFiltered": "(gefiltert von _MAX_ Einträgen)", 6 | "sInfoPostFix": "", 7 | "sInfoThousands": ".", 8 | "sLengthMenu": "_MENU_ Einträge anzeigen", 9 | "sLoadingRecords": "Wird geladen...", 10 | "sProcessing": "Bitte warten...", 11 | "sSearch": "Suchen", 12 | "sZeroRecords": "Keine Einträge vorhanden.", 13 | "oPaginate": { 14 | "sFirst": "Erste", 15 | "sPrevious": "Zurück", 16 | "sNext": "Nächste", 17 | "sLast": "Letzte" 18 | }, 19 | "oAria": { 20 | "sSortAscending": ": aktivieren, um Spalte aufsteigend zu sortieren", 21 | "sSortDescending": ": aktivieren, um Spalte absteigend zu sortieren" 22 | } 23 | } -------------------------------------------------------------------------------- /Assets/vendor/jquery/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery", 3 | "version": "2.1.4", 4 | "main": "dist/jquery.js", 5 | "license": "MIT", 6 | "ignore": [ 7 | "**/.*", 8 | "build", 9 | "dist/cdn", 10 | "speed", 11 | "test", 12 | "*.md", 13 | "AUTHORS.txt", 14 | "Gruntfile.js", 15 | "package.json" 16 | ], 17 | "devDependencies": { 18 | "sizzle": "2.1.1-jquery.2.1.2", 19 | "requirejs": "2.1.10", 20 | "qunit": "1.14.0", 21 | "sinon": "1.8.1" 22 | }, 23 | "keywords": [ 24 | "jquery", 25 | "javascript", 26 | "library" 27 | ], 28 | "homepage": "https://github.com/jquery/jquery", 29 | "_release": "2.1.4", 30 | "_resolution": { 31 | "type": "version", 32 | "tag": "2.1.4", 33 | "commit": "7751e69b615c6eca6f783a81e292a55725af6b85" 34 | }, 35 | "_source": "git://github.com/jquery/jquery.git", 36 | "_target": ">=1.7.0", 37 | "_originalSource": "jquery" 38 | } -------------------------------------------------------------------------------- /Foundation/Theme/Theme.php: -------------------------------------------------------------------------------- 1 | name = $name; 17 | $this->path = realpath($path); 18 | } 19 | 20 | /** 21 | * @return string 22 | */ 23 | public function getName() 24 | { 25 | return ucfirst($this->name); 26 | } 27 | 28 | /** 29 | * @return string 30 | */ 31 | public function getPath() 32 | { 33 | return $this->path; 34 | } 35 | 36 | /** 37 | * Get name in lower case. 38 | * 39 | * @return string 40 | */ 41 | public function getLowerName() 42 | { 43 | return strtolower($this->name); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Navigation/NavigationOrdener.php: -------------------------------------------------------------------------------- 1 | sort( 10 | function ($item1, $item2) { 11 | $item1 = self::getItem($item1); 12 | $item2 = self::getItem($item2); 13 | 14 | if ($item1['weight'] > $item2['weight']) { 15 | return 1; 16 | } 17 | if ($item1['weight'] < $item2['weight']) { 18 | return -1; 19 | } 20 | 21 | return 0; 22 | } 23 | ); 24 | } 25 | 26 | /** 27 | * @param $item 28 | * @return mixed 29 | */ 30 | public static function getItem($item) 31 | { 32 | return isset($item['weight']) ? $item : $item->first(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Composers/MasterViewComposer.php: -------------------------------------------------------------------------------- 1 | setting = $setting; 22 | $this->assetPipeline = $assetPipeline; 23 | } 24 | 25 | public function compose(View $view) 26 | { 27 | $view->with('sitename', $this->setting->get('core::site-name', App::getLocale())); 28 | $view->with('cssFiles', $this->assetPipeline->allCss()); 29 | $view->with('jsFiles', $this->assetPipeline->allJs()); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Console/Installers/Scripts/ProtectInstaller.php: -------------------------------------------------------------------------------- 1 | finder = $finder; 21 | } 22 | 23 | /** 24 | * Fire the install script 25 | * @param Command $command 26 | * @return mixed 27 | * @throws Exception 28 | */ 29 | public function fire(Command $command) 30 | { 31 | if ($this->finder->isFile('.env') && ! $command->option('force')) { 32 | throw new Exception('Asgard has already been installed. You can already log into your administration.'); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Assets/js/vendor/datatables/fr.json: -------------------------------------------------------------------------------- 1 | { 2 | "sProcessing": "Traitement en cours...", 3 | "sSearch": "Rechercher :", 4 | "sLengthMenu": "Afficher _MENU_ éléments", 5 | "sInfo": "Affichage de l'élement _START_ à _END_ sur _TOTAL_ éléments", 6 | "sInfoEmpty": "Affichage de l'élement 0 à 0 sur 0 éléments", 7 | "sInfoFiltered": "(filtré de _MAX_ éléments au total)", 8 | "sInfoPostFix": "", 9 | "sLoadingRecords": "Chargement en cours...", 10 | "sZeroRecords": "Aucun élément à afficher", 11 | "sEmptyTable": "Aucune donnée disponible dans le tableau", 12 | "oPaginate": { 13 | "sFirst": "Premier", 14 | "sPrevious": "Précédent", 15 | "sNext": "Suivant", 16 | "sLast": "Dernier" 17 | }, 18 | "oAria": { 19 | "sSortAscending": ": activer pour trier la colonne par ordre croissant", 20 | "sSortDescending": ": activer pour trier la colonne par ordre décroissant" 21 | } 22 | } -------------------------------------------------------------------------------- /Providers/SidebarServiceProvider.php: -------------------------------------------------------------------------------- 1 | request = $request; 24 | if ($this->onBackend() === true ) { 25 | $manager->register(AdminSidebar::class); 26 | } 27 | } 28 | 29 | private function onBackend() 30 | { 31 | $url = $this->request->url(); 32 | if (str_contains($url, config('asgard.core.core.admin-prefix'))) { 33 | return true; 34 | } 35 | return false; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Console/Installers/Scripts/ModuleSeeders.php: -------------------------------------------------------------------------------- 1 | option('verbose')) { 24 | $command->blockMessage('Seeds', 'Running the module seeds ...', 'comment'); 25 | } 26 | 27 | foreach ($this->modules as $module) { 28 | if ($command->option('verbose')) { 29 | $command->call('module:seed', ['module' => $module]); 30 | continue; 31 | } 32 | $command->callSilent('module:seed', ['module' => $module]); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Providers/AssetServiceProvider.php: -------------------------------------------------------------------------------- 1 | bindAssetClasses(); 18 | } 19 | 20 | /** 21 | * Bind classes related to assets 22 | */ 23 | private function bindAssetClasses() 24 | { 25 | $this->app->singleton(AssetManager::class, function () { 26 | return new AsgardAssetManager(); 27 | }); 28 | 29 | $this->app->singleton(AssetPipeline::class, function ($app) { 30 | return new AsgardAssetPipeline($app[AssetManager::class]); 31 | }); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Assets/vendor/jquery/src/attributes/support.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../var/support" 3 | ], function( support ) { 4 | 5 | (function() { 6 | var input = document.createElement( "input" ), 7 | select = document.createElement( "select" ), 8 | opt = select.appendChild( document.createElement( "option" ) ); 9 | 10 | input.type = "checkbox"; 11 | 12 | // Support: iOS<=5.1, Android<=4.2+ 13 | // Default value for a checkbox should be "on" 14 | support.checkOn = input.value !== ""; 15 | 16 | // Support: IE<=11+ 17 | // Must access selectedIndex to make default options select 18 | support.optSelected = opt.selected; 19 | 20 | // Support: Android<=2.3 21 | // Options inside disabled selects are incorrectly marked as disabled 22 | select.disabled = true; 23 | support.optDisabled = !opt.disabled; 24 | 25 | // Support: IE<=11+ 26 | // An input loses its value after becoming a radio 27 | input = document.createElement( "input" ); 28 | input.value = "t"; 29 | input.type = "radio"; 30 | support.radioValue = input.value === "t"; 31 | })(); 32 | 33 | return support; 34 | 35 | }); 36 | -------------------------------------------------------------------------------- /Console/Installers/Scripts/ModuleAssets.php: -------------------------------------------------------------------------------- 1 | option('verbose')) { 25 | $command->blockMessage('Module assets', 'Publishing module assets ...', 'comment'); 26 | } 27 | 28 | foreach ($this->modules as $module) { 29 | if ($command->option('verbose')) { 30 | $command->call('module:publish', ['module' => $module]); 31 | continue; 32 | } 33 | $command->callSilent('module:publish', ['module' => $module]); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Assets/vendor/microplugin/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "microplugin", 3 | "keywords": [ 4 | "extensibility", 5 | "plugins", 6 | "architecture", 7 | "require", 8 | "dependencies" 9 | ], 10 | "description": "A lightweight plugin / dependency system for javascript libraries.", 11 | "version": "0.0.3", 12 | "license": "Apache License, Version 2.0", 13 | "readmeFilename": "README.md", 14 | "repository": { 15 | "type": "git", 16 | "url": "git://github.com/brianreavis/microplugin.js.git" 17 | }, 18 | "main": [ 19 | "src/microplugin.js" 20 | ], 21 | "ignore": [ 22 | "Makefile", 23 | "test", 24 | ".travis.yml", 25 | ".npmignore.yml" 26 | ], 27 | "dependencies": {}, 28 | "homepage": "https://github.com/brianreavis/microplugin.js", 29 | "_release": "0.0.3", 30 | "_resolution": { 31 | "type": "version", 32 | "tag": "v0.0.3", 33 | "commit": "d8671e6cc769938648f8735610534427cdeeaf67" 34 | }, 35 | "_source": "git://github.com/brianreavis/microplugin.js.git", 36 | "_target": "0.0.x", 37 | "_originalSource": "microplugin" 38 | } -------------------------------------------------------------------------------- /Assets/vendor/selectize/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "selectize", 3 | "keywords": ["select", "ui", "form", "input", "control", "autocomplete", "tagging", "tag"], 4 | "description": "Selectize is a jQuery-based custom "; 27 | support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; 28 | })(); 29 | 30 | return support; 31 | 32 | }); 33 | -------------------------------------------------------------------------------- /Assets/vendor/selectize/dist/less/plugins/remove_button.less: -------------------------------------------------------------------------------- 1 | .selectize-control.plugin-remove_button { 2 | [data-value] { 3 | position: relative; 4 | padding-right: 24px !important; 5 | } 6 | [data-value] .remove { 7 | z-index: 1; /* fixes ie bug (see #392) */ 8 | position: absolute; 9 | top: 0; 10 | right: 0; 11 | bottom: 0; 12 | width: 17px; 13 | text-align: center; 14 | font-weight: bold; 15 | font-size: 12px; 16 | color: inherit; 17 | text-decoration: none; 18 | vertical-align: middle; 19 | display: inline-block; 20 | padding: @selectize-padding-item-y 0 0 0; 21 | border-left: 1px solid @selectize-color-item-border; 22 | .selectize-border-radius(0 2px 2px 0); 23 | .selectize-box-sizing(border-box); 24 | } 25 | [data-value] .remove:hover { 26 | background: rgba(0,0,0,0.05); 27 | } 28 | [data-value].active .remove { 29 | border-left-color: @selectize-color-item-active-border; 30 | } 31 | .disabled [data-value] .remove:hover { 32 | background: none; 33 | } 34 | .disabled [data-value] .remove { 35 | border-left-color: lighten(desaturate(@selectize-color-item-border, 100%), @selectize-lighten-disabled-item-border); 36 | } 37 | } -------------------------------------------------------------------------------- /Console/Installers/Scripts/ModuleMigrator.php: -------------------------------------------------------------------------------- 1 | option('verbose')) { 28 | $command->blockMessage('Migrations', 'Starting the module migrations ...', 'comment'); 29 | } 30 | 31 | foreach ($this->modules as $module) { 32 | if ($command->option('verbose')) { 33 | $command->call('module:migrate', ['module' => $module]); 34 | continue; 35 | } 36 | $command->callSilent('module:migrate', ['module' => $module]); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /module.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Core", 3 | "alias": "core", 4 | "description": "The core module with all base classes and logic.", 5 | "keywords": [], 6 | "require": {}, 7 | "version": "1.23.1", 8 | "active": 1, 9 | "order": 0, 10 | "providers": [ 11 | "Modules\\Core\\Providers\\CoreServiceProvider", 12 | "Modules\\Core\\Providers\\SidebarServiceProvider", 13 | "Modules\\Core\\Providers\\AssetServiceProvider", 14 | "Collective\\Html\\HtmlServiceProvider", 15 | "Laracasts\\Flash\\FlashServiceProvider", 16 | "Dimsav\\Translatable\\TranslatableServiceProvider", 17 | "Mcamara\\LaravelLocalization\\LaravelLocalizationServiceProvider", 18 | "FloatingPoint\\Stylist\\StylistServiceProvider", 19 | "Maatwebsite\\Sidebar\\SidebarServiceProvider" 20 | ], 21 | "aliases": { 22 | "Form": "Collective\\Html\\FormFacade", 23 | "Flash": "Laracasts\\Flash\\Flash", 24 | "LaravelLocalization": "Mcamara\\LaravelLocalization\\Facades\\LaravelLocalization" 25 | }, 26 | "files": [ 27 | "start.php", 28 | "helpers.php", 29 | "macros.php" 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /Foundation/Asset/Pipeline/AssetPipeline.php: -------------------------------------------------------------------------------- 1 | 0 ? 13 | this.on( name, null, data, fn ) : 14 | this.trigger( name ); 15 | }; 16 | }); 17 | 18 | jQuery.fn.extend({ 19 | hover: function( fnOver, fnOut ) { 20 | return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); 21 | }, 22 | 23 | bind: function( types, data, fn ) { 24 | return this.on( types, null, data, fn ); 25 | }, 26 | unbind: function( types, fn ) { 27 | return this.off( types, null, fn ); 28 | }, 29 | 30 | delegate: function( selector, types, data, fn ) { 31 | return this.on( types, selector, data, fn ); 32 | }, 33 | undelegate: function( selector, types, fn ) { 34 | // ( namespace ) or ( selector, types [, fn] ) 35 | return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn ); 36 | } 37 | }); 38 | 39 | }); 40 | -------------------------------------------------------------------------------- /Assets/vendor/sifter/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sifter", 3 | "keywords": [ 4 | "search", 5 | "filter", 6 | "sift", 7 | "data", 8 | "results", 9 | "match", 10 | "sort", 11 | "autocomplete" 12 | ], 13 | "description": "A library for textually searching arrays and hashes of objects by property (or multiple properties). Designed specifically for autocomplete.", 14 | "version": "0.4.5", 15 | "license": "Apache-2.0", 16 | "author": "Brian Reavis ", 17 | "main": "./sifter.js", 18 | "repository": { 19 | "type": "git", 20 | "url": "git://github.com/brianreavis/sifter.js.git" 21 | }, 22 | "scripts": { 23 | "test": "mocha -R list" 24 | }, 25 | "bin": { 26 | "sifter": "./bin/sifter.js" 27 | }, 28 | "dependencies": { 29 | "optimist": "0.6.x", 30 | "cardinal": "0.4.x", 31 | "async": "0.2.x", 32 | "humanize": "0.0.x", 33 | "node-csv": "https://github.com/voodootikigod/node-csv/tarball/master" 34 | }, 35 | "devDependencies": { 36 | "mocha": "1.12.x", 37 | "mocha-istanbul": "0.2.x", 38 | "mocha-lcov-reporter": "0.0.x", 39 | "coveralls": "2.3.x", 40 | "uglify-js": "2.4.x", 41 | "istanbul": "0.1.x" 42 | }, 43 | "optionalDependencies": { 44 | "microtime": "2.0.x" 45 | }, 46 | "engines": { 47 | "node": "*" 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Assets/js/keypressAction.js: -------------------------------------------------------------------------------- 1 | ;(function ( $, window, document, undefined ) { 2 | var pluginName = "keypressAction", 3 | defaults = {}; 4 | 5 | // The actual plugin constructor 6 | function keypressAction ( element, options ) { 7 | this.element = element; 8 | this.settings = $.extend( {}, defaults, options ); 9 | this._defaults = defaults; 10 | this._name = pluginName; 11 | this.init(); 12 | } 13 | 14 | $.extend(keypressAction.prototype, { 15 | bindKeyToRoute: function (key, route) { 16 | Mousetrap.bind([key], function(e) { 17 | window.location = route; 18 | return false; 19 | }); 20 | }, 21 | init: function () { 22 | var self = this; 23 | $.each(this.settings.actions, function( index, object ) { 24 | self.bindKeyToRoute(object.key, object.route); 25 | }); 26 | } 27 | }); 28 | 29 | $.fn[ pluginName ] = function ( options ) { 30 | this.each(function() { 31 | if ( !$.data( this, "plugin_" + pluginName ) ) { 32 | $.data( this, "plugin_" + pluginName, new keypressAction( this, options ) ); 33 | } 34 | }); 35 | 36 | // chain jQuery functions 37 | return this; 38 | }; 39 | 40 | })( jQuery, window, document ); 41 | -------------------------------------------------------------------------------- /Composers/ApplicationVersionViewComposer.php: -------------------------------------------------------------------------------- 1 | filesystem = $filesystem; 21 | $this->cache = $cache; 22 | } 23 | 24 | public function compose(View $view) 25 | { 26 | $view->with('version', $this->getAppVersion()); 27 | } 28 | 29 | /** 30 | * @return string 31 | */ 32 | private function getAppVersion() 33 | { 34 | $composerFile = $this->getComposerFile(); 35 | 36 | return isset($composerFile->version) ? $composerFile->version : '1.0'; 37 | } 38 | 39 | /** 40 | * Get the decoded contents from the main composer.json file 41 | * @return object 42 | */ 43 | private function getComposerFile() 44 | { 45 | $composerFile = $this->cache->remember('app.version', 1440, function () { 46 | return $this->filesystem->get('composer.json'); 47 | }); 48 | 49 | return json_decode($composerFile); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Http/Middleware/PublicMiddleware.php: -------------------------------------------------------------------------------- 1 | request = $request; 21 | $this->menuItem = $menuItem; 22 | } 23 | 24 | /** 25 | * Handle an incoming request. 26 | * 27 | * @param \Illuminate\Http\Request $request 28 | * @param \Closure $next 29 | * @return mixed 30 | */ 31 | public function handle($request, \Closure $next) 32 | { 33 | $locale = $this->request->segment(1) ?: App::getLocale(); 34 | $item = $this->menuItem->findByUriInLanguage($this->request->segment(2), $locale); 35 | 36 | if ($this->isOffline($item)) { 37 | App::abort(404); 38 | } 39 | 40 | return $next($request); 41 | } 42 | 43 | /** 44 | * Checks if the given menu item is offline 45 | * @param object $item 46 | * @return bool 47 | */ 48 | private function isOffline($item) 49 | { 50 | return is_null($item); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Internationalisation/Translatable.php: -------------------------------------------------------------------------------- 1 | translations; 10 | if ($this->exists) { 11 | if (count($this->getDirty()) > 0) { 12 | // If $this->exists and dirty, parent::save() has to return true. If not, 13 | // an error has occurred. Therefore we shouldn't save the translations. 14 | if (parent::save($options)) { 15 | $this->translations = $tempTranslations; 16 | 17 | return $this->saveTranslations(); 18 | } 19 | 20 | return false; 21 | } else { 22 | // If $this->exists and not dirty, parent::save() skips saving and returns 23 | // false. So we have to save the translations 24 | $this->translations = $tempTranslations; 25 | 26 | return $this->saveTranslations(); 27 | } 28 | } elseif (parent::save($options)) { 29 | // We save the translations only if the instance is saved in the database. 30 | $this->translations = $tempTranslations; 31 | 32 | return $this->saveTranslations(); 33 | } 34 | 35 | return false; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Console/Installers/Installer.php: -------------------------------------------------------------------------------- 1 | finder = $finder; 23 | $this->app = $app; 24 | $this->composer = $composer; 25 | } 26 | 27 | /** 28 | * @param array $scripts 29 | * @return $this 30 | */ 31 | public function stack(array $scripts) 32 | { 33 | $this->scripts = $scripts; 34 | 35 | return $this; 36 | } 37 | 38 | /** 39 | * Fire install scripts 40 | * @param Command $command 41 | * @return bool 42 | */ 43 | public function install(Command $command) 44 | { 45 | foreach ($this->scripts as $script) { 46 | try { 47 | $this->app->make($script)->fire($command); 48 | } catch (\Exception $e) { 49 | $command->error($e->getMessage()); 50 | 51 | return false; 52 | } 53 | } 54 | 55 | return true; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Tests/BaseTestCase.php: -------------------------------------------------------------------------------- 1 | refreshApplication(); 13 | } 14 | 15 | protected function getPackageProviders($app) 16 | { 17 | return [ 18 | 'Pingpong\Modules\ModulesServiceProvider', 19 | 'Modules\Core\Providers\CoreServiceProvider', 20 | 'Modules\Core\Providers\AssetServiceProvider', 21 | 'Mcamara\LaravelLocalization\LaravelLocalizationServiceProvider', 22 | 'Maatwebsite\Sidebar\SidebarServiceProvider', 23 | ]; 24 | } 25 | 26 | protected function getEnvironmentSetUp($app) 27 | { 28 | $app['path.base'] = __DIR__ . '/..'; 29 | $app['config']->set('database.default', 'sqlite'); 30 | $app['config']->set('database.connections.sqlite', array( 31 | 'driver' => 'sqlite', 32 | 'database' => ':memory:', 33 | 'prefix' => '', 34 | )); 35 | $app['config']->set('translatable.locales', ['en', 'fr']); 36 | } 37 | 38 | protected function getPackageAliases($app) 39 | { 40 | return [ 41 | 'Eloquent' => 'Illuminate\Database\Eloquent\Model', 42 | 'LaravelLocalization' => 'Mcamara\LaravelLocalization\Facades\LaravelLocalization' 43 | ]; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Assets/vendor/jquery/src/core/access.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../core" 3 | ], function( jQuery ) { 4 | 5 | // Multifunctional method to get and set values of a collection 6 | // The value/s can optionally be executed if it's a function 7 | var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) { 8 | var i = 0, 9 | len = elems.length, 10 | bulk = key == null; 11 | 12 | // Sets many values 13 | if ( jQuery.type( key ) === "object" ) { 14 | chainable = true; 15 | for ( i in key ) { 16 | jQuery.access( elems, fn, i, key[i], true, emptyGet, raw ); 17 | } 18 | 19 | // Sets one value 20 | } else if ( value !== undefined ) { 21 | chainable = true; 22 | 23 | if ( !jQuery.isFunction( value ) ) { 24 | raw = true; 25 | } 26 | 27 | if ( bulk ) { 28 | // Bulk operations run against the entire set 29 | if ( raw ) { 30 | fn.call( elems, value ); 31 | fn = null; 32 | 33 | // ...except when executing function values 34 | } else { 35 | bulk = fn; 36 | fn = function( elem, key, value ) { 37 | return bulk.call( jQuery( elem ), value ); 38 | }; 39 | } 40 | } 41 | 42 | if ( fn ) { 43 | for ( ; i < len; i++ ) { 44 | fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) ); 45 | } 46 | } 47 | } 48 | 49 | return chainable ? 50 | elems : 51 | 52 | // Gets 53 | bulk ? 54 | fn.call( elems ) : 55 | len ? fn( elems[0], key ) : emptyGet; 56 | }; 57 | 58 | return access; 59 | 60 | }); 61 | -------------------------------------------------------------------------------- /Assets/vendor/jquery/src/ajax/script.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../core", 3 | "../ajax" 4 | ], function( jQuery ) { 5 | 6 | // Install script dataType 7 | jQuery.ajaxSetup({ 8 | accepts: { 9 | script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" 10 | }, 11 | contents: { 12 | script: /(?:java|ecma)script/ 13 | }, 14 | converters: { 15 | "text script": function( text ) { 16 | jQuery.globalEval( text ); 17 | return text; 18 | } 19 | } 20 | }); 21 | 22 | // Handle cache's special case and crossDomain 23 | jQuery.ajaxPrefilter( "script", function( s ) { 24 | if ( s.cache === undefined ) { 25 | s.cache = false; 26 | } 27 | if ( s.crossDomain ) { 28 | s.type = "GET"; 29 | } 30 | }); 31 | 32 | // Bind script tag hack transport 33 | jQuery.ajaxTransport( "script", function( s ) { 34 | // This transport only deals with cross domain requests 35 | if ( s.crossDomain ) { 36 | var script, callback; 37 | return { 38 | send: function( _, complete ) { 39 | script = jQuery(" 31 | -------------------------------------------------------------------------------- /Assets/vendor/jquery/src/css/curCSS.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../core", 3 | "./var/rnumnonpx", 4 | "./var/rmargin", 5 | "./var/getStyles", 6 | "../selector" // contains 7 | ], function( jQuery, rnumnonpx, rmargin, getStyles ) { 8 | 9 | function curCSS( elem, name, computed ) { 10 | var width, minWidth, maxWidth, ret, 11 | style = elem.style; 12 | 13 | computed = computed || getStyles( elem ); 14 | 15 | // Support: IE9 16 | // getPropertyValue is only needed for .css('filter') (#12537) 17 | if ( computed ) { 18 | ret = computed.getPropertyValue( name ) || computed[ name ]; 19 | } 20 | 21 | if ( computed ) { 22 | 23 | if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) { 24 | ret = jQuery.style( elem, name ); 25 | } 26 | 27 | // Support: iOS < 6 28 | // A tribute to the "awesome hack by Dean Edwards" 29 | // iOS < 6 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels 30 | // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values 31 | if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) { 32 | 33 | // Remember the original values 34 | width = style.width; 35 | minWidth = style.minWidth; 36 | maxWidth = style.maxWidth; 37 | 38 | // Put in the new values to get a computed value out 39 | style.minWidth = style.maxWidth = style.width = ret; 40 | ret = computed.width; 41 | 42 | // Revert the changed values 43 | style.width = width; 44 | style.minWidth = minWidth; 45 | style.maxWidth = maxWidth; 46 | } 47 | } 48 | 49 | return ret !== undefined ? 50 | // Support: IE 51 | // IE returns zIndex value as an integer. 52 | ret + "" : 53 | ret; 54 | } 55 | 56 | return curCSS; 57 | }); 58 | -------------------------------------------------------------------------------- /Http/Middleware/Authorization.php: -------------------------------------------------------------------------------- 1 | auth = $auth; 26 | } 27 | 28 | /** 29 | * @param $request 30 | * @param \Closure $next 31 | * @param $permission 32 | * @return \Illuminate\Http\RedirectResponse|Response 33 | */ 34 | public function handle($request, \Closure $next, $permission) 35 | { 36 | if ($this->auth->hasAccess($permission) === false) { 37 | return $this->handleUnauthorizedRequest($request, $permission); 38 | } 39 | 40 | return $next($request); 41 | } 42 | 43 | /** 44 | * @param Request $request 45 | * @param $permission 46 | * @return \Illuminate\Http\RedirectResponse|Response 47 | */ 48 | private function handleUnauthorizedRequest(Request $request, $permission) 49 | { 50 | if ($request->ajax()) { 51 | return response('Unauthorized.', Response::HTTP_UNAUTHORIZED); 52 | } 53 | if (! $request->user()) { 54 | return redirect()->guest('auth/login'); 55 | } 56 | 57 | flash()->error(trans('core::core.permission denied', ['permission' => $permission])); 58 | 59 | return redirect()->back(); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "asgardcms/core-module", 3 | "type": "asgard-module", 4 | "description": "The core module for AsgardCMS. This is required for every install.", 5 | "keywords": [ 6 | "asgardcms", 7 | "core" 8 | ], 9 | "license": "MIT", 10 | "authors": [ 11 | { 12 | "name": "Nicolas Widart", 13 | "email": "info@asgardcms.com", 14 | "role": "Developer" 15 | } 16 | ], 17 | "support": { 18 | "email": "support@asgardcms.com", 19 | "issues": "https://github.com/AsgardCms/Core/issues", 20 | "source": "https://github.com/AsgardCms/Core" 21 | }, 22 | "require": { 23 | "php": ">=5.5", 24 | "composer/installers": "~1.0", 25 | "pingpong/modules": "dev-feature/5.1", 26 | "laravelcollective/html": "~5.0", 27 | "laracasts/flash": "~1.3", 28 | "laracasts/presenter": "~0.2", 29 | "guzzlehttp/guzzle": "~5.0", 30 | "dimsav/laravel-translatable": "~5.0", 31 | "mcamara/laravel-localization": "~1.0", 32 | "floatingpoint/stylist": "~0.1", 33 | "maatwebsite/laravel-sidebar": "~2.0" 34 | }, 35 | "require-dev": { 36 | "phpunit/phpunit": "~4.0", 37 | "orchestra/testbench": "~3.1", 38 | "mockery/mockery": "^0.9.4" 39 | }, 40 | "suggest": { 41 | "asgardcms/notification-module": "Allows notifications to be sent to the user. Optionally real-time notifications." 42 | }, 43 | "repositories": [ 44 | { 45 | "type": "vcs", 46 | "url": "https://github.com/nWidart/modules" 47 | } 48 | ], 49 | "autoload-dev": { 50 | "psr-4": { 51 | "Modules\\Core\\": ".", 52 | "Modules\\": "Modules/" 53 | } 54 | }, 55 | "extra": { 56 | "branch-alias": { 57 | "dev-master": "1.0-dev" 58 | } 59 | }, 60 | "minimum-stability": "dev", 61 | "prefer-stable": true 62 | } 63 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # Core Module 2 | 3 | [![Latest Version](https://img.shields.io/packagist/v/asgardcms/core-module.svg?style=flat-square)](https://github.com/asgardcms/core/releases) 4 | [![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md) 5 | [![Quality Score](https://img.shields.io/scrutinizer/g/asgardcms/core.svg?style=flat-square)](https://scrutinizer-ci.com/g/asgardcms/core) 6 | [![SensioLabs Insight](https://img.shields.io/sensiolabs/i/57e26b38-6275-4608-96e2-44047aaed5c2.svg)](https://insight.sensiolabs.com/projects/57e26b38-6275-4608-96e2-44047aaed5c2) 7 | [![CodeClimate](https://img.shields.io/codeclimate/github/AsgardCms/Core.svg)](https://codeclimate.com/github/AsgardCms/Core) 8 | 9 | [![Total Downloads](https://img.shields.io/packagist/dd/asgardcms/core-module.svg?style=flat-square)](https://packagist.org/packages/asgardcms/core-module) 10 | [![Total Downloads](https://img.shields.io/packagist/dm/asgardcms/core-module.svg?style=flat-square)](https://packagist.org/packages/asgardcms/core-module) 11 | [![Total Downloads](https://img.shields.io/packagist/dt/asgardcms/core-module.svg?style=flat-square)](https://packagist.org/packages/asgardcms/core-module) 12 | [![Slack](http://slack.asgardcms.com/badge.svg)](http://slack.asgardcms.com/) 13 | 14 | 15 | 16 | | Branch | Travis-ci | 17 | | ---------------- | --------------- | 18 | | master | [![Build Status](https://travis-ci.org/AsgardCms/Core.svg?branch=master)](https://travis-ci.org/AsgardCms/Core) | 19 | 20 | ## Resources 21 | 22 | - [Contribute to AsgardCMS](https://asgardcms.com/en/docs/getting-started/contributing) 23 | - [License](LICENSE.md) 24 | - [Documentation](http://asgardcms.com/docs/core-module/configuration) 25 | 26 | 27 | ## Info 28 | 29 | All AsgardCMS modules respect [Semantic Versioning](http://semver.org/). 30 | -------------------------------------------------------------------------------- /Http/Controllers/Admin/AdminBaseController.php: -------------------------------------------------------------------------------- 1 | assetManager = app('Modules\Core\Foundation\Asset\Manager\AssetManager'); 23 | $this->assetPipeline = app('Modules\Core\Foundation\Asset\Pipeline\AssetPipeline'); 24 | 25 | $this->addAssets(); 26 | $this->requireDefaultAssets(); 27 | } 28 | 29 | /** 30 | * Add the assets from the config file on the asset manager 31 | */ 32 | private function addAssets() 33 | { 34 | foreach (config('asgard.core.core.admin-assets') as $assetName => $path) { 35 | if (key($path) == 'theme') { 36 | $this->assetManager->addAsset($assetName, Theme::url($path['theme'])); 37 | } else { 38 | $this->assetManager->addAsset($assetName, Module::asset($path['module'])); 39 | } 40 | } 41 | } 42 | 43 | /** 44 | * Require the default assets from config file on the asset pipeline 45 | */ 46 | private function requireDefaultAssets() 47 | { 48 | $this->assetPipeline->requireCss(config('asgard.core.core.admin-required-assets.css')); 49 | $this->assetPipeline->requireJs(config('asgard.core.core.admin-required-assets.js')); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Sidebar/AdminSidebar.php: -------------------------------------------------------------------------------- 1 | menu = $menu; 36 | $this->modules = $modules; 37 | $this->container = $container; 38 | } 39 | 40 | /** 41 | * Build your sidebar implementation here 42 | */ 43 | public function build() 44 | { 45 | foreach ($this->modules->enabled() as $module) { 46 | $name = studly_case($module->getName()); 47 | $class = 'Modules\\' . $name . '\\Sidebar\\SidebarExtender'; 48 | 49 | if (class_exists($class)) { 50 | $extender = $this->container->make($class); 51 | 52 | $this->menu->add( 53 | $extender->extendWith($this->menu) 54 | ); 55 | } 56 | } 57 | } 58 | 59 | /** 60 | * @return Menu 61 | */ 62 | public function getMenu() 63 | { 64 | return $this->menu; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /Assets/vendor/jquery/src/wrap.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "./core", 3 | "./core/init", 4 | "./manipulation", // clone 5 | "./traversing" // parent, contents 6 | ], function( jQuery ) { 7 | 8 | jQuery.fn.extend({ 9 | wrapAll: function( html ) { 10 | var wrap; 11 | 12 | if ( jQuery.isFunction( html ) ) { 13 | return this.each(function( i ) { 14 | jQuery( this ).wrapAll( html.call(this, i) ); 15 | }); 16 | } 17 | 18 | if ( this[ 0 ] ) { 19 | 20 | // The elements to wrap the target around 21 | wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true ); 22 | 23 | if ( this[ 0 ].parentNode ) { 24 | wrap.insertBefore( this[ 0 ] ); 25 | } 26 | 27 | wrap.map(function() { 28 | var elem = this; 29 | 30 | while ( elem.firstElementChild ) { 31 | elem = elem.firstElementChild; 32 | } 33 | 34 | return elem; 35 | }).append( this ); 36 | } 37 | 38 | return this; 39 | }, 40 | 41 | wrapInner: function( html ) { 42 | if ( jQuery.isFunction( html ) ) { 43 | return this.each(function( i ) { 44 | jQuery( this ).wrapInner( html.call(this, i) ); 45 | }); 46 | } 47 | 48 | return this.each(function() { 49 | var self = jQuery( this ), 50 | contents = self.contents(); 51 | 52 | if ( contents.length ) { 53 | contents.wrapAll( html ); 54 | 55 | } else { 56 | self.append( html ); 57 | } 58 | }); 59 | }, 60 | 61 | wrap: function( html ) { 62 | var isFunction = jQuery.isFunction( html ); 63 | 64 | return this.each(function( i ) { 65 | jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html ); 66 | }); 67 | }, 68 | 69 | unwrap: function() { 70 | return this.parent().each(function() { 71 | if ( !jQuery.nodeName( this, "body" ) ) { 72 | jQuery( this ).replaceWith( this.childNodes ); 73 | } 74 | }).end(); 75 | } 76 | }); 77 | 78 | return jQuery; 79 | }); 80 | -------------------------------------------------------------------------------- /Internationalisation/Helper.php: -------------------------------------------------------------------------------- 1 | $value) { 40 | if (is_array($value)) { 41 | foreach ($value as $lang => $input) { 42 | $cleanedData[$lang][$key] = $input; 43 | } 44 | } else { 45 | $cleanedData[$key] = $value; 46 | } 47 | } 48 | 49 | return $cleanedData; 50 | } 51 | 52 | /** 53 | * Save the given properties for the model 54 | * @param $model 55 | * @param $data 56 | */ 57 | private static function saveTranslatedProperties($model, $data) 58 | { 59 | foreach ($data as $lang => $value) { 60 | if (is_array($value)) { 61 | foreach ($value as $key => $input) { 62 | $model->translate($lang)->$key = $input; 63 | } 64 | } 65 | } 66 | $model->save(); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /Assets/vendor/jquery/src/dimensions.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "./core", 3 | "./core/access", 4 | "./css" 5 | ], function( jQuery, access ) { 6 | 7 | // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods 8 | jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { 9 | jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) { 10 | // Margin is only for outerHeight, outerWidth 11 | jQuery.fn[ funcName ] = function( margin, value ) { 12 | var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ), 13 | extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" ); 14 | 15 | return access( this, function( elem, type, value ) { 16 | var doc; 17 | 18 | if ( jQuery.isWindow( elem ) ) { 19 | // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there 20 | // isn't a whole lot we can do. See pull request at this URL for discussion: 21 | // https://github.com/jquery/jquery/pull/764 22 | return elem.document.documentElement[ "client" + name ]; 23 | } 24 | 25 | // Get document width or height 26 | if ( elem.nodeType === 9 ) { 27 | doc = elem.documentElement; 28 | 29 | // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], 30 | // whichever is greatest 31 | return Math.max( 32 | elem.body[ "scroll" + name ], doc[ "scroll" + name ], 33 | elem.body[ "offset" + name ], doc[ "offset" + name ], 34 | doc[ "client" + name ] 35 | ); 36 | } 37 | 38 | return value === undefined ? 39 | // Get width or height on the element, requesting but not forcing parseFloat 40 | jQuery.css( elem, type, extra ) : 41 | 42 | // Set width or height on the element 43 | jQuery.style( elem, type, value, extra ); 44 | }, type, chainable ? margin : undefined, chainable, null ); 45 | }; 46 | }); 47 | }); 48 | 49 | return jQuery; 50 | }); 51 | -------------------------------------------------------------------------------- /Assets/vendor/jquery/src/ajax/load.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../core", 3 | "../core/parseHTML", 4 | "../ajax", 5 | "../traversing", 6 | "../manipulation", 7 | "../selector", 8 | // Optional event/alias dependency 9 | "../event/alias" 10 | ], function( jQuery ) { 11 | 12 | // Keep a copy of the old load method 13 | var _load = jQuery.fn.load; 14 | 15 | /** 16 | * Load a url into a page 17 | */ 18 | jQuery.fn.load = function( url, params, callback ) { 19 | if ( typeof url !== "string" && _load ) { 20 | return _load.apply( this, arguments ); 21 | } 22 | 23 | var selector, type, response, 24 | self = this, 25 | off = url.indexOf(" "); 26 | 27 | if ( off >= 0 ) { 28 | selector = jQuery.trim( url.slice( off ) ); 29 | url = url.slice( 0, off ); 30 | } 31 | 32 | // If it's a function 33 | if ( jQuery.isFunction( params ) ) { 34 | 35 | // We assume that it's the callback 36 | callback = params; 37 | params = undefined; 38 | 39 | // Otherwise, build a param string 40 | } else if ( params && typeof params === "object" ) { 41 | type = "POST"; 42 | } 43 | 44 | // If we have elements to modify, make the request 45 | if ( self.length > 0 ) { 46 | jQuery.ajax({ 47 | url: url, 48 | 49 | // if "type" variable is undefined, then "GET" method will be used 50 | type: type, 51 | dataType: "html", 52 | data: params 53 | }).done(function( responseText ) { 54 | 55 | // Save response for use in complete callback 56 | response = arguments; 57 | 58 | self.html( selector ? 59 | 60 | // If a selector was specified, locate the right elements in a dummy div 61 | // Exclude scripts to avoid IE 'Permission Denied' errors 62 | jQuery("
").append( jQuery.parseHTML( responseText ) ).find( selector ) : 63 | 64 | // Otherwise use the full result 65 | responseText ); 66 | 67 | }).complete( callback && function( jqXHR, status ) { 68 | self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] ); 69 | }); 70 | } 71 | 72 | return this; 73 | }; 74 | 75 | }); 76 | -------------------------------------------------------------------------------- /Http/Middleware/AdminMiddleware.php: -------------------------------------------------------------------------------- 1 | auth = $auth; 35 | $this->session = $session; 36 | $this->request = $request; 37 | $this->redirect = $redirect; 38 | $this->application = $application; 39 | } 40 | 41 | /** 42 | * Handle an incoming request. 43 | * 44 | * @param \Illuminate\Http\Request $request 45 | * @param \Closure $next 46 | * @return mixed 47 | */ 48 | public function handle($request, \Closure $next) 49 | { 50 | // Check if the user is logged in 51 | if (!$this->auth->check()) { 52 | // Store the current uri in the session 53 | $this->session->put('url.intended', $this->request->url()); 54 | 55 | // Redirect to the login page 56 | return $this->redirect->route('login'); 57 | } 58 | 59 | // Check if the user has access to the dashboard page 60 | if (! $this->auth->hasAccess('dashboard.index')) { 61 | // Show the insufficient permissions page 62 | return $this->application->abort(403); 63 | } 64 | 65 | return $next($request); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /Foundation/Theme/AssetPublisher.php: -------------------------------------------------------------------------------- 1 | theme = $theme; 25 | } 26 | 27 | /** 28 | * @param $finder 29 | * @return $this 30 | */ 31 | public function setFinder($finder) 32 | { 33 | $this->finder = $finder; 34 | 35 | return $this; 36 | } 37 | 38 | /** 39 | * @param $repository 40 | * @return $this 41 | */ 42 | public function setRepository($repository) 43 | { 44 | $this->repository = $repository; 45 | 46 | return $this; 47 | } 48 | 49 | /** 50 | * Publish the assets 51 | */ 52 | public function publish() 53 | { 54 | if (!$this->finder->isDirectory($sourcePath = $this->getSourcePath())) { 55 | $message = "Source path does not exist : {$sourcePath}"; 56 | throw new \InvalidArgumentException($message); 57 | } 58 | if (!$this->finder->isDirectory($destinationPath = $this->getDestinationPath())) { 59 | $this->finder->makeDirectory($destinationPath, 0775, true); 60 | } 61 | if ($this->finder->copyDirectory($sourcePath, $destinationPath)) { 62 | return true; 63 | } 64 | } 65 | 66 | /** 67 | * Get the original source path 68 | * @return string 69 | */ 70 | public function getSourcePath() 71 | { 72 | return $this->theme->getPath() . '/assets'; 73 | } 74 | 75 | /** 76 | * Get the destination path 77 | * @return string 78 | */ 79 | public function getDestinationPath() 80 | { 81 | return $this->repository->getAssetPath($this->theme->getLowerName()); 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /Console/Installers/Scripts/UnignoreComposerLock.php: -------------------------------------------------------------------------------- 1 | gitignoreContainsComposerLock($gitignorePath)) { 22 | return; 23 | } 24 | 25 | $removeComposerLock = $command->confirm('Do you want to remove composer.lock from .gitignore ?', true); 26 | if ($removeComposerLock) { 27 | $out = $this->getGitignoreLinesButComposerLock($gitignorePath); 28 | $this->writeNewGitignore($gitignorePath, $out); 29 | } 30 | } 31 | 32 | /** 33 | * @param $gitignorePath 34 | * @return bool 35 | */ 36 | private function gitignoreContainsComposerLock($gitignorePath) 37 | { 38 | return file_exists($gitignorePath) && strpos(file_get_contents($gitignorePath), self::COMPOSER_LOCK) !== false; 39 | } 40 | 41 | /** 42 | * @param $gitignorePath 43 | * @return array 44 | */ 45 | private function getGitignoreLinesButComposerLock($gitignorePath) 46 | { 47 | $data = file($gitignorePath); 48 | $out = []; 49 | foreach ($data as $line) { 50 | if (trim($line) !== self::COMPOSER_LOCK) { 51 | $out[] = $line; 52 | } 53 | } 54 | 55 | return $out; 56 | } 57 | 58 | /** 59 | * @param $gitignorePath 60 | * @param $out 61 | */ 62 | private function writeNewGitignore($gitignorePath, $out) 63 | { 64 | $fp = fopen($gitignorePath, "w+"); 65 | flock($fp, LOCK_EX); 66 | foreach ($out as $line) { 67 | fwrite($fp, $line); 68 | } 69 | flock($fp, LOCK_UN); 70 | fclose($fp); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /Tests/Theme/ThemeManagerTest.php: -------------------------------------------------------------------------------- 1 | repository = new ThemeManager($this->app, $this->getPath()); 21 | } 22 | 23 | /** @test */ 24 | public function it_should_return_all_themes() 25 | { 26 | $this->assertTrue(is_array($this->repository->all())); 27 | $this->assertEquals($this->repository->count(), 2); 28 | } 29 | 30 | /** @test */ 31 | public function it_should_return_a_theme() 32 | { 33 | $theme = $this->repository->find('demo'); 34 | 35 | $this->assertInstanceOf('Modules\Core\Foundation\Theme\Theme', $theme); 36 | $this->assertEquals('demo', $theme->getLowerName()); 37 | } 38 | 39 | /** @test */ 40 | public function it_should_return_null_if_not_theme_found() 41 | { 42 | $theme = $this->repository->find('fakeTheme'); 43 | 44 | $this->assertNull($theme); 45 | } 46 | 47 | /** @test */ 48 | public function it_should_return_empty_array_if_no_themes() 49 | { 50 | $repository = new ThemeManager($this->app, $this->getEmptyThemesPath()); 51 | 52 | $this->assertEquals([], $repository->all()); 53 | } 54 | 55 | /** @test */ 56 | public function it_should_return_empty_array_if_no_folder() 57 | { 58 | $repository = new ThemeManager($this->app, $this->getFakePath()); 59 | 60 | $this->assertEquals([], $repository->all()); 61 | } 62 | 63 | private function getPath() 64 | { 65 | return __DIR__ . '/Fixture/Themes'; 66 | } 67 | 68 | private function getEmptyThemesPath() 69 | { 70 | return __DIR__ . '/Fixture/EmptyThemes'; 71 | } 72 | 73 | private function getFakePath() 74 | { 75 | return __DIR__ . '/Fixture/fakeFolder'; 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /Assets/vendor/jquery/src/css/defaultDisplay.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../core", 3 | "../manipulation" // appendTo 4 | ], function( jQuery ) { 5 | 6 | var iframe, 7 | elemdisplay = {}; 8 | 9 | /** 10 | * Retrieve the actual display of a element 11 | * @param {String} name nodeName of the element 12 | * @param {Object} doc Document object 13 | */ 14 | // Called only from within defaultDisplay 15 | function actualDisplay( name, doc ) { 16 | var style, 17 | elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), 18 | 19 | // getDefaultComputedStyle might be reliably used only on attached element 20 | display = window.getDefaultComputedStyle && ( style = window.getDefaultComputedStyle( elem[ 0 ] ) ) ? 21 | 22 | // Use of this method is a temporary fix (more like optimization) until something better comes along, 23 | // since it was removed from specification and supported only in FF 24 | style.display : jQuery.css( elem[ 0 ], "display" ); 25 | 26 | // We don't have any data stored on the element, 27 | // so use "detach" method as fast way to get rid of the element 28 | elem.detach(); 29 | 30 | return display; 31 | } 32 | 33 | /** 34 | * Try to determine the default display value of an element 35 | * @param {String} nodeName 36 | */ 37 | function defaultDisplay( nodeName ) { 38 | var doc = document, 39 | display = elemdisplay[ nodeName ]; 40 | 41 | if ( !display ) { 42 | display = actualDisplay( nodeName, doc ); 43 | 44 | // If the simple way fails, read from inside an iframe 45 | if ( display === "none" || !display ) { 46 | 47 | // Use the already-created iframe if possible 48 | iframe = (iframe || jQuery( "