From c3d5dfec626d2bb48edfe8fae79ff78d2ec64b0e Mon Sep 17 00:00:00 2001 From: Sem Date: Thu, 4 Oct 2012 22:00:29 +0200 Subject: Added privacy icons. --- _graphics/privacy.png | Bin 0 -> 2311 bytes views/default/n1_theme/css.php | 31 +++++++++++++++++++++++ views/default/output/access.php | 53 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 84 insertions(+) create mode 100644 _graphics/privacy.png create mode 100644 views/default/output/access.php diff --git a/_graphics/privacy.png b/_graphics/privacy.png new file mode 100644 index 0000000..4866921 Binary files /dev/null and b/_graphics/privacy.png differ diff --git a/views/default/n1_theme/css.php b/views/default/n1_theme/css.php index 32267cb..c6a94a8 100644 --- a/views/default/n1_theme/css.php +++ b/views/default/n1_theme/css.php @@ -26,6 +26,37 @@ font-weight: bold; } +.elgg-access, .elgg-input-access > option { + padding-left: 19px; + background-image: url('mod/n1_theme/_graphics/privacy.png'); + background-repeat: no-repeat; +} + +.elgg-access { + padding-top: 1px; + padding-bottom: 1px; +} + +.elgg-access-private, .elgg-input-access > option[value=""] { + background-position: 0 -65px; +} + +.elgg-access-friends, .elgg-input-access > option[value=""] { + background-position: 0 -51px; +} + +.elgg-access-loggedin, .elgg-input-access > option[value=""] { + background-position: 0 -34px; +} + +.elgg-access-public, .elgg-input-access > option[value=""] { + background-position: 0 -16px; +} + +.elgg-access-group, .elgg-input-access > option { + background-position: 0 0; +} + .file-photo { margin-top: 15px; } diff --git a/views/default/output/access.php b/views/default/output/access.php new file mode 100644 index 0000000..fdb8fe1 --- /dev/null +++ b/views/default/output/access.php @@ -0,0 +1,53 @@ +access_id; + $access_class = 'elgg-access'; + $access_id_string = get_readable_access_level($access_id); + $access_id_string = htmlentities($access_id_string, ENT_QUOTES, 'UTF-8'); + + // if within a group or shared access collection display group name and open/closed membership status + // @todo have a better way to do this instead of checking against subtype / class. + $container = $vars['entity']->getContainerEntity(); + + if ($container && $container instanceof ElggGroup) { + // we decided to show that the item is in a group, rather than its actual access level + // not required. Group ACLs are prepended with "Group: " when written. + //$access_id_string = elgg_echo('groups:group') . $container->name; + $membership = $container->membership; + + if ($membership == ACCESS_PUBLIC) { + $access_class .= ' elgg-access-group-open'; + } else { + $access_class .= ' elgg-access-group-closed'; + } + } + + switch ($access_id) { + case ACCESS_PRIVATE: + $access_class .= ' elgg-access-private'; + break; + case ACCESS_FRIENDS: + $access_class .= ' elgg-access-friends'; + break; + case ACCESS_LOGGED_IN: + $access_class .= ' elgg-access-loggedin'; + break; + case ACCESS_PUBLIC: + $access_class .= ' elgg-access-public'; + break; + default: + $access_class .= ' elgg-access-group'; + } + + $help_text = elgg_echo('access:help'); + + echo "$access_id_string"; +} -- cgit v1.2.3