aboutsummaryrefslogtreecommitdiff
path: root/lib/include/header.php
diff options
context:
space:
mode:
authorJan-Hendrik Willms <tleilax+github@gmail.com>2021-07-22 16:07:19 +0200
committerJan-Hendrik Willms <tleilax+github@gmail.com>2021-07-22 16:19:12 +0200
commita3da1483a9e689846179159355badfec8073dbec (patch)
tree770dcca6bdf5f6f2a11b0e7fcbbeda6919a3fc52 /lib/include/header.php
current code from svn, revision 62608
Diffstat (limited to 'lib/include/header.php')
-rw-r--r--lib/include/header.php61
1 files changed, 61 insertions, 0 deletions
diff --git a/lib/include/header.php b/lib/include/header.php
new file mode 100644
index 0000000..5a90479
--- /dev/null
+++ b/lib/include/header.php
@@ -0,0 +1,61 @@
+<?php
+# Lifter002: TODO
+# Lifter007: TODO
+# Lifter003: TODO
+# Lifter010: TODO
+/**
+ * head line of Stud.IP
+ *
+ * @author Stefan Suchi <suchi@data-quest.de>
+ * @author Michael Riehemann <michael.riehemann@uni-oldenburg.de>
+ * @author Ralf Stockmann <rstockm@gwdg.de>
+ * @license GPL2 or any later version
+ * @access public
+ * @modulegroup visual
+ * @module header.php
+ * @package studip_core
+ */
+
+/* ---
+ * Mögliche Datenschutz-/Sichtbarkeitsentscheidung: Beim ersten Login wird ein
+ * informierender Text mit Entscheidungsmöglichkeit: "Ich will sichtbar sein" oder
+ * "Ich will unsichtbar sein" angezeigt.
+ *
+ * Bei Nutzung dieser Funktion unbedingt die Texte unter locale/de/LC_HELP/visibility_decision.php bzw.
+ * locale/en/LC_HELP/visibility_decision.php an die lokalen Verhältnisse anpassen!
+ */
+if (PageLayout::isHeaderEnabled()) //Einige Seiten benötigen keinen Header, sprich Navigation (Evaluation usw.)
+{
+ $header_template = $GLOBALS['template_factory']->open('header');
+ $header_template->current_page = PageLayout::getTitle();
+ $header_template->link_params = array_fill_keys(array_keys(URLHelper::getLinkParams()), NULL);
+
+ if (is_object($GLOBALS['user']) && $GLOBALS['user']->id != 'nobody') {
+ // only mark course if user is logged in and free access enabled
+ $is_public_course = Context::isCourse() && Config::get()->ENABLE_FREE_ACCESS;
+ $is_public_institute = Context::isInstitute()
+ && Config::get()->ENABLE_FREE_ACCESS
+ && Config::get()->ENABLE_FREE_ACCESS != 'courses_only';
+ if (($is_public_course || $is_public_institute) &&
+ Navigation::hasItem('/course') && Navigation::getItem('/course')->isActive()) {
+ // indicate to the template that this course is publicly visible
+ // need to handle institutes separately (always visible)
+ if (Context::isInstitute()) {
+ $header_template->public_hint = _('öffentliche Einrichtung');
+ } else if (Course::findCurrent()->lesezugriff == 0) {
+ $header_template->public_hint = _('öffentliche Veranstaltung');
+ }
+ }
+ if ($GLOBALS['user']->cfg->ACCESSKEY_ENABLE) {
+ $header_template->accesskey_enabled = true;
+ }
+
+ if (!$GLOBALS['user']->needsToAcceptTerms()) {
+ $header_template->show_quicksearch = true;
+ }
+ }
+} else {
+ $header_template = $GLOBALS['template_factory']->open('noheader');
+}
+
+echo $header_template->render();