aboutsummaryrefslogtreecommitdiff
path: root/views/installation/input/checkbox.php
diff options
context:
space:
mode:
authorewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-25 18:54:05 +0000
committerewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-25 18:54:05 +0000
commit4e5d14ee2638dd6c9b22baf67d880787fa6085e4 (patch)
treedff5c5b0c673b717a4fb1689e83be434483bd231 /views/installation/input/checkbox.php
parent5eef9adfea09ef6c913069e8eff8c88cb8a02a04 (diff)
downloadelgg-4e5d14ee2638dd6c9b22baf67d880787fa6085e4.tar.gz
elgg-4e5d14ee2638dd6c9b22baf67d880787fa6085e4.tar.bz2
Updated input/checkboxes code in installation viewtype
git-svn-id: http://code.elgg.org/elgg/trunk@8467 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/installation/input/checkbox.php')
-rw-r--r--views/installation/input/checkbox.php33
1 files changed, 33 insertions, 0 deletions
diff --git a/views/installation/input/checkbox.php b/views/installation/input/checkbox.php
new file mode 100644
index 000000000..898fe8458
--- /dev/null
+++ b/views/installation/input/checkbox.php
@@ -0,0 +1,33 @@
+<?php
+/**
+ * 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.
+ */
+
+$defaults = array(
+ 'class' => 'elgg-input-checkbox',
+ 'default' => 0,
+);
+
+$vars = array_merge($defaults, $vars);
+
+$default = $vars['default'];
+unset($vars['default']);
+
+if (isset($vars['name']) && $default !== false) {
+ echo "<input type=\"hidden\" name=\"{$vars['name']}\" value=\"$default\"/>";
+}
+
+?>
+
+<input type="checkbox" <?php echo elgg_format_attributes($vars); ?> /> \ No newline at end of file