Browse Source

Display only if content for CP in module exists

Vova Tkach 6 years ago
parent
commit
eaa0434fd8
1 changed files with 6 additions and 4 deletions
  1. 6 4
      modules/modules.go

+ 6 - 4
modules/modules.go

@@ -108,11 +108,13 @@ func (this *Modules) getCurrentModule(wrap *wrapper.Wrapper, backend bool) (*Mod
 func (this *Modules) getNavMenuModules(wrap *wrapper.Wrapper) string {
 	html := ""
 	for _, mod := range this.mods {
-		class := ""
-		if mod.Info.Mount == wrap.CurrModule {
-			class = " active"
+		if mod.Back != nil {
+			class := ""
+			if mod.Info.Mount == wrap.CurrModule {
+				class = " active"
+			}
+			html += `<a class="dropdown-item` + class + `" href="/cp/` + mod.Info.Mount + `/">` + mod.Info.Name + `</a>`
 		}
-		html += `<a class="dropdown-item` + class + `" href="/cp/` + mod.Info.Mount + `/">` + mod.Info.Name + `</a>`
 	}
 	return html
 }