/// <summary> /// Constructor /// </summary> /// <param name="id">user id</param> public Form_Author_Add(long id) { _action = new CMS_Action("/backend/PromoteUser?id=" + id.ToString()); CMS_Form_Element_Textbox name = new CMS_Form_Element_Textbox("name"); name.setLabel("First name"); name.setRequired(); this.addElement(name); CMS_Form_Element_Textbox lastname = new CMS_Form_Element_Textbox("lastname"); lastname.setRequired(); lastname.setLabel("Lastname"); this.addElement(lastname); CMS_Form_Element_Textarea description = new CMS_Form_Element_Textarea("description"); description.setLabel("Description"); description.setRequired(); description.setClass("ckeditor"); this.addElement(description); CMS_Form_Element_Submit ok = new CMS_Form_Element_Submit("ok"); ok.setLabel("Promote to author"); this.addElement(ok); }
/// <summary> /// Constructor /// </summary> /// <param name="id">id</param> /// <param name="ident">ident (art or parent)</param> public Form_Comment_New(long id,string ident) { _action = new CMS_Action("/comment/add?"+ident+"="+id.ToString()); CMS_Form_Element_Textbox name = new CMS_Form_Element_Textbox("name"); name.setRequired(); name.setLabel("Nickname"); this.addElement(name); CMS_Form_Element_Textbox email = new CMS_Form_Element_Textbox("email"); email.setRequired(); email.setLabel("E-mail"); email.addValidator(new CMS_Validator_Email()); this.addElement(email); CMS_Form_Element_Textbox title = new CMS_Form_Element_Textbox("title"); title.setLabel("Title"); title.setRequired(); this.addElement(title); CMS_Form_Element_Textarea text = new CMS_Form_Element_Textarea("text"); text.setRequired(); text.setLabel("Comment"); this.addElement(text); CMS_Form_Element_Submit ok = new CMS_Form_Element_Submit("ok"); ok.setLabel("Comment!"); this.addElement(ok); }
/// <summary> /// Constructor /// </summary> public Form_User_Add() { this._action = new CMS_Action("/backend/AddUser"); CMS_Form_Element_Textbox username = new CMS_Form_Element_Textbox("username"); username.setLabel("Username"); username.setRequired(); this.addElement(username); CMS_Form_Element_Password password = new CMS_Form_Element_Password("password"); password.setLabel("Password"); password.setRequired(); this.addElement(password); CMS_Form_Element_Textbox email = new CMS_Form_Element_Textbox("email"); email.setRequired(); email.setLabel("E-mail"); email.addValidator(new CMS_Validator_Email()); this.addElement(email); CMS_Form_Element_Select role = new CMS_Form_Element_Select("role"); role.setLabel("User role"); role.setRequired(); this.addElement(role); CMS_Form_Element_Submit ok = new CMS_Form_Element_Submit("ok"); ok.setLabel("Add the user"); this.addElement(ok); }
/// <summary> /// Constructor /// </summary> public Form_Resource_Add() { this._action = new CMS_Action("/backend/AddResource"); CMS_Form_Element_Textbox name = new CMS_Form_Element_Textbox("name"); name.setRequired(); name.setLabel("Name of the resource"); this.addElement(name); CMS_Form_Element_Textbox controller = new CMS_Form_Element_Textbox("controller"); controller.setRequired(); controller.setLabel("Name of the controller"); this.addElement(controller); CMS_Form_Element_Textbox action = new CMS_Form_Element_Textbox("action"); action.setLabel("Name of the action"); action.setRequired(); this.addElement(action); CMS_Form_Element_Submit submit = new CMS_Form_Element_Submit("ok"); submit.setLabel("Add the resource"); this.addElement(submit); }
/// <summary> /// Constructor /// </summary> public Form_Resource_Add() { this._action = new CMS_Action("/backend/AddResource"); CMS_Form_Element_Textbox name = new CMS_Form_Element_Textbox("name"); name.setRequired(); name.setLabel("Jméno aplikačního zdroje"); this.addElement(name); CMS_Form_Element_Textbox controller = new CMS_Form_Element_Textbox("controller"); controller.setRequired(); controller.setLabel("Jméno controlleru"); this.addElement(controller); CMS_Form_Element_Textbox action = new CMS_Form_Element_Textbox("action"); action.setLabel("Jméno action"); action.setRequired(); this.addElement(action); CMS_Form_Element_Submit submit = new CMS_Form_Element_Submit("ok"); submit.setLabel("Přidat zdroj"); this.addElement(submit); }
/// <summary> /// Constructor /// </summary> public Form_LoginForm(string backUrl) { _action = new CMS_Action("/user/login"); CMS_Form_Element_Textbox username = new CMS_Form_Element_Textbox("username"); username.setLabel("Uživatelské jméno"); username.setRequired(); addElement(username); CMS_Form_Element_Hidden hidden = new CMS_Form_Element_Hidden("backUrl"); hidden.setValue(backUrl); addElement(hidden); CMS_Form_Element_Password pw = new CMS_Form_Element_Password("password"); pw.setLabel("Heslo"); pw.setRequired(); addElement(pw); CMS_Form_Element_Submit submit = new CMS_Form_Element_Submit("submit"); submit.setLabel("Přihlásit se"); addElement(submit); }
/// <summary> /// Constructor /// </summary> /// <param name="parent">parentid</param> public Form_Role_Add(long parent) { _action = new CMS_Action("/backend/AddRole?parent="+parent.ToString()); CMS_Form_Element_Textbox name = new CMS_Form_Element_Textbox("name"); name.setRequired(); name.setLabel("Category title"); this.addElement(name); CMS_Form_Element_Submit ok = new CMS_Form_Element_Submit("ok"); ok.setLabel("Add the role"); this.addElement(ok); }
/// <summary> /// Constructor /// </summary> public Form_LoginForm() { _action = new CMS_Action("/user/login"); CMS_Form_Element_Textbox username = new CMS_Form_Element_Textbox("username"); username.setLabel("Username"); username.setRequired(); addElement(username); CMS_Form_Element_Password pw = new CMS_Form_Element_Password("password"); pw.setLabel("Password"); pw.setRequired(); addElement(pw); CMS_Form_Element_Submit submit = new CMS_Form_Element_Submit("submit"); submit.setLabel("Sign in"); addElement(submit); }
/// <summary> /// Constructor /// </summary> /// <param name="OriginalArticle">Edited article</param> public Form_Article_Edit(article OriginalArticle) { _action = new CMS_Action("/backend/editArticle?id="+OriginalArticle.id.ToString()); CMS_Form_Element_Textbox title = new CMS_Form_Element_Textbox("title"); title.setLabel("Title"); title.setRequired(); title.setValue(OriginalArticle.title); title.addValidator(new CMS_Validator_StringLength(0, 100)); this.addElement(title); CMS_Form_Element_Textarea perex = new CMS_Form_Element_Textarea("perex"); perex.setRequired(); perex.setValue(OriginalArticle.introtext); perex.setLabel("Introtext"); perex.setClass("ckeditor"); CMS_Validator_StringLength v = new CMS_Validator_StringLength(); v.setMaxLength(1000); perex.addValidator(v); this.addElement(perex); CMS_Form_Element_Textarea text = new CMS_Form_Element_Textarea("text"); text.setRequired(); text.setValue(OriginalArticle.fulltext); text.setLabel("Text"); text.setClass("ckeditor"); this.addElement(text); CMS_Form_Element_Select authors = new CMS_Form_Element_Select("authors"); authors.setIsMultiSelect(); authors.setLabel("Authors"); authors.setSize(4); authors.setRequired(); this.addElement(authors); CMS_Form_Element_Select categories = new CMS_Form_Element_Select("categories"); categories.setIsMultiSelect(); categories.setLabel("Categories"); categories.setSize(4); categories.setRequired(); this.addElement(categories); CMS_Form_Element_DateTime published = new CMS_Form_Element_DateTime("published"); published.setRequired(); published.setValue(OriginalArticle.date_published.ToString()); published.setLabel("Publish date"); this.addElement(published); CMS_Form_Element_DateTime pullback = new CMS_Form_Element_DateTime("pullback"); pullback.setLabel("Pullback date"); pullback.setValue(OriginalArticle.date_pullback.ToString()); this.addElement(pullback); CMS_Form_Element_Select roles = new CMS_Form_Element_Select("roles"); roles.setRequired(); roles.setLabel("Role with access to the article"); roles.setValue("1"); this.addElement(roles); CMS_Form_Element_File smallIcon = new CMS_Form_Element_File("smallIcon"); smallIcon.setRequired(); smallIcon.setLabel("Small icon"); this.addElement(smallIcon); CMS_Form_Element_File bigIcon = new CMS_Form_Element_File("bigIcon"); bigIcon.setRequired(); bigIcon.setLabel("Big icon"); this.addElement(bigIcon); CMS_Form_Element_Textbox tags = new CMS_Form_Element_Textbox("tags"); tags.setLabel("Tags (whitespace separated)"); this.addElement(tags); CMS_Form_Element_Select published_bool = new CMS_Form_Element_Select("published_bool"); published_bool.addOption("0", "No"); published_bool.addOption("1", "Yes"); published_bool.setLabel("Published state"); published_bool.setValue(OriginalArticle.published.ToString()); this.addElement(published_bool); CMS_Form_Element_Submit submit = new CMS_Form_Element_Submit("submit"); submit.setLabel("Save the article"); this.addElement(submit); }