예제 #1
0
 /**
  *
  **/
 public function index_action()
 {
     $this->consumers = RESTAPI\UserPermissions::get($GLOBALS['user']->id)->getConsumers();
     $this->types = array('website' => _('Website'), 'program' => _('Herkömmliches Desktopprogramm'), 'app' => _('Mobile App'));
     $widget = new SidebarWidget();
     $widget->setTitle(_('Informationen'));
     $widget->addElement(new WidgetElement(_('Dies sind die Apps, die Zugriff auf Ihren Account haben.')));
     Sidebar::Get()->addWidget($widget);
 }
예제 #2
0
 public function render($variables = array())
 {
     $attributes = array();
     foreach ((array) $this->template_variables['attributes'] as $key => $value) {
         $attributes[] = sprintf('%s="%s"', htmlReady($key), htmlReady($value));
     }
     $this->template_variables['attributes'] = implode(' ', $attributes) ?: '';
     return parent::render($variables);
 }
예제 #3
0
파일: calendar.php 프로젝트: ratbird/hope
 protected function createSidebarFilter()
 {
     $tmpl_factory = $this->get_template_factory();
     $filters = new SidebarWidget();
     $filters->setTitle('Auswahl');
     $tmpl = $tmpl_factory->open('calendar/single/_jump_to');
     $tmpl->atime = $this->atime;
     $tmpl->action = $this->action;
     $tmpl->action_url = $this->url_for('calendar/single/jump_to');
     $filters->addElement(new WidgetElement($tmpl->render()));
     $tmpl = $tmpl_factory->open('calendar/single/_select_category');
     $tmpl->action_url = $this->url_for();
     $tmpl->category = $this->category;
     $filters->addElement(new WidgetElement($tmpl->render()));
     if (get_config('CALENDAR_GROUP_ENABLE') || get_config('CALENDAR_COURSE_ENABLE')) {
         $tmpl = $tmpl_factory->open('calendar/single/_select_calendar');
         $tmpl->range_id = $this->range_id;
         $tmpl->action_url = $this->url_for('calendar/group/switch');
         $tmpl->view = $this->action;
         $filters->addElement(new WidgetElement($tmpl->render()));
     }
     Sidebar::get()->addWidget($filters);
 }
예제 #4
0
파일: index.php 프로젝트: ratbird/hope
?>
    </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();
        $actions->addLink(_('Stud.IP Rundmail'), $controller->url_for('messages/write', array('inst_id' => $inst_id, 'emailrequest' => 1)), Icon::create('mail', 'clickable'), array('data-dialog' => 'size=50%'));
        $sidebar->addWidget($actions);
    }
}


$widget = new OptionsWidget();
예제 #5
0
 /**
  * Renders the widget.
  *
  * @param Array $variables Unused variables parameter
  * @return String containing the html output of the widget
  */
 public function render($variables = array())
 {
     $query = parse_url($this->url, PHP_URL_QUERY);
     if ($query) {
         $this->url = str_replace('?' . $query, '', $this->url);
         parse_str(html_entity_decode($query) ?: '', $query_params);
     } else {
         $query_params = array();
     }
     $this->template_variables['url'] = URLHelper::getLink($this->url);
     $this->template_variables['url_params'] = $query_params;
     $this->template_variables['method'] = $this->method;
     $this->template_variables['id'] = $this->id;
     foreach ($this->needles as $index => $needle) {
         if ($needle['quick_search']) {
             $quick_search = QuickSearch::get($needle['name'], $needle['quick_search']);
             if ($needle['js_func'] !== null) {
                 $quick_search->fireJSFunctionOnSelect($needle['js_func']);
             }
             $needle['quick_search'] = $quick_search;
             $this->needles[$index] = $needle;
         }
     }
     if ($this->hasData()) {
         $reset_link = sprintf('<a href="%s">%s %s</a>', URLHelper::getLink($this->template_variables['url'], array('reset-search' => 1)), Icon::create('search+decline', 'clickable')->asImg(["class" => 'text-top']), _('Zurücksetzen'));
         $this->template_variables['reset_search'] = $reset_link;
     }
     $this->template_variables['needles'] = $this->needles;
     $this->template_variables['filters'] = $this->filters;
     $this->template_variables['has_data'] = $this->hasData();
     return parent::render($variables);
 }
예제 #6
0
파일: contact.php 프로젝트: ratbird/hope
 private function initSidebar($active_id = null)
 {
     $sidebar = Sidebar::Get();
     $letterlist = new SidebarWidget();
     foreach (range('A', 'Z') as $letter) {
         if ($this->contacts[$letter]) {
             $html .= "<a href='#letter_{$letter}'>{$letter}</a>";
         } else {
             $html .= "<span>{$letter}</span>";
         }
     }
     $letterlist->setTitle(_('Schnellzugriff'));
     $letterlist->addElement(new WidgetElement("<div class='letterlist'>{$html}</div>"));
     $sidebar->addWidget($letterlist);
     // Groups
     $actions = new ActionsWidget();
     $actions->addLink(_('Neue Gruppe anlegen'), $this->url_for('contact/editGroup'), Icon::create('group3+add', 'clickable'))->asDialog('size=auto');
     $actions->addLink(_('Nachricht an alle'), $this->url_for('messages/write', array('rec_uname' => $this->allContacts->pluck('username'))), Icon::create('mail', 'clickable'))->asDialog();
     $actions->addLink(_('E-Mail an alle'), URLHelper::getLink('mailto:' . join(',', $this->allContacts->pluck('email'))), Icon::create('mail', 'clickable'));
     $actions->addLink(_('Alle vCards herunterladen'), $this->url_for('contact/vcard/' . $this->filter), Icon::create('vcard', 'clickable'));
     $sidebar->addWidget($actions);
     // Groups navigation
     $groupsWidget = new ViewsWidget();
     $groupsWidget->setTitle(_('Gruppen'));
     $groupsWidget->addLink(_('Alle Kontakte'), URLHelper::getLink('dispatch.php/contact/index'))->setActive(!$active_id);
     foreach ($this->groups as $group) {
         $groupsWidget->addLink($group->name, URLHelper::getLink('dispatch.php/contact/index/' . $group->id))->setActive($group->id == $active_id);
     }
     $sidebar->addWidget($groupsWidget);
 }
예제 #7
0
파일: ListWidget.php 프로젝트: ratbird/hope
 /**
  * 
  */
 public function render($variables = array())
 {
     $this->template_variables['css_classes'] = $this->css_classes;
     return parent::render($variables);
 }
예제 #8
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;
 }
예제 #9
0
파일: my_courses.php 프로젝트: ratbird/hope
 /**
  * Returns a widget for semester selection
  * @param $sem
  * @return OptionsWidget
  */
 private function setSemesterWidget(&$sem)
 {
     $semesters = new SimpleCollection(Semester::getAll());
     $this->sem = $sem;
     $this->semesters = $semesters->orderBy('beginn desc');
     $sidebar = Sidebar::Get();
     $widget = new SidebarWidget();
     $widget->setTitle(_('Semesterfilter'));
     $this->render_template('my_courses/_semester_filter.php', null);
     $html = $this->response->body;
     $this->erase_response();
     $widget->addElement(new WidgetElement($html));
     $sidebar->addWidget($widget);
 }
예제 #10
0
파일: smileys.php 프로젝트: ratbird/hope
 /**
  * Extends this controller with neccessary infobox
  *
  * @param String $view Currently viewed group
  */
 private function setSidebar($view)
 {
     $sidebar = Sidebar::Get();
     $sidebar->setImage('sidebar/smiley-sidebar.png');
     $sidebar->setTitle(PageLayout::getTitle() ?: _('Smileys'));
     // Render items
     $factory = new Flexi_TemplateFactory($this->dispatcher->trails_root . '/views/admin/smileys/');
     $actions = new ActionsWidget();
     $actions->addLink(_('Neues Smiley hochladen'), $this->url_for('admin/smileys/upload', $view), Icon::create('add', 'clickable'))->asDialog('size=auto');
     $actions->addLink(_('Smileys zählen'), $this->url_for('admin/smileys/count', $view), Icon::create('code', 'clickable'));
     $actions->addLink(_('Tabelle aktualisieren'), $this->url_for('admin/smileys/refresh', $view), Icon::create('refresh', 'clickable'));
     $actions->addLink(_('Smiley-Übersicht öffnen'), URLHelper::getLink('dispatch.php/smileys'), Icon::create('smiley', 'clickable'))->asDialog();
     $sidebar->addWidget($actions);
     $widget = new SidebarWidget();
     $filter = $factory->render('selector', array('characters' => Smiley::getUsedCharacters(), 'controller' => $this, 'view' => $view));
     $widget->setTitle(_('Filter'));
     $widget->addElement(new WidgetElement($filter));
     $sidebar->addWidget($widget);
     $widget = new SidebarWidget();
     $statistics = $factory->render('statistics', Smiley::getStatistics());
     $widget->setTitle(_('Statistiken'));
     $widget->addElement(new WidgetElement($statistics));
     $sidebar->addWidget($widget);
 }
예제 #11
0
파일: edit_list.php 프로젝트: ratbird/hope
<? endif ?>
<? $treeview->showTree(); ?>
<?php 
$sidebar = Sidebar::get();
$sidebar->setImage('sidebar/literature-sidebar.png');
$widget = new ActionsWidget();
$widget->addLink(_('Literatur importieren'), URLHelper::getLink('dispatch.php/literature/import_list?return_range=' . $_range_id), Icon::create('literature+add', 'clickable'), array('data-dialog' => ''));
$widget->addLink(_('Neue Literatur anlegen'), URLHelper::getLink('dispatch.php/literature/edit_element?_range_id=new_entry&return_range=' . $_range_id), Icon::create('literature+add', 'clickable'), array('data-dialog' => ''));
$sidebar->addWidget($widget);
ob_start();
echo $clip_form->getFormStart(URLHelper::getLink($treeview->getSelf()));
echo $clip_form->getFormField("clip_content", array_merge(array('size' => $clipboard->getNumElements()), (array) $attributes['lit_select']));
echo $clip_form->getFormField("clip_cmd", $attributes['lit_select']);
?>
<div align="center">
<?php 
echo $clip_form->getFormButton("clip_ok", array('style' => 'vertical-align:middle;margin:3px;'));
?>
</div>
<?php 
echo $clip_form->getFormEnd();
?>
<?
$content = ob_get_clean();
$widget = new SidebarWidget();
$widget->setTitle(_('Merkliste'));
$widget->addElement(new WidgetElement($content));
$sidebar->addWidget($widget);
$widget = new ExportWidget();
$widget->addLink(_('Druckansicht'), URLHelper::getLink('dispatch.php/literature/print_view?_range_id='.$_range_id), Icon::create('print', 'clickable'), array('target' => '_blank'));
$sidebar->addWidget($widget);
예제 #12
0
 /**
  * edit one room requests
  */
 public function edit_action()
 {
     Helpbar::get()->addPlainText(_('Information'), _('Hier können Sie Angaben zu gewünschten Raumeigenschaften machen.'));
     if (Request::option('new_room_request_type')) {
         $request = new RoomRequest();
         $request->seminar_id = $this->course_id;
         $request->user_id = $GLOBALS['user']->id;
         list($new_type, $id) = explode('_', Request::option('new_room_request_type'));
         if ($new_type == 'course') {
             if ($existing_request = RoomRequest::existsByCourse($this->course_id)) {
                 $request = RoomRequest::find($existing_request);
             }
         }
         if ($new_type == 'date') {
             $request->termin_id = $id;
             if ($existing_request = RoomRequest::existsByDate($id)) {
                 $request = RoomRequest::find($existing_request);
             }
         } elseif ($new_type == 'cycle') {
             $request->metadate_id = $id;
             if ($existing_request = RoomRequest::existsByCycle($id)) {
                 $request = RoomRequest::find($existing_request);
             }
         }
     } else {
         $request = RoomRequest::find(Request::option('request_id'));
     }
     $admission_turnout = Seminar::getInstance($this->course_id)->admission_turnout;
     $attributes = self::process_form($request, $admission_turnout);
     $this->params = array('request_id' => $request->getId());
     $this->params['fromDialog'] = Request::get('fromDialog');
     if (Request::get('origin') !== null) {
         $this->params['origin'] = Request::get('origin');
     }
     if (Request::submitted('save') || Request::submitted('save_close')) {
         if (!($request->getSettedPropertiesCount() || $request->getResourceId())) {
             PageLayout::postMessage(MessageBox::error(_("Die Anfrage konnte nicht gespeichert werden, da Sie mindestens einen Raum oder mindestens eine Eigenschaft (z.B. Anzahl der Sitzplätze) angeben müssen!")));
         } else {
             $request->setClosed(0);
             $this->request_stored = $request->store();
             if ($this->request_stored) {
                 PageLayout::postMessage(MessageBox::success(_("Die Raumanfrage und gewünschte Raumeigenschaften wurden gespeichert")));
             }
             if (Request::submitted('save_close')) {
                 if (!Request::isXhr()) {
                     $this->redirect('course/room_requests/index/' . $this->course_id);
                 } else {
                     if (Request::get('fromDialog') == true && !isset($this->params['origin'])) {
                         $this->relocate('course/room_requests/index/' . $this->course_id);
                     } else {
                         if (isset($this->params['origin'])) {
                             $this->relocate(str_replace('_', '/', $this->params['origin']) . '?cid=' . $this->course_id);
                         } else {
                             $this->relocate('course/room_requests/index/' . $this->course_id);
                         }
                     }
                 }
             }
         }
     }
     if (!$request->isNew() && $request->isDirty()) {
         PageLayout::postMessage(MessageBox::info(_("Die Änderungen an der Raumanfrage wurden noch nicht gespeichert!")));
     }
     $room_categories = array_values(array_filter(getResourcesCategories(), create_function('$a', 'return $a["is_room"] == 1;')));
     if (!$request->getCategoryId() && count($room_categories) == 1) {
         $request->setCategoryId($room_categories[0]['category_id']);
     }
     $this->search_result = $attributes['search_result'];
     $this->search_by_properties = $attributes['search_by_properties'];
     $this->admission_turnout = $admission_turnout;
     $this->request = $request;
     $this->room_categories = $room_categories;
     $this->new_room_request_type = Request::option('new_room_request_type');
     $this->is_resources_admin = getGlobalPerms($GLOBALS['user']->id);
     $actions = new ActionsWidget();
     $actions->addLink(_('Bearbeitung abbrechen'), $this->link_for('index/' . $this->course_id), Icon::create('decline', 'clickable'));
     if (getGlobalPerms($GLOBALS['user']->id) == 'admin' || $GLOBALS['perm']->have_perm('admin') && count(getMyRoomRequests(null, null, true, $request->getId()))) {
         $actions->addLink(_('Raumanfrage auflösen'), URLHelper::getLink('resources.php', array('view' => 'edit_request', 'single_request' => $request->getId())), Icon::create('admin', 'clickable'));
     }
     if (Request::isXhr()) {
         Sidebar::Get()->addWidget($actions);
         $widget = new SidebarWidget();
         $widget->setTitle(_('Informationen'));
         if ($request->isNew()) {
             $widget->addElement(new WidgetElement(_('Dies ist eine neue Raumanfrage.')));
         } else {
             $info_txt = '<p>' . sprintf(_('Erstellt von: %s'), User::find($request->user_id)->getFullname()) . '</p>';
             $info_txt .= '<p>' . sprintf(_('Erstellt am: %s'), strftime('%x %H:%M', $request->mkdate)) . '</p>';
             $info_txt .= '<p>' . sprintf(_('Letzte Änderung: %s'), strftime('%x %H:%M', $request->chdate)) . '</p>';
             $widget->addElement(new WidgetElement($info_txt));
         }
         Sidebar::Get()->addWidget($widget);
     }
 }
예제 #13
0
파일: courses.php 프로젝트: ratbird/hope
 /**
  * Returns a course type widthet depending on all available courses and theirs types
  * @param string $selected
  * @param array $params
  * @return ActionsWidget
  */
 private function setCourseTypeWidget($selected = 'all')
 {
     $sidebar = Sidebar::get();
     $this->url = $this->url_for('admin/courses/set_course_type');
     $this->types = array();
     $this->selected = $selected;
     $this->render_template('admin/courses/filters/course_type_filter.php', null);
     $html = $this->response->body;
     $this->erase_response();
     $widget = new SidebarWidget();
     $widget->setTitle(_('Veranstaltungstyp-Filter'));
     $widget->addElement(new WidgetElement($html));
     $sidebar->addWidget($widget, 'filter_coursetypes');
 }
예제 #14
0
파일: index.php 프로젝트: ratbird/hope
<?php

# Lifter010: TODO
$zoom = $my_schedule_settings['zoom'];
$sidebar = Sidebar::get();
$sidebar->setImage('sidebar/schedule-sidebar.png');
$semester_widget = new SidebarWidget();
$semester_widget->setTitle(_('Angezeigtes Semester'));
$semester_widget->addElement(new WidgetElement($this->render_partial('calendar/schedule/_semester_chooser')), 'semester');
$sidebar->addWidget($semester_widget, 'calendar/schedule/semester');
$actions = new ActionsWidget();
if (!$inst_mode) {
    $actions->addLink(_("Neuer Eintrag"), $controller->url_for('calendar/schedule/entry'), Icon::create('date+add', 'clickable'), array('data-dialog' => ''));
}
$actions->addLink(_("Darstellung ändern"), $controller->url_for('calendar/schedule/settings'), Icon::create('admin', 'clickable'), array('data-dialog' => ''));
if (!$show_hidden) {
    $actions->addLink(_("Ausgeblendete Veranstaltungen anzeigen"), $controller->url_for('calendar/schedule/?show_hidden=1'), Icon::create('visibility-visible', 'clickable'));
} else {
    $actions->addLink(_("Ausgeblendete Veranstaltungen verbergen"), $controller->url_for('calendar/schedule/?show_hidden=0'), Icon::create('visibility-visible', 'clickable'));
}
$sidebar->addWidget($actions, 'calendar/schedule/actions');
$widget = new ExportWidget();
$widget->addLink(_('Druckansicht'), $controller->url_for('calendar/schedule/index/' . implode(',', $days) . '?printview=true&semester_id=' . $current_semester['semester_id']), Icon::create('print', 'clickable'), array('target' => '_blank'));
$sidebar->addWidget($widget, 'calendar/schedule/print');
$options = new OptionsWidget();
$options->setTitle(_("Darstellungsgröße"));
$options->addRadioButton(_("klein"), URLHelper::getURL('', array('zoom' => 0)), $zoom == 0);
$options->addRadioButton(_("mittel"), URLHelper::getURL('', array('zoom' => 1)), $zoom == 1);
$options->addRadioButton(_("groß"), URLHelper::getURL('', array('zoom' => 2)), $zoom == 2);
$sidebar->addWidget($options, 'calendar/schedule/options');
?>
예제 #15
0
파일: index.php 프로젝트: ratbird/hope
                <td style="text-align: center;" colspan="11">
                    <?php 
echo Button::createAccept(_('Speichern'), 'save', array('title' => _('Einstellungen speichern')));
?>
                </td>
            </tr>
        </tfoot>
        </table>
    </form>
<? endif ?>

<?
$sidebar = Sidebar::Get();
$sidebar->setTitle(_('Plugins'));
$sidebar->setImage('sidebar/plugin-sidebar.png');



if (get_config('PLUGINS_UPLOAD_ENABLE')) {
    $actions = new ActionsWidget();
    $actions->addLink(_('Weitere Plugins installieren'), $controller->url_for('admin/plugin/search'), Icon::create('add', 'clickable'));
    $actions->addLink(_('Plugin von URL installieren'), $controller->url_for('admin/plugin/edit_automaticupdate'), Icon::create('download', 'clickable'), array('data-dialog' => "true"));
    $sidebar->addWidget($actions);

    $widget = new SidebarWidget();
    $widget->setTitle(_('Weitere Plugins installieren'));
    $widget->addElement(new WidgetElement($this->render_partial('admin/plugin/upload-drag-and-drop')));
    $sidebar->addWidget($widget);
}