diff options
Diffstat (limited to 'views/default')
-rw-r--r-- | views/default/css/elements/skin.php | 19 | ||||
-rw-r--r-- | views/default/css/screen.php | 1 | ||||
-rw-r--r-- | views/default/forms/likes/edit.php | 28 | ||||
-rw-r--r-- | views/default/output/confirmlink.php | 18 |
4 files changed, 52 insertions, 14 deletions
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> |