summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Kremmel <xing@synapse.plus.com>2007-03-29 08:49:14 +0000
committerMax Kremmel <xing@synapse.plus.com>2007-03-29 08:49:14 +0000
commit801f039f939c24c5e28e61e66910f2cb6dc728fc (patch)
tree5b4666a736090dd29e8f43e13c263e182b1b9e69
parentd2c2e1c858d3879efde77157294354846d0f467d (diff)
downloadliberty-801f039f939c24c5e28e61e66910f2cb6dc728fc.tar.gz
liberty-801f039f939c24c5e28e61e66910f2cb6dc728fc.tar.bz2
liberty-801f039f939c24c5e28e61e66910f2cb6dc728fc.zip
you cannot have nested forms - services are inserted into forms, rename some of the form values to use unique names
-rw-r--r--content_permissions_inc.php12
-rw-r--r--templates/content_permissions_inc.tpl11
2 files changed, 12 insertions, 11 deletions
diff --git a/content_permissions_inc.php b/content_permissions_inc.php
index b22d2ee..40b38e6 100644
--- a/content_permissions_inc.php
+++ b/content_permissions_inc.php
@@ -1,6 +1,6 @@
<?php
/**
- * @version $Revision: 1.4 $
+ * @version $Revision: 1.5 $
* @package liberty
* @subpackage functions
*/
@@ -13,14 +13,14 @@ if( !empty( $verify_permission ) ) {
// If we haven't got any content loaded yet, load it
if( empty( $gContent ) ) {
// make sure we have a content_id we can work with
- if( empty( $_REQUEST["content_id"] ) || $_REQUEST["content_id"] < 1 ) {
+ if( empty( $_REQUEST["perm_content_id"] ) || $_REQUEST["perm_content_id"] < 1 ) {
$gBitSmarty->assign( 'msg', tra( "No valid content id given." ) );
$gBitSystem->display( 'error.tpl' );
die;
}
$gContent = new LibertyContent();
- $gContent = $gContent->getLibertyObject( $_REQUEST['content_id'] );
+ $gContent = $gContent->getLibertyObject( $_REQUEST['perm_content_id'] );
}
$gBitSmarty->assign_by_ref( 'gContent', $gContent );
@@ -32,14 +32,14 @@ if( !empty( $_REQUEST['back'] ) ) {
}
// Update database if needed
-if( !empty( $_REQUEST["group_id"] ) && !empty( $gContent->mContentId ) && !empty( $_REQUEST["perm"] ) ) {
+if( !empty( $_REQUEST["perm_group_id"] ) && !empty( $gContent->mContentId ) && !empty( $_REQUEST["perm"] ) ) {
if( isset( $_REQUEST["assign"] ) ) {
- $gContent->storePermission( $_REQUEST["group_id"], $_REQUEST["perm"], $gContent->mContentId );
+ $gContent->storePermission( $_REQUEST["perm_group_id"], $_REQUEST["perm"], $gContent->mContentId );
}
if( isset( $_REQUEST["action"] ) ) {
if( $_REQUEST["action"] == 'remove' ) {
- $gContent->removePermission( $_REQUEST["group_id"], $_REQUEST["perm"] );
+ $gContent->removePermission( $_REQUEST["perm_group_id"], $_REQUEST["perm"] );
}
}
}
diff --git a/templates/content_permissions_inc.tpl b/templates/content_permissions_inc.tpl
index b185ec2..70bd4e2 100644
--- a/templates/content_permissions_inc.tpl
+++ b/templates/content_permissions_inc.tpl
@@ -1,7 +1,8 @@
<h2>{tr}Assign permissions to{/tr}: {$gContent->getTitle()}</h2>
-{form legend="Content Permissions"}
- <input type="hidden" name="content_id" value="{$gContent->mContentId}" />
+{* you can't have a form within a form - services are inserted into forms - xing
+form legend="Content Permissions"*}
+ <input type="hidden" name="perm_content_id" value="{$gContent->mContentId}" />
<div class="row">
{formlabel label="Assign this Permission" for="perm"}
@@ -18,7 +19,7 @@
<div class="row">
{formlabel label="To this Group" for="group_id"}
{forminput}
- <select name="group_id" id="group_id">
+ <select name="perm_group_id" id="group_id">
{foreach from=$userGroups item=group}
<option value="{$group.group_id}">{$group.group_name}</option>
{/foreach}
@@ -31,7 +32,7 @@
<input type="submit" name="back" value="{tr}Go back to content{/tr}" />
<input type="submit" name="assign" value="{tr}Assign Permission{/tr}" />
</div>
-{/form}
+{*/form*}
<br />
@@ -51,7 +52,7 @@
{$perm.perm_desc}
</td>
<td align="right">
- {smartlink ititle="Remove Permission" ibiticon="icons/edit-delete" action=remove content_id=$gContent->mContentId perm=$perm.perm_name group_id=$perm.group_id}
+ {smartlink ititle="Remove Permission" ibiticon="icons/edit-delete" action=remove perm_content_id=$gContent->mContentId perm=$perm.perm_name group_id=$perm.group_id}
</td>
</tr>
{foreachelse}