Work in progress adding checks for enabled plugins for pages.
[timetracker.git] / WEB-INF / templates / header.tpl
index 2e058ef..b307f4c 100644 (file)
@@ -27,7 +27,7 @@ With 101% height we essentially force the scrollbar to always appear. -->
   <tr>
     <td valign="top" align="center"> <!-- This is to centrally align all our content. -->
 
-      <!-- Top image -->
+      <!-- top image -->
       <table cellspacing="0" cellpadding="0" width="100%" border="0">
         <tr>
 {if $user->custom_logo}
@@ -54,11 +54,11 @@ With 101% height we essentially force the scrollbar to always appear. -->
           </td>
         </tr>
       </table>
-      <!-- End of top image -->
+      <!-- end of top image -->
 
 {if $authenticated}
   {if $user->isAdmin()}
-      <!-- Top menu for admin -->
+      <!-- top menu for admin -->
       <table cellspacing="0" cellpadding="3" width="100%" border="0">
         <tr>
           <td class="systemMenu" height="17" align="center">&nbsp;
@@ -68,9 +68,9 @@ With 101% height we essentially force the scrollbar to always appear. -->
           </td>
         </tr>
       </table>
-      <!-- End of top menu for admin -->
+      <!-- end of top menu for admin -->
 
-      <!-- Sub menu for admin -->
+      <!-- sub menu for admin -->
       <table cellspacing="0" cellpadding="3" width="100%" border="0">
         <tr>
           <td align="center" bgcolor="#d9d9d9" nowrap height="17" background="images/subm_bg.gif">&nbsp;
@@ -79,9 +79,9 @@ With 101% height we essentially force the scrollbar to always appear. -->
           </td>
         </tr>
       </table>
-      <!-- End of sub menu for admin -->
+      <!-- end of sub menu for admin -->
   {else}
-      <!-- Top menu for authorized user -->
+      <!-- top menu for authorized user -->
       <table cellspacing="0" cellpadding="3" width="100%" border="0">
         <tr>
           <td class="systemMenu" height="17" align="center">&nbsp;
@@ -92,25 +92,24 @@ With 101% height we essentially force the scrollbar to always appear. -->
           </td>
         </tr>
       </table>
-      <!-- End of top menu for authorized user -->
+      <!-- end of top menu for authorized user -->
 
-      <!-- Sub menu for authorized user -->
+      <!-- sub menu for authorized user -->
       <table cellspacing="0" cellpadding="3" width="100%" border="0">
         <tr>
           <td align="center" bgcolor="#d9d9d9" nowrap height="17" background="images/subm_bg.gif">&nbsp;
     {if !$user->isClient()}
            <a class="mainMenu" href="time.php">{$i18n.menu.time}</a>
     {/if}
-    {if in_array('ex', explode(',', $user->plugins)) && !$user->isClient()}
+    {if $user->isPluginEnabled('ex') && !$user->isClient()}
             &middot; <a class="mainMenu" href="expenses.php">{$i18n.menu.expenses}</a>
     {/if}
             {if !$user->isClient()}&middot; {/if}<a class="mainMenu" href="reports.php">{$i18n.menu.reports}</a>
-    {if ($user->canManageTeam() || $user->isClient()) && in_array('iv', explode(',', $user->plugins))}
+    {if ($user->canManageTeam() || $user->isClient()) && $user->isPluginEnabled('iv')}
             &middot; <a class="mainMenu" href="invoices.php">{$i18n.title.invoices}</a>
     {/if}
-    {if (in_array('ch', explode(',', $user->plugins)) && !$user->isClient()) && ($smarty.const.MODE_PROJECTS == $user->tracking_mode
-      || $smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode
-      || in_array('cl', explode(',', $user->plugins)))}
+    {if ($user->isPluginEnabled('ch') && !$user->isClient()) && ($smarty.const.MODE_PROJECTS == $user->tracking_mode
+      || $smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode || $user->isPluginEnabled('cl'))}
             &middot; <a class="mainMenu" href="charts.php">{$i18n.menu.charts}</a>
     {/if}
     {if !$user->isClient() && ($smarty.const.MODE_PROJECTS == $user->tracking_mode || $smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode)}
@@ -122,7 +121,7 @@ With 101% height we essentially force the scrollbar to always appear. -->
     {if !$user->isClient()}
             &middot; <a class="mainMenu" href="users.php">{$i18n.menu.users}</a>
     {/if}
-    {if $user->canManageTeam() && in_array('cl', explode(',', $user->plugins))}
+    {if $user->canManageTeam() && $user->isPluginEnabled('cl')}
             &middot; <a class="mainMenu" href="clients.php">{$i18n.menu.clients}</a>
     {/if}
     {if $user->isManager()}
@@ -131,10 +130,10 @@ With 101% height we essentially force the scrollbar to always appear. -->
           </td>
         </tr>
       </table>
-      <!-- End of sub menu for authorized user -->
+      <!-- end of sub menu for authorized user -->
   {/if}
 {else}
-      <!-- Top menu for non authorized user -->
+      <!-- top menu for non authorized user -->
       <table cellspacing="0" cellpadding="3" width="100%" border="0">
         <tr>
           <td class="systemMenu" height="17" align="center">&nbsp;
@@ -150,39 +149,39 @@ With 101% height we essentially force the scrollbar to always appear. -->
 {/if}
       <br>
 
-      <!-- Page title and user details -->
+      <!-- page title and user details -->
 {if $title}
       <table cellspacing="0" cellpadding="5" width="{$tab_width+20}" border="0">
         <tr><td class="sectionHeader"><div class="pageTitle">{$title}{if $timestring}: {$timestring}{/if}</div></td></tr>
         <tr><td>{$user->name|escape:'html'}{if $user->isAdmin()} {$i18n.label.role_admin}{elseif $user->isManager()} {$i18n.label.role_manager}{elseif $user->canManageTeam()} {$i18n.label.role_comanager}{/if}{if $user->behalf_id > 0} <b>{$i18n.label.on_behalf} {$user->behalf_name|escape:'html'}</b>{/if}{if $user->team}, {$user->team|escape:'html'}{/if}</td></tr>
       </table>
 {/if}
-      <!-- End of page title and user details -->
+      <!-- end of page title and user details -->
 
-      <!-- Output errors -->
-{if $errors->yes()}
+      <!-- output errors -->
+{if $err->yes()}
       <table cellspacing="4" cellpadding="7" width="{$tab_width}" border="0">
         <tr>
           <td class="error">
-  {foreach $errors->getErrors() as $error}
+  {foreach $err->getErrors() as $error}
             {$error.message}<br> {* No need to escape as they are not coming from user and may contain a link. *}
   {/foreach}
           </td>
         </tr>
       </table>
 {/if}
-      <!-- End of output errors -->
+      <!-- end of output errors -->
 
-      <!-- Output messages -->
-{if $messages->yes()}
+      <!-- output messages -->
+{if $msg->yes()}
       <table cellspacing="4" cellpadding="7" width="{$tab_width}" border="0">
         <tr>
           <td class="info_message">
-  {foreach $messages->getErrors() as $message}
+  {foreach $msg->getErrors() as $message}
             {$message.message}<br> {* No need to escape. *}
   {/foreach}
           </td>
         </tr>
       </table>
 {/if}
-      <!-- End of output messages -->
+      <!-- end of output messages -->