Ejemplo n.º 1
0
 protected function _canShowByType($access_level)
 {
     // Hide media objects if they are attached to private records
     $linked_ids = WT_DB::prepare("SELECT l_from FROM `##link` WHERE l_to=? AND l_file=?")->execute(array($this->xref, $this->gedcom_id))->fetchOneColumn();
     foreach ($linked_ids as $linked_id) {
         $linked_record = WT_GedcomRecord::getInstance($linked_id);
         if ($linked_record && !$linked_record->canShow($access_level)) {
             return false;
         }
     }
     // ... otherwise apply default behaviour
     return parent::_canShowByType($access_level);
 }
Ejemplo n.º 2
0
 protected function _canShowByType($access_level)
 {
     // Hide sources if they are attached to private repositories ...
     preg_match_all('/\\n1 REPO @(.+)@/', $this->gedcom, $matches);
     foreach ($matches[1] as $match) {
         $repo = WT_Repository::getInstance($match);
         if ($repo && !$repo->canShow($access_level)) {
             return false;
         }
     }
     // ... otherwise apply default behaviour
     return parent::_canShowByType($access_level);
 }