Ejemplo n.º 1
0
        /// <summary>
        /// 生成artDialog的地址 并引入公用的提示信息 by张俊栋
        /// </summary>
        /// <param name="themes">主题</param>
        /// <returns></returns>
        public static HtmlString CreateFrontArtDialogUrl(string themes = "")
        {
            if (string.IsNullOrEmpty(themes))
            {
                switch (HtmlExtend.GetArea())
                {
                case "admin":
                    themes = "admin";
                    break;

                default:
                    themes = "blue";
                    break;
                }
            }

            return(new HtmlString(string.Format("<script type=\"text/javascript\" src=\"{0}/{1}/artDialog/jquery.artDialog.source.js?skin={2}\"></script><script type=\"text/javascript\" src=\"{0}/{1}/artDialog/plugins/iframeOrangeTools.source.js\"></script>", MTConfig.ResourceServer, "Plugins", themes)));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 使用在列表页面 首页等位置 生成头部的title keywords description
        /// </summary>
        /// <param name="controller"></param>
        public static void GetHeadMeta(this Controller controller)
        {
            List <NodeModel>     nodeList = NodeDAL.GetNodeByArea(HtmlExtend.GetArea());
            RouteValueDictionary vd       = controller.RouteData.Values;
            string actionName             = vd["action"].ToString().ToLower();
            string controllerName         = vd["controller"].ToString().ToLower();
            string link      = "/" + string.Join("/", new[] { HtmlExtend.GetArea(), controllerName, actionName });
            var    actionObj = nodeList.FirstOrDefault(s => !string.IsNullOrEmpty(s.Link) && s.Link.ToLower() == link);

            controller.ViewBag.Title       = "";
            controller.ViewBag.Keywords    = "";
            controller.ViewBag.Description = "";

            if (actionObj != null)
            {
                controller.ViewBag.Title       = actionObj.HeadTitle;
                controller.ViewBag.Keywords    = actionObj.HeadKeywords;
                controller.ViewBag.Description = actionObj.HeadDescription;
            }
        }