From 77897d4efad074d9434a97a67052bc788c315dee Mon Sep 17 00:00:00 2001 From: cash Date: Sun, 15 May 2011 19:38:49 +0000 Subject: Refs #3453 an implementation of creating the data directory. This capability is turned off due to security concerns. git-svn-id: http://code.elgg.org/elgg/trunk@9088 36083f99-b078-4883-b0ff-0f9b5a30f544 --- views/installation/input/checkbox.php | 37 +++++++++---------- views/installation/input/checkboxes.php | 64 --------------------------------- views/installation/input/combo.php | 19 ++++++++++ views/installation/input/form.php | 4 +-- views/installation/input/hidden.php | 10 ------ views/installation/input/text.php | 22 +++++++----- 6 files changed, 52 insertions(+), 104 deletions(-) delete mode 100644 views/installation/input/checkboxes.php create mode 100644 views/installation/input/combo.php delete mode 100644 views/installation/input/hidden.php (limited to 'views/installation/input') diff --git a/views/installation/input/checkbox.php b/views/installation/input/checkbox.php index 898fe8458..378eae6fd 100644 --- a/views/installation/input/checkbox.php +++ b/views/installation/input/checkbox.php @@ -2,32 +2,29 @@ /** * Elgg checkbox input * Displays a checkbox input tag - * - * @package Elgg - * @subpackage Core * - * - * Pass input tag attributes as key value pairs. For a list of allowable - * attributes, see http://www.w3schools.com/tags/tag_input.asp - * - * @uses mixed $vars['default'] The default value to submit if not checked. - * Optional, defaults to 0. Set to false for no default. + * @uses $var['name'] + * @uses $vars['value'] + * @uses $vars['id'] + * @uses $vars['class'] */ -$defaults = array( - 'class' => 'elgg-input-checkbox', - 'default' => 0, -); - -$vars = array_merge($defaults, $vars); +if (isset($vars['id'])) { + $id = "id=\"{$vars['id']}\""; +} else { + $id = ''; +} -$default = $vars['default']; -unset($vars['default']); +if (isset($vars['class'])) { + $id = "class=\"{$vars['class']}\""; +} else { + $id = ''; +} -if (isset($vars['name']) && $default !== false) { - echo ""; +if (!isset($vars['value'])) { + $vars['value'] = $vars['name']; } ?> - /> \ No newline at end of file + name="" 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 026ff04ba..000000000 --- a/views/installation/input/checkboxes.php +++ /dev/null @@ -1,64 +0,0 @@ - option for the each checkbox field - * @uses string $vars['id'] The id for each input field. Optional. - * (Only use this with a single value.) - * @uses string $vars['default'] The default value to send if nothing is checked. - * Optional, defaults to 0. Set to FALSE for no default. - * @uses bool $vars['disabled'] Make all input elements disabled. Optional. - * @uses string $vars['value'] The current value. Optional. - * @uses string $vars['class'] Additional class of the list. Optional. - * @uses string $vars['align'] 'horizontal' or 'vertical' Default: 'vertical' - * - */ - -$additional_class = elgg_extract('class', $vars); -$align = elgg_extract('align', $vars, 'vertical'); -$value = (isset($vars['value'])) ? $vars['value'] : NULL; -$value_array = (is_array($value)) ? array_map('elgg_strtolower', $value) : array(elgg_strtolower($value)); -$name = (isset($vars['name'])) ? $vars['name'] : ''; -$options = (isset($vars['options']) && is_array($vars['options'])) ? $vars['options'] : array(); -$default = (isset($vars['default'])) ? $vars['default'] : 0; - -$id = (isset($vars['id'])) ? $vars['id'] : ''; -$disabled = (isset($vars['disabled'])) ? $vars['disabled'] : FALSE; - -$class = "elgg-input-checkboxes elgg-$align"; -if ($additional_class) { - $class = " $additional_class"; -} - -if ($options && count($options) > 0) { - // include a default value so if nothing is checked 0 will be passed. - if ($name && $default !== FALSE) { - echo ""; - } - - echo "'; -} \ 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 @@ +$label"; + +echo '
'; \ No newline at end of file diff --git a/views/installation/input/form.php b/views/installation/input/form.php index d48d5fed8..f8730b4f5 100644 --- a/views/installation/input/form.php +++ b/views/installation/input/form.php @@ -10,12 +10,12 @@ */ if (isset($vars['id'])) { - $id = "id = \"{$vars['id']}\""; + $id = "id=\"{$vars['id']}\""; } else { $id = ''; } if (isset($vars['name'])) { - $name = "name = \"{$vars['name']}\""; + $name = "name=\"{$vars['name']}\""; } else { $name = ''; } diff --git a/views/installation/input/hidden.php b/views/installation/input/hidden.php deleted file mode 100644 index 139ff03d7..000000000 --- a/views/installation/input/hidden.php +++ /dev/null @@ -1,10 +0,0 @@ - - \ No newline at end of file diff --git a/views/installation/input/text.php b/views/installation/input/text.php index 2caf547b6..ec8233461 100644 --- a/views/installation/input/text.php +++ b/views/installation/input/text.php @@ -3,17 +3,23 @@ * Elgg text input * Displays a text input field * - * * @uses $vars['value'] The current value, if any - * @uses $vars['name'] 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 + * @uses $vars['id'] CSS id */ -$class = $vars['class']; -if (!$class) { - $class = "input-text"; +if (isset($vars['class'])) { + $class = "class=\"{$vars['class']}\""; +} else { + $class = ""; +} + +if (isset($vars['id'])) { + $id = "id=\"{$vars['id']}\""; +} else { + $id = ''; } ?> - name="" value="" class=""/> \ No newline at end of file + /> \ No newline at end of file -- cgit v1.2.3