Exemple #1
0
        /// <summary>
        /// creates a new XmlTreeNode with the default parameters for the BaseTree root node
        /// </summary>
        /// <param name="bTree"></param>
        /// <returns></returns>
        public static XmlTreeNode CreateRoot(BaseTree bTree)
        {
            XmlTreeNode xNode = new XmlTreeNode();

            xNode.NodeID   = bTree.StartNodeID.ToString();
            xNode.Source   = bTree.GetTreeServiceUrl();
            xNode.Menu     = bTree.RootNodeActions.FindAll(delegate(IAction a) { return(true); });        //return a duplicate copy of the list
            xNode.NodeType = bTree.TreeAlias;
            xNode.Text     = BaseTree.GetTreeHeader(bTree.TreeAlias);
            //by default, all root nodes will open the dashboard to their application
            xNode.Action = "javascript:" + ClientTools.Scripts.OpenDashboard(bTree.app);
            xNode.IsRoot = true;
            //generally the tree type and node type are the same but in some cased they are not.
            xNode.m_treeType = bTree.TreeAlias;
            return(xNode);
        }
Exemple #2
0
        /// <summary>
        /// creates a new XmlTreeNode with the default parameters for the BaseTree root node
        /// </summary>
        /// <param name="bTree"></param>
        /// <returns></returns>
        public static XmlTreeNode CreateRoot(BaseTree bTree)
        {
            XmlTreeNode xNode = new XmlTreeNode();

            xNode.NodeID   = bTree.StartNodeID.ToString();
            xNode.Source   = bTree.GetTreeServiceUrl();
            xNode.Menu     = bTree.RootNodeActions.FindAll(delegate(IAction a) { return(true); });        //return a duplicate copy of the list
            xNode.NodeType = bTree.TreeAlias;
            xNode.Text     = BaseTree.GetTreeHeader(bTree.TreeAlias);

            // By default the action from the trees.config will be used, if none is specified then the apps dashboard will be used.
            var appTreeItem = umbraco.BusinessLogic.ApplicationTree.getByAlias(bTree.TreeAlias);

            xNode.Action = appTreeItem == null || String.IsNullOrEmpty(appTreeItem.Action) ? "javascript:" + ClientTools.Scripts.OpenDashboard(bTree.app) : "javascript:" + appTreeItem.Action;

            xNode.IsRoot = true;
            //generally the tree type and node type are the same but in some cased they are not.
            xNode.m_treeType = bTree.TreeAlias;
            return(xNode);
        }
Exemple #3
0
		/// <summary>
		/// creates a new XmlTreeNode with the default parameters for the BaseTree root node
		/// </summary>
		/// <param name="bTree"></param>
		/// <returns></returns>
		public static XmlTreeNode CreateRoot(BaseTree bTree)
		{
			XmlTreeNode xNode = new XmlTreeNode();
			xNode.NodeID = bTree.StartNodeID.ToString();
			xNode.Source = bTree.GetTreeServiceUrl();
			xNode.Menu = bTree.RootNodeActions.FindAll(delegate(IAction a) { return true; }); //return a duplicate copy of the list
			xNode.NodeType = bTree.TreeAlias;
			xNode.Text = BaseTree.GetTreeHeader(bTree.TreeAlias);
			
            // By default the action from the trees.config will be used, if none is specified then the apps dashboard will be used.
            var appTreeItem = umbraco.BusinessLogic.ApplicationTree.getByAlias(bTree.TreeAlias);
            xNode.Action = appTreeItem == null || String.IsNullOrEmpty(appTreeItem.Action) ? "javascript:" + ClientTools.Scripts.OpenDashboard(bTree.app) : "javascript:" + appTreeItem.Action;
			
            xNode.IsRoot = true;
			//generally the tree type and node type are the same but in some cased they are not.
			xNode.m_treeType = bTree.TreeAlias;
			return xNode;
		}
Exemple #4
0
		/// <summary>
		/// creates a new XmlTreeNode with the default parameters for the BaseTree root node
		/// </summary>
		/// <param name="bTree"></param>
		/// <returns></returns>
		public static XmlTreeNode CreateRoot(BaseTree bTree)
		{
			XmlTreeNode xNode = new XmlTreeNode();
			xNode.NodeID = bTree.StartNodeID.ToString();
			xNode.Source = bTree.GetTreeServiceUrl();
			xNode.Menu = bTree.RootNodeActions.FindAll(delegate(IAction a) { return true; }); //return a duplicate copy of the list
			xNode.NodeType = bTree.TreeAlias;
			xNode.Text = BaseTree.GetTreeHeader(bTree.TreeAlias);
			//by default, all root nodes will open the dashboard to their application
			xNode.Action = "javascript:" + ClientTools.Scripts.OpenDashboard(bTree.app);
			xNode.IsRoot = true;
			//generally the tree type and node type are the same but in some cased they are not.
			xNode.m_treeType = bTree.TreeAlias;
			return xNode;
		}