Location: PHPKode > projects > O - OpenSource GroupWare > osgw/notebook/add_note.php
<?php
/**************************************************************************
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.

   @Authors:	Ryan Thompson(hide@address.com)
***************************************************************************/
/*$Id: add_note.php,v 1.14 2003/12/10 20:04:23 rthomp Exp $*/
include("./data.php");
$service['add_header'] = TRUE;
include("../config.inc.php");
include($here. "/class.notebook.php");
$notes = new notebook;
if(isset($_POST['save_add_note']) || isset($_POST['save_note']))
{
	if($notes->verify_title($_POST['title']))
	{
		$notes->save_note($_POST, $user->user_id);
		if(isset($_POST['save_note']))
		{
			$O->redirect('/notebook');
		}	
		unset($_POST);
	}
} elseif(isset($_POST['cancel']))
{
	$O->redirect('/notebook');
}

echo $layout->page_header;
echo $layout->service_header($notes->msg('service_name'), $notes->nav_buttons(), $notes->msg('add_note'));


if($error->buffer)
{
	echo $error->display();
}
if(isset($_POST['enable_sharing']))
{
	$share_enabled = " checked=\"checked\"";
	$display = "display:block";
} else {
	$display = "display:none";
}
echo $html->create_list(
		array("SELF"=>$_SERVER['PHP_SELF'],
			"TITLE_TEXT"=>$text['title'],
			"TITLE"=>$_POST['title'],
			"CATEGORY_TEXT"=>$text['category'],
			"CATEGORY"=>$category->get_category_select($user->user_id, 'nb', 'add_note.php', 0),
			"NOTE_TEXT"=>$text['note'],
			"NOTE"=>$_POST['note'],
			"SAVE_ADD_TEXT"=>$text['save_add'],
			"SAVE_TEXT"=>$text['save'],
			"CANCEL_TEXT"=>$text['cancel'],
			"SHARING"=>$text['share'],
			"SHARE_ENABLED"=>$share_enabled,
			"DISPLAY"=>$display,
			"SHARE_SELECT"=>$share->share_select($user->user_id, $_POST['share_groups']),
			"USER_SELECT"=>$share->share_select_users($_POST['share_groups'], $_POST['share_users']),
			),
		"{$layout->service_theme}/add_note.html");
	


echo $layout->create_footer();
Return current item: O - OpenSource GroupWare