actually, they are different -- array_add checks for uniqueness
git-svn-id: file:///home/shish/svn/shimmie2/trunk@232 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
		
							parent
							
								
									7638c8de70
								
							
						
					
					
						commit
						cec93d8a4d
					
				@ -283,6 +283,12 @@ function array_remove($array, $to_remove) {
 | 
				
			|||||||
	return $a2;
 | 
						return $a2;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function array_add($array, $element) { 
 | 
				
			||||||
 | 
						$array[] = $element; 
 | 
				
			||||||
 | 
						$array = array_unique($array); 
 | 
				
			||||||
 | 
						return $array; 
 | 
				
			||||||
 | 
					} 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
 | 
					/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
 | 
				
			||||||
* Event API                                                                 *
 | 
					* Event API                                                                 *
 | 
				
			||||||
 | 
				
			|||||||
@ -136,7 +136,7 @@ class TagListTheme extends Themelet {
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
		else {
 | 
							else {
 | 
				
			||||||
			$tags = array_remove($tags, "-$tag");
 | 
								$tags = array_remove($tags, "-$tag");
 | 
				
			||||||
			$tags = array_push($tags, $tag);
 | 
								$tags = array_add($tags, $tag);
 | 
				
			||||||
			return "<a href='".$this->tag_link(join(' ', $tags))."' title='Add' rel='nofollow'>A</a>";
 | 
								return "<a href='".$this->tag_link(join(' ', $tags))."' title='Add' rel='nofollow'>A</a>";
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
@ -147,7 +147,7 @@ class TagListTheme extends Themelet {
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
		else {
 | 
							else {
 | 
				
			||||||
			$tags = array_remove($tags, $tag);
 | 
								$tags = array_remove($tags, $tag);
 | 
				
			||||||
			$tags = array_push($tags, "-$tag");
 | 
								$tags = array_add($tags, "-$tag");
 | 
				
			||||||
			return "<a href='".$this->tag_link(join(' ', $tags))."' title='Subtract' rel='nofollow'>S</a>";
 | 
								return "<a href='".$this->tag_link(join(' ', $tags))."' title='Subtract' rel='nofollow'>S</a>";
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user