예제 #1
0
    public void Mode_AddBroadcast()
    {
        Controls.AddLiteral("<div class=\"toolbar\">");
        Controls.AddLiteral("<a href=\"", this.ModuleRoot, "\" title=\"Обратно к списку трансляций\">< К списку трансляций</a>");
        Controls.AddLiteral("</div>");

        ExFormDataAdapter form = new ExFormDataAdapter("Трансляция", "BROADCASTING", "media");
        form.AddField("ExFieldString", "NAME", "Название", DBUtils.ValueTrue, "TEXT")
            .AddField("ExFieldDateTime", "START_DATE", "Начало", DBUtils.ValueTrue)
            .AddField("ExFieldDateTime", "END_DATE", "Конец", DBUtils.ValueTrue)
            .AddField("ExFieldHtmlText", "DESCRIPTION", "Описание", DBUtils.ValueFalse, "TEXT");
        form.RecordID = -1;
        form.Initialise();
        form.OnAfterInsert += (object sender, IdEventArgs e) => HttpContext.Current.Response.Redirect(String.Concat(ModuleRoot, "/editbroadcast/", e.ID));

        Controls.Add(form);
    }
예제 #2
0
    public void Mode_EditBroadcast(WebModuleParams wmp)
    {
        Int32 castid = Int32.Parse(wmp["editbroadcast"]);

        Controls.AddLiteral("<div class=\"toolbar\">");
        Controls.AddLiteral("<a href=\"", this.ModuleRoot, "\" title=\"", Lang["navbar.root.title"], "\">", Lang["navbar.root"], "</a>");
        Controls.AddLiteral(" | <a href=\"", this.ModuleRoot, "/cast/", castid, "\" title=\"", Lang["navbar.view.title"], "\">", Lang["navbar.view"], "</a>");
        Controls.AddLiteral("</div>");

        String name = new DataAdapter().Select("NAME").From("BROADCASTING").JoinExt("TEXT").Where("ID = @castid")
            .AddParametr("@castid", castid)
            .GetDataScalar() as String ?? "noname";
        Controls.AddLiteral("<h1>", name, "</h1>");

        Controls.AddLiteral("<div id=\"Sites_video_broadcasting_chanel_tabs\" style=\"display:none;\">");
        Controls.AddLiteral("<ul>");
        Controls.AddLiteral("<li><a href=\"#tab-1\">", Lang["tab.common"], "</a></li>");
        Controls.AddLiteral("<li><a href=\"#tab-2\">", Lang["tab.streams"], "</a></li>");
        Controls.AddLiteral("<li><a href=\"#tab-3\">", Lang["tab.conversation"], "</a></li>");
        Controls.AddLiteral("</ul>");

        Controls.AddLiteral("<div id=\"tab-1\">");
        ExFormDataAdapter form = new ExFormDataAdapter(Lang["form.title"], "BROADCASTING", "media");
        form.AddField("ExFieldLanguageString", "NAME", Lang["form.name"], DBUtils.ValueTrue, "TEXT")
            .AddField("ExFieldDateTime", "START_DATE", Lang["form.start"], DBUtils.ValueTrue)
            .AddField("ExFieldDateTime", "END_DATE", Lang["form.end"], DBUtils.ValueTrue)
            .AddField("ExFieldLanguageHtmlText", "DESCRIPTION", Lang["form.description"], DBUtils.ValueFalse, "TEXT");
        form.RecordID = castid;
        form.Initialise();
        form.DataForm.SubmitText = Lang["form.submit"];
        Controls.Add(form);
        Controls.AddLiteral("</div>");

        // потоки
        Controls.AddLiteral("<div id=\"tab-2\">");
        Controls.AddLiteral("<table id=\"stream-list\"><tr><td/></tr></table>");
        Controls.AddLiteral("<div id=\"stream-list-pager\"></div>");
        Controls.AddLiteral("</div>");

        // чат
        Controls.AddLiteral("<div id=\"tab-3\" class=\"ExForm\">");
        Controls.AddLiteral("<fieldset>");
        Controls.AddLiteral("<legend>", Lang["conversation.form.title"], "</legend>");
        Controls.AddLiteral("<div><input type=\"checkbox\" name=\"stream-conversation-enable\" id=\"stream-conversation-enable\" /> <label for=\"stream-conversation-enable\">", Lang["conversation.form.contol"], "</label></div>");
        Controls.AddLiteral("<div class=\"optional\">");
        Controls.AddLiteral("<div><input type=\"checkbox\" name=\"stream-conversation-allow\" id=\"stream-conversation-allow\" /> <label for=\"stream-conversation-allow\">", Lang["conversation.form.enable"], "</label></div>");
        Controls.AddLiteral("<table>");
        Controls.AddLiteral("<tr>");
        Controls.AddLiteral("<td>", Lang["conversation.form.header"], "</td>");
        Controls.AddLiteral("<td class=\"Multilang\">");
        Controls.AddLiteral("<label><span class=\"langname\">ru:</span><input type=\"text\" name=\"stream-conversation-h1-ru\" id=\"stream-conversation-h1-ru\" /></label>");
        Controls.AddLiteral("<label><span class=\"langname\">en:</span><input type=\"text\" name=\"stream-conversation-h1-en\" id=\"stream-conversation-h1-en\" /></label>");
        Controls.AddLiteral("</td>");
        Controls.AddLiteral("</tr>");
        Controls.AddLiteral("<tr>");
        Controls.AddLiteral("<td>", Lang["conversation.form.description"], "</td>");
        Controls.AddLiteral("<td class=\"Multilang\">");
        Controls.AddLiteral("<label><span class=\"langname\">ru:</span><input type=\"text\" name=\"stream-conversation-h2-ru\" id=\"stream-conversation-h2-ru\" /></label>");
        Controls.AddLiteral("<label><span class=\"langname\">en:</span><input type=\"text\" name=\"stream-conversation-h2-en\" id=\"stream-conversation-h2-en\" /></label>");
        Controls.AddLiteral("</td>");
        Controls.AddLiteral("</tr>");
        Controls.AddLiteral("</table>");
        Controls.AddLiteral("<div class=\"button-place\"><input type=\"button\" name=\"stream-conversation-save\" id=\"stream-conversation-save\" value=\"", Lang["form.submit"], "\" /></div>");
        Controls.AddLiteral("</div>");
        Controls.AddLiteral("</fieldset>");
        Controls.AddLiteral("</div>");

        Controls.AddLiteral("</div>");

        scripts.Add("/tools/JavaScript/jquery.js");
        scripts.Add("/tools/JavaScript/jquery-ui.js");
        scripts.Add(String.Concat("/tools/JavaScript/jquery-jqGrid-i18n/grid.locale-", Lang["lang"], ".js"));
        scripts.Add("/tools/JavaScript/jquery.jqGrid.js");
        scripts.Add("/tools/JavaScript/rpc.js");
        scripts.Add("/sites/video.mineralogy.ru/broadcasing-editor.js");

        ScriptControlDescriptor sd = new ScriptControlDescriptor("IWCtrls.BroadcasctingEditor", "Sites_video_broadcasting_chanel_tabs");
        sd.AddProperty("BroadcastingId", castid);
        sd.AddProperty("xlang", Lang.SerialiseJson());
        sdescriptions.Add(sd);
    }