Dient zur Darstellung des Hauses in Form von: * ==> Einer Bio-Seite * ==> Als Zeile einer Übersichts-Tabelle */ class haus_outside extends haus_basic { function haus_outer($in = false, $elseread = true, $toread = array("*")) { parent::haus_basic($in, $elseread, $toread); } function list_row($class = 0, $fields = array('house_nr','name','owner_name','level_name','keys','extensions','bio_link')) { global $wvnav; $wvtxt = & sysTxt::instance(); $str = ''; $tpl = $wvtxt->get('list_field'); if (in_array('bio_link', $fields)) { $link = $wvnav->link('act=show&house_id=' . $this->get('house_id')); $this->set('bio_link', sprintf($wvtxt->get('list_bio_link'), $link)); addnav('', $link); } if(in_array('enter_link', $fields)) { $link = $wvnav->link($this->getEnterLink()); $this->set('enter_link',sprintf($wvtxt->get('list_enter_link'),$link)); addnav('',$link); } foreach($fields as $field) { $str .= sprintf($tpl, $this->get($field)); } return sprintf($wvtxt->get('list_row_'.($class == 0 ? 'dark' : 'light')) , $str); } function bio() { } function canEnter($user=false) { if (!$user) { global $session; $user = $session['user']; } if ($this->get('level') <= 0) { return false; } else { if (is_array($user)) $user = $user['acctid']; $sql = 'SELECT 1 AS `ok` FROM `' . HAUS_KEY_TABLE . '` WHERE `' . HAUS_ID_FIELD . '`='.$this->get(HAUS_ID_FIELD).' AND `acctid`=' . $user . ' LIMIT 1'; $res = dying_query($sql, 'Fehler beim Üperprüfen der Zugangsberechtigung für User "' . $user . '"', __FILE__, __LINE__); return (bool) db_num_rows($res); } } function getEnterLink() { return 'cat=inside&house_id=' . $this->get('house_id'); } } ?>