Beispiel #1
0
        protected override void OnInit(EventArgs e)
        {
            ModCtrl   = new NBrightBuyController();
            DebugMode = StoreSettings.Current.DebugMode;

            base.OnInit(e);

            #region "Get all Settings for module"
            //get Model Level Settings
            ModSettings = new ModSettings(ModuleId, Settings);
            ModuleKey   = ModSettings.Get("modref");
            if (String.IsNullOrEmpty(ModuleKey))
            {
                ModuleKey = ModSettings.Get("modulekey");                                  // keep backward compatiblity with ProductView.
            }
            #endregion

            if (EnablePaging)
            {
                // SET NOINDEX if we are paging product list
                try
                {
                    var page = Utils.RequestQueryStringParam(Context, "page");
                    if (page != "")
                    {
                        var metarobots = (System.Web.UI.HtmlControls.HtmlMeta)BasePage.Header.FindControl("MetaRobots");
                        if (metarobots != null)
                        {
                            metarobots.Content = "NOINDEX";
                        }
                    }
                }
                catch (Exception)
                {
                    //ignore
                }

                CtrlPaging = new NBrightCore.controls.PagingCtrl();
                this.Controls.Add(CtrlPaging);
                CtrlPaging.PageChanged += new RepeaterCommandEventHandler(PagingClick);
            }

            //add template provider to NBright Templating
            //TODO: Remove when BO is all razor.
            NBrightCore.providers.GenXProviderManager.AddProvider("NBrightBuy,Nevoweb.DNN.NBrightBuy.render.GenXmlTemplateExt");

            // Build the plugin list
            PluginUtils.CreateSystemPlugins();
        }