Browse Source

Fix file names, fix functions names

Vova Tkach 4 years ago
parent
commit
aea9f15c50

+ 3 - 3
engine/modules/module_template.go → engine/modules/module_templates.go

@@ -15,7 +15,7 @@ import (
 	"golang-fave/engine/wrapper"
 )
 
-func (this *Modules) template_GetThemeFiles(wrap *wrapper.Wrapper) []string {
+func (this *Modules) templates_GetThemeFiles(wrap *wrapper.Wrapper) []string {
 	var result []string
 	files, err := ioutil.ReadDir(wrap.DTemplate)
 	if err == nil {
@@ -32,7 +32,7 @@ func (this *Modules) template_GetThemeFiles(wrap *wrapper.Wrapper) []string {
 	return result
 }
 
-func (this *Modules) RegisterModule_Template() *Module {
+func (this *Modules) RegisterModule_Templates() *Module {
 	return this.newModule(MInfo{
 		Mount:  "templates",
 		Name:   "Templates",
@@ -52,7 +52,7 @@ func (this *Modules) RegisterModule_Template() *Module {
 				{Name: "Template editor"},
 			})
 
-			files := this.template_GetThemeFiles(wrap)
+			files := this.templates_GetThemeFiles(wrap)
 			if len(files) > 0 {
 				selected_file, _ := url.QueryUnescape(wrap.R.URL.Query().Get("file"))
 				if !(selected_file != "" && utils.InArrayString(files, selected_file)) {

+ 2 - 2
engine/modules/module_template_act_edit_theme_file.go → engine/modules/module_templates_act_edit_theme_file.go

@@ -8,7 +8,7 @@ import (
 	"golang-fave/engine/wrapper"
 )
 
-func (this *Modules) RegisterAction_TemplateEditThemeFile() *Action {
+func (this *Modules) RegisterAction_TemplatesEditThemeFile() *Action {
 	return this.newAction(AInfo{
 		Mount:     "templates-edit-theme-file",
 		WantAdmin: true,
@@ -31,7 +31,7 @@ func (this *Modules) RegisterAction_TemplateEditThemeFile() *Action {
 			return
 		}
 
-		files := this.template_GetThemeFiles(wrap)
+		files := this.templates_GetThemeFiles(wrap)
 		if len(files) <= 0 {
 			wrap.MsgError(`No any file found in theme folder`)
 			return

+ 1 - 1
engine/modules/module_template_act_restore_file.go → engine/modules/module_templates_act_restore_file.go

@@ -9,7 +9,7 @@ import (
 	"golang-fave/engine/wrapper"
 )
 
-func (this *Modules) RegisterAction_TemplateRestoreFile() *Action {
+func (this *Modules) RegisterAction_TemplatesRestoreFile() *Action {
 	return this.newAction(AInfo{
 		Mount:     "templates-restore-file",
 		WantAdmin: true,

+ 1 - 1
engine/modules/module_template_act_restore_file_all.go → engine/modules/module_templates_act_restore_file_all.go

@@ -9,7 +9,7 @@ import (
 	"golang-fave/engine/wrapper"
 )
 
-func (this *Modules) RegisterAction_TemplateRestoreFileAll() *Action {
+func (this *Modules) RegisterAction_TemplatesRestoreFileAll() *Action {
 	return this.newAction(AInfo{
 		Mount:     "templates-restore-file-all",
 		WantAdmin: true,