public function afterStoreCallback()
 {
     if ($this->isDirty()) {
         //add notification to writer of review
         if (!$this->review['host_id'] && $this->review['user_id'] !== $this['user_id']) {
             PersonalNotifications::add($this->review['user_id'], URLHelper::getURL("plugins.php/lernmarktplatz/market/discussion/" . $this['review_id'] . "#comment_" . $this->getId()), sprintf(_("%s hat einen Kommentar zu Ihrem Review geschrieben."), $this['host_id'] ? LernmarktplatzUser::find($this['user_id'])->name : get_fullname($this['user_id'])), "comment_" . $this->getId(), Icon::create("support", "clickable"));
         }
         //add notification to all users of this servers who discussed this review but are neither the new
         //commentor nor the writer of the review
         $statement = DBManager::get()->prepare("\n                SELECT user_id\n                FROM lernmarktplatz_comments\n                WHERE review_id = :review_id\n                    AND host_id IS NULL\n                GROUP BY user_id\n            ");
         $statement->execute(array('review_id' => $this->review->getId()));
         foreach ($statement->fetchAll(PDO::FETCH_COLUMN, 0) as $user_id) {
             if (!in_array($user_id, array($this->review['user_id'], $this['user_id']))) {
                 PersonalNotifications::add($user_id, URLHelper::getURL("plugins.php/lernmarktplatz/market/discussion/" . $this['review_id'] . "#comment_" . $this->getId()), sprintf(_("%s hat auch einen Kommentar geschrieben."), $this['host_id'] ? LernmarktplatzUser::find($this['user_id'])->name : get_fullname($this['user_id'])), "comment_" . $this->getId(), Icon::create("support", "clickable"));
             }
         }
         //only push if the comment is from this server and the material-server is different
         if (!$this['host_id']) {
             $myHost = LernmarktplatzHost::thisOne();
             $data = array();
             $data['host'] = array('name' => $myHost['name'], 'url' => $myHost['url'], 'public_key' => $myHost['public_key']);
             $data['data'] = $this->toArray();
             $data['data']['foreign_comment_id'] = $data['data']['comment_id'];
             unset($data['data']['comment_id']);
             unset($data['data']['id']);
             unset($data['data']['user_id']);
             unset($data['data']['host_id']);
             $user_description_datafield = DataField::find(get_config("LERNMARKTPLATZ_USER_DESCRIPTION_DATAFIELD")) ?: DataField::findOneBySQL("name = ?", array(get_config("LERNMARKTPLATZ_USER_DESCRIPTION_DATAFIELD")));
             if ($user_description_datafield) {
                 $datafield_entry = DatafieldEntryModel::findOneBySQL("range_id = ? AND datafield_id = ?", array($this['user_id'], $user_description_datafield->getId()));
             }
             $data['user'] = array('user_id' => $this['user_id'], 'name' => get_fullname($this['user_id']), 'avatar' => Avatar::getAvatar($this['user_id'])->getURL(Avatar::NORMAL), 'description' => $datafield_entry ? $datafield_entry['content'] : null);
             $statement = DBManager::get()->prepare("\n                    SELECT host_id\n                    FROM lernmarktplatz_comments\n                    WHERE review_id = :review_id\n                        AND host_id IS NOT NULL\n                    GROUP BY host_id\n                ");
             $statement->execute(array('review_id' => $this->review->getId()));
             $hosts = $statement->fetchAll(PDO::FETCH_COLUMN, 0);
             if ($this->review['host_id'] && !in_array($this->review['host_id'], $hosts)) {
                 $hosts[] = $this->review['host_id'];
             }
             if ($this->review->material['host_id'] && !in_array($this->review->material['host_id'], $hosts)) {
                 $hosts[] = $this->review->material['host_id'];
             }
             foreach ($hosts as $host_id) {
                 $remote = new LernmarktplatzHost($host_id);
                 if (!$remote->isMe()) {
                     $review_id = $this->review['foreign_review_id'] ?: $this->review->getId();
                     if ($this->review['foreign_review_id']) {
                         if ($this->review->host_id === $remote->getId()) {
                             $host_hash = null;
                         } else {
                             $host_hash = md5($this->review->host['public_key']);
                         }
                     } else {
                         $host_hash = md5($myHost['public_key']);
                     }
                     $remote->pushDataToEndpoint("add_comment/" . $review_id . "/" . $host_hash, $data);
                 }
             }
         }
     }
 }
Esempio n. 2
0
 public function testGetURL()
 {
     URLHelper::addLinkParam('null', NULL);
     URLHelper::addLinkParam('empty', array());
     URLHelper::addLinkParam('foo', 'bar');
     $url = 'abc?a=b&c=d#top';
     $expected = 'abc?foo=bar&a=b&c=d#top';
     $this->assertEquals($expected, URLHelper::getURL($url));
     $url = 'abc#top';
     $params = array('a' => 'b', 'c' => 'd');
     $expected = 'abc?foo=bar&a=b&c=d#top';
     $this->assertEquals($expected, URLHelper::getURL($url, $params));
     $url = 'abc?foo=test';
     $expected = 'abc?foo=test';
     $this->assertEquals($expected, URLHelper::getURL($url));
     $url = 'abc';
     $params = array('foo' => 'test');
     $expected = 'abc?foo=test';
     $this->assertEquals($expected, URLHelper::getURL($url, $params));
     $url = 'abc?baz=on';
     $params = array('baz' => 'off');
     $expected = 'abc?foo=bar&baz=off';
     $this->assertEquals($expected, URLHelper::getURL($url, $params));
     $url = 'abc?foo=baz';
     $params = array('foo' => 'test');
     $expected = 'abc?foo=test';
     $this->assertEquals($expected, URLHelper::getURL($url, $params));
 }
 public function afterStoreCallback()
 {
     if (!$this->material['host_id'] && $this->material['user_id'] !== $GLOBALS['user']->id) {
         PersonalNotifications::add($this->material['user_id'], URLHelper::getURL("plugins.php/lernmarktplatz/market/details/" . $this->material->getId() . "#review_" . $this->getId()), $this->isNew() ? sprintf(_("%s hat ein Review zu '%s' geschrieben."), $this['host_id'] ? LernmarktplatzUser::find($this['user_id'])->name : get_fullname($this['user_id']), $this->material['name']) : sprintf(_("%s hat ein Review zu '%s' verändert."), $this['host_id'] ? LernmarktplatzUser::find($this['user_id'])->name : get_fullname($this['user_id']), $this->material['name']), "review_" . $this->getId(), Icon::create("support", "clickable"));
     }
     //only push if the comment is from this server and the material-server is different
     if ($this->material['host_id'] && !$this['host_id'] && $this->isDirty()) {
         $remote = new LernmarktplatzHost($this->material['host_id']);
         $myHost = LernmarktplatzHost::thisOne();
         $data = array();
         $data['host'] = array('name' => $myHost['name'], 'url' => $myHost['url'], 'public_key' => $myHost['public_key']);
         $data['data'] = $this->toArray();
         $data['data']['foreign_review_id'] = $data['data']['review_id'];
         unset($data['data']['review_id']);
         unset($data['data']['id']);
         unset($data['data']['user_id']);
         unset($data['data']['host_id']);
         $user_description_datafield = DataField::find(get_config("LERNMARKTPLATZ_USER_DESCRIPTION_DATAFIELD")) ?: DataField::findOneBySQL("name = ?", array(get_config("LERNMARKTPLATZ_USER_DESCRIPTION_DATAFIELD")));
         if ($user_description_datafield) {
             $datafield_entry = DatafieldEntryModel::findOneBySQL("range_id = ? AND datafield_id = ?", array($this['user_id'], $user_description_datafield->getId()));
         }
         $data['user'] = array('user_id' => $this['user_id'], 'name' => get_fullname($this['user_id']), 'avatar' => Avatar::getAvatar($this['user_id'])->getURL(Avatar::NORMAL), 'description' => $datafield_entry ? $datafield_entry['content'] : null);
         if (!$remote->isMe()) {
             $remote->pushDataToEndpoint("add_review/" . $this->material['foreign_material_id'], $data);
         }
     }
 }
Esempio n. 4
0
 public function overview_action()
 {
     Navigation::activateItem("/admin/locations/sem_classes");
     if (count($_POST) && Request::submitted('delete') && Request::get("delete_sem_class")) {
         $sem_class = $GLOBALS['SEM_CLASS'][Request::get("delete_sem_class")];
         if ($sem_class->delete()) {
             PageLayout::postMessage(MessageBox::success(_("Veranstaltungskategorie wurde gelöscht.")));
             $GLOBALS['SEM_CLASS'] = SemClass::refreshClasses();
         }
     }
     if (count($_POST) && Request::get("add_name")) {
         $statement = DBManager::get()->prepare("SELECT 1 FROM sem_classes WHERE name = :name");
         $statement->execute(array('name' => Request::get("add_name")));
         $duplicate = $statement->fetchColumn();
         if ($duplicate) {
             $message = sprintf(_("Es existiert bereits eine Veranstaltungskategorie mit dem Namen \"%s\""), Request::get("add_name"));
             PageLayout::postMessage(MessageBox::error($message));
             $this->redirect('admin/sem_classes/overview');
         } else {
             $statement = DBManager::get()->prepare("INSERT INTO sem_classes SET name = :name, mkdate = UNIX_TIMESTAMP(), chdate = UNIX_TIMESTAMP() " . "");
             $statement->execute(array('name' => Request::get("add_name")));
             $id = DBManager::get()->lastInsertId();
             if (Request::get("add_like")) {
                 $sem_class = clone $GLOBALS['SEM_CLASS'][Request::get("add_like")];
                 $sem_class->set('name', Request::get("add_name"));
                 $sem_class->set('id', $id);
                 $sem_class->store();
             }
             $this->redirect(URLHelper::getURL($this->url_for('admin/sem_classes/details'), array('id' => $id)));
             PageLayout::postMessage(MessageBox::success(_("Veranstaltungskategorie wurde erstellt.")));
             $GLOBALS['SEM_CLASS'] = SemClass::refreshClasses();
         }
     }
 }
Esempio n. 5
0
 function getIconNavigation($course_id, $last_visit, $user_id)
 {
     if (get_config('SCM_ENABLE')) {
         $navigation = new Navigation(_('Ablaufplan'), URLHelper::getURL("seminar_main.php", array('auswahl' => $course_id, 'redirect_to' => "dispatch.php/course/dates")));
         $navigation->setImage(Icon::create('schedule', 'inactive'));
         return $navigation;
     } else {
         return null;
     }
 }
Esempio n. 6
0
 /**
  * load help content from db
  */
 public function loadContent()
 {
     $help_content = HelpContent::getContentByRoute();
     foreach ($help_content as $row) {
         $this->addPlainText($row['label'] ?: '', $this->interpolate($row['content'], $this->variables), $row['icon'] ? Icon::create($row['icon'], 'info_alt') : null, URLHelper::getURL('dispatch.php/help_content/edit/' . $row['content_id']), URLHelper::getURL('dispatch.php/help_content/delete/' . $row['content_id']));
     }
     if (!count($help_content) && $this->help_admin) {
         $this->addPlainText('', '', null, null, null, URLHelper::getURL('dispatch.php/help_content/edit/new' . '?help_content_route=' . get_route()));
     }
 }
Esempio n. 7
0
 public function getURL($absolute_url = false)
 {
     if ($absolute_url) {
         $old_base = URLHelper::setBaseURL($GLOBALS['ABSOLUTE_URI_STUDIP']);
     }
     $url = URLHelper::getURL("plugins.php/pluginmarket/presenting/image/" . $this->getId(), array(), true);
     if ($absolute_url) {
         URLHelper::setBaseURL($old_base);
     }
     return $url;
 }
 public function show_document_avatar($eventname, $search_item)
 {
     if ($search_item->type === "document") {
         $db = DBManager::get();
         $dokument = $db->query("SELECT * FROM dokumente WHERE dokument_id = " . $db->quote($search_item->entry_id))->fetch(PDO::FETCH_ASSOC);
         $extension = strtolower(substr($dokument['name'], strrpos($dokument['name'], ".") + 1));
         if (in_array($extension, array("jpg", "jpeg", "gif", "png", "bmp"))) {
             $search_item->avatar = URLHelper::getURL("sendfile.php", array('type' => $dokument['url'] ? 6 : 0, 'file_id' => $search_item->entry_id, 'file_name' => $dokument['name']));
         }
         $search_item->tools[] = '<a href="' . URLHelper::getURL("sendfile.php", array('force_download' => 1, 'type' => $dokument['url'] ? 6 : 0, 'file_id' => $search_item->entry_id, 'file_name' => $name)) . '">' . Assets::img("icons/16/blue/download.png") . "</a>";
     }
 }
 /**
  * Applikationsübergreifender before_filter mit Trick:
  *
  * Controller-Methoden, die mit "before" anfangen werden in
  * Quellcode-Reihenfolge als weitere before_filter ausgeführt.
  * Geben diese FALSE zurück, bricht Trails genau wie beim normalen
  * before_filter ab.
  */
 function before_filter(&$action, &$args)
 {
     $this->plugin_path = URLHelper::getURL($this->dispatcher->plugin->getPluginPath());
     list($this->plugin_path) = explode("?cid=", $this->plugin_path);
     # call before filters
     foreach (get_class_methods($this) as $filter) {
         if ($filter !== "before_filter" && !strncasecmp("before", $filter, 6)) {
             if (FALSE === call_user_func(array($this, $filter), $action, $args)) {
                 return FALSE;
             }
         }
     }
 }
Esempio n. 10
0
 /**
  * URL to given avatar, if there is a customized avatar. And for anonymous
  * authors this geturns a url to gravatar.
  * @param Avatar-sizes (constan, see there) $size
  * @param string $ext
  * @return string url
  */
 function getURL($size, $ext = 'png')
 {
     $this->checkAvatarVisibility();
     if ($this->is_customized()) {
         return $this->getCustomAvatarUrl($size, $ext);
     } else {
         $contact = new BlubberExternalContact($this->user_id);
         $email = $contact['mail_identifier'];
         $email_hash = md5(strtolower(trim($email)));
         $width = $this->getDimension($size);
         return URLHelper::getURL("http://www.gravatar.com/avatar/" . $email_hash, array('s' => max(array($width[0], $width[1])), 'd' => $this->getNobody()->getCustomAvatarUrl($size, $ext)), true);
     }
 }
Esempio n. 11
0
 /**
  * Initialize the subnavigation of this item. This method
  * is called once before the first item is added or removed.
  */
 public function initSubNavigation()
 {
     global $auth, $perm;
     parent::initSubNavigation();
     $username = $auth->auth['uname'];
     // news
     $navigation = new Navigation(_('Ankündigungen'), 'dispatch.php/news/admin_news');
     $this->addSubNavigation('news', $navigation);
     // votes and tests, evaluations
     if (get_config('VOTE_ENABLE')) {
         $navigation = new Navigation(_('Fragebögen'), URLHelper::getURL("dispatch.php/questionnaire/overview"));
         $this->addSubNavigation('questionnaire', $navigation);
         $navigation = new Navigation(_('Evaluationen'), 'admin_evaluation.php', array('rangeID' => $username));
         $this->addSubNavigation('evaluation', $navigation);
     }
     // literature
     if (get_config('LITERATURE_ENABLE')) {
         if ($perm->have_perm('admin')) {
             $navigation = new Navigation(_('Literaturübersicht'), 'admin_literatur_overview.php');
             $this->addSubNavigation('literature', $navigation);
             $navigation->addSubNavigation('overview', new Navigation(_('Literaturübersicht'), 'admin_literatur_overview.php'));
             $navigation->addSubNavigation('edit_list', new Navigation(_('Literatur bearbeiten'), 'dispatch.php/literature/edit_list?_range_id=self'));
             $navigation->addSubNavigation('search', new Navigation(_('Literatur suchen'), 'dispatch.php/literature/search?return_range=self'));
         } elseif (get_config('LITERATURE_ENABLE')) {
             $navigation = new Navigation(_('Literatur'), 'dispatch.php/literature/edit_list.php', array('_range_id' => 'self'));
             $this->addSubNavigation('literature', $navigation);
             $navigation->addSubNavigation('edit_list', new Navigation(_('Literatur bearbeiten'), 'dispatch.php/literature/edit_list?_range_id=self'));
             $navigation->addSubNavigation('search', new Navigation(_('Literatur suchen'), 'dispatch.php/literature/search?return_range=self'));
         }
     }
     // elearning
     if (get_config('ELEARNING_INTERFACE_ENABLE')) {
         $navigation = new Navigation(_('Lernmodule'), 'dispatch.php/elearning/my_accounts');
         $this->addSubNavigation('my_elearning', $navigation);
     }
     // export
     if (get_config('EXPORT_ENABLE') && $perm->have_perm('tutor')) {
         $navigation = new Navigation(_('Export'), 'export.php');
         $this->addSubNavigation('export', $navigation);
     }
     if ($perm->have_perm('admin') || $perm->have_perm('dozent') && get_config('ALLOW_DOZENT_COURSESET_ADMIN')) {
         $navigation = new Navigation(_('Anmeldesets'), 'dispatch.php/admission/courseset/index');
         $this->addSubNavigation('coursesets', $navigation);
         $navigation->addSubNavigation('sets', new Navigation(_('Anmeldesets verwalten'), 'dispatch.php/admission/courseset/index'));
         $navigation->addSubNavigation('userlists', new Navigation(_('Personenlisten'), 'dispatch.php/admission/userlist/index'));
         $navigation->addSubNavigation('restricted_courses', new Navigation(_('teilnahmebeschränkte Veranstaltungen'), 'dispatch.php/admission/restricted_courses'));
     }
 }
Esempio n. 12
0
 function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     $course_id = Request::option('cid');
     if (isset($_SESSION['seminar_change_view_' . $course_id])) {
         unset($_SESSION['seminar_change_view_' . $course_id]);
         // Reset simulated view, redirect to administration page.
         $this->redirect(URLHelper::getURL('dispatch.php/course/management'));
     } elseif (get_object_type($course_id, array('sem')) && !SeminarCategories::GetBySeminarId($course_id)->studygroup_mode && in_array($GLOBALS['perm']->get_studip_perm($course_id), words('tutor dozent'))) {
         // Set simulated view, redirect to overview page.
         $_SESSION['seminar_change_view_' . $course_id] = 'autor';
         $this->redirect(URLHelper::getURL('seminar_main.php'));
     } else {
         throw new Trails_Exception(400);
     }
 }
Esempio n. 13
0
 /**
  * common tasks for all actions
  */
 function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     $this->course_id = $args[0];
     if (!in_array($action, words('apply claim delete order_down order_up'))) {
         $this->redirect($this->url_for('/apply/' . $action));
         return false;
     }
     if (!get_object_type($this->course_id, array('sem'))) {
         throw new Trails_Exception(400);
     }
     $course = Seminar::GetInstance($this->course_id);
     $enrolment_info = $course->getEnrolmentInfo($GLOBALS['user']->id);
     //Ist bereits Teilnehmer/Admin/freier Zugriff -> gleich weiter
     if ($enrolment_info['enrolment_allowed'] && (in_array($enrolment_info['cause'], words('root courseadmin member')) || $enrolment_info['cause'] == 'free_access' && $GLOBALS['user']->id == 'nobody')) {
         $redirect_url = UrlHelper::getUrl('seminar_main.php', array('auswahl' => $this->course_id));
         if (Request::isXhr()) {
             $this->response->add_header('X-Location', $redirect_url);
             $this->render_nothing();
         } else {
             $this->redirect($redirect_url);
         }
         return false;
     }
     //Grundsätzlich verboten
     if (!$enrolment_info['enrolment_allowed']) {
         throw new AccessDeniedException($enrolment_info['description']);
     }
     PageLayout::setTitle($course->getFullname() . " - " . _("Veranstaltungsanmeldung"));
     PageLayout::addSqueezePackage('enrolment');
     if (Request::isXhr()) {
         $this->set_layout(null);
         $this->response->add_header('X-No-Buttons', 1);
         $this->response->add_header('X-Title', PageLayout::getTitle());
         $request = Request::getInstance();
         foreach ($request as $key => $value) {
             $request[$key] = studip_utf8decode($value);
         }
     } else {
         $this->set_layout($GLOBALS['template_factory']->open('layouts/base'));
     }
     $this->set_content_type('text/html;charset=windows-1252');
     if (Request::submitted('cancel')) {
         $this->redirect(URLHelper::getURL('dispatch.php/course/details/', array('sem_id' => $this->course_id)));
     }
 }
Esempio n. 14
0
 public function __construct()
 {
     $this->tour_data = HelpTour::getHelpbarTourData();
     foreach ($this->tour_data['tours'] as $index => $tour) {
         $element = new LinkElement($tour->name, URLHelper::getURL('?tour_id=' . $tour->tour_id));
         $visit_state = HelpTourUser::find(array($tour->tour_id, $GLOBALS['user']->id));
         if ($visit_state === null) {
             $element->addClass('tour-new');
         } elseif (!$visit_state->completed) {
             $element->addClass('tour-paused');
         } else {
             $element->addClass('tour-completed');
         }
         $element->addClass('tour_link');
         $element['id'] = $tour->tour_id;
         $this->addElement($element);
     }
 }
Esempio n. 15
0
<? endif; ?>

<?php 
$sidebar = Sidebar::get();
$sidebar->setImage('sidebar/mail-sidebar.png');
$actions = new ActionsWidget();
$actions->addLink(_("Neue Nachricht schreiben"), $controller->url_for('messages/write'), Icon::create('mail+add', 'clickable'), array('data-dialog' => 'width=650;height=600'));
if (Navigation::getItem('/messaging/messages/inbox')->isActive() && $messages) {
    $actions->addLink(_('Alle als gelesen markieren'), $controller->url_for('messages/overview', array('read_all' => 1)), Icon::create('accept', 'clickable'));
}
$actions->addLink(_('Ausgewählte Nachrichten löschen'), "#", Icon::create('trash', 'clickable'), array('onclick' => "if (window.confirm('Wirklich %s Nachrichten löschen?'.toLocaleString().replace('%s', jQuery('#bulk tbody :checked').length))) { jQuery('#bulk').submit(); } return false;"));
$sidebar->addWidget($actions);
$search = new SearchWidget(URLHelper::getLink('?'));
$search->addNeedle(_('Nachrichten durchsuchen'), 'search', true);
$search->addFilter(_('Betreff'), 'search_subject');
$search->addFilter(_('Inhalt'), 'search_content');
$search->addFilter(_('Autor/-in'), 'search_autor');
$sidebar->addWidget($search);
$folderwidget = new ViewsWidget();
$folderwidget->forceRendering();
$folderwidget->title = _('Schlagworte');
$folderwidget->id = 'messages-tags';
$folderwidget->addLink(_("Alle Nachrichten"), URLHelper::getURL("?"), null, array('class' => "tag"))->setActive(!Request::submitted("tag"));
if (empty($tags)) {
    $folderwidget->style = 'display:none';
} else {
    foreach ($tags as $tag) {
        $folderwidget->addLink(ucfirst($tag), URLHelper::getURL("?", array('tag' => $tag)), null, array('class' => "tag"))->setActive(Request::get("tag") === $tag);
    }
}
$sidebar->addWidget($folderwidget);
Esempio n. 16
0
 /**
  * Return the current URL associated with this navigation item.
  * If not URL is set but there are subnavigation items, the URL
  * of the first visible subnavigation item is returned.
  *
  * @return string   url of item or NULL (no URL set)
  */
 public function getURL()
 {
     if ($this->initialized === false) {
         $this->initItem();
     }
     if (isset($this->url)) {
         if (isset($this->params)) {
             return URLHelper::getURL($this->url, $this->params);
         } else {
             return $this->url;
         }
     }
     foreach ($this->getSubNavigation() as $nav) {
         $url = $nav->getURL();
         if (isset($url)) {
             return $url;
         }
     }
     return NULL;
 }
 /**
 * creates the html for the create new group options
 *
 * @access   private
 * @param    string $show
 * @return   string the html
 */
 function createFormNew($show = ARRANGMENT_BLOCK)
 {
     $table = new HTML("table");
     $table->addAttr("width", "100%");
     $table->addAttr("class", "blank");
     $table->addAttr("border", "0");
     $table->addAttr("cellpadding", "6");
     $table->addAttr("cellspacing", "0");
     $table->addAttr("div", "left");
     $tr = new HTML("tr");
     $td = new HTML("td");
     $td->addAttr("class", "blank");
     $td->addAttr("align", "center");
     $td->addContent(new HTMLempty("br"));
     #   $tr->addContent ($td);
     #   $table->addContent ($tr);
     $tr = new HTML("tr");
     $td = new HTML("td");
     $td->addAttr("class", "content_body");
     #   $td->addAttr ("class","steelgrau");
     $td->addAttr("align", "center");
     $img = new HTMLempty("img");
     $img->addAttr("src", Assets::image_path("blank.gif"));
     $img->addAttr("width", "30");
     $img->addAttr("height", "1");
     $img->addAttr("alt", "");
     #   $td->addContent ($img);
     #   $td->addContent (new HTMLempty ("br"));
     $group_selection = _("Gruppierungsblock") . "&nbsp;" . Button::create(_('Erstellen'), 'cmd[AddGroup]', array('title' => _('Einen neuen Gruppierungsblock erstellen')));
     $qgroup_selection = _("Fragenblock mit") . "&nbsp;" . $this->createTemplateSelection() . Button::create(_('Erstellen'), 'cmd[AddQGroup]', array('title' => _('Einen neuen Fragenblock erstellen')));
     $seperator = "&nbsp;|&nbsp;";
     switch ($show) {
         case ARRANGMENT_BLOCK:
             $td->addHTMLContent($group_selection);
             break;
         case QUESTION_BLOCK:
             $td->addHTMLContent($qgroup_selection);
             break;
         case "both":
             $td->addHTMLContent($group_selection . $seperator . $qgroup_selection);
             break;
     }
     // abort-button
     $child = $this->tree->eval->getNextChild();
     $number_of_childs = $this->tree->eval->getNumberChildren();
     if ($number_of_childs == 1 && $this->itemID == ROOT_BLOCK && $this->tree->eval->getTitle() == _("Neue Evaluation") && $this->tree->eval->getText() == "" && $child && $child->getTitle() == _("Erster Gruppierungsblock") && $child->getChildren() == NULL && $child->getText == "") {
         $cancel = $seperator . "&nbsp;";
         $a_content = LinkButton::createCancel(_('Abbrechen'), URLHelper::getURL(EVAL_FILE_ADMIN . "?evalID=" . $this->tree->eval->getObjectID() . "&abort_creation_button=1"), array('title' => _("Erstellung einer Evaluation abbrechen")));
         $cancel .= $a_content;
         $td->addHTMLContent($cancel);
     }
     $tr->addContent($td);
     $table->addContent($tr);
     return $table->createContent();
 }
Esempio n. 18
0
 public function testHelperBuildSignedURLWithHashSetterParamsHttps()
 {
     $uh = new URLHelper("imgix-library-secure-test-source.imgix.net", "dog.jpg", "https", "EHFQXiZhxP4wA2c4");
     $uh->setParameter("w", 500);
     $this->assertEquals("https://imgix-library-secure-test-source.imgix.net/dog.jpg?w=500&s=e4eb402d12bbdf267bf0fc5588170d56", $uh->getURL());
 }
Esempio n. 19
0
echo Icon::create('edit', 'clickable')->asImg();
?>
</a>
                <a href="<?php 
echo URLHelper::getURL('dispatch.php/tour/admin_details/' . $tour->tour_id . '?delete_tour_step=' . $step->step);
?>
" <?php 
echo tooltip(_('Schritt löschen'));
?>
>
                <?php 
echo Icon::create('trash', 'clickable')->asImg();
?>
</a>
                <a href="<?php 
echo URLHelper::getURL('dispatch.php/tour/edit_step/' . $tour->tour_id . '/' . ($step->step + 1) . '/new');
?>
" target="blank" <?php 
echo tooltip(_('Neuen Schritt hinzufügen'));
?>
 data-dialog="size=auto;reload-on-close">
                <?php 
echo Icon::create('add', 'clickable')->asImg();
?>
</a>
                </td>
                </tr>
            <? endforeach ?>
        <? else : ?>
            <tr>
            <td colspan="6">
Esempio n. 20
0
if (Request::int('send_excel')) {
    $tmpfile = basename($sem_browse_obj->create_result_xls($excel_text));
    if ($tmpfile) {
        header('Location: ' . getDownloadLink($tmpfile, _("Veranstaltungsübersicht.xls"), 4));
        page_close();
        die;
    }
}
PageLayout::setHelpKeyword("Basis.Informationsseite");
PageLayout::setTitle(($level == "s" ? $SessSemName["header_line"] . " - " : "") . $head_text);
if ($level == "s" && $SessSemName[1] && $SessSemName["class"] == "inst") {
    Navigation::activateItem('/course/main/courses');
}
$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'));
Esempio n. 21
0
        </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');
}
Esempio n. 22
0
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                                //
                                // Show Page
                                //
                                SkipLinks::addIndex(_("Aktuelle Seite"), 'main_content', 100);
                                showWikiPage($keyword, $version, $special, $show_wiki_comments, Request::get('hilight'));
                            }
                        }
                    }
                }
            }
        }
    }
}
// end default action
$layout = $GLOBALS['template_factory']->open('layouts/base');
$layout->content_for_layout = ob_get_clean();
if (in_array($cmd, words('show abortedit really_delete really_delete_all'))) {
    // redirect to normal view to avoid duplicate edits on reload or back/forward
    header('Location: ' . URLHelper::getURL('', compact('keyword')));
} else {
    Sidebar::get()->setImage('sidebar/wiki-sidebar.png');
    echo $layout->render();
}
// Save data back to database.
page_close();
Esempio n. 23
0
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
// +---------------------------------------------------------------------------+

use Studip\Button, Studip\LinkButton;

require_once ("$PATH_EXPORT/export_xslt_vars.inc.php");   // XSLT-Variablen

$semester = new SemesterData;

$export_pagename = _("Datenexport - Startseite");

$export_info = _("Bitte wählen Sie Datenart und Einrichtung.") . "<br>";

$export_pagecontent .= "<form method=\"POST\" action=\"" . URLHelper::getURL() . "\">";

$export_pagecontent .= CSRFProtection::tokenTag();

$export_pagecontent .="<br><b>". _("Bitte wählen Sie eine Einrichtung: ") .  "</b><br><select name=\"range_id\">";

// Prepare institutes statement for faculty
$query = "SELECT Institut_id, Name
          FROM Institute
          WHERE fakultaets_id = ? AND institut_id != fakultaets_id
          ORDER BY Name";
$inst_statement = DBManager::get()->prepare($query);

// Prepare and execute faculties statement
$query = "SELECT Institut_id, Name, fakultaets_id
          FROM Institute
Esempio n. 24
0
            if ($changeObject->deletePerms(Request::option('delete_user_perms')))
                $perms_changed=TRUE;

        if ((Request::submitted('send_search_owner')) && (Request::option('submit_search_owner') !="FALSE") && (!Request::submitted('reset_search_owner')))
            $changeObject->setOwnerId(Request::option('submit_search_owner'));

        if ((Request::submitted('send_search_perm_user')) && (Request::option('submit_search_perm_user') !="FALSE") && (!Request::submitted('reset_search_perm_user')))
            if ($changeObject->storePerms(Request::option('submit_search_perm_user')))
                $perms_changed=TRUE;

        if ((getGlobalPerms($user->id) == "admin") && ($changeObject->isRoom())) {
            if ($changeObject->isParent()) {
                if ((Request::option('change_lockable')) && (!$changeObject->isLockable()))
                    $msg->addMsg(29, array(URLHelper::getURL('?set_lockable_recursiv=1&lock_resource_id='.$changeObject->getId())));
                elseif ((!Request::option('change_lockable')) && ($changeObject->isLockable()))
                    $msg->addMsg(30, array(URLHelper::getURL('?unset_lockable_recursiv=1&lock_resource_id='.$changeObject->getId())));
            }
            $changeObject->setLockable(Request::option('change_lockable'));
        }

        //Object speichern
        if (($changeObject->store()) || ($perms_changed))
            $msg->addMsg(8);
    } else {
        $msg->addMsg(1);
    }
    $_SESSION['resources_data']["view"]="edit_object_perms";
    $view = $_SESSION['resources_data']["view"];
}

//set/unset lockable for a comlete hierarchy
Esempio n. 25
0
                echo "</td>\n";
            }
            ?>
        </tr>
        </thead>
        <?php 
echo $table_content;
?>
    </table>
<?
}
$sidebar = Sidebar::get();
$sidebar->setImage('sidebar/person-sidebar.png');
$widget = new ViewsWidget();
$widget->addLink(_('Standard'), URLHelper::getURL('?extend=no'))->setActive($extend != 'yes');
$widget->addLink(_('Erweitert'), URLHelper::getURL('?extend=yes'))->setActive($extend == 'yes');
$sidebar->addWidget($widget);

if ($admin_view) {

    if (!LockRules::Check($inst_id, 'participants')) {

        $edit = new SidebarWidget();
        $edit->setTitle(_('Personenverwaltung'));
        $edit->addElement(new WidgetElement($mp));
        $sidebar->addWidget($edit);
    }


    if (!empty($mail_list)) {
        $actions = new ActionsWidget();
Esempio n. 26
0
 /**
  * show institute overview page
  *
  * @return void
  */
 function index_action()
 {
     $this->sidebar = Sidebar::get();
     $this->sidebar->setImage('sidebar/institute-sidebar.png');
     if (get_config('NEWS_RSS_EXPORT_ENABLE') && $this->institute_id) {
         $rss_id = StudipNews::GetRssIdFromRangeId($this->institute_id);
         if ($rss_id) {
             PageLayout::addHeadElement('link', array('rel' => 'alternate', 'type' => 'application/rss+xml', 'title' => 'RSS', 'href' => 'rss.php?id=' . $rss_id));
         }
     }
     URLHelper::bindLinkParam("inst_data", $this->institut_main_data);
     // (un)subscribe to institute
     if (Config::get()->ALLOW_SELFASSIGN_INSTITUTE && $GLOBALS['user']->id !== 'nobody' && !$GLOBALS['perm']->have_perm('admin')) {
         $widget = new ActionsWidget();
         if (!$GLOBALS['perm']->have_studip_perm('user', $this->institute_id)) {
             $url = URLHelper::getLink('dispatch.php/institute/overview', array('follow_inst' => 'on'));
             $widget->addLink(_('Einrichtung abonnieren'), $url);
         } elseif (!$GLOBALS['perm']->have_studip_perm('autor', $this->institute_id)) {
             $url = URLHelper::getLink('dispatch.php/institute/overview', array('follow_inst' => 'off'));
             $widget->addLink(_('Austragen aus der Einrichtung'), $url);
         }
         $this->sidebar->addWidget($widget);
         if (!$GLOBALS['perm']->have_studip_perm('user', $this->institute_id) and Request::option('follow_inst') == 'on') {
             $query = "INSERT IGNORE INTO user_inst\n                          (user_id, Institut_id, inst_perms)\n                          VALUES (?, ?, 'user')";
             $statement = DBManager::get()->prepare($query);
             $statement->execute(array($GLOBALS['user']->user_id, $this->institute_id));
             if ($statement->rowCount() > 0) {
                 log_event('INST_USER_ADD', $this->institute_id, $GLOBALS['user']->user_id, 'user');
                 PageLayout::postMessage(MessageBox::success(_("Sie haben die Einrichtung abonniert.")));
                 header('Location: ' . URLHelper::getURL('', array('cid' => $this->institute_id)));
                 die;
             }
         } elseif (!$GLOBALS['perm']->have_studip_perm('autor', $this->institute_id) and Request::option('follow_inst') == 'off') {
             $query = "DELETE FROM user_inst\n                          WHERE user_id = ?  AND Institut_id = ?";
             $statement = DBManager::get()->prepare($query);
             $statement->execute(array($GLOBALS['user']->user_id, $this->institute_id));
             if ($statement->rowCount() > 0) {
                 log_event('INST_USER_DEL', $this->institute_id, $GLOBALS['user']->user_id, 'user');
                 PageLayout::postMessage(MessageBox::success(_("Sie haben sich aus der Einrichtung ausgetragen.")));
                 header('Location: ' . URLHelper::getURL('', array('cid' => $this->institute_id)));
                 die;
             }
         }
     }
     // Fetch news
     $response = $this->relay('news/display/' . $this->institute_id);
     $this->news = $response->body;
     // Fetch  votes
     if (get_config('VOTE_ENABLE')) {
         $response = $this->relay('questionnaire/widget/' . $this->institute_id . '/institute');
         $this->questionnaires = $response->body;
     }
     // Fetch dates
     $response = $this->relay("calendar/contentbox/display/{$this->institute_id}/1210000");
     $this->dates = $response->body;
 }
Esempio n. 27
0
                                    <?php 
echo htmlReady($info['description']);
?>
                                <? else: ?>
                                    <?php 
echo _("Keine Beschreibung vorhanden.");
?>
                                <? endif ?>
                            <? endif ?>
                        </strong>

                    </div>

                    <!-- inhaltlöschenbutton -->
                    <? if ($val['type'] == 'plugin' && method_exists($plugin, 'deleteContent')) echo LinkButton::create(_('Inhalte löschen'), URLHelper::getURL("?deleteContent=true&name=" . $key), array('style' => 'float:right; z-index: 1;')); ?>
                    <? if ($val['type'] == 'modul' && $studip_module instanceOf StudipModule && method_exists($studip_module, 'deleteContent')) echo LinkButton::create(_('Inhalte löschen'), URLHelper::getURL("?deleteContent=true&name=" . $key), array('style' => 'float:right; z-index: 1;')); ?>
                          
                </div>

                <? if ($_SESSION['plus']['View'] == 'openall' || !isset($_SESSION['plus'])) { ?>

                    <div class="plus_expert">

                        <div class="screenshot_holder">
                            <? if (isset($info['screenshot']) || isset($info['screenshots'])) : 
                                if(isset($info['screenshots'])){   
                                    $title = $info['screenshots']['pictures'][0]['title'];
                                    $source = $info['screenshots']['path'].'/'.$info['screenshots']['pictures'][0]['source'];                                   
                                } else {
                                    $fileext = end(explode(".", $info['screenshot']));
                                    $title = str_replace("_"," ",basename($info['screenshot'], ".".$fileext));
Esempio n. 28
0
        echo URLHelper::getURL('dispatch.php/admission/userlist/configure/' . $list->getId());
        ?>
">
            <?php 
        echo Icon::create('edit', 'clickable', ['title' => _('Nutzerliste bearbeiten')])->asImg(16, ["alt" => _('Nutzerliste bearbeiten')]);
        ?>
        </a>
        <a href="<?php 
        echo $controller->url_for('admission/userlist/delete', $list->getId());
        ?>
"
            onclick="return STUDIP.Dialogs.showConfirmDialog('<?php 
        echo sprintf(_('Soll die Nutzerliste %s wirklich gelöscht werden?'), htmlReady($list->getName()));
        ?>
', '<?php 
        echo URLHelper::getURL('dispatch.php/admission/userlist/delete/' . $list->getId(), array('really' => 1));
        ?>
')">
            <?php 
        echo Icon::create('trash', 'clickable', ['title' => _('Personenliste löschen')]);
        ?>
        </a>
    </div>
    <div id="userlist_details_<?php 
        echo $list->getId();
        ?>
" style="display: none; margin-left: 20px;">
        <?php 
        echo $list->toString();
        ?>
    </div>
Esempio n. 29
0
        $problems[$problems_found] = $msgText;
        $problems_found++;
    }
}

if ($problems_found > 1) {
    $moreProbs = " (Beachten Sie bitte die angegebene Reihenfolge!)";
}

if ($problems_found) {
?>
    <table width="100%" border=0 cellpadding=0 cellspacing=0>
        <tr>
             <td class="blank" colspan=2>
                <?= MessageBox::info(_("Das Anlegen einer Veranstaltung ist leider zu diesem Zeitpunkt noch nicht möglich, 
                da zunächst die folgenden Voraussetzungen geschaffen werden müssen.".$moreProbs), $problems); ?>
            </td>
        </tr>
        <tr <? $cssSw->switchClass() ?>>
            <td class="<? echo $cssSw->getClass() ?>" align="center" colspan=2>
                <?= LinkButton::create(_('Aktualisieren'), URLHelper::getURL(''))?>
            </td>
        </tr>
        <tr>
            <td class="blank" colspan=2>&nbsp;</td>
        </tr>
    </table>
<?php
return false;
}
 public function getURL()
 {
     return URLHelper::getURL("about.php", array('username' => $this['username']), true);
 }