blob: e13f16f6e8885d808793056989b9abb6a9155781 (
plain)
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
|
<?php
/**
* Edit form for the custom front page
*
* @package SitePages
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
* @author Curverider Ltd
* @copyright Curverider Ltd 2008-2010
* @link http://elgg.org/
*/
$action = 'sitepages/addfront';
if ($sitepages_object = sitepages_get_sitepage_object('front')) {
$css = $sitepages_object->css;
$logged_in_content = $sitepages_object->logged_in_content;
$logged_out_content = $sitepages_object->logged_out_content;
} else {
$css = '';
$logged_in_content = '';
$logged_out_content = '';
}
// set the required form variables
$input_css = elgg_view('input/plaintext', array('internalname' => 'css', 'value' => $css));
$input_logged_in_content = elgg_view('input/plaintext', array('internalname' => 'logged_in_content', 'value' => $logged_in_content ));
$input_logged_out_content = elgg_view('input/plaintext', array('internalname' => 'logged_out_content', 'value' => $logged_out_content ));
$submit_input = elgg_view('input/submit', array('internalname' => 'submit', 'value' => elgg_echo('save')));
$logged_in_content_title = elgg_echo("sitepages:logged_in_front_content");
$logged_out_content_title = elgg_echo("sitepages:logged_out_front_content");
$css_title = elgg_echo("sitepages:css");
//preview link
// @todo this doesn't do anything.
//$preview = "<div class=\"page_preview\"><a href=\"#preview\">" . elgg_echo('sitepages:preview') . "</a></div>";
//construct the form
$form_body = <<<___EOT
<h3 class='settings'>$css_title</h3>
<p class='longtext_editarea'>$input_css</p><br />
<h3 class='settings'>$logged_in_content_title</h3>
<p class='longtext_editarea'>$input_logged_in_content</p><br />
<h3 class='settings'>$logged_out_content_title</h3>
<p class='longtext_editarea'>$input_logged_out_content</p>
$hidden_guid
<br />
$submit_input
$preview
___EOT;
echo elgg_view('input/form', array('action' => "{$vars['url']}action/$action", 'body' => $form_body));
|