summaryrefslogtreecommitdiff
path: root/templates/content_permissions.tpl
diff options
context:
space:
mode:
authorMax Kremmel <xing@synapse.plus.com>2007-07-07 20:46:19 +0000
committerMax Kremmel <xing@synapse.plus.com>2007-07-07 20:46:19 +0000
commitbc5ba66acce008dcd9e8b0a80b95ac47ff2d6338 (patch)
tree93ef127b4b22a5bdc6844cb847c9be0754a7687e /templates/content_permissions.tpl
parent4540d88faaba05851ada0f5bca0598fcba72636a (diff)
downloadliberty-bc5ba66acce008dcd9e8b0a80b95ac47ff2d6338.tar.gz
liberty-bc5ba66acce008dcd9e8b0a80b95ac47ff2d6338.tar.bz2
liberty-bc5ba66acce008dcd9e8b0a80b95ac47ff2d6338.zip
add cool new interface for sites with more than 10 groups
Diffstat (limited to 'templates/content_permissions.tpl')
-rw-r--r--templates/content_permissions.tpl142
1 files changed, 115 insertions, 27 deletions
diff --git a/templates/content_permissions.tpl b/templates/content_permissions.tpl
index e4d123a..dc0c346 100644
--- a/templates/content_permissions.tpl
+++ b/templates/content_permissions.tpl
@@ -11,38 +11,126 @@
{if !$contentPerms.assigned}
{formfeedback warning="No Individual permissions set. Global Permissions apply."}
{else}
- {smartlink ititle="Remove all custom content permissions" action=expunge content_id=$gContent->mContentId}
+ {smartlink ititle="Clear all custom content permissions" action=expunge content_id=$gContent->mContentId}
{/if}
- <table class="data">
- <tr>
- <th>{tr}Permission{/tr}</th>
- {foreach from=$contentPerms.groups item=group}
- <th>{$group.group_name}</th>
- {/foreach}
- </tr>
+ {if count($contentPerms.groups) lt 10}
+ <table class="data">
+ <caption>{tr}Permissions set for this content item{/tr}</caption>
+ <tr>
+ <th>{tr}Permission{/tr}</th>
+ {foreach from=$contentPerms.groups item=group}
+ <th>{$group.group_name}</th>
+ {/foreach}
+ </tr>
- {foreach from=$contentPerms.assignable key=perm item=permInfo}
- <tr class="{cycle values="odd,even"}">
- <td>{$permInfo.perm_desc}<br /><em>({$permInfo.perm_name})</em></td>
- {foreach from=$contentPerms.groups key=group_id item=groupInfo}
- {assign var=icon value="icons/media-playback-stop"} {* default icon *}
- {assign var=action value="assign"} {* default action *}
- {if $groupInfo.perms.$perm} {* global active permissions *}
- {assign var=icon value="icons/dialog-ok"} {* default active permission icon *}
- {if $contentPerms.assigned.$group_id.$perm}
- {assign var=icon value="icons/list-add"} {* custon permission icon *}
- {assign var=action value="remove"} {* remove permission if we have a custom one *}
- {/if}
- {if $contentPerms.assigned.$group_id.$perm.is_excluded}
- {assign var=icon value="icons/list-remove"} {* is_excluded icon *}
+ {foreach from=$contentPerms.assignable key=perm item=permInfo}
+ <tr class="{cycle values="odd,even"}">
+ <td>{$permInfo.perm_desc}<br /><em>({$permInfo.perm_name})</em></td>
+ {foreach from=$contentPerms.groups key=groupId item=groupInfo}
+ {assign var=icon value="icons/media-playback-stop"} {* default icon *}
+ {assign var=action value="assign"} {* default action *}
+ {if $groupInfo.perms.$perm} {* global active permissions *}
+ {assign var=icon value="icons/dialog-ok"} {* default active permission icon *}
+ {if $contentPerms.assigned.$groupId.$perm}
+ {assign var=icon value="icons/list-add"} {* custon permission icon *}
+ {assign var=action value="remove"} {* remove permission if we have a custom one *}
+ {/if}
+ {if $contentPerms.assigned.$groupId.$perm.is_excluded}
+ {assign var=icon value="icons/list-remove"} {* is_excluded icon *}
+ {/if}
{/if}
- {/if}
- <td style="text-align:center">{smartlink itra=false ititle=$perm ibiticon=$icon action=$action content_id=$gContent->mContentId perm=$perm group_id=$group_id}</td>
+ <td style="text-align:center">{smartlink itra=false ititle=$perm ibiticon=$icon action=$action content_id=$gContent->mContentId perm=$perm group_id=$groupId}</td>
+ {/foreach}
+ </tr>
+ {/foreach}
+ </table>
+
+ {else}
+
+ {form}
+ <input type="hidden" name="content_id" value="{$gContent->mContentId}" />
+ <input type="hidden" name="action" value="assign" />
+
+ <div class="row">
+ {formlabel label="Assign this Permission" for="perm"}
+ {forminput}
+ <select name="perm" id="perm">
+ {foreach from=$contentPerms.assignable item=perm}
+ <option value="{$perm.perm_name}">{$perm.perm_desc}</option>
+ {/foreach}
+ </select>
+ {formhelp note=""}
+ {/forminput}
+ </div>
+
+ <div class="row">
+ {formlabel label="To this Group" for="group_id"}
+ {forminput}
+ <select name="group_id" id="group_id">
+ {foreach from=$contentPerms.groups item=group}
+ <option value="{$group.group_id}">{$group.group_name}</option>
+ {/foreach}
+ </select>
+ {formhelp note=""}
+ {/forminput}
+ </div>
+
+ <div class="row submit">
+ <input type="submit" name="back" value="{tr}Go back to content{/tr}" />
+ <input type="submit" name="assign" value="{tr}Assign Permission{/tr}" />
+ </div>
+ {/form}
+
+ {if $contentPerms.assigned}
+ <table class="data">
+ <caption>{tr}Custom permissions assigned to this content{/tr}</caption>
+ <tr>
+ <th>{tr}Group{/tr}</th>
+ <th>{tr}Permission{/tr}</th>
+ <th>{tr}Action{/tr}</th>
+ </tr>
+ {foreach from=$contentPerms.assigned key=groupId item=groupInfo}
+ {foreach from=$groupInfo key=perm item=permInfo name=fgroup}
+ <tr class="{cycle values="even,odd"}">
+ {if $smarty.foreach.fgroup.first}
+ <td rowspan="{$smarty.foreach.fgroup.total}">{$permInfo.group_name}</td>
+ {/if}
+ <td>
+ {if $contentPerms.assigned.$groupId.$perm.is_excluded}
+ {biticon iname=list-remove iexplain="Removed Permission"}
+ {else}
+ {biticon iname=list-add iexplain="Added Permission"}
+ {/if} {$permInfo.perm_desc} <em>({$permInfo.perm_name})</em>
+ </td>
+ <td align="right">
+ {smartlink ititle="Remove Permission" ibiticon="icons/edit-delete" action=remove content_id=$gContent->mContentId perm=$perm group_id=$groupId}
+ </td>
+ </tr>
+ {/foreach}
+ {foreachelse}
+ <tr class="norecords">
+ <td colspan="3">{tr}No individual permissions, global permissions apply{/tr}</td>
+ </tr>
{/foreach}
- </tr>
- {/foreach}
- </table>
+ </table>
+ {/if}
+
+ <h2 >{tr}Default Permissions{/tr}</h2>
+ <ul>
+ {foreach from=$contentPerms.groups key=groupId item=groupInfo}
+ <li>{$groupInfo.group_name}
+ <ul>
+ {foreach from=$groupInfo.perms key=perm item=permInfo}
+ {if $contentPerms.assignable.$perm}
+ <li>{$permInfo.perm_desc} <em>({$permInfo.perm_name})</em></li>
+ {/if}
+ {/foreach}
+ </ul>
+ </li>
+ {/foreach}
+ </ul>
+ {/if}
</div><!-- end .body -->
</div><!-- end .liberty -->