Location: PHPKode > projects > Write2Left > Skin/Users.php
<?php
/*
+------------------------------------------------------
| Write2Left
| (c) timdorr
| http://www.write2left.com
| hide@address.com
| See License.txt for license info
|------------------------------------------------------
| Script: Users.php
| Description:
|   Contains part of the interface's skin's default output parts
| Created Jun-19-2003
+------------------------------------------------------
*/

/* Class: Skin_Users
 * Description:
 *   The generic skin parts class.
 */
class Skin_Users
{
	function body_top()
	{
		return <<<EOF
<td class="main" valign="top">

<big><b>User Manager</b></big>
<br /><br />
	
EOF;
	}
	
	function body_bottom()
	{
		return <<<EOF
</td>

<td class="space">&nbsp;</td>
</tr>		
EOF;
	}
	
	function user_list_head()
	{
		return <<<EOF
<table width="85%" cellspacing="0" cellpadding="3" style="border: solid 1px black">	
<tr class="dark">
<td colspan="2">Current Users:</td>
</tr>
EOF;
	}
	
	function user_item( $user_id, $name )
	{
		return <<<EOF
<tr>
<td class="bevel" width="75" align="center">
<a href="?Action=Users&amp;M=Edit&amp;user_id=$user_id">Edit</a> 
<a href="?Action=Users&amp;M=Delete&amp;user_id=$user_id">Delete</a> 
</td> 
<td class="bevel">
$name
</td>
</tr>
EOF;
	}
	
	function user_list_foot()
	{
		return <<<EOF
</table>
<br />
EOF;
	}
	
	function new_user_form( $name='', $email='' )
	{
		return <<<EOF
<form action="?Action=Users&amp;M=Add" method="Post">
<b>Add a user:</b><br />
<br />
Username:<br />
<input type="text" name="name" value="$name" /><br />
Password:<br />
<input type="password" name="pass" /><br />
Confirm Password:<br />
<input type="password" name="verify" /><br />
Email:<br />
<input type="text" name="email" value="$email" /><br />
<br />
<input type="submit" value="Add User" />
</form>
<br />
EOF;
	}
	
	function error( $error )
	{
		return <<<EOF
<div class="error">$error</div>
<br />
EOF;
	}
	
	function del_confirm( $user_name, $user_id )
	{
		return <<<EOF
<div class="box">
Are you sure you want to delete $user_name?<br />
<a href="?Action=Users&amp;M=DoDelete&amp;user_id=$user_id">Yes</a> / <a href="?Action=Users">No</a>
</div>
<br />
EOF;
	}
	
	function edit_user_head( $id, $email )
	{
		return <<<EOF
<form action="?Action=Users&amp;M=DoEdit" method="Post">
<input type="hidden" name="id" value="$id" />

<table width="85%" cellspacing="0" cellpadding="3" style="border: solid 1px black">	

<tr class="dark">
<td>Edit user</td>
</tr>

<tr>
<td class="bevel">
Email:<br />
<input type="text" name="email" value="$email" /><br />
</td>
</tr>
EOF;
	}
	
	function edit_user_log_row( $id, $name, $perms )
	{
		return <<<EOF
<tr><td class="bevel">
<b>$name Abilities:</b><br />

<table width="100%" style="margin-left:10px; margin-right:-10px;">

<tr>
<td><input type="checkbox" name="log_{$id}[can_access]" $perms[can_access]/> Access Weblog </td>
<td><input type="checkbox" name="log_{$id}[can_upload]" $perms[can_upload]/> Upload Files</td>
</tr>

<tr>
<td><input type="checkbox" name="log_{$id}[can_post]" $perms[can_post]/> Post</td>
<td><input type="checkbox" name="log_{$id}[can_template]" $perms[can_template]/> Modify Templates</td>
</tr>

<tr>
<td><input type="checkbox" name="log_{$id}[can_edit]" $perms[can_edit]/> Edit Posts</td>
<td><input type="checkbox" name="log_{$id}[can_moderate]" $perms[can_moderate]/> Moderate Comments</td>
</tr>

<tr>
<td><input type="checkbox" name="log_{$id}[can_config]" $perms[can_config]/> Configure Log</td>
<td><input type="checkbox" name="log_{$id}[can_editors]" $perms[can_editors]/> Manage Editors and Permissions</td>
</tr>


<tr>
<td><input type="checkbox" name="log_{$id}[can_notify]" $perms[can_notify]/> Notify Mailing Lists</td>
<td><input type="checkbox" name="log_{$id}[can_mail]" $perms[can_mail]/> Edit Mailing Lists</td>
</tr>

</table>

</td></tr>
EOF;
	}
	
	function edit_user_foot()
	{
		return <<<EOF
</table>

<br />
<input type="submit" value="Edit User" />
</form>
<br />
EOF;
	}
}

?>
Return current item: Write2Left