当前位置: 首页>>代码示例>>C#>>正文


C# Language_Support_Info.Get_Translation方法代码示例

本文整理汇总了C#中SobekCM.Library.Application_State.Language_Support_Info.Get_Translation方法的典型用法代码示例。如果您正苦于以下问题:C# Language_Support_Info.Get_Translation方法的具体用法?C# Language_Support_Info.Get_Translation怎么用?C# Language_Support_Info.Get_Translation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SobekCM.Library.Application_State.Language_Support_Info的用法示例。


在下文中一共展示了Language_Support_Info.Get_Translation方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Menu_Get_Nav_Bar_HTML

        /// <summary> Returns the HTML for one element within tab which appears over the search box in the collection view </summary>
        /// <param name="ThisView"> Collection view type for this tab </param>
        /// <param name="Current_Mode"> Mode / navigation information for the current request, to see if the tab is currently selected or not and determine current skin language </param>
        /// <param name="Translations"> Language support object for writing the name of the view in the appropriate interface language </param>
        /// <returns> HTML to display the tab, including the link if it is not currently selected </returns>
        public static string Menu_Get_Nav_Bar_HTML(Item_Aggregation.CollectionViewsAndSearchesEnum ThisView, SobekCM_Navigation_Object Current_Mode, Language_Support_Info Translations )
        {
            string skinCode = Current_Mode.Base_Skin;

            switch (ThisView)
            {
                case Item_Aggregation.CollectionViewsAndSearchesEnum.Advanced_Search:
                case Item_Aggregation.CollectionViewsAndSearchesEnum.Advanced_Search_YearRange:
                    return Menu_HTML_Helper(skinCode, Search_Type_Enum.Advanced, Translations.Get_Translation("ADVANCED SEARCH", Current_Mode.Language), Current_Mode);

                case Item_Aggregation.CollectionViewsAndSearchesEnum.Basic_Search:
                case Item_Aggregation.CollectionViewsAndSearchesEnum.Basic_Search_YearRange:
                    return Menu_HTML_Helper(skinCode, Search_Type_Enum.Basic, Translations.Get_Translation("BASIC SEARCH", Current_Mode.Language), Current_Mode);

                case Item_Aggregation.CollectionViewsAndSearchesEnum.Map_Search:
                    return Menu_HTML_Helper(skinCode, Search_Type_Enum.Map, Translations.Get_Translation("MAP SEARCH", Current_Mode.Language), Current_Mode);

                case Item_Aggregation.CollectionViewsAndSearchesEnum.Map_Search_Beta:
                    return Menu_HTML_Helper(skinCode, Search_Type_Enum.Map_Beta, Translations.Get_Translation("MAP SEARCH", Current_Mode.Language), Current_Mode);

                case Item_Aggregation.CollectionViewsAndSearchesEnum.Newspaper_Search:
                    return Menu_HTML_Helper(skinCode, Search_Type_Enum.Newspaper, Translations.Get_Translation("NEWSPAPER SEARCH", Current_Mode.Language), Current_Mode);

                case Item_Aggregation.CollectionViewsAndSearchesEnum.Admin_View:
                    return String.Empty; // HTML_Helper(Skin_Code, SobekCM.Library.Navigation.Search_Type_Enum.Admin_View, Translations.Get_Translation("ADMIN", Current_Mode.Language), Current_Mode, Downward_Tabs);

                case Item_Aggregation.CollectionViewsAndSearchesEnum.DLOC_FullText_Search:
                    return Menu_HTML_Helper(skinCode, Search_Type_Enum.dLOC_Full_Text, Translations.Get_Translation("TEXT SEARCH", Current_Mode.Language), Current_Mode);

                case Item_Aggregation.CollectionViewsAndSearchesEnum.FullText_Search:
                    return Menu_HTML_Helper(skinCode, Search_Type_Enum.Full_Text, Translations.Get_Translation("TEXT SEARCH", Current_Mode.Language), Current_Mode);
            }

            return String.Empty;
        }
开发者ID:randomyed,项目名称:SobekCM-Web-Application,代码行数:40,代码来源:Aggregation_Nav_Bar_HTML_Factory.cs

示例2: render_helper

        /// <summary> Method helps to render all simple text box based elements </summary>
        /// <param name="Output"> Output for the generated html for this element </param>
        /// <param name="instance_value"> Value for the current digital resource to display</param>
        /// <param name="Skin_Code"> Code for the current html skin </param>
        /// <param name="Current_User"> Current user, who's rights may impact the way an element is rendered </param>
        /// <param name="CurrentLanguage"> Current user-interface language </param>
        /// <param name="Translator"> Language support object which handles simple translational duties </param>
        /// <param name="Base_URL"> Base URL for the current request </param>
        protected void render_helper(TextWriter Output, bool instance_value, string Skin_Code, User_Object Current_User, Web_Language_Enum CurrentLanguage, Language_Support_Info Translator, string Base_URL)
        {
            Output.WriteLine("  <!-- " + Title + " Element -->");
            Output.WriteLine("  <tr align=\"left\">");
            Output.WriteLine("    <td width=\"" + LEFT_MARGIN + "px\">&nbsp;</td>");

            // Get the label to show
            string label_to_show = Title.Replace(":", "");

            if (Acronym.Length > 0)
            {
                Output.WriteLine("    <td valign=\"top\" class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\"><acronym title=\"" + Acronym + "\">" + Translator.Get_Translation(label_to_show, CurrentLanguage) + ":</acronym></a></td>");
            }
            else
            {
                Output.WriteLine("    <td valign=\"top\" class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\">" + Translator.Get_Translation(label_to_show, CurrentLanguage) + ":</a></td>");
            }

            Output.WriteLine("    <td>");
            Output.WriteLine("      <table>");
            Output.WriteLine("        <tr>");
            Output.WriteLine("          <td>");
            if (!instance_value)
            {
                Output.WriteLine("            <input type=\"checkbox\" name=\"" + html_element_name + "\" id=\"" + html_element_name + "\"><label for=\"" + html_element_name + "\">" + checkBoxText + "</label>");
            }
            else
            {
                Output.WriteLine("            <input type=\"checkbox\" name=\"" + html_element_name + "\" id=\"" + html_element_name + "\" checked=\"checked\"><label for=\"" + html_element_name + "\">" + checkBoxText + "</label>");
            }
            Output.WriteLine("          </td>");
            Output.WriteLine("          <td valign=\"bottom\" >");

            Output.WriteLine("            <a target=\"_" + html_element_name.ToUpper() + "\"  title=\"" + Translator.Get_Translation("Get help.", CurrentLanguage) + "\" href=\"" + Help_URL(Skin_Code, Base_URL) + "\" ><img border=\"0px\" class=\"help_button\" src=\"" + Base_URL + HELP_BUTTON_URL + "\" /></a>");

            Output.WriteLine("          </td>");
            Output.WriteLine("        </tr>");
            Output.WriteLine("      </table>");

            Output.WriteLine("    </td>");

            Output.WriteLine("  </tr>");
            Output.WriteLine();
        }
开发者ID:randomyed,项目名称:SobekCM-Web-Application,代码行数:52,代码来源:checkBox_Element.cs

示例3: Get_Nav_Bar_HTML

        /// <summary> Returns the HTML for one tab which appears over the search box in the collection view </summary>
        /// <param name="thisView"> Collection view type for this tab </param>
        /// <param name="Current_Mode"> Mode / navigation information for the current request, to see if the tab is currently selected or not and determine current skin language </param>
        /// <param name="Translations"> Language support object for writing the name of the view in the appropriate interface language </param>
        /// <param name="Downward_Tabs"> Flag indicates if this tab faces downward, rather than the default upward </param>
        /// <returns> HTML to display the tab, including the link if it is not currently selected </returns>
        public static string Get_Nav_Bar_HTML( Item_Aggregation.CollectionViewsAndSearchesEnum thisView, SobekCM_Navigation_Object Current_Mode, Language_Support_Info Translations, bool Downward_Tabs )
        {
            string skinCode = Current_Mode.Base_Skin;

            switch (thisView)
            {
                case Item_Aggregation.CollectionViewsAndSearchesEnum.Advanced_Search:
                    if (Current_Mode.Is_Robot)
                    {
                        return "<img src=\"" + Current_Mode.Base_URL + "design/skins/" + skinCode + "/tabs/cL.gif\" border=\"0\" class=\"tab_image\" alt=\"\" /><span class=\"tab\"> ADVANCED SEARCH </span><img src=\"" + Current_Mode.Base_URL + "design/skins/" + skinCode + "/tabs/cR.gif\" border=\"0\" class=\"tab_image\" alt=\"\" />" + Environment.NewLine ;
                    }
                    return HTML_Helper(skinCode, Search_Type_Enum.Advanced, Translations.Get_Translation("ADVANCED SEARCH", Current_Mode.Language), Current_Mode, Downward_Tabs);

                case Item_Aggregation.CollectionViewsAndSearchesEnum.Basic_Search:
                    return HTML_Helper(skinCode, Search_Type_Enum.Basic, Translations.Get_Translation("BASIC SEARCH", Current_Mode.Language), Current_Mode, Downward_Tabs);

                case Item_Aggregation.CollectionViewsAndSearchesEnum.Map_Search:
                    return HTML_Helper(skinCode, Search_Type_Enum.Map, Translations.Get_Translation("MAP SEARCH", Current_Mode.Language), Current_Mode, Downward_Tabs);

                case Item_Aggregation.CollectionViewsAndSearchesEnum.Newspaper_Search:
                    return HTML_Helper(skinCode, Search_Type_Enum.Newspaper, Translations.Get_Translation("NEWSPAPER SEARCH", Current_Mode.Language), Current_Mode, Downward_Tabs);

                case Item_Aggregation.CollectionViewsAndSearchesEnum.Admin_View:
                    return String.Empty; // HTML_Helper(Skin_Code, SobekCM.Library.Navigation.Search_Type_Enum.Admin_View, Translations.Get_Translation("ADMIN", Current_Mode.Language), Current_Mode, Downward_Tabs);

                case Item_Aggregation.CollectionViewsAndSearchesEnum.dLOC_FullText_Search:
                    return HTML_Helper(skinCode, Search_Type_Enum.dLOC_Full_Text, Translations.Get_Translation("TEXT SEARCH", Current_Mode.Language), Current_Mode, Downward_Tabs);

                case Item_Aggregation.CollectionViewsAndSearchesEnum.FullText_Search:
                    return HTML_Helper(skinCode, Search_Type_Enum.Full_Text, Translations.Get_Translation("TEXT SEARCH", Current_Mode.Language), Current_Mode, Downward_Tabs);
            }

            return String.Empty;
        }
开发者ID:randomyed,项目名称:SobekCM-Web-Application,代码行数:40,代码来源:Aggregation_Nav_Bar_HTML_Factory.cs

示例4: Render_Template_HTML

        /// <summary> Renders the HTML for this element </summary>
        /// <param name="Output"> Textwriter to write the HTML for this element </param>
        /// <param name="Bib"> Object to populate this element from </param>
        /// <param name="Skin_Code"> Code for the current skin </param>
        /// <param name="isMozilla"> Flag indicates if the current browse is Mozilla Firefox (different css choices for some elements)</param>
        /// <param name="popup_form_builder"> Builder for any related popup forms for this element </param>
        /// <param name="Current_User"> Current user, who's rights may impact the way an element is rendered </param>
        /// <param name="CurrentLanguage"> Current user-interface language </param>
        /// <param name="Translator"> Language support object which handles simple translational duties </param>
        /// <param name="Base_URL"> Base URL for the current request </param>
        /// <remarks> This element appends a popup form to the popup_form_builder</remarks>
        public override void Render_Template_HTML(TextWriter Output, SobekCM_Item Bib, string Skin_Code, bool isMozilla, StringBuilder popup_form_builder, User_Object Current_User, Web_Language_Enum CurrentLanguage, Language_Support_Info Translator, string Base_URL )
        {
            // Check that an acronym exists
            if (Acronym.Length == 0)
            {
                const string defaultAcronym = "Select the resource type information which best describes this material.";
                switch (CurrentLanguage)
                {
                    case Web_Language_Enum.English:
                        Acronym = defaultAcronym;
                        break;

                    case Web_Language_Enum.Spanish:
                        Acronym = defaultAcronym;
                        break;

                    case Web_Language_Enum.French:
                        Acronym = defaultAcronym;
                        break;

                    default:
                        Acronym = defaultAcronym;
                        break;
                }
            }

             // Determine the material type
            string instance_value = "Select Material Type";
            bool initial_value = true;
            string thisType = Bib.Bib_Info.SobekCM_Type_String;
            if (thisType.Length > 0)
            {
                if (thisType.ToUpper() != "PROJECT")
                {
                    instance_value = thisType;
                    initial_value = false;
                }
                else
                {
                    if (Bib.Bib_Info.Notes_Count > 0)
                    {
                        foreach (Note_Info thisNote in Bib.Bib_Info.Notes)
                        {
                            if (thisNote.Note_Type == Note_Type_Enum.default_type)
                            {
                                instance_value = thisNote.Note;
                                initial_value = false;
                                break;
                            }
                        }
                    }
                }
            }

            if ((instance_value.Length == 0) && (default_values.Count > 0))
            {
                instance_value = default_values[0];
            }

            // Render the title
            Output.WriteLine("  <!-- " + Title + " Form Element -->");
            Output.WriteLine("  <tr align=\"left\">");
            Output.WriteLine("    <td width=\"" + LEFT_MARGIN + "px\">&nbsp;</td>");
            if (Acronym.Length > 0)
            {
                Output.WriteLine("    <td valign=\"top\" class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\"><acronym title=\"" + Acronym + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</acronym></a></td>");
            }
            else
            {
                Output.WriteLine("    <td valign=\"top\" class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</a></td>");
            }

            Output.WriteLine("    <td>");
            Output.WriteLine("      <table>");
            Output.WriteLine("        <tr>");
            Output.WriteLine("          <td>");
            Output.WriteLine("            <div id=\"" + html_element_name + "_div\">");

            // Start the select combo box
            if (onChange.Length > 0)
            {
                if (initial_value)
                {
                    Output.WriteLine("              <select class=\"" + html_element_name + "_select_init\" name=\"form_typeformat_type\" id=\"form_typeformat_type\" onChange=\"" + onChange + "\" >");
                }
                else
                {
                    Output.WriteLine("              <select class=\"" + html_element_name + "_select\" name=\"form_typeformat_type\" id=\"form_typeformat_type\" onChange=\"" + onChange + "\" >");
                }
//.........这里部分代码省略.........
开发者ID:randomyed,项目名称:SobekCM-Web-Application,代码行数:101,代码来源:Type_Format_Form_Element.cs

示例5: Render_Template_HTML

        /// <summary> Renders the HTML for this element </summary>
        /// <param name="Output"> Textwriter to write the HTML for this element </param>
        /// <param name="Bib"> Object to populate this element from </param>
        /// <param name="Skin_Code"> Code for the current skin </param>
        /// <param name="IsMozilla"> Flag indicates if the current browse is Mozilla Firefox (different css choices for some elements)</param>
        /// <param name="PopupFormBuilder"> Builder for any related popup forms for this element </param>
        /// <param name="Current_User"> Current user, who's rights may impact the way an element is rendered </param>
        /// <param name="CurrentLanguage"> Current user-interface language </param>
        /// <param name="Translator"> Language support object which handles simple translational duties </param>
        /// <param name="Base_URL"> Base URL for the current request </param>
        /// <remarks> This element appends a popup form to the popup_form_builder</remarks>
        public override void Render_Template_HTML(TextWriter Output, SobekCM_Item Bib, string Skin_Code, bool IsMozilla, StringBuilder PopupFormBuilder, User_Object Current_User, Web_Language_Enum CurrentLanguage, Language_Support_Info Translator, string Base_URL )
        {
            // Check that an acronym exists
            if (Acronym.Length == 0)
            {
                const string DEFAULT_ACRONYM = "Enter spatial information about this material hierarchically.  This can either be the source or the subject of the material.";
                switch (CurrentLanguage)
                {
                    case Web_Language_Enum.English:
                        Acronym = DEFAULT_ACRONYM;
                        break;

                    case Web_Language_Enum.Spanish:
                        Acronym = DEFAULT_ACRONYM;
                        break;

                    case Web_Language_Enum.French:
                        Acronym = DEFAULT_ACRONYM;
                        break;

                    default:
                        Acronym = DEFAULT_ACRONYM;
                        break;
                }
            }

            Output.WriteLine("  <!-- " + Title + " Form Element -->");
            Output.WriteLine("  <tr>");
            Output.WriteLine("    <td style=\"width:" + LEFT_MARGIN + "px\">&nbsp;</td>");
            if (Acronym.Length > 0)
            {
                Output.WriteLine("    <td class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\"><acronym title=\"" + Acronym + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</acronym></a></td>");
            }
            else
            {
                Output.WriteLine("    <td class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</a></td>");
            }

            Output.WriteLine("    <td>");
            Output.WriteLine("      <table>");
            Output.WriteLine("        <tr>");
            Output.WriteLine("          <td>");
            Output.Write("      <div id=\"" + html_element_name + "_div\">");

            // Ensure there is at least one spatial subject
            bool found_spatial = false;
            if (Bib.Bib_Info.Subjects_Count > 0)
            {
                if (Bib.Bib_Info.Subjects.Any(ThisSubject => ThisSubject.Class_Type == Subject_Info_Type.Hierarchical_Spatial))
                {
                    found_spatial = true;
                }
            }
            if (!found_spatial)
            {
                Bib.Bib_Info.Add_Hierarchical_Geographic_Subject();
            }

            int subject_index = 1;
            if (Bib.Bib_Info.Subjects_Count > 0)
            {
                foreach (Subject_Info thisSubject in Bib.Bib_Info.Subjects)
                {

                    if (thisSubject.Class_Type == Subject_Info_Type.Hierarchical_Spatial)
                    {
                        Subject_Info_HierarchicalGeographic hieroSubject = (Subject_Info_HierarchicalGeographic)thisSubject;

                        // Add this subject linke
                        if (hieroSubject.hasData)
                            Output.Write("\n        <a title=\"Click to edit this hierarchical spatial information\" href=\"" + Base_URL + "l/technical/javascriptrequired\" onfocus=\"link_focused2('form_spatial_term_" + subject_index + "')\" onblur=\"link_blurred2('form_spatial_term_" + subject_index + "')\" onkeypress=\"return popup_keypress_focus('form_spatial_" + subject_index + "', 'formspatialcontinent_" + subject_index + "', '" + IsMozilla.ToString() + "' );\"  onclick=\"return popup_focus('form_spatial_" + subject_index + "', 'formspatialcontinent_" + subject_index + "' );\"><div class=\"form_linkline form_spatial_line\" id=\"form_spatial_term_" + subject_index + "\">" + hieroSubject + "</div></a>");
                        else
                            Output.Write("\n        <a title=\"Click to edit this hierarchical spatial information\" href=\"" + Base_URL + "l/technical/javascriptrequired\" onfocus=\"link_focused2('form_spatial_term_" + subject_index + "')\" onblur=\"link_blurred2('form_spatial_term_" + subject_index + "')\" onkeypress=\"return popup_keypress_focus('form_spatial_" + subject_index + "', 'formspatialcontinent_" + subject_index + "', '" + IsMozilla.ToString() + "' );\"  onclick=\"return popup_focus('form_spatial_" + subject_index + "', 'formspatialcontinent_" + subject_index + "' );\"><div class=\"form_linkline_empty form_spatial_line\" id=\"form_spatial_term_" + subject_index + "\"><i>Empty Spatial Coverage</i></div></a>");

                        // Add the popup form
                        PopupFormBuilder.AppendLine("<!-- Hierarchical Spatial Form " + subject_index + " -->");
                        PopupFormBuilder.AppendLine("<div class=\"spatial_popup_div sbkMetadata_PopupDiv\" id=\"form_spatial_" + subject_index + "\" style=\"display:none;\">");
                        PopupFormBuilder.AppendLine("  <div class=\"sbkMetadata_PopupTitle\"><table style=\"width:100%\"><tr><td style=\"text-align:left\">Edit Hierarchical Spatial</td><td style=\"text-align:right\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" alt=\"HELP\" target=\"_" + html_element_name.ToUpper() + "\" >?</a> &nbsp; <a href=\"#template\" alt=\"CLOSE\" onclick=\"close_spatial_form('form_spatial_" + subject_index + "')\">X</a> &nbsp; </td></tr></table></div>");
                        PopupFormBuilder.AppendLine("  <br />");
                        PopupFormBuilder.AppendLine("  <table class=\"sbkMetadata_PopupTable\">");

                        // Add the rows of data
                        PopupFormBuilder.AppendLine("    <tr><td style=\"width:100px;\">Continent:</td><td colspan=\"2\"><input class=\"formspatial_input sbk_Focusable\" name=\"formspatialcontinent_" + subject_index + "\" id=\"formspatialcontinent_" + subject_index + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(hieroSubject.Continent) + "\" /></td></tr>");
                        PopupFormBuilder.AppendLine("    <tr><td>Country:</td><td colspan=\"2\"><input class=\"formspatial_input sbk_Focusable\" name=\"formspatialcountry_" + subject_index + "\" id=\"formspatialcountry_" + subject_index + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(hieroSubject.Country) + "\" /></td></tr>");
                        PopupFormBuilder.AppendLine("    <tr><td>Province:</td><td colspan=\"2\"><input class=\"formspatial_input sbk_Focusable\" name=\"formspatialprovince_" + subject_index + "\" id=\"formspatialprovince_" + subject_index + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(hieroSubject.Province) + "\" /></td></tr>");
                        PopupFormBuilder.AppendLine("    <tr><td>Region:</td><td colspan=\"2\"><input class=\"formspatial_input sbk_Focusable\" name=\"formspatialregion_" + subject_index + "\" id=\"formspatialregion_" + subject_index + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(hieroSubject.Region) + "\" /></td></tr>");
                        PopupFormBuilder.AppendLine("    <tr><td>State:</td><td colspan=\"2\"><input class=\"formspatial_input sbk_Focusable\" name=\"formspatialstate_" + subject_index + "\" id=\"formspatialstate_" + subject_index + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(hieroSubject.State) + "\" /></td></tr>");
                        PopupFormBuilder.AppendLine("    <tr><td>Territory:</td><td colspan=\"2\"><input class=\"formspatial_input sbk_Focusable\" name=\"formspatialterritory_" + subject_index + "\" id=\"formspatialterritory_" + subject_index + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(hieroSubject.Territory) + "\" /></td></tr>");
                        PopupFormBuilder.AppendLine("    <tr><td>County:</td><td colspan=\"2\"><input class=\"formspatial_input sbk_Focusable\" name=\"formspatialcounty_" + subject_index + "\" id=\"formspatialcounty_" + subject_index + "\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(hieroSubject.County) + "\" /></td></tr>");
//.........这里部分代码省略.........
开发者ID:randomyed,项目名称:SobekCM-Web-Application,代码行数:101,代码来源:Hierarchical_Spatial_Form_Element.cs

示例6: Render_Template_HTML

        /// <summary> Renders the HTML for this element </summary>
        /// <param name="Output"> Textwriter to write the HTML for this element </param>
        /// <param name="Bib"> Object to populate this element from </param>
        /// <param name="Skin_Code"> Code for the current skin </param>
        /// <param name="isMozilla"> Flag indicates if the current browse is Mozilla Firefox (different css choices for some elements)</param>
        /// <param name="popup_form_builder"> Builder for any related popup forms for this element </param>
        /// <param name="Current_User"> Current user, who's rights may impact the way an element is rendered </param>
        /// <param name="CurrentLanguage"> Current user-interface language </param>
        /// <param name="Translator"> Language support object which handles simple translational duties </param>
        /// <param name="Base_URL"> Base URL for the current request </param>
        /// <remarks> This element appends a popup form to the popup_form_builder</remarks>
        public override void Render_Template_HTML(TextWriter Output, SobekCM_Item Bib, string Skin_Code, bool isMozilla, StringBuilder popup_form_builder, User_Object Current_User, Web_Language_Enum CurrentLanguage, Language_Support_Info Translator, string Base_URL )
        {
            // Check that an acronym exists
            if (Acronym.Length == 0)
            {
                const string defaultAcronym = "Enter each person or group which created this material. Personal names should be entered as [Family Name], [Given Name].";
                switch (CurrentLanguage)
                {
                    case Web_Language_Enum.English:
                        Acronym = defaultAcronym;
                        break;

                    case Web_Language_Enum.Spanish:
                        Acronym = defaultAcronym;
                        break;

                    case Web_Language_Enum.French:
                        Acronym = defaultAcronym;
                        break;

                    default:
                        Acronym = defaultAcronym;
                        break;
                }
            }

            // Render this in HTML
            Output.WriteLine("  <!-- " + Title + " Form Element -->");
            Output.WriteLine("  <tr align=\"left\">");
            Output.WriteLine("    <td width=\"" + LEFT_MARGIN + "px\">&nbsp;</td>");
            if (Acronym.Length > 0)
            {
                Output.WriteLine("    <td valign=\"top\" class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\"><acronym title=\"" + Acronym + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</acronym></a></td>");
            }
            else
            {
                Output.WriteLine("    <td valign=\"top\" class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</a></td>");
            }

            Output.WriteLine("    <td>");
            Output.WriteLine("      <table>");
            Output.WriteLine("        <tr>");
            Output.WriteLine("          <td>");
            Output.WriteLine("            <div class=\"form_name_div\">");

            // Collect all the names
            int name_count = 1;
            bool first_is_main = false;
            List<Name_Info> names = new List<Name_Info>();
            if (( Bib.Bib_Info.hasMainEntityName ) && ( Bib.Bib_Info.Main_Entity_Name.hasData))
            {
                names.Add(Bib.Bib_Info.Main_Entity_Name);
                first_is_main = true;
            }
            if (Bib.Bib_Info.Names_Count > 0)
            {
                names.AddRange(Bib.Bib_Info.Names);
            }

            // There should always be one name at least
            if (names.Count == 0)
                names.Add(new Name_Info());

            // Step through and create the popup forms and inks
            foreach (Name_Info thisName in names)
            {
                // Add the link for the other title
                string thisNameText = thisName.ToString();
                if (!thisName.hasData)
                {
                    thisNameText = "<i>Empty Name</i>";
                    Output.WriteLine("              <a title=\"Click to edit this named entity\" href=\"" + Base_URL + "l/technical/javascriptrequired\" onfocus=\"link_focused2('form_name_line_" + name_count + "')\" onblur=\"link_blurred2('form_name_line_" + name_count + "')\" onkeypress=\"return popup_keypress_focus('form_name_" + name_count + "', 'form_name_line_" + name_count + "', 'form_name_full_" + name_count + "', 375, 700, '" + isMozilla.ToString() + "' );\" onclick=\"return popup_focus('form_name_" + name_count + "', 'form_name_line_" + name_count + "', 'form_name_full_" + name_count + "', 375, 700 );\"><div class=\"form_linkline_empty form_name_line\" id=\"form_name_line_" + name_count + "\">" + thisNameText + "</div></a>");

                }
                else
                {
                    Output.WriteLine("              <a title=\"Click to edit this named entity\" href=\"" + Base_URL + "l/technical/javascriptrequired\" onfocus=\"link_focused2('form_name_line_" + name_count + "')\" onblur=\"link_blurred2('form_name_line_" + name_count + "')\" onkeypress=\"return popup_keypress_focus('form_name_" + name_count + "', 'form_name_line_" + name_count + "', 'form_name_full_" + name_count + "', 375, 700, '" + isMozilla.ToString() + "' );\" onclick=\"return popup_focus('form_name_" + name_count + "', 'form_name_line_" + name_count + "', 'form_name_full_" + name_count + "', 375, 700 );\"><div class=\"form_linkline form_name_line\" id=\"form_name_line_" + name_count + "\">" + thisNameText + "</div></a>");
                }

                // Determine if this is a personal name
                string personal_values_display = "none";
                string description_location_display = "Location";
                string form_class = "name_popup_div";
                if ((thisName.Name_Type == Name_Info_Type_Enum.personal) || ( thisName.Name_Type == Name_Info_Type_Enum.UNKNOWN ))
                {
                    personal_values_display = "inline";
                    description_location_display = "Description";
                    form_class = "name_popup_div_personal";
                }
//.........这里部分代码省略.........
开发者ID:randomyed,项目名称:SobekCM-Web-Application,代码行数:101,代码来源:Name_Form_Element.cs

示例7: Render_Template_HTML

        /// <summary> Renders the HTML for this element </summary>
        /// <param name="Output"> Textwriter to write the HTML for this element </param>
        /// <param name="Bib"> Object to populate this element from </param>
        /// <param name="Skin_Code"> Code for the current skin </param>
        /// <param name="IsMozilla"> Flag indicates if the current browse is Mozilla Firefox (different css choices for some elements)</param>
        /// <param name="PopupFormBuilder"> Builder for any related popup forms for this element </param>
        /// <param name="Current_User"> Current user, who's rights may impact the way an element is rendered </param>
        /// <param name="CurrentLanguage"> Current user-interface language </param>
        /// <param name="Translator"> Language support object which handles simple translational duties </param>
        /// <param name="Base_URL"> Base URL for the current request </param>
        /// <remarks> This element appends a popup form to the popup_form_builder</remarks>
        public override void Render_Template_HTML(TextWriter Output, SobekCM_Item Bib, string Skin_Code, bool IsMozilla, StringBuilder PopupFormBuilder, User_Object Current_User, Web_Language_Enum CurrentLanguage, Language_Support_Info Translator, string Base_URL)
        {
            // Check that an acronym exists
            if (Acronym.Length == 0)
            {
                const string DEFAULT_ACRONYM = "Enter serial hierarchy information which explains how this volume related to the larger body of work.";
                switch (CurrentLanguage)
                {
                    case Web_Language_Enum.English:
                        Acronym = DEFAULT_ACRONYM;
                        break;

                    case Web_Language_Enum.Spanish:
                        Acronym = DEFAULT_ACRONYM;
                        break;

                    case Web_Language_Enum.French:
                        Acronym = DEFAULT_ACRONYM;
                        break;

                    default:
                        Acronym = DEFAULT_ACRONYM;
                        break;
                }
            }

            Output.WriteLine("  <!-- " + Title + " Form Element -->");
            Output.WriteLine("  <tr>");
            Output.WriteLine("    <td style=\"width:" + LEFT_MARGIN + "px\">&nbsp;</td>");
            if (Acronym.Length > 0)
            {
                Output.WriteLine("    <td class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\"><acronym title=\"" + Acronym + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</acronym></a></td>");
            }
            else
            {
                Output.WriteLine("    <td class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</a></td>");
            }

            Output.WriteLine("    <td>");
            Output.WriteLine("      <table>");

            Output.WriteLine("    <tr><td>&nbsp;</td><td><span style=\"color:Gray;padding-left:55px;\">Display Text</span></td><td><span style=\"color:Gray;\"> &nbsp; Display Order</span></td></tr>");

            // Add the rows of enumeration data
            Output.WriteLine("    <tr><td style=\"width:100px\">Level 1:</td>");
            if (Bib.Behaviors.Serial_Info.Count > 0)
            {
                Output.WriteLine("<td><input type=\"text\" class=\"form_serialhierarchy_text_input sbk_Focusable\" id=\"form_serialhierarchy_enum1text\" name=\"form_serialhierarchy_enum1text\" value=\"" + HttpUtility.HtmlEncode(Bib.Behaviors.Serial_Info[0].Display) + "\" /></td>");
                Output.WriteLine("<td><input type=\"text\" class=\"form_serialhierarchy_order_input sbk_Focusable\" id=\"form_serialhierarchy_enum1order\" name=\"form_serialhierarchy_enum1order\" value=\"" + HttpUtility.HtmlEncode(Bib.Behaviors.Serial_Info[0].Order.ToString()) + "\" /></td></tr>");
            }
            else
            {
                Output.WriteLine("<td><input type=\"text\" class=\"form_serialhierarchy_text_input sbk_Focusable\" id=\"form_serialhierarchy_enum1text\" name=\"form_serialhierarchy_enum1text\" value=\"\" /></td>");
                Output.WriteLine("<td><input type=\"text\" class=\"form_serialhierarchy_order_input sbk_Focusable\" id=\"form_serialhierarchy_enum1order\" name=\"form_serialhierarchy_enum1order\" value=\"\" /></td></tr>");
            }

            Output.WriteLine("    <tr><td>Level 2:</td>");
            if (Bib.Behaviors.Serial_Info.Count > 1)
            {
                Output.WriteLine("<td><input type=\"text\" class=\"form_serialhierarchy_text_input sbk_Focusable\" id=\"form_serialhierarchy_enum2text\" name=\"form_serialhierarchy_enum2text\" value=\"" + HttpUtility.HtmlEncode(Bib.Behaviors.Serial_Info[1].Display) + "\"  /></td>");
                Output.WriteLine("<td><input type=\"text\" class=\"form_serialhierarchy_order_input sbk_Focusable\" id=\"form_serialhierarchy_enum2order\" name=\"form_serialhierarchy_enum2order\" value=\"" + HttpUtility.HtmlEncode(Bib.Behaviors.Serial_Info[1].Order.ToString()) + "\" /></td></tr>");
            }
            else
            {
                Output.WriteLine("<td><input type=\"text\" class=\"form_serialhierarchy_text_input sbk_Focusable\" id=\"form_serialhierarchy_enum2text\" name=\"form_serialhierarchy_enum2text\" value=\"\" /></td>");
                Output.WriteLine("<td><input type=\"text\" class=\"form_serialhierarchy_order_input sbk_Focusable\" id=\"form_serialhierarchy_enum2order\" name=\"form_serialhierarchy_enum2order\" value=\"\" /></td></tr>");
            }

            Output.WriteLine("    <tr><td>Level 3:</td>");
            if (Bib.Behaviors.Serial_Info.Count > 2)
            {
                Output.WriteLine("<td><input type=\"text\" class=\"form_serialhierarchy_text_input sbk_Focusable\" id=\"form_serialhierarchy_enum3text\" name=\"form_serialhierarchy_enum3text\" value=\"" + HttpUtility.HtmlEncode(Bib.Behaviors.Serial_Info[2].Display) + "\" /></td>");
                Output.WriteLine("<td><input type=\"text\" class=\"form_serialhierarchy_order_input sbk_Focusable\" id=\"form_serialhierarchy_enum3order\" name=\"form_serialhierarchy_enum3order\" value=\"" + HttpUtility.HtmlEncode(Bib.Behaviors.Serial_Info[2].Order.ToString()) + "\" /></td></tr>");
            }
            else
            {
                Output.WriteLine("<td><input type=\"text\" class=\"form_serialhierarchy_text_input sbk_Focusable\" id=\"form_serialhierarchy_enum3text\" name=\"form_serialhierarchy_enum3text\" value=\"\" /></td>");
                Output.WriteLine("<td><input type=\"text\" class=\"form_serialhierarchy_order_input sbk_Focusable\" id=\"form_serialhierarchy_enum3order\" name=\"form_serialhierarchy_enum3order\" value=\"\" /></td></tr>");
            }

            Output.WriteLine("      </table>");
            Output.WriteLine("    </td>");
            Output.WriteLine("  </tr>");
            Output.WriteLine();

            //// Determine which is primary, the enumeration or chronology.
            //bool enum_primary = true;
            //if (Bib.Serial_Info.Count > 0)
            //{
//.........这里部分代码省略.........
开发者ID:randomyed,项目名称:SobekCM-Web-Application,代码行数:101,代码来源:Serial_Hierarchy_Panel_Element.cs

示例8: Render_Template_HTML

        /// <summary> Renders the HTML for this element </summary>
        /// <param name="Output"> Textwriter to write the HTML for this element </param>
        /// <param name="Bib"> Object to populate this element from </param>
        /// <param name="Skin_Code"> Code for the current skin </param>
        /// <param name="IsMozilla"> Flag indicates if the current browse is Mozilla Firefox (different css choices for some elements)</param>
        /// <param name="PopupFormBuilder"> Builder for any related popup forms for this element </param>
        /// <param name="Current_User"> Current user, who's rights may impact the way an element is rendered </param>
        /// <param name="CurrentLanguage"> Current user-interface language </param>
        /// <param name="Translator"> Language support object which handles simple translational duties </param>
        /// <param name="Base_URL"> Base URL for the current request </param>
        /// <remarks> This element appends a popup form to the popup_form_builder</remarks>
        public override void Render_Template_HTML(TextWriter Output, SobekCM_Item Bib, string Skin_Code, bool IsMozilla, StringBuilder PopupFormBuilder, User_Object Current_User, Web_Language_Enum CurrentLanguage, Language_Support_Info Translator, string Base_URL )
        {
            // Check that an acronym exists
            if (Acronym.Length == 0)
            {
                const string DEFAULT_ACRONYM = "Enter information for any electronic finding guide to which this material belongs.";
                switch (CurrentLanguage)
                {
                    case Web_Language_Enum.English:
                        Acronym = DEFAULT_ACRONYM;
                        break;

                    case Web_Language_Enum.Spanish:
                        Acronym = DEFAULT_ACRONYM;
                        break;

                    case Web_Language_Enum.French:
                        Acronym = DEFAULT_ACRONYM;
                        break;

                    default:
                        Acronym = DEFAULT_ACRONYM;
                        break;
                }
            }

            Output.WriteLine("  <!-- " + Title + " Form Element -->");
            Output.WriteLine("  <tr>");
            Output.WriteLine("    <td style=\"width:" + LEFT_MARGIN + "px\">&nbsp;</td>");
            if (Acronym.Length > 0)
            {
                Output.WriteLine("    <td class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\"><acronym title=\"" + Acronym + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</acronym></a></td>");
            }
            else
            {
                Output.WriteLine("    <td class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</a></td>");
            }

            Output.WriteLine("    <td>");
            Output.WriteLine("      <table>");
            Output.WriteLine("        <tr>");
            Output.WriteLine("          <td>");
            Output.WriteLine("            <div id=\"" + html_element_name + "_div\">");

            // Write the EAD popup link
            if (( !Bib.Bib_Info.hasLocationInformation ) || ((Bib.Bib_Info.Location.EAD_Name.Length == 0) && (Bib.Bib_Info.Location.EAD_URL.Length == 0 )))
            {
                Output.Write("              <a title=\"Click to edit the related EAD information\" href=\"" + Base_URL + "l/technical/javascriptrequired\" onfocus=\"link_focused2('form_ead_term')\" onblur=\"link_blurred2('form_ead_term')\" onkeypress=\"return popup_keypress_focus('form_ead', 'formead_name', '" + IsMozilla.ToString() + "' );\" onclick=\"return popup_focus('form_ead', 'formead_name' );\"><div class=\"form_linkline_empty form_ead_line\" id=\"form_ead_term\">");
                Output.Write("<i>Empty Related EAD</i>");
            }
            else
            {
                Output.Write("              <a title=\"Click to edit the related EAD information\" href=\"" + Base_URL + "l/technical/javascriptrequired\" onfocus=\"link_focused2('form_ead_term')\" onblur=\"link_blurred2('form_ead_term')\" onkeypress=\"return popup_keypress_focus('form_ead', 'formead_name', '" + IsMozilla.ToString() + "' );\" onclick=\"return popup_focus('form_ead', 'formead_name' );\"><div class=\"form_linkline form_ead_line\" id=\"form_ead_term\">");
                Output.Write(Bib.Bib_Info.Location.EAD_Name.Length > 0
                                 ? HttpUtility.HtmlEncode(Bib.Bib_Info.Location.EAD_Name)
                                 : HttpUtility.HtmlEncode(Bib.Bib_Info.Location.EAD_URL));
            }
            Output.WriteLine("</div></a>");
            Output.WriteLine("              </div>");
            Output.WriteLine("          </td>");
            Output.WriteLine("          <td style=\"vertical-align:bottom\" >");
            Output.WriteLine("            <a target=\"_" + html_element_name.ToUpper() + "\"  title=\"" + Translator.Get_Translation("Get help.", CurrentLanguage) + "\" href=\"" + Help_URL(Skin_Code, Base_URL) + "\" ><img class=\"help_button\" src=\"" + Base_URL + HELP_BUTTON_URL + "\" /></a>");
            Output.WriteLine("          </td>");
            Output.WriteLine("        </tr>");
            Output.WriteLine("      </table>");
            Output.WriteLine("    </td>");
            Output.WriteLine("  </tr>");
            Output.WriteLine();

            // Add the popup form
            PopupFormBuilder.AppendLine("<!-- Related EAD Form -->");
            PopupFormBuilder.AppendLine("<div class=\"ead_popup_div sbkMetadata_PopupDiv\" id=\"form_ead\" style=\"display:none;\">");
            PopupFormBuilder.AppendLine("  <div class=\"sbkMetadata_PopupTitle\"><table style=\"width:100%\"><tr><td style=\"text-align:left\">Edit Related EAD / Finding Guide</td><td style=\"text-align:right\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" alt=\"HELP\" target=\"_" + html_element_name.ToUpper() + "\" >?</a> &nbsp; <a href=\"#template\" alt=\"CLOSE\" onclick=\"close_ead_form()\">X</a> &nbsp; </td></tr></table></div>");
            PopupFormBuilder.AppendLine("  <br />");
            PopupFormBuilder.AppendLine("  <table class=\"sbkMetadata_PopupTable\">");

            // Add the rows of data
            PopupFormBuilder.AppendLine("    <tr><td style=\"width:90px\">EAD Name:</td><td><input class=\"formead_input sbk_Focusable\" name=\"formead_name\" id=\"formead_name\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(Bib.Bib_Info.Location.EAD_Name) + "\" /></td></tr>");
            PopupFormBuilder.AppendLine("    <tr><td>EAD URL:</td><td><input class=\"formead_input sbk_Focusable\" name=\"formead_url\" id=\"formead_url\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(Bib.Bib_Info.Location.EAD_URL) + "\" /></td></tr>");

            // Finish the popup form and add the CLOSE button
            PopupFormBuilder.AppendLine("    <tr style=\"height:35px; text-align: center; vertical-align: bottom;\">");
            PopupFormBuilder.AppendLine("      <td colspan=\"2\"><button title=\"Close\" class=\"sbkMetadata_RoundButton\" onclick=\"return close_ead_form();\">CLOSE</button></td>");
            PopupFormBuilder.AppendLine("    </tr>");
            PopupFormBuilder.AppendLine("  </table>");
            PopupFormBuilder.AppendLine("</div>");
            PopupFormBuilder.AppendLine();
        }
开发者ID:randomyed,项目名称:SobekCM-Web-Application,代码行数:99,代码来源:EAD_Form_Element.cs

示例9: render_helper

        /// <summary> Method helps to render all simple text box based elements </summary>
        /// <param name="Output"> Output for the generated html for this element </param>
        /// <param name="instance_values"> Value(s) for the current digital resource to display</param>
        /// <param name="Skin_Code"> Code for the current html skin </param>
        /// <param name="Current_User"> Current user, who's rights may impact the way an element is rendered </param>
        /// <param name="CurrentLanguage"> Current user-interface language </param>
        /// <param name="Translator"> Language support object which handles simple translational duties </param>
        /// <param name="Base_URL"> Base URL for the current request </param>
        /// <param name="HTML_ID_Name"> ID name used for these elements.  This is usually provided when there are multiple fixed-roles or fixed-type elements </param>
        protected void render_helper(TextWriter Output, ReadOnlyCollection<string> instance_values, string Skin_Code, User_Object Current_User, Web_Language_Enum CurrentLanguage, Language_Support_Info Translator, string Base_URL, string HTML_ID_Name)
        {
            List<string> allValues = new List<string>();
            allValues.AddRange(default_values);
            allValues.AddRange(instance_values);

            if (allValues.Count == 0)
            {
                render_helper(Output, String.Empty, Skin_Code, Current_User, CurrentLanguage, Translator, Base_URL, HTML_ID_Name);
                return;
            }

            if (allValues.Count == 1)
            {
                render_helper(Output, allValues[0], Skin_Code, Current_User, CurrentLanguage, Translator, Base_URL, HTML_ID_Name);
                return;
            }

            Output.WriteLine("  <!-- " + Title + " Element -->");
            Output.WriteLine("  <tr align=\"left\">");
            Output.WriteLine("    <td width=\"" + LEFT_MARGIN + "px\">&nbsp;</td>");
            if (Title.IndexOf(":") < 0)
            {
                if (Acronym.Length > 0)
                {
                    Output.WriteLine("    <td valign=\"top\" class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\"><acronym title=\"" + Acronym + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</acronym></a></td>");
                }
                else
                {
                    Output.WriteLine("    <td valign=\"top\" class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</a></td>");
                }
            }
            else
            {
                if (Acronym.Length > 0)
                {
                    Output.WriteLine("    <td valign=\"top\" class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\"><acronym title=\"" + Acronym + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + "</acronym></a></td>");
                }
                else
                {
                    Output.WriteLine("    <td valign=\"top\" class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + "</a></td>");
                }
            }

            if (Read_Only)
            {
                Output.WriteLine("    <td>");
                Output.WriteLine("      <table>");
                Output.WriteLine("        <tr>");
                Output.Write("          <td><div class=\"" + HTML_ID_Name + "_div\">");
                for (int i = 0; i < instance_values.Count; i++)
                {
                    Output.Write(instance_values[i]);
                    if (i < (instance_values.Count - 1))
                        Output.Write("<br />");
                }
                Output.WriteLine("</div></td>");
                Output.WriteLine("          <td valign=\"bottom\" >");
                Output.WriteLine("            <a target=\"_" + html_element_name.ToUpper() + "\"  title=\"" + Translator.Get_Translation("Get help.", CurrentLanguage) + "\" href=\"" + Help_URL(Skin_Code, Base_URL) + "\" ><img border=\"0px\" class=\"help_button\" src=\"" + Base_URL + HELP_BUTTON_URL + "\" /></a>");
                Output.WriteLine("          </td>");
                Output.WriteLine("        </tr>");
                Output.WriteLine("      </table>");
                Output.WriteLine("    </td>");
            }
            else
            {
                Output.WriteLine("    <td>");
                Output.WriteLine("      <table>");
                Output.WriteLine("        <tr>");
                Output.WriteLine("          <td>");
                Output.WriteLine("            <div id=\"" + HTML_ID_Name + "_div\">");

                for (int i = 1; i <= allValues.Count; i++)
                {
                    if (i == allValues.Count)
                    {
                        Output.WriteLine("              <input name=\"" + HTML_ID_Name + i + "\" id=\"" + HTML_ID_Name + i + "\" class=\"" + html_element_name + "_input\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(allValues[i - 1].Replace("<i>", "").Replace("</i>", "")) + "\" onfocus=\"javascript:textbox_enter('" + HTML_ID_Name + i + "', '" + html_element_name + "_input_focused')\" onblur=\"javascript:textbox_leave('" + HTML_ID_Name + i + "', '" + html_element_name + "_input')\" />");
                    }
                    else
                    {
                        Output.WriteLine("              <input name=\"" + HTML_ID_Name + i + "\" id=\"" + HTML_ID_Name + i + "\" class=\"" + html_element_name + "_input\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(allValues[i - 1].Replace("<i>", "").Replace("</i>", "")) + "\" onfocus=\"javascript:textbox_enter('" + HTML_ID_Name + i + "', '" + html_element_name + "_input_focused')\" onblur=\"javascript:textbox_leave('" + HTML_ID_Name + i + "', '" + html_element_name + "_input')\" /><br />");
                    }
                }

                Output.WriteLine("            </div>");
                Output.WriteLine("          </td>");
                Output.WriteLine("          <td valign=\"bottom\" >");

                if (view_choices_string.Length > 0)
                {
                    Output.WriteLine("            " + view_choices_string.Replace("<%INTERFACE%>", Skin_Code) + "&nbsp; ");
//.........这里部分代码省略.........
开发者ID:randomyed,项目名称:SobekCM-Web-Application,代码行数:101,代码来源:simpleTextBox_Element.cs

示例10: Render_Template_HTML

        /// <summary> Renders the HTML for this element </summary>
        /// <param name="Output"> Textwriter to write the HTML for this element </param>
        /// <param name="Bib"> Object to populate this element from </param>
        /// <param name="Skin_Code"> Code for the current skin </param>
        /// <param name="isMozilla"> Flag indicates if the current browse is Mozilla Firefox (different css choices for some elements)</param>
        /// <param name="popup_form_builder"> Builder for any related popup forms for this element </param>
        /// <param name="Current_User"> Current user, who's rights may impact the way an element is rendered </param>
        /// <param name="CurrentLanguage"> Current user-interface language </param>
        /// <param name="Translator"> Language support object which handles simple translational duties </param>
        /// <param name="Base_URL"> Base URL for the current request </param>
        /// <remarks> This element appends a popup form to the popup_form_builder</remarks>
        public override void Render_Template_HTML(TextWriter Output, SobekCM_Item Bib, string Skin_Code, bool isMozilla, StringBuilder popup_form_builder, User_Object Current_User, Web_Language_Enum CurrentLanguage, Language_Support_Info Translator, string Base_URL )
        {
            // Check that an acronym exists
            if (Acronym.Length == 0)
            {
                const string defaultAcronym = "Enter information for any electronic finding guide to which this material belongs.";
                switch (CurrentLanguage)
                {
                    case Web_Language_Enum.English:
                        Acronym = defaultAcronym;
                        break;

                    case Web_Language_Enum.Spanish:
                        Acronym = defaultAcronym;
                        break;

                    case Web_Language_Enum.French:
                        Acronym = defaultAcronym;
                        break;

                    default:
                        Acronym = defaultAcronym;
                        break;
                }
            }

            Output.WriteLine("  <!-- " + Title + " Form Element -->");
            Output.WriteLine("  <tr align=\"left\">");
            Output.WriteLine("    <td width=\"" + LEFT_MARGIN + "px\">&nbsp;</td>");
            if (Acronym.Length > 0)
            {
                Output.WriteLine("    <td valign=\"top\" class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\"><acronym title=\"" + Acronym + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</acronym></a></td>");
            }
            else
            {
                Output.WriteLine("    <td valign=\"top\" class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</a></td>");
            }

            Output.WriteLine("    <td>");
            Output.WriteLine("      <table>");
            Output.WriteLine("        <tr>");
            Output.WriteLine("          <td>");
            Output.WriteLine("            <div id=\"" + html_element_name + "_div\">");

            // Write the EAD popup link
            if (( !Bib.Bib_Info.hasLocationInformation ) || ((Bib.Bib_Info.Location.EAD_Name.Length == 0) && (Bib.Bib_Info.Location.EAD_URL.Length == 0 )))
            {
                Output.Write("              <a title=\"Click to edit the related EAD information\" href=\"" + Base_URL + "l/technical/javascriptrequired\" onfocus=\"link_focused2('form_ead_term')\" onblur=\"link_blurred2('form_ead_term')\" onkeypress=\"return popup_keypress_focus('form_ead', 'form_ead_term', 'formead_name', 175, 620, '" + isMozilla.ToString() + "' );\" onclick=\"return popup_focus('form_ead', 'form_ead_term', 'formead_name', 175, 620 );\"><div class=\"form_linkline_empty form_ead_line\" id=\"form_ead_term\">");
                Output.Write("<i>Empty Related EAD</i>");
            }
            else
            {
                Output.Write("              <a title=\"Click to edit the related EAD information\" href=\"" + Base_URL + "l/technical/javascriptrequired\" onfocus=\"link_focused2('form_ead_term')\" onblur=\"link_blurred2('form_ead_term')\" onkeypress=\"return popup_keypress_focus('form_ead', 'form_ead_term', 'formead_name', 175, 620, '" + isMozilla.ToString() + "' );\" onclick=\"return popup_focus('form_ead', 'form_ead_term', 'formead_name', 175, 620 );\"><div class=\"form_linkline form_ead_line\" id=\"form_ead_term\">");
                Output.Write(Bib.Bib_Info.Location.EAD_Name.Length > 0
                                 ? HttpUtility.HtmlEncode(Bib.Bib_Info.Location.EAD_Name)
                                 : HttpUtility.HtmlEncode(Bib.Bib_Info.Location.EAD_URL));
            }
            Output.WriteLine("</div></a>");
            Output.WriteLine("              </div>");
            Output.WriteLine("          </td>");
            Output.WriteLine("          <td valign=\"bottom\" >");
            Output.WriteLine("            <a target=\"_" + html_element_name.ToUpper() + "\"  title=\"" + Translator.Get_Translation("Get help.", CurrentLanguage) + "\" href=\"" + Help_URL(Skin_Code, Base_URL) + "\" ><img border=\"0px\" class=\"help_button\" src=\"" + Base_URL + HELP_BUTTON_URL + "\" /></a>");
            Output.WriteLine("          </td>");
            Output.WriteLine("        </tr>");
            Output.WriteLine("      </table>");
            Output.WriteLine("    </td>");
            Output.WriteLine("  </tr>");
            Output.WriteLine();

            // Add the popup form
            popup_form_builder.AppendLine("<!-- Related EAD Form -->");
            popup_form_builder.AppendLine("<div class=\"ead_popup_div\" id=\"form_ead\" style=\"display:none;\">");
            popup_form_builder.AppendLine("  <div class=\"popup_title\"><table width=\"100%\"><tr><td align=\"left\">EDIT RELATED EAD / FINDING GUIDE</td><td align=\"right\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" alt=\"HELP\" target=\"_" + html_element_name.ToUpper() + "\" >?</a> &nbsp; <a href=\"#template\" alt=\"CLOSE\" onclick=\"close_ead_form()\">X</a> &nbsp; </td></tr></table></div>");
            popup_form_builder.AppendLine("  <br />");
            popup_form_builder.AppendLine("  <table class=\"popup_table\">");

            // Add the rows of data
            popup_form_builder.AppendLine("    <tr><td width=\"90px\">EAD Name:</td><td><input class=\"formead_input\" name=\"formead_name\" id=\"formead_name\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(Bib.Bib_Info.Location.EAD_Name) + "\" onfocus=\"javascript:textbox_enter('formead_name', 'formead_input_focused')\" onblur=\"javascript:textbox_leave('formead_name', 'formead_input')\" /></td></tr>");
            popup_form_builder.AppendLine("    <tr><td>EAD URL:</td><td><input class=\"formead_input\" name=\"formead_url\" id=\"formead_url\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(Bib.Bib_Info.Location.EAD_URL) + "\" onfocus=\"javascript:textbox_enter('formead_url', 'formead_input_focused')\" onblur=\"javascript:textbox_leave('formead_url', 'formead_input')\" /></td></tr>");

            // Finish the popup form
            popup_form_builder.AppendLine("  </table>");
            popup_form_builder.AppendLine("  <br />");
            popup_form_builder.AppendLine("  <center><a href=\"#template\" onclick=\"return close_ead_form()\"><img border=\"0\" src=\"" + Close_Button_URL(Skin_Code, Base_URL ) + "\" alt=\"CLOSE\" /></a></center>");
            popup_form_builder.AppendLine("</div>");
            popup_form_builder.AppendLine();
        }
开发者ID:randomyed,项目名称:SobekCM-Web-Application,代码行数:98,代码来源:EAD_Form_Element.cs

示例11: Render_Template_HTML

        /// <summary> Renders the HTML for this element </summary>
        /// <param name="Output"> Textwriter to write the HTML for this element </param>
        /// <param name="Bib"> Object to populate this element from </param>
        /// <param name="Skin_Code"> Code for the current skin </param>
        /// <param name="isMozilla"> Flag indicates if the current browse is Mozilla Firefox (different css choices for some elements)</param>
        /// <param name="popup_form_builder"> Builder for any related popup forms for this element </param>
        /// <param name="Current_User"> Current user, who's rights may impact the way an element is rendered </param>
        /// <param name="CurrentLanguage"> Current user-interface language </param>
        /// <param name="Translator"> Language support object which handles simple translational duties </param>
        /// <param name="Base_URL"> Base URL for the current request </param>
        /// <remarks> This simple element does not append any popup form to the popup_form_builder</remarks>
        public override void Render_Template_HTML(TextWriter Output, SobekCM_Item Bib, string Skin_Code, bool isMozilla, StringBuilder popup_form_builder, User_Object Current_User, Web_Language_Enum CurrentLanguage, Language_Support_Info Translator, string Base_URL )
        {
            // Check that an acronym exists
            if (Acronym.Length == 0)
            {
                const string defaultAcronym = "Enter the period of time which is the subject of this material.";
                switch (CurrentLanguage)
                {
                    case Web_Language_Enum.English:
                        Acronym = defaultAcronym;
                        break;

                    case Web_Language_Enum.Spanish:
                        Acronym = defaultAcronym;
                        break;

                    case Web_Language_Enum.French:
                        Acronym = defaultAcronym;
                        break;

                    default:
                        Acronym = defaultAcronym;
                        break;
                }
            }

            string id_name = html_element_name.Replace("_", "");

            Output.WriteLine("  <!-- " + Title + " Element -->");
            Output.WriteLine("  <tr align=\"left\">");
            Output.WriteLine("    <td width=\"" + LEFT_MARGIN + "px\">&nbsp;</td>");
            if (Acronym.Length > 0)
            {
                Output.WriteLine("    <td valign=\"top\" class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\"><acronym title=\"" + Acronym + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</acronym></a></td>");
            }
            else
            {
                Output.WriteLine("    <td valign=\"top\" class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</a></td>");
            }
            Output.WriteLine("    <td>");
            Output.WriteLine("      <table>");
            Output.WriteLine("        <tr>");
            Output.WriteLine("          <td>");
            Output.WriteLine("            <div id=\"" + html_element_name + "_div\">");

            if (Bib.Bib_Info.TemporalSubjects_Count == 0)
            {
                const int  i = 1;
                Output.Write("              <span class=\"metadata_sublabel2\">" + Translator.Get_Translation("Start Year", CurrentLanguage) + ":</span>");
                Output.Write("<input name=\"" + id_name + "_start" + i + "\" id=\"" + id_name + "_start" + i + "\" class=\"" + html_element_name + "_year_input\" type=\"text\" value=\"\" onfocus=\"javascript:textbox_enter('" + id_name + "_start" + i + "', '" + html_element_name + "_year_input_focused')\" onblur=\"javascript:textbox_leave('" + id_name + "_start" + i + "', '" + html_element_name + "_year_input')\" />");
                Output.Write("<span class=\"metadata_sublabel\">" + Translator.Get_Translation("End Year", CurrentLanguage) + ":</span>");
                Output.Write("<input name=\"" + id_name + "_end" + i + "\" id=\"" + id_name + "_end" + i + "\" class=\"" + html_element_name + "_year_input\" type=\"text\" value=\"\" onfocus=\"javascript:textbox_enter('" + id_name + "_end" + i + "', '" + html_element_name + "_year_input_focused')\" onblur=\"javascript:textbox_leave('" + id_name + "_end" + i + "', '" + html_element_name + "_year_input')\" />");
                Output.Write("<span class=\"metadata_sublabel\">" + Translator.Get_Translation("Period", CurrentLanguage) + ":</span>");
                Output.WriteLine("<input name=\"" + id_name + "_period" + i + "\" id=\"" + id_name + "_period" + i + "\" class=\"" + html_element_name + "_period_input\" type=\"text\" value=\"\" onfocus=\"javascript:textbox_enter('" + id_name + "_period" + i + "', '" + html_element_name + "_period_input_focused')\" onblur=\"javascript:textbox_leave('" + id_name + "_period" + i + "', '" + html_element_name + "_period_input')\" /></div>");
                Output.WriteLine("            </div>");
            }
            else
            {
                ReadOnlyCollection<Temporal_Info> temporalSubjects = Bib.Bib_Info.TemporalSubjects;
                for (int i = 1; i <= temporalSubjects.Count; i++)
                {
                    Output.Write("              <span class=\"metadata_sublabel2\">" + Translator.Get_Translation("Start Year", CurrentLanguage) + ":</span>");
                    Output.Write("<input name=\"" + id_name + "_start" + i + "\" id=\"" + id_name + "_start" + i + "\" class=\"" + html_element_name + "_year_input\" type=\"text\" value=\"" + temporalSubjects[i - 1].Start_Year.ToString().Replace("-1", "") + "\" onfocus=\"javascript:textbox_enter('" + id_name + "_start" + i + "', '" + html_element_name + "_year_input_focused')\" onblur=\"javascript:textbox_leave('" + id_name + "_start" + i + "', '" + html_element_name + "_year_input')\" />");
                    Output.Write("<span class=\"metadata_sublabel\">" + Translator.Get_Translation("End Year", CurrentLanguage) + ":</span>");
                    Output.Write("<input name=\"" + id_name + "_end" + i + "\" id=\"" + id_name + "_end" + i + "\" class=\"" + html_element_name + "_year_input\" type=\"text\" value=\"" + temporalSubjects[i - 1].End_Year.ToString().Replace("-1", "") + "\" onfocus=\"javascript:textbox_enter('" + id_name + "_end" + i + "', '" + html_element_name + "_year_input_focused')\" onblur=\"javascript:textbox_leave('" + id_name + "_end" + i + "', '" + html_element_name + "_year_input')\" />");
                    Output.Write("<span class=\"metadata_sublabel\">" + Translator.Get_Translation("Period", CurrentLanguage) + ":</span>");
                    Output.Write("<input name=\"" + id_name + "_period" + i + "\" id=\"" + id_name + "_period" + i + "\" class=\"" + html_element_name + "_period_input\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(temporalSubjects[i - 1].TimePeriod) + "\" onfocus=\"javascript:textbox_enter('" + id_name + "_period" + i + "', '" + html_element_name + "_period_input_focused')\" onblur=\"javascript:textbox_leave('" + id_name + "_period" + i + "', '" + html_element_name + "_period_input')\" />");

                    Output.WriteLine(i < temporalSubjects.Count ? "<br />" : "\n            </div>");
                }
            }
            Output.WriteLine("          </td>");

            Output.WriteLine("          <td valign=\"bottom\" >");
            if (Repeatable)
            {
                Output.WriteLine("            <a title=\"" + Translator.Get_Translation("Click to add a new temporal coverage field", CurrentLanguage) + ".\" href=\"" + Base_URL + "l/technical/javascriptrequired\" onmousedown=\"return add_temporal_element();\"><img border=\"0px\" class=\"repeat_button\" src=\"" + Base_URL + REPEAT_BUTTON_URL + "\" /></a>");
            }
            Output.WriteLine("            <a target=\"_" + html_element_name.ToUpper() + "\"  title=\"" + Translator.Get_Translation("Get help.", CurrentLanguage) + "\" href=\"" + Help_URL(Skin_Code, Base_URL) + "\" ><img border=\"0px\" class=\"help_button\" src=\"" + Base_URL + HELP_BUTTON_URL + "\" /></a>");
            Output.WriteLine("          </td>");

            Output.WriteLine("        </tr>");
            Output.WriteLine("      </table>");
            Output.WriteLine("    </td>");
            Output.WriteLine("  </tr>");
            Output.WriteLine();
        }
开发者ID:randomyed,项目名称:SobekCM-Web-Application,代码行数:98,代码来源:Temporal_Complex_Element.cs

示例12: render_helper

        /// <summary> Method helps to render the html for all elements based on comboBox_TextBox_Element class </summary>
        /// <param name="Output"> Output for the generate html for this element </param>
        /// <param name="select_value"> Value for the current digital resource to display in the combo box</param>
        /// <param name="userdefined_possible"> List of possible select values, set by the user </param>
        /// <param name="text_value"> Value for the current digital resource to display in the text box</param>
        /// <param name="Skin_Code"> Code for the current html skin </param>
        /// <param name="Current_User"> Current user, who's rights may impact the way an element is rendered </param>
        /// <param name="CurrentLanguage"> Current user-interface language </param>
        /// <param name="Translator"> Language support object which handles simple translational duties </param>
        /// <param name="Base_URL"> Base URL for the current request </param>
        /// <param name="initial_value"> Flag indicates if the value in the select_value param is actually instructional text, and not a true value</param>
        protected void render_helper(TextWriter Output, string select_value, List<string> userdefined_possible, string text_value, string Skin_Code, User_Object Current_User, Web_Language_Enum CurrentLanguage, Language_Support_Info Translator, string Base_URL, bool initial_value)
        {
            string id_name = html_element_name.Replace("_", "");

            Output.WriteLine("  <!-- " + Title + " Element -->");
            Output.WriteLine("  <tr>");
            Output.WriteLine("    <td style=\"width:" + LEFT_MARGIN + "px\">&nbsp;</td>");
            if (Acronym.Length > 0)
            {
                Output.WriteLine("    <td class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\"><acronym title=\"" + Acronym + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</acronym></a></td>");
            }
            else
            {
                Output.WriteLine("    <td class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</a></td>");
            }
            Output.WriteLine("    <td>");

            Output.WriteLine("      <table>");
            Output.WriteLine("        <tr>");
            Output.WriteLine("          <td>");
            Output.WriteLine("            <div id=\"" + html_element_name + "_div\">");

            const int i = 1;

                // Write the combo box
            // Write the combo box
            if (clear_textbox_on_combobox_change)
            {
                Output.Write("            <select class=\"" + html_element_name + "_select\" name=\"" + id_name + "_select" + i + "\" id=\"" + id_name + "_select" + i + "\" onblur=\"javascript:selectbox_leave('" + id_name + "_select" + i + "','" + html_element_name + "_select', '" + html_element_name + "_select_init')\" onchange=\"clear_textbox('" + id_name + "_text" + i + "')\" >");
            }
            else
            {
                Output.Write("            <select class=\"" + html_element_name + "_select\" name=\"" + id_name + "_select" + i + "\" id=\"" + id_name + "_select" + i + "\" onblur=\"javascript:selectbox_leave('" + id_name + "_select" + i + "','" + html_element_name + "_select', '" + html_element_name + "_select_init')\" >");
            }

                bool found_option = false;
                foreach (string thisOption in possible_select_items)
                {
                    if ((i < possible_select_items.Count) && (thisOption == select_value))
                    {
                        Output.Write("<option value=\"" + thisOption + "\" selected=\"selected=\">" + thisOption + "</option>");
                        found_option = true;
                    }
                    else
                    {
                        Output.Write("<option value=\"" + thisOption + "\" >" + thisOption + "</option>");
                    }
                }

                if ((select_value.Length > 0) && (!Restrict_Values) && (!found_option))
                {
                    Output.Write("<option value=\"" + select_value + "\" selected=\"selected=\">" + select_value + "</option>");
                }
                Output.Write("</select>");

                // Write the second text
                if (second_label.Length > 0)
                {
                    Output.Write("<span class=\"metadata_sublabel\">" + second_label + ":</span>");
                }

                // Write the text box
                Output.Write("<input name=\"" + id_name + "_text" + i + "\" id=\"" + id_name + "_text" + i + "\" class=\"" + html_element_name + "_input sbk_Focusable\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(text_value) + "\" />");

                Output.WriteLine("</div>");

            Output.WriteLine("        </td>");
            Output.WriteLine("        <td style=\"vertical-align:bottom\" >");
            if (Repeatable)
            {
                Output.WriteLine("          <a title=\"" + Translator.Get_Translation("Click to add another " + Title.ToLower(), CurrentLanguage) + ".\" href=\"" + Base_URL + "l/technical/javascriptrequired\" onmousedown=\"return " + html_element_name + "_add_new_item();\"><img class=\"repeat_button\" src=\"" + Base_URL + REPEAT_BUTTON_URL + "\" /></a>");
            }

            Output.WriteLine("            <a target=\"_" + html_element_name.ToUpper() + "\"  title=\"" + Translator.Get_Translation("Get help.", CurrentLanguage) + "\" href=\"" + Help_URL(Skin_Code, Base_URL) + "\" ><img class=\"help_button\" src=\"" + Base_URL + HELP_BUTTON_URL + "\" /></a>");

            Output.WriteLine("        </td>");
            Output.WriteLine("      </tr>");
            Output.WriteLine("    </table>");

            Output.WriteLine("    </td>");
            Output.WriteLine("  </tr>");
            Output.WriteLine();
        }
开发者ID:randomyed,项目名称:SobekCM-Web-Application,代码行数:94,代码来源:comboBox_TextBox_Element.cs

示例13: Render_Template_HTML

        /// <summary> Renders the HTML for this element </summary>
        /// <param name="Output"> Textwriter to write the HTML for this element </param>
        /// <param name="Bib"> Object to populate this element from </param>
        /// <param name="Skin_Code"> Code for the current skin </param>
        /// <param name="isMozilla"> Flag indicates if the current browse is Mozilla Firefox (different css choices for some elements)</param>
        /// <param name="popup_form_builder"> Builder for any related popup forms for this element </param>
        /// <param name="Current_User"> Current user, who's rights may impact the way an element is rendered </param>
        /// <param name="CurrentLanguage"> Current user-interface language </param>
        /// <param name="Translator"> Language support object which handles simple translational duties </param>
        /// <param name="Base_URL"> Base URL for the current request </param>
        /// <remarks> This simple element does not append any popup form to the popup_form_builder</remarks>
        public override void Render_Template_HTML(TextWriter Output, SobekCM_Item Bib, string Skin_Code, bool isMozilla, StringBuilder popup_form_builder, User_Object Current_User, Web_Language_Enum CurrentLanguage, Language_Support_Info Translator, string Base_URL )
        {
            // Check that an acronym exists
            if (Acronym.Length == 0)
            {
                const string defaultAcronym = "Enter any notes about this digital manifestation or the original material";
                switch (CurrentLanguage)
                {
                    case Web_Language_Enum.English:
                        Acronym = defaultAcronym;
                        break;

                    case Web_Language_Enum.Spanish:
                        Acronym = defaultAcronym;
                        break;

                    case Web_Language_Enum.French:
                        Acronym = defaultAcronym;
                        break;

                    default:
                        Acronym = defaultAcronym;
                        break;
                }
            }

            // Determine the columns for this text area, based on browser
            int actual_cols = cols;
            if (isMozilla)
                actual_cols = colsMozilla;

            string id_name = html_element_name.Replace("_", "");

            Output.WriteLine("  <!-- " + Title + " Element -->");
            Output.WriteLine("  <tr align=\"left\">");
            Output.WriteLine("    <td width=\"" + LEFT_MARGIN + "px\">&nbsp;</td>");
            if (Acronym.Length > 0)
            {
                Output.WriteLine("    <td valign=\"top\" class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\"><acronym title=\"" + Acronym + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</acronym></a></td>");
            }
            else
            {
                Output.WriteLine("    <td valign=\"top\" class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</a></td>");
            }
            Output.WriteLine("    <td>");
            Output.WriteLine("      <table>");
            Output.WriteLine("        <tr align=\"left\">");
            Output.WriteLine("          <td>");
            Output.WriteLine("            <div id=\"" + html_element_name + "_div\">");

            int notes_count = 0;
            if (Bib.Bib_Info.Notes_Count > 0)
            {
                notes_count += Bib.Bib_Info.Notes.Count(thisNote => ((thisNote.Note_Type != Note_Type_Enum.statement_of_responsibility) || (Include_Statement_Responsibility)) && (thisNote.Note_Type != Note_Type_Enum.default_type));
            }

            if (notes_count == 0)
            {
                Output.WriteLine("              <div id=\"" + html_element_name + "_topdiv1\">");
                Output.WriteLine("                <span class=\"metadata_sublabel2\">" + Translator.Get_Translation("Type", CurrentLanguage) + ":</span>");
                Output.WriteLine("                <select class=\"" + html_element_name + "_type\" name=\"" + id_name + "_type1\" id=\"" + id_name + "_type1\" onchange=\"javascript:complexnote_type_change('1')\" onfocus=\"javascript:textbox_enter('" + id_name + "_type1','" + html_element_name + "_type_focused')\" onblur=\"javascript:textbox_leave('" + id_name + "_type1','" + html_element_name + "_type')\" >");
                Output.WriteLine("                  <option selected=\"selected=\" value=\"500\"></option>");
                Output.WriteLine("                  <option value=\"541\">Acquisition</option>");
                Output.WriteLine("                  <option value=\"530\">Additional Physical Form</option>");
                Output.WriteLine("                  <option value=\"504\">Bibliography</option>");
                Output.WriteLine("                  <option value=\"545\">Biographical</option>");
                Output.WriteLine("                  <option value=\"510\">Citation/Reference</option>");
                Output.WriteLine("                  <option value=\"508\">Creation/Production Credits</option>");
                Output.WriteLine("                  <option value=\"362\">Dates/Sequential Designation</option>");
                Output.WriteLine("                  <option value=\"donation\">Donation</option>");
                Output.WriteLine("                  <option value=\"585\">Exhibitions</option>");
                Output.WriteLine("                  <option value=\"536\">Funding</option>");
                Output.WriteLine("                  <option value=\"internal\">Internal Comments</option>");
                Output.WriteLine("                  <option value=\"550\">Issuing Body</option>");
                Output.WriteLine("                  <option value=\"546\">Language</option>");
                Output.WriteLine("                  <option value=\"515\">Numbering Peculiarities</option>");
                Output.WriteLine("                  <option value=\"535\">Original Location</option>");
                Output.WriteLine("                  <option value=\"534\">Original Version</option>");
                Output.WriteLine("                  <option value=\"561\">Ownership</option>");
                Output.WriteLine("                  <option value=\"511\">Performers</option>");
                Output.WriteLine("                  <option value=\"524\">Preferred Citation</option>");
                Output.WriteLine("                  <option value=\"581\">Publications</option>");
                Output.WriteLine("                  <option value=\"pubstatus\">Publication Status</option>");
                Output.WriteLine("                  <option value=\"506\">Restriction</option>");
                if (Include_Statement_Responsibility)
                {
                    Output.WriteLine("                  <option value=\"245\">Statement of Responsibility</option>");
                }
                Output.WriteLine("                  <option value=\"538\">System Details</option>");
//.........这里部分代码省略.........
开发者ID:randomyed,项目名称:SobekCM-Web-Application,代码行数:101,代码来源:Note_Complex_Element.cs

示例14: Render_Template_HTML

        /// <summary> Renders the HTML for this element </summary>
        /// <param name="Output"> Textwriter to write the HTML for this element </param>
        /// <param name="Bib"> Object to populate this element from </param>
        /// <param name="Skin_Code"> Code for the current skin </param>
        /// <param name="isMozilla"> Flag indicates if the current browse is Mozilla Firefox (different css choices for some elements)</param>
        /// <param name="popup_form_builder"> Builder for any related popup forms for this element </param>
        /// <param name="Current_User"> Current user, who's rights may impact the way an element is rendered </param>
        /// <param name="CurrentLanguage"> Current user-interface language </param>
        /// <param name="Translator"> Language support object which handles simple translational duties </param>
        /// <param name="Base_URL"> Base URL for the current request </param>
        /// <remarks> This simple element does not append any popup form to the popup_form_builder</remarks>
        public override void Render_Template_HTML(TextWriter Output, SobekCM_Item Bib, string Skin_Code, bool isMozilla, StringBuilder popup_form_builder, User_Object Current_User, Web_Language_Enum CurrentLanguage, Language_Support_Info Translator, string Base_URL )
        {
            // Check that an acronym exists
            if (Acronym.Length == 0)
            {
                const string defaultAcronym = "Enter the rights you give for sharing, repurposing, or remixing your item to other users.  You may also select a creative commons license below.";
                switch (CurrentLanguage)
                {
                    case Web_Language_Enum.English:
                        Acronym = defaultAcronym;
                        break;

                    case Web_Language_Enum.Spanish:
                        Acronym = defaultAcronym;
                        break;

                    case Web_Language_Enum.French:
                        Acronym = defaultAcronym;
                        break;

                    default:
                        Acronym = defaultAcronym;
                        break;
                }
            }

            // render_helper(Output, Bib.Bib_Info.Access_Condition.Text, Skin_Code, isMozilla, Current_User, CurrentLanguage, Translator);

            string id_name = html_element_name.Replace("_", "");

            int actual_cols = cols;
            if (isMozilla)
                actual_cols = cols_mozilla;

            Output.WriteLine("  <!-- " + Title + " Element -->");
            Output.WriteLine("  <tr align=\"left\">");
            Output.WriteLine("    <td width=\"" + LEFT_MARGIN + "px\">&nbsp;</td>");
            if (Read_Only)
            {
                Output.WriteLine("    <td valign=\"top\" class=\"metadata_label\">" + Title + ":</b></td>");
            }
            else
            {
                if (Acronym.Length > 0)
                {
                    Output.WriteLine("    <td valign=\"top\" class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\"><acronym title=\"" + Acronym + "\">" + Title + ":</acronym></a></td>");
                }
                else
                {
                    Output.WriteLine("    <td valign=\"top\" class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\">" + Title + ":</a></td>");
                }
            }
            Output.WriteLine("    <td>");
            Output.WriteLine("      <table>");
            Output.WriteLine("        <tr>");
            Output.WriteLine("          <td>");
            Output.WriteLine("            <div id=\"" + html_element_name + "_div\">");
            Output.WriteLine("              <textarea rows=\"" + rows + "\" cols=\"" + actual_cols + "\" name=\"" + id_name + "1\" id=\"" + id_name + "1\" class=\"" + html_element_name + "_input\" onfocus=\"javascript:textbox_enter('" + id_name + "1','" + html_element_name + "_input_focused')\" onblur=\"javascript:textbox_leave('" + id_name + "1','" + html_element_name + "_input')\">" + HttpUtility.HtmlEncode(Bib.Bib_Info.Access_Condition.Text.Trim()) + "</textarea>");
            Output.WriteLine("              <div class=\"ShowOptionsRow\">");
            Output.WriteLine("                <a href=\"\" onclick=\"return open_cc_rights();\"><img src=\"" + baseURL + "design/skins/" + Skin_Code + "/tabs/cLDG.gif\" border=\"0\" class=\"tab_image\" alt=\"\" /><span class=\"tab\">CREATIVE COMMONS</span><img src=\"" + baseURL + "design/skins/" + Skin_Code + "/tabs/cRDG.gif\" border=\"0\" class=\"tab_image\" alt=\"\" /></a>");
            Output.WriteLine("              </div>");
            Output.WriteLine("            </div>");
            Output.WriteLine("          </td>");
            Output.WriteLine("          <td valign=\"bottom\" >");
            Output.WriteLine("            <a target=\"_" + html_element_name.ToUpper() + "\"  title=\"" + Translator.Get_Translation("Get help.", CurrentLanguage) + "\" href=\"" + Help_URL(Skin_Code, Base_URL) + "\" ><img border=\"0px\" class=\"help_button_rightsmgmt\" src=\"" + Base_URL + HELP_BUTTON_URL + "\" /></a>");
            Output.WriteLine("          </td>");
            Output.WriteLine("        </tr>");
            Output.WriteLine("      </table>");
            Output.WriteLine("    </td>");
            Output.WriteLine("  </tr>");
            Output.WriteLine();

            Output.WriteLine("  <tr align=\"left\">");
            Output.WriteLine("    <td colspan=\"2\">&nbsp;</td>");
            Output.WriteLine("    <td>");
            Output.WriteLine("      <table id=\"cc_rights\" cellpadding=\"3px\" cellspacing=\"3px\" style=\"display:none;\">");
            Output.WriteLine("        <tr><td colspan=\"2\">You may also select a <a title=\"Explanation of different creative commons licenses.\" href=\"http://creativecommons.org/about/licenses/\">Creative Commons License</a> option below.<br /></td></tr>");
            Output.WriteLine("        <tr><td> &nbsp; <a href=\"\" onclick=\"return set_cc_rights('rightsmgmt1','[cc0] The author dedicated the work to the Commons by waiving all of his or her rights to the work worldwide under copyright law and all related or neighboring legal rights he or she had in the work, to the extent allowable by law.');\"><img title=\"You dedicate the work to the Commons by waiving all of your rights to the work worldwide under copyright law and all related or neighboring legal rights you had in the work, to the extent allowable by law.\" src=\"" + baseURL + "default/images/cc_zero.png\" /></a></td><td><b>No Copyright</b><br /><i>cc0</i></td></tr>");
            Output.WriteLine("        <tr><td> &nbsp; <a href=\"\" onclick=\"return set_cc_rights('rightsmgmt1','[cc by] This item is licensed with the Creative Commons Attribution License.  This license lets others distribute, remix, tweak, and build upon this work, even commercially, as long as they credit the author for the original creation.');\"><img title=\"This license lets others distribute, remix, tweak, and build upon your work, even commercially, as long as they credit you for the original creation.\" src=\"" + baseURL + "default/images/cc_by.png\" /></a></td><td><b>Attribution</b><br /><i>cc by</i></td></tr>");
            Output.WriteLine("        <tr><td> &nbsp; <a href=\"\" onclick=\"return set_cc_rights('rightsmgmt1','[cc by-sa] This item is licensed with the Creative Commons Attribution Share Alike License.  This license lets others remix, tweak, and build upon this work even for commercial reasons, as long as they credit the author and license their new creations under the identical terms.');\"><img title=\"This license lets others remix, tweak, and build upon your work even for commercial reasons, as long as they credit you and license their new creations under the identical terms.\" src=\"" + baseURL + "default/images/cc_by_sa.png\" /></a></td><td><b>Attribution Share Alike</b><br /><i>cc by-sa</i></td></tr>");
            Output.WriteLine("        <tr><td> &nbsp; <a href=\"\" onclick=\"return set_cc_rights('rightsmgmt1','[cc by-nd] This item is licensed with the Creative Commons Attribution No Derivatives License.  This license allows for redistribution, commercial and non-commercial, as long as it is passed along unchanged and in whole, with credit to the author.');\"><img title=\"This license allows for redistribution, commercial and non-commercial, as long as it is passed along unchanged and in whole, with credit to you.\" src=\"" + baseURL + "default/images/cc_by_nd.png\" /></a></td><td><b>Attribution No Derivatives</b><br /><i>cc by-nd</i></td></tr>");
            Output.WriteLine("        <tr><td> &nbsp; <a href=\"\" onclick=\"return set_cc_rights('rightsmgmt1','[cc by-nc] This item is licensed with the Creative Commons Attribution Non-Commerical License.  This license lets others remix, tweak, and build upon this work non-commercially, and although their new works must also acknowledge the author and be non-commercial, they don’t have to license their derivative works on the same terms.');\"><img title=\"This license lets others remix, tweak, and build upon your work non-commercially, and although their new works must also acknowledge you and be non-commercial, they don’t have to license their derivative works on the same terms.\" src=\"" + baseURL + "default/images/cc_by_nc.png\" /></a></td><td><b>Attribution Non-Commercial</b><br /><i>cc by-nc</i></td></tr>");
            Output.WriteLine("        <tr><td> &nbsp; <a href=\"\" onclick=\"return set_cc_rights('rightsmgmt1','[cc by-nc-sa] This item is licensed with the Creative Commons Attribution Non-Commercial Share Alike License.  This license lets others remix, tweak, and build upon this work non-commercially, as long as they credit the author and license their new creations under the identical terms.');\"><img title=\"This license lets others remix, tweak, and build upon your work non-commercially, as long as they credit you and license their new creations under the identical terms.\" src=\"" + baseURL + "default/images/cc_by_nc_sa.png\" /></a></td><td><b>Attribution Non-Commercial Share Alike</b><br /><i>cc by-nc-sa</i></td></tr>");
            Output.WriteLine("        <tr><td> &nbsp; <a href=\"\" onclick=\"return set_cc_rights('rightsmgmt1','[cc by-nc-nd] This item is licensed with the Creative Commons Attribution Non-Commercial No Derivative License.  This license allows others to download this work and share them with others as long as they mention the author and link back to the author, but they can’t change them in any way or use them commercially.');\"><img title=\"This license allows others to download your works and share them with others as long as they mention you and link back to you, but they can’t change them in any way or use them commercially.\" src=\"" + baseURL + "default/images/cc_by_nc_nd.png\" /></a></td><td><b>Attribution Non-Commercial No Derivatives</b><br /><i>cc by-nc-nd</i></td></tr>");
            Output.WriteLine("      </table>");
            Output.WriteLine("    </td>");
            Output.WriteLine("  </tr>");
            Output.WriteLine("");
        }
开发者ID:randomyed,项目名称:SobekCM-Web-Application,代码行数:100,代码来源:Rights_Element.cs

示例15: render_helper

        /// <summary> Method helps to render the html for all elements based on textBox_ComboBox_Element class </summary>
        /// <param name="Output"> Output for the generate html for this element </param>
        /// <param name="text_values"> Value(s) for the current digital resource to display in the text box </param>
        /// <param name="select_values"> Value(s) for the current digital resource to display in the combo box</param>
        /// <param name="Skin_Code"> Code for the current html skin </param>
        /// <param name="Current_User"> Current user, who's rights may impact the way an element is rendered </param>
        /// <param name="CurrentLanguage"> Current user-interface language </param>
        /// <param name="Translator"> Language support object which handles simple translational duties </param>
        /// <param name="Base_URL"> Base URL for the current request </param>
        protected void render_helper(TextWriter Output, List<string> text_values, List<string> select_values, string Skin_Code, User_Object Current_User, Web_Language_Enum CurrentLanguage, Language_Support_Info Translator, string Base_URL )
        {
            if (text_values.Count == 0)
            {
                text_values.Add(String.Empty);
                select_values.Add(String.Empty);
            }

            string id_name = html_element_name.Replace("_", "");

            Output.WriteLine("  <!-- " + Title + " Element -->");
            Output.WriteLine("  <tr align=\"left\">");
            Output.WriteLine("    <td width=\"" + LEFT_MARGIN + "px\">&nbsp;</td>");
            if (Acronym.Length > 0)
            {
                Output.WriteLine("    <td valign=\"top\" class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\"><acronym title=\"" + Acronym + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</acronym></a></td>");
            }
            else
            {
                Output.WriteLine("    <td valign=\"top\" class=\"metadata_label\"><a href=\"" + Help_URL(Skin_Code, Base_URL) + "\" target=\"_" + html_element_name.ToUpper() + "\">" + Translator.Get_Translation(Title, CurrentLanguage) + ":</a></td>");
            }
            Output.WriteLine("    <td>");
            Output.WriteLine("      <table><tr><td>");
            Output.WriteLine("      <div id=\"" + html_element_name + "_div\">");
            for (int i = 1; i <= text_values.Count; i++)
            {
                // Write the text box
                Output.Write("        <input name=\"" + id_name + "_text" + i + "\" id=\"" + id_name + "_text" + i + "\" class=\"" + html_element_name + "_input\" type=\"text\" value=\"" + HttpUtility.HtmlEncode(text_values[i - 1]) + "\" onfocus=\"javascript:textbox_enter('" + id_name + "_text" + i + "','" + html_element_name + "_input_focused')\" onblur=\"javascript:textbox_leave('" + id_name + "_text" + i + "','" + html_element_name + "_input')\" />");

                // If there is a second label, draw that
                if (second_label.Length > 0)
                {
                    Output.WriteLine("<span class=\"metadata_sublabel\">" + Translator.Get_Translation(second_label, CurrentLanguage) + ":</span>");
                }
                else
                {
                    Output.WriteLine();
                }

                // Write the combo box
                Output.WriteLine("        <select class=\"" + html_element_name + "_select\" name=\"" + id_name + "_select" + i + "\" id=\"" + id_name + "_select" + i + "\" onfocus=\"javascript:textbox_enter('" + id_name + "_select" + i + "','" + html_element_name + "_select_focused')\" onblur=\"javascript:selectbox_leave('" + id_name + "_select" + i + "','" + html_element_name + "_select','" + html_element_name + "_select_init')\" >");

                bool found_option = false;
                for ( int j = 0 ; j < possible_select_items_text.Count ; j++ )
                {
                    if ((i < possible_select_items_text.Count) && (possible_select_items_text[j] == select_values[i - 1]))
                    {
                        if (possible_select_items_value.Count > j)
                        {
                            Output.WriteLine("          <option selected=\"selected=\" value=\"" + possible_select_items_value[j] + "\">" + possible_select_items_text[j] + "</option>");
                        }
                        else
                        {
                            Output.WriteLine("          <option selected=\"selected=\" value=\"" + possible_select_items_text[j] + "\">" + possible_select_items_text[j] + "</option>");
                        }
                        found_option = true;
                    }
                    else
                    {
                        if (possible_select_items_value.Count > j)
                        {
                            Output.WriteLine("          <option value=\"" + possible_select_items_value[j] + "\">" + possible_select_items_text[j] + "</option>");
                        }
                        else
                        {
                            Output.WriteLine("          <option value=\"" + possible_select_items_text[j] + "\">" + possible_select_items_text[j] + "</option>");
                        }
                    }
                }

                if (( i <= select_values.Count ) && ( select_values[i-1].Length > 0  ) && ( !Restrict_Values ) && ( !found_option ))
                {
                    Output.WriteLine("          <option value=\"" + select_values[i-1] + "\" selected=\"selected=\">" + select_values[i-1] + "</option>");
                }
                Output.Write("        </select>");

                if (i == text_values.Count )
                {
                    Output.WriteLine();
                    Output.WriteLine("      </div>");
                }
                else
                {
                    Output.WriteLine("<br />");
                }
            }

            Output.WriteLine("    </td>");
            Output.WriteLine("    <td valign=\"bottom\" >");

            if (Repeatable)
//.........这里部分代码省略.........
开发者ID:randomyed,项目名称:SobekCM-Web-Application,代码行数:101,代码来源:textBox_ComboBox_Element.cs


注:本文中的SobekCM.Library.Application_State.Language_Support_Info.Get_Translation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。