Permalink
Browse files

allow hidding tags with '@' symbol in their name

  • Loading branch information...
wazari972 committed Sep 26, 2014
1 parent 76895e5 commit c21bf0fba1ce24dcc3f844ad46e1592a7646ca50
Showing with 51 additions and 2 deletions.
  1. +12 −1 daos/Items.php
  2. +14 −0 daos/Sources.php
  3. +15 −1 daos/Tags.php
  4. +10 −0 helpers/Authentication.php
@@ -80,6 +80,17 @@ public function get($options = array()) {
$options
);
return $this->backend->get($options);
$items = $this->backend->get($options);
if(!\F3::get('auth')->showHiddenTags()) {
foreach($items as $idx => $item) {
if (strpos($item['tags'], "@") !== false) {
unset($items[$idx]);
}
}
$items = array_values($items);
}
return $items;
}
}
@@ -47,6 +47,20 @@ public function __call($name, $args) {
\F3::get('logger')->log('Unimplemented method for ' . \F3::get('db_type') . ': ' . $name, \ERROR);
}
public function get() {
$sources = $this->backend->get();
if(!\F3::get('auth')->showHiddenTags()) {
foreach($sources as $idx => $source) {
if (strpos($source['tags'], "@") !== false) {
unset($sources[$idx]);
}
}
$sources = array_values($sources);
}
return $sources;
}
/**
* validate new data for a given source
@@ -30,7 +30,21 @@ public function __construct() {
$this->backend = new $class();
parent::__construct();
}
public function get() {
$tags = $this->backend->get();
if(!\F3::get('auth')->showHiddenTags()) {
foreach($tags as $idx => $tag) {
if (strpos($tag['tag'], "@") !== false) {
unset($tags[$idx]);
}
}
$tags = array_values($tags);
}
return $tags;
}
/**
* pass any method call to the backend.
@@ -129,6 +129,16 @@ public function isLoggedin() {
return $this->loggedin;
}
/**
* showHiddenTags
*
* @return bool
*/
public function showHiddenTags() {
return $this->isLoggedin();
}
/**
* logout

0 comments on commit c21bf0f

Please sign in to comment.