Exemplo n.º 1
0
        public static string GetScriptOnLoad(int siteId, int currentChannelId)
        {
            if (currentChannelId == 0 || currentChannelId == siteId)
            {
                return(string.Empty);
            }

            var nodeInfo = ChannelManager.GetChannelInfo(siteId, currentChannelId);

            if (nodeInfo == null)
            {
                return(string.Empty);
            }

            string path;

            if (nodeInfo.ParentId == siteId)
            {
                path = currentChannelId.ToString();
            }
            else
            {
                path = nodeInfo.ParentsPath.Substring(nodeInfo.ParentsPath.IndexOf(",", StringComparison.Ordinal) + 1) + "," + currentChannelId;
            }
            return(NodeTreeItem.GetScriptOnLoad(path));
        }
Exemplo n.º 2
0
 public static string GetScriptOnLoad(int publishmentSystemID, int currentNodeID)
 {
     if (currentNodeID != 0 && currentNodeID != publishmentSystemID)
     {
         var nodeInfo = NodeManager.GetNodeInfo(publishmentSystemID, currentNodeID);
         if (nodeInfo != null)
         {
             var path = string.Empty;
             if (nodeInfo.ParentId == publishmentSystemID)
             {
                 path = currentNodeID.ToString();
             }
             else
             {
                 path = nodeInfo.ParentsPath.Substring(nodeInfo.ParentsPath.IndexOf(",") + 1) + "," + currentNodeID.ToString();
             }
             return(NodeTreeItem.GetScriptOnLoad(path));
         }
     }
     return(string.Empty);
 }
Exemplo n.º 3
0
 public static string GetScriptOnLoad(int publishmentSystemId, int currentNodeId)
 {
     if (currentNodeId != 0 && currentNodeId != publishmentSystemId)
     {
         var nodeInfo = NodeManager.GetNodeInfo(publishmentSystemId, currentNodeId);
         if (nodeInfo != null)
         {
             string path;
             if (nodeInfo.ParentId == publishmentSystemId)
             {
                 path = currentNodeId.ToString();
             }
             else
             {
                 path = nodeInfo.ParentsPath.Substring(nodeInfo.ParentsPath.IndexOf(",", StringComparison.Ordinal) + 1) + "," + currentNodeId;
             }
             return(NodeTreeItem.GetScriptOnLoad(path));
         }
     }
     return(string.Empty);
 }