Exemple #1
0
        protected override TreeNodeCollection GetTreeNodes(string id, FormDataCollection queryStrings)
        {
            var nodes        = new TreeNodeCollection();
            var settings     = _settingsService.GetSettings();
            var trashedNodes = _umbracoDbRepository.GetTrashedNodes();

            if (id == PackageConstants.FirstNodeId && settings != null && !settings.HideLeftPanel)
            {
                foreach (var timage in _imageService.GetTopOptimizedImages())
                {
                    var treeNode = CreateTreeNode(timage.Id + string.Empty, id, queryStrings, timage.Name, PackageConstants.TreeIcon, false,
                                                  queryStrings.GetValue <string>(PackageConstants.AppAlias) + PackageConstants.CustomTreeUrl +
                                                  SolutionExtensions.Base64Encode(timage.Id));

                    if (trashedNodes.Count(idNode => timage.Id.Equals(idNode.ToString())) != 0)
                    {
                        treeNode.Name += " (trashed)";
                    }

                    treeNode.MenuUrl = null;
                    nodes.Add(treeNode);
                }
            }
            return(nodes);
        }