コード例 #1
0
        /// <summary> Adds the internal header HTML for this specific HTML writer </summary>
        /// <param name="Output"> Stream to which to write the HTML for the internal header information </param>
        /// <param name="Current_User"> Currently logged on user, to determine specific rights </param>
        public override void Add_Internal_Header_HTML(TextWriter Output, User_Object Current_User)
        {
            if ((Current_User != null) && ( currentMode.Aggregation.Length > 0 ) && ( currentMode.Aggregation.ToUpper() != "ALL" ) && ((Current_User.Is_Aggregation_Curator(currentMode.Aggregation)) || (Current_User.Is_Internal_User) || ( Current_User.Can_Edit_All_Items( currentMode.Aggregation ))))
            {
                Output.WriteLine("  <table cellspacing=\"0\" id=\"internalheader_aggr\">");
                Output.WriteLine("    <tr height=\"45px\">");
                Output.WriteLine("      <td align=\"left\" width=\"100px\">");
                Output.WriteLine("          <button title=\"Hide Internal Header\" class=\"intheader_button_aggr hide_intheader_button_aggr\" onclick=\"return hide_internal_header();\" alt=\"Hide Internal Header\"></button>");
                Output.WriteLine("      </td>");

                Output.WriteLine("      <td align=\"center\" valign=\"middle\">");

                // Add button to view private items
                Display_Mode_Enum displayMode = currentMode.Mode;
                string submode = currentMode.Info_Browse_Mode;

                currentMode.Mode = Display_Mode_Enum.Aggregation_Private_Items;
                currentMode.Info_Browse_Mode = String.Empty;
                Output.WriteLine("          <button title=\"View Private Items\" class=\"intheader_button_aggr view_private_items\" onclick=\"window.location.href='" + currentMode.Redirect_URL() + "';return false;\" ></button>");

                // Add button to view item count information
                currentMode.Mode = Display_Mode_Enum.Aggregation_Item_Count;
                Output.WriteLine("          <button title=\"View Item Count\" class=\"intheader_button_aggr show_item_count\" onclick=\"window.location.href='" + currentMode.Redirect_URL() + "';return false;\"></button>");

                // Add button to view usage statistics information
                currentMode.Mode = Display_Mode_Enum.Aggregation_Usage_Statistics;
                Output.WriteLine("          <button title=\"View Usage Statistics\" class=\"intheader_button_aggr show_usage_statistics\" onclick=\"window.location.href='" + currentMode.Redirect_URL() + "';return false;\"></button>");

                // Add admin view is system administrator
                if ((Current_User.Is_System_Admin) || (Current_User.Is_Aggregation_Curator(Hierarchy_Object.Code)))
                {
                    currentMode.Mode = Display_Mode_Enum.Administrative;
                    currentMode.Admin_Type = Admin_Type_Enum.Aggregation_Single;
                    Output.WriteLine("          <button title=\"Edit Administrative Information\" class=\"intheader_button_aggr admin_view_button\" onclick=\"window.location.href='" + currentMode.Redirect_URL() + "';return false;\" ></button>");
                }
                else
                {
                    currentMode.Mode = Display_Mode_Enum.Aggregation_Admin_View;
                    Output.WriteLine("          <button title=\"View Administrative Information\" class=\"intheader_button_aggr admin_view_button\" onclick=\"window.location.href='" + currentMode.Redirect_URL() + "';return false;\" ></button>");
                }
                Output.WriteLine("      </td>");

                currentMode.Info_Browse_Mode = submode;
                currentMode.Mode = displayMode;

                // Add the HELP icon next
                Output.WriteLine("      <td align=\"left\" width=\"30px\">");
                Output.WriteLine("        <span class=\"intheader_help\"><a href=\"" + SobekCM_Library_Settings.Help_URL(currentMode.Base_URL) + "help/aggrheader\" title=\"Help regarding this header\" ><img src=\"" + currentMode.Base_URL + "default/images/help_button_darkgray.jpg\" alt=\"?\" title=\"Help regarding this header\" /></a></span>");
                Output.WriteLine("      </td>");

                Add_Internal_Header_Search_Box(Output);

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

                Output.WriteLine("  </table>");
            }
            else
            {
                base.Add_Internal_Header_HTML(Output, Current_User);
            }
        }