From abf321f2fb25d1750c96a67807bcda84a63ba497 Mon Sep 17 00:00:00 2001 From: ben Date: Mon, 23 Feb 2009 10:29:43 +0000 Subject: Added site default access permissions. Refs #744 git-svn-id: https://code.elgg.org/elgg/trunk@2885 36083f99-b078-4883-b0ff-0f9b5a30f544 --- views/default/input/access.php | 16 ++++++++++------ views/default/settings/system.php | 29 ++++++++++++++++------------- 2 files changed, 26 insertions(+), 19 deletions(-) (limited to 'views/default') diff --git a/views/default/input/access.php b/views/default/input/access.php index db938111e..e08eca13a 100644 --- a/views/default/input/access.php +++ b/views/default/input/access.php @@ -15,15 +15,19 @@ * @uses $vars['js'] Any Javascript to enter into the input tag * @uses $vars['internalname'] The name of the input field * - */ - - if (isset($vars['class'])) $class = $vars['class']; + */ + + if (isset($vars['class'])) $class = $vars['class']; if (!$class) $class = "input-access"; - - if ((!isset($vars['options'])) || (!is_array($vars['options']))) + + if (!array_key_exists('value', $vars) || $vars['value'] == ACCESS_DEFAULT) + $vars['value'] = get_default_access(); + + + if ((!isset($vars['options'])) || (!is_array($vars['options']))) { $vars['options'] = array(); - $vars['options'] = get_write_access_array(); + $vars['options'] = get_write_access_array(); } if (is_array($vars['options']) && sizeof($vars['options']) > 0) { diff --git a/views/default/settings/system.php b/views/default/settings/system.php index f8317d95c..317a1094e 100644 --- a/views/default/settings/system.php +++ b/views/default/settings/system.php @@ -35,26 +35,29 @@ $languages = get_installed_translations(); $form_body .= "

" . elgg_echo('installation:language') . elgg_view("input/pulldown", array('internalname' => 'language', 'value' => $vars['config']->language, 'options_values' => $languages)) . "

"; - $form_body .= "

" . elgg_echo('installation:debug') . "
" .elgg_view("input/checkboxes", array('options' => array(elgg_echo('installation:debug:label')), 'internalname' => 'debug', 'value' => ($vars['config']->debug ? elgg_echo('installation:debug:label') : "") )) . "

"; - - $form_body .= "

" . elgg_echo('installation:httpslogin') . "
" .elgg_view("input/checkboxes", array('options' => array(elgg_echo('installation:httpslogin:label')), 'internalname' => 'https_login', 'value' => ($vars['config']->https_login ? elgg_echo('installation:httpslogin:label') : "") )) . "

"; + $form_body .= "

" . elgg_echo('admin:site:access:warning') . "
"; + $form_body .= elgg_echo('installation:sitepermissions') . elgg_view('input/access', array('internalname' => 'default_access','value' => $vars['config']->default_access)) . "

"; - - $form_body .= "

" . elgg_echo('installation:disableapi') . "
"; - $on = elgg_echo('installation:disableapi:label'); - if ((isset($CONFIG->disable_api)) && ($CONFIG->disable_api == true)) - $on = ($vars['config']->disable_api ? "" : elgg_echo('installation:disableapi:label')); - $form_body .= elgg_view("input/checkboxes", array('options' => array(elgg_echo('installation:disableapi:label')), 'internalname' => 'api', 'value' => $on )); - $form_body .= "

"; + $form_body .= "

" . elgg_echo('installation:debug') . "
" .elgg_view("input/checkboxes", array('options' => array(elgg_echo('installation:debug:label')), 'internalname' => 'debug', 'value' => ($vars['config']->debug ? elgg_echo('installation:debug:label') : "") )) . "

"; + + $form_body .= "

" . elgg_echo('installation:httpslogin') . "
" .elgg_view("input/checkboxes", array('options' => array(elgg_echo('installation:httpslogin:label')), 'internalname' => 'https_login', 'value' => ($vars['config']->https_login ? elgg_echo('installation:httpslogin:label') : "") )) . "

"; + + + $form_body .= "

" . elgg_echo('installation:disableapi') . "
"; + $on = elgg_echo('installation:disableapi:label'); + if ((isset($CONFIG->disable_api)) && ($CONFIG->disable_api == true)) + $on = ($vars['config']->disable_api ? "" : elgg_echo('installation:disableapi:label')); + $form_body .= elgg_view("input/checkboxes", array('options' => array(elgg_echo('installation:disableapi:label')), 'internalname' => 'api', 'value' => $on )); + $form_body .= "

"; $form_body .= "

" . elgg_echo('installation:usage') . "
"; - $on = elgg_echo('installation:usage:label'); + $on = elgg_echo('installation:usage:label'); if (isset($CONFIG->ping_home)) $on = ($vars['config']->ping_home!='disabled' ? elgg_echo('installation:usage:label') : ""); $form_body .= elgg_view("input/checkboxes", array('options' => array(elgg_echo('installation:usage:label')), 'internalname' => 'usage', 'value' => $on )); - $form_body .= "

"; - + $form_body .= "

"; + $form_body .= elgg_view('input/hidden', array('internalname' => 'settings', 'value' => 'go')); -- cgit v1.2.3