コード例 #1
0
ファイル: show_bereich.php プロジェクト: ratbird/hope
$sidebar = Sidebar::get();
$sidebar->setImage('sidebar/seminar-sidebar.png');
$semester = new SelectWidget(_("Semester:"), URLHelper::getURL(), 'select_sem');
foreach (array_reverse(Semester::getAll()) as $one) {
    $semester->addElement(new SelectElement($one->id, $one->name, $one->id == $show_semester));
}
$sidebar->addWidget($semester);
$grouping = new LinksWidget();
$grouping->setTitle(_("Anzeige gruppieren:"));
foreach ($sem_browse_obj->group_by_fields as $i => $field) {
    $grouping->addLink($field['name'], URLHelper::getLink('?', array('group_by' => $i)), $group_by == $i ? "icons/16/red/arr_1right" : "");
}
$sidebar->addWidget($grouping);
if (get_config('EXPORT_ENABLE') && $perm->have_perm("tutor")) {
    $export = new LinksWidget();
    $export->setTitle(_("Daten ausgeben:"));
    if ($level == "s") {
        $export->addLink(_("Diese Daten exportieren"), URLHelper::getLink("export.php", array('range_id' => $SessSemName[1], 'o_mode' => 'choose', 'ex_type' => "veranstaltung", 'xslt_filename' => $SessSemName[0], 'ex_sem' => $show_semester)), Icon::create('download', 'info'));
        $export->addLink(_("Download als Excel Tabelle"), URLHelper::getLink('?send_excel=1&group_by=' . (int) $group_by), Icon::create('file-xls', 'info'));
    }
    if ($level == "sbb") {
        $export->addLink(_("Diese Daten exportieren"), URLHelper::getLink("export.php", array('range_id' => $id, 'o_mode' => 'choose', 'ex_type' => "veranstaltung", 'xslt_filename' => $id, 'ex_sem' => $show_semester)), Icon::create('download', 'info'));
        $export->addLink(_("Download als Excel Tabelle"), URLHelper::getLink('?send_excel=1&group_by=' . (int) $group_by), Icon::create('file-xls', 'info'));
    }
    $sidebar->addWidget($export);
}
?>
<div><?php 
echo $intro_text;
?>
</div>
コード例 #2
0
ファイル: write.php プロジェクト: ratbird/hope
        </table>
    </div>
    <div id="preview" style="display: none;">
        <h4><?php 
echo _("Vorschau");
?>
</h4>
        <p class="message_body"></p>
    </div>

    <div style="text-align: center;" data-dialog-button>
        <?php 
echo \Studip\Button::create(_('Abschicken'), null, array('onclick' => "STUDIP.Messages.checkAdressee();"));
?>
    </div>

</form>

<br>

<?php 
$sidebar = Sidebar::get();
$sidebar->setImage('sidebar/mail-sidebar.png');
if (false && count($tags)) {
    $folderwidget = new LinksWidget();
    $folderwidget->setTitle(_("Verwendete Tags"));
    foreach ($tags as $tag) {
        $folderwidget->addLink(ucfirst($tag), URLHelper::getURL("?", array('tag' => $tag)), null, array('class' => "tag"));
    }
    $sidebar->addWidget($folderwidget, 'folder');
}
コード例 #3
0
ファイル: wiki.inc.php プロジェクト: ratbird/hope
/**
* Returns an infobox string holding information and action links for
* current page.
* If newest version is displayed, infobox includes backlinks.
*
* @param    string  WikiPage name
* @param    bool    Is version displayed latest version?
*
**/
function getShowPageInfobox($keyword, $latest_version)
{
    $versions = getWikiPageVersions($keyword);

    if (!$latest_version) {
        $message = sprintf(_('Sie betrachten eine alte Version, die nicht mehr geändert werden kann. Verwenden Sie dazu die %saktuelle Version%s.'),
                           '<a href="' . URLHelper::getLink('?keyword='.urlencode($keyword)) . '">',
                           '</a>');
        PageLayout::postMessage(MessageBox::info($message));
    }

    $sidebar = Sidebar::get();

    // Table of Contents/QuickLinks
    $widget = new ListWidget();
    $widget->setTitle(_('QuickLinks'));

    $toccont = get_toc_content();
    $toccont_empty = !trim(strip_tags($toccont));
    if ($GLOBALS['perm']->have_studip_perm('autor', $GLOBALS['SessSemName'][1])){
        $extra = sprintf('<a href="%s">%s</a>',
                         URLHelper::getLink('?keyword=toc&view=edit'),
                         $toccont_empty
                             ? Icon::create('add', 'clickable', ['title' => _('erstellen')])->asImg()
                             : Icon::create('edit', 'clickable', ['title' => _('bearbeiten')])->asImg());
        $widget->setExtra($extra);
    }

    $element = new WidgetElement($toccont_empty ? _('Keine QuickLinks vorhanden') : $toccont);
    $element->icon = Icon::create('link-intern', 'clickable');
    $widget->addElement($element);
    $sidebar->addWidget($widget);

    // Backlinks
    if ($latest_version) {
        $widget = new LinksWidget();
        $widget->setTitle(_('Seiten, die auf diese Seite verweisen'));
        foreach(getBacklinks($keyword) as $backlink) {
            $widget->addLink($backlink, URLHelper::getLink('?keyword=' . urlencode($backlink)));
        }
        $sidebar->addWidget($widget);
    }

    // Ansichten
    $widget = new ViewsWidget();
    $widget->addLink(_('Standard'),
                     URLHelper::getLink('?keyword=' . urlencode($keyword) . '&view=show'),
                     Icon::create('wiki', 'clickable'))
           ->setActive(true);
    if (count($versions) >= 1) {
        $widget->addLink(_('Textänderungen anzeigen'),
                         URLHelper::getLink('?keyword=' . urlencode($keyword) . '&view=diff'));
        $widget->addLink(_('Text mit Autor/-innenzuordnung anzeigen'),
                         URLHelper::getLink('?keyword=' . urlencode($keyword) . '&view=combodiff'));
    }
    $sidebar->addWidget($widget);

    // Suche
    $widget = new SearchWidget(URLHelper::getLink('?view=search&keyword=' . urlencode($keyword)));
    $widget->addNeedle(_('Im Wiki suchen'), 'searchfor', true);
    $widget->addFilter(_('Nur in aktuellen Versionen'), 'searchcurrentversions');
    $sidebar->addWidget($widget);

    // Versionen
    if (count($versions) > 0) {
        $widget = new SelectWidget(_('Alte Versionen dieser Seite'),
                                   URLHelper::getLink('?keyword=' . urlencode($keyword)),
                                   'version');
        $widget->addElement(new SelectElement('', _('Aktuelle Version')));
        foreach ($versions as $version) {
            $element = new SelectElement($version['version'],
                                         sprintf(_('Version %u (%s)'),
                                                 $version['version'],
                                                 date('d.m.Y, H:i', $version['chdate'])),
                                         $version['version'] == Request::int('version', 0));
            $widget->addElement($element);
        }
        $sidebar->addWidget($widget);
    }

    // Kommentare
    $widget = new OptionsWidget();
    $widget->setTitle(_('Kommentare'));
    $widget->addRadioButton(_('einblenden'),
                            URLHelper::getLink('?keyword=' . urlencode($keyword) . '&wiki_comments=all'),
                            $GLOBALS['show_wiki_comments'] === 'all');
    $widget->addRadioButton(_('als Icons einblenden'),
                            URLHelper::getLink('?keyword=' . urlencode($keyword) . '&wiki_comments=icon'),
                            $GLOBALS['show_wiki_comments'] === 'icon');
    $widget->addRadioButton(_('ausblenden'),
                            URLHelper::getLink('?keyword=' . urlencode($keyword) . '&wiki_comments=none'),
                            $GLOBALS['show_wiki_comments'] === 'none');
    $sidebar->addWidget($widget, 'comments');

    // Exportfunktionen
    $version = Request::int('version') ?: '';

    $widget = new ExportWidget();
    $widget->addLink(_('Druckansicht'),
                     URLHelper::getLink('?keyword=' . urlencode($keyword) . '&version=' . $version . '&view=wikiprint'),
                     Icon::create('print', 'clickable'),
                     array('target' => '_blank'));
    $widget->addLink(_('PDF-Ausgabe'),
                     URLHelper::getLink('?keyword=' . urlencode($keyword) . '&version=' . $version . '&view=export_pdf'),
                     Icon::create('file-pdf', 'clickable'),
                     array('target' => '_blank'));
    $sidebar->addWidget($widget);

    return array();
}
コード例 #4
0
ファイル: studygroup.php プロジェクト: ratbird/hope
 /**
  * shows details of a studygroup
  *
  * @param string id of a studygroup
  *
  * @return void
  */
 function details_action($id)
 {
     global $perm;
     $studygroup = new Seminar($id);
     if (Request::isXhr()) {
         $this->set_layout(null);
         $this->response->add_header('Content-Type', 'text/html;charset=Windows-1252');
         header('X-Title: ' . _('Studiengruppendetails'));
     } else {
         PageLayout::setTitle(getHeaderLine($id) . ' - ' . _('Studiengruppendetails'));
         PageLayout::setHelpKeyword('Basis.StudiengruppenAbonnieren');
         PageLayout::addSqueezePackage('enrolment');
         $stmt = DBManager::get()->prepare("SELECT * FROM admission_seminar_user" . " WHERE user_id = ? AND seminar_id = ?");
         $stmt->execute(array($GLOBALS['user']->id, $id));
         $data = $stmt->fetch();
         if ($data['status'] == 'accepted') {
             $membership_requested = true;
         }
         if (StudygroupModel::isInvited($GLOBALS['user']->id, $id)) {
             $invited = true;
         }
         $participant = $perm->have_studip_perm('autor', $id);
         if (!preg_match('/^(' . preg_quote($GLOBALS['CANONICAL_RELATIVE_PATH_STUDIP'], '/') . ')?([a-zA-Z0-9_-]+\\.php)([a-zA-Z0-9_?&=-]*)$/', Request::get('send_from_search_page'))) {
             $send_from_search_page = '';
         } else {
             $send_from_search_page = Request::get('send_from_search_page');
         }
         $icon = Icon::create('schedule', 'info');
         if ($GLOBALS['perm']->have_studip_perm('autor', $studygroup->getId()) || $membership_requested) {
             $action = _("Persönlicher Status:");
             if ($membership_requested) {
                 $infotext = _("Mitgliedschaft bereits beantragt!");
             } else {
                 $infolink = URLHelper::getURL('seminar_main.php?auswahl=' . $studygroup->getId());
                 $infotext = _("Direkt zur Studiengruppe");
             }
         } else {
             if ($GLOBALS['perm']->have_perm('admin')) {
                 $action = _("Hinweis:");
                 $infotext = _('Sie sind Admin und können sich daher nicht für Studiengruppen anmelden.');
                 $icon = Icon::create('decline', 'attention');
             } else {
                 $action = _("Aktionen:");
                 $infolink = URLHelper::getScriptURL('dispatch.php/course/enrolment/apply/' . $studygroup->getId());
                 $infolink_options = array('data-dialog' => '');
                 // customize link text if user is invited or group access is restricted
                 if ($invited === true) {
                     $infotext = _("Einladung akzeptieren");
                 } elseif ($studygroup->admission_prelim) {
                     $infotext = _("Mitgliedschaft beantragen");
                 } else {
                     $infotext = _("Studiengruppe beitreten");
                 }
             }
         }
         $sidebar = Sidebar::get();
         $sidebar->setTitle(_("Details"));
         $sidebar->setContextAvatar(StudygroupAvatar::getAvatar($studygroup->id));
         $iwidget = new SidebarWidget();
         $iwidget->setTitle(_("Information"));
         $iwidget->addElement(new WidgetElement(_("Hier sehen Sie weitere Informationen zur Studiengruppe. Außerdem können Sie ihr beitreten/eine Mitgliedschaft beantragen.")));
         $sidebar->addWidget($iwidget);
         $awidget = new LinksWidget();
         $awidget->setTitle($action);
         $awidget->addLink($infotext, $infolink, $icon, $infolink_options);
         if ($send_from_search_page) {
             $awidget->addLink(_("zurück zur Suche"), URLHelper::getURL($send_from_search_page), Icon::create('schedule', 'info'));
         }
         $sidebar->addWidget($awidget);
     }
     $this->studygroup = $studygroup;
 }
コード例 #5
0
ファイル: index.php プロジェクト: ratbird/hope
    $sidebar->addWidget($grouping);
} else {
    $toplist_names = array("dummy",_("Teilnehmeranzahl"), _("die meisten Materialien"), _("aktivste Veranstaltungen"),_("neueste Veranstaltungen"));
    $toplist = new LinksWidget();
    $toplist->setTitle(_("Topliste: ").$toplist_names[$_SESSION['sem_portal']["toplist"] ?: 4]);
    foreach ((array) $toplist_entries as $key => $entry) {
        $toplist->addLink(
            ($key + 1).". ".$entry['name'],
            URLHelper::getURL("dispatch.php/course/details/", array('sem_id' => $entry['seminar_id'],
                'cid' => null,
                'send_from_search' => 1,
                'send_from_search_page' => URLHelper::getUrl(basename($_SERVER['PHP_SELF']), array('cid' => null)))
            ),
            null
        );
    }

    $sidebar->addWidget($toplist);

    $toplist_switcher = new LinksWidget();
    $toplist_switcher->setTitle(_("Weitere Toplisten"));
    foreach (array(4,1,2,3) as $i) {
        $toplist_switcher->addLink(
            $toplist_names[$i],
            URLHelper::getURL("?", array('choose_toplist' => $i)),
            $_SESSION['sem_portal']["toplist"] == $i ? Icon::create("arr_1right", "attention") : null
        );
    }
    $sidebar->addWidget($toplist_switcher);
}