aboutsummaryrefslogtreecommitdiff
path: root/views/default/input/access.php
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-05-23 17:19:15 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-05-23 17:19:15 +0000
commitf13ffaf15ac87e1a465167c02edf374e3683e828 (patch)
tree6499a5584b4e28710e59a2c536deaa302a8955f5 /views/default/input/access.php
parent42cda8751ae6237f4ab9439b1daf6650b3db0f63 (diff)
downloadelgg-f13ffaf15ac87e1a465167c02edf374e3683e828.tar.gz
elgg-f13ffaf15ac87e1a465167c02edf374e3683e828.tar.bz2
Introducing a visual widget for inputting access permissions.
git-svn-id: https://code.elgg.org/elgg/trunk@706 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/default/input/access.php')
-rw-r--r--views/default/input/access.php45
1 files changed, 45 insertions, 0 deletions
diff --git a/views/default/input/access.php b/views/default/input/access.php
new file mode 100644
index 000000000..4c767d0d0
--- /dev/null
+++ b/views/default/input/access.php
@@ -0,0 +1,45 @@
+<?php
+
+ /**
+ * Elgg access level input
+ * Displays a pulldown input field
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.org/
+ *
+ * @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
+ *
+ */
+
+ $vars['options'] = array();
+ $vars['options'] = get_write_access_array();
+
+ if (is_array($vars['options']) && sizeof($vars['options']) > 0) {
+
+?>
+
+<select name="<?php echo $vars['internalname']; ?>" <?php echo $vars['js']; ?>>
+<?php
+
+ foreach($vars['options'] as $option) {
+ if ($option != $vars['value']) {
+ echo "<option>{$option}</option>";
+ } else {
+ echo "<option selected=\"selected\">{$option}</option>";
+ }
+ }
+
+?>
+</select>
+
+<?php
+
+ }
+
+?> \ No newline at end of file