public virtual void List() { set("addLink", to(Add)); set("sortAction", to(SaveSort)); List <FileLang> list = FileLang.GetAll(); bindList("list", "data", list, bindLink); }
public void Add() { target(Create); dropList("categoryId", getRootList(), "Name=Id", ""); dropList("fileItem.LicenseTypeId", LicenseType.GetAll(), "Name=Id", ""); dropList("fileItem.Lang", FileLang.GetAll(), "Name=Name", ""); set("subCategoriesJson", FileCategory.GetSubCatsJson()); checkboxList("fileItem.PlatformIds", Platform.GetAll(), "Name=Id", ""); set("authInfo", AdminSecurityUtils.GetAuthCookieJson(ctx)); set("uploadLink", to(SaveUpload)); set("jsPath", sys.Path.DiskJs); }
public void Edit(int id) { target(Update, id); FileItem f = FileItem.findById(id); bind(f); dropList("categoryId", getRootList(), "Name=Id", f.ParentCategoryId); dropList("fileItem.LicenseTypeId", LicenseType.GetAll(), "Name=Id", f.LicenseTypeId); dropList("fileItem.Lang", FileLang.GetAll(), "Name=Name", f.Lang); set("subCategoriesJson", FileCategory.GetSubCatsJson()); checkboxList("fileItem.PlatformIds", Platform.GetAll(), "Name=Id", f.PlatformIds); editor("fileItem.Description", f.Description, "200px"); set("authInfo", AdminSecurityUtils.GetAuthCookieJson(ctx)); set("uploadLink", to(SaveUpload)); set("jsPath", sys.Path.DiskJs); }
public virtual void SaveSort() { long id = ctx.PostLong("id"); String cmd = ctx.Post("cmd"); FileLang data = FileLang.GetById(id); List <FileLang> list = FileLang.GetAll(); if (cmd == "up") { new SortUtil <FileLang>(data, list).MoveUp(); echoRedirect("ok"); } else if (cmd == "down") { new SortUtil <FileLang>(data, list).MoveDown(); echoRedirect("ok"); } else { echoError(lang("exUnknowCmd")); } }