]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
added elgg-icon-delete and elgg-icon-likes
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Mon, 20 Dec 2010 12:38:25 +0000 (12:38 +0000)
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Mon, 20 Dec 2010 12:38:25 +0000 (12:38 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@7698 36083f99-b078-4883-b0ff-0f9b5a30f544

mod/blog/views/default/object/blog.php
pages/entities/index.php
views/default/css/elements/skin.php
views/default/css/screen.php
views/default/forms/likes/edit.php
views/default/output/confirmlink.php

index 776408cc5ff20ac95ab14980c9c516606a386a83..3efd749f17dde1fdb5f449cf2e004e93d2a6f705 100644 (file)
@@ -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) {
 
index a2cb224551d0181c954408229593bc06c9351979..13aea9e5a27302ebcb73453312deb447fea3ac49 100644 (file)
@@ -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;
        }
index 8994785ef6d7769b9ef81c2099ef381b1acaa0b0..5d9af8e63d96d1af1abacf2413ba0058552e9caf 100644 (file)
@@ -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;
 }
index 129a8c6373ee08e8974415a220353f77d75e3b4b..16529004f2ea85a296df31c082cea2b19e6cd295 100644 (file)
@@ -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;
index 33527b53a0f49cf1a18552a6afe0a7c66f2d9c98..93c4ce983ec972a8796fe4e46d100d2c173bf885 100644 (file)
@@ -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>"; 
 }
 
 
index bce06305ad7be2fd8af4170b41906df5d792cd76..5cb9aa52e00df7dd14a94b36d2594acf84b20e78 100644 (file)
@@ -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>