From dd5f5518d83e46c13232e0fa82118539aae0faa7 Mon Sep 17 00:00:00 2001 From: ewinslow Date: Tue, 22 Feb 2011 02:13:13 +0000 Subject: Fixes #2980: DRY'ed up all plugins to use elgg_view_icon instead of generating their own html git-svn-id: http://code.elgg.org/elgg/trunk@8410 36083f99-b078-4883-b0ff-0f9b5a30f544 --- .../views/default/bookmarks/page_links.php | 2 +- mod/bookmarks/views/default/object/bookmarks.php | 6 ++--- .../views/default/theme_preview/icons.php | 31 ++++++++++++++-------- mod/thewire/views/default/thewire/metadata.php | 2 +- .../admin/appearance/profile_fields/list.php | 14 +++++++--- views/default/core/likes/display.php | 4 +-- views/default/icon/user/default.php | 2 +- views/default/navigation/menu/metadata.php | 2 +- views/default/navigation/menu/site.php | 3 ++- views/default/output/tagcloud.php | 8 +++--- views/default/output/tags.php | 4 +-- views/default/page/elements/page_links.php | 2 +- views/default/page/elements/topbar.php | 12 ++++----- views/default/river/relationship/friend/create.php | 2 +- 14 files changed, 56 insertions(+), 38 deletions(-) diff --git a/mod/bookmarks/views/default/bookmarks/page_links.php b/mod/bookmarks/views/default/bookmarks/page_links.php index 92ea8600a..8774230f0 100644 --- a/mod/bookmarks/views/default/bookmarks/page_links.php +++ b/mod/bookmarks/views/default/bookmarks/page_links.php @@ -11,7 +11,7 @@ $url = 'pg/bookmarks/add/' . elgg_get_logged_in_user_guid() $return[] = new ElggMenuItem('bookmark_this_page', elgg_echo('bookmarks:this'), $url); echo elgg_view('output/url', array( - 'text' => '', + 'text' => elgg_view_icon('bookmark'), 'href' => $url, 'title' => $label, 'rel' => 'nofollow', diff --git a/mod/bookmarks/views/default/object/bookmarks.php b/mod/bookmarks/views/default/object/bookmarks.php index e9485d260..dc1ae795d 100644 --- a/mod/bookmarks/views/default/object/bookmarks.php +++ b/mod/bookmarks/views/default/object/bookmarks.php @@ -63,12 +63,12 @@ if ($full && !elgg_in_context('gallery')) { 'tags' => $tags, ); $bookmark_info = elgg_view('layout/objects/list/body', $params); - + $bookmark_icon = elgg_view_icon('bookmark'); echo << -

$link

+ $bookmark_icon

$link

$description HTML; @@ -103,7 +103,7 @@ HTML; 'text' => $display_text ))); - $content = "$link{$excerpt}"; + $content = elgg_view_icon('bookmark') . "$link{$excerpt}"; $params = array( 'entity' => $bookmark, diff --git a/mod/developers/views/default/theme_preview/icons.php b/mod/developers/views/default/theme_preview/icons.php index 89aa8cbc6..be444adb8 100644 --- a/mod/developers/views/default/theme_preview/icons.php +++ b/mod/developers/views/default/theme_preview/icons.php @@ -9,17 +9,26 @@

Icon Sprites

Ajax loader

diff --git a/mod/thewire/views/default/thewire/metadata.php b/mod/thewire/views/default/thewire/metadata.php index da749c97f..0ae7cb0a0 100644 --- a/mod/thewire/views/default/thewire/metadata.php +++ b/mod/thewire/views/default/thewire/metadata.php @@ -41,7 +41,7 @@ if ($entity->canEdit() && $handler) { $delete_url = "action/$handler/delete?guid={$entity->getGUID()}"; $delete_link = elgg_view('output/confirmlink', array( 'href' => $delete_url, - 'text' => '', + 'text' => elgg_view_icon('delete'), 'title' => elgg_echo('delete'), 'confirm' => elgg_echo('deleteconfirm'), 'text_encode' => false, diff --git a/views/default/admin/appearance/profile_fields/list.php b/views/default/admin/appearance/profile_fields/list.php index 0b27da3ed..493129583 100644 --- a/views/default/admin/appearance/profile_fields/list.php +++ b/views/default/admin/appearance/profile_fields/list.php @@ -1,6 +1,8 @@ $item->translation)); //$even_odd = ( 'odd' != $even_odd ) ? 'odd' : 'even'; - $url = elgg_add_action_tokens_to_url(elgg_get_site_url() . "action/profile/fields/delete?id={$item->shortname}"); + $url = elgg_view('output/url', array( + 'href' => "action/profile/fields/delete?id={$item->shortname}", + 'is_action' => TRUE, + 'text' => elgg_view_icon('delete'), + )); $type = elgg_echo($item->type); echo << -$item->translation [$type] - +
  • + + $item->translation [$type] $url
  • HTML; } diff --git a/views/default/core/likes/display.php b/views/default/core/likes/display.php index 570c4d1ff..addcee199 100644 --- a/views/default/core/likes/display.php +++ b/views/default/core/likes/display.php @@ -19,7 +19,7 @@ if (elgg_is_logged_in() && $vars['entity']->canAnnotate(0, 'likes')) { $url = elgg_get_site_url() . "action/likes/add?guid={$guid}"; $params = array( 'href' => $url, - 'text' => '', + 'text' => elgg_view_icon('likes'), 'title' => elgg_echo('likes:likethis'), 'is_action' => true, 'encode_text' => false, @@ -35,7 +35,7 @@ if (elgg_is_logged_in() && $vars['entity']->canAnnotate(0, 'likes')) { $url = elgg_get_site_url() . "action/likes/delete?annotation_id={$likes[0]->id}"; $params = array( 'href' => $url, - 'text' => "", + 'text' => elgg_view_icon('liked'), 'title' => elgg_echo('likes:remove'), 'is_action' => true, 'encode_text' => false, diff --git a/views/default/icon/user/default.php b/views/default/icon/user/default.php index a288358a2..46889e89e 100644 --- a/views/default/icon/user/default.php +++ b/views/default/icon/user/default.php @@ -49,7 +49,7 @@ if ($show_menu) { 'username' => $username, 'name' => $name, ); - echo ""; + echo elgg_view_icon('hover-menu'); echo elgg_view_menu('user_hover', $params); } diff --git a/views/default/navigation/menu/metadata.php b/views/default/navigation/menu/metadata.php index 3ce3573b9..2685a9582 100644 --- a/views/default/navigation/menu/metadata.php +++ b/views/default/navigation/menu/metadata.php @@ -39,7 +39,7 @@ if ($entity->canEdit() && $handler) { $delete_url = "action/$handler/delete?guid={$entity->getGUID()}"; $delete_link = elgg_view('output/confirmlink', array( 'href' => $delete_url, - 'text' => '', + 'text' => elgg_view_icon('delete'), 'title' => elgg_echo('delete'), 'confirm' => elgg_echo('deleteconfirm'), 'text_encode' => false, diff --git a/views/default/navigation/menu/site.php b/views/default/navigation/menu/site.php index 706e56fe5..0b3a47a62 100644 --- a/views/default/navigation/menu/site.php +++ b/views/default/navigation/menu/site.php @@ -13,8 +13,9 @@ foreach ($vars['menu']['default'] as $menu_item) { if (isset($vars['menu']['more'])) { $more = elgg_echo('more'); + $arrow = elgg_view_icon('arrow-s'); echo '
  • '; - echo "$more"; + echo "$arrow $more"; echo '
      '; foreach ($vars['menu']['more'] as $menu_item) { echo elgg_view('navigation/menu/elements/item', array('item' => $menu_item)); diff --git a/views/default/output/tagcloud.php b/views/default/output/tagcloud.php index 329119a6b..6742d9954 100644 --- a/views/default/output/tagcloud.php +++ b/views/default/output/tagcloud.php @@ -55,10 +55,12 @@ if (!empty($vars['tagcloud']) && is_array($vars['tagcloud'])) { } if ($context != 'tags') { - $text = elgg_echo('tagcloud:allsitetags'); $cloud .= '

      '; - $cloud .= ''; - $cloud .= "$text"; + $cloud .= elgg_view_icon('tag'); + $cloud .= elgg_view('output/url', array( + 'href' => 'pg/tags', + 'text' => elgg_echo('tagcloud:allsitetags'), + )); $cloud .= '

      '; } diff --git a/views/default/output/tags.php b/views/default/output/tags.php index 76145276c..2af4c2757 100644 --- a/views/default/output/tags.php +++ b/views/default/output/tags.php @@ -33,7 +33,7 @@ if (!empty($vars['tags'])) { } echo '
      '; - echo ''; + echo elgg_view_icon('tag'); echo '
        '; foreach($vars['tags'] as $tag) { if (!empty($vars['type'])) { @@ -44,7 +44,7 @@ if (!empty($vars['tags'])) { $url = elgg_get_site_url() . 'pg/search/?q=' . urlencode($tag) . "&search_type=tags{$type}{$subtype}{$object}"; if (is_string($tag)) { echo '
      • '; - echo "" . htmlspecialchars($tag, ENT_QUOTES, 'UTF-8') . ""; + echo elgg_view('output/url', array('href' => $url, 'text' => $tag, 'rel' => 'tag')); echo '
      • '; } } diff --git a/views/default/page/elements/page_links.php b/views/default/page/elements/page_links.php index fb9acbfb7..bd901ee42 100644 --- a/views/default/page/elements/page_links.php +++ b/views/default/page/elements/page_links.php @@ -17,7 +17,7 @@ if (isset($autofeed) && $autofeed == true) { $label = elgg_echo('feed:rss'); $rss_link = elgg_view('output/url', array( - 'text' => '', + 'text' => elgg_view_icon('rss'), 'href' => $url, 'title' => $label, 'rel' => 'nofollow', diff --git a/views/default/page/elements/topbar.php b/views/default/page/elements/topbar.php index 987326119..88ffa85e0 100644 --- a/views/default/page/elements/topbar.php +++ b/views/default/page/elements/topbar.php @@ -26,8 +26,8 @@ echo elgg_view('output/url', array( // friends echo elgg_view('output/url', array( - 'href' => elgg_get_site_url() . "pg/friends/{$user->username}/", - 'text' => '', + 'href' => "pg/friends/{$user->username}/", + 'text' => elgg_view_icon('friends'), 'title' => elgg_echo('friends'), )); @@ -51,16 +51,16 @@ echo elgg_view('elgg_topbar/extend', $vars); // user settings echo elgg_view('output/url', array( - 'href' => elgg_get_site_url() . "pg/settings/user/{$user->username}", - 'text' => '' . elgg_echo('settings'), + 'href' => "pg/settings/user/{$user->username}", + 'text' => elgg_view_icon('settings') . elgg_echo('settings'), 'class' => 'elgg-alt', )); // The administration link is for admin or site admin users only if ($user->isAdmin()) { echo elgg_view('output/url', array( - 'href' => elgg_get_site_url() . 'pg/admin/', - 'text' => '' . elgg_echo('admin'), + 'href' => 'pg/admin/', + 'text' => elgg_view_icon('settings') . elgg_echo('admin'), 'class' => 'elgg-alt', )); } diff --git a/views/default/river/relationship/friend/create.php b/views/default/river/relationship/friend/create.php index 1e6514b4a..5392105d6 100644 --- a/views/default/river/relationship/friend/create.php +++ b/views/default/river/relationship/friend/create.php @@ -17,6 +17,6 @@ echo elgg_echo("friends:river:add", array($object_link)); echo '
        '; echo $subject_icon; -echo ''; +echo elgg_view_icon('following'); echo $object_icon; echo '
        '; -- cgit v1.2.3