echo Studip\Button::createAccept(_('Übernehmen'), 'i_edit'); ?> <?php echo Studip\LinkButton::create(_('Löschen'), $controller->url_for('institute/basicdata/index/' . $i_view, array('i_trykill' => 1)), !$may_delete ? array('disabled' => '') : array()); ?> <? if (!$may_delete && strlen($reason_txt) > 0): ?> <?php echo tooltipIcon($reason_txt, true); ?> <? endif; ?> <? else: ?> <?php echo Studip\Button::create(_('Anlegen'), 'create'); ?> <? endif; ?> <input type="hidden" name="i_view" value="<?php echo $i_view; ?> "> </footer> </form> <?php $sidebar = Sidebar::get(); $sidebar->setImage('sidebar/institute-sidebar.png'); $widget = new ActionsWidget(); $widget->addLink(_('Infobild ändern'), URLHelper::getLink('dispatch.php/institute/avatar/update/' . $institute->id), Icon::create('edit', 'clickable')); if (InstituteAvatar::getAvatar($institute->id)->is_customized()) { $widget->addLink(_('Infobild löschen'), URLHelper::getLink('dispatch.php/institute/avatar/delete/' . $institute->id), Icon::create('trash', 'clickable')); } $sidebar->addWidget($widget);
<th style="text-align: center"><?php echo _("Inhalt"); ?> </th> <th></th> </tr> </thead> <tbody> <? foreach ($institutes as $values) : ?> <? $lastVisit = $values['visitdate']; ?> <? $instid = $values['institut_id'] ?> <tr> <td style="width:1px"></td> <td> <?php echo InstituteAvatar::getAvatar($instid)->getImageTag(Avatar::SMALL, tooltip2(htmlReady($values['name']))) != '' ? Icon::create('institute', 'clickable', ['title' => htmlReady($values['name'])])->asImg(20) : InstituteAvatar::getAvatar($instid)->getImageTag(Avatar::SMALL, tooltip2(htmlReady($values['name']))); ?> </td> <td style="text-align: left"> <a href="<?php echo URLHelper::getLink('dispatch.php/institute/overview', array('auswahl' => $instid)); ?> "> <?php echo htmlReady($GLOBALS['INST_TYPE'][$values["type"]]["name"] . ": " . $values["name"]); ?> </a> </td> <td style="text-align: left; white-space: nowrap">
/** * Renders the sidebar. * The sidebar will only be rendered if it actually contains any widgets. * It will use the template "sidebar.php" located at "templates/sidebar". * A notification is dispatched before and after the actual rendering * process. * * @return String The HTML code of the rendered sidebar. */ public function render() { $content = ''; if ($this->context_avatar === null) { $breadcrumbs = $this->getBreadCrumbs(); $keys = array_keys($breadcrumbs); if (reset($keys) === 'course') { $course = Course::findCurrent(); if ($course) { if ($course->getSemClass()->offsetGet('studygroup_mode')) { $avatar = StudygroupAvatar::getAvatar($course->id); } else { $avatar = CourseAvatar::getAvatar($course->id); } } else { $institute = Institute::findCurrent(); $avatar = InstituteAvatar::getAvatar($institute->id); } $this->setContextAvatar($avatar); } } NotificationCenter::postNotification('SidebarWillRender', $this); if ($this->hasWidgets()) { $template = $GLOBALS['template_factory']->open('sidebar/sidebar'); $template->widgets = $this->widgets; $template->image = $this->getImage(); $template->title = $this->getTitle(); $template->avatar = $this->context_avatar; $content = $template->render(); } NotificationCenter::postNotification('SidebarDidRender', $this); return $content; }
?> <? if (isset($error)) : ?> <?php echo MessageBox::error($error); ?> <? endif ?> <h1><?php echo _("Einrichtungsbild hochladen"); ?> </h1> <div style="float: left; padding: 0 1em 1em 0;"> <?php echo InstituteAvatar::getAvatar($institute_id)->getImageTag(Avatar::NORMAL); ?> </div> <form enctype="multipart/form-data" action="<?php echo $controller->url_for('institute/avatar/put/' . $institute_id); ?> " method="post" style="float: left"> <?php echo CSRFProtection::tokenTag(); ?> <input type="hidden" name="MAX_FILE_SIZE" value="1000000"> <label for="upload-input"><?php echo _("Wählen Sie ein Bild für die Einrichtung:");
/** * returns an html tag of the image of the searched item (if avatar enabled) * * @param string $id id of the item which can be username, user_id, Seminar_id or Institut_id * @param constant $size enum(NORMAL, SMALL, MEDIUM): size of the avatar * * @return string like "<img src="...avatar.jpg" ... >" */ public function getAvatarImageTag($id, $size = Avatar::SMALL, $options = array()) { switch ($this->avatarLike) { case "username": return Avatar::getAvatar(get_userid($id), $id)->getImageTag($size, $options); case "user_id": return Avatar::getAvatar($id)->getImageTag($size, $options); case "Seminar_id": case "Arbeitsgruppe_id": return CourseAvatar::getAvatar($id)->getImageTag($size, $options); case "Institut_id": return InstituteAvatar::getAvatar($id)->getImageTag($size, $options); } }
/** * This method is called to remove an avatar for a course. * * @return void */ public function delete_action() { InstituteAvatar::getAvatar($this->institute_id)->reset(); PageLayout::postMessage(MessageBox::success(_('Das Infobild wurde gelöscht.'))); $this->redirect(URLHelper::getUrl('dispatch.php/institute/basicdata/index/' . $this->institute_id)); }