Skip to content
This repository

Login forward url #140

Closed
wants to merge 3 commits into from

2 participants

Ismayil Khayredinov Cash Costello
Ismayil Khay... added some commits January 09, 2012
fixes tags html markup issues 091729f
tags css 2158154
adding a check for forward url upon login 53b0e7c
Ismayil Khayredinov hypeJunction closed this January 09, 2012
Cash Costello
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

Showing 3 unique commits by 1 author.

Jan 09, 2012
fixes tags html markup issues 091729f
tags css 2158154
adding a check for forward url upon login 53b0e7c
This page is out of date. Refresh to see the latest.
2  actions/login.php
@@ -12,7 +12,7 @@
12 12
 	unset($_SESSION['last_forward_from']);
13 13
 } elseif (get_input('returntoreferer')) {
14 14
 	$forward_url = REFERER;
15  
-} else {
  15
+} elseif (!$forward_url = elgg_get_config('logged_in_forward_url')) {
16 16
 	// forward to main index page
17 17
 	$forward_url = '';
18 18
 }
9  views/default/css/elements/components.php
@@ -265,17 +265,16 @@
265 265
 	Tags
266 266
 *************************************** */
267 267
 .elgg-tags {
268  
-	display: inline;
269 268
 	font-size: 85%;
270 269
 }
271  
-.elgg-tags li {
272  
-	display: inline;
  270
+.elgg-tags > li {
  271
+	float:left;
273 272
 	margin-right: 5px;
274 273
 }
275  
-.elgg-tags li:after {
  274
+.elgg-tags li.item-tag:after {
276 275
 	content: ",";
277 276
 }
278  
-.elgg-tags li:last-child:after {
  277
+.elgg-tags li.item-tag:last-child:after {
279 278
 	content: "";
280 279
 }
281 280
 .elgg-tagcloud {
40  views/default/output/tags.php
@@ -7,6 +7,9 @@
7 7
  * @uses $vars['type']    The entity type, optional
8 8
  * @uses $vars['subtype'] The entity subtype, optional
9 9
  * @uses $vars['entity']  Optional. Entity whose tags are being displayed (metadata ->tags)
  10
+ * @uses $vars['list_class'] Optional. Additional classes to be passed to <ul> element
  11
+ * @uses $vars['item_class'] Optional. Additional classes to be passed to <li> elements
  12
+ * @uses $vars['icon_class'] Optional. Additional classes to be passed to tags icon image
10 13
  */
11 14
 
12 15
 if (isset($vars['entity'])) {
@@ -38,9 +41,21 @@
38 41
 		$vars['tags'] = array($vars['tags']);
39 42
 	}
40 43
 
41  
-	echo '<div>';
42  
-	echo elgg_view_icon('tag');
43  
-	echo '<ul class="elgg-tags">';
  44
+	$list_class = "elgg-tags";
  45
+	if (isset($vars['list_class'])) {
  46
+		$list_class = "$list_class {$vars['list_class']}";
  47
+		unset($vars['list_class']);
  48
+	}
  49
+
  50
+	$item_class = "item-tag";
  51
+	if (isset($vars['item_class'])) {
  52
+		$item_class = "$item_class {$vars['item_class']}";
  53
+		unset($vars['item_class']);
  54
+	}
  55
+
  56
+	$icon_class = elgg_extract('icon_class', $vars);
  57
+	$list_items = '<li>' . elgg_view_icon('tag', $icon_class) . '</li>';
  58
+
44 59
 	foreach($vars['tags'] as $tag) {
45 60
 		if (!empty($vars['type'])) {
46 61
 			$type = "&type={$vars['type']}";
@@ -49,11 +64,20 @@
49 64
 		}
50 65
 		$url = elgg_get_site_url() . 'search?q=' . urlencode($tag) . "&search_type=tags{$type}{$subtype}{$object}";
51 66
 		if (is_string($tag)) {
52  
-			echo '<li>';
53  
-			echo elgg_view('output/url', array('href' => $url, 'text' => $tag, 'rel' => 'tag'));
54  
-			echo '</li>';
  67
+			$list_items .= "<li class=\"$item_class\">";
  68
+			$list_items .= elgg_view('output/url', array('href' => $url, 'text' => $tag, 'rel' => 'tag'));
  69
+			$list_items .= '</li>';
55 70
 		}
56 71
 	}
57  
-	echo '</ul>';
58  
-	echo '</div>';
  72
+
  73
+	$list = <<<___HTML
  74
+		<div class="clearfix">
  75
+			<ul class="$list_class">
  76
+				$list_items
  77
+			</ul>
  78
+		</div>
  79
+___HTML;
  80
+
  81
+	echo $list;
59 82
 }
  83
+
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.