本文整理汇总了C#中SobekCM.Library.Users.User_Object.Set_Aggregation_Home_Page_Flag方法的典型用法代码示例。如果您正苦于以下问题:C# User_Object.Set_Aggregation_Home_Page_Flag方法的具体用法?C# User_Object.Set_Aggregation_Home_Page_Flag怎么用?C# User_Object.Set_Aggregation_Home_Page_Flag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SobekCM.Library.Users.User_Object
的用法示例。
在下文中一共展示了User_Object.Set_Aggregation_Home_Page_Flag方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Aggregation_HtmlSubwriter
/// <summary> Constructor creates a new instance of the Aggregation_HtmlSubwriter class </summary>
/// <param name="Hierarchy_Object"> Current item aggregation object to display </param>
/// <param name="Current_Mode"> Mode / navigation information for the current request</param>
/// <param name="HTML_Skin"> HTML Web skin which controls the overall appearance of this digital library </param>
/// <param name="Translator"> Language support object which handles simple translational duties </param>
/// <param name="Browse_Object"> Object contains all the basic information about any browse or info display </param>
/// <param name="Paged_Results"> Paged results to display within a browse or search result </param>
/// <param name="Results_Statistics"> Information about the entire set of results for a search or browse </param>
/// <param name="Code_Manager"> List of valid collection codes, including mapping from the Sobek collections to Greenstone collections</param>
/// <param name="All_Items_Lookup"> Lookup object used to pull basic information about any item loaded into this library </param>
/// <param name="Thematic_Headings"> Headings under which all the highlighted collections on the home page are organized </param>
/// <param name="Current_User"> Currently logged on user </param>
/// <param name="IP_Restrictions"> IP restrictions, used to determine if a user has access to a particular item </param>
/// <param name="Static_Web_Content"> HTML content-based browse, info, or imple CMS-style web content objects. These are objects which are read from a static HTML file and much of the head information must be maintained </param>
/// <param name="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering </param>
public Aggregation_HtmlSubwriter(Item_Aggregation Hierarchy_Object,
SobekCM_Navigation_Object Current_Mode, SobekCM_Skin_Object HTML_Skin,
Language_Support_Info Translator,
Item_Aggregation_Browse_Info Browse_Object,
Search_Results_Statistics Results_Statistics,
List<iSearch_Title_Result> Paged_Results,
Aggregation_Code_Manager Code_Manager, Item_Lookup_Object All_Items_Lookup,
List<Thematic_Heading> Thematic_Headings, User_Object Current_User,
IP_Restriction_Ranges IP_Restrictions,
HTML_Based_Content Static_Web_Content,
Custom_Tracer Tracer )
{
currentUser = Current_User;
base.Hierarchy_Object = Hierarchy_Object;
currentMode = Current_Mode;
Skin = HTML_Skin;
translator = Translator;
thisBrowseObject = Browse_Object;
thisStaticBrowseObject = Static_Web_Content;
codeManager = Code_Manager;
itemList = All_Items_Lookup;
thematicHeadings = Thematic_Headings;
ipRestrictions = IP_Restrictions;
resultsStatistics = Results_Statistics;
pagedResults = Paged_Results;
NameValueCollection form = HttpContext.Current.Request.Form;
if (form["item_action"] != null)
{
string action = form["item_action"].ToLower().Trim();
if (action == "add_aggregation")
{
SobekCM_Database.User_Set_Aggregation_Home_Page_Flag(currentUser.UserID, base.Hierarchy_Object.Aggregation_ID, true, Tracer);
currentUser.Set_Aggregation_Home_Page_Flag(base.Hierarchy_Object.Code, base.Hierarchy_Object.Name, true);
HttpContext.Current.Session.Add("ON_LOAD_MESSAGE", "Added aggregation to your home page");
}
if (action == "remove_aggregation")
{
int removeAggregationID = base.Hierarchy_Object.Aggregation_ID;
string remove_code = base.Hierarchy_Object.Code;
string remove_name = base.Hierarchy_Object.Name;
if ((form["aggregation"] != null) && (form["aggregation"].Length > 0))
{
Item_Aggregation_Related_Aggregations aggrInfo = codeManager[form["aggregation"]];
if (aggrInfo != null)
{
remove_code = aggrInfo.Code;
removeAggregationID = aggrInfo.ID;
}
}
SobekCM_Database.User_Set_Aggregation_Home_Page_Flag(currentUser.UserID, removeAggregationID, false, Tracer);
currentUser.Set_Aggregation_Home_Page_Flag(remove_code, remove_name, false);
if (currentMode.Home_Type != Home_Type_Enum.Personalized)
{
HttpContext.Current.Session.Add("ON_LOAD_MESSAGE", "Removed aggregation from your home page");
}
}
if (action == "private_folder")
{
User_Folder thisFolder = currentUser.Get_Folder(form["aggregation"]);
if (SobekCM_Database.Edit_User_Folder(thisFolder.Folder_ID, currentUser.UserID, -1, thisFolder.Folder_Name, false, String.Empty, Tracer) >= 0)
thisFolder.isPublic = false;
}
if (action == "email")
{
string address = form["email_address"].Replace(";", ",").Trim();
string comments = form["email_comments"].Trim();
string format = form["email_format"].Trim().ToUpper();
if (address.Length > 0)
{
// Determine the email format
bool is_html_format = true;
if (format == "TEXT")
is_html_format = false;
// CC: the user, unless they are already on the list
string cc_list = currentUser.Email;
//.........这里部分代码省略.........
示例2: Aggregation_HtmlSubwriter
/// <summary> Constructor creates a new instance of the Aggregation_HtmlSubwriter class </summary>
/// <param name="Current_Aggregation"> Current item aggregation object to display </param>
/// <param name="Current_Mode"> Mode / navigation information for the current request</param>
/// <param name="HTML_Skin"> HTML Web skin which controls the overall appearance of this digital library </param>
/// <param name="Translator"> Language support object which handles simple translational duties </param>
/// <param name="Browse_Object"> Object contains all the basic information about any browse or info display </param>
/// <param name="Paged_Results"> Paged results to display within a browse or search result </param>
/// <param name="Results_Statistics"> Information about the entire set of results for a search or browse </param>
/// <param name="Code_Manager"> List of valid collection codes, including mapping from the Sobek collections to Greenstone collections</param>
/// <param name="All_Items_Lookup"> Lookup object used to pull basic information about any item loaded into this library </param>
/// <param name="Thematic_Headings"> Headings under which all the highlighted collections on the home page are organized </param>
/// <param name="Current_User"> Currently logged on user (or object representing the unlogged on user's preferences) </param>
/// <param name="Static_Web_Content"> HTML content-based browse, info, or imple CMS-style web content objects. These are objects which are read from a static HTML file and much of the head information must be maintained </param>
/// <param name="Tracer"> Trace object keeps a list of each method executed and important milestones in rendering </param>
public Aggregation_HtmlSubwriter(Item_Aggregation Current_Aggregation,
SobekCM_Navigation_Object Current_Mode, SobekCM_Skin_Object HTML_Skin,
Language_Support_Info Translator,
Item_Aggregation_Child_Page Browse_Object,
Search_Results_Statistics Results_Statistics,
List<iSearch_Title_Result> Paged_Results,
Aggregation_Code_Manager Code_Manager, Item_Lookup_Object All_Items_Lookup,
List<Thematic_Heading> Thematic_Headings, User_Object Current_User,
HTML_Based_Content Static_Web_Content,
Custom_Tracer Tracer )
{
currentUser = Current_User;
base.Current_Aggregation = Current_Aggregation;
currentMode = Current_Mode;
Skin = HTML_Skin;
translator = Translator;
thisBrowseObject = Browse_Object;
thisStaticBrowseObject = Static_Web_Content;
codeManager = Code_Manager;
itemList = All_Items_Lookup;
thematicHeadings = Thematic_Headings;
resultsStatistics = Results_Statistics;
pagedResults = Paged_Results;
leftButtons = String.Empty;
rightButtons = String.Empty;
// Check to see if the user should be able to edit the home page
if ((currentMode.Mode == Display_Mode_Enum.Aggregation) && (currentMode.Aggregation_Type == Aggregation_Type_Enum.Home_Edit))
{
if ( currentUser == null )
currentMode.Aggregation_Type = Aggregation_Type_Enum.Home;
else
{
if ((!currentUser.Is_System_Admin) && (!currentUser.Is_Portal_Admin) && (!currentUser.Is_Aggregation_Admin(Current_Aggregation.Code)))
{
currentMode.Aggregation_Type = Aggregation_Type_Enum.Home;
}
}
}
else if ( currentMode.Aggregation_Type == Aggregation_Type_Enum.Home_Edit )
currentMode.Aggregation_Type = Aggregation_Type_Enum.Home;
NameValueCollection form = HttpContext.Current.Request.Form;
if ( form["item_action"] != null)
{
string action = form["item_action"].ToLower().Trim();
if ((action == "add_aggregation") && ( currentUser != null ))
{
SobekCM_Database.User_Set_Aggregation_Home_Page_Flag(currentUser.UserID, base.Current_Aggregation.Aggregation_ID, true, Tracer);
currentUser.Set_Aggregation_Home_Page_Flag(base.Current_Aggregation.Code, base.Current_Aggregation.Name, true);
HttpContext.Current.Session.Add("ON_LOAD_MESSAGE", "Added aggregation to your home page");
}
if (( action == "remove_aggregation") && ( currentUser != null ))
{
int removeAggregationID = base.Current_Aggregation.Aggregation_ID;
string remove_code = base.Current_Aggregation.Code;
string remove_name = base.Current_Aggregation.Name;
if ((form["aggregation"] != null) && (form["aggregation"].Length > 0))
{
Item_Aggregation_Related_Aggregations aggrInfo = codeManager[form["aggregation"]];
if (aggrInfo != null)
{
remove_code = aggrInfo.Code;
removeAggregationID = aggrInfo.ID;
}
}
SobekCM_Database.User_Set_Aggregation_Home_Page_Flag(currentUser.UserID, removeAggregationID, false, Tracer);
currentUser.Set_Aggregation_Home_Page_Flag(remove_code, remove_name, false);
if (currentMode.Home_Type != Home_Type_Enum.Personalized)
{
HttpContext.Current.Session.Add("ON_LOAD_MESSAGE", "Removed aggregation from your home page");
}
}
if ((action == "private_folder") && ( currentUser != null ))
{
User_Folder thisFolder = currentUser.Get_Folder(form["aggregation"]);
if (SobekCM_Database.Edit_User_Folder(thisFolder.Folder_ID, currentUser.UserID, -1, thisFolder.Folder_Name, false, String.Empty, Tracer) >= 0)
thisFolder.isPublic = false;
}
//.........这里部分代码省略.........