Skip to content

Commit

Permalink
Merge pull request #31628 from mlutfy/wpAcl
Browse files Browse the repository at this point in the history
WordPress Permissions: code cleanup, use cycle and odd-row css classes
  • Loading branch information
colemanw authored Dec 19, 2024
2 parents 8c386bf + 119a88a commit 3c39513
Showing 1 changed file with 14 additions and 23 deletions.
37 changes: 14 additions & 23 deletions templates/CRM/ACL/Form/WordPress/Permissions.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,42 +12,33 @@
<p>{ts}Use this form to Grant access to CiviCRM components and other CiviCRM permissions to WordPress roles.{/ts}</p>
<p>{ts}<strong>NOTE: Super Admin</strong> and <strong>Administrator</strong> roles will have all permissions in CiviCRM.{/ts}</p>
</div>
<div class="crm-block crm-form-block crm-export-form-block crm-sticky">
<table>
<div class="crm-block crm-sticky">
<table class="table-striped">
<thead>
<tr>
<th class="label">&nbsp;</th>
{assign var="num" value=0}
{foreach from=$roles key=role_name item=role_value}
<th align="center"><strong>{$role_value}</strong></th>
<th align="center">{$role_value}</th>
{assign var="num" value=$num+1}
{/foreach}
</tr>
</thead>
<tbody>
{assign var="x" value=0}
{foreach from=$table key=perm_name item=row}
{if $x mod 2 eq 1}
<tr style="background-color: #E6E6DC;">
{else}
<tr style="background-color: #FFFFFF;">
{/if}

<td style="height: 2.6em;">
{$row.label}
{if !empty($row.desc)}
<br/><span class="description">{$row.desc}</span>
{/if}
</td>

{foreach from=$row.roles key=index item=role_name}
<td align="center" style="padding-top: 0.6em;">
{$form.$role_name.$perm_name.html}
<tr class="{cycle values="odd-row,even-row"}">
<td style="height: 2.6em;">
{$row.label}
{if !empty($row.desc)}
<br/><span class="description">{$row.desc}</span>
{/if}
</td>
{/foreach}

{foreach from=$row.roles key=index item=role_name}
<td align="center" style="padding-top: 0.6em;">
{$form.$role_name.$perm_name.html}
</td>
{/foreach}
</tr>
{assign var="x" value=$x+1}
{/foreach}
</tbody>
</table>
Expand Down

0 comments on commit 3c39513

Please sign in to comment.