Documentation
¶
Index ¶
- Variables
- func DeleteHypha(u *user.User, h hyphae.Hypha, lc *l18n.Localizer) (hop *history.Op, errtitle string)
- func FetchTextFile(h hyphae.Hypha) (string, error)
- func RenameHypha(h hyphae.Hypha, newHypha hyphae.Hypha, recursive bool, u *user.User, ...) (hop *history.Op, errtitle string)
- func SetHeaderLinks()
- func UnattachHypha(u *user.User, h hyphae.Hypha, lc *l18n.Localizer) (hop *history.Op, errtitle string)
- func UploadBinary(h hyphae.Hypha, mime string, file multipart.File, u *user.User, ...) (*history.Op, string)
- func UploadText(h hyphae.Hypha, data []byte, userMessage string, u *user.User, ...) (hop *history.Op, errtitle string)
- func YieldHyphaNamesContainingString(query string) <-chan string
Constants ¶
This section is empty.
Variables ¶
var ( CanDelete = canFactory( rejectDeleteLog, "delete-confirm", nil, "ui.act_norights_delete", "ui.act_notexist_delete", true, ) CanRename = canFactory( rejectRenameLog, "rename-confirm", nil, "ui.act_norights_rename", "ui.act_notexist_rename", true, ) CanUnattach = canFactory( rejectUnattachLog, "unattach-confirm", func(h hyphae.Hypha, u *user.User, lc *l18n.Localizer) (errmsg, errtitle string) { switch h := h.(type) { case *hyphae.EmptyHypha: case *hyphae.TextualHypha: rejectUnattachLog(h, u, "no amnt") return lc.Get("ui.act_noattachment_tip"), lc.Get("ui.act_noattachment") } return "", "" }, "ui.act_norights_unattach", "ui.act_notexist_unattach", true, ) CanEdit = canFactory( rejectEditLog, "upload-text", nil, "ui.act_norights_edit", "You cannot edit a hypha that does not exist", false, ) CanAttach = canFactory( rejectAttachLog, "upload-binary", nil, "ui.act_norights_attach", "You cannot attach a hypha that does not exist", false, ) )
CanDelete and etc are hyphae operation checkers based on user rights and hyphae existence.
Functions ¶
func DeleteHypha ¶
func DeleteHypha(u *user.User, h hyphae.Hypha, lc *l18n.Localizer) (hop *history.Op, errtitle string)
DeleteHypha deletes hypha and makes a history record about that.
func FetchTextFile ¶ added in v1.8.2
FetchTextFile tries to read text file of the given hypha. If there is no file, empty string is returned.
func RenameHypha ¶
func RenameHypha(h hyphae.Hypha, newHypha hyphae.Hypha, recursive bool, u *user.User, lc *l18n.Localizer) (hop *history.Op, errtitle string)
RenameHypha renames hypha from old name `hyphaName` to `newName` and makes a history record about that. If `recursive` is `true`, its subhyphae will be renamed the same way.
func SetHeaderLinks ¶
func SetHeaderLinks()
SetHeaderLinks initializes header links by reading the configured hypha, if there is any, or resorting to default values.
func UnattachHypha ¶
func UnattachHypha(u *user.User, h hyphae.Hypha, lc *l18n.Localizer) (hop *history.Op, errtitle string)
UnattachHypha unattaches hypha and makes a history record about that.
func UploadBinary ¶
func UploadBinary(h hyphae.Hypha, mime string, file multipart.File, u *user.User, lc *l18n.Localizer) (*history.Op, string)
UploadBinary edits the hypha's media part and makes a history record about that.
func UploadText ¶
func UploadText(h hyphae.Hypha, data []byte, userMessage string, u *user.User, lc *l18n.Localizer) (hop *history.Op, errtitle string)
UploadText edits the hypha's text part and makes a history record about that.
func YieldHyphaNamesContainingString ¶ added in v1.3.0
YieldHyphaNamesContainingString picks hyphae with have a string in their title, sorts and iterates over them.
Types ¶
This section is empty.