From fa0dbc7f8a34597345f7939ca9914438624c3cee Mon Sep 17 00:00:00 2001 From: cash Date: Sat, 5 Nov 2011 17:09:34 -0400 Subject: Fixes #3567 standardized classes for icons --- engine/lib/input.php | 12 ++--- engine/lib/views.php | 4 +- .../views/default/theme_preview/icons/avatars.php | 4 +- mod/file/views/default/icon/object/file.php | 8 +++- .../views/default/groups/invitationrequests.php | 2 +- .../views/default/groups/membershiprequests.php | 2 +- .../notifications/subscriptions/forminternals.php | 2 +- mod/profile/views/default/profile/owner_block.php | 2 +- views/default/icon/default.php | 11 ++++- views/default/icon/user/default.php | 51 ++++++++++++++++------ views/default/input/friendspicker.php | 2 +- views/default/input/userpicker.php | 2 +- views/default/profile/icon.php | 2 +- .../river/user/default/profileiconupdate.php | 5 ++- 14 files changed, 75 insertions(+), 34 deletions(-) diff --git a/engine/lib/input.php b/engine/lib/input.php index 2f68195f2..57e35786f 100644 --- a/engine/lib/input.php +++ b/engine/lib/input.php @@ -301,12 +301,12 @@ function input_livesearch_page_handler($page) { } $output = elgg_view_list_item($entity, array( - 'hover' => false, + 'use_hover' => false, 'class' => 'elgg-autocomplete-item', )); $icon = elgg_view_entity_icon($entity, 'tiny', array( - 'hover' => false, + 'use_hover' => false, )); $result = array( @@ -344,12 +344,12 @@ function input_livesearch_page_handler($page) { } $output = elgg_view_list_item($entity, array( - 'hover' => false, + 'use_hover' => false, 'class' => 'elgg-autocomplete-item', )); $icon = elgg_view_entity_icon($entity, 'tiny', array( - 'hover' => false, + 'use_hover' => false, )); $result = array( @@ -391,12 +391,12 @@ function input_livesearch_page_handler($page) { } $output = elgg_view_list_item($entity, array( - 'hover' => false, + 'use_hover' => false, 'class' => 'elgg-autocomplete-item', )); $icon = elgg_view_entity_icon($entity, 'tiny', array( - 'hover' => false, + 'use_hover' => false, )); $result = array( diff --git a/engine/lib/views.php b/engine/lib/views.php index 2ec56c97e..6ca68ac8c 100644 --- a/engine/lib/views.php +++ b/engine/lib/views.php @@ -860,7 +860,9 @@ function elgg_view_entity(ElggEntity $entity, $vars = array(), $bypass = true, $ * * @param ElggEntity $entity The entity to display * @param string $size The size: tiny, small, medium, large - * @param array $vars An array of variables to pass to the view + * @param array $vars An array of variables to pass to the view. Some possible + * variables are img_class and link_class. See the + * specific icon view for more parameters. * * @return string HTML to display or false */ diff --git a/mod/developers/views/default/theme_preview/icons/avatars.php b/mod/developers/views/default/theme_preview/icons/avatars.php index cbce5bc7d..f50a6b70d 100644 --- a/mod/developers/views/default/theme_preview/icons/avatars.php +++ b/mod/developers/views/default/theme_preview/icons/avatars.php @@ -18,7 +18,7 @@ '; - echo elgg_view_entity_icon($user, $size, array('hover' => false)); + echo elgg_view_entity_icon($user, $size, array('use_hover' => false)); echo ''; } ?> @@ -28,7 +28,7 @@ '; - echo elgg_view_entity_icon($group, $size, array('hover' => false)); + echo elgg_view_entity_icon($group, $size, array('use_hover' => false)); echo ''; } ?> diff --git a/mod/file/views/default/icon/object/file.php b/mod/file/views/default/icon/object/file.php index 51a4469e9..a3190310b 100644 --- a/mod/file/views/default/icon/object/file.php +++ b/mod/file/views/default/icon/object/file.php @@ -5,6 +5,7 @@ * @uses $vars['entity'] The entity the icon represents - uses getIconURL() method * @uses $vars['size'] topbar, tiny, small, medium (default), large, master * @uses $vars['href'] Optional override for link + * @uses $vars['img_class'] Optional CSS class added to img * @uses $vars['link_class'] Optional CSS class added to link */ @@ -25,8 +26,13 @@ if (isset($vars['href'])) { } $class = ''; +if (isset($vars['img_class'])) { + $class = $vars['img_class']; +} if ($entity->thumbnail) { - $class = 'class="elgg-photo"'; + $class = "class=\"elgg-photo $class\""; +} else if ($class) { + $class = "class=\"$class\""; } $img_src = $entity->getIconURL($vars['size']); diff --git a/mod/groups/views/default/groups/invitationrequests.php b/mod/groups/views/default/groups/invitationrequests.php index e644b6bdc..94dbdf1f2 100644 --- a/mod/groups/views/default/groups/invitationrequests.php +++ b/mod/groups/views/default/groups/invitationrequests.php @@ -10,7 +10,7 @@ if (!empty($vars['invitations']) && is_array($vars['invitations'])) { echo '