MCPcopy Index your code
hub / github.com/TruthHun/BookStack / Setting

Method Setting

controllers/ManagerController.go:560–597  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

558}
559
560func (this *ManagerController) Setting() {
561 tab := this.GetString("tab", "basic")
562 options, err := models.NewOption().All()
563 if err != nil {
564 this.Abort("404")
565 }
566
567 if this.Ctx.Input.IsPost() {
568 for _, item := range options {
569 if _, ok := this.Ctx.Request.PostForm[item.OptionName]; ok {
570 item.OptionValue = this.GetString(item.OptionName)
571 item.InsertOrUpdate()
572 }
573 }
574
575 if err := models.NewElasticSearchClient().Init(); err != nil {
576 this.JsonResult(1, err.Error())
577 }
578
579 models.NewSign().UpdateSignRule()
580 models.NewReadRecord().UpdateReadingRule()
581 this.JsonResult(0, "ok")
582 }
583
584 for _, item := range options {
585 if item.OptionName == "APP_PAGE" {
586 this.Data["APP_PAGE"] = item.OptionValue
587 this.Data["M_APP_PAGE"] = item
588 } else {
589 this.Data[item.OptionName] = item
590 }
591 }
592 this.Data["SITE_TITLE"] = this.Option["SITE_NAME"]
593 this.Data["Tab"] = tab
594 this.Data["IsSetting"] = true
595 this.Data["SeoTitle"] = "配置管理"
596 this.TplName = "manager/setting.html"
597}
598
599// Transfer 转让书籍.
600func (this *ManagerController) Transfer() {

Callers

nothing calls this directly

Calls 10

NewOptionFunction · 0.92
NewElasticSearchClientFunction · 0.92
NewSignFunction · 0.92
NewReadRecordFunction · 0.92
JsonResultMethod · 0.80
UpdateSignRuleMethod · 0.80
UpdateReadingRuleMethod · 0.80
AllMethod · 0.45
InsertOrUpdateMethod · 0.45
InitMethod · 0.45

Tested by

no test coverage detected