Exemplo n.º 1
0
 internal UserPollsNavigationItem(ICustomNavigationPlugin plugin, ICustomNavigationItemConfiguration configuration, Guid id, int userId, Func <string> getLabel)
 {
     Plugin        = plugin;
     Configuration = configuration;
     UniqueID      = id;
     _userId       = userId;
     _getLabel     = getLabel;
 }
Exemplo n.º 2
0
 internal PollGroupNavigationItem(ICustomNavigationPlugin plugin, ICustomNavigationItemConfiguration configuration, Guid id, int groupId, Func <string> getLabel)
 {
     Plugin        = plugin;
     Configuration = configuration;
     UniqueID      = id;
     _groupId      = groupId;
     _getLabel     = getLabel;
 }
Exemplo n.º 3
0
 internal MapsGroupNavigationItem(ICustomNavigationPlugin plugin, ICustomNavigationItemConfiguration configuration, Guid id, int groupId, Func <string> getLabel)
 {
     Plugin        = plugin;
     Configuration = configuration;
     UniqueID      = id;
     _mapbooks     = PublicApi.MapBooks.List(groupId);
     _groupId      = groupId;
     _getLabel     = getLabel;
 }
Exemplo n.º 4
0
        public ICustomNavigationItem GetNavigationItem(Guid id, ICustomNavigationItemConfiguration configuration)
        {
            int groupId = configuration.GetIntValue("groupid", -1);
            if (groupId == -1)
                return null;

            string label = configuration.GetStringValue("label", "");

            return new PollGroupNavigationItem(this, configuration, id, groupId, () => string.IsNullOrEmpty(label) ?  _translation.GetLanguageResourceValue("configuration_defaultLabel") : label);
        }
Exemplo n.º 5
0
 internal MapsGroupNavigationItem(ICustomNavigationPlugin plugin, ICustomNavigationItemConfiguration configuration, Guid id, int groupId, string label = "")
 {
     Plugin        = plugin;
     Configuration = configuration;
     UniqueID      = id;
     _groupId      = groupId;
     maplistOp.IncludeSubGroups = false;
     _mapbooks = PublicApi.MapBooks.List(groupId, maplistOp);
     _mapbook  = _mapbooks.FirstOrDefault();
     Label     = string.IsNullOrEmpty(label)? _getAppLabel(_mapbook): label;
     Plugin    = plugin;
 }
Exemplo n.º 6
0
        public ICustomNavigationItem GetNavigationItem(Guid id, ICustomNavigationItemConfiguration configuration)
        {
            int groupId = configuration.GetIntValue("groupid", -1);

            if (groupId == -1)
            {
                return(null);
            }

            string label = configuration.GetStringValue("label", "");

            return(new PollGroupNavigationItem(this, configuration, id, groupId, () => string.IsNullOrEmpty(label) ?  _translation.GetLanguageResourceValue("configuration_defaultLabel") : label));
        }
Exemplo n.º 7
0
        public ICustomNavigationItem GetDefaultNavigationItem(ICustomNavigationItemConfiguration configuration)
        {
            Telligent.Evolution.Extensibility.Api.Entities.Version1.User user = null;
            if (configuration.GetStringValue("user", "current") == "accessing")
                user = TEApi.Users.AccessingUser;
            else
            {
                var userItem = TEApi.Url.CurrentContext.ContextItems.GetItemByContentType(TEApi.Users.ContentTypeId);
                if (userItem != null)
                    user = TEApi.Users.Get(new UsersGetOptions() { ContentId = userItem.ContentId });
            }

            return new UserPollsNavigationItem(this, configuration, _defaultId, user.Id.Value, () => _translation.GetLanguageResourceValue("configuration_defaultLabel"));
        }
        public ICustomNavigationItem GetDefaultNavigationItem(int groupId, ICustomNavigationItemConfiguration configuration)
        {
            string label = translationController.GetLanguageResourceValue("configuration_defaultLabel");

            return(new CustomNavigationItem(Id,
                                            () => GetNavigationLabel(groupId, label),
                                            () => GetNavigationUrl(groupId),
                                            (int userId) => GetIsVisible(groupId, userId, Configuration),
                                            () => TEApi.Url.CurrentContext.ApplicationTypeId == Id)
            {
                Configuration = configuration,
                Plugin = this,
                CssClass = "sharepoint-libraries"
            });
        }
Exemplo n.º 9
0
        public ICustomNavigationItem GetNavigationItem(Guid id, ICustomNavigationItemConfiguration configuration)
        {
            Telligent.Evolution.Extensibility.Api.Entities.Version1.User user = null;
            if (configuration.GetStringValue("user", "current") == "accessing")
            {
                user = TEApi.Users.AccessingUser;
            }
            else
            {
                var userItem = TEApi.Url.CurrentContext.ContextItems.GetItemByContentType(TEApi.Users.ContentTypeId);
                if (userItem != null)
                {
                    user = TEApi.Users.Get(new UsersGetOptions()
                    {
                        ContentId = userItem.ContentId
                    });
                }
            }

            return(new UserPollsNavigationItem(this, configuration, id, user.Id.Value, () => _translation.GetLanguageResourceValue("configuration_defaultLabel")));
        }
        public ICustomNavigationItem GetNavigationItem(Guid itemId, ICustomNavigationItemConfiguration configuration)
        {
            int groupId;

            if (!int.TryParse(HttpUtility.ParseQueryString(configuration.GetStringValue("group", ""))["Group"], out groupId))
            {
                return(null);
            }

            if (groupId <= 0)
            {
                var group = CoreContext.Instance().CurrentGroup;
                if (group != null)
                {
                    groupId = group.ID;
                }
                else
                {
                    return(null);
                }
            }

            string label = configuration.GetStringValue("label", "");

            if (string.IsNullOrEmpty(label))
            {
                label = translationController.GetLanguageResourceValue("configuration_defaultLabel");
            }

            return(new CustomNavigationItem(Id,
                                            () => GetNavigationLabel(groupId, label),
                                            () => GetNavigationUrl(groupId),
                                            (int userId) => GetIsVisible(groupId, userId, Configuration),
                                            () => TEApi.Url.CurrentContext.ApplicationTypeId == Id)
            {
                Configuration = configuration,
                Plugin = this,
                CssClass = "sharepoint-libraries"
            });
        }
Exemplo n.º 11
0
 public ICustomNavigationItem GetDefaultNavigationItem(int groupId, ICustomNavigationItemConfiguration configuration)
 {
     return(new PollGroupNavigationItem(this, configuration, _defaultId, groupId, () => _translation.GetLanguageResourceValue("configuration_defaultLabel")));
 }
Exemplo n.º 12
0
 internal UserPollsNavigationItem(ICustomNavigationPlugin plugin, ICustomNavigationItemConfiguration configuration, Guid id, int userId, Func<string> getLabel)
 {
     Plugin = plugin;
     Configuration = configuration;
     UniqueID = id;
     _userId = userId;
     _getLabel = getLabel;
 }
 public ICustomNavigationItem GetNavigationItem(Guid id, ICustomNavigationItemConfiguration configuration)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 14
0
 public ICustomNavigationItem GetDefaultNavigationItem(int groupId, ICustomNavigationItemConfiguration configuration)
 {
     return new PollGroupNavigationItem(this, configuration, _defaultId, groupId, () => _translation.GetLanguageResourceValue("configuration_defaultLabel"));
 }
Exemplo n.º 15
0
 internal PollGroupNavigationItem(ICustomNavigationPlugin plugin, ICustomNavigationItemConfiguration configuration, Guid id, int groupId, Func<string> getLabel)
 {
     Plugin = plugin;
     Configuration = configuration;
     UniqueID = id;
     _groupId = groupId;
     _getLabel = getLabel;
 }