Browse Source

Move cache blocks code to new file

Vova Tkach 5 years ago
parent
commit
0462f516bd
2 changed files with 49 additions and 44 deletions
  1. 49 0
      engine/wrapper/cblocks.go
  2. 0 44
      engine/wrapper/wrapper.go

+ 49 - 0
engine/wrapper/cblocks.go

@@ -0,0 +1,49 @@
+package wrapper
+
+import (
+	"html/template"
+)
+
+func (this *Wrapper) ResetCacheBlocks() {
+	this.c.Reset(this.Host)
+}
+
+func (this *Wrapper) GetBlock1() (template.HTML, bool) {
+	return this.c.GetBlock1(this.Host, this.R.URL.Path)
+}
+
+func (this *Wrapper) SetBlock1(data template.HTML) {
+	this.c.SetBlock1(this.Host, this.R.URL.Path, data)
+}
+
+func (this *Wrapper) GetBlock2() (template.HTML, bool) {
+	return this.c.GetBlock2(this.Host, this.R.URL.Path)
+}
+
+func (this *Wrapper) SetBlock2(data template.HTML) {
+	this.c.SetBlock2(this.Host, this.R.URL.Path, data)
+}
+
+func (this *Wrapper) GetBlock3() (template.HTML, bool) {
+	return this.c.GetBlock3(this.Host, this.R.URL.Path)
+}
+
+func (this *Wrapper) SetBlock3(data template.HTML) {
+	this.c.SetBlock3(this.Host, this.R.URL.Path, data)
+}
+
+func (this *Wrapper) GetBlock4() (template.HTML, bool) {
+	return this.c.GetBlock4(this.Host, this.R.URL.Path)
+}
+
+func (this *Wrapper) SetBlock4(data template.HTML) {
+	this.c.SetBlock4(this.Host, this.R.URL.Path, data)
+}
+
+func (this *Wrapper) GetBlock5() (template.HTML, bool) {
+	return this.c.GetBlock5(this.Host, this.R.URL.Path)
+}
+
+func (this *Wrapper) SetBlock5(data template.HTML) {
+	this.c.SetBlock5(this.Host, this.R.URL.Path, data)
+}

+ 0 - 44
engine/wrapper/wrapper.go

@@ -273,50 +273,6 @@ func (this *Wrapper) ConfigSave() error {
 	return this.Config.configWrite(this.DConfig + string(os.PathSeparator) + "config.json")
 }
 
-func (this *Wrapper) ResetCacheBlocks() {
-	this.c.Reset(this.Host)
-}
-
-func (this *Wrapper) GetBlock1() (template.HTML, bool) {
-	return this.c.GetBlock1(this.Host, this.R.URL.Path)
-}
-
-func (this *Wrapper) SetBlock1(data template.HTML) {
-	this.c.SetBlock1(this.Host, this.R.URL.Path, data)
-}
-
-func (this *Wrapper) GetBlock2() (template.HTML, bool) {
-	return this.c.GetBlock2(this.Host, this.R.URL.Path)
-}
-
-func (this *Wrapper) SetBlock2(data template.HTML) {
-	this.c.SetBlock2(this.Host, this.R.URL.Path, data)
-}
-
-func (this *Wrapper) GetBlock3() (template.HTML, bool) {
-	return this.c.GetBlock3(this.Host, this.R.URL.Path)
-}
-
-func (this *Wrapper) SetBlock3(data template.HTML) {
-	this.c.SetBlock3(this.Host, this.R.URL.Path, data)
-}
-
-func (this *Wrapper) GetBlock4() (template.HTML, bool) {
-	return this.c.GetBlock4(this.Host, this.R.URL.Path)
-}
-
-func (this *Wrapper) SetBlock4(data template.HTML) {
-	this.c.SetBlock4(this.Host, this.R.URL.Path, data)
-}
-
-func (this *Wrapper) GetBlock5() (template.HTML, bool) {
-	return this.c.GetBlock5(this.Host, this.R.URL.Path)
-}
-
-func (this *Wrapper) SetBlock5(data template.HTML) {
-	this.c.SetBlock5(this.Host, this.R.URL.Path, data)
-}
-
 func (this *Wrapper) RemoveProductImageThumbnails(product_id, filename string) error {
 	pattern := this.DHtdocs + string(os.PathSeparator) + strings.Join([]string{"products", "images", product_id, filename}, string(os.PathSeparator))
 	if files, err := filepath.Glob(pattern); err != nil {