private static ServiceAction GetServiceAction(Content context, Node view, bool addFullPath, string portletId, string selectedView, string backUrl)
{
//create app-less action for view selection
var act = ActionFramework.GetAction("ServiceAction", context, backUrl,
new
{
path = context.Path,
uiContextId = portletId ?? string.Empty,
view = addFullPath ? view.Path : view.Name
}) as ServiceAction;
if (act == null)
return null;
var gc = view as GenericContent;
var icon = gc != null ? gc.Icon : string.Empty;
if (string.IsNullOrEmpty(icon))
icon = "views";
act.Name = "ServiceAction";
act.ServiceName = "ContentListViewHelper.mvc";
act.MethodName = "SetView";
act.Text = view.DisplayName;
act.Icon = icon;
if (selectedView.CompareTo(view.Name) == 0 || selectedView.CompareTo(view.Path) == 0)
{
act.CssClass = (act.CssClass + " sn-actionlink-selectedview").TrimStart(new[] { ' ' });
act.Forbidden = true;
}
return act;
}
}