aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-02-23 10:37:23 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-02-23 10:37:23 +0000
commit8e1c721fc516d7d2dfe127ac423ddcc034868667 (patch)
tree47671d5be62de5e39400feb80b2214f55502a4f3
parentabf321f2fb25d1750c96a67807bcda84a63ba497 (diff)
downloadelgg-8e1c721fc516d7d2dfe127ac423ddcc034868667.tar.gz
elgg-8e1c721fc516d7d2dfe127ac423ddcc034868667.tar.bz2
Introducing the access control to the failsafe view.
git-svn-id: https://code.elgg.org/elgg/trunk@2886 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--views/failsafe/input/access.php51
1 files changed, 51 insertions, 0 deletions
diff --git a/views/failsafe/input/access.php b/views/failsafe/input/access.php
new file mode 100644
index 000000000..d3bbaa407
--- /dev/null
+++ b/views/failsafe/input/access.php
@@ -0,0 +1,51 @@
+<?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-2009
+ * @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
+ *
+ */
+
+ if (isset($vars['class'])) $class = $vars['class'];
+ if (!$class) $class = "input-access";
+
+ if ((!isset($vars['options'])) || (!is_array($vars['options'])))
+ {
+ $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 if (isset($vars['js'])) echo $vars['js']; ?> <?php if ((isset($vars['disabled'])) && ($vars['disabled'])) echo ' disabled="yes" '; ?> class="<?php echo $class; ?>">
+<?php
+
+ foreach($vars['options'] as $key => $option) {
+ if ($key != $vars['value']) {
+ echo "<option value=\"{$key}\">{$option}</option>";
+ } else {
+ echo "<option value=\"{$key}\" selected=\"selected\">{$option}</option>";
+ }
+ }
+
+?>
+</select>
+
+<?php
+
+ }
+
+?> \ No newline at end of file