Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Login forward url #140

Closed
wants to merge 3 commits into from

2 participants

Ismayil Khay... added some commits
@cash
Owner

Why the unset($vars['item_class']);?

All CSS classes should be namespaced by "elgg-". I'm thinking of item-tag.

Collaborator

Right, will namespace the item-tag.

unsetting item_class in case we decide to clean the vars and pass attributes to the element.

Collaborator

I was looking into a possibility of creating a tag cloud using classes for a elements, but I don't think it's possible with the current setup. So, removed the unsetting of item_class and list_class

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 9, 2012
  1. fixes tags html markup issues

    Ismayil Khayredinov authored
  2. tags css

    Ismayil Khayredinov authored
  3. adding a check for forward url upon login

    Ismayil Khayredinov authored
This page is out of date. Refresh to see the latest.
View
2  actions/login.php
@@ -12,7 +12,7 @@
unset($_SESSION['last_forward_from']);
} elseif (get_input('returntoreferer')) {
$forward_url = REFERER;
-} else {
+} elseif (!$forward_url = elgg_get_config('logged_in_forward_url')) {
// forward to main index page
$forward_url = '';
}
View
9 views/default/css/elements/components.php
@@ -265,17 +265,16 @@
Tags
*************************************** */
.elgg-tags {
- display: inline;
font-size: 85%;
}
-.elgg-tags li {
- display: inline;
+.elgg-tags > li {
+ float:left;
margin-right: 5px;
}
-.elgg-tags li:after {
+.elgg-tags li.item-tag:after {
content: ",";
}
-.elgg-tags li:last-child:after {
+.elgg-tags li.item-tag:last-child:after {
content: "";
}
.elgg-tagcloud {
View
40 views/default/output/tags.php
@@ -7,6 +7,9 @@
* @uses $vars['type'] The entity type, optional
* @uses $vars['subtype'] The entity subtype, optional
* @uses $vars['entity'] Optional. Entity whose tags are being displayed (metadata ->tags)
+ * @uses $vars['list_class'] Optional. Additional classes to be passed to <ul> element
+ * @uses $vars['item_class'] Optional. Additional classes to be passed to <li> elements
+ * @uses $vars['icon_class'] Optional. Additional classes to be passed to tags icon image
*/
if (isset($vars['entity'])) {
@@ -38,9 +41,21 @@
$vars['tags'] = array($vars['tags']);
}
- echo '<div>';
- echo elgg_view_icon('tag');
- echo '<ul class="elgg-tags">';
+ $list_class = "elgg-tags";
+ if (isset($vars['list_class'])) {
+ $list_class = "$list_class {$vars['list_class']}";
+ unset($vars['list_class']);
+ }
+
+ $item_class = "item-tag";
+ if (isset($vars['item_class'])) {
+ $item_class = "$item_class {$vars['item_class']}";
+ unset($vars['item_class']);
+ }
+
+ $icon_class = elgg_extract('icon_class', $vars);
+ $list_items = '<li>' . elgg_view_icon('tag', $icon_class) . '</li>';
+
foreach($vars['tags'] as $tag) {
if (!empty($vars['type'])) {
$type = "&type={$vars['type']}";
@@ -49,11 +64,20 @@
}
$url = elgg_get_site_url() . 'search?q=' . urlencode($tag) . "&search_type=tags{$type}{$subtype}{$object}";
if (is_string($tag)) {
- echo '<li>';
- echo elgg_view('output/url', array('href' => $url, 'text' => $tag, 'rel' => 'tag'));
- echo '</li>';
+ $list_items .= "<li class=\"$item_class\">";
+ $list_items .= elgg_view('output/url', array('href' => $url, 'text' => $tag, 'rel' => 'tag'));
+ $list_items .= '</li>';
}
}
- echo '</ul>';
- echo '</div>';
+
+ $list = <<<___HTML
+ <div class="clearfix">
+ <ul class="$list_class">
+ $list_items
+ </ul>
+ </div>
+___HTML;
+
+ echo $list;
}
+
Something went wrong with that request. Please try again.