aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-12-20 12:38:25 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-12-20 12:38:25 +0000
commit45809013256e8c5eb87fa90a6feee66ec632cb03 (patch)
treedcecf3c13dea698febc0d00c49ba90260abce79d
parent14a131e73eca92bb216ffad468a18c4a28ee35c2 (diff)
downloadelgg-45809013256e8c5eb87fa90a6feee66ec632cb03.tar.gz
elgg-45809013256e8c5eb87fa90a6feee66ec632cb03.tar.bz2
added elgg-icon-delete and elgg-icon-likes
git-svn-id: http://code.elgg.org/elgg/trunk@7698 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--mod/blog/views/default/object/blog.php12
-rw-r--r--pages/entities/index.php2
-rw-r--r--views/default/css/elements/skin.php19
-rw-r--r--views/default/css/screen.php1
-rw-r--r--views/default/forms/likes/edit.php28
-rw-r--r--views/default/output/confirmlink.php18
6 files changed, 60 insertions, 20 deletions
diff --git a/mod/blog/views/default/object/blog.php b/mod/blog/views/default/object/blog.php
index 776408cc5..3efd749f1 100644
--- a/mod/blog/views/default/object/blog.php
+++ b/mod/blog/views/default/object/blog.php
@@ -52,11 +52,13 @@ if ($blog->canEdit()) {
$edit_link = "<span class='entity-edit'><a href=\"$edit_url\">" . elgg_echo('edit') . '</a></span>';
$delete_url = "action/blog/delete?guid={$blog->getGUID()}";
- $delete_link = "<span class='delete-button'>" . elgg_view('output/confirmlink', array(
+ $delete_link = elgg_view('output/confirmlink', array(
'href' => $delete_url,
- 'text' => elgg_echo('delete'),
- 'confirm' => elgg_echo('deleteconfirm')
- )) . "</span>";
+ 'text' => '<span class="elgg-icon elgg-icon-delete"></span>',
+ 'title' => elgg_echo('delete'),
+ 'confirm' => elgg_echo('deleteconfirm'),
+ 'encode' => false,
+ ));
$status = '';
if ($blog->status != 'published') {
@@ -69,7 +71,7 @@ if ($blog->canEdit()) {
// include a view for plugins to extend
$edit = elgg_view("blogs/options", array("object_type" => 'blog', 'entity' => $blog)) .
- elgg_view_likes($blog) . $edit;
+ $edit . elgg_view_likes($blog);
if ($full) {
diff --git a/pages/entities/index.php b/pages/entities/index.php
index a2cb22455..13aea9e5a 100644
--- a/pages/entities/index.php
+++ b/pages/entities/index.php
@@ -38,7 +38,7 @@ if ($entity = get_entity($guid)) {
}
$area1 = elgg_view_entity($entity, true);
if ($shell) {
- $body = elgg_view_layout('one_column_with_sidebar', array('content' => $area1));
+ $body = elgg_view_layout('one_column', array('content' => $area1));
} else {
$body = $area1;
}
diff --git a/views/default/css/elements/skin.php b/views/default/css/elements/skin.php
index 8994785ef..5d9af8e63 100644
--- a/views/default/css/elements/skin.php
+++ b/views/default/css/elements/skin.php
@@ -207,6 +207,25 @@ a.selected {
.elgg-icon-help {
background-position: -302px -136px;
}
+.elgg-icon-delete {
+ background-position: -199px 1px;
+}
+.elgg-icon-delete:hover {
+ background-position: -199px -15px;
+}
+.elgg-icon-likes {
+ background-position: 0px -101px;
+ width: 20px;
+ height: 20px;
+}
+.elgg-icon-likes:hover {
+ background-position: 0px -131px;
+}
+.elgg-icon-liked {
+ background-position: 0px -131px;
+ width: 20px;
+ height: 20px;
+}
.elgg-icon-arrow-s {
background-position: -146px -56px;
}
diff --git a/views/default/css/screen.php b/views/default/css/screen.php
index 129a8c637..16529004f 100644
--- a/views/default/css/screen.php
+++ b/views/default/css/screen.php
@@ -562,6 +562,7 @@ a.elgg-widget-edit-button:hover, a.elgg-widget-delete-button:hover {
.entity-metadata span, .elgg-metadata span {
margin-left:14px;
text-align:right;
+ float:left;
}
.entity-metadata .entity-edit a, .elgg-metadata .entity-edit a {
color:#aaaaaa;
diff --git a/views/default/forms/likes/edit.php b/views/default/forms/likes/edit.php
index 33527b53a..93c4ce983 100644
--- a/views/default/forms/likes/edit.php
+++ b/views/default/forms/likes/edit.php
@@ -8,18 +8,25 @@
*/
if (isset($vars['entity']) && isloggedin()) {
- $guid = $vars['entity']->getGuid();
- $url = elgg_add_action_tokens_to_url(elgg_get_site_url() . "action/likes/add?guid={$guid}");
+ $guid = $vars['entity']->getGUID();
+ $url = elgg_get_site_url() . "action/likes/add?guid={$guid}";
- echo "<span class='likes-list-holder'>";
//check to see if the user has already liked
if (!elgg_annotation_exists($guid, 'likes') ) {
- echo "<a class='user-like link' title='".elgg_echo('likes:likethis')."' href=\"{$url}\">" . elgg_echo('likes:likethis') . "</a>";
- $likes_classname = "not-liked";
+ $params = array(
+ 'href' => $url,
+ 'text' => '<span class="elgg-icon elgg-icon-likes"></span>',
+ 'title' => elgg_echo('likes:likethis'),
+ 'is_action' => true,
+ );
+ echo elgg_view('output/url', $params);
+ $likes_classname = 'elgg-icon-likes';
$likes_titletag = "";
} else {
- $likes_titletag = "title='".elgg_echo('likes:remove')."'";
+ $likes_classname = 'elgg-icon-liked';
+ $likes_titletag = elgg_echo('likes:remove');
}
+
//display the number of likes
$numoflikes = elgg_count_likes($vars['entity']);
if ($numoflikes != 0) {
@@ -29,14 +36,19 @@ if (isset($vars['entity']) && isloggedin()) {
$user_string = elgg_echo('likes:userslikedthis');
}
- echo "<a class='likes-list-button link {$likes_classname}' {$likes_titletag}>" . elgg_count_likes($vars['entity']) . " " . $user_string . "</a>";
+ $params = array(
+ 'href' => $url,
+ 'text' => "<span class=\"elgg-icon $likes_classname\"></span>" . elgg_count_likes($vars['entity']) . " " . $user_string,
+ 'title' => $likes_titletag,
+ 'is_action' => true,
+ );
+ echo elgg_view('output/url', $params);
//show the users who liked the object
echo "<div class='likes-list hidden clearfix'>";
echo list_annotations($vars['entity']->getGUID(), 'likes', 99);
echo "</div>";
}
- echo "</span>";
}
diff --git a/views/default/output/confirmlink.php b/views/default/output/confirmlink.php
index bce06305a..5cb9aa52e 100644
--- a/views/default/output/confirmlink.php
+++ b/views/default/output/confirmlink.php
@@ -9,21 +9,27 @@
* @uses $vars['text'] The text of the link
* @uses $vars['href'] The address
* @uses $vars['confirm'] The dialog text
- *
+ * @uses $vars['encode'] Encode special characters?
*/
-$confirm = $vars['confirm'];
-if (!$confirm) {
- $confirm = elgg_echo('question:areyousure');
-}
+$confirm = elgg_get_array_value('confirm', $vars, elgg_echo('question:areyousure'));
+
+$encode = elgg_get_array_value('encode', $vars, true);
// always generate missing action tokens
$link = elgg_add_action_tokens_to_url(elgg_normalize_url($vars['href']));
+$text = elgg_get_array_value('text', $vars, '');
+if ($encode) {
+ $text = htmlspecialchars($text, ENT_QUOTES, 'UTF-8');
+}
+
if (isset($vars['class']) && $vars['class']) {
$class = 'class="' . $vars['class'] . '"';
} else {
$class = '';
}
?>
-<a href="<?php echo $link; ?>" <?php echo $class; ?> onclick="return confirm('<?php echo addslashes($confirm); ?>');"><?php echo htmlspecialchars($vars['text'], ENT_QUOTES, 'UTF-8'); ?></a>
+<a href="<?php echo $link; ?>" <?php echo $class; ?> onclick="return confirm('<?php echo addslashes($confirm); ?>');">
+ <?php echo $text; ?>
+</a>