Ejemplo n.º 1
0
 public static string GetLargeIconAbsoluteURL(this IWebItem item)
 {
     if (item == null || item.Context == null || String.IsNullOrEmpty(item.Context.LargeIconFileName))
     {
         return(string.Empty);
     }
     return(WebImageSupplier.GetAbsoluteWebPath(item.Context.LargeIconFileName, item.ID));
 }
Ejemplo n.º 2
0
 public static string GetDisabledIconAbsoluteURL(this IWebItem item, WebImageSupplier webImageSupplier)
 {
     if (item == null || item.Context == null || string.IsNullOrEmpty(item.Context.DisabledIconFileName))
     {
         return(string.Empty);
     }
     return(webImageSupplier.GetAbsoluteWebPath(item.Context.DisabledIconFileName, item.ID));
 }
Ejemplo n.º 3
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            Page.RegisterInlineScript(String.Format(" emptyScreenPeopleFilter = '{0}'; ",
                                                    WebImageSupplier.GetAbsoluteWebPath("empty_screen_filter.png")),
                                      onReady: false);
        }
Ejemplo n.º 4
0
 public HistoryCategoryBaseWrapper(ListItem listItem)
     : base(listItem)
 {
     if (!String.IsNullOrEmpty(listItem.AdditionalParams))
     {
         ImagePath = WebImageSupplier.GetAbsoluteWebPath(listItem.AdditionalParams, ProductEntryPoint.ID);
     }
 }
Ejemplo n.º 5
0
        protected override void PageLoad()
        {
            if (!Participant.IsAdmin || Participant.IsVisitor)
            {
                Response.Redirect(PathProvider.BaseVirtualPath, true);
            }

            if (!String.IsNullOrEmpty(UrlParameters.EntityID))
            {
                if (string.Compare(UrlParameters.ActionType, "add", StringComparison.OrdinalIgnoreCase) == 0)
                {
                    var projectAction = (Controls.Templates.CreateProject)LoadControl(PathProvider.GetControlVirtualPath("CreateProject.ascx"));
                    _content.Controls.Add(projectAction);
                    return;
                }

                if (string.Compare(UrlParameters.ActionType, "edit", StringComparison.OrdinalIgnoreCase) == 0)
                {
                    var projectAction = (Controls.Templates.EditTemplate)LoadControl(PathProvider.GetControlVirtualPath("EditTemplate.ascx"));
                    _content.Controls.Add(projectAction);
                    return;
                }
            }
            else
            {
                if (string.Compare(UrlParameters.ActionType, "add", StringComparison.OrdinalIgnoreCase) == 0)
                {
                    var projectAction = (Controls.Templates.EditTemplate)LoadControl(PathProvider.GetControlVirtualPath("EditTemplate.ascx"));
                    _content.Controls.Add(projectAction);
                    return;
                }
            }



            var templates = Global.EngineFactory.GetTemplateEngine().GetAll();

            EmptyListTemplates = templates.Count <= 0;

            if (!EmptyListTemplates)
            {
                Master.JsonPublisher(templates, "templates");
                _hintPopup.Options.IsPopup = true;
            }

            var escNoTmpl = new Studio.Controls.Common.EmptyScreenControl
            {
                Header     = ProjectTemplatesResource.EmptyListTemplateHeader,
                ImgSrc     = WebImageSupplier.GetAbsoluteWebPath("project-templates_logo.png", ProductEntryPoint.ID),
                Describe   = ProjectTemplatesResource.EmptyListTemplateDescr,
                ID         = "escNoTmpl",
                ButtonHTML = string.Format("<a href='projectTemplates.aspx?action=add' class='projectsEmpty baseLinkAction addFirstElement'>{0}<a>", ProjectTemplatesResource.EmptyListTemplateButton)
            };

            _escNoTmpl.Controls.Add(escNoTmpl);

            Title = HeaderStringHelper.GetPageTitle(ProjectTemplatesResource.AllProjectTmpl);
        }
        protected override IEnumerable <KeyValuePair <string, object> > GetClientVariables(HttpContext context)
        {
            var curQuota = TenantExtra.GetTenantQuota();

            var result = new List <KeyValuePair <string, object> >(32)
            {
                RegisterObject(
                    new {
                    ApiPath                          = SetupInfo.WebApiBaseUrl,
                    IsAuthenticated                  = SecurityContext.IsAuthenticated,
                    IsAdmin                          = CoreContext.UserManager.IsUserInGroup(SecurityContext.CurrentAccount.ID, Constants.GroupAdmin.ID),
                    IsVisitor                        = CoreContext.UserManager.GetUsers(SecurityContext.CurrentAccount.ID).IsVisitor(),
                    CurrentTenantId                  = CoreContext.TenantManager.GetCurrentTenant().TenantId,
                    CurrentTenantCreatedDate         = CoreContext.TenantManager.GetCurrentTenant().CreatedDateTime,
                    CurrentTenantVersion             = CoreContext.TenantManager.GetCurrentTenant().Version,
                    CurrentTenantUtcOffset           = CoreContext.TenantManager.GetCurrentTenant().TimeZone,
                    CurrentTenantUtcHoursOffset      = CoreContext.TenantManager.GetCurrentTenant().TimeZone.BaseUtcOffset.Hours,
                    CurrentTenantUtcMinutesOffset    = CoreContext.TenantManager.GetCurrentTenant().TimeZone.BaseUtcOffset.Minutes,
                    TimezoneDisplayName              = CoreContext.TenantManager.GetCurrentTenant().TimeZone.DisplayName,
                    TimezoneOffsetMinutes            = CoreContext.TenantManager.GetCurrentTenant().TimeZone.GetUtcOffset(DateTime.UtcNow).TotalMinutes,
                    TenantIsPremium                  = curQuota.Trial ? "No" : "Yes",
                    TenantTariff                     = curQuota.Id,
                    EmailRegExpr                     = @"^(([^<>()[\]\\.,;:\s@\""]+(\.[^<>()[\]\\.,;:\s@\""]+)*)|(\"".+\""))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$",
                    GroupSelector_MobileVersionGroup = new { Id = -1, Name = UserControlsCommonResource.LblSelect.HtmlEncode().ReplaceSingleQuote() },
                    GroupSelector_WithGroupEveryone  = new { Id = Constants.GroupEveryone.ID, Name = UserControlsCommonResource.Everyone.HtmlEncode().ReplaceSingleQuote() },
                    GroupSelector_WithGroupAdmin     = new { Id = Constants.GroupAdmin.ID, Name = UserControlsCommonResource.Admin.HtmlEncode().ReplaceSingleQuote() },
                    SetupInfoNotifyAddress           = SetupInfo.NotifyAddress,
                    SetupInfoTipsAddress             = SetupInfo.TipsAddress,
                    CKEDITOR_BASEPATH                = WebPath.GetPath("/usercontrols/common/ckeditor/"),
                    MaxImageFCKWidth                 = ConfigurationManager.AppSettings["MaxImageFCKWidth"] ?? "620",
                    UserPhotoHandlerUrl              = VirtualPathUtility.ToAbsolute("~/UserPhoto.ashx"),
                    ImageWebPath                     = WebImageSupplier.GetImageFolderAbsoluteWebPath(),
                    UrlShareGooglePlus               = SetupInfo.ShareGooglePlusUrl,
                    UrlShareTwitter                  = SetupInfo.ShareTwitterUrl,
                    UrlShareFacebook                 = SetupInfo.ShareFacebookUrl,
                    ZeroClipboardMoviePath           = CommonLinkUtility.ToAbsolute("~/js/flash/zeroclipboard/zeroclipboard10.swf")
                })
            };

            if (CoreContext.Configuration.Personal)
            {
                result.Add(RegisterObject(new { CoreContext.Configuration.Personal }));
            }

            if (CoreContext.Configuration.Standalone)
            {
                result.Add(RegisterObject(new { CoreContext.Configuration.Standalone }));
            }

            var helpLink = CommonLinkUtility.GetHelpLink();

            if (!string.IsNullOrEmpty(helpLink))
            {
                result.Add(RegisterObject(new { FilterHelpCenterLink = helpLink.TrimEnd('/') + "/tipstricks/using-search.aspx" }));
            }

            return(result);
        }
        public static string GetIconAbsoluteURL(this IModule module)
        {
            if (module == null || module.Context == null || String.IsNullOrEmpty(module.Context.IconFileName))
            {
                return("");
            }

            return(WebImageSupplier.GetAbsoluteWebPath(module.Context.IconFileName, module.ID));
        }
Ejemplo n.º 8
0
 public SideRecentActivity()
 {
     UserId    = Guid.Empty;
     ProductId = Guid.Empty;
     ModuleId  = Guid.Empty;
     MaxItems  = 5;
     Title     = Resources.Resource.RecentActivity;
     ImageURL  = WebImageSupplier.GetAbsoluteWebPath("recent_activity.png");
 }
Ejemplo n.º 9
0
        private static String GetDefaultPhoto(bool isCompany, Size photoSize)
        {
            if (isCompany)
            {
                return(WebImageSupplier.GetAbsoluteWebPath(String.Format("empty_company_logo_{0}_{1}.png", photoSize.Height, photoSize.Width), ProductEntryPoint.ID));
            }

            return(WebImageSupplier.GetAbsoluteWebPath(String.Format("empty_people_logo_{0}_{1}.png", photoSize.Height, photoSize.Width), ProductEntryPoint.ID));
        }
        public static string GetIconAbsoluteURL(this IProduct product)
        {
            if (product == null || product.Context == null || String.IsNullOrEmpty(product.Context.IconFileName))
            {
                return("");
            }

            return(WebImageSupplier.GetAbsoluteWebPath(product.Context.IconFileName, product.ID));
        }
Ejemplo n.º 11
0
 protected string GetContactImgSrc(int contactID)
 {
     if (contactID > 0)
     {
         var contact = Global.DaoFactory.GetContactDao().GetByID(contactID);
         return(ContactPhotoManager.GetSmallSizePhoto(contactID, contact is Company));
     }
     return(WebImageSupplier.GetAbsoluteWebPath("blank.gif"));
 }
Ejemplo n.º 12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ForumContainer.Options.InfoType = InfoType.Alert;

            StringBuilder sb = new StringBuilder();

            sb.Append("<script language=\"javascript\"  type=\"text/javascript\"> ForumMakerProvider.All='" + Resources.ForumResource.All + "'; ");
            sb.Append(" ForumMakerProvider.ConfirmMessage='" + Resources.ForumResource.ConfirmMessage + "'; ");
            sb.Append(" ForumMakerProvider.SaveButton='" + Resources.ForumResource.SaveButton + "'; ");
            sb.Append(" ForumMakerProvider.CancelButton='" + Resources.ForumResource.CancelButton + "'; ");
            sb.Append(" ForumMakerProvider.NameEmptyString='" + Resources.ForumResource.NameEmptyString + "'; ");
            sb.Append(" ForumContainer_PanelInfoID = '" + ForumContainer.GetInfoPanelClientID() + "'; ");

            sb.Append("</script>");

            this.Page.ClientScript.RegisterClientScriptInclude(typeof(string), "forummaker_script", WebPath.GetPath(ForumManager.BaseVirtualPath.Substring(2) + "/js/forummaker.js"));
            this.Page.ClientScript.RegisterClientScriptBlock(typeof(string), "forummaker_script_init", sb.ToString(), false);

            SearchText = "";

            if (!String.IsNullOrEmpty(Request["search"]))
            {
                SearchText = Request["search"];
            }

            var tags = ForumDataProvider.GetTagCloud(TenantProvider.CurrentTenantID, 40);

            TabCloudContainer.Title          = Resources.ForumResource.TagCloud;
            TabCloudContainer.HeaderCSSClass = "studioSideBoxTagCloudHeader";
            TabCloudContainer.ImageURL       = WebImageSupplier.GetAbsoluteWebPath("tagcloud.png");

            foreach (RankTag tag in tags)
            {
                TagCloudItem item = new TagCloudItem();
                item.TagName = tag.Name;
                item.TagID   = tag.ID.ToString();
                item.Rank    = tag.Rank;
                item.URL     = "search.aspx?tag=" + tag.ID;
                tagCloud.Items.Add(item);
            }
            if (tags.Count == 0)
            {
                TabCloudContainer.Visible = false;
            }

            sideRecentActivity.TenantId  = TenantProvider.CurrentTenantID;
            sideRecentActivity.ProductId = Product.CommunityProduct.ID;
            sideRecentActivity.ModuleId  = Forum.ForumManager.ModuleID;


            string script = "<link href=\"" + WebSkin.GetUserSkin().GetAbsoluteWebPath(ForumManager.BaseVirtualPath.Substring(2) + "/app_themes/<theme_folder>/style.css") + "\" rel=\"stylesheet\" type=\"text/css\" />";

            this.Page.ClientScript.RegisterClientScriptBlock(typeof(string), Guid.NewGuid().ToString(), script);

            SetNavigation();
        }
Ejemplo n.º 13
0
 protected override IEnumerable <KeyValuePair <string, object> > GetClientVariables(HttpContext context)
 {
     return(new List <KeyValuePair <string, object> >(1)
     {
         RegisterObject(new
         {
             emptyScreenPeopleFilter = WebImageSupplier.GetAbsoluteWebPath("empty_screen_filter.png")
         })
     });
 }
Ejemplo n.º 14
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            this.Page.RegisterBodyScriptsControl("~/products/people/masters/DefaultBodyScripts.ascx");

            this.Page.RegisterInlineScript(String.Format(" emptyScreenPeopleFilter = '{0}'; ",
                                                         WebImageSupplier.GetAbsoluteWebPath("empty_screen_filter.png")),
                                           onReady: false);
        }
Ejemplo n.º 15
0
 public OrganisationLogoManager(WebImageSupplier webImageSupplier,
                                Global global,
                                IOptionsMonitor <ILog> logger,
                                DaoFactory daoFactory)
 {
     _webImageSupplier = webImageSupplier;
     _global           = global;
     _logger           = logger.Get("ASC.CRM");
     _daoFactory       = daoFactory;
 }
Ejemplo n.º 16
0
 protected string GetPrivateImg(int projectID)
 {
     if (Global.EngineFactory.GetProjectEngine().GetByID(projectID).Private)
     {
         return(string.Format("<img src='{0}' title='{1}' alt='{1}' />",
                              WebImageSupplier.GetAbsoluteWebPath("lock.png", ProductEntryPoint.ID),
                              ProjectResource.HiddenProject));
     }
     return(string.Empty);
 }
Ejemplo n.º 17
0
        private string GetModuleIconUrl(UserActivity userActivity)
        {
            if (userActivity.ImageOptions != null && !string.IsNullOrEmpty(userActivity.ImageOptions.ImageFileName))
            {
                return(WebImageSupplier.GetAbsoluteWebPath(userActivity.ImageOptions.ImageFileName, userActivity.ModuleID));
            }
            var module = ProductManager.Instance.GetModuleByID(userActivity.ModuleID);

            return(module == null ? "Unknown module" : module.GetIconAbsoluteURL());
        }
Ejemplo n.º 18
0
        protected override IEnumerable <KeyValuePair <string, object> > GetClientVariables(HttpContext context)
        {
            yield return(RegisterObject("ApiPath", SetupInfo.WebApiBaseUrl));

            yield return(RegisterObject("IsAuthenticated", SecurityContext.IsAuthenticated));

            yield return(RegisterObject("IsAdmin", CoreContext.UserManager.IsUserInGroup(SecurityContext.CurrentAccount.ID, ASC.Core.Users.Constants.GroupAdmin.ID)));

            yield return(RegisterObject("CurrentTenantVersion", CoreContext.TenantManager.GetCurrentTenant().Version));

            yield return(RegisterObject("CurrentTenantUtcOffset", CoreContext.TenantManager.GetCurrentTenant().TimeZone));

            yield return(RegisterObject("CurrentTenantUtcHoursOffset", CoreContext.TenantManager.GetCurrentTenant().TimeZone.GetUtcOffset(DateTime.UtcNow).Hours));

            yield return(RegisterObject("CurrentTenantUtcMinutesOffset", CoreContext.TenantManager.GetCurrentTenant().TimeZone.GetUtcOffset(DateTime.UtcNow).Minutes));

            var curQuota = TenantExtra.GetTenantQuota();

            yield return(RegisterObject("TenantIsPremium", curQuota.Trial ? "No" : "Yes"));

            yield return(RegisterObject("TenantTariff", curQuota.Id));

            yield return(RegisterObject("TenantTariffDocsEdition", curQuota.DocsEdition));

            if (CoreContext.Configuration.Personal)
            {
                yield return(RegisterObject("Personal", CoreContext.Configuration.Personal));
            }

            yield return(RegisterObject("ShowPromotions", SettingsManager.Instance.LoadSettings <StudioNotifyBarSettings>(TenantProvider.CurrentTenantID).ShowPromotions));

            yield return(RegisterObject("EmailRegExpr", @"^(([^<>()[\]\\.,;:\s@\""]+(\.[^<>()[\]\\.,;:\s@\""]+)*)|(\"".+\""))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$"));

            yield return(RegisterObject("GroupSelector_MobileVersionGroup", new { Id = -1, Name = UserControlsCommonResource.LblSelect.HtmlEncode().ReplaceSingleQuote() }));

            yield return(RegisterObject("GroupSelector_WithGroupEveryone", new { Id = ASC.Core.Users.Constants.GroupEveryone.ID, Name = UserControlsCommonResource.Everyone.HtmlEncode().ReplaceSingleQuote() }));

            yield return(RegisterObject("GroupSelector_WithGroupAdmin", new { Id = ASC.Core.Users.Constants.GroupAdmin.ID, Name = UserControlsCommonResource.Admin.HtmlEncode().ReplaceSingleQuote() }));

            yield return(RegisterObject("FilterHelpCenterLink", CommonLinkUtility.GetHelpLink(true) + "/tipstricks/using-search.aspx"));

            yield return(RegisterObject("SetupInfoNotifyAddress", SetupInfo.NotifyAddress));

            yield return(RegisterObject("CKEDITOR_BASEPATH", WebPath.GetPath("/usercontrols/common/ckeditor/")));

            yield return(RegisterObject("MaxImageFCKWidth", ConfigurationManager.AppSettings["MaxImageFCKWidth"] ?? "620"));

            yield return(RegisterObject("UserPhotoHandlerUrl", VirtualPathUtility.ToAbsolute("~/UserPhoto.ashx")));

            yield return(RegisterObject("ImageWebPath", WebImageSupplier.GetImageFolderAbsoluteWebPath()));

            yield return(RegisterObject("UploadFlashUrl", FileUploaderFlashParams.GetFlashUrl));

            yield return(RegisterObject("UploadDefaultRuntimes", FileUploaderFlashParams.DefaultRuntimes));
        }
Ejemplo n.º 19
0
 public TenantInfoSettingsHelper(
     WebImageSupplier webImageSupplier,
     StorageFactory storageFactory,
     TenantManager tenantManager,
     IConfiguration configuration)
 {
     WebImageSupplier = webImageSupplier;
     StorageFactory   = storageFactory;
     TenantManager    = tenantManager;
     Configuration    = configuration;
 }
Ejemplo n.º 20
0
        public string GetAbsoluteCompanyLogoPath(TenantInfoSettings tenantInfoSettings)
        {
            if (tenantInfoSettings.IsDefault)
            {
                return(WebImageSupplier.GetAbsoluteWebPath("onlyoffice_logo/dark_general.png"));
            }

            var store = StorageFactory.GetStorage(TenantManager.GetCurrentTenant().TenantId.ToString(), "logo");

            return(store.GetUri(tenantInfoSettings.CompanyLogoFileName ?? "").ToString());
        }
Ejemplo n.º 21
0
        public string GetAbsoluteCompanyLogoPath()
        {
            if (_isDefault)
            {
                return(WebImageSupplier.GetAbsoluteWebPath("logo/logo.png"));
            }

            var store = StorageFactory.GetStorage(TenantProvider.CurrentTenantID.ToString(), "logo");

            return(store.GetUri(_companyLogoFileName ?? "").ToString());
        }
Ejemplo n.º 22
0
 protected override void OnInit(EventArgs e)
 {
     base.OnInit(e);
     TopStudioPanel            = (TopStudioPanel)LoadControl(TopStudioPanel.Location);
     MetaKeywords.Content      = Resource.MetaKeywords;
     MetaDescription.Content   = Resource.MetaDescription.HtmlEncode();
     MetaDescriptionOG.Content = Resource.MetaDescription.HtmlEncode();
     MetaTitleOG.Content       = (String.IsNullOrEmpty(Page.Title) ? Resource.MainPageTitle : Page.Title).HtmlEncode();
     CanonicalURLOG.Content    = HttpContext.Current.Request.Url.Scheme + "://" + Request.GetUrlRewriter().Host;
     MetaImageOG.Content       = WebImageSupplier.GetAbsoluteWebPath("logo/fb_icon_325x325.jpg");
 }
Ejemplo n.º 23
0
        public static void AdjustTopNavigator(TopNavigationPanel topNavPanel, PersonalPart part, Guid currentItem)
        {
            topNavPanel.DisableProductNavigation = true;
            topNavPanel.DisableSearch            = true;
            topNavPanel.DisableUserInfo          = true;

            topNavPanel.DisableSearch      = true;
            topNavPanel.CustomTitle        = Resources.Resource.Administration;
            topNavPanel.CustomTitleURL     = GetPartUrl(PersonalPart.Default);
            topNavPanel.CustomTitleIconURL = WebImageSupplier.GetAbsoluteWebPath("settings.png");

            int i = 0;

            //items
            foreach (var itemId in _personalItems)
            {
                var webItem = WebItemManager.Instance[itemId];
                topNavPanel.NavigationItems.Add(new NavigationItem()
                {
                    Name     = webItem.Name,
                    URL      = VirtualPathUtility.ToAbsolute(webItem.StartURL),
                    Selected = currentItem.Equals(webItem.ID) || (part == PersonalPart.Default && i == 0)
                });

                i++;
            }

            //backup
            topNavPanel.NavigationItems.Add(new NavigationItem()
            {
                Name       = Resources.Resource.Backup,
                URL        = GetPartUrl(PersonalPart.Backup),
                Selected   = (part == PersonalPart.Backup),
                RightAlign = true
            });

            //settings
            topNavPanel.NavigationItems.Add(new NavigationItem()
            {
                Name       = Resources.Resource.Administration,
                URL        = GetPartUrl(PersonalPart.Settings),
                Selected   = (part == PersonalPart.Settings),
                RightAlign = true
            });

            //profile
            topNavPanel.NavigationItems.Add(new NavigationItem()
            {
                Name       = Resources.Resource.Profile,
                URL        = GetPartUrl(PersonalPart.Profile),
                Selected   = (part == PersonalPart.Profile),
                RightAlign = true
            });
        }
Ejemplo n.º 24
0
        public static string GetNotificationImageUrl(string imageFileName)
        {
            if (string.IsNullOrEmpty(NotificationImagePath))
            {
                return
                    (CommonLinkUtility.GetFullAbsolutePath(
                         WebImageSupplier.GetAbsoluteWebPath("notification/" + imageFileName)));
            }

            return(NotificationImagePath.TrimEnd('/') + "/" + imageFileName);
        }
Ejemplo n.º 25
0
 private void InitEmptyScreenForNoDealsInContact()
 {
     emptyContentForDealsFilter.ImgSrc   = WebImageSupplier.GetAbsoluteWebPath("empty_screen_deals.png", ProductEntryPoint.ID);
     emptyContentForDealsFilter.Header   = CRMDealResource.EmptyContentDealsHeader;
     emptyContentForDealsFilter.Describe = String.Format(CRMDealResource.EmptyContentDealsDescribe,
                                                         "<span class='hintStages baseLinkAction' >", "</span>");
     emptyContentForDealsFilter.ButtonHTML = String.Format(
         "<a class='linkAddMediumText' href='deals.aspx?action=manage&contactID={0}'>{1}</a>",
         contactID,
         CRMDealResource.CreateDeal);
 }
Ejemplo n.º 26
0
        public AjaxResponse GetImage(string imageID)
        {
            var storage     = StorageFactory.GetStorage();
            var store       = Data.Storage.StorageFactory.GetStorage(TenantProvider.CurrentTenantID.ToString(), "photo");
            var currentItem = storage.GetAlbumItem(Convert.ToInt64(imageID));

            if (currentItem == null)
            {
                return new AjaxResponse
                       {
                           status  = "error",
                           message = "have no photo",
                           rs2     = "",
                           rs3     = WebImageSupplier.GetAbsoluteWebPath("blank.gif")
                       }
            }
            ;
            var items = storage.GetAlbumItems(currentItem.Album);
            var pos   = items.IndexOf(currentItem);

            var htw           = new HtmlTextWriter(new StringWriter());
            var imageComments = StorageFactory.GetStorage().GetComments(currentItem.Id);
            var comments      = new List <CommentInfo>();

            AppendChildsComments(ref comments, imageComments);

            var CommentsList = new CommentsList();

            ConfigureCommentsList(CommentsList, currentItem);
            CommentsList.Items = comments;
            CommentsList.RenderControl(htw);

            if (!SecurityContext.DemoMode)
            {
                storage.ReadAlbumItem(currentItem.Id, currentUserID.ToString());
            }

            return(new AjaxResponse
            {
                rs1 = currentItem.Id.ToString(),
                rs2 = (currentItem.Name ?? string.Empty).HtmlEncode(),
                rs3 = ImageHTMLHelper.GetImageUrl(currentItem.ExpandedStorePreview, store),
                rs4 = (currentItem.Description ?? string.Empty).HtmlEncode(),
                rs5 = currentItem.PreviewSize.Width.ToString(),
                rs6 = currentItem.PreviewSize.Height.ToString(),
                rs7 = Grammatical.ViewsCount(currentItem.ViewsCount),
                rs8 = Grammatical.CommentsCount(currentItem.CommentsCount),
                rs9 = RenderEditPhotoLink(currentItem),
                rs10 = RenderSlideShowLink(currentItem),
                rs11 = pos > 0 ? items[pos - 1].Id.ToString() : "",
                rs12 = pos < items.Count - 1 ? items[pos + 1].Id.ToString() : "",
                rs13 = htw.InnerWriter.ToString()
            });
        }
Ejemplo n.º 27
0
        protected string GetAbsoluteCompanyTopLogoPath()
        {
            var general = !TenantLogoManager.IsRetina(Request);

            return
                (CoreContext.Configuration.Personal
                    ? WebImageSupplier.GetAbsoluteWebPath("personal_logo/logo_personal_auth.png")
                    : TenantLogoManager.WhiteLabelEnabled
                          ? TenantLogoManager.GetLogoDark(general)
                          : TenantWhiteLabelSettings.GetAbsoluteDefaultLogoPath(WhiteLabelLogoTypeEnum.Dark, general));
        }
Ejemplo n.º 28
0
 private static EmptyScreenControl RenderEmptyScreenForFilter(string headerText, string description, string id = "emptyScreenForFilter")
 {
     return(new EmptyScreenControl
     {
         ImgSrc = WebImageSupplier.GetAbsoluteWebPath("empty_screen_filter.png"),
         Header = headerText,
         Describe = description,
         ID = id,
         ButtonHTML = String.Format("<a class='clearFilterButton link dotline'>{0}</a>", ProjectsFilterResource.ClearFilter)
     });
 }
Ejemplo n.º 29
0
 private void InitEmptyScreenForFilter()
 {
     emptyContentForDealsFilter.ImgSrc     = WebImageSupplier.GetAbsoluteWebPath("empty_screen_filter.png", ProductEntryPoint.ID);
     emptyContentForDealsFilter.Header     = CRMDealResource.EmptyContentDealsFilterHeader;
     emptyContentForDealsFilter.Describe   = CRMDealResource.EmptyContentDealsFilterDescribe;
     emptyContentForDealsFilter.ButtonHTML = String.Format(
         @"<a class='crm-clearFilterButton' href='javascript:void(0);'
                                                 onclick='ASC.CRM.ListDealView.advansedFilter.advansedFilter(null);'>
                                                     {0}
                                           </a>",
         CRMCommonResource.ClearFilter);
 }
Ejemplo n.º 30
0
        private void InitTags()
        {
            ServiceHelper.SetPagination();

            IList <Tag> tags;

            switch (sortUtil.SortBy)
            {
            case SortByEnum.Name:
                tags = ServiceHelper.GetTagsSortedByName();
                break;

            case SortByEnum.Popularity:
                tags = ServiceHelper.GetMostPopularTags();
                break;

            default:
                tags = ServiceHelper.GetMostRecentTags();
                break;
            }

            if (tags == null || tags.Count == 0)
            {
                var emptyScreenControl = new EmptyScreenControl
                {
                    ImgSrc     = WebImageSupplier.GetAbsoluteWebPath("bookmarks_icon.png", BookmarkingSettings.ModuleId),
                    Header     = BookmarkingUCResource.EmptyScreenTagsCaption,
                    Describe   = BookmarkingUCResource.EmptyScreenText,
                    ButtonHTML = String.Format("<a class='linkAddMediumText' href='CreateBookmark.aspx'>{0}</a>", BookmarkingUCResource.EmptyScreenLink)
                };

                TagsContainer.Controls.Add(emptyScreenControl);
                TagsSortingPanel.Visible = false;
                return;
            }
            var i = 0;

            var bookmarks = ServiceHelper.GetMostPopularBookmarksByTag(tags);

            foreach (var tag in tags)
            {
                using (var c = LoadControl(BookmarkUserControlPath.TagInfoUserControlPath) as TagInfoUserControl)
                {
                    c.Tag          = tag;
                    c.BookmarkList = GetBookmarksByTag(bookmarks, tag);
                    c.IsOdd        = i++ % 2 == 0;
                    TagsContainer.Controls.Add(c);
                }
            }
            SetBookmarkingPagination();
        }