Skip to content
Browse files

(old school) preview module deprecated, function moved into administr…

…ationController

[#292 state:resolved]
  • Loading branch information...
1 parent c2b4d0b commit 6d99c4c0297a74db041d1d14d52653e845b45986 @dleffler dleffler committed Aug 8, 2011
View
2 framework/modules-1/administrationmodule/views/Quick Links.tpl
@@ -30,7 +30,7 @@
{/if}
{/permissions}
- {chain module=previewmodule view=Default}
+{* {chain module=previewmodule view=Default} *}
</div>
View
2 framework/modules-1/administrationmodule/views/_panel.tpl
@@ -35,7 +35,7 @@
<a class="editprofile" href="{link module=loginmodule action=editprofile}">Edit Profile</a>
<a class="logout" href="{link module=loginmodule action=logout}">Log Out</a>
{/permissions}
- {chain module=previewmodule view=Default}
+{* {chain module=previewmodule view=Default}*}
{/if}
</div>
</div>
View
15 framework/modules/administration/controllers/administrationController.php
@@ -408,6 +408,21 @@ public function toggle_maintenance() {
expHistory::back();
}
+ public function toggle_preview() {
+ $level = 99;
+ if (expSession::is_set('uilevel')) {
+ $level = expSession::get('uilevel');
+ }
+ if ($level == UILEVEL_PREVIEW) {
+ expSession::un_set('uilevel');
+ } else { //edit mode
+ expSession::set("uilevel",0);
+ }
+ $message = ($level == UILEVEL_PREVIEW) ? "Exponent is no longer in 'Preview' mode" : "Exponent is now in 'Preview' mode" ;
+ flash('message',$message);
+ expHistory::back();
+ }
+
public function clear_smarty_cache() {
expTheme::removeSmartyCache();
$message = "Smarty Cache has been cleared" ;
View
22 framework/modules/administration/menus/user.php
@@ -28,13 +28,13 @@
$level = expSession::get('uilevel');
}
-if ($level == UILEVEL_PREVIEW) {
- $preview_url = makeLink(array('module'=>'previewmodule','action'=>'normal'));
- $preview_class = 'preview_on';
-} else {
- $preview_url = makeLink(array('module'=>'previewmodule','action'=>'preview'));
- $preview_class = 'preview_off';
-}
+//if ($level == UILEVEL_PREVIEW) {
+// $preview_url = makeLink(array('module'=>'previewmodule','action'=>'normal'));
+// $preview_class = 'preview_on';
+//} else {
+// $preview_url = makeLink(array('module'=>'previewmodule','action'=>'preview'));
+// $preview_class = 'preview_off';
+//}
/////////////////////////////////////////////////////////////////////////
// BUILD THE MENU
/////////////////////////////////////////////////////////////////////////
@@ -62,8 +62,12 @@
),
array(
'text'=>gt('Preview Mode'),
- 'classname'=>$preview_class,
- 'url'=>$preview_url
+ 'text' => ($level == UILEVEL_PREVIEW)?gt('Turn Preview Mode off'):gt('Turn Preview Mode on'),
+ 'classname' => ($level == UILEVEL_PREVIEW)?'preview_on':'preview_off',
+ 'url' => makeLink(array(
+ 'module' => 'administration',
+ 'action' => 'toggle_preview'
+ ))
),
),
)
View
2 framework/modules/administration/views/administration/quicklinks_Administration_Links.tpl
@@ -30,7 +30,7 @@
{/if}
{/permissions}
- {chain module=previewmodule view=Default}
+{* {chain module=previewmodule view=Default} *}
</div>

0 comments on commit 6d99c4c

Please sign in to comment.
Something went wrong with that request. Please try again.