-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpanel.php
146 lines (122 loc) · 4.37 KB
/
panel.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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<?php
/**
* the posting form as a browser sidebar
*
* @todo add an option to make it post bookmarks
* @link http://quikonnex.com/start/ Channel Viever and Bookmark Server
*
* This is a simple form to ease blogger work. Put text here while browsing.
* Then hit the submit button to push it at your own web site.
*
* The panel is always displayed, even to anonymous surfers, since access rules are enforced by the
* edit form in the main panel anyway.
*
* @see articles/edit.php
*
* This panel supports Gecko-based browsers, including Mozilla and Firefox, and Internet Explorer.
*
* For Mozilla and Firefox, links will target the panel '[code]_content[/code]'. This is the default.
* Else the target frame can be overriden by passing the parameter '[code]target[/code]'.
* To make Internet Explorer work correctly this parameter should have the value '[code]_main[/code]'.
*
* This panel may be installed from the Control Panel.
*
* @see control/index.php
*
* Color and style inspired by [link=Live Sidebar Note-it]http://livesidebar.com/lsbtabs/notes[/link].
*
* @link http://livesidebar.com/lsbtabs/notes Live Sidebar Note-it
*
* @author Bernard Paques
* @reference
* @license http://www.gnu.org/copyleft/lesser.txt GNU Lesser General Public License
*/
// common definitions and initial processing
include_once 'shared/global.php';
// look for the target
$target = '_content';
if(isset($_REQUEST['target']))
$target = $_REQUEST['target'];
elseif(isset($context['arguments'][0]))
$target = $context['arguments'][0];
$target = strip_tags($target);
// load localized strings
i18n::bind('root');
// load the skin
load_skin('panel');
// the title of the page
$context['page_title'] = i18n::s('New page');
// the form to edit an article
$context['text'] .= '<form method="post"'
.' action="'.$context['url_to_root'].'articles/edit.php" target="'.htmlspecialchars($target).'" id="side_form">';
// the section
// $context['text'] .= '<p>'.i18n::s('Section').BR
// .'<select name="anchor">'.Sections::get_options().'</select>'
// .'</p>'."\n";
// the title
$context['text'] .= '<p>'.i18n::s('Title').BR
.'<textarea name="title" id="title" rows="2" cols="20" accesskey="t"></textarea>'
.'</p>'."\n";
// the introduction
$context['text'] .= '<p>'.i18n::s('Introduction').BR
.'<textarea name="introduction" rows="3" cols="20" accesskey="i"></textarea>'
.'</p>'."\n";
// the description label
$context['text'] .= '<p>'.i18n::s('Page content').BR
.'<textarea name="text" rows="10" cols="20" accesskey="c"></textarea>'
.'</p>'."\n";
// the submit and reset buttons
$context['text'] .= '<p>'.Skin::build_submit_button(i18n::s('Submit'), i18n::s('Press [s] to submit data'), 's', NULL, 'no_spin_on_click').'</p>'."\n";
// end of the form
$context['text'] .= '</form>';
// handle the output correctly
render_raw();
// if it was a HEAD request, stop here
if(isset($_SERVER['REQUEST_METHOD']) && ($_SERVER['REQUEST_METHOD'] == 'HEAD'))
return;
// add language information, if known
if(isset($context['page_language']))
$language = ' xml:lang="'.$context['page_language'].'" ';
else
$language = '';
// do our own rendering
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">'."\n"
.'<html '.$language.' xmlns="http://www.w3.org/1999/xhtml">'."\n"
.'<head>'."\n";
// the title
if(isset($context['page_title']))
echo '<title>'.ucfirst(strip_tags($context['page_title'])).'</title>';
// styles
echo '<style type="text/css" media="screen">'."\n"
.'<!--'."\n"
.' body, body p {'."\n"
.' font-family: Verdana, Arial, Helvetica, sans-serif;'."\n"
.' font-size: x-small;'."\n"
.' voice-family: "\"}\"";'."\n"
.' voice-family: inherit;'."\n"
.' font-size: small;'."\n"
.' }'."\n"
."\n"
.' body {'."\n"
.' scrollbar-face-color: #FFFFAA;'."\n"
.' }'."\n"
."\n"
.' textarea {'."\n"
.' border: 0px none;'."\n"
.' width: 99%;'."\n"
.' background-color: rgb(255, 255, 170);'."\n"
.' }'."\n"
.'-->'."\n"
.'</style>'."\n";
// end of meta information
echo "</head>\n<body>\n";
// display error messages, if any
echo Skin::build_error_block();
// render and display the content
if(isset($context['text']))
echo $context['text'];
// debug output, if any
if(is_array($context['debug']) && count($context['debug']))
echo "\n".'<ul id="debug">'."\n".'<li>'.implode('</li>'."\n".'<li>', $context['debug']).'<li>'."\n".'</ul>'."\n";
echo "\n</body>\n</html>";
?>