-
Notifications
You must be signed in to change notification settings - Fork 0
/
note_add_page.php
112 lines (101 loc) · 3.44 KB
/
note_add_page.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<?php
# phpWebNotes - a php based note addition system
# Copyright (C) 2000-2002 Webnotes Team - webnotes-devel@sourceforge.net
# This program is distributed under the terms and conditions of the GPL
# See the files README and LICENSE for details
# --------------------------------------------------------
# $Id: note_add_page.php,v 1.21 2002/10/03 06:01:25 vboctor Exp $
# --------------------------------------------------------
require_once( 'core' . DIRECTORY_SEPARATOR . 'api.php' );
access_ensure_check_action( ACTION_NOTES_SUBMIT );
print_html_top();
print_head_top();
print_title( $g_window_title );
print_css( $g_css_inc_file );
print_head_bottom();
print_body_top();
print_header( $g_page_title );
print_top_page( $g_top_page_inc );
$f_note_id = gpc_get_int( 'f_note_id', 0 );
if ( 0 == $f_note_id ) {
$f_page_id = gpc_get_int( 'f_page_id' );
$t_default_email = '';
if ( ( ON == config_get('auto_set_email') ) && access_is_logged_in() ) {
$t_user_info = user_get_info( user_where_current() );
if ( false !== $t_user_info ) {
$t_default_email = $t_user_info['email'];
}
}
$t_default_body = '';
$t_note_id = 0;
} else {
$t_note_info = note_get_info( note_where_id_equals( $f_note_id ) );
if ( false === $t_note_info ) {
# @@@@ proper error
echo "no note with the specified id";
exit;
}
$t_default_email = $t_note_info['email'];
$t_default_body = $t_note_info['note'];
$t_note_id = db_prepare_int( $f_note_id );
$f_page_id = $t_note_info['page_id'];
}
$t_page_name = page_get_name( $f_page_id );
if ( empty ( $t_page_name ) ) {
echo "<div align=\"center\">";
# @@@@ replace with one parameterised localisation string
echo "$s_not_indexed_part1 <a href=\"mailto:$g_administrator_email\">$s_administrator</a> $s_not_indexed_part2";
echo "</div>";
}
else {
?>
<?php
# @@@@ When themes are supported, this won't be needed (or at least done in another way.
### Display a nice message
if ( file_exists( $g_note_add_include ) ) {
include( $g_note_add_include );
}
$t_base_page_name = basename( $t_page_name );
#$t_date = date( $g_date_format, time() ); #Remon
#$t_date = date ('M-d-Y H:i');
$t_date = date ($g_date_format);
echo <<<EOT
<div class="center">
<div class="medium-width">
<table class="box" summary="">
<form method="post" action="$g_note_preview_page">
<input type="hidden" name="f_page_id" value="$f_page_id" />
<input type="hidden" name="f_note_id" value="$t_note_id" />
<tr class="form-title">
<td colspan="2"><strong>$s_add_note</strong></td>
</tr>
<tr class="row-1">
<th width="15%">$s_page</th>
<td width="85%">$t_base_page_name</td>
</tr>
<tr class="row-2">
<th>$s_date</th>
<td>$t_date</td>
</tr>
<tr class="row-1">
<th>$s_email</th>
<td><input type="text" name="f_email" size="64" maxlength="128" value="$t_default_email"/></td>
</tr>
<tr class="row-2">
<th>$s_note</th>
<td><textarea type="text" name="f_note" rows="16" cols="72">$t_default_body</textarea></td>
</tr>
<tr class="form-buttons">
<td colspan="2" align="center" width="80%"><input type="submit" value="Preview" /></td>
</tr>
</form>
</table>
</div>
</div>
EOT;
} ### end else
print_footer( __FILE__ );
print_bottom_page( $g_bottom_page_inc );
print_body_bottom();
print_html_bottom();
?>