예제 #1
0
        private void SetArticlesParameters()
        {
            ArticleListParameters draftParameters = new ArticleListParameters();
            draftParameters.NothingFoundText = ResourceManager.GetLiteral("Admin.Articles.NoArticles");
            draftParameters.MoreUrl = Utility.ResolveUrl(Constants.Urls.Articles.ListDraftUrl);
            draftParameters.Header = ResourceManager.GetLiteral("Admin.Articles.Draft");

            this.draftArticlesList.ArticleHandler = new BlogArticleHandler();
            this.draftArticlesList.Parameters = draftParameters;

            ArticleListParameters draftPagesParameters = new ArticleListParameters();
            draftPagesParameters.NothingFoundText = ResourceManager.GetLiteral("Admin.Pages.NoPages");
            draftPagesParameters.MoreUrl = Utility.ResolveUrl(Constants.Urls.Pages.ListPublishedUrl);
            draftPagesParameters.Header = ResourceManager.GetLiteral("Admin.Pages.Draft");

            this.draftPagesList.ArticleHandler = new StaticArticleHandler();
            this.draftPagesList.Parameters = draftPagesParameters;
        }
예제 #2
0
        private void DisplayArticleView()
        {
            ArticleListParameters parameters = new ArticleListParameters();
            parameters.HideHeader = true;
            parameters.DisplayTableHeader = true;
            parameters.ShowDelete = true;
            parameters.AllowMultiSelect = true;

            parameters.NothingFoundText = ResourceManager.GetLiteral("Admin.Articles.NoArticles");

            if (Stage == PublishingStage.Draft)
            {
                this.headerH1.InnerText = ResourceManager.GetLiteral("Admin.Articles.Draft");
                parameters.ShowPublish = true;
            }
            else
            {
                this.headerH1.InnerText = ResourceManager.GetLiteral("Admin.Articles.Published");
                parameters.ShowPublish = false;
            }

            this.articlesList.Stage = Stage;
            this.articlesList.Parameters = parameters;
        }
예제 #3
0
        private void SetPageView()
        {
            this.Title = ResourceManager.GetLiteral("Admin.Pages.List.PageTitle");

            //get a static handler
            StaticArticleHandler handler = new StaticArticleHandler();

            //fetch only pages
            this.draftArticlesList.ArticleHandler = handler;
            this.publishedArticlesList.ArticleHandler = handler;

            ArticleListParameters draftParameters = new ArticleListParameters();
            draftParameters.EditUrlPrefix = Constants.Urls.Pages.EditUrlWithKey;
            draftParameters.MoreUrl = Constants.Urls.Pages.ListDraftUrl;
            draftParameters.ShowDelete = true;
            draftParameters.ShowPublish = true;
            draftParameters.Header = ResourceManager.GetLiteral("Admin.Pages.Draft");
            draftParameters.NothingFoundText = ResourceManager.GetLiteral("Admin.Pages.NoPages");

            ArticleListParameters publishedParameters = new ArticleListParameters();
            publishedParameters.EditUrlPrefix = Constants.Urls.Pages.EditUrlWithKey;
            publishedParameters.MoreUrl = Constants.Urls.Pages.ListPublishedUrl;
            publishedParameters.ShowDelete = true;
            publishedParameters.ShowPublish = false;
            publishedParameters.Header = ResourceManager.GetLiteral("Admin.Pages.Published");
            publishedParameters.NothingFoundText = ResourceManager.GetLiteral("Admin.Pages.NoPages");

            this.draftArticlesList.Parameters = draftParameters;
            this.publishedArticlesList.Parameters = publishedParameters;
        }
예제 #4
0
        private void DisplayPageView()
        {
            ArticleListParameters parameters = new ArticleListParameters();
            parameters.HideHeader = true;
            parameters.DisplayTableHeader = true;
            parameters.ShowDelete = true;
            parameters.NothingFoundText = ResourceManager.GetLiteral("Admin.Pages.NoPages");
            parameters.AllowMultiSelect = true;
            parameters.EditUrlPrefix = Constants.Urls.Pages.EditUrlWithKey;

            if (Stage == PublishingStage.Draft)
            {
                this.headerH1.InnerText = ResourceManager.GetLiteral("Admin.Pages.Draft");
                parameters.ShowPublish = true;
            }
            else
            {
                this.headerH1.InnerText = ResourceManager.GetLiteral("Admin.Pages.Published");
            }

            this.articlesList.ArticleHandler = new StaticArticleHandler();
            this.articlesList.Stage = Stage;
            this.articlesList.Parameters = parameters;
        }
예제 #5
0
        private void GenerateParametersIfUndefined()
        {
            if (!parametersSet)
            {
                // snippet generation is supported for published stage.
                // it gets used when the

                this.Stage = PublishingStage.Published;

                ArticleListParameters p = new ArticleListParameters();
                p.ShowDelete = true;
                p.ShowPublish = false;
                p.EditUrlPrefix = Constants.Urls.Pages.EditUrlWithKey;
                this.Parameters = p;

                if (!string.IsNullOrEmpty(urlkey))
                {
                    // get the articles.
                    Article article = ArticleStore.Instance.GetArticle(urlkey, this.Stage);
                    List<Article> articles = new List<Article>(1);
                    articles.Add(article);

                    this.Articles = articles;
                }
            }
        }