aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-22 02:13:13 +0000
committerewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-22 02:13:13 +0000
commitdd5f5518d83e46c13232e0fa82118539aae0faa7 (patch)
tree600c8c95e942f752c9980ba22630227282a5c172
parentde8cccfd3f729fce4350a3391208acf2450a3f83 (diff)
downloadelgg-dd5f5518d83e46c13232e0fa82118539aae0faa7.tar.gz
elgg-dd5f5518d83e46c13232e0fa82118539aae0faa7.tar.bz2
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
-rw-r--r--mod/bookmarks/views/default/bookmarks/page_links.php2
-rw-r--r--mod/bookmarks/views/default/object/bookmarks.php6
-rw-r--r--mod/developers/views/default/theme_preview/icons.php31
-rw-r--r--mod/thewire/views/default/thewire/metadata.php2
-rw-r--r--views/default/admin/appearance/profile_fields/list.php14
-rw-r--r--views/default/core/likes/display.php4
-rw-r--r--views/default/icon/user/default.php2
-rw-r--r--views/default/navigation/menu/metadata.php2
-rw-r--r--views/default/navigation/menu/site.php3
-rw-r--r--views/default/output/tagcloud.php8
-rw-r--r--views/default/output/tags.php4
-rw-r--r--views/default/page/elements/page_links.php2
-rw-r--r--views/default/page/elements/topbar.php12
-rw-r--r--views/default/river/relationship/friend/create.php2
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' => '<span class="elgg-icon elgg-icon-bookmark"></span>',
+ '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 <<<HTML
$header
$bookmark_info
<div class="bookmark elgg-content">
- <span class="elgg-icon elgg-icon-bookmark"></span><h3 class="pbl">$link</h3>
+ $bookmark_icon<h3 class="pbl">$link</h3>
$description
</div>
HTML;
@@ -103,7 +103,7 @@ HTML;
'text' => $display_text
)));
- $content = "<span class=\"elgg-icon elgg-icon-bookmark\"></span>$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 @@
<?php echo elgg_view('theme_preview/header', $vars); ?>
<h2>Icon Sprites</h2>
<ul class="mbl clearfix">
- <li><span class="elgg-icon elgg-icon-settings"></span>Settings</li>
- <li><span class="elgg-icon elgg-icon-friends"></span>Friends</li>
- <li><span class="elgg-icon elgg-icon-help"></span>Help</li>
- <li><span class="elgg-icon elgg-icon-delete"></span>Delete</li>
- <li><span class="elgg-icon elgg-icon-likes"></span>Likes</li>
- <li><span class="elgg-icon elgg-icon-liked"></span>Liked</li>
- <li><span class="elgg-icon elgg-icon-following"></span>Following</li>
- <li><span class="elgg-icon elgg-icon-dragger"></span>Dragger</li>
- <li><span class="elgg-icon elgg-icon-rss"></span>RSS</li>
- <li><span class="elgg-icon elgg-icon-arrow-s"></span>Arrow S</li>
- <li><span class="elgg-icon elgg-icon-hover-menu"></span>Hover Menu</li>
+ <?php
+ $icons = array(
+ 'settings' => 'Settings',
+ 'friends' => 'Friends',
+ 'help' => 'Help',
+ 'delete' => 'Delete',
+ 'likes' => 'Likes',
+ 'liked' => 'Liked',
+ 'following' => 'Following',
+ 'dragger' => 'Dragger',
+ 'rss' => 'RSS',
+ 'arrow-s' => 'Arrow S',
+ 'hover-menu' => 'Hover Menu',
+ );
+
+ foreach ($icons as $icon_id => $icon_label) {
+ echo "<li>" . elgg_view_icon($icon_id) . $icon_label . "</li>";
+ }
+
+ ?>
</ul>
<h2>Ajax loader</h2>
<div class="mbl">
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' => '<span class="elgg-icon elgg-icon-delete"></span>',
+ '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 @@
<?php
/**
* Profile fields.
+ *
+ * @todo Needs some review
*/
// List form elements
@@ -32,12 +34,16 @@ foreach ($items as $item) {
echo elgg_view("profile/", array('value' => $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 <<<HTML
-<li id="$item->shortname" class="clearfix"><span class="elgg-icon elgg-icon-dragger elgg-state-draggable"></span>
-<b><span id="elgg-profile-field-{$item->shortname}" class="elgg-state-editable">$item->translation</span></b> [$type]
-<a href="$url"><span class="elgg-icon elgg-icon-delete"></a></span>
+<li id="$item->shortname" class="clearfix">
+ <span class="elgg-icon elgg-icon-dragger elgg-state-draggable"></span>
+ <b><span id="elgg-profile-field-{$item->shortname}" class="elgg-state-editable">$item->translation</span></b> [$type] $url
</li>
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' => '<span class="elgg-icon elgg-icon-likes"></span>',
+ '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' => "<span class=\"elgg-icon elgg-icon-liked\"></span>",
+ '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 "<span class=\"elgg-icon elgg-icon-hover-menu\"></span>";
+ 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' => '<span class="elgg-icon elgg-icon-delete"></span>',
+ '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 '<li class="elgg-more">';
- echo "<a class='subnav' title=\"$more\"><span class=\"elgg-icon elgg-icon-arrow-s\"></span>$more</a>";
+ echo "<a class='subnav' title=\"$more\">$arrow $more</a>";
echo '<ul>';
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 .= '<p class="small">';
- $cloud .= '<span class="elgg-icon elgg-icon-tag"></span>';
- $cloud .= "<a href=\"" . elgg_get_site_url() . "pg/tags\">$text</a>";
+ $cloud .= elgg_view_icon('tag');
+ $cloud .= elgg_view('output/url', array(
+ 'href' => 'pg/tags',
+ 'text' => elgg_echo('tagcloud:allsitetags'),
+ ));
$cloud .= '</p>';
}
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 '<div>';
- echo '<span class="elgg-icon elgg-icon-tag"></span>';
+ echo elgg_view_icon('tag');
echo '<ul class="elgg-tags">';
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 '<li>';
- echo "<a rel=\"tag\" href=\"$url\">" . htmlspecialchars($tag, ENT_QUOTES, 'UTF-8') . "</a>";
+ echo elgg_view('output/url', array('href' => $url, 'text' => $tag, 'rel' => 'tag'));
echo '</li>';
}
}
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' => '<span class="elgg-icon elgg-icon-rss"></span>',
+ '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' => '<span class="elgg-icon elgg-icon-friends"></span>',
+ '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' => '<span class="elgg-icon elgg-icon-settings"></span>' . 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' => '<span class="elgg-icon elgg-icon-settings"></span>' . 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 '<div class="elgg-river-content clearfix">';
echo $subject_icon;
-echo '<span class="elgg-icon elgg-icon-following"></span>';
+echo elgg_view_icon('following');
echo $object_icon;
echo '</div>';