[Jifty-commit] r7266 - in jifty/trunk: examples/MyWeblog/share/web/templates/_elements lib/Jifty lib/Jifty/Plugin/AdminUI lib/Jifty/Plugin/OnlineDocs lib/Jifty/Plugin/SetupWizard lib/Jifty/Plugin/ViewDeclarePage lib/Jifty/View/Declare share/web/templates/__jifty/error/_elements share/web/templates/_elements t/TestApp/share/web/templates/_elements

Jifty commits jifty-commit at lists.jifty.org
Tue Jun 16 00:21:26 EDT 2009


Author: sartak
Date: Tue Jun 16 00:21:26 2009
New Revision: 7266

Modified:
   jifty/trunk/examples/MyWeblog/share/web/templates/_elements/nav
   jifty/trunk/lib/Jifty/Plugin/AdminUI/Dispatcher.pm
   jifty/trunk/lib/Jifty/Plugin/OnlineDocs/Dispatcher.pm
   jifty/trunk/lib/Jifty/Plugin/SetupWizard/View.pm
   jifty/trunk/lib/Jifty/Plugin/ViewDeclarePage/Page.pm
   jifty/trunk/lib/Jifty/View/Declare/Page.pm
   jifty/trunk/lib/Jifty/Web.pm
   jifty/trunk/share/plugins/Jifty/Plugin/AdminUI/web/templates/__jifty/admin/autohandler
   jifty/trunk/share/web/templates/__jifty/error/_elements/wrapper
   jifty/trunk/share/web/templates/_elements/wrapper
   jifty/trunk/t/TestApp/share/web/templates/_elements/wrapper

Log:
Use Jifty->admin_mode instead of asking whether config has AdminMode

Modified: jifty/trunk/examples/MyWeblog/share/web/templates/_elements/nav
==============================================================================
--- jifty/trunk/examples/MyWeblog/share/web/templates/_elements/nav	(original)
+++ jifty/trunk/examples/MyWeblog/share/web/templates/_elements/nav	Tue Jun 16 00:21:26 2009
@@ -3,7 +3,7 @@
 $top->child( Home => url => "/", sort_order => 1);
 $top->child( Post => url => "/post", label => "Post Article");
 
-if (Jifty->config->framework('AdminMode') ) {
+if (Jifty->admin_mode) {
     $top->child(Administration       => url => "/__jifty/admin/", sort_order => 998);
     $top->child(OnlineDocs       => url => "/__jifty/online_docs/", label => 'Online docs',  sort_order => 999);
  }

Modified: jifty/trunk/lib/Jifty/Plugin/AdminUI/Dispatcher.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/AdminUI/Dispatcher.pm	(original)
+++ jifty/trunk/lib/Jifty/Plugin/AdminUI/Dispatcher.pm	Tue Jun 16 00:21:26 2009
@@ -27,7 +27,7 @@
     my $top = Jifty->web->navigation;
     # for now leave check here, but we want AdminUI to be
     # real plugin someday
-    if ( Jifty->config->framework('AdminMode') ) {
+    if (Jifty->admin_mode) {
         $top->child(
             Administration =>
             url        => "/__jifty/admin/",

Modified: jifty/trunk/lib/Jifty/Plugin/OnlineDocs/Dispatcher.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/OnlineDocs/Dispatcher.pm	(original)
+++ jifty/trunk/lib/Jifty/Plugin/OnlineDocs/Dispatcher.pm	Tue Jun 16 00:21:26 2009
@@ -16,7 +16,7 @@
 use Jifty::Dispatcher -base;
     
 on '*' => run {
-    return unless Jifty->config->framework('AdminMode');
+    return unless Jifty->admin_mode;
 
     my $top = Jifty->web->navigation;
     $top->child(
@@ -28,7 +28,7 @@
 };
 
 under '/__jifty/online_docs' => run {
-    return if Jifty->config->framework('AdminMode');
+    return if Jifty->admin_mode;
     warn "Attempt to access /__jifty/online_docs; either enable AdminMode, or remove the OnlineDocs plugin";
     redirect('/__jifty/error/permission_denied');
 };

Modified: jifty/trunk/lib/Jifty/Plugin/SetupWizard/View.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/SetupWizard/View.pm	(original)
+++ jifty/trunk/lib/Jifty/Plugin/SetupWizard/View.pm	Tue Jun 16 00:21:26 2009
@@ -15,7 +15,7 @@
         },
     );
 
-    p { _("You're seeing this configuration because you started %1 in AdminMode and the SetupWizard plugin. Disable one or both of these to restore normal operation.", $appname) };
+    p { _("You're seeing this configuration because you started %1 in SetupMode. Disable this to restore normal operation.", $appname) };
 };
 
 template '/__jifty/admin/setupwizard/step' => sub {

Modified: jifty/trunk/lib/Jifty/Plugin/ViewDeclarePage/Page.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/ViewDeclarePage/Page.pm	(original)
+++ jifty/trunk/lib/Jifty/Plugin/ViewDeclarePage/Page.pm	Tue Jun 16 00:21:26 2009
@@ -576,7 +576,7 @@
 =cut
 
 sub render_jifty_page_detritus {
-    if ( Jifty->config->framework('AdminMode') ) {
+    if ( Jifty->admin_mode ) {
         with( class => "warning admin_mode" ), div {
             outs( _('Alert') . ': ' );
             outs_raw(

Modified: jifty/trunk/lib/Jifty/View/Declare/Page.pm
==============================================================================
--- jifty/trunk/lib/Jifty/View/Declare/Page.pm	(original)
+++ jifty/trunk/lib/Jifty/View/Declare/Page.pm	Tue Jun 16 00:21:26 2009
@@ -189,7 +189,7 @@
 =cut
 
 sub render_pre_content_hook {
-    if ( Jifty->config->framework('AdminMode') ) {
+    if ( Jifty->admin_mode ) {
         with( class => "warning admin_mode" ), div {
             outs( _('Alert') . ': ' );
             outs_raw(

Modified: jifty/trunk/lib/Jifty/Web.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Web.pm	(original)
+++ jifty/trunk/lib/Jifty/Web.pm	Tue Jun 16 00:21:26 2009
@@ -254,7 +254,7 @@
         return $self->{current_user};
     } elsif ( my $id = $self->session->get('user_id') ) {
          $object = Jifty->app_class({require => 0}, "CurrentUser")->new( id => $id );
-    } elsif ( Jifty->config->framework('AdminMode')) {
+    } elsif ( Jifty->admin_mode ) {
          $object = Jifty->app_class({require => 0}, "CurrentUser")->superuser;
     } else {
          $object = Jifty->app_class({require => 0}, "CurrentUser")->new;

Modified: jifty/trunk/share/plugins/Jifty/Plugin/AdminUI/web/templates/__jifty/admin/autohandler
==============================================================================
--- jifty/trunk/share/plugins/Jifty/Plugin/AdminUI/web/templates/__jifty/admin/autohandler	(original)
+++ jifty/trunk/share/plugins/Jifty/Plugin/AdminUI/web/templates/__jifty/admin/autohandler	Tue Jun 16 00:21:26 2009
@@ -1,7 +1,7 @@
 <%init>
 
 # If "AdminMode" is turned off in Jifty's config file, don't let people at the admin UI.
-unless (Jifty->config->framework('AdminMode')) {
+unless (Jifty->admin_mode) {
     $m->redirect('/__jifty/error/permission_denied'); 
     $m->abort();
 }

Modified: jifty/trunk/share/web/templates/__jifty/error/_elements/wrapper
==============================================================================
--- jifty/trunk/share/web/templates/__jifty/error/_elements/wrapper	(original)
+++ jifty/trunk/share/web/templates/__jifty/error/_elements/wrapper	Tue Jun 16 00:21:26 2009
@@ -10,7 +10,7 @@
   </div>
   <div id="content">
     <a name="content"></a>
-% if (Jifty->config->framework('AdminMode') ) {
+% if (Jifty->admin_mode) {
 <div class="warning admin_mode">
 Alert: Jifty <% Jifty->web->tangent( label => 'administration mode' , url => '/__jifty/admin/')%> is enabled.
 </div>
@@ -27,4 +27,4 @@
 This exists as a fallback wrapper, in case the mason error in question
 is caused by the Jifty app's wrapper, for instance.
 
-</%doc>
\ No newline at end of file
+</%doc>

Modified: jifty/trunk/share/web/templates/_elements/wrapper
==============================================================================
--- jifty/trunk/share/web/templates/_elements/wrapper	(original)
+++ jifty/trunk/share/web/templates/_elements/wrapper	Tue Jun 16 00:21:26 2009
@@ -6,7 +6,7 @@
   <& sidebar &>
   <div id="content">
     <a name="content"></a>
-% if (Jifty->config->framework('AdminMode') ) {
+% if (Jifty->admin_mode) {
 <div class="warning admin_mode">
 <%_('Alert')%>: <% Jifty->web->tangent( label => _('Administration mode is enabled.') , url => '/__jifty/admin/')%>
 </div>

Modified: jifty/trunk/t/TestApp/share/web/templates/_elements/wrapper
==============================================================================
--- jifty/trunk/t/TestApp/share/web/templates/_elements/wrapper	(original)
+++ jifty/trunk/t/TestApp/share/web/templates/_elements/wrapper	Tue Jun 16 00:21:26 2009
@@ -6,7 +6,7 @@
   <& sidebar &>
   <div id="content">
     <a name="content"></a>
-% if (Jifty->config->framework('AdminMode') ) {
+% if (Jifty->admin_mode) {
 <div class="warning admin_mode">
 <%_('Alert')%>: <% Jifty->web->tangent( label => _('Administration mode is enabled.') , url => '/__jifty/admin/')%>
 </div>


More information about the Jifty-commit mailing list