Elgg  Version 1.9
update_advanced.php
Go to the documentation of this file.
1 <?php
5 $form_body = "";
6 
7 foreach (array('wwwroot', 'path', 'dataroot') as $field) {
8  $warning = false;
9 
10  $form_body .= "<div>";
11  $form_body .= elgg_echo('installation:' . $field) . "<br />";
12 
13  $params = array(
14  'name' => $field,
15  'value' => elgg_get_config($field)
16  );
17  if ($field == 'dataroot' && elgg_get_config('dataroot_in_settings')) {
18  $params['readonly'] = true;
19  $params['class'] = 'elgg-state-disabled';
20  $warning = elgg_echo('admin:settings:in_settings_file');
21  }
22 
23  $form_body .= elgg_view("input/text", $params);
24  if ($warning) {
25  $form_body .= "<span class=\"elgg-text-help\">$warning</span>";
26  }
27  $form_body .= "</div>";
28 }
29 
30 $is_simple_cache_on = (bool)elgg_get_config('simplecache_enabled');
31 $simple_cache_disabled_class = $is_simple_cache_on ? '' : 'elgg-state-disabled';
32 $form_body .= '<fieldset class="elgg-fieldset">';
33 $form_body .= '<legend>' . elgg_echo('admin:legend:caching') . '</legend>';
34 $form_body .= "<div>" . elgg_echo('installation:simplecache:description') . "<br />";
35 $params = array(
36  'label' => elgg_echo('installation:simplecache:label'),
37  'name' => 'simplecache_enabled',
38  'checked' => $is_simple_cache_on,
39 );
40 if (elgg_get_config('simplecache_enabled_in_settings')) {
41  $params['class'] = 'elgg-state-disabled';
42  $params['label_class'] = 'elgg-state-disabled';
43 }
44 $form_body .= elgg_view("input/checkbox", $params);
45 if (elgg_get_config('simplecache_enabled_in_settings')) {
46  $warning = elgg_echo('admin:settings:in_settings_file');
47  $form_body .= "<span class=\"elgg-text-help\">$warning</span>";
48 }
49 $form_body .= "</div>";
50 
51 $form_body .= "<div>" . elgg_echo('installation:minify:description') . "<br />";
52 $form_body .= elgg_view("input/checkbox", array(
53  'label' => elgg_echo('installation:minify_js:label'),
54  'name' => 'simplecache_minify_js',
55  'checked' => (bool)elgg_get_config('simplecache_minify_js'),
56  'label_class' => $simple_cache_disabled_class,
57 )) . '<br />';
58 $form_body .= elgg_view("input/checkbox", array(
59  'label' => elgg_echo('installation:minify_css:label'),
60  'name' => 'simplecache_minify_css',
61  'checked' => (bool)elgg_get_config('simplecache_minify_css'),
62  'label_class' => $simple_cache_disabled_class,
63 )) . "</div>";
64 
65 $form_body .= "<div>" . elgg_echo('installation:systemcache:description') . "<br />";
66 $form_body .= elgg_view("input/checkbox", array(
67  'label' => elgg_echo('installation:systemcache:label'),
68  'name' => 'system_cache_enabled',
69  'checked' => (bool)elgg_get_config('system_cache_enabled'),
70 )) . "</div>";
71 $form_body .= "</fieldset>";
72 
73 $form_body .= '<fieldset class="elgg-fieldset">';
74 $form_body .= '<legend>' . elgg_echo('admin:legend:content_access') . '</legend>';
75 $form_body .= "<div>" . elgg_echo('admin:site:access:warning') . "<br />";
76 $form_body .= "<label>" . elgg_echo('installation:sitepermissions') . " </label>";
77 $form_body .= elgg_view('input/access', array(
78  'options_values' => array(
79  ACCESS_PRIVATE => elgg_echo("PRIVATE"),
80  ACCESS_FRIENDS => elgg_echo("access:friends:label"),
81  ACCESS_LOGGED_IN => elgg_echo("LOGGED_IN"),
82  ACCESS_PUBLIC => elgg_echo("PUBLIC"),
83  ),
84  'name' => 'default_access',
85  'value' => elgg_get_config('default_access'),
86 )) . "</div>";
87 
88 $form_body .= "<div>" . elgg_echo('installation:allow_user_default_access:description') . "<br />";
89 
90 $form_body .= elgg_view('input/checkbox', array(
91  'label' => elgg_echo('installation:allow_user_default_access:label'),
92  'name' => 'allow_user_default_access',
93  'checked' => (bool)elgg_get_config('allow_user_default_access'),
94 )) . "</div>";
95 $form_body .= "</fieldset>";
96 
97 $form_body .= '<fieldset class="elgg-fieldset">';
98 $form_body .= '<legend>' . elgg_echo('admin:legend:site_access') . '</legend>';
99 // control new user registration
100 $form_body .= '<div>' . elgg_echo('installation:registration:description') . '<br />';
101 $form_body .= elgg_view('input/checkbox', array(
102  'label' => elgg_echo('installation:registration:label'),
103  'name' => 'allow_registration',
104  'checked' => (bool)elgg_get_config('allow_registration'),
105 )) . '</div>';
106 
107 // control walled garden
108 $form_body .= '<div>' . elgg_echo('installation:walled_garden:description') . '<br />';
109 $form_body .= elgg_view('input/checkbox', array(
110  'label' => elgg_echo('installation:walled_garden:label'),
111  'name' => 'walled_garden',
112  'checked' => (bool)elgg_get_config('walled_garden'),
113 )) . '</div>';
114 
115 $form_body .= "<div>" . elgg_echo('installation:httpslogin') . "<br />";
116 $form_body .= elgg_view("input/checkbox", array(
117  'label' => elgg_echo('installation:httpslogin:label'),
118  'name' => 'https_login',
119  'checked' => (bool)elgg_get_config('https_login'),
120 )) . "</div>";
121 $form_body .= "</fieldset>";
122 
123 
124 $form_body .= '<fieldset class="elgg-fieldset">';
125 $form_body .= '<legend>' . elgg_echo("admin:legend:security") . '</legend>';
126 
128 $current_strength = elgg_echo('site_secret:current_strength');
129 $strength_text = elgg_echo("site_secret:strength:$strength");
130 $strength_msg = elgg_echo("site_secret:strength_msg:$strength");
131 
132 $form_body .= "<div>" . elgg_echo('admin:site:secret:intro') . "<br /><br />";;
133 
134 if ($strength != 'strong') {
135  $title = "$current_strength: $strength_text";
136 
137  $form_body .= elgg_view_module('main', $title, $strength_msg, array(
138  'class' => 'elgg-message elgg-state-error'
139  ));
140 } else {
142 }
143 
144 $form_body .= '<p class="elgg-text-help">' . elgg_echo('admin:site:secret:regenerate:help') . '</p>';
145 
146 $form_body .= elgg_view("input/checkboxes", array(
147  'options' => array(elgg_echo('admin:site:secret:regenerate') => 1),
148  'name' => 'regenerate_site_secret'
149 )) . "</div>";
150 
151 $form_body .= '</fieldset>';
152 
154  '0' => elgg_echo('installation:debug:none'),
155  'ERROR' => elgg_echo('installation:debug:error'),
156  'WARNING' => elgg_echo('installation:debug:warning'),
157  'NOTICE' => elgg_echo('installation:debug:notice'),
158  'INFO' => elgg_echo('installation:debug:info'),
159 );
160 $form_body .= '<fieldset class="elgg-fieldset">';
161 $form_body .= '<legend>' . elgg_echo('admin:legend:debug') . '</legend>';
162 $form_body .= "<div>" . elgg_echo('installation:debug') . "<br />";
163 $form_body .= "<label>" . elgg_echo('installation:debug:label') . " </label>";
164 $form_body .= elgg_view('input/select', array(
165  'options_values' => $debug_options,
166  'name' => 'debug',
167  'value' => elgg_get_config('debug'),
168 ));
169 $form_body .= '</div>';
170 $form_body .= "</fieldset>";
171 
172 $form_body .= elgg_view('input/hidden', array('name' => 'settings', 'value' => 'go'));
173 
174 $form_body .= '<div class="elgg-foot">';
175 $form_body .= elgg_view('input/submit', array('value' => elgg_echo("save")));
176 $form_body .= '</div>';
177 
elgg_get_config($name, $site_guid=0)
Get an Elgg configuration value.
elgg_view_module($type, $title, $body, array $vars=array())
Wrapper function for the module display pattern.
Definition: views.php:1197
$form_body
const ACCESS_FRIENDS
Definition: elgglib.php:2124
$title
Definition: save.php:24
foreach(array('wwwroot', 'path', 'dataroot') as $field) $is_simple_cache_on
elgg_echo($message_key, $args=array(), $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
$current_strength
$strength_msg
const ACCESS_PRIVATE
Definition: elgglib.php:2121
elgg echo
Translates a string.
Definition: languages.js:43
$simple_cache_disabled_class
elgg_view($view, $vars=array(), $bypass=false, $ignored=false, $viewtype= '')
Return a parsed view.
Definition: views.php:354
const ACCESS_PUBLIC
Definition: elgglib.php:2123
_elgg_get_site_secret_strength()
Get the strength of the site secret.
Definition: actions.php:205
$strength_text
const ACCESS_LOGGED_IN
Definition: elgglib.php:2122
$debug_options