本文整理汇总了C#中SobekCM.Core.Users.User_Object.Is_In_Bookshelf方法的典型用法代码示例。如果您正苦于以下问题:C# User_Object.Is_In_Bookshelf方法的具体用法?C# User_Object.Is_In_Bookshelf怎么用?C# User_Object.Is_In_Bookshelf使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SobekCM.Core.Users.User_Object
的用法示例。
在下文中一共展示了User_Object.Is_In_Bookshelf方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Add_Main_Menu
public void Add_Main_Menu(TextWriter Output, string CurrentCode, bool ItemRestrictedFromUserByIP, bool ItemCheckedOutByOtherUser, BriefItemInfo CurrentItem, Navigation_Object CurrentMode, User_Object CurrentUser, Custom_Tracer Tracer)
{
// Set some flags based on the resource type
bool is_bib_level = (String.Compare(CurrentItem.Type, "BIB_LEVEL", StringComparison.OrdinalIgnoreCase) == 0);
bool is_ead = (String.Compare(CurrentItem.Type, "EAD", StringComparison.OrdinalIgnoreCase) == 0);
// Determine if this user can edit this item
bool userCanEditItem = false;
if (CurrentUser != null)
{
userCanEditItem = CurrentUser.Can_Edit_This_Item(CurrentItem.BibID, CurrentItem.Type, CurrentItem.Behaviors.Source_Institution_Aggregation, CurrentItem.Behaviors.Holding_Location_Aggregation, CurrentItem.Behaviors.Aggregation_Code_List);
}
// Can this user (if there is one) edit this item?
bool canManage = (CurrentUser != null) && (CurrentUser.Can_Edit_This_Item(CurrentItem.BibID, CurrentItem.Type, CurrentItem.Behaviors.Source_Institution_Aggregation, CurrentItem.Behaviors.Holding_Location_Aggregation, CurrentItem.Behaviors.Aggregation_Code_List));
// Add the item views
Output.WriteLine("<!-- Add the different view and social options -->");
Output.WriteLine("<nav class=\"sbkMenu_Bar\" id=\"sbkIsw_MenuBar\" role=\"navigation\" aria-label=\"Item menu\">");
Output.WriteLine("\t<h2 class=\"hidden-element\">Item menu</h2>");
// Check that this item is not checked out by another user
bool itemCheckedOutByOtherUser = false;
if (CurrentItem.Behaviors.Single_Use)
{
if (!Engine_ApplicationCache_Gateway.Checked_List.Check_Out(CurrentItem.Web.ItemID, HttpContext.Current.Request.UserHostAddress))
{
itemCheckedOutByOtherUser = true;
}
}
// Add the sharing buttons if this is not restricted by IP address or checked out
if ((!ItemRestrictedFromUserByIP) && (!ItemCheckedOutByOtherUser) && (!CurrentMode.Is_Robot))
{
string add_text = "Add";
string remove_text = "Remove";
string send_text = "Send";
string print_text = "Print";
if (canManage)
{
add_text = String.Empty;
remove_text = String.Empty;
send_text = String.Empty;
print_text = String.Empty;
}
string logOnUrl = String.Empty;
bool isLoggedOn = CurrentUser != null && CurrentUser.LoggedOn;
if (!isLoggedOn)
{
string returnUrl = UrlWriterHelper.Redirect_URL(CurrentMode);
CurrentMode.Mode = Display_Mode_Enum.My_Sobek;
CurrentMode.My_Sobek_Type = My_Sobek_Type_Enum.Logon;
CurrentMode.Return_URL = returnUrl;
logOnUrl = UrlWriterHelper.Redirect_URL(CurrentMode);
CurrentMode.Mode = Display_Mode_Enum.Item_Display;
CurrentMode.Return_URL = String.Empty;
}
Output.WriteLine("\t<div id=\"menu-right-actions\">");
if (( CurrentItem.Web != null ) && ( CurrentItem.Web.ItemID > 0))
{
string print_item_form_open_url = UI_ApplicationCache_Gateway.Settings.Servers.Engine_URL + "items/html/print/" + CurrentItem.BibID + "/" + CurrentItem.VID + "/" + CurrentMode.ViewerCode;
Output.WriteLine("\t\t<span id=\"printbuttonitem\" class=\"action-sf-menu-item\" onclick=\"print_form_open('" + print_item_form_open_url + "');\"><img src=\"" + Static_Resources_Gateway.Printer_Png + "\" alt=\"\" style=\"vertical-align:middle\" /><span id=\"printbuttonspan\">" + print_text + "</span></span>");
}
else
{
Output.WriteLine("\t\t<span id=\"printbuttonitem\" class=\"action-sf-menu-item\" onclick=\"window.print();return false;\"><img src=\"" + Static_Resources_Gateway.Printer_Png + "\" alt=\"\" style=\"vertical-align:middle\" /><span id=\"printbuttonspan\">" + print_text + "</span></span>");
}
if (isLoggedOn)
{
string email_item_form_open_url = UI_ApplicationCache_Gateway.Settings.Servers.Engine_URL + "items/html/send/" + CurrentItem.BibID + "/" + CurrentItem.VID;
Output.WriteLine("\t\t<span id=\"sendbuttonitem\" class=\"action-sf-menu-item\" onclick=\"email_form_open('" + email_item_form_open_url + "');\"><img src=\"" + Static_Resources_Gateway.Email_Png + "\" alt=\"\" style=\"vertical-align:middle\" /><span id=\"sendbuttonspan\">" + send_text + "</span></span>");
if ((CurrentItem.Web != null) && (CurrentItem.Web.ItemID > 0))
{
if (CurrentUser.Is_In_Bookshelf(CurrentItem.BibID, CurrentItem.VID))
{
Output.WriteLine("\t\t<span id=\"addbuttonitem\" class=\"action-sf-menu-item\" onclick=\"return remove_item_itemviewer();\"><img src=\"" + Static_Resources_Gateway.Minussign_Png + "\" alt=\"\" style=\"vertical-align:middle\" /><span id=\"addbuttonspan\">" + remove_text + "</span></span>");
}
else
{
// Determine the URL
string add_item_form_open_url = UI_ApplicationCache_Gateway.Settings.Servers.Engine_URL + "items/html/bookshelf/" + CurrentUser.UserID + "/" + CurrentItem.BibID + "/" + CurrentItem.VID;
Output.WriteLine("\t\t<span id=\"addbuttonitem\" class=\"action-sf-menu-item\" onclick=\"add_item_form_open('" + add_item_form_open_url + "');return false;\"><img src=\"" + Static_Resources_Gateway.Plussign_Png + "\" alt=\"\" style=\"vertical-align:middle\" /><span id=\"addbuttonspan\">" + add_text + "</span></span>");
}
}
}
else
{
Output.WriteLine("\t\t<span id=\"sendbuttonitem\" class=\"action-sf-menu-item\" onclick=\"window.location='" + logOnUrl + "';return false;\"><img src=\"" + Static_Resources_Gateway.Email_Png + "\" alt=\"\" style=\"vertical-align:middle\" /><span id=\"sendbuttonspan\">" + send_text + "</span></span>");
if ((CurrentItem.Web != null) && (CurrentItem.Web.ItemID > 0))
Output.WriteLine("\t\t<span id=\"addbuttonitem\" class=\"action-sf-menu-item\" onclick=\"window.location='" + logOnUrl + "';return false;\"><img src=\"" + Static_Resources_Gateway.Plussign_Png + "\" alt=\"\" style=\"vertical-align:middle\" /><span id=\"addbuttonspan\">" + add_text + "</span></span>");
}
string share_item_form_open_url = UI_ApplicationCache_Gateway.Settings.Servers.Engine_URL + "items/html/share/" + CurrentItem.BibID + "/" + CurrentItem.VID;
//.........这里部分代码省略.........