diff --git a/Admin/ArticleJsConfig.php b/Admin/ArticleJsConfig.php index 870bbe1f2..0d491c0d4 100644 --- a/Admin/ArticleJsConfig.php +++ b/Admin/ArticleJsConfig.php @@ -88,7 +88,7 @@ public function getParameters() $type = $this->getType($structure->getStructure()); if (!array_key_exists($type, $config['types'])) { $config['types'][$type] = [ - 'default' => $type, + 'default' => $structure->getKey(), 'title' => $this->getTitle($type), ]; } diff --git a/Resources/public/dist/main.js b/Resources/public/dist/main.js index e618bed3a..7a0b09574 100644 --- a/Resources/public/dist/main.js +++ b/Resources/public/dist/main.js @@ -1 +1 @@ -require.config({paths:{suluarticle:"../../suluarticle/dist",suluarticlecss:"../../suluarticle/css","type/article-selection":"../../suluarticle/dist/validation/types/article-selection","type/page-tree-route":"../../suluarticle/dist/validation/types/page-tree-route","services/suluarticle/article-manager":"../../suluarticle/dist/services/manager","services/suluarticle/article-router":"../../suluarticle/dist/services/router","services/suluarticle/property-configuration":"../../suluarticle/dist/services/property-configuration","services/suluarticle/list-helper":"../../suluarticle/dist/services/list-helper","services/suluarticle/overlay-filter-helper":"../../suluarticle/dist/services/overlay-filter-helper"}}),define(["underscore","config","css!suluarticlecss/main"],function(a,b){"use strict";var c=function(){var c=b.get("sulu-content").locales,d=[];return a.each(c,function(b){d=a.union(d,Object.keys(b))}),d};return{name:"Sulu Article Bundle",initialize:function(d){function e(c){var d={};return a.each(c,function(a,c){var e=b.get("sulu_security.contexts")["sulu.modules.articles_"+c];e&&e.view!==!1&&(d[a["default"]]=a)}),d}d.components.addSource("suluarticle","/bundles/suluarticle/dist/components"),d.sandbox.urlManager.setUrl("article","articles/<%= locale %>/edit:<%= id %>/details");var f=c(),g=b.get("sulu_article"),h={defaultLocale:f[0],locales:f,languageChanger:a.map(f,function(a){return{id:a,title:a}}),settingsKey:"articleLanguage",typeNames:Object.keys(e(g.types)),types:e(g.types),templates:g.templates,displayTabAll:g.displayTabAll,defaultAuthor:g.defaultAuthor,pageTreeEnabled:g.pageTreeEnabled,classes:g.classes,showWebspaceSettings:g.showWebspaceSettings,webspaceSettings:g.webspaceSettings,webspaces:g.webspaces};b.set("sulu_article",h);var i=function(){return d.sandbox.sulu.getUserSetting(h.settingsKey)||h.defaultLocale};d.sandbox.mvc.routes.push({route:"articles",callback:function(){return d.sandbox.emit("sulu.router.navigate","articles/"+i())}}),1===h.typeNames.length?(d.sandbox.mvc.routes.push({route:"articles/:locale",callback:function(a){return'
"}}),d.sandbox.mvc.routes.push({route:"articles/:locale/add",callback:function(a,b){return'"}})):(h.displayTabAll||d.sandbox.mvc.routes.push({route:"articles(/:locale)",callback:function(){return d.sandbox.emit("sulu.router.navigate","articles:"+h.typeNames[0]+"/"+i())}}),h.displayTabAll===!0&&d.sandbox.mvc.routes.push({route:"articles/:locale",callback:function(a){return'"}}),d.sandbox.mvc.routes.push({route:"articles::type",callback:function(a){return d.sandbox.emit("sulu.router.navigate","articles:"+a+"/"+i())}}),d.sandbox.mvc.routes.push({route:"articles::type/:locale",callback:function(a,b){return'