diff options
31 files changed, 75 insertions, 79 deletions
diff --git a/views/default/html/form.php b/views/default/html/form.php new file mode 100644 index 000000000..b93c62051 --- /dev/null +++ b/views/default/html/form.php @@ -0,0 +1,11 @@ +<?php +$defaults = array( + 'method' => 'POST', + 'body' => '', +); + +$overrides = array( + 'tag' => 'form', +); + +echo elgg_view('html/tag', array_merge($defaults, $vars, $overrides));
\ No newline at end of file diff --git a/views/default/html/input.php b/views/default/html/input.php new file mode 100644 index 000000000..7350ae308 --- /dev/null +++ b/views/default/html/input.php @@ -0,0 +1,12 @@ +<?php +$defaults = array( + 'type' => 'text', +); + +$overrides = array( + 'tag' => 'input', +); + +$args = array_merge($defaults, $vars, $overrides); + +echo elgg_view('html/tag', $args);
\ No newline at end of file diff --git a/views/default/html/option.php b/views/default/html/option.php new file mode 100644 index 000000000..b3d9bbc7f --- /dev/null +++ b/views/default/html/option.php @@ -0,0 +1 @@ +<?php diff --git a/views/default/html/tag.php b/views/default/html/tag.php index c8a49dd61..b4875d953 100644 --- a/views/default/html/tag.php +++ b/views/default/html/tag.php @@ -12,17 +12,20 @@ foreach ($_SESSION as $key=>$value) { // backwards compatibility code if (isset($vars['internalname'])) { + //@todo put deprecated notice $vars['name'] = $vars['internalname']; unset($vars['internalname']); } if (isset($vars['internalid'])) { + //@todo put deprecated notice $vars['id'] = $vars['internalid']; unset($vars['internalid']); } $js = ''; if (isset($vars['js'])) { + //@todo put deprecated notice $js = $vars['js']; unset($vars['js']); } diff --git a/views/default/html/textarea.php b/views/default/html/textarea.php new file mode 100644 index 000000000..0c3813246 --- /dev/null +++ b/views/default/html/textarea.php @@ -0,0 +1,16 @@ +<?php +$defaults = array( + 'body' => '', + 'class' => 'input-textarea', +); + +$overrides = array( + 'tag' => 'textarea', +); + +if (isset($vars['value'])) { + $vars['body'] = $vars['value']; + unset($vars['value']); +} + +echo elgg_view('html/tag', array_merge($defaults, $vars, $overrides));
\ No newline at end of file diff --git a/views/default/input/button.php b/views/default/input/button.php index 6fc1fb762..bda1d7bb3 100644 --- a/views/default/input/button.php +++ b/views/default/input/button.php @@ -6,4 +6,4 @@ $overrides = array( $args = array_merge($vars, $overrides);
-echo elgg_view('input/default', $args);
\ No newline at end of file +echo elgg_view('html/input', $args);
\ No newline at end of file diff --git a/views/default/input/checkbox.php b/views/default/input/checkbox.php index ff9a4b433..c9a2c6498 100644 --- a/views/default/input/checkbox.php +++ b/views/default/input/checkbox.php @@ -6,4 +6,4 @@ $overrides = array( $args = array_merge($vars, $overrides);
-echo elgg_view('input/default', $args);
\ No newline at end of file +echo elgg_view('html/input', $args);
\ No newline at end of file diff --git a/views/default/input/color.php b/views/default/input/color.php index f67212d47..07a364b50 100644 --- a/views/default/input/color.php +++ b/views/default/input/color.php @@ -8,4 +8,4 @@ $overrides = array( 'type' => 'color',
);
-echo elgg_view('input/default', array_merge($defaults, $vars, $overrides));
\ No newline at end of file +echo elgg_view('html/input', array_merge($defaults, $vars, $overrides));
\ No newline at end of file diff --git a/views/default/input/date.php b/views/default/input/date.php index 8987d3e4a..62014cb92 100644 --- a/views/default/input/date.php +++ b/views/default/input/date.php @@ -11,4 +11,4 @@ if (isset($vars['value']) && is_int($vars['value'])) { $vars['value'] = date("Y-m-d", $vars['value']);
}
-echo elgg_view('input/default', array_merge($defaults, $vars, $overrides));
\ No newline at end of file +echo elgg_view('html/input', array_merge($defaults, $vars, $overrides));
\ No newline at end of file diff --git a/views/default/input/datetime-local.php b/views/default/input/datetime-local.php index af5573120..c9f0b32f9 100644 --- a/views/default/input/datetime-local.php +++ b/views/default/input/datetime-local.php @@ -11,4 +11,4 @@ if (isset($vars['value']) && is_int($vars['value'])) { $vars['value'] = date("Y-m-d\TH:i:s", $vars['value']);
}
-echo elgg_view('input/default', array_merge($defaults, $vars, $overrides));
\ No newline at end of file +echo elgg_view('html/input', array_merge($defaults, $vars, $overrides));
\ No newline at end of file diff --git a/views/default/input/datetime.php b/views/default/input/datetime.php index a9b2fe418..7eecb62e8 100644 --- a/views/default/input/datetime.php +++ b/views/default/input/datetime.php @@ -11,4 +11,4 @@ if (isset($vars['value']) && is_int($vars['value'])) { $vars['value'] = date("c", $vars['value']);
}
-echo elgg_view('input/default', array_merge($defaults, $vars, $overrides));
\ No newline at end of file +echo elgg_view('html/input', array_merge($defaults, $vars, $overrides));
\ No newline at end of file diff --git a/views/default/input/default.php b/views/default/input/default.php index 4f4eecc59..cf9f64097 100644 --- a/views/default/input/default.php +++ b/views/default/input/default.php @@ -15,15 +15,5 @@ * including javascript event attributes such as onclick.
*/
-// default attributes
-$defaults = array(
- 'type' => 'text',
-);
-
-$overrides = array(
- 'tag' => 'input',
-);
-
-$args = array_merge($defaults, $vars, $overrides);
-
-echo elgg_view('html/tag', $args);
\ No newline at end of file +//@todo put deprecated notice
+echo elgg_view('html/input', $vars);
\ No newline at end of file diff --git a/views/default/input/email.php b/views/default/input/email.php index e6d05be67..6d1bed19c 100644 --- a/views/default/input/email.php +++ b/views/default/input/email.php @@ -9,4 +9,4 @@ $overrides = array( $args = array_merge($defaults, $vars, $overrides);
-echo elgg_view('input/default', $args);
\ No newline at end of file +echo elgg_view('html/input', $args);
\ No newline at end of file diff --git a/views/default/input/file.php b/views/default/input/file.php index a90eed945..ef7223a80 100644 --- a/views/default/input/file.php +++ b/views/default/input/file.php @@ -8,4 +8,4 @@ $overrides = array( 'type' => 'file',
);
-echo elgg_view('input/default', array_merge($defaults, $vars, $overrides));
\ No newline at end of file +echo elgg_view('html/input', array_merge($defaults, $vars, $overrides));
\ No newline at end of file diff --git a/views/default/input/form.php b/views/default/input/form.php index e6b4f299e..c30dd5c9a 100644 --- a/views/default/input/form.php +++ b/views/default/input/form.php @@ -17,23 +17,10 @@ * */ +if ($vars['disable_security'] != TRUE) { + $vars['body'] .= elgg_view('input/securitytoken'); +} -$defaults = array( - 'method' => 'POST', - 'body' => '', -); - -$overrides = array( - 'tag' => 'form', -); - -$disable_security = $vars['disable_security']; unset($vars['disable_security']); -$args = array_merge($defaults, $vars, $overrides); - -if ($disable_security != TRUE) { - $args['body'] .= elgg_view('input/securitytoken'); -} - -echo elgg_view('html/tag', $args); +echo elgg_view('html/form', $vars); diff --git a/views/default/input/hidden.php b/views/default/input/hidden.php index 0cc5c6db4..da1e9bd00 100644 --- a/views/default/input/hidden.php +++ b/views/default/input/hidden.php @@ -8,4 +8,4 @@ $overrides = array( 'type' => 'hidden',
);
-echo elgg_view('input/default', array_merge($defaults, $vars, $overrides));
\ No newline at end of file +echo elgg_view('html/input', array_merge($defaults, $vars, $overrides));
\ No newline at end of file diff --git a/views/default/input/image.php b/views/default/input/image.php index bf0a4de81..f1b07cb8e 100644 --- a/views/default/input/image.php +++ b/views/default/input/image.php @@ -8,4 +8,4 @@ $overrides = array( 'type' => 'image',
);
-echo elgg_view('input/default', array_merge($defaults, $vars, $overrides));
\ No newline at end of file +echo elgg_view('html/input', array_merge($defaults, $vars, $overrides));
\ No newline at end of file diff --git a/views/default/input/longtext.php b/views/default/input/longtext.php index a19c7dde8..6366f8a3d 100644 --- a/views/default/input/longtext.php +++ b/views/default/input/longtext.php @@ -15,19 +15,7 @@ */ $defaults = array( - 'class' => 'input-textarea', + 'class' => 'input-richtext', ); -$overrides = array( - 'tag' => 'textarea', -); - -$args = array_merge($defaults, $vars, $overrides); - -if (isset($args['value'])) { - $args['body'] = $args['value']; -} - -$args['class'] = $args['class'].' input-richtext'; - -echo elgg_view('html/tag', $args);
\ No newline at end of file +echo elgg_view('html/textarea', array_merge($defaults, $vars));
\ No newline at end of file diff --git a/views/default/input/month.php b/views/default/input/month.php index b00db0309..071d40262 100644 --- a/views/default/input/month.php +++ b/views/default/input/month.php @@ -11,4 +11,4 @@ if (isset($vars['value']) && is_int($vars['value'])) { $vars['value'] = date("Y-m", $vars['value']);
}
-echo elgg_view('input/default', array_merge($defaults, $vars, $overrides));
\ No newline at end of file +echo elgg_view('html/input', array_merge($defaults, $vars, $overrides));
\ No newline at end of file diff --git a/views/default/input/number.php b/views/default/input/number.php index e996e4e96..fbd1bec72 100644 --- a/views/default/input/number.php +++ b/views/default/input/number.php @@ -8,4 +8,4 @@ $overrides = array( 'type' => 'number',
);
-echo elgg_view('input/default', array_merge($defaults, $vars, $overrides));
\ No newline at end of file +echo elgg_view('html/input', array_merge($defaults, $vars, $overrides));
\ No newline at end of file diff --git a/views/default/input/password.php b/views/default/input/password.php index 22374c8d9..609b39faa 100644 --- a/views/default/input/password.php +++ b/views/default/input/password.php @@ -8,4 +8,4 @@ $overrides = array( 'type' => 'password',
);
-echo elgg_view('input/default', array_merge($defaults, $vars, $overrides));
\ No newline at end of file +echo elgg_view('html/input', array_merge($defaults, $vars, $overrides));
\ No newline at end of file diff --git a/views/default/input/plaintext.php b/views/default/input/plaintext.php index 4c8cdac57..1d907dcfc 100644 --- a/views/default/input/plaintext.php +++ b/views/default/input/plaintext.php @@ -3,16 +3,4 @@ * */ -$defaults = array( - 'class' => 'input-textarea', -); - -$overrides = array( - 'tag' => 'textarea', -); - -if (isset($vars['value'])) { - $vars['body'] = $value; -} - -echo elgg_view('html/tag', array_merge($defaults, $vars, $overrides));
\ No newline at end of file +echo elgg_view('html/textarea', $vars);
\ No newline at end of file diff --git a/views/default/input/range.php b/views/default/input/range.php index 48965f662..8fedf067a 100644 --- a/views/default/input/range.php +++ b/views/default/input/range.php @@ -8,4 +8,4 @@ $overrides = array( 'type' => 'range',
);
-echo elgg_view('input/default', array_merge($defaults, $vars, $overrides));
\ No newline at end of file +echo elgg_view('html/input', array_merge($defaults, $vars, $overrides));
\ No newline at end of file diff --git a/views/default/input/reset.php b/views/default/input/reset.php index 023a6d7b6..911c6671b 100644 --- a/views/default/input/reset.php +++ b/views/default/input/reset.php @@ -8,4 +8,4 @@ $overrides = array( 'type' => 'reset',
);
-echo elgg_view('input/default', array_merge($defaults, $vars, $overrides));
\ No newline at end of file +echo elgg_view('html/input', array_merge($defaults, $vars, $overrides));
\ No newline at end of file diff --git a/views/default/input/search.php b/views/default/input/search.php index 65c252bfc..457c45999 100644 --- a/views/default/input/search.php +++ b/views/default/input/search.php @@ -2,10 +2,10 @@ $defaults = array(
'placeholder' => elgg_echo('placeholder:search'),
-)
+);
$overrides = array(
'type' => 'search',
);
-echo elgg_view('input/default', array_merge($defaults, $vars, $overrides));
\ No newline at end of file +echo elgg_view('html/input', array_merge($defaults, $vars, $overrides));
\ No newline at end of file diff --git a/views/default/input/submit.php b/views/default/input/submit.php index 741062ede..a0cd1cfac 100644 --- a/views/default/input/submit.php +++ b/views/default/input/submit.php @@ -10,4 +10,4 @@ $overrides = array( $args = array_merge($vars, $overrides);
-echo elgg_view('input/default', $args);
\ No newline at end of file +echo elgg_view('html/input', $args);
\ No newline at end of file diff --git a/views/default/input/tel.php b/views/default/input/tel.php index 174b4967d..1bb146ce5 100644 --- a/views/default/input/tel.php +++ b/views/default/input/tel.php @@ -8,4 +8,4 @@ $overrides = array( 'type' => 'tel',
);
-echo elgg_view('input/default', array_merge($defaults, $vars, $overrides));
\ No newline at end of file +echo elgg_view('html/input', array_merge($defaults, $vars, $overrides));
\ No newline at end of file diff --git a/views/default/input/text.php b/views/default/input/text.php index 77e66625c..0993d1f2b 100644 --- a/views/default/input/text.php +++ b/views/default/input/text.php @@ -8,4 +8,4 @@ $overrides = array( 'type' => 'text',
);
-echo elgg_view('input/default', array_merge($defaults, $vars, $overrides));
\ No newline at end of file +echo elgg_view('html/input', array_merge($defaults, $vars, $overrides));
\ No newline at end of file diff --git a/views/default/input/time.php b/views/default/input/time.php index f0ba3d169..3d714ccc1 100644 --- a/views/default/input/time.php +++ b/views/default/input/time.php @@ -8,4 +8,4 @@ $overrides = array( 'type' => 'time',
);
-echo elgg_view('input/default', array_merge($defaults, $vars, $overrides));
\ No newline at end of file +echo elgg_view('html/input', array_merge($defaults, $vars, $overrides));
\ No newline at end of file diff --git a/views/default/input/url.php b/views/default/input/url.php index 0d3bf0273..60d8820e7 100644 --- a/views/default/input/url.php +++ b/views/default/input/url.php @@ -10,4 +10,4 @@ $overrides = array( $args = array_merge($vars, $overrides);
-echo elgg_view('input/default', $args);
\ No newline at end of file +echo elgg_view('html/input', $args);
\ No newline at end of file diff --git a/views/default/input/week.php b/views/default/input/week.php index 3e025e345..294811aee 100644 --- a/views/default/input/week.php +++ b/views/default/input/week.php @@ -8,4 +8,4 @@ $overrides = array( 'type' => 'week',
);
-echo elgg_view('input/default', array_merge($defaults, $vars, $overrides));
\ No newline at end of file +echo elgg_view('html/input', array_merge($defaults, $vars, $overrides));
\ No newline at end of file |