Exemplo n.º 1
0
 /// <summary>
 /// Creates the root node for the content tree. If the current User does
 /// not have access to the actual content tree root, then we'll display the
 /// node that correlates to their StartNodeID
 /// </summary>
 /// <param name="rootNode"></param>
 protected override void CreateRootNode(ref XmlTreeNode rootNode)
 {
     if (StartNodeID != -1)
     {
         Document doc = StartNode;
         if (doc == null)
         {
             rootNode             = new NullTree(this.app).RootNode;
             rootNode.Text        = "You do not have permission for this content tree";
             rootNode.HasChildren = false;
             rootNode.Source      = string.Empty;
         }
         else
         {
             rootNode = CreateNode(doc, RootNodeActions);
         }
     }
     else
     {
         if (IsDialog)
         {
             rootNode.Action = "javascript:openContent(-1);";
         }
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Load an empty tree structure to show the end user that there was a problem loading the tree.
        /// </summary>
        private void LoadNullTree()
        {
            BaseTree nullTree = new NullTree(m_treeParams.Application);

            nullTree.SetTreeParameters(m_treeParams);
            nullTree.Render(ref m_xTree);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Load an empty tree structure to show the end user that there was a problem loading the tree.
        /// </summary>
        private void LoadNullTree(TreeRequestParams treeParams)
        {
            BaseTree nullTree = new NullTree(treeParams.Application);

            nullTree.SetTreeParameters(treeParams);
            nullTree.Render(ref _xTree);
        }
        /// <summary>
        /// Determines if it needs to render a null tree based on the start node id and returns true if it is the case.
        /// </summary>
        /// <param name="tree"></param>
        /// <param name="startNodeId"></param>
        /// <param name="rootNode"></param>
        /// <param name="app"></param>
        /// <returns></returns>
        internal static bool SetNullTreeRootNode(this BaseTree tree, int startNodeId, ref XmlTreeNode rootNode, string app)
        {
            if (startNodeId == NoAccessId)
            {
                rootNode             = new NullTree(app).RootNode;
                rootNode.Text        = "You do not have permission to view this tree";
                rootNode.HasChildren = false;
                rootNode.Source      = string.Empty;
                return(true);
            }

            if (startNodeId == NoChildNodesId)
            {
                rootNode             = new NullTree(app).RootNode;
                rootNode.Text        = "[No start node found]";
                rootNode.HasChildren = false;
                rootNode.Source      = string.Empty;
                return(true);
            }

            return(false);
        }