예제 #1
0
 protected function build_mostviewed(rsContainer $Container)
 {
     $Container->subordinate('h2', 'Meist angesehen');
     $List = $Container->subordinate('ul', array('class' => 'mostviewed'));
     foreach ($this->db->get('SELECT * FROM `%TABLE` WHERE `lft` > ' . $this->get_left_value(NAVIGATION) . ' AND `rgt` < ' . $this->get_right_value(NAVIGATION) . ' ORDER BY `count` DESC LIMIT 0,10') as $item) {
         $List->subordinate('li')->subordinate('a', array('href' => '?i=' . $item['id']), $item['name'])->append('span', '(' . $item['count'] . ')');
     }
     return $List;
 }
 protected function build_top(rsContainer $Container)
 {
     $Top = $Container->subordinate('div', array('id' => 'top'));
     $Top->subordinate('a', array('href' => './'))->subordinate('img', array('src' => 'static/images/top_title_clararockt.png', 'id' => 'title'));
     $Top->subordinate('a', array('href' => './'))->subordinate('img', array('src' => 'static/images/csgstamp_white_s.png', 'id' => 'stamp'));
     return $Top;
 }
예제 #3
0
 protected function build_top(rsContainer $Container)
 {
     $Top = $Container->subordinate('div', array('id' => 'top'));
     $Top->subordinate('a', array('href' => './'))->subordinate('img', array('src' => 'static/images/top_logo_sv.png', 'id' => 'logo'));
     $Top->subordinate('a', array('href' => './'))->subordinate('img', array('src' => 'static/images/top_title_sv.png', 'id' => 'title'));
     return $Top;
 }
 protected function list_mymails(rsContainer $Container)
 {
     $Container->subordinate('h2', 'Meine Nachrichten')->subordinate('span', array('class' => 'tablesearch'), 'Nachrichten durchsuchen:')->subordinate('input', array('type' => 'text', 'value' => ''));
     $Form = $Container->subordinate('form', array('method' => 'post', 'action' => '#menu', 'onSubmit' => 'if(!confirm(\'Bist Du sicher, dass Du die markierten Nachrichten l&ouml;schen willst?\'))return false;'));
     $Table = $Form->subordinate('table', array('class' => 'list'));
     $Table->subordinate('thead')->subordinate('tr')->subordinate('th', 'Von')->append('th', 'Betreff')->append('th', array('class' => 'sorted-asc'), 'Datum')->append('th', '&nbsp;');
     $Table = $Table->subordinate('tbody');
     $my_mails = $this->mailsdb->get('SELECT * FROM `%TABLE` WHERE `to` = ' . $this->Benutzer->get('id') . ' ORDER BY `timestamp` DESC');
     foreach ($my_mails as $mail) {
         $userdata = $this->get_userdata($mail['from']);
         if ($mail['gelesen'] == 0) {
             $attributes = array('class' => 'ungelesen');
         }
         $Table->subordinate('tr', $attributes)->subordinate('td', $userdata['vorname'] . " " . $userdata['nachname'])->append('td', $mail['betreff'])->append('td', date('H:i \\/ d.m.Y', $mail['timestamp']))->parent_subordinate('td')->subordinate('input', array('type' => 'checkbox', 'name' => 'f' . $mail['id']));
     }
     $Form->subordinate('p', array('class' => 'tableoptions'))->subordinate('input', array('type' => 'submit', 'name' => 'button', 'value' => 'L&ouml;schen'));
 }
 protected function list_myfiles(rsContainer $Container)
 {
     $Container->subordinate('h2', 'Alle meine Dateien')->subordinate('span', array('class' => 'tablesearch'), 'Dateien durchsuchen:')->subordinate('input', array('type' => 'text', 'value' => ''));
     $Form = $Container->subordinate('form', array('method' => 'post', 'action' => '#menu', 'onSubmit' => 'if(!confirm(\'Bist Du sicher, dass Du die markierten Dateien l&ouml;schen willst?\'))return false;'));
     $Table = $Form->subordinate('table', array('class' => 'list'));
     $Table->subordinate('thead')->subordinate('tr')->subordinate('th', 'Name')->append('th', 'Art')->append('th', 'Beschreibung')->append('th', 'Gr&ouml;&szlig;e')->append('th', array('class' => 'sorted-asc'), 'Datum')->append('th', 'Angeh&auml;ngt an')->append('th', '&nbsp;');
     $Table = $Table->subordinate('tbody');
     $my_files = $this->filesdb->get('SELECT * FROM `%TABLE` WHERE `owner` = ' . $this->Benutzer->get('id') . ' ORDER BY `timestamp` DESC');
     foreach ($my_files as $file) {
         if ($file['attachedto'] == $this->docid) {
             $this->sum_space(filesize('./media/' . $file['filename']));
         }
         $Table->subordinate('tr')->subordinate('td')->subordinate('img', array('src' => 'static/images/symbols/' . strtolower($this->name_filetype(substr($file['filename'], 33))) . '.png'))->subordinate('a', array('href' => '?f=' . $file['id']), $file['title'])->parent()->append('td', $this->name_filetype(substr($file['filename'], 33), true))->append('td', $file['description'] == '' ? '(keine)' : $file['description'])->append('td', $this->decode_size(filesize('./media/' . $file['filename'])))->append('td', date('d.m.Y', $file['timestamp']))->append('td', $file['attachedto'] == $this->docid ? '-' : '<a href="?i=' . $file['attachedto'] . '">' . $this->db->getColumn('name', '`id`=' . $file['attachedto']) . '</a>')->parent_subordinate('td')->subordinate('input', array('type' => 'checkbox', 'name' => 'f' . $file['id']));
     }
     $Form->subordinate('p', array('class' => 'tableoptions'))->subordinate('input', array('type' => 'submit', 'name' => 'button', 'value' => 'L&ouml;schen'));
     $Form->subordinate('div', array('class' => 'progressindicator'))->subordinate('div', array('class' => 'progress', 'style' => 'width: ' . round($this->needed_space / USERSPACE * 100, 0) . '%'))->parent()->append('span', 'Belegter Speicherplatz: ' . $this->decode_size($this->needed_space) . ' von ' . $this->decode_size(USERSPACE));
 }
예제 #6
0
 public function __construct(rsContainer $Container, rsMysql $db, $active_doc = null)
 {
     parent::__construct($db);
     $this->menu_container = $Container->subordinate('ul');
     if ($active_doc) {
         $this->active_doc = $active_doc;
     } else {
         $this->active_doc = parent::detect_requested_page();
     }
 }
예제 #7
0
 protected function build_list_element($doc, rsContainer $List, $show_ids)
 {
     $Li = $List->subordinate('li', array('id' => $doc['id']));
     $LiDiv = $Li->subordinate('div', array('id' => 'div' . $doc['id']));
     $LiDiv->subordinate('a', array('onClick' => 'show_doceditor(' . $doc['id'] . ')'), $doc['name']);
     if ($show_ids) {
         $LiDiv->subordinate('span', array('class' => 'id'), '#' . $doc['id'] . ' (' . $doc['lft'] . '|' . $doc['rgt'] . ')');
     }
     if ($doc['offspring'] > 0) {
         $this->list_branch($doc['id'], $Li->subordinate('ul'), $show_ids);
     }
 }
 protected function subordinate_dir($item, rsContainer $List)
 {
     $Li = $List->subordinate('li', array('class' => 'dir', 'id' => $item['id']));
     $LiDiv = $Li->subordinate('div', array('id' => 'div' . $item['id']));
     if (isset($this->options['dir_link'])) {
         $LiDiv->subordinate('a', $this->options['dir_link'], $item['name']);
     } else {
         $LiDiv->swallow($item['name']);
     }
     if ($this->show_ids) {
         $LiDiv->subordinate('span', array('class' => 'id'), '(' . $item['id'] . ')');
     }
     return $Li;
 }
예제 #9
0
 protected function build_bloglist(rsContainer $Container)
 {
     $Bloglist = $Container->subordinate('ul', array('class' => 'blog list'));
     $first = true;
     foreach ($this->get_sublevel_documents($this->blogdir) as $blogpost) {
         $teaser = explode('<!-- pagebreak -->', $blogpost['content']);
         $teaser = str_replace('<p>', '', str_replace('</p>', '', $teaser[0]));
         $BlogLi = $Bloglist->subordinate('li', array('class' => 'blogpost'));
         if ($first) {
             $BlogLi->add_attribute('class', 'first');
             $first = false;
         }
         $BlogLi->subordinate('a', array('href' => '?i=' . $blogpost['id']))->subordinate('h2', $blogpost['name']);
         $BlogLi->subordinate('div', array('class' => 'teaser'), $teaser)->subordinate('a', array('href' => '?i=' . $blogpost['id']), 'Weiterlesen...');
     }
 }
 protected function build_thirdlevelsubmenu($docid, rsContainer $Li, $alt_select_first = false)
 {
     $Menu = new rsMenu($Li->subordinate('div', array('class' => 'menu thirdlevel')), $this->db);
     $first = true;
     foreach ($this->get_sublevel_documents($docid) as $menuItem) {
         $Li = $Menu->add_doc($menuItem);
         if ($first) {
             $firstLi = $Li;
             $firstId = $menuItem['id'];
             if ($Menu->is_active($menuItem['id'])) {
                 $Menu->select_item($Li, $menuItem['id']);
             }
             $first2 = false;
         }
     }
     if ($alt_select_first && $Menu->get_active() == null) {
         $Menu->select_item($firstLi, $firstId);
         $this->build_thirdlevelsubmenu($Menu->get_active(), $firstLi);
         $this->docid = $firstId;
     }
 }
    protected function build_groupmembers(rsContainer $Tabs, rsContainer $Container)
    {
        $Li = $Tabs->subordinate('li', 'Mitglieder');
        if (isset($_POST['user'])) {
            $this->invite_user(intval($_POST['user']));
            $Li->add_attribute('class', 'selected');
        }
        $Memberlist = $Container->subordinate('ul', array('class' => 'memberlist'));
        foreach ($this->groupmembersdb->get('
			SELECT `%TABLE`.*, `' . DBPREFIX . 'user`.*
			FROM `%TABLE`
			LEFT JOIN `' . DBPREFIX . 'user`
			ON `%TABLE`.`userid` = `' . DBPREFIX . 'user`.`id`
			WHERE `groupid` = ' . $this->groupdata['id'] . '
			ORDER BY `' . DBPREFIX . 'user`.`vorname`, `' . DBPREFIX . 'user`.`nachname`') as $member) {
            $member = $this->userdb->getRow('`id` = ' . $member['userid']);
            $Memberlist->subordinate('li', $member['vorname'] . ' ' . $member['nachname']);
        }
        $InvitationForm = $Container->subordinate('form', array('action' => '?i=' . $this->docid . '&g=' . $this->groupdata['id'], 'method' => 'post'));
        $InvitationForm->subordinate('p', '<div>Benutzer: <span id="foundusername"></span></div>')->subordinate('input', array('type' => 'hidden', 'name' => 'user', 'id' => 'inputfounduserid'))->subordinate('div', array('id' => 'getUser'));
        $InvitationForm->subordinate('input', array('type' => 'submit', 'id' => 'invite', 'value' => 'Benutzer einladen'));
    }
 protected function process_validation(rsContainer $Container)
 {
     $user = $this->userdb->getRow('`aktiv` = 0 AND `id` = ' . intval($_GET['u']));
     $code = sha1($user['id'] . $_GET['email'] . $_GET['geb'] . $user['vorname'] . $_GET['pw']);
     if ($_GET['c'] == $code) {
         $this->userdb->update(array('email' => $_GET['email'], 'passwort' => $_GET['pw'], 'geburtsdatum' => $_GET['geb'], 'registered' => time()), '`id` = ' . $user['id']);
     } else {
         $Container->subordinate('p', array('class' => 'error'), 'Der Link stimmt nicht oder du hast dir mit der Freischaltung zu viel Zeit gelassen.');
         return false;
     }
     $Container->subordinate('h2', 'Deine Kontodaten wurden vervollst&auml;ndigt.')->append('p', 'Jetzt musst du nur noch pers&ouml;nlich bei der SV best&auml;tigen, dass du das Konto eingerichtet hast.');
     return true;
 }
예제 #13
0
 protected function build_marklets(rsContainer $Container)
 {
     $Marklets = $Container->subordinate('div', array('id' => 'marklets'));
     $Marklets->subordinate('a', array('href' => 'http://delicious.com/save', 'onClick' => 'window.open(\'http://delicious.com/save?v=5&noui&jump=close&url=\'+encodeURIComponent(location.href)+\'&title=\'+encodeURIComponent(document.title), \'delicious\',\'toolbar=no,width=550,height=550\'); return false;', 'title' => 'Lesezeichen dieser Seite auf delicious.com speichern'))->subordinate('img', array('src' => 'static/images/delicious.png'));
     $Marklets->subordinate('a', array('href' => '?rss&i=' . $this->docid, 'title' => 'RSS 2.0 Feed dieser Seite abrufen'))->subordinate('img', array('src' => 'static/images/rss.png'));
     $Marklets->subordinate('a', array('href' => 'http://www.facebook.com/pages/Bonn-Germany/Clara-Schumann-Gymnasium-Bonn/300523910014', 'title' => 'Facebook-Seite des Clara-Schumann-Gymnasiums aufrufen'))->subordinate('img', array('src' => 'static/images/facebook.png'));
     $Marklets->subordinate('a', array('href' => 'http://twitter.com/csgbonn', 'title' => 'Twitter-Seite des Clara-Schumann-Gymnasiums aufrufen'))->subordinate('img', array('src' => 'static/images/twitter.png'));
     $Marklets->subordinate('a', array('href' => 'http://www.studivz.net/Suggest/Selection/?u=' . urlencode('http://www.clara-online.de/?i=' . $this->docid) . '&desc=' . urlencode($this->page->get_title()) . '&prov=' . urlencode(SITE_TITLE), 'title' => 'Diese Seite auf Sch&uuml;lerVZ meinen Freunden empfehlen'))->subordinate('img', array('src' => 'static/images/schuelervz.png'));
     $Marklets->subordinate('a', array('href' => 'http://www.schulhomepage.de/topliste/index.php?vote=2623', 'title' => 'F&uuml;r unsere Schulhomepage beim Schulhomepage-Award stimmen'))->subordinate('img', array('src' => 'static/images/award.png'));
 }
 protected function build_mediathek(rsContainer $Container)
 {
     $mediadb = new rsMysql('media');
     $Container->subordinate('h1', 'Mediathek');
     $this->build_dateibaum($Container->subordinate('div', array('class' => 'media tree')), $mediadb);
     $this->build_upload_dialog($Container);
     return $Container;
 }
 protected function build_participating_groups(rsContainer $Container)
 {
     $participating_groups = $this->groupmembersdb->get('SELECT * FROM `%TABLE` WHERE `userid` = ' . $this->Benutzer->get('id'));
     if (count($participating_groups) > 0) {
         $Container->subordinate('p', 'Mitglied in folgenden Gruppen...');
         $Groups = $Container->subordinate('ul');
         foreach ($participating_groups as $row) {
             $groupdata = $this->groupsdb->getRow('`id` = ' . $row['groupid']);
             $Li = $Groups->subordinate('li');
             $Li->subordinate('a', array('href' => '?i=' . $this->docid . '&g=' . $groupdata['id']), $groupdata['name']);
             $Grouppage = new rsPage($groupdata['docid'], $this->groupsdb);
             $Li->subordinate('span', array('class' => ''), $Grouppage->get_description());
         }
     }
 }
 protected function build_groupcreation(rsContainer $Container)
 {
     if (isset($_GET['k']) && $_GET['k'] == 'groupcreation') {
         if (isset($_POST['name']) && $_POST['name'] != '') {
             $groupsdb = new rsMysql('groups');
             $rightsdb = new rsMysql('rights');
             $groupmembersdb = new rsMysql('groupmember');
             $doctree = new rsTree('tree');
             $docid = $doctree->createChild(98);
             $doctree->update(array('name' => $_POST['name']), '`id` = ' . $docid);
             $mediatree = new rsTree('media');
             $mediaid = $mediatree->createChild(1);
             $mediatree->update(array('name' => $_POST['name']), '`id` = ' . $mediaid);
             $groupsdb->insert(array('name' => $_POST['name'], 'leiter' => intval($_POST['leiter']), 'typ' => $_POST['typ'], 'docid' => $docid, 'mediaid' => $mediaid));
             $docids = $rightsdb->getColumn('docid', '`id` = ' . intval($_POST['leiter'])) . ',' . $docid;
             $mediaids = $rightsdb->getColumn('mediaid', '`id` = ' . intval($_POST['leiter'])) . ',' . $mediaid;
             $rightsdb->update_insert(array('docid' => $docids, 'mediaid' => ',' . $mediaids), array('userid' => intval($_POST['leiter'])), '`userid` = ' . intval($_POST['leiter']));
             $groupmembersdb->update_insert(array('groupid' => $this->groupdata['id'], 'userid' => $userid), '`userid` = ' . $userid . ' AND `groupid` =' . $this->groupdata['id']);
             $Container->subordinate('p', array('class' => 'success'), 'Die Gruppe &quot;' . $_POST['name'] . '&quot; wurde eingerichtet.');
         }
         $Container = $Container->subordinate('form', array('method' => 'post'));
         $Container->subordinate('p', '<div>Gruppenname:</div>')->subordinate('input', array('type' => 'text', 'name' => 'name'));
         $Container->subordinate('p', '<div>Leiter: <span id="foundusername"></span></div>')->subordinate('input', array('type' => 'hidden', 'name' => 'leiter', 'id' => 'inputfounduserid'))->subordinate('div', array('id' => 'getUser'));
         $Typ = $Container->subordinate('p', '<div>Gruppen-Typ:</div>')->subordinate('select', array('name' => 'typ'));
         $Typ->subordinate('option', array('value' => 'klasse'), 'Klasse');
         $Typ->subordinate('option', array('value' => 'kurs'), 'Kurs');
         $Typ->subordinate('option', array('value' => 'ag'), 'AG / Sonstige');
         $Container->subordinate('p', '<div></div>')->subordinate('input', array('type' => 'submit', 'value' => 'Einrichten'))->subordinate('input', array('type' => 'button', 'onClick' => 'document.location.href=\'?i=' . $this->docid . '&j=administration\'', 'value' => 'Abbrechen'));
     } elseif (!isset($_GET['k'])) {
         $this->build_adminpanel('Gruppen', 'group_icon.png', array(array('label' => 'Neue Gruppe gr&uuml;nden', 'action' => 'location.href=\'?i=' . $this->docid . '&j=administration&k=groupcreation\'')), $Container);
     }
 }
 protected function build_setup(rsContainer $Container)
 {
     $Container->subordinate('h2', 'Konto einrichten');
     if ($this->setup_is_valid() && $this->setup_processed()) {
         $Container->subordinate('p', 'Alles klar! Best&auml;tige nun nur noch Deine eMail-Adresse!');
     } else {
         if (isset($_POST['email']) && !$this->setup_is_valid()) {
             $Error = $Container->subordinate('ul', array('class' => 'error'));
             if (!$this->email_is_valid($_POST['email'])) {
                 $Error->subordinate('li', 'Deine eingegebene eMail-Adresse ist nicht richtig.');
             }
             if (!$this->password_is_valid($_POST['pw'], $_POST['pw2'])) {
                 $Error->subordinate('li', 'Dein neues Passwort ist nicht richtig. Du musst 2x das Gleiche eingeben und Dein neues Passwort muss mindestens 6 Zeichen lang sein.');
             }
             if (!$this->date_is_valid($_POST['geb'])) {
                 $Error->subordinate('li', 'Dein Geburtsdatum ist nicht richtig. Gib zuerst den Tag, dann den Monat und dann das Jahr an (z.B. 22.06.1996).');
             }
         }
         $Form = $Container->subordinate('form', array('method' => 'post'));
         $Table = $Form->subordinate('table');
         $Table->subordinate('tr')->subordinate('td', 'eMail-Adresse:')->parent_subordinate('td')->subordinate('input', array('type' => 'text', 'name' => 'email', 'value' => htmlentities($_POST['email'])));
         $Table->subordinate('tr')->subordinate('td', '&nbsp')->append('td', '&nbsp;');
         $Table->subordinate('tr')->subordinate('td', 'Neues Passwort (min. 6 Stellen):')->parent_subordinate('td')->subordinate('input', array('type' => 'password', 'name' => 'pw', 'value' => htmlentities($_POST['pw'])));
         $Table->subordinate('tr')->subordinate('td', 'Neues Passwort wiederholen:')->parent_subordinate('td')->subordinate('input', array('type' => 'password', 'name' => 'pw2', 'value' => htmlentities($_POST['pw2'])));
         $Table->subordinate('tr')->subordinate('td', '&nbsp')->append('td', '&nbsp;');
         $Table->subordinate('tr')->subordinate('td', 'Geburtstag:')->parent_subordinate('td')->subordinate('input', array('type' => 'text', 'name' => 'geb', 'value' => htmlentities($_POST['geb']), 'class' => 'datum'));
         $Form->subordinate('p')->subordinate('input', array('type' => 'submit', 'value' => 'Fertig'));
     }
 }
 protected function build_success(rsContainer $Container)
 {
     $Container->subordinate('p')->subordinate('b', 'Vielen Dank! Wir werden schnellstm&ouml;glich antworten.');
 }
예제 #19
0
 protected function build_postlist(rsContainer $Container)
 {
     $Container->subordinate('h2', 'G&auml;stebuch-Eintr&auml;ge');
     $start = isset($_GET['start']) ? intval($_GET['start']) : 0;
     $postdb = new rsMysql('guestbook');
     $entries = $postdb->get('SELECT * FROM  `%TABLE` WHERE `valid` = "1" ORDER BY `id` DESC LIMIT ' . $start . ' , ' . ($start + $this->entries_per_page));
     $Postlist = $Container->subordinate('ul', array('class' => 'guestbook list'));
     foreach ($entries as $entry) {
         $PostLi = $Postlist->subordinate('li');
         $PostLi->subordinate('div', array('class' => 'meta'), $entry['name'])->subordinate('br')->subordinate('span', array('class' => 'date'), '(' . date('d.m.Y', $entry['timestamp']) . ')')->parent_subordinate('br')->swallow($this->is_author($entry) ? ' [<a href="?i=' . $this->docid . '&delete=' . $entry['id'] . '">Eintrag l&ouml;schen</a>]' : '');
         $PostLi->subordinate('p', array('class' => 'post text'), $entry['text']);
     }
 }