Skip to content

Commit

Permalink
Add config option for allowing editing/read-only. Hide edit buttons e…
Browse files Browse the repository at this point in the history
…tc when read only
  • Loading branch information
rjmackay committed May 21, 2012
1 parent 3f0cb8c commit 8e6622e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions config/offline.php
@@ -0,0 +1,5 @@
<?php defined('SYSPATH') or die('No direct script access.');
/**
* Enable offline editing (experimental)
*/
$config['enable_editing'] = FALSE;
2 changes: 2 additions & 0 deletions views/offline/message-li-template.php
Expand Up @@ -19,8 +19,10 @@
<td class="col-3"><%- message_date %></td> <td class="col-3"><%- message_date %></td>
<td class="col-4"> <td class="col-4">
<ul> <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.create_report'); ?></li>
<li class="none-separator"><?php echo Kohana::lang('ui_admin.view_report'); ?></li> <li class="none-separator"><?php echo Kohana::lang('ui_admin.view_report'); ?></li>
<li><?php echo Kohana::lang('ui_main.delete'); ?></li> <li><?php echo Kohana::lang('ui_main.delete'); ?></li>
<?php } ?>
</ul> </ul>
</td> </td>
2 changes: 2 additions & 0 deletions views/offline/report-li-template.php
Expand Up @@ -36,8 +36,10 @@
<td class="col-3"><%- incident_date %></td> <td class="col-3"><%- incident_date %></td>
<td class="col-4"> <td class="col-4">
<ul> <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 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/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> <li><a href="#reports/delete/<%- cid %>" class="del"><?php echo Kohana::lang('ui_main.delete');?></a></li>
<?php } ?>
</ul> </ul>
</td> </td>
2 changes: 2 additions & 0 deletions views/offline/report-page-template.php
Expand Up @@ -2,11 +2,13 @@
<a href="#reports"><?php echo Kohana::lang('ui_main.view_reports');?></a> <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>--> <!--<a href="#reports/add"><?php echo Kohana::lang('ui_main.create_report');?></a>-->
</h2> </h2>
<?php if (Kohana::config('offline.enable_editing')) { ?>
<div class="tab"><ul> <div class="tab"><ul>
<li><a class="active">View</a></li> <li><a class="active">View</a></li>
<li><a href="#reports/edit/<%- cid %>">Edit</a></li> <li><a href="#reports/edit/<%- cid %>">Edit</a></li>
<li><a href="#reports/delete/<%- cid %>">Delete</a></li> <li><a href="#reports/delete/<%- cid %>">Delete</a></li>
</ul></div> </ul></div>
<?php } ?>
<!--<%- incident_title %> <!--<%- incident_title %>
<%- id %>--> <%- id %>-->
<div class="f-col-full"> <div class="f-col-full">
Expand Down

0 comments on commit 8e6622e

Please sign in to comment.