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

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

<big><b>Template Editor</b></big>
<br /><br />
	

EOF;
	}
	
	function body_bottom( $error )
	{
		return <<<EOF
$error		
</td>

<td class="space">&nbsp;</td>
</tr>		
EOF;
	}
	
	function edit_head( $name )
	{
		return <<<EOF
<table width="85%" cellpadding="3">

<tr class="dark">
<td>$name</td>
</tr>
</table>

<table width="85%" cellspacing="0" cellpadding="3" style="border: solid 1px black">	
EOF;
	}
	
	function section( $bit_id, $page_id, $set_id, $name, $type )
	{
		return <<<EOF
<tr>
<td class="bevel" width="75" align="center">
<a href="?Action=Editor&amp;M=Edit&amp;bit_id=$bit_id&amp;page_id=$page_id&amp;set_id=$set_id">Edit</a> 
<a href="?Action=Editor&amp;M=Delete&amp;bit_id=$bit_id&amp;page_id=$page_id&amp;set_id=$set_id">Delete</a> 
</td> 
<td class="bevel">$name ($type)</td>
<td class="bevel" width="60" align="center">
<a href="?Action=Editor&amp;M=U&amp;bit_id=$bit_id&amp;page_id=$page_id&amp;set_id=$set_id">Up</a> 
<a href="?Action=Editor&amp;M=D&amp;bit_id=$bit_id&amp;page_id=$page_id&amp;set_id=$set_id">Down</a> 
</td>
</tr>
EOF;
	}
	
	function edit_foot()
	{
		return <<<EOF
</table>
<br />
EOF;
	}
	
	function add_form( $page_id, $set_id, $type_options, $after_options )
	{
		return <<<EOF

<form action="?Action=Editor&amp;M=Add&amp;page_id=$page_id&amp;set_id=$set_id" method="post" >
<b>Add New Bit:</b><br />
Name: 
<input type="text" name="newname" size="10" maxlength="25" />
Type:
<select name="newtype">
$type_options
</select>
After: 
<select name="after_bit_id">
$after_options
</select>
<input type="submit" value="Add Bit" />
</form>
EOF;
	}
	
	function text_form( $bit_id, $page_id, $set_id, $data )
	{
		return <<<EOF
<div style="border: solid 1px black; width: 75%;">		
<div class="editor">
<b>Edit Text:</b>
<form action="?Action=Editor&amp;M=Save&amp;bit_id=$bit_id&amp;page_id=$page_id&amp;set_id=$set_id" method="post">
<textarea name="newdata" rows="7" cols="50">$data</textarea><br />
<br />
<input type="submit" value="Save Text" />
</form>
</div></div>
<br />
EOF;
	}
}

?>
Return current item: Write2Left