Пример #1
0
 function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     Navigation::activateItem("/pluginmarket/presenting");
     if ($GLOBALS['perm']->have_perm("user")) {
         $config = UserConfig::get($GLOBALS['user']->id);
         $this->last_pluginmarket_visit = $config->getValue("last_pluginmarket_visit") ?: time();
         $_SESSION['last_pluginmarket_visit'] = time();
         $config->store("last_pluginmarket_visit", $_SESSION['last_pluginmarket_visit']);
     }
     PageLayout::addScript($this->plugin->getPluginURL() . "/assets/studiptable.js");
     PageLayout::addScript($this->plugin->getPluginURL() . "/assets/pluginmarket.js");
     $tags_statement = DBManager::get()->prepare("\n            SELECT pluginmarket_tags.tag, COUNT(*) AS number\n            FROM pluginmarket_tags\n                INNER JOIN pluginmarket_plugins ON (pluginmarket_plugins.plugin_id = pluginmarket_tags.plugin_id)\n            WHERE pluginmarket_tags. proposal = '0'\n                AND pluginmarket_plugins.approved = 1\n                AND pluginmarket_plugins.publiclyvisible = 1\n            GROUP BY pluginmarket_tags.tag\n            ORDER BY number DESC, RAND()\n            LIMIT 25\n        ");
     $tags_statement->execute();
     $this->tags = $tags_statement->fetchAll(PDO::FETCH_ASSOC);
     // Set view
     $_SESSION['pluginmarket']['view'] = Request::get('view') ?: $_SESSION['pluginmarket']['view'];
     if (!isset($_SESSION['pluginmarket']['view'])) {
         $_SESSION['pluginmarket']['view'] = 'tiles';
     }
     // Sidebar
     $sidebar = Sidebar::Get();
     // Create search widget
     $searchWidget = new SearchWidget($this->url_for('presenting/all'));
     $searchWidget->addNeedle(_('Suche'), 'search', true);
     $sidebar->addWidget($searchWidget);
     // Create cloud
     $tagWidget = new LinkCloudWidget();
     $tagWidget->setTitle(_("Beliebte Tags"));
     foreach ($this->tags as $tag) {
         $tagWidget->addLink($tag['tag'], $this->url_for('presenting/all', array('tag' => $tag['tag'])), $tag['number']);
     }
     $sidebar->addWidget($tagWidget);
     // Create view widget
     if ($action != 'details') {
         $viewWidget = new ViewsWidget();
         $viewWidget->addLink(_('Kacheln'), URLHelper::getLink('', array('view' => 'tiles')))->setActive($_SESSION['pluginmarket']['view'] == 'tiles');
         $viewWidget->addLink(_('Liste'), $this->url_for('presenting/all', array('view' => 'list')))->setActive($_SESSION['pluginmarket']['view'] == 'list');
         $sidebar->addWidget($viewWidget);
     }
     // Create versionfilter widget
     $versionWidget = new OptionsWidget();
     $versionWidget->setTitle(_('Stud.IP Version'));
     // Create options for all studip versions
     $_SESSION['pluginmarket']['version'] = Request::submitted('version') ? Request::get('version') : $_SESSION['pluginmarket']['version'];
     $options[] = "<option value='" . URLHelper::getLink('', array('version' => 0)) . "'>" . _('Alle Versionen') . "</option>";
     foreach (array_reverse(PluginMarket::getStudipReleases()) as $version) {
         $options[] = "<option value='" . URLHelper::getLink('', array('version' => $version)) . "' " . ($_SESSION['pluginmarket']['version'] == $version ? "SELECTED" : "") . ">{$version}</option>";
     }
     $versionWidget->addElement(new WidgetElement('<select style="width: 100%" onchange="location = this.options[this.selectedIndex].value;">' . join("", $options) . '</select>'));
     // Add checkbox to ignore older releases (use invese logic to be applied on startup)
     $sidebar->addWidget($versionWidget, 'comments');
 }
Пример #2
0
 /**
  * Displays the global ranking list.
  *
  * @param int $page Page of the ranking list to be displayed.
  */
 public function index_action($page = 1)
 {
     $vis_query = get_vis_query('b');
     // Calculate offsets
     $max_per_page = get_config('ENTRIES_PER_PAGE');
     if ($page < 1) {
         $page = 1;
     }
     $offset = max(0, ($page - 1) * $max_per_page);
     // Liste aller die mutig (oder eitel?) genug sind
     $query = "SELECT SQL_CALC_FOUND_ROWS a.user_id,username,score,geschlecht, {$GLOBALS['_fullname_sql']['full']} AS fullname\n                  FROM user_info AS a\n                  LEFT JOIN auth_user_md5 AS b USING (user_id)\n                  WHERE score > 0 AND locked = 0 AND {$vis_query}\n                  ORDER BY score DESC\n                  LIMIT " . (int) $offset . "," . (int) $max_per_page;
     $result = DBManager::get()->fetchAll($query);
     $count = DBManager::get()->fetchColumn("SELECT FOUND_ROWS()");
     $persons = array();
     foreach ($result as $row) {
         $row['is_king'] = StudipKing::is_king($row['user_id'], true);
         $persons[$row['user_id']] = $row;
     }
     $persons = Score::getScoreContent($persons);
     $this->persons = array_values($persons);
     $this->numberOfPersons = $count;
     $this->page = $page;
     $this->offset = $offset;
     $this->max_per_page = $max_per_page;
     $this->current_user = User::findCurrent();
     $this->current_user_score = Score::getMyScore($this->current_user);
     // Set up sidebar and helpbar
     $sidebar = Sidebar::get();
     $sidebar->setImage('sidebar/medal-sidebar.png');
     $actions = new OptionsWidget();
     $actions->addCheckbox(_('Ihren Wert veröffentlichen'), $this->current_user->score, $this->url_for('score/publish'), $this->url_for('score/unpublish'));
     $sidebar->addWidget($actions);
     $helpbar = Helpbar::get();
 }
Пример #3
0
 /**
  * Displays the online list.
  **/
 public function index_action()
 {
     $this->contact_count = Contact::countBySQL('owner_id=?', array(User::findCurrent()->id));
     // Total number of contacts
     $this->users = $this->getOnlineUsers($this->settings['show_groups']);
     $this->showOnlyBuddies = $this->settings['show_only_buddys'];
     $this->showGroups = $this->settings['show_groups'];
     $this->limit = Config::getInstance()->ENTRIES_PER_PAGE;
     $max_page = ceil(count($this->users['users']) / $this->limit);
     $this->page = min(Request::int('page', 1), $max_page);
     // Setup sidebar
     $sidebar = Sidebar::get();
     $sidebar->setImage('sidebar/person-sidebar.png');
     // Add buddy configuration option to sidebar only if the user actually
     // has buddies
     if ($this->contact_count > 0) {
         $actions = new OptionsWidget();
         $actions->addCheckbox(_('Nur Kontakte in der Übersicht der aktiven Benutzer anzeigen'), $this->settings['show_only_buddys'], $this->url_for('online/config/show_buddies/' . get_ticket()));
         $actions->addCheckbox(_('Kontaktgruppen bei der Darstellung berücksichtigen'), $this->settings['show_groups'], $this->url_for('online/config/show_groups/' . get_ticket()));
         $sidebar->addWidget($actions);
     }
 }
Пример #4
0
 function run($data)
 {
     $list = array();
     foreach (Funcs::$referenceId['options'] as $key => $item) {
         if (is_numeric($item['value'])) {
             $list[$item['path']] = $data[$item['path']];
             $list[$item['path']]['act'] = $item['value'];
             $list[$item['path']]['path'] = $item['path'];
         } else {
             $value = explode("\n", $item['value']);
             if (in_array(end(Funcs::$uri), explode(';', $value[2])) && $value[2] != '' || $value[2] == '') {
                 if ($item['path'] == 'select' || $item['path'] == 'checkbox' || $item['path'] == 'radio') {
                     $temp = OptionsWidget::getValuesSelect($item['name']);
                 } elseif ($item['path'] == 'number') {
                     $temp = OptionsWidget::getValuesNumber($item['name']);
                 } elseif ($item['path'] == 'link') {
                     $temp = OptionsWidget::getValuesLink($value);
                 }
                 if (count($temp) > 0) {
                     $list[$item['value']]['list'] = $temp;
                     $list[$item['value']]['name'] = trim($value[0]);
                     $list[$item['value']]['path'] = $item['path'];
                     $list[$item['value']]['title'] = trim($value[1]) == '' ? $item['name'] : $value[1];
                 }
             }
         }
     }
     $tree = Tree::getTreeByUrl();
     foreach (Fields::getFeaturesList($tree['id']) as $items) {
         foreach ($items['list'] as $item) {
             if ($item['filtertype'] == 'checkbox' || $item['filtertype'] == 'checkboxgroup' || $item['filtertype'] == 'select') {
                 $temp = OptionsWidget::getValuesSelect($item['path']);
             } elseif ($item['filtertype'] == 'number') {
                 $temp = OptionsWidget::getValuesNumber($item['path']);
             }
             $list[$item['path']]['list'] = $temp;
             $list[$item['path']]['name'] = $item['path'];
             $list[$item['path']]['path'] = $item['filtertype'];
             $list[$item['path']]['title'] = $item['name'];
             $list[$item['path']]['comment'] = $item['comment'];
         }
     }
     View::widget('options', array('list' => $list));
 }
Пример #5
0
        $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();
$widget->setTitle(_('Gruppierung'));
// Admins can choose between different grouping functions
if ($GLOBALS['perm']->have_perm("admin")) {
    $widget->addRadioButton(_('Funktion'),
        URLHelper::getLink('?show=funktion'),
        $show == 'funktion');
    $widget->addRadioButton(_('Status'),
        URLHelper::getLink('?show=status'),
        $show == 'status');
    $widget->addRadioButton(_('keine'),
        URLHelper::getLink('?show=liste'),
        $show == 'liste');
} else {
    $widget->addRadioButton(_('Nach Funktion gruppiert'),
        URLHelper::getLink('?show=funktion'),
Пример #6
0
							[{"to" : "3"}, {}]
						]
					],
					total_steps	: 19,
					speed : 1000
				});
            });
        </script>
		
		</a>
		</div>
			<?}else{*/
?>
			<div class="filter-box">
				<?php 
OptionsWidget::run($options);
?>
			</div>
			<?php 
/*}*/
?>

			<?php 
PanelWidget::vert();
?>
		</div>
		<div class="right-coll">
			<h1><?php 
echo Funcs::$seo['name']['value'] ? Funcs::$seo['name']['value'] : $name;
?>
</h1>
Пример #7
0
        PageLayout::setTitle(_('Übersicht des Raumplanungs-Status'));
        Navigation::activateItem('/resources/room_requests/start');
    break;
    case 'edit_request':
        PageLayout::setTitle(_('Bearbeiten der Anfragen'));
        Navigation::activateItem('/resources/room_requests/edit');

        $widget = new ActionsWidget();
        $widget->addLink(_('Ressourcen suchen'),
                         URLHelper::getLink('resources.php?view=search&quick_view_mode=no_nav'), Icon::create('search', 'clickable'),
                         array('onclick' => "windows.open(this.href, '', 'scrollbars=yes,left=10,top=10,width=1000,height=680,resizable=yes');return false;"));
        $widget->addLink(_('Nachrichten zu zugewiesenen Anfragen versenden'),
                         URLHelper::getLink('?snd_closed_request_sms=TRUE'), Icon::create('mail', 'clickable'));
        $sidebar->addWidget($widget);

        $widget = new OptionsWidget();
        $widget->addCheckbox(_('Bearbeitete Anfragen anzeigen'),
                             $_SESSION['resources_data']['skip_closed_requests'],
                             URLHelper::getLink('?skip_closed_requests=TRUE'),
                             URLHelper::getLink('?skip_closed_requests=FALSE'));

    break;
    case 'list_requests':
        $helpbar->setVariables(array(
            'link' => URLHelper::getLink('resources.php?view=requests_start&cancel_edit_request_x=1'),
        ));
        PageLayout::setTitle(_('Anfragenliste'));
        Navigation::activateItem('/resources/room_requests/list');
    break;
    //all the intros in an open object (Veranstaltung, Einrichtung)
    case 'openobject_main':
Пример #8
0
 /**
  * Creates the sidebar.
  */
 private function setupSidebar()
 {
     $sidebar = Sidebar::get();
     $sidebar->setImage('sidebar/plugin-sidebar.png');
     $sidebar->setTitle(PageLayout::getTitle());
     $plusconfig = UserConfig::get($GLOBALS['user']->id)->PLUS_SETTINGS;
     if (!isset($_SESSION['profile_plus'])) {
         if (is_array($plusconfig['profile_plus'])) {
             $_SESSION['profile_plus'] = $plusconfig['profile_plus'];
         } else {
             //$_SESSION['profile_plus']['Kategorie']['Lehrorganisation'] = 1;
             $_SESSION['profile_plus']['Kategorie']['Kommunikation und Zusammenarbeit'] = 1;
             //$_SESSION['profile_plus']['Kategorie']['Aufgaben'] = 1;
             $_SESSION['profile_plus']['Kategorie']['Sonstiges'] = 1;
             //$_SESSION['profile_plus']['Kategorie']['Projekte und Entwicklung'] = 1;
             /*$_SESSION['profile_plus']['Komplex'][1] = 1;
               $_SESSION['profile_plus']['Komplex'][2] = 1;
               $_SESSION['profile_plus']['Komplex'][3] = 1;*/
             $_SESSION['profile_plus']['View'] = 'openall';
             $_SESSION['profile_plus']['displaystyle'] = 'category';
         }
     }
     /*if (Request::Get('Komplex1') != null) $_SESSION['profile_plus']['Komplex'][1] = Request::Get('Komplex1');
       if (Request::Get('Komplex2') != null) $_SESSION['profile_plus']['Komplex'][2] = Request::Get('Komplex2');
       if (Request::Get('Komplex3') != null) $_SESSION['profile_plus']['Komplex'][3] = Request::Get('Komplex3');*/
     if (Request::Get('mode') != null) {
         $_SESSION['profile_plus']['View'] = Request::Get('mode');
     }
     if (Request::Get('displaystyle') != null) {
         $_SESSION['profile_plus']['displaystyle'] = Request::Get('displaystyle');
     }
     $widget = new OptionsWidget();
     $widget->setTitle(_('Kategorien'));
     foreach ($_SESSION['profile_plus']['Kategorie'] as $key => $val) {
         if ($key == 'Sonstiges') {
             continue;
         }
         if (Request::Get(md5('cat_' . $key)) != null) {
             $_SESSION['profile_plus']['Kategorie'][$key] = Request::Get(md5('cat_' . $key));
         }
         $widget->addCheckbox($key, $_SESSION['profile_plus']['Kategorie'][$key], URLHelper::getLink('?', array(md5('cat_' . $key) => 1)), URLHelper::getLink('?', array(md5('cat_' . $key) => 0)));
     }
     if (Request::Get(md5('cat_Sonstiges')) != null) {
         $_SESSION['profile_plus']['Kategorie']['Sonstiges'] = Request::Get(md5('cat_Sonstiges'));
     }
     $widget->addCheckbox(_('Sonstiges'), $_SESSION['profile_plus']['Kategorie']['Sonstiges'], URLHelper::getLink('?', array(md5('cat_Sonstiges') => 1)), URLHelper::getLink('?', array(md5('cat_Sonstiges') => 0)));
     $sidebar->addWidget($widget, "Kategorien");
     /*$widget = new OptionsWidget();
       $widget->setTitle(_('Komplexität'));
       $widget->addCheckbox(_('Standard'), $_SESSION['profile_plus']['Komplex'][1],
           URLHelper::getLink('?', array('Komplex1' => 1)), URLHelper::getLink('?', array('Komplex1' => 0)));
       $widget->addCheckbox(_('Erweitert'), $_SESSION['profile_plus']['Komplex'][2],
           URLHelper::getLink('?', array('Komplex2' => 1)), URLHelper::getLink('?', array('Komplex2' => 0)));
       $widget->addCheckbox(_('Intensiv'), $_SESSION['profile_plus']['Komplex'][3],
           URLHelper::getLink('?', array('Komplex3' => 1)), URLHelper::getLink('?', array('Komplex3' => 0)));
       $sidebar->addWidget($widget, "Komplex");*/
     $widget = new ActionsWidget();
     $widget->setTitle(_("Ansichten"));
     if ($_SESSION['profile_plus']['View'] == 'openall') {
         $widget->addLink(_("Alles zuklappen"), URLHelper::getLink('?', array('mode' => 'closeall')), Icon::create('assessment', 'clickable'));
     } else {
         $widget->addLink(_("Alles aufklappen"), URLHelper::getLink('?', array('mode' => 'openall')), Icon::create('assessment', 'clickable'));
     }
     if ($_SESSION['profile_plus']['displaystyle'] == 'category') {
         $widget->addLink(_("Alphabetische Anzeige ohne Kategorien"), URLHelper::getLink('?', array('displaystyle' => 'alphabetical')), Icon::create('assessment', 'clickable'));
     } else {
         $widget->addLink(_("Anzeige nach Kategorien"), URLHelper::getLink('?', array('displaystyle' => 'category')), Icon::create('assessment', 'clickable'));
     }
     $widget->addLink(_('Alle Inhaltselemente aktivieren'), $this->url_for('profilemodules/reset/true'), Icon::create('accept', 'clickable'));
     $widget->addLink(_('Alle Inhaltselemente deaktivieren'), $this->url_for('profilemodules/reset'), Icon::create('decline', 'clickable'));
     $sidebar->addWidget($widget);
     $plusconfig['profile_plus'] = $_SESSION['profile_plus'];
     UserConfig::get($GLOBALS['user']->id)->store(PLUS_SETTINGS, $plusconfig);
 }
Пример #9
0
 /**
  * Adds view filter to the sidebar
  * @param array $configs
  */
 private function setViewWidget($configs = array())
 {
     $configs = $configs ?: array();
     $checkbox_widget = new OptionsWidget();
     $checkbox_widget->setTitle(_('Darstellungs-Filter'));
     foreach ($this->getViewFilters() as $index => $label) {
         $state = in_array($index, $configs);
         $checkbox_widget->addCheckbox($label, $state, $this->url_for('admin/courses/set_view_filter/' . $index . '/' . $state));
     }
     Sidebar::get()->addWidget($checkbox_widget, 'views');
 }
Пример #10
0
$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');
?>
<div style="text-align: center; font-weight: bold; font-size: 1.2em">
    <? if($inst_mode) : ?>
    <?php 
echo $institute_name;
?>
: <?php 
echo _('Stundenplan im');
?>
    <? else : ?>
Пример #11
0
 /**
  * Defines the elements in the sidebar.
  *
  * @param String $current_entry Directory entry id of the current folder
  * @param String $current_dir   File id of the current folder
  */
 private function setupSidebar($current_entry, $current_dir, $page = 1)
 {
     $root_dir = RootDirectory::find($this->context_id);
     $root_count = $root_dir->countFiles(true, false);
     $sidebar = Sidebar::get();
     $sidebar->setImage('sidebar/files-sidebar.png');
     if (Config::get()->PERSONALDOCUMENT_OPEN_ACCESS && $GLOBALS['user']->id !== $this->context_id) {
         $title = sprintf(_('Dateien von %s'), $this->owner->getFullname());
         $sidebar->setTitle($title);
     }
     if ($this->full_access) {
         $widget = new ActionsWidget();
         $widget->addLink(_('Datei hochladen'), $this->url_for('document/files/upload/' . $current_entry . '/' . $page), Icon::create('upload', 'clickable'), $this->userConfig['forbidden'] ? array('disabled' => '', 'title' => _('Ihre Upload-Funktion wurde gesperrt.')) : array())->asDialog('size=auto');
         $widget->addLink(_('Neuen Ordner erstellen'), $this->url_for('document/folder/create/' . $current_entry), Icon::create('folder-empty+add', 'clickable'))->asDialog('size=auto');
         $attributes = $root_count > 0 ? array() : array('disabled' => true, 'title' => _('Ihr Dateibereich enthält keine Dateien'));
         $widget->addLink(_('Dateibereich leeren'), $this->url_for('document/folder/delete/all'), Icon::create('trash', 'clickable'), $attributes);
         $sidebar->addWidget($widget);
     }
     $widget = new OptionsWidget();
     $widget->setTitle(_('Darstellung anpassen'));
     foreach (self::$possible_limits as $limit) {
         $widget->addRadioButton(sprintf(_('%u Einträge pro Seite anzeigen'), $limit), $this->url_for('document/files/settings/' . $limit . '/' . $page . '/' . $current_entry), $limit == $this->limit);
     }
     $sidebar->addWidget($widget);
     // Show export options only if zip extension is loaded
     // TODO: Implement fallback
     if (extension_loaded('zip')) {
         $widget = new ExportWidget();
         $this_dir = $current_dir === $this->context_id ? $root_dir : StudipDirectory::find($current_dir);
         $attributes = $this_dir->countFiles(true, false) > 0 ? array() : array('disabled' => true, 'title' => _('Dieser Ordner enthält keine Dateien'));
         $widget->addLink(_('Inhalt dieses Ordners herunterladen'), $this->url_for('document/download/' . $current_dir), Icon::create('file-archive', 'clickable'), $attributes);
         $attributes = $root_count > 0 ? array() : array('disabled' => true, 'title' => _('Ihr Dateibereich enthält keine Dateien'));
         $widget->addLink(_('Alle Dateien herunterladen'), $this->url_for('document/download/' . $this->context_id), Icon::create('download', 'clickable'), $attributes);
         $sidebar->addWidget($widget);
     }
 }
Пример #12
0
/* * * * * * * * * * * * * * * *
 * * * *     V I E W     * * * *
 * * * * * * * * * * * * * * * */

list($self_assign_all, $self_assign_exclusive) = CheckSelfAssignAll($range_id);

$sidebar = Sidebar::get();
$sidebar->setImage('sidebar/group-sidebar.png');

// get statusgroups, to check if there are any
$statusgruppen = GetAllStatusgruppen($range_id);

// do we have some roles already?
if ($statusgruppen && sizeof($statusgruppen) > 0) {
    $actions = new OptionsWidget();
    $actions->setTitle(_('Aktionen'));

    $actions->addCheckbox(_('Selbsteintragung in allen Gruppen aktiviert?'),
                          $self_assign_all,
                          URLHelper::getLink('?cmd=activateSelfAssignAll'),
                          URLHelper::getLink('?cmd=deactivateSelfAssignAll'));

    $actions->addCheckbox(_('Selbsteintragung in nur einer Gruppe aktiviert?'),
                          $self_assign_exclusive,
                          URLHelper::getLink('?cmd=activateSelfAssignExclusive'),
                          URLHelper::getLink('?cmd=deactivateSelfAssignExclusive'));

    $sidebar->addWidget($actions);

    // open the template for tree-view of roles
Пример #13
0
/**
* 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();
}
Пример #14
0
$widget = new OptionsWidget();
$widget->setTitle(_('Suchoptionen'));
$widget->addCheckbox(_('Erweiterte Suche anzeigen'),
                     $_SESSION['sem_browse_data']['cmd'] == "xts",
                     URLHelper::getLink('?cmd=xts&level=f'),
                     URLHelper::getLink('?cmd=qs&level=f'));

$sidebar->addWidget($widget);

if ($sem_browse_obj->show_result && count($_SESSION['sem_browse_data']['search_result'])){
    $actions = new ActionsWidget();
    $actions->addLink(_("Download des Ergebnisses"), URLHelper::getURL("dispatch.php/search/courses/export_results"), Icon::create('file-office', 'clickable'));
    $sidebar->addWidget($actions);

    $group_by_links = "";
    $grouping = new OptionsWidget();
    $grouping->setTitle(_("Suchergebnis gruppieren:"));
    foreach ($sem_browse_obj->group_by_fields as $i => $field){
        $grouping->addRadioButton(
            $field['name'],
            URLHelper::getLink('?', array('group_by' => $i, 'keep_result_set' => 1)),
            $_SESSION['sem_browse_data']['group_by'] == $i
        );
    }
    $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(