From 90960088561357dae617344cfbf6ae8fba955c42 Mon Sep 17 00:00:00 2001 From: cash Date: Sat, 11 Jun 2011 14:58:43 +0000 Subject: Refs #3523 added a view for write access in pages plugin git-svn-id: http://code.elgg.org/elgg/trunk@9171 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/pages/start.php | 2 +- mod/pages/views/default/input/write_access.php | 35 ++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 mod/pages/views/default/input/write_access.php diff --git a/mod/pages/start.php b/mod/pages/start.php index fded5fee9..744306649 100644 --- a/mod/pages/start.php +++ b/mod/pages/start.php @@ -65,7 +65,7 @@ function pages_init() { 'description' => 'longtext', 'tags' => 'tags', 'access_id' => 'access', - 'write_access_id' => 'access', + 'write_access_id' => 'write_access', )); elgg_register_plugin_hook_handler('register', 'menu:owner_block', 'pages_owner_block_menu'); diff --git a/mod/pages/views/default/input/write_access.php b/mod/pages/views/default/input/write_access.php new file mode 100644 index 000000000..69277ca20 --- /dev/null +++ b/mod/pages/views/default/input/write_access.php @@ -0,0 +1,35 @@ + 'elgg-input-access', + 'disabled' => FALSE, + 'value' => get_default_access(), + 'options_values' => $options, +); + +if (isset($vars['entity'])) { + $defaults['value'] = $vars['entity']->write_access_id; + unset($vars['entity']); +} + +$vars = array_merge($defaults, $vars); + +if ($vars['value'] == ACCESS_DEFAULT) { + $vars['value'] = get_default_access(); +} +$vars['value'] = ($vars['value'] == ACCESS_PUBLIC) ? ACCESS_LOGGED_IN : $vars['value']; + +echo elgg_view('input/dropdown', $vars); -- cgit v1.2.3