Permalink
Browse files

Add config option for allowing editing/read-only. Hide edit buttons e…

…tc when read only
  • Loading branch information...
rjmackay committed May 21, 2012
1 parent 3f0cb8c commit 8e6622e4ec96f64603a9fd2d01d0084f26462495
View
@@ -0,0 +1,5 @@
+<?php defined('SYSPATH') or die('No direct script access.');
+/**
+ * Enable offline editing (experimental)
+ */
+$config['enable_editing'] = FALSE;
@@ -19,8 +19,10 @@
<td class="col-3"><%- message_date %></td>
<td class="col-4">
<ul>
+ <?php if (Kohana::config('offline.enable_editing')) { ?>
<li class="none-separator"><?php echo Kohana::lang('ui_admin.create_report'); ?></li>
<li class="none-separator"><?php echo Kohana::lang('ui_admin.view_report'); ?></li>
<li><?php echo Kohana::lang('ui_main.delete'); ?></li>
+ <?php } ?>
</ul>
</td>
@@ -36,8 +36,10 @@
<td class="col-3"><%- incident_date %></td>
<td class="col-4">
<ul>
+ <?php if (Kohana::config('offline.enable_editing')) { ?>
<li class="none-separator"><a href="#reports/approve/<%- cid %>" <% if (incident_active == 1) print(" class=\"status_yes\"") %>><?php echo Kohana::lang('ui_main.approve');?></a></li>
<li><a href="#reports/verify/<%- cid %>" <% if (incident_verified == 1) print(" class=\"status_yes\"") %> ><?php echo Kohana::lang('ui_main.verify');?></a></li>
<li><a href="#reports/delete/<%- cid %>" class="del"><?php echo Kohana::lang('ui_main.delete');?></a></li>
+ <?php } ?>
</ul>
</td>
@@ -2,11 +2,13 @@
<a href="#reports"><?php echo Kohana::lang('ui_main.view_reports');?></a>
<!--<a href="#reports/add"><?php echo Kohana::lang('ui_main.create_report');?></a>-->
</h2>
+ <?php if (Kohana::config('offline.enable_editing')) { ?>
<div class="tab"><ul>
<li><a class="active">View</a></li>
<li><a href="#reports/edit/<%- cid %>">Edit</a></li>
<li><a href="#reports/delete/<%- cid %>">Delete</a></li>
</ul></div>
+ <?php } ?>
<!--<%- incident_title %>
<%- id %>-->
<div class="f-col-full">

0 comments on commit 8e6622e

Please sign in to comment.