[pLog-svn] r6056 - in plog/trunk: class/action/admin class/view/admin js/ui/pages templates/admin

mark at devel.lifetype.net mark at devel.lifetype.net
Mon Nov 19 06:23:34 EST 2007


Author: mark
Date: 2007-11-19 06:23:34 -0500 (Mon, 19 Nov 2007)
New Revision: 6056

Added:
   plog/trunk/templates/admin/addbloguser_form.template
   plog/trunk/templates/admin/editbloguser_form.template
Modified:
   plog/trunk/class/action/admin/admineditbloguseraction.class.php
   plog/trunk/class/action/admin/admineditfriendgroupaction.class.php
   plog/trunk/class/action/admin/admineditlinkcategoryaction.class.php
   plog/trunk/class/view/admin/adminnewbloguserview.class.php
   plog/trunk/js/ui/pages/blogusers.js
   plog/trunk/templates/admin/addbloguser.template
   plog/trunk/templates/admin/editbloguser.template
Log:
now, the blogusers panel can edit and update without problems.

Modified: plog/trunk/class/action/admin/admineditbloguseraction.class.php
===================================================================
--- plog/trunk/class/action/admin/admineditbloguseraction.class.php	2007-11-19 08:58:25 UTC (rev 6055)
+++ plog/trunk/class/action/admin/admineditbloguseraction.class.php	2007-11-19 11:23:34 UTC (rev 6056)
@@ -1,17 +1,10 @@
 <?php
-
-		
-	
-		
-		
-			
-
     /**
      * \ingroup Action
      * @private
      */
-    class AdminEditBlogUserAction extends AdminAction 
-	{	
+    class AdminEditBlogUserAction extends AdminAction
+	{
     	/**
          * Constructor. If nothing else, it also has to call the constructor of the parent
          * class, BlogAction with the same parameters
@@ -19,14 +12,14 @@
         function AdminEditBlogUserAction( $actionInfo, $request )
         {
         	$this->AdminAction( $actionInfo, $request );
-			
+
 			// register one validator
 			$this->registerFieldValidator( "userId", new IntegerValidator());
 			// and the view we should show in case there is a validation error
 			$errorView = new AdminBlogUsersListView( $this->_blogInfo );
-			$errorView->setErrorMessage( $this->_locale->tr("error_invalid_user_id" ));			
+			$errorView->setErrorMessage( $this->_locale->tr("error_invalid_user_id" ));
 			$this->setValidationErrorView( $errorView );
-			
+
 			$this->requirePermission( "update_blog_user");
         }
 
@@ -34,7 +27,7 @@
 		{
 			// fetch the data, we already know it's valid and that we can trust it!
 			$userId = $this->_request->getValue( "userId" );
-			
+
 			// load the user
 			$users = new Users();
 			$userInfo = $users->getUserInfoFromId( $userId );
@@ -49,37 +42,51 @@
         {
 			$userInfo = $this->loadUser();
 			if( !$userInfo ) {
-				$errorView = new AdminBlogUsersListView( $this->_blogInfo );
-				$errorView->setErrorMessage( $this->_locale->tr("error_invalid_user_id" ));
+				if( Request::isXHR())
+					$this->_view = new AdminErrorDialogView( $this->_blogInfo );
+				else
+					$this->_view = new AdminBlogUsersListView( $this->_blogInfo );
+
+				$this->_view->setErrorMessage( $this->_locale->tr("error_invalid_user_id" ));
 				$this->setCommonData();
-				return( false );
+				return false;
 			}
 
 			// pass all the information to the view
-			$this->_view = new AdminTemplatedView( $this->_blogInfo, "editbloguser" );
-			$this->_view->setValue( "edituser", $userInfo );			
+            // otherwise show the form to edit its fields
+			if( Request::isXHR())
+        		$this->_view = new AdminTemplatedView( $this->_blogInfo, "editbloguser_form" );
+			else
+				$this->_view = new AdminTemplatedView( $this->_blogInfo, "editbloguser" );
+
+			$this->_view->setValue( "edituser", $userInfo );
 	        $perms = new Permissions();
 			$this->_view->setValue( "perms", $perms->getAllPermissions());
 			$this->setCommonData();
-			
+
 			return( true );
         }
 
 		function performAjax()
 		{
-			
-			$this->_view = new AdminAjaxView( $this->_blogInfo );
-			
-			$userInfo = $this->loadUser();
-			if( !$userInfo ) {
-				$this->_view->setErrorMessage( $this->_locale->tr("error_invalid_user_id" ));
-				return( false );
-			}			
-			
-			$this->_view->setResult( Array( "bloguser" => $userInfo, "blog" => $this->_blogInfo, "permissions" => $userInfo->getPermissions( $this->_blogInfo->getId())));
-			
-			// include also the permission that this user has in this blog
-			return( true );
+
+			if( $this->_request->getOutput() == Request::REQUEST_OUTPUT_JSON ) {
+    			$this->_view = new AdminAjaxView( $this->_blogInfo );
+
+    			$userInfo = $this->loadUser();
+    			if( !$userInfo ) {
+    				$this->_view->setErrorMessage( $this->_locale->tr("error_invalid_user_id" ));
+    				return( false );
+    			}
+
+    			$this->_view->setResult( Array( "bloguser" => $userInfo, "blog" => $this->_blogInfo, "permissions" => $userInfo->getPermissions( $this->_blogInfo->getId())));
+
+    			// include also the permission that this user has in this blog
+    			return( true );
+			}
+			else {
+				return( $this->perform());
+			}
 		}
     }
 ?>
\ No newline at end of file

Modified: plog/trunk/class/action/admin/admineditfriendgroupaction.class.php
===================================================================
--- plog/trunk/class/action/admin/admineditfriendgroupaction.class.php	2007-11-19 08:58:25 UTC (rev 6055)
+++ plog/trunk/class/action/admin/admineditfriendgroupaction.class.php	2007-11-19 11:23:34 UTC (rev 6056)
@@ -53,19 +53,19 @@
 				if( Request::isXHR())
 					$this->_view = new AdminErrorDialogView( $this->_blogInfo );
 				else
-					$this->_view = new AdminFriendGroupsListView( $this->_blogInfo, $this->_locale->tr("error_incorrect_friend_group_id"));
-					
+					$this->_view = new AdminFriendGroupsListView( $this->_blogInfo );
+
                 $this->_view->setErrorMessage( $this->_locale->tr("error_fetching_friend_group"));
                 $this->setCommonData();
 				return( false );
 			}
-						
+
             // otherwise show the form to edit its fields
 			if( Request::isXHR())
         		$this->_view = new AdminTemplatedView( $this->_blogInfo, "editfriendgroup_form" );
 			else
 				$this->_view = new AdminTemplatedView( $this->_blogInfo, "editfriendgroup" );
-							
+
 			$this->_view->setValue( "groupId", $group->getId());
         	$this->_view->setValue( "groupName", $group->getName());
 			$this->_view->setValue( "groupDescription", $group->getDescription());
@@ -85,14 +85,14 @@
 	                $this->_view->setErrorMessage( $this->_locale->tr("error_fetching_friend_group"));
 					return( false );
 				}
-						
+
 	            // otherwise show the form to edit its fields
-				
+
 	        	$this->_view = new AdminAjaxView( $this->_blogInfo );
 				$this->_view->setResult( $group );
 
 	            // better to return true if everything fine
-	            return true;			
+	            return true;
 			}
 			else {
 				return( $this->perform());

Modified: plog/trunk/class/action/admin/admineditlinkcategoryaction.class.php
===================================================================
--- plog/trunk/class/action/admin/admineditlinkcategoryaction.class.php	2007-11-19 08:58:25 UTC (rev 6055)
+++ plog/trunk/class/action/admin/admineditlinkcategoryaction.class.php	2007-11-19 11:23:34 UTC (rev 6056)
@@ -1,19 +1,19 @@
 <?php
 
-	
-    
-	
-		
-    
-    
 
+
+
+
+
+
+
     /**
      * \ingroup Action
      * @private
      *
      * Action that shows a form to change the settings of the link category
      */
-    class AdminEditLinkCategoryAction extends AdminAction 
+    class AdminEditLinkCategoryAction extends AdminAction
 	{
     	var $_categoryId;
 
@@ -24,14 +24,14 @@
         function AdminEditLinkCategoryAction( $actionInfo, $request )
         {
         	$this->AdminAction( $actionInfo, $request );
-			
+
 			// data validation
 			$this->registerFieldValidator( "categoryId", new IntegerValidator());
 			$this->_form->registerField( "categoryName" );
 			$view = new AdminLinkCategoriesListView( $this->_blogInfo );
 			$view->setErrorMessage( $this->_locale->tr("error_fetching_link_category" ));
 			$this->setValidationErrorView( $view );
-			
+
 			// permission checks
 			$this->requirePermission( "update_link_category" );
         }
@@ -47,10 +47,10 @@
                 return false;
             }
 			$this->notifyEvent( EVENT_LINK_CATEGORY_LOADED, Array( "linkcategory" => &$category ));
-			
+
 			return( $category );
 		}
-        
+
         /**
          * Carries out the specified action
          */
@@ -61,19 +61,19 @@
 				if( Request::isXHR())
 					$this->_view = new AdminErrorDialogView( $this->_blogInfo );
 				else
-					$this->_view = new AdminLinkCategoriesListView( $this->_blogInfo, $this->_locale->tr("error_incorrect_link_category_id"));
-					
+					$this->_view = new AdminLinkCategoriesListView( $this->_blogInfo );
+
                 $this->_view->setErrorMessage( $this->_locale->tr("error_fetching_link_category"));
                 $this->setCommonData();
 				return( false );
 			}
-						
+
             // otherwise show the form to edit its fields
 			if( Request::isXHR())
         		$this->_view = new AdminTemplatedView( $this->_blogInfo, "editlinkcategory_form" );
 			else
 				$this->_view = new AdminTemplatedView( $this->_blogInfo, "editlinkcategory" );
-							
+
 			$this->_view->setValue( "linkCategoryName", $category->getName());
 			$this->_view->setValue( "linkCategoryId", $category->getId());
             $this->setCommonData();
@@ -91,14 +91,14 @@
 	                $this->_view->setErrorMessage( $this->_locale->tr("error_fetching_link_category"));
 					return( false );
 				}
-						
+
 	            // otherwise show the form to edit its fields
-				
+
 	        	$this->_view = new AdminAjaxView( $this->_blogInfo );
 				$this->_view->setResult( $category );
 
 	            // better to return true if everything fine
-	            return true;			
+	            return true;
 			}
 			else {
 				return( $this->perform());

Modified: plog/trunk/class/view/admin/adminnewbloguserview.class.php
===================================================================
--- plog/trunk/class/view/admin/adminnewbloguserview.class.php	2007-11-19 08:58:25 UTC (rev 6055)
+++ plog/trunk/class/view/admin/adminnewbloguserview.class.php	2007-11-19 11:23:34 UTC (rev 6056)
@@ -1,26 +1,25 @@
 <?php
-
-	
-	
-
     /**
      * \ingroup View
      * @private
-     *	
+     *
 	 * Shows the form to add a new user to the blog, including permissions
      */
-    class AdminNewBlogUserView extends AdminTemplatedView 
+    class AdminNewBlogUserView extends AdminTemplatedView
 	{
         function AdminNewBlogUserView( $blogInfo, $params = Array())
-        {		
-        	$this->AdminTemplatedView( $blogInfo, "addbloguser" );
+        {
+			if( Request::isXHR())
+				$this->AdminTemplatedView( $blogInfo, "addbloguser_form" );
+			else
+				$this->AdminTemplatedView( $blogInfo, "addbloguser" );
 		}
 
         function render()
         {
 	        $perms = new Permissions();
 			$this->setValue( "perms", $perms->getAllPermissions());
-	        		
+
 			parent::render();
         }
     }

Modified: plog/trunk/js/ui/pages/blogusers.js
===================================================================
--- plog/trunk/js/ui/pages/blogusers.js	2007-11-19 08:58:25 UTC (rev 6055)
+++ plog/trunk/js/ui/pages/blogusers.js	2007-11-19 11:23:34 UTC (rev 6056)
@@ -51,14 +51,19 @@
 
 Lifetype.UI.Pages.BlogUsers.addBlogUserSubmitHook = function( form )
 {
-	Lifetype.Forms.AjaxFormProcessor( form.id,'?output=json', {resetAfterSuccess:true} );	
+	Lifetype.Forms.AjaxFormProcessor( form.id,'?output=json', {resetAfterSuccess:true} );
 }
 
+Lifetype.UI.Pages.BlogUsers.updateBlogUserSubmitHook = function( form )
+{
+	Lifetype.Forms.AjaxFormProcessor( form.id,'?output=json', {resetAfterSuccess:true} );
+}
+
 YAHOO.util.Event.addListener( window, "load", function() {
 		var t = new Lifetype.Effects.Table( "blogUsersTable" );
 		t.stripe();
 		t.highlightRows();
-		
+
 		// reload the list when successfully deleting an item and processing one of the forms
 		Lifetype.Forms.Events.performRequestSuccessEvent.subscribe( function() { Lifetype.UI.DataTable.reload( '?op=showBlogUsers' )});
 		Lifetype.Forms.Events.formProcessorSuccessEvent.subscribe( function() {Lifetype.UI.DataTable.reload( '?op=showBlogUsers' )});

Modified: plog/trunk/templates/admin/addbloguser.template
===================================================================
--- plog/trunk/templates/admin/addbloguser.template	2007-11-19 08:58:25 UTC (rev 6055)
+++ plog/trunk/templates/admin/addbloguser.template	2007-11-19 11:23:34 UTC (rev 6056)
@@ -1,59 +1,7 @@
- <form name="addBlogUser" id="addBlogUser" action="admin.php" method="post" onSubmit="Lifetype.UI.Pages.BlogUsers.addBlogUserSubmitHook(this);return(false);">
-   <fieldset class="inputField">  
-     <legend>{$locale->tr("newBlogUser")}</legend>
-     {include file="$admintemplatepath/formvalidateajax.template"}
-     <div class="field">
-      <label for="userName">{$locale->tr("username")}</label>
-      <span class="required">*</span>
-      <div class="formHelp">{$locale->tr("new_blog_username_help")}</div>
-      <input type="text" id="userName" name="userName" value="{$newBlogUserName}" style="width:50%" />
-      <input type="hidden" id="userId" name="userId" />
-	  {check_perms adminperm=view_users}
-	   <a href="#" onclick="window.open('?op=siteUsersChooser','UserChooser','scrollbars=yes,resizable=yes,toolbar=no,height=450,width=600');">
-		{$locale->tr("select")}
-	   </a>
-	  {/check_perms}
-	  {include file="$admintemplatepath/validateajax.template" field=newBlogUserName}
-     </div>
+{include file="$admintemplatepath/header.template"}
+{include file="$admintemplatepath/navigation.template" showOpt=newBlogUser title=$locale->tr("newBlogUser")}
 
-     <div class="field">
-       <label for="sendNotification">{$locale->tr("send_notification")}</label>      
-       <div class="formHelp">
-	    <input class="checkbox" type="checkbox" id="sendNotification" name="sendNotification" value="1" {if isset($sendNotification)}checked="checked"{/if} />	   
-	    {$locale->tr("send_user_notification_help")}
-	  </div>
-     </div>
-     
-     <div class="field">
-      <label for="perm">{$locale->tr("permissions")}</label>
-      <div class="formHelp">{$locale->tr("blog_user_permissions_help")}</div>
-        {$locale->tr("quick_permission_selection")}
-        </br>
-        <select name="preselection" onChange="Lifetype.UI.Pages.BlogUsers.togglePermissionSets('addBlogUser', this.value);">
-          <option value=""/>{$locale->tr("select")}</option>
-          <option value="basic_blog_permission"/>{$locale->tr("basic_blog_permission")}</option>
-          <option value="full_blog_permission"/>{$locale->tr("full_blog_permission")}</option>
-        </select><br/>
-        <div id="permissions" style="overflow:auto;height:190px;">
-     	{foreach from=$perms item=permission}
-     	 {if !$permission->isAdminOnlyPermission()}
-  		   {assign var=permId value=$permission->getId()}
-           {if $permission->getName() == "blog_access"}
-             {** the blog_access permission will always be checked by default for new users, in order not to cause confusion as
-	             this permissions is now needed for even accessing the blog **}
-		     <input type="hidden" name="perm[{$permission->getId()}]" value="{$permission->getId()}" />
-           {else}
-     	     <input type="checkbox" class="checkbox" name="perm[{$permission->getId()}]" value="{$permission->getId()}" {if $perm[$permId]==$permission->getId()}checked="checked"{/if} />
-     	     {$locale->tr($permission->getDescription())}<br/>
-           {/if}
-     	 {/if}
-     	{/foreach}		
-       </div>
-     </div>
-  </fieldset>
-  <div class="buttons">  
-    <input type="reset" value="{$locale->tr("reset")}" name="resetButton" />
-    <input type="submit" name="Add this user" value="{$locale->tr("add")}"/>
-    <input type="hidden" name="op" value="addBlogUser"/>
-  </div> 
- </form>
\ No newline at end of file
+{include file="$admintemplatepath/addbloguser_form.template"}
+
+{include file="$admintemplatepath/footernavigation.template"}
+{include file="$admintemplatepath/footer.template"}
\ No newline at end of file

Added: plog/trunk/templates/admin/addbloguser_form.template
===================================================================
--- plog/trunk/templates/admin/addbloguser_form.template	                        (rev 0)
+++ plog/trunk/templates/admin/addbloguser_form.template	2007-11-19 11:23:34 UTC (rev 6056)
@@ -0,0 +1,59 @@
+ <form name="addBlogUser" id="addBlogUser" action="admin.php" method="post" onSubmit="Lifetype.UI.Pages.BlogUsers.addBlogUserSubmitHook(this);return(false);">
+   <fieldset class="inputField">  
+     <legend>{$locale->tr("newBlogUser")}</legend>
+     {include file="$admintemplatepath/formvalidateajax.template"}
+     <div class="field">
+      <label for="userName">{$locale->tr("username")}</label>
+      <span class="required">*</span>
+      <div class="formHelp">{$locale->tr("new_blog_username_help")}</div>
+      <input type="text" id="userName" name="userName" value="{$newBlogUserName}" style="width:50%" />
+      <input type="hidden" id="userId" name="userId" />
+	  {check_perms adminperm=view_users}
+	   <a href="#" onclick="window.open('?op=siteUsersChooser','UserChooser','scrollbars=yes,resizable=yes,toolbar=no,height=450,width=600');">
+		{$locale->tr("select")}
+	   </a>
+	  {/check_perms}
+	  {include file="$admintemplatepath/validateajax.template" field=newBlogUserName}
+     </div>
+
+     <div class="field">
+       <label for="sendNotification">{$locale->tr("send_notification")}</label>      
+       <div class="formHelp">
+	    <input class="checkbox" type="checkbox" id="sendNotification" name="sendNotification" value="1" {if isset($sendNotification)}checked="checked"{/if} />	   
+	    {$locale->tr("send_user_notification_help")}
+	  </div>
+     </div>
+     
+     <div class="field">
+      <label for="perm">{$locale->tr("permissions")}</label>
+      <div class="formHelp">{$locale->tr("blog_user_permissions_help")}</div>
+        {$locale->tr("quick_permission_selection")}
+        </br>
+        <select name="preselection" onChange="Lifetype.UI.Pages.BlogUsers.togglePermissionSets('addBlogUser', this.value);">
+          <option value=""/>{$locale->tr("select")}</option>
+          <option value="basic_blog_permission"/>{$locale->tr("basic_blog_permission")}</option>
+          <option value="full_blog_permission"/>{$locale->tr("full_blog_permission")}</option>
+        </select><br/>
+        <div id="permissions" style="overflow:auto;height:190px;">
+     	{foreach from=$perms item=permission}
+     	 {if !$permission->isAdminOnlyPermission()}
+  		   {assign var=permId value=$permission->getId()}
+           {if $permission->getName() == "blog_access"}
+             {** the blog_access permission will always be checked by default for new users, in order not to cause confusion as
+	             this permissions is now needed for even accessing the blog **}
+		     <input type="hidden" name="perm[{$permission->getId()}]" value="{$permission->getId()}" />
+           {else}
+     	     <input type="checkbox" class="checkbox" name="perm[{$permission->getId()}]" value="{$permission->getId()}" {if $perm[$permId]==$permission->getId()}checked="checked"{/if} />
+     	     {$locale->tr($permission->getDescription())}<br/>
+           {/if}
+     	 {/if}
+     	{/foreach}		
+       </div>
+     </div>
+  </fieldset>
+  <div class="buttons">  
+    <input type="reset" value="{$locale->tr("reset")}" name="resetButton" />
+    <input type="submit" name="Add this user" value="{$locale->tr("add")}"/>
+    <input type="hidden" name="op" value="addBlogUser"/>
+  </div> 
+ </form>
\ No newline at end of file

Modified: plog/trunk/templates/admin/editbloguser.template
===================================================================
--- plog/trunk/templates/admin/editbloguser.template	2007-11-19 08:58:25 UTC (rev 6055)
+++ plog/trunk/templates/admin/editbloguser.template	2007-11-19 11:23:34 UTC (rev 6056)
@@ -1,41 +1,7 @@
-<form name="editBlogUser" id="editBlogUser" action="admin.php" method="post" onSubmit="Lifetype.Forms.AjaxFormProcessor(this.id,'?op=updateBlogUser&output=json');return(false);"> 
-   <fieldset class="inputField">
-  
-     <legend>{$locale->tr("newBlogUser")}</legend>
-     {include file="$admintemplatepath/formvalidateajax.template"}
+{include file="$admintemplatepath/header.template"}
+{include file="$admintemplatepath/navigation.template" showOpt=showBlogUsers title=$locale->tr("editBlogUser")}
 
-     <div class="field">
-      <label for="newBlogUserName">{$locale->tr("username")}</label>
-      <input type="text" disabled="disabled" id="newBlogUsername" name="newBlogUserName" value="{$edituser->getUsername()}" />
-	 {include file="$admintemplatepath/validateajax.template" field=newBlogUserName}
-     </div>
+{include file="$admintemplatepath/editbloguser_form.template"}
 
-     <div class="field">
-      <label for="perm">{$locale->tr("permissions")}</label>
-      <span class="required"></span>
-      <div class="formHelp">{$locale->tr("blog_user_permissions_help")}</div>
-        {$locale->tr("quick_permission_selection")}
-        </br>
-        <select name="preselection" onChange="Lifetype.UI.Pages.BlogUsers.togglePermissionSets('editBlogUser', this.value);">
-          <option value=""/>{$locale->tr("select")}</option>
-          <option value="basic_blog_permission"/>{$locale->tr("basic_blog_permission")}</option>
-          <option value="full_blog_permission"/>{$locale->tr("full_blog_permission")}</option>
-        </select><br/>     
-		<div id="permissions" style="overflow:auto;height:190px;">
-     	{foreach from=$perms item=perm}
-     	 {if !$perm->isAdminOnlyPermission()}
-     	 <input type="checkbox" class="checkbox" name="perm[]" value="{$perm->getId()}" {if $edituser->hasPermissionByName($perm->getName(),$blog->getId())}checked="checked"{/if}/>
-     	 {$locale->tr($perm->getDescription())}<br/>
-     	 {/if}
-     	{/foreach}
-		</div>
-     </div>
-
-  </fieldset>
-  <div class="buttons"> 
-	<input type="hidden" name="userId" value="{$edituser->getId()}" />
-    <input type="reset" value="{$locale->tr("reset")}" name="resetButton" />
-    <input type="submit" name="Add this user" value="{$locale->tr("update")}"/>
-    <input type="hidden" name="op" value="updateBlogUser"/>
-  </div> 
- </form>
\ No newline at end of file
+{include file="$admintemplatepath/footernavigation.template"}
+{include file="$admintemplatepath/footer.template"}
\ No newline at end of file

Added: plog/trunk/templates/admin/editbloguser_form.template
===================================================================
--- plog/trunk/templates/admin/editbloguser_form.template	                        (rev 0)
+++ plog/trunk/templates/admin/editbloguser_form.template	2007-11-19 11:23:34 UTC (rev 6056)
@@ -0,0 +1,41 @@
+<form name="editBlogUser" id="editBlogUser" action="admin.php" method="post" onSubmit="Lifetype.UI.Pages.BlogUsers.updateBlogUserSubmitHook(this);return(false);">
+   <fieldset class="inputField">
+
+     <legend>{$locale->tr("newBlogUser")}</legend>
+     {include file="$admintemplatepath/formvalidateajax.template"}
+
+     <div class="field">
+      <label for="newBlogUserName">{$locale->tr("username")}</label>
+      <input type="text" disabled="disabled" id="newBlogUsername" name="newBlogUserName" value="{$edituser->getUsername()}" />
+	 {include file="$admintemplatepath/validateajax.template" field=newBlogUserName}
+     </div>
+
+     <div class="field">
+      <label for="perm">{$locale->tr("permissions")}</label>
+      <span class="required"></span>
+      <div class="formHelp">{$locale->tr("blog_user_permissions_help")}</div>
+        {$locale->tr("quick_permission_selection")}
+        </br>
+        <select name="preselection" onChange="Lifetype.UI.Pages.BlogUsers.togglePermissionSets('editBlogUser', this.value);">
+          <option value=""/>{$locale->tr("select")}</option>
+          <option value="basic_blog_permission"/>{$locale->tr("basic_blog_permission")}</option>
+          <option value="full_blog_permission"/>{$locale->tr("full_blog_permission")}</option>
+        </select><br/>
+		<div id="permissions" style="overflow:auto;height:190px;">
+     	{foreach from=$perms item=perm}
+     	 {if !$perm->isAdminOnlyPermission()}
+     	 <input type="checkbox" class="checkbox" name="perm[]" value="{$perm->getId()}" {if $edituser->hasPermissionByName($perm->getName(),$blog->getId())}checked="checked"{/if}/>
+     	 {$locale->tr($perm->getDescription())}<br/>
+     	 {/if}
+     	{/foreach}
+		</div>
+     </div>
+
+  </fieldset>
+  <div class="buttons">
+	<input type="hidden" name="userId" value="{$edituser->getId()}" />
+    <input type="reset" value="{$locale->tr("reset")}" name="resetButton" />
+    <input type="submit" name="Add this user" value="{$locale->tr("update")}"/>
+    <input type="hidden" name="op" value="updateBlogUser"/>
+  </div>
+ </form>
\ No newline at end of file



More information about the pLog-svn mailing list