diff options
Diffstat (limited to 'views/installation')
38 files changed, 210 insertions, 454 deletions
diff --git a/views/installation/canvas/default.php b/views/installation/canvas/default.php deleted file mode 100644 index 4b8d12e6d..000000000 --- a/views/installation/canvas/default.php +++ /dev/null @@ -1,13 +0,0 @@ -<?php -/** - * Elgg default layout - * - * @package Elgg - * @subpackage Core - */ - -for ($i = 1; $i < 8; $i++) { - if (isset($vars["area{$i}"])) { - echo $vars["area{$i}"]; - } -}
\ No newline at end of file diff --git a/views/installation/install/forms/template.php b/views/installation/forms/install/template.php index 626bfc6c8..a01914f12 100644 --- a/views/installation/install/forms/template.php +++ b/views/installation/forms/install/template.php @@ -13,30 +13,18 @@ $form_body = ''; foreach ($variables as $field => $params) { $label = elgg_echo("install:$type:label:$field"); $help = elgg_echo("install:$type:help:$field"); - $params['internalname'] = $field; + $params['name'] = $field; - $form_body .= '<p>'; + $form_body .= '<div>'; $form_body .= "<label>$label</label>"; $form_body .= elgg_view("input/{$params['type']}", $params); $form_body .= "<span class=\"install-help\">$help</span>"; - $form_body .= '</p>'; + $form_body .= '</div>'; } $submit_params = array( - 'value' => elgg_echo('next'), + 'value' => elgg_echo('install:next'), ); $form_body .= elgg_view('input/submit', $submit_params); echo $form_body; - -?> -<script type="text/javascript"> - var was_submitted = false; - function elggCheckFormSubmission() { - if (was_submitted == false) { - was_submitted = true; - return true; - } - return false; - } -</script> diff --git a/views/installation/input/access.php b/views/installation/input/access.php index 51b8dfa00..c3d4713bc 100644 --- a/views/installation/input/access.php +++ b/views/installation/input/access.php @@ -1,23 +1,14 @@ <?php /** * Elgg access level input - * Displays a pulldown input field - * - * @package Elgg - * @subpackage Core + * Displays a dropdown input field * * @uses $vars['value'] The current value, if any - * @uses $vars['js'] Any Javascript to enter into the input tag - * @uses $vars['internalname'] The name of the input field + * @uses $vars['name'] The name of the input field * */ -if (isset($vars['class'])) { - $class = $vars['class']; -} -if (!$class) { - $class = "input-access"; -} +$class = "elgg-input-access"; if ((!isset($vars['options'])) || (!is_array($vars['options']))) { $vars['options'] = array(); @@ -28,7 +19,7 @@ if (is_array($vars['options']) && sizeof($vars['options']) > 0) { ?> - <select name="<?php echo $vars['internalname']; ?>" <?php if (isset($vars['js'])) echo $vars['js']; ?> <?php if ((isset($vars['disabled'])) && ($vars['disabled'])) echo ' disabled="yes" '; ?> class="<?php echo $class; ?>"> + <select name="<?php echo $vars['name']; ?>" class="<?php echo $class; ?>"> <?php foreach($vars['options'] as $key => $option) { @@ -44,4 +35,4 @@ if (is_array($vars['options']) && sizeof($vars['options']) > 0) { <?php -}
\ No newline at end of file +} diff --git a/views/installation/input/button.php b/views/installation/input/button.php index 759752c8c..ec90fed9d 100644 --- a/views/installation/input/button.php +++ b/views/installation/input/button.php @@ -1,25 +1,22 @@ <?php /** * Create a input button - * Use this view for forms rather than creating a submit/reset button tag in the wild as it provides - * extra security which help prevent CSRF attacks. - * - * @package Elgg - * @subpackage Core * * @uses $vars['value'] The current value, if any - * @uses $vars['js'] Any Javascript to enter into the input tag - * @uses $vars['internalname'] The name of the input field - * @uses $vars['type'] Submit or reset, defaults to submit. - * @uses $vars['src'] Src of an image - * + * @uses $vars['name'] The name of the input field + * @uses $vars['type'] submit or button. */ -global $CONFIG; +if (isset($vars['class'])) { + $class = $vars['class']; +} else { + $class = "elgg-button-submit"; +} -$class = $vars['class']; -if (!$class) { - $class = "submit-button"; +if (isset($vars['name'])) { + $name = $vars['name']; +} else { + $name = ''; } if (isset($vars['type'])) { @@ -32,20 +29,12 @@ switch ($type) { case 'button' : $type='button'; break; - case 'reset' : - $type='reset'; - break; case 'submit': default: $type = 'submit'; } $value = htmlentities($vars['value'], ENT_QUOTES, 'UTF-8'); -$name = $vars['internalname']; -$src = $vars['src']; -// blank src if trying to access an offsite image. -if (strpos($src,elgg_get_site_url())===false) { - $src = ""; -} + ?> -<input type="<?php echo $type; ?>" <?php if (isset($vars['internalid'])) echo "id=\"{$vars['internalid']}\"";?> <?php echo $vars['js']; ?> value="<?php echo $value; ?>" src="<?php echo $src; ?>" class="<?php echo $class; ?>" />
\ No newline at end of file +<input type="<?php echo $type; ?>" value="<?php echo $value; ?>" class="<?php echo $class; ?>" />
\ No newline at end of file diff --git a/views/installation/input/checkbox.php b/views/installation/input/checkbox.php new file mode 100644 index 000000000..6fbe25169 --- /dev/null +++ b/views/installation/input/checkbox.php @@ -0,0 +1,24 @@ +<?php +/** + * Elgg checkbox input + * Displays a checkbox input tag + * + * @uses $var['name'] + * @uses $vars['value'] + * @uses $vars['class'] + */ + + +if (isset($vars['class'])) { + $id = "class=\"{$vars['class']}\""; +} else { + $id = ''; +} + +if (!isset($vars['value'])) { + $vars['value'] = $vars['name']; +} + +?> + +<input type="checkbox" <?php echo $class; ?> name="<?php echo $vars['name']; ?>" value="<?php echo $vars['value']; ?>" />
\ No newline at end of file diff --git a/views/installation/input/checkboxes.php b/views/installation/input/checkboxes.php deleted file mode 100644 index d4e1b494d..000000000 --- a/views/installation/input/checkboxes.php +++ /dev/null @@ -1,48 +0,0 @@ -<?php -/** - * Elgg checkbox input - * Displays a checkbox input field - * - * @package Elgg - * @subpackage Core - * - * @uses $vars['value'] The current value, if any - * @uses $vars['js'] Any Javascript to enter into the input tag - * @uses $vars['internalname'] The name of the input field - * @uses $vars['options'] An array of strings representing the options for the checkbox field - * - */ - -$class = $vars['class']; -if (!$class) { - $class = "input-checkboxes"; -} - -foreach($vars['options'] as $label => $option) { - //if (!in_array($option,$vars['value'])) { - if (is_array($vars['value'])) { - if (!in_array($option,$vars['value'])) { - $selected = ""; - } else { - $selected = "checked = \"checked\""; - } - } else { - if ($option != $vars['value']) { - $selected = ""; - } else { - $selected = "checked = \"checked\""; - } - } - - // handle indexed array where label is not specified - // @todo deprecate in Elgg 1.8 - if (is_integer($label)) { - $label = $option; - } - - $disabled = ""; - if ($vars['disabled']) { - $disabled = ' disabled="yes" '; - } - echo "<label><input type=\"checkbox\" $disabled {$vars['js']} name=\"{$vars['internalname']}[]\" {$selected} value=\"".htmlentities($option, ENT_QUOTES, 'UTF-8')."\" {$selected} class=\"$class\" />{$label}</label><br />"; -}
\ No newline at end of file diff --git a/views/installation/input/combo.php b/views/installation/input/combo.php new file mode 100644 index 000000000..508dbcd01 --- /dev/null +++ b/views/installation/input/combo.php @@ -0,0 +1,19 @@ +<?php +/** + * Combination of text box and check box. When the checkbox is checked, the + * text field is cleared and disabled. + * + */ + +$label = elgg_echo('install:label:combo:' . $vars['name']); + +$vars['class'] = "elgg-combo-text"; +echo elgg_view('input/text', $vars); + +$vars['class'] = "elgg-combo-checkbox"; +$vars['value'] = "{$vars['name']}-checkbox"; +echo elgg_view('input/checkbox', $vars); + +echo "<label class=\"elgg-combo-label\">$label</label>"; + +echo '<div class="clearfloat"></div>';
\ No newline at end of file diff --git a/views/installation/input/pulldown.php b/views/installation/input/dropdown.php index 70e961c4d..cf875492e 100644 --- a/views/installation/input/pulldown.php +++ b/views/installation/input/dropdown.php @@ -1,29 +1,22 @@ <?php /** - * Elgg pulldown input - * Displays a pulldown input field - * - * @package Elgg - * @subpackage Core + * Elgg dropdown input + * Displays a dropdown input field * * @uses $vars['value'] The current value, if any - * @uses $vars['js'] Any Javascript to enter into the input tag - * @uses $vars['internalname'] The name of the input field - * @uses $vars['options'] An array of strings representing the options for the pulldown field + * @uses $vars['name'] The name of the input field + * @uses $vars['options'] An array of strings representing the options for the dropdown field * @uses $vars['options_values'] An associative array of "value" => "option" where "value" is an internal name and "option" is * the value displayed on the button. Replaces $vars['options'] when defined. */ +$class = "elgg-input-dropdown"; -$class = $vars['class']; -if (!$class) { - $class = "input-pulldown"; -} ?> -<select name="<?php echo $vars['internalname']; ?>" <?php echo $vars['js']; ?> <?php if ($vars['disabled']) echo ' disabled="yes" '; ?> class="<?php echo $class; ?>"> +<select name="<?php echo $vars['name']; ?>" class="<?php echo $class; ?>"> <?php -if ($vars['options_values']) { - foreach($vars['options_values'] as $value => $option) { +if (isset($vars['options_values'])) { + foreach ($vars['options_values'] as $value => $option) { if ($value != $vars['value']) { echo "<option value=\"$value\">{$option}</option>"; } else { @@ -31,7 +24,7 @@ if ($vars['options_values']) { } } } else { - foreach($vars['options'] as $option) { + foreach ($vars['options'] as $option) { if ($option != $vars['value']) { echo "<option>{$option}</option>"; } else { @@ -40,4 +33,4 @@ if ($vars['options_values']) { } } ?> -</select>
\ No newline at end of file +</select> diff --git a/views/installation/input/form.php b/views/installation/input/form.php index a4707f257..3556413a8 100644 --- a/views/installation/input/form.php +++ b/views/installation/input/form.php @@ -1,36 +1,21 @@ <?php /** * Create a form for data submission. - * Use this view for forms rather than creating a form tag in the wild as it provides - * extra security which help prevent CSRF attacks. * - * @package Elgg - * @subpackage Core - * - * @uses $vars['body'] The body of the form (made up of other input/xxx views and html - * @uses $vars['method'] Method (default POST) - * @uses $vars['enctype'] How the form is encoded, default blank + * @uses $vars['body'] The body of the form (made up of other input/xxx views and html * @uses $vars['action'] URL of the action being called - * + * @uses $vars['method'] Method (default POST) + * @uses $vars['name'] Form name */ -if (isset($vars['internalid'])) { - $id = $vars['internalid']; -} else { - $id = ''; -} -if (isset($vars['internalname'])) { - $name = $vars['internalname']; +if (isset($vars['name'])) { + $name = "name=\"{$vars['name']}\""; } else { $name = ''; } + $body = $vars['body']; $action = $vars['action']; -if (isset($vars['enctype'])) { - $enctype = $vars['enctype']; -} else { - $enctype = ''; -} if (isset($vars['method'])) { $method = $vars['method']; } else { @@ -39,13 +24,7 @@ if (isset($vars['method'])) { $method = strtolower($method); -// Generate a security header -$security_header = ""; -if (!isset($vars['disable_security']) || $vars['disable_security'] != true) { - $security_header = elgg_view('input/securitytoken'); -} ?> -<form <?php if ($id) { ?>id="<?php echo $id; ?>" <?php } ?> <?php if ($name) { ?>name="<?php echo $name; ?>" <?php } ?> action="<?php echo $action; ?>" method="<?php echo $method; ?>" <?php if ($enctype!="") echo "enctype=\"$enctype\""; ?> <?php echo $vars['js']; ?>> -<?php echo $security_header; ?> +<form <?php echo $name; ?> action="<?php echo $action; ?>" method="<?php echo $method; ?>"> <?php echo $body; ?> </form>
\ No newline at end of file diff --git a/views/installation/input/hidden.php b/views/installation/input/hidden.php deleted file mode 100644 index 7a0798e48..000000000 --- a/views/installation/input/hidden.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php -/** - * Create a hidden data field - * Use this view for forms rather than creating a hidden tag in the wild as it provides - * extra security which help prevent CSRF attacks. - * - * @package Elgg - * @subpackage Core - * - * @uses $vars['value'] The current value, if any - * @uses $vars['js'] Any Javascript to enter into the input tag - * @uses $vars['internalname'] The name of the input field - * - */ -?> -<input type="hidden" <?php echo $vars['js']; ?> name="<?php echo $vars['internalname']; ?>" value="<?php echo htmlentities($vars['value'], ENT_QUOTES, 'UTF-8'); ?>" />
\ No newline at end of file diff --git a/views/installation/input/longtext.php b/views/installation/input/longtext.php deleted file mode 100644 index c7e465e9f..000000000 --- a/views/installation/input/longtext.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php -/** - * Elgg long text input - * Displays a long text input field - * - * @package Elgg - * @subpackage Core - * - * @uses $vars['value'] The current value, if any - * @uses $vars['js'] Any Javascript to enter into the input tag - * @uses $vars['internalname'] The name of the input field - * - */ - -$class = $vars['class']; -if (!$class) { - $class = "input-textarea"; -} - -?> - -<textarea class="<?php echo $class; ?>" name="<?php echo $vars['internalname']; ?>" <?php if ($vars['disabled']) echo ' disabled="yes" '; ?> <?php echo $vars['js']; ?>><?php echo $vars['value']; ?></textarea>
\ No newline at end of file diff --git a/views/installation/input/password.php b/views/installation/input/password.php index 541728ee3..2265ab117 100644 --- a/views/installation/input/password.php +++ b/views/installation/input/password.php @@ -3,19 +3,15 @@ * Elgg password input * Displays a password input field * - * @package Elgg - * @subpackage Core - * * @uses $vars['value'] The current value, if any - * @uses $vars['js'] Any Javascript to enter into the input tag - * @uses $vars['internalname'] The name of the input field + * @uses $vars['name'] The name of the input field * */ -$class = $vars['class']; -if (!$class) { - $class = "input-password"; -} +$class = "input-password"; + +$value = htmlentities($vars['value'], ENT_QUOTES, 'UTF-8'); + ?> -<input type="password" <?php if ($vars['disabled']) echo ' disabled="yes" '; ?> <?php echo $vars['js']; ?> name="<?php echo $vars['internalname']; ?>" <?php if (isset($vars['internalid'])) echo "id=\"{$vars['internalid']}\""; ?> value="<?php echo htmlentities($vars['value'], ENT_QUOTES, 'UTF-8'); ?>" class="<?php echo $class; ?>" /> +<input type="password" name="<?php echo $vars['name']; ?>" value="<?php echo $value; ?>" class="<?php echo $class; ?>" /> diff --git a/views/installation/input/reset.php b/views/installation/input/reset.php deleted file mode 100644 index 0c83a92ca..000000000 --- a/views/installation/input/reset.php +++ /dev/null @@ -1,13 +0,0 @@ -<?php -/** - * Create a reset input button - * Use this view for forms rather than creating a submit/reset button tag in the wild as it provides - * extra security which help prevent CSRF attacks. - * - * @package Elgg - * @subpackage Core - */ - -$vars['type'] = 'reset'; - -echo elgg_view('input/button', $vars);
\ No newline at end of file diff --git a/views/installation/input/securitytoken.php b/views/installation/input/securitytoken.php deleted file mode 100644 index 9a8cb1ebe..000000000 --- a/views/installation/input/securitytoken.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php -/** - * CSRF security token view for use with secure forms. - * - * It is still recommended that you use input/form. - * - * @package Elgg - * @subpackage Core - */ - -$ts = time(); -$token = generate_action_token($ts); - -echo elgg_view('input/hidden', array('internalname' => '__elgg_token', 'value' => $token)); -echo elgg_view('input/hidden', array('internalname' => '__elgg_ts', 'value' => $ts)); diff --git a/views/installation/input/submit.php b/views/installation/input/submit.php index aefb2ada6..5d891c380 100644 --- a/views/installation/input/submit.php +++ b/views/installation/input/submit.php @@ -1,11 +1,9 @@ <?php /** * Create a submit input button - * Use this view for forms rather than creating a submit/reset button tag in the wild as it provides - * extra security which help prevent CSRF attacks. * - * @package Elgg - * @subpackage Core + * @uses $vars['value'] The current value, if any + * @uses $vars['name'] The name of the input field */ $vars['type'] = 'submit'; diff --git a/views/installation/input/text.php b/views/installation/input/text.php index 73801dcf7..375b91c44 100644 --- a/views/installation/input/text.php +++ b/views/installation/input/text.php @@ -3,22 +3,18 @@ * Elgg text input * Displays a text input field * - * @package Elgg - * @subpackage Core - - - * * @uses $vars['value'] The current value, if any - * @uses $vars['js'] Any Javascript to enter into the input tag - * @uses $vars['internalname'] The name of the input field - * @uses $vars['disabled'] If true then control is read-only - * @uses $vars['class'] Class override + * @uses $vars['name'] The name of the input field + * @uses $vars['class'] CSS class */ -$class = $vars['class']; -if (!$class) { - $class = "input-text"; +if (isset($vars['class'])) { + $class = "class=\"{$vars['class']}\""; +} else { + $class = "elgg-input-text"; } +$value = htmlentities($vars['value'], ENT_QUOTES, 'UTF-8'); + ?> -<input type="text" <?php if ($vars['disabled']) echo ' disabled="yes" '; ?> <?php echo $vars['js']; ?> name="<?php echo $vars['internalname']; ?>" value="<?php echo htmlentities($vars['value'], ENT_QUOTES, 'UTF-8'); ?>" class="<?php echo $class ?>"/>
\ No newline at end of file +<input type="text" name="<?php echo $vars['name']; ?>" value="<?php echo $value; ?>" <?php echo $class; ?> />
\ No newline at end of file diff --git a/views/installation/install/footer.php b/views/installation/install/footer.php deleted file mode 100644 index 69cd27f66..000000000 --- a/views/installation/install/footer.php +++ /dev/null @@ -1,10 +0,0 @@ -<?php -/** - * Install footer - offers help links - */ -?> -<ul> - <li><a href="http://docs.elgg.org/wiki/Installation">Install instructions</a></li> - <li><a href="http://docs.elgg.org/wiki/Install_Troubleshooting">Install troubleshooting</a></li> - <li><a href="http://community.elgg.org/pg/groups/world/">Elgg community forums</a></li> -</ul>
\ No newline at end of file diff --git a/views/installation/install/forms/admin.php b/views/installation/install/forms/admin.php deleted file mode 100644 index 1ecb389a3..000000000 --- a/views/installation/install/forms/admin.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php -/** - * Admin account form - * - * @uses $vars['variables'] Array of form variables. See ElggInstaller. - */ - -$vars['type'] = 'admin'; -$form_body = elgg_view('install/forms/template', $vars); - -$url = current_page_url(); - -$params = array( - 'body' => $form_body, - 'action' => $url, - 'disable_security' => TRUE, - 'js' => 'onsubmit="return elggCheckFormSubmission()"', -); -echo elgg_view('input/form', $params); diff --git a/views/installation/install/forms/database.php b/views/installation/install/forms/database.php deleted file mode 100644 index 0e798db09..000000000 --- a/views/installation/install/forms/database.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php -/** - * Database form - * - * @uses $vars['variables'] Array of form variables. See ElggInstaller. - */ - -$vars['type'] = 'database'; -$form_body = elgg_view('install/forms/template', $vars); - -$url = current_page_url(); - -$params = array( - 'body' => $form_body, - 'action' => $url, - 'disable_security' => TRUE, - 'js' => 'onsubmit="return elggCheckFormSubmission()"', -); -echo elgg_view('input/form', $params); diff --git a/views/installation/install/forms/settings.php b/views/installation/install/forms/settings.php deleted file mode 100644 index e9a818b92..000000000 --- a/views/installation/install/forms/settings.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php -/** - * Site settings form - * - * @uses $vars['variables'] Array of form variables. See ElggInstaller. - */ - -$vars['type'] = 'settings'; -$form_body = elgg_view('install/forms/template', $vars); - -$url = current_page_url(); - -$params = array( - 'body' => $form_body, - 'action' => $url, - 'disable_security' => TRUE, - 'js' => 'onsubmit="return elggCheckFormSubmission()"', -); -echo elgg_view('input/form', $params); diff --git a/views/installation/install/js_rewrite_check.php b/views/installation/install/js_rewrite_check.php new file mode 100644 index 000000000..04d81171d --- /dev/null +++ b/views/installation/install/js_rewrite_check.php @@ -0,0 +1,12 @@ +<?php +/** + * Some servers don't allow PHP to check the rewrite, so try via AJAX + */ +?> +<script type="text/javascript"> + elgg.installer.rewriteTest( + '<?php echo $vars['url'];?>', + '<?php echo elgg_echo('install:check:rewrite:success'); ?>', + '<?php echo $vars['config']->wwwroot; ?>install.php?step=database' + ); +</script>
\ No newline at end of file diff --git a/views/installation/install/nav.php b/views/installation/install/nav.php index 1ecc07d1c..c150cb2cb 100644 --- a/views/installation/install/nav.php +++ b/views/installation/install/nav.php @@ -12,22 +12,22 @@ // has a refresh button been requested $refresh = ''; if (isset($vars['refresh']) && $vars['refresh']) { - $refresh_text = elgg_echo('Refresh'); + $refresh_text = elgg_echo('install:refresh'); $refresh = "<a href=\"\">$refresh_text</a>"; } // create next button and selectively disable -$next_text = elgg_echo('next'); +$next_text = elgg_echo('install:next'); $next_link = elgg_get_site_url()."install.php?step={$vars['next_step']}"; $next = "<a href=\"$next_link\">$next_text</a>"; if (isset($vars['advance']) && !$vars['advance']) { // disable the next button - $next = "<a class=\"disabled\">$next_text</a>"; + $next = "<a class=\"elgg-state-disabled\">$next_text</a>"; } echo <<<___END -<div class="install-nav"> +<div class="elgg-install-nav"> $next $refresh </div> diff --git a/views/installation/install/pages/admin.php b/views/installation/install/pages/admin.php index 1fdd5dced..e810aa701 100644 --- a/views/installation/install/pages/admin.php +++ b/views/installation/install/pages/admin.php @@ -3,6 +3,15 @@ * Install create admin account page */ -echo autop(elgg_echo('install:admin:instructions')); +echo elgg_autop(elgg_echo('install:admin:instructions')); -echo elgg_view('install/forms/admin', $vars); +$vars['type'] = 'admin'; + +$url = current_page_url(); + +$form_vars = array( + 'action' => $url, + 'disable_security' => TRUE, +); + +echo elgg_view_form('install/template', $form_vars, $vars); diff --git a/views/installation/install/pages/complete.php b/views/installation/install/pages/complete.php index 0c9821fc2..80f8e7434 100644 --- a/views/installation/install/pages/complete.php +++ b/views/installation/install/pages/complete.php @@ -3,11 +3,11 @@ * Install completion page */ -echo autop(elgg_echo('install:complete:instructions')); +echo elgg_autop(elgg_echo('install:complete:instructions')); ?> -<div class="install-nav"> +<div class="elgg-install-nav"> <?php $url = elgg_get_site_url() . $vars['destination']; $text = elgg_echo('install:complete:gotosite'); diff --git a/views/installation/install/pages/database.php b/views/installation/install/pages/database.php index 7765c6e48..d24b4f57b 100644 --- a/views/installation/install/pages/database.php +++ b/views/installation/install/pages/database.php @@ -6,11 +6,21 @@ */ if (isset($vars['failure']) && $vars['failure']) { - echo autop(elgg_echo('install:database:error')); + echo elgg_autop(elgg_echo('install:database:error')); $vars['refresh'] = TRUE; $vars['advance'] = FALSE; echo elgg_view('install/nav', $vars); } else { - echo autop(elgg_echo('install:database:instructions')); - echo elgg_view('install/forms/database', $vars); + echo elgg_autop(elgg_echo('install:database:instructions')); + + $vars['type'] = 'database'; + + $url = current_page_url(); + + $form_vars = array( + 'action' => $url, + 'disable_security' => TRUE, + ); + + echo elgg_view_form('install/template', $form_vars, $vars); }
\ No newline at end of file diff --git a/views/installation/install/pages/requirements.php b/views/installation/install/pages/requirements.php index b6516840f..3f0941c95 100644 --- a/views/installation/install/pages/requirements.php +++ b/views/installation/install/pages/requirements.php @@ -14,26 +14,26 @@ if ($vars['num_failures'] != 0) { $instruct_text = elgg_echo('install:requirements:instructions:success'); } -echo autop($instruct_text); +echo elgg_autop($instruct_text); $report = $vars['report']; foreach ($report as $category => $checks) { $title = elgg_echo("install:require:$category"); echo "<h3>$title</h3>"; - echo "<ul>"; + echo "<ul class=\"elgg-require-$category\">"; foreach ($checks as $check) { echo "<li class=\"{$check['severity']}\">"; - echo autop($check['message']); + echo elgg_autop($check['message']); echo "</li>"; } echo "</ul>"; } -$vars['refresh'] = TRUE; +$vars['refresh'] = true; // cannot advance to next step with a failure if ($vars['num_failures'] != 0) { - $vars['advance'] = FALSE; + $vars['advance'] = false; } echo elgg_view('install/nav', $vars); diff --git a/views/installation/install/pages/settings.php b/views/installation/install/pages/settings.php index 6f20573ef..04f23c0ea 100644 --- a/views/installation/install/pages/settings.php +++ b/views/installation/install/pages/settings.php @@ -1,5 +1,14 @@ <?php -echo autop(elgg_echo('install:settings:instructions')); +echo elgg_autop(elgg_echo('install:settings:instructions')); -echo elgg_view('install/forms/settings', $vars); +$vars['type'] = 'settings'; + +$url = current_page_url(); + +$form_vars = array( + 'action' => $url, + 'disable_security' => TRUE, +); + +echo elgg_view_form('install/template', $form_vars, $vars); diff --git a/views/installation/install/pages/welcome.php b/views/installation/install/pages/welcome.php index f069e4ba7..f370c15f3 100644 --- a/views/installation/install/pages/welcome.php +++ b/views/installation/install/pages/welcome.php @@ -3,6 +3,6 @@ * Install welcome page */ -echo autop(elgg_echo('install:welcome:instructions')); +echo elgg_autop(elgg_echo('install:welcome:instructions')); echo elgg_view('install/nav', $vars); diff --git a/views/installation/messages/errors/error.php b/views/installation/messages/errors/error.php deleted file mode 100644 index 296fb1a6e..000000000 --- a/views/installation/messages/errors/error.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php -/** - * Elgg error message - * Displays a single error message - * - * @package Elgg - * @subpackage Core - * - * @uses $vars['object'] An error message (string) - */ -?> - -<p> - <?php echo $vars['object']; ?> -</p>
\ No newline at end of file diff --git a/views/installation/messages/errors/list.php b/views/installation/messages/errors/list.php deleted file mode 100644 index 2f69213e9..000000000 --- a/views/installation/messages/errors/list.php +++ /dev/null @@ -1,25 +0,0 @@ -<?php -/** - * Elgg list errors - * Lists error messages - * - * @package Elgg - * @subpackage Core - * - * @uses $vars['object'] An array of error messages - */ - -if (!empty($vars['object']) && is_array($vars['object'])) { - -?> - - <div class="messages error"> - -<?php - foreach ($vars['object'] as $error) { - echo elgg_view('messages/errors/error', array('object' => $error)); - } -?> - </div> -<?php -}
\ No newline at end of file diff --git a/views/installation/messages/list.php b/views/installation/messages/list.php deleted file mode 100644 index 2944ce5a6..000000000 --- a/views/installation/messages/list.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php -/** - * Elgg global system message list - * Lists all system messages - * - * @package Elgg - * @subpackage Core - * - * @uses $vars['object'] The array of message registers - */ - -if (!empty($vars['object']) && is_array($vars['object']) && sizeof($vars['object']) > 0) { - foreach($vars['object'] as $register => $list ) { - echo elgg_view("messages/{$register}/list", array('object' => $list)); - } -}
\ No newline at end of file diff --git a/views/installation/messages/messages/list.php b/views/installation/messages/messages/list.php deleted file mode 100644 index bd996bef7..000000000 --- a/views/installation/messages/messages/list.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php -/** - * Elgg list system messages - * Lists system messages - * - * @package Elgg - * @subpackage Core - * - * @uses $vars['object'] An array of system messages - */ - -if (!empty($vars['object']) && is_array($vars['object'])) { - -?> - - <div class="messages success"> - -<?php - foreach($vars['object'] as $message) { - echo elgg_view('messages/messages/message',array('object' => $message)); - } -?> - - </div> - -<?php - -}
\ No newline at end of file diff --git a/views/installation/messages/messages/message.php b/views/installation/messages/messages/message.php deleted file mode 100644 index 94c9303cd..000000000 --- a/views/installation/messages/messages/message.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php -/** - * Elgg standard message - * Displays a single Elgg system message - * - * @package Elgg - * @subpackage Core - * - * @uses $vars['object'] A system message (string) - */ -?> - -<p> - <?php echo nl2br($vars['object']); ?> -</p>
\ No newline at end of file diff --git a/views/installation/page_shells/default.php b/views/installation/page/default.php index fbc5ccbf2..662e8206e 100644 --- a/views/installation/page_shells/default.php +++ b/views/installation/page/default.php @@ -29,24 +29,29 @@ header('Expires: Fri, 05 Feb 1982 00:00:00 -0500', TRUE); <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="SHORTCUT ICON" href="<?php echo elgg_get_site_url(); ?>_graphics/favicon.ico" /> <link rel="stylesheet" href="<?php echo elgg_get_site_url(); ?>install/css/install.css" type="text/css" /> + <script type="text/javascript" src="<?php echo elgg_get_site_url(); ?>vendors/jquery/jquery-1.6.4.min.js"></script> + <script type="text/javascript" src="<?php echo elgg_get_site_url(); ?>install/js/install.js"></script> </head> <body> - <div id="elgg-wrapper"> - <div id="elgg-header"> - <?php echo elgg_view('install/header', $vars); ?> + <div class="elgg-page"> + <div class="elgg-page-header"> + <?php echo elgg_view('page/elements/header', $vars); ?> + </div> + <div class="elgg-page-body"> + <div class="elgg-layout"> + <div class="elgg-sidebar"> + <?php echo elgg_view('page/elements/sidebar', $vars); ?> + </div> + <div class="elgg-body"> + <h2><?php echo $vars['title']; ?></h2> + <?php echo elgg_view('page/elements/messages', array('object' => $vars['sysmessages'])); ?> + <?php echo $vars['body']; ?> + </div> + </div> + </div> + <div class="elgg-page-footer"> + <?php echo elgg_view('page/elements/footer'); ?> + </div> </div> - <div id="elgg-sidebar"> - <?php echo elgg_view('install/sidebar', $vars); ?> - </div> - <div id="elgg-content"> - <h2><?php echo $vars['title']; ?></h2> - <?php echo elgg_view('messages/list', array('object' => $vars['sysmessages'])); ?> - <?php echo $vars['body']; ?> - </div> - <div class="clearfloat"></div> - </div> - <div id="elgg-footer"> - <?php echo elgg_view('install/footer'); ?> - </div> </body> </html> diff --git a/views/installation/page/elements/footer.php b/views/installation/page/elements/footer.php new file mode 100644 index 000000000..d6a755fba --- /dev/null +++ b/views/installation/page/elements/footer.php @@ -0,0 +1,10 @@ +<?php +/** + * Install footer - offers help links + */ +?> +<ul> + <li><a href="http://docs.elgg.org/wiki/Installation" target="_blank">Install instructions</a></li> + <li><a href="http://docs.elgg.org/wiki/Install_Troubleshooting" target="_blank">Install troubleshooting</a></li> + <li><a href="http://community.elgg.org/pg/groups/world" target="_blank">Elgg community forums</a></li> +</ul>
\ No newline at end of file diff --git a/views/installation/install/header.php b/views/installation/page/elements/header.php index 8c18dbffd..8c18dbffd 100644 --- a/views/installation/install/header.php +++ b/views/installation/page/elements/header.php diff --git a/views/installation/page/elements/messages.php b/views/installation/page/elements/messages.php new file mode 100644 index 000000000..46261dca4 --- /dev/null +++ b/views/installation/page/elements/messages.php @@ -0,0 +1,21 @@ +<?php +/** + * Lists all system messages + * + * @uses $vars['object'] The array of message registers + */ + +if (isset($vars['object']) && is_array($vars['object']) && sizeof($vars['object']) > 0) { + + echo '<ul class="elgg-system-messages">'; + + foreach ($vars['object'] as $type => $list ) { + foreach ($list as $message) { + echo "<li class=\"elgg-state-$type\">"; + echo elgg_autop($message); + echo '</li>'; + } + } + + echo '</ul>'; +} diff --git a/views/installation/install/sidebar.php b/views/installation/page/elements/sidebar.php index 8136cd898..8136cd898 100644 --- a/views/installation/install/sidebar.php +++ b/views/installation/page/elements/sidebar.php |
