public ActionResult ContentEdit(ContentSingleModel model) {
			if (ModelState.IsValid) {
				cmsHelper.OverrideKey(model.PageId);

				if (model.WidgetId.HasValue && model.WidgetId.Value != Guid.Empty) {
					List<Widget> lstWidgets = cmsHelper.cmsAdminWidget;

					Widget pageWidget = (from w in lstWidgets
										 where w.Root_WidgetID == model.WidgetId.Value
										 select w).FirstOrDefault();

					pageWidget.ControlProperties = model.PageText;
					pageWidget.WidgetDataID = Guid.NewGuid();
					pageWidget.IsPendingChange = true;

					lstWidgets.RemoveAll(x => x.Root_WidgetID == model.WidgetId.Value);

					lstWidgets.Add(pageWidget);

					cmsHelper.cmsAdminWidget = lstWidgets;
				} else {
					var pageContents = cmsHelper.cmsAdminContent;

					switch (model.Field) {
						case "c":
							pageContents.PageText = model.PageText;
							break;

						case "l":
							pageContents.LeftPageText = model.PageText;
							break;

						case "r":
							pageContents.RightPageText = model.PageText;
							break;
					}

					cmsHelper.cmsAdminContent = pageContents;
				}

				SetSaved();

				return RedirectToAction("ContentEdit", new { @id = model.PageId, @widgetid = model.WidgetId, @field = model.Field, @mode = model.Mode });
			}

			return View(model);
		}
		public ActionResult ContentEdit(Guid id, Guid? widgetid, string field, string mode) {
			ContentSingleModel model = new ContentSingleModel();
			model.Mode = mode;
			model.Field = field;
			model.PageId = id;
			model.WidgetId = widgetid;

			cmsHelper.OverrideKey(model.PageId);

			if (widgetid.HasValue) {
				Widget pageWidget = (from w in cmsHelper.cmsAdminWidget
									 where w.Root_WidgetID == widgetid.Value
									 select w).FirstOrDefault();

				model.PageText = pageWidget.ControlProperties;
			} else {
				if (cmsHelper.cmsAdminContent != null) {
					var pageContents = cmsHelper.cmsAdminContent;
					switch (field) {
						case "c":
							model.PageText = pageContents.PageText;
							break;

						case "l":
							model.PageText = pageContents.LeftPageText;
							break;

						case "r":
							model.PageText = pageContents.RightPageText;
							break;
					}
				}
			}

			ShowSaved();

			return View(model);
		}