@@ -112,20 +112,24 @@ public function getFormDefinition(FAPI\Form $form, array &$form_state): FAPI\For
112112
113113 switch ($ type ) {
114114 case 'edit ' :
115- $ this ->addActionLink (
116- 'media-btn ' ,
117- 'media-btn ' ,
118- $ this ->getHtmlRenderer ()->getIcon ('image ' ) . ' ' . $ this ->getUtils ()->translate ('Media ' , locale: $ this ->getCurrentLocale ()),
119- $ this ->getUrl ('crud.app.site.controllers.admin.json.pagemedia ' , ['id ' => $ this ->getRequest ()->query ->get ('page_id ' )]) . '?page_id= ' . $ this ->getRequest ()->query ->get ('page_id ' ) . '&action=new ' ,
120- 'btn btn-sm btn-light inToolSidePanel '
121- );
122- $ this ->addActionLink (
123- 'taxonomy-btn ' ,
124- 'taxonomy-btn ' ,
125- $ this ->getHtmlRenderer ()->getIcon ('list ' ) . ' ' . $ this ->getUtils ()->translate ('Terms ' , locale: $ this ->getCurrentLocale ()),
126- $ this ->getUrl ('crud.app.site.controllers.admin.json.pageterms ' , ['id ' => $ this ->getRequest ()->query ->get ('page_id ' )]) . '?page_id= ' . $ this ->getRequest ()->query ->get ('page_id ' ) . '&action=new ' ,
127- 'btn btn-sm btn-light inToolSidePanel '
128- );
115+ if (Media::getCollection ()->count () > 0 ) {
116+ $ this ->addActionLink (
117+ 'media-btn ' ,
118+ 'media-btn ' ,
119+ $ this ->getHtmlRenderer ()->getIcon ('image ' ) . ' ' . $ this ->getUtils ()->translate ('Media ' , locale: $ this ->getCurrentLocale ()),
120+ $ this ->getUrl ('crud.app.site.controllers.admin.json.pagemedia ' , ['id ' => $ this ->getRequest ()->query ->get ('page_id ' )]) . '?page_id= ' . $ this ->getRequest ()->query ->get ('page_id ' ) . '&action=new ' ,
121+ 'btn btn-sm btn-light inToolSidePanel '
122+ );
123+ }
124+ if (Taxonomy::getCollection ()->count () > 0 ) {
125+ $ this ->addActionLink (
126+ 'taxonomy-btn ' ,
127+ 'taxonomy-btn ' ,
128+ $ this ->getHtmlRenderer ()->getIcon ('list ' ) . ' ' . $ this ->getUtils ()->translate ('Terms ' , locale: $ this ->getCurrentLocale ()),
129+ $ this ->getUrl ('crud.app.site.controllers.admin.json.pageterms ' , ['id ' => $ this ->getRequest ()->query ->get ('page_id ' )]) . '?page_id= ' . $ this ->getRequest ()->query ->get ('page_id ' ) . '&action=new ' ,
130+ 'btn btn-sm btn-light inToolSidePanel '
131+ );
132+ }
129133 // intentional fall-trough
130134 // no break
131135 case 'new ' :
0 commit comments