本文整理匯總了PHP中PageLayout::getTitle方法的典型用法代碼示例。如果您正苦於以下問題:PHP PageLayout::getTitle方法的具體用法?PHP PageLayout::getTitle怎麽用?PHP PageLayout::getTitle使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PageLayout
的用法示例。
在下文中一共展示了PageLayout::getTitle方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: before_filter
/**
* common tasks for all actions
*/
function before_filter(&$action, &$args)
{
global $perm;
parent::before_filter($action, $args);
if (Request::get('termin_id')) {
$this->dates[0] = new SingleDate(Request::option('termin_id'));
$this->course_id = $this->dates[0]->range_id;
}
if (Request::get('issue_id')) {
$this->issue_id = Request::option('issue_id');
$this->dates = array_values(array_map(function ($data) {
$d = new SingleDate();
$d->fillValuesFromArray($data);
return $d;
}, IssueDB::getDatesforIssue(Request::option('issue_id'))));
$this->course_id = $this->dates[0]->range_id;
}
if (!get_object_type($this->course_id, array('sem')) || SeminarCategories::GetBySeminarId($this->course_id)->studygroup_mode || !$perm->have_studip_perm("tutor", $this->course_id)) {
throw new Trails_Exception(400);
}
PageLayout::setHelpKeyword("Basis.VeranstaltungenVerwaltenAendernVonZeitenUndTerminen");
PageLayout::setTitle(Course::findCurrent()->getFullname() . " - " . _("Veranstaltungstermine absagen"));
$this->set_content_type('text/html;charset=windows-1252');
if (Request::isXhr()) {
$this->set_layout(null);
$this->response->add_header('X-Title', PageLayout::getTitle());
$request = Request::getInstance();
foreach ($request as $key => $value) {
$request[$key] = studip_utf8decode($value);
}
}
}
示例2: index_action
/**
* Displays the deputy information of a user.
*/
public function index_action()
{
if (Request::submitted('add_deputy') && ($deputy_id = Request::option('deputy_id'))) {
$this->check_ticket();
if (isDeputy($deputy_id, $this->user->user_id)) {
$this->reportError(_('%s ist bereits als Vertretung eingetragen.'), get_fullname($deputy_id, 'full'));
} else {
if ($deputy_id == $this->user->user_id) {
$this->reportError(_('Sie können sich nicht als Ihre eigene Vertretung eintragen!'));
} else {
if (addDeputy($deputy_id, $this->user->user_id)) {
$this->reportSuccess(_('%s wurde als Vertretung eingetragen.'), get_fullname($deputy_id, 'full'));
} else {
$this->reportError(_('Fehler beim Eintragen der Vertretung!'));
}
}
}
$this->redirect('settings/deputies');
return;
}
$deputies = getDeputies($this->user->user_id, true);
$exclude_users = array($this->user->user_id);
if (is_array($deputies)) {
$exclude_users = array_merge($exclude_users, array_map(function ($d) {
return $d['user_id'];
}, $deputies));
}
$this->deputies = $deputies;
$this->search = new PermissionSearch('user', _('Vor-, Nach- oder Benutzername'), 'user_id', array('permission' => getValidDeputyPerms(), 'exclude_user' => $exclude_users));
$sidebar = Sidebar::Get();
$sidebar->setTitle(PageLayout::getTitle());
$actions = new ActionsWidget();
// add "add dozent" to infobox
$mp = MultiPersonSearch::get('settings_add_deputy')->setLinkText(_('Neue Standardvertretung festlegen'))->setDefaultSelectedUser(array_keys($this->deputies))->setLinkIconPath('')->setTitle(_('Neue Standardvertretung festlegen'))->setExecuteURL(URLHelper::getLink('dispatch.php/settings/deputies/add_member'))->setSearchObject($this->search)->setNavigationItem('/links/settings/deputies')->render();
$element = LinkElement::fromHTML($mp, Icon::create('community+add', 'clickable'));
$actions->addElement($element);
Sidebar::Get()->addWidget($actions);
}
示例3: view_action
/**
* Zeigt die Grunddaten an. Man beachte, dass eventuell zuvor eine andere
* Action wie Set ausgeführt wurde, von der hierher weitergeleitet worden ist.
* Wichtige Daten dazu wurden dann über $this->flash übertragen.
*
* @param md5 $course_id
*/
public function view_action($course_id = null)
{
global $user, $perm, $_fullname_sql;
$deputies_enabled = get_config('DEPUTIES_ENABLE');
//damit QuickSearch funktioniert:
Request::set('new_doz_parameter', $this->flash['new_doz_parameter']);
if ($deputies_enabled) {
Request::set('new_dep_parameter', $this->flash['new_dep_parameter']);
}
Request::set('new_tut_parameter', $this->flash['new_tut_parameter']);
$this->course_id = Request::option('cid', $course_id);
Navigation::activateItem('/course/admin/details');
//Berechtigungscheck:
if (!$perm->have_studip_perm("tutor", $this->course_id)) {
throw new AccessDeniedException(_("Sie haben keine Berechtigung diese " . "Veranstaltung zu verändern."));
}
//Kopf initialisieren:
PageLayout::setHelpKeyword("Basis.VeranstaltungenVerwaltenGrunddaten");
PageLayout::setTitle(_("Verwaltung der Grunddaten"));
if ($this->course_id) {
PageLayout::setTitle(Course::find($this->course_id)->getFullname() . " - " . PageLayout::getTitle());
}
//Daten sammeln:
$sem = Seminar::getInstance($this->course_id);
$data = $sem->getData();
//Erster Reiter des Akkordions: Grundeinstellungen
$this->attributes = array();
$this->attributes[] = array('title' => _("Name der Veranstaltung"), 'name' => "course_name", 'must' => true, 'type' => 'text', 'value' => $data['name'], 'locked' => LockRules::Check($this->course_id, 'Name'));
$this->attributes[] = array('title' => _("Untertitel der Veranstaltung"), 'name' => "course_subtitle", 'type' => 'text', 'value' => $data['subtitle'], 'locked' => LockRules::Check($this->course_id, 'Untertitel'));
$sem_types = array();
if ($perm->have_perm("admin")) {
foreach (SemClass::getClasses() as $sc) {
foreach ($sc->getSemTypes() as $st) {
if (!$sc['course_creation_forbidden']) {
$sem_types[$st['id']] = $st['name'] . ' (' . $sc['name'] . ')';
}
}
}
} else {
$sc = $sem->getSemClass();
foreach ($sc->getSemTypes() as $st) {
$sem_types[$st['id']] = $st['name'] . ' (' . $sc['name'] . ')';
}
}
if (!isset($sem_types[$data['status']])) {
$sem_types[$data['status']] = $sem->getSemType()->offsetGet('name');
}
$this->attributes[] = array('title' => _("Typ der Veranstaltung"), 'name' => "course_status", 'must' => true, 'type' => 'select', 'value' => $data['status'], 'locked' => LockRules::Check($this->course_id, 'status'), 'choices' => array_map('htmlReady', $sem_types));
$this->attributes[] = array('title' => _("Art der Veranstaltung"), 'name' => "course_form", 'type' => 'text', 'value' => $data['form'], 'locked' => LockRules::Check($this->course_id, 'art'));
$this->attributes[] = array('title' => _("Veranstaltungs-Nummer"), 'name' => "course_seminar_number", 'type' => 'text', 'value' => $data['seminar_number'], 'locked' => LockRules::Check($this->course_id, 'VeranstaltungsNummer'));
$this->attributes[] = array('title' => _("ECTS-Punkte"), 'name' => "course_ects", 'type' => 'text', 'value' => $data['ects'], 'locked' => LockRules::Check($this->course_id, 'ects'));
$this->attributes[] = array('title' => _("max. Teilnehmerzahl"), 'name' => "course_admission_turnout", 'must' => false, 'type' => 'number', 'value' => $data['admission_turnout'], 'locked' => LockRules::Check($this->course_id, 'admission_turnout'), 'min' => '0');
$this->attributes[] = array('title' => _("Beschreibung"), 'name' => "course_description", 'type' => 'textarea', 'value' => $data['description'], 'locked' => LockRules::Check($this->course_id, 'Beschreibung'));
//Zweiter Reiter: Institute
$this->institutional = array();
$institute = Institute::getMyInstitutes();
$choices = array();
foreach ($institute as $inst) {
//$choices[$inst['Institut_id']] = $inst['Name'];
$choices[$inst['Institut_id']] = ($inst['is_fak'] ? "<span style=\"font-weight: bold\">" : " ") . htmlReady($inst['Name']) . ($inst['is_fak'] ? "</span>" : "");
}
$this->institutional[] = array('title' => _("Heimat-Einrichtung"), 'name' => "course_institut_id", 'must' => true, 'type' => 'select', 'value' => $data['institut_id'], 'choices' => $choices, 'locked' => LockRules::Check($this->course_id, 'Institut_id'));
$institute = Institute::getInstitutes();
$choices = array();
foreach ($institute as $inst) {
$choices[$inst['Institut_id']] = ($inst['is_fak'] ? "<span style=\"font-weight: bold\">" : " ") . htmlReady($inst['Name']) . ($inst['is_fak'] ? "</span>" : "");
}
$sem_institutes = $sem->getInstitutes();
$inst = array_flip($sem_institutes);
unset($inst[$sem->institut_id]);
$inst = array_flip($inst);
$this->institutional[] = array('title' => _("beteiligte Einrichtungen"), 'name' => "related_institutes[]", 'type' => 'multiselect', 'value' => $inst, 'choices' => $choices, 'locked' => LockRules::Check($this->course_id, 'seminar_inst'));
$this->dozent_is_locked = LockRules::Check($this->course_id, 'dozent');
$this->tutor_is_locked = LockRules::Check($this->course_id, 'tutor');
//Dritter Reiter: Personal
$this->dozenten = $sem->getMembers('dozent');
$instUsers = new SimpleCollection(InstituteMember::findByInstituteAndStatus($sem->getInstitutId(), 'dozent'));
$this->lecturersOfInstitute = $instUsers->pluck('user_id');
if (SeminarCategories::getByTypeId($sem->status)->only_inst_user) {
$search_template = "user_inst_not_already_in_sem";
} else {
$search_template = "user_not_already_in_sem";
}
$this->dozentUserSearch = new PermissionSearch($search_template, sprintf(_("%s suchen"), get_title_for_status('dozent', 1, $sem->status)), "user_id", array('permission' => 'dozent', 'seminar_id' => $this->course_id, 'sem_perm' => 'dozent', 'institute' => $sem_institutes));
$this->dozenten_title = get_title_for_status('dozent', 1, $sem->status);
$this->deputies_enabled = $deputies_enabled;
if ($this->deputies_enabled) {
$this->deputies = getDeputies($this->course_id);
$this->deputySearch = new PermissionSearch("user_not_already_in_sem_or_deputy", sprintf(_("%s suchen"), get_title_for_status('deputy', 1, $sem->status)), "user_id", array('permission' => getValidDeputyPerms(), 'seminar_id' => $this->course_id));
$this->deputy_title = get_title_for_status('deputy', 1, $sem->status);
}
$this->tutoren = $sem->getMembers('tutor');
$this->tutorUserSearch = new PermissionSearch($search_template, sprintf(_("%s suchen"), get_title_for_status('tutor', 1, $sem->status)), "user_id", array('permission' => array('dozent', 'tutor'), 'seminar_id' => $this->course_id, 'sem_perm' => array('dozent', 'tutor'), 'institute' => $sem_institutes));
//.........這裏部分代碼省略.........
示例4: permissions_action
/**
*
**/
public function permissions_action($consumer_key = null)
{
if (Request::submitted('store')) {
$perms = $_POST['permission'];
$permissions = RestIP\Router::getInstance($consumer_key ?: null)->getPermissions();
foreach ($_POST['permission'] as $route => $methods) {
foreach ($methods as $method => $granted) {
$permissions->set(urldecode($route), urldecode($method), (bool) $granted);
}
}
PageLayout::postMessage(MessageBox::success(_('Die Zugriffsberechtigungen wurden erfolgreich gespeichert')));
$this->redirect($consumer_key ? 'admin' : 'admin/permissions');
return;
}
$title = $consumer_key ? 'Zugriffsberechtigungen' : 'Globale Zugriffsberechtigungen';
$title .= ' - ' . PageLayout::getTitle();
PageLayout::setTitle($title);
$this->consumer_key = $consumer_key;
$this->router = RestIP\Router::getInstance($consumer_key);
$this->routes = $this->router->getRoutes();
$this->descriptions = $this->router->getDescriptions();
$this->permissions = $this->router->getPermissions();
$this->global = $consumer_key ? RestIP\Router::getInstance()->getPermissions() : false;
}
示例5: edit_list_action
/**
* Displays a page for literature list administration.
*/
public function edit_list_action()
{
global $_msg;
if (Request::option('_range_id') == "self") {
$this->_range_id = $GLOBALS['user']->id;
} else {
if (Request::option('_range_id')) {
$this->_range_id = Request::option('_range_id');
} else {
if (Request::get('admin_inst_id')) {
$this->view = 'lit_inst';
$this->_range_id = Request::option('admin_inst_id');
} else {
$this->_range_id = $_SESSION['_lit_range'];
}
}
}
if (!$this->_range_id) {
$this->_range_id = $GLOBALS['user']->id;
}
$_SESSION['_lit_range'] = $this->_range_id;
require_once "lib/classes/lit_import_plugins/StudipLitImportPluginAbstract.class.php";
PageLayout::setHelpKeyword("Basis.LiteraturListen");
PageLayout::setTitle(_("Verwaltung von Literaturlisten"));
if (Request::option('list') || Request::option('view') || Request::option('view_mode') || $this->_range_id != $GLOBALS['user']->id) {
Navigation::activateItem('/course/literature/edit');
$this->_range_id = $_SESSION['SessSemName'][1] ? $_SESSION['SessSemName'][1] : $this->_range_id;
} else {
Navigation::activateItem('/tools/literature/edit_list');
closeObject();
}
$_the_treeview = new StudipLitListViewAdmin($this->_range_id);
$_the_tree =& $_the_treeview->tree;
//Literaturlisten-Import
$cmd = Request::option('cmd');
$xmlfile = $_FILES['xmlfile']['tmp_name'];
$xmlfile_name = $_FILES['xmlfile']['name'];
$xmlfile_size = $_FILES['xmlfile']['size'];
$this->plugin_name = Request::option('plugin_name');
if ($cmd == "import_lit_list" && $xmlfile) {
StudipLitImportPluginAbstract::use_lit_import_plugins($xmlfile, $xmlfile_size, $xmlfile_name, $this->plugin_name, $this->_range_id);
}
$this->msg = $_msg;
PageLayout::setTitle($_the_tree->root_name . " - " . PageLayout::getTitle());
//checking rights
if ($_the_tree->range_type == "sem" && !$GLOBALS['perm']->have_studip_perm("tutor", $this->_range_id) || ($_the_tree->range_type == "inst" || $_the_tree->range_type == "fak") && !$GLOBALS['perm']->have_studip_perm("autor", $this->_range_id)) {
throw new AccessDeniedException(_('Keine Berechtigung für diese Literaturliste.'));
}
$_the_treeview->parseCommand();
//always show existing lists
$_the_treeview->open_ranges['root'] = true;
//if there are no lists always open root element
if (!$_the_tree->hasKids('root')) {
$_the_treeview->open_items['root'] = true;
}
$_the_clipboard = StudipLitClipBoard::GetInstance();
$_the_clip_form =& $_the_clipboard->getFormObject();
if ($_the_clip_form->isClicked("clip_ok")) {
$clip_cmd = explode("_", $_the_clip_form->getFormFieldValue("clip_cmd"));
if ($clip_cmd[0] == "ins") {
if (is_array($_the_clip_form->getFormFieldValue("clip_content"))) {
$inserted = $_the_tree->insertElementBulk($_the_clip_form->getFormFieldValue("clip_content"), $clip_cmd[1]);
if ($inserted) {
$_the_tree->init();
$_the_treeview->open_ranges[$clip_cmd[1]] = true;
PageLayout::postMessage(MessageBox::success(sprintf(_("%s Einträge aus Ihrer Merkliste wurden in <b>%s</b> eingetragen."), $inserted, htmlReady($_the_tree->tree_data[$clip_cmd[1]]['name']))));
}
} else {
PageLayout::postMessage(MessageBox::info(_("Sie haben keinen Eintrag in Ihrer Merkliste ausgewählt!")));
}
}
$_the_clipboard->doClipCmd();
}
if (($this->lists = $_the_tree->getListIds()) && $_the_clipboard->getNumElements()) {
for ($i = 0; $i < count($this->lists); ++$i) {
$_the_clip_form->form_fields['clip_cmd']['options'][] = array('name' => my_substr(sprintf(_("In \"%s\" eintragen"), $_the_tree->tree_data[$this->lists[$i]]['name']), 0, 50), 'value' => 'ins_' . $this->lists[$i]);
}
}
$this->msg .= $_the_clipboard->msg;
if (is_array($_the_treeview->msg)) {
foreach ($_the_treeview->msg as $t_msg) {
if (!$this->msg || $this->msg && strpos($t_msg, $this->msg) === false) {
$this->msg .= $t_msg . "§";
}
}
}
$this->lists = $_the_tree->getKids('root');
if ($this->lists) {
$this->list_count['visible'] = 0;
$this->list_count['visible_entries'] = 0;
$this->list_count['invisible'] = 0;
$this->list_count['invisible_entries'] = 0;
for ($i = 0; $i < count($this->lists); ++$i) {
if ($_the_tree->tree_data[$this->lists[$i]]['visibility']) {
++$this->list_count['visible'];
$this->list_count['visible_entries'] += $_the_tree->getNumKids($this->lists[$i]);
} else {
//.........這裏部分代碼省略.........
示例6: htmlReady
<html>
<head>
<title><?php
echo htmlReady(PageLayout::getTitle());
?>
</title>
</head>
<body>
<? if (sizeof($dates)) : ?>
<table cellspacing="0" cellpadding="0" border="1" width="100%">
<tr>
<th colspan="3">
<h2><?php
echo htmlReady(PageLayout::getTitle());
?>
</h2>
</th>
</tr>
<?
$semester = new SemesterData();
$all_semester = $semester->getAllSemesterData();
foreach ($dates as $date) :
if ( ($grenze == 0) || ($grenze < $date['start']) ) {
foreach ($all_semester as $zwsem) {
if ( ($zwsem['beginn'] < $date['start']) && ($zwsem['ende'] > $date['start']) ) {
$grenze = $zwsem['ende'];
?>
示例7: getHeaderLine
PageLayout::setTitle(_("Verwaltung externer Seiten"));
if ($range_id != 'studip') {
Navigation::activateItem('/admin/institute/external');
require_once 'lib/admin_search.inc.php';
} else {
Navigation::activateItem('/admin/locations/external');
}
$mod=Request::quoted('mod');//Change header_line if open object
$header_line = getHeaderLine($range_id);
if ($header_line) {
PageLayout::setTitle($header_line." - ".PageLayout::getTitle());
foreach ($GLOBALS['EXTERN_MODULE_TYPES'] as $key => $type) {
if ($type["module"] == $mod) {
PageLayout::setTitle(PageLayout::getTitle() . " ({$GLOBALS['EXTERN_MODULE_TYPES'][$key]['name']})");
break;
}
}
}
// upload of configuration
if (Request::option('com') == "do_upload_config") {
$file_content = file_get_contents($_FILES['the_file']['tmp_name']);
// revert the changes done by indentJson
$file_content_wo_tabs = str_replace("\t", '', str_replace("\n", '', $file_content));
$jsonconfig = json_decode($file_content_wo_tabs, true);
// utf8-decode the values after json_decode has worked on it
示例8: setSidebar
/**
* 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);
}
示例9: after_filter
/**
* Callback function being called after an action is executed.
*
* @param string Name of the action to perform.
* @param array An array of arguments to the action.
*
* @return void
*/
function after_filter($action, $args)
{
parent::after_filter($action, $args);
if (Request::isXhr() && !isset($this->response->headers['X-Title']) && PageLayout::hasTitle()) {
$this->response->add_header('X-Title', PageLayout::getTitle());
}
if ($this->with_session) {
page_close();
}
}
示例10: index_action
/**
* show institute basicdata page
*
* @param mixed $i_id Optional institute id
* @throws AccessDeniedException
*/
public function index_action($i_id = false)
{
PageLayout::setTitle(_('Verwaltung der Grunddaten'));
Navigation::activateItem('/admin/institute/details');
//get ID from an open Institut
$i_view = $i_id ?: Request::option('i_view', $GLOBALS['SessSemName'][1]);
if (!$i_view) {
require_once 'lib/admin_search.inc.php';
// This search just died a little inside, so it should be safe to
// continue here but we nevertheless return just to be sure
return;
} elseif ($i_view === 'new') {
closeObject();
}
// allow only inst-admin and root to view / edit
if ($i_view && !$GLOBALS['perm']->have_studip_perm('admin', $i_view) && $i_view !== 'new') {
throw new AccessDeniedException();
}
//Change header_line if open object
$header_line = getHeaderLine($i_view);
if ($header_line) {
PageLayout::setTitle($header_line . ' - ' . PageLayout::getTitle());
}
if (Request::get('i_trykill')) {
$message = _('Sind Sie sicher, dass Sie diese Einrichtung löschen wollen?');
$post['i_kill'] = 1;
$post['studipticket'] = get_ticket();
$this->question = createQuestion2($message, $post, array(), $this->url_for('institute/basicdata/delete/' . $i_view));
}
$lockrule = LockRules::getObjectRule($i_view);
if ($lockrule->description && LockRules::CheckLockRulePermission($i_view, $lockrule['permission'])) {
PageLayout::postMessage(MessageBox::info(formatLinks($lockrule->description)));
}
// Load institute data
$institute = new Institute($i_view === 'new' ? null : $i_view);
//add the free administrable datafields
$datafields = array();
$localEntries = DataFieldEntry::getDataFieldEntries($institute->id, 'inst');
if ($localEntries) {
$invalidEntries = $this->flash['invalid_entries'] ?: array();
foreach ($localEntries as $entry) {
if (!$entry->isVisible()) {
continue;
}
$color = '#000000';
if (in_array($entry->getId(), $invalidEntries)) {
$color = '#ff0000';
}
$datafields[] = array('color' => $color, 'title' => $entry->getName(), 'value' => $GLOBALS['perm']->have_perm($entry->isEditable()) && !LockRules::Check($institute['Institut_id'], $entry->getId()) ? $entry->getHTML('datafields') : $entry->getDisplayValue());
}
}
// Read faculties if neccessary
if (count($institute->sub_institutes) === 0) {
if ($GLOBALS['perm']->have_perm('root')) {
$this->faculties = Institute::findBySQL('Institut_id = fakultaets_id ORDER BY Name ASC', array($i_view));
} else {
$temp = User::find($GLOBALS['user']->id)->institute_memberships->findBy('inst_perms', 'admin')->pluck('institute');
$institutes = SimpleORMapCollection::createFromArray($temp);
$faculties = $institutes->filter(function ($institute) {
return $institute->is_fak;
});
$this->faculties = $faculties;
}
}
// Indicates whether the current user is allowed to delete the institute
$this->may_delete = $i_view !== 'new' && !(count($institute->home_courses) || count($institute->sub_institutes)) && ($GLOBALS['perm']->have_perm('root') || $GLOBALS['perm']->is_fak_admin() && get_config('INST_FAK_ADMIN_PERMS') == 'all');
if (!$this->may_delete) {
//Set infotext for disabled delete-button
$reason_txt = _('Löschen nicht möglich.');
if (count($institute->home_courses) > 0) {
$reason_txt .= ' ';
$reason_txt .= sprintf(ngettext('Es ist eine Veranstaltung zugeordnet.', 'Es sind %u Veranstaltungen zugeordnet.', count($institute->home_courses)), count($institute->home_courses));
}
if (count($institute->sub_institutes) > 0) {
$reason_txt .= ' ';
$reason_txt .= sprintf(ngettext('Es ist eine Einrichtung zugeordnet.', 'Es sind %u Einrichtungen zugeordnet.', count($institute->sub_institutes)), count($institute->sub_institutes));
}
}
// Indicates whether the current user is allowed to change the faculty
$this->may_edit_faculty = $GLOBALS['perm']->is_fak_admin() && !LockRules::Check($institute['Institut_id'], 'fakultaets_id') && ($GLOBALS['perm']->have_studip_perm('admin', $institute['fakultaets_id']) || $i_view === 'new');
// Prepare template
$this->institute = $institute;
$this->i_view = $i_view;
$this->datafields = $datafields;
$this->reason_txt = $reason_txt;
}
示例11: setSidebar
private function setSidebar($action)
{
$sidebar = Sidebar::Get();
$sidebar->setTitle(PageLayout::getTitle() ?: _('Rollen'));
$sidebar->setImage('sidebar/roles-sidebar.png');
$views = new ViewsWidget();
$views->addLink(_('Rollen verwalten'), $this->url_for('admin/role'))->setActive($action === 'index');
$views->addLink(_('Personenzuweisungen bearbeiten'), $this->url_for('admin/role/assign_role'))->setActive($action === 'assign_role');
$views->addLink(_('Pluginzuweisungen bearbeiten'), $this->url_for('admin/role/assign_plugin_role'))->setActive($action === 'assign_plugin_role');
$views->addLink(_('Rollenzuweisungen anzeigen'), $this->url_for('admin/role/show_role'))->setActive($action === 'show_role');
$sidebar->addWidget($views);
$actions = new ActionsWidget();
$actions->addLink(_('Neue Rolle anlegen'), $this->url_for('admin/role/add'), Icon::create('add', 'clickable'))->asDialog('size=auto');
$sidebar->addWidget($actions);
}
示例12: apply_action
/**
* A person applies for a course.
*/
function apply_action()
{
$user_id = $GLOBALS['user']->id;
$courseset = CourseSet::getSetForCourse($this->course_id);
$this->course_name = PageLayout::getTitle();
if ($courseset) {
$errors = $courseset->checkAdmission($user_id, $this->course_id);
if (count($errors)) {
$this->courseset_message = $courseset->toString(true);
$this->admission_error = MessageBox::error(_("Die Anmeldung war nicht erfolgreich."), $errors);
foreach ($courseset->getAdmissionRules() as $rule) {
$admission_form .= $rule->getInput();
}
if ($admission_form) {
$this->admission_form = $admission_form;
}
} else {
if ($courseset->isSeatDistributionEnabled()) {
if ($courseset->hasAlgorithmRun()) {
if ($courseset->getSeatDistributionTime()) {
$msg = _("Die Plätze in dieser Veranstaltung wurden automatisch verteilt.");
}
if (StudipLock::get('enrolment' . $this->course_id)) {
$course = Course::find($this->course_id);
if ($course->getFreeSeats() && !$course->getNumWaiting()) {
$enrol_user = true;
} else {
if ($course->isWaitlistAvailable()) {
$seminar = new Seminar($course);
if ($seminar->addToWaitlist($user_id, 'last')) {
$msg_details[] = sprintf(_("Alle Plätze sind belegt, Sie wurden daher auf Platz %s der Warteliste gesetzt."), $maxpos);
}
} else {
$this->admission_error = MessageBox::error(_("Die Anmeldung war nicht erfolgreich. Alle Plätze sind belegt und es steht keine Warteliste zur Verfügung."));
}
}
} else {
$this->admission_error = MessageBox::error(_("Die Anmeldung war wegen technischer Probleme nicht erfolgreich. Bitte versuchen Sie es später noch einmal."));
}
} else {
$msg = _("Die Plätze in dieser Veranstaltung werden automatisch verteilt.");
if ($limit = $courseset->getAdmissionRule('LimitedAdmission')) {
$msg_details[] = sprintf(_("Diese Veranstaltung gehört zu einem Anmeldeset mit %s Veranstaltungen. Sie können maximal %s davon belegen. Bei der Verteilung werden die von Ihnen gewünschten Prioritäten berücksichtigt."), count($courseset->getCourses()), $limit->getMaxNumber());
$this->user_max_limit = $limit->getMaxNumberForUser($user_id);
if (get_config('IMPORTANT_SEMNUMBER')) {
$order = "ORDER BY VeranstaltungsNummer, Name";
} else {
$order = "ORDER BY Name";
}
$this->priocourses = Course::findMany($courseset->getCourses(), $order);
$this->user_prio = AdmissionPriority::getPrioritiesByUser($courseset->getId(), $user_id);
$this->max_limit = $limit->getMaxNumber();
$this->prio_stats = AdmissionPriority::getPrioritiesStats($courseset->getId());
$this->already_claimed = count($this->user_prio);
} else {
$this->priocourses = Course::find($this->course_id);
$this->already_claimed = array_key_exists($this->course_id, AdmissionPriority::getPrioritiesByUser($courseset->getId(), $user_id));
}
$msg_details[] = _("Zeitpunkt der automatischen Verteilung: ") . strftime("%x %X", $courseset->getSeatDistributionTime());
$this->num_claiming = count(AdmissionPriority::getPrioritiesByCourse($courseset->getId(), $this->course_id));
if ($this->already_claimed) {
$msg_details[] = _("Sie sind bereits für die Verteilung angemeldet.");
}
}
$this->courseset_message = MessageBox::info($msg, $msg_details);
} else {
$enrol_user = true;
}
}
} else {
$enrol_user = true;
}
if ($enrol_user) {
$course = Seminar::GetInstance($this->course_id);
if ($course->admission_prelim) {
if (!$course->isStudygroup() && $course->admission_prelim_txt && !Request::submitted('apply')) {
$this->admission_prelim_txt = $course->admission_prelim_txt;
$this->admission_prelim_comment = Config::get()->ADMISSION_PRELIM_COMMENT_ENABLE;
$this->admission_form = $this->render_template_as_string('course/enrolment/prelim');
} else {
if (Request::get('admission_comment')) {
$admission_comment = get_fullname() . ': ' . Request::get('admission_comment');
} else {
$admission_comment = '';
}
if ($course->addPreliminaryMember($user_id, $admission_comment)) {
if ($course->isStudygroup()) {
if (StudygroupModel::isInvited($user_id, $this->course_id)) {
// an invitation exists, so accept the join request automatically
$status = 'autor';
StudygroupModel::accept_user(get_username($user_id), $this->course_id);
StudygroupModel::cancelInvitation(get_username($user_id), $this->course_id);
$success = sprintf(_("Sie wurden in die Veranstaltung %s als %s eingetragen."), $course->getName(), get_title_for_status($status, 1));
PageLayout::postMessage(MessageBox::success($success));
} else {
$success = sprintf(_("Sie wurden auf die Anmeldeliste der Studiengruppe %s eingetragen. Die Moderatoren der Studiengruppe können Sie jetzt freischalten."), $course->getName());
PageLayout::postMessage(MessageBox::success($success));
//.........這裏部分代碼省略.........
示例13: permissions_action
/**
*
**/
public function permissions_action($consumer_id = null)
{
if (Request::submitted('store')) {
$perms = Request::getArray('permission');
$permissions = RESTAPI\ConsumerPermissions::get($consumer_id ?: 'global');
foreach ($perms as $route => $methods) {
foreach ($methods as $method => $granted) {
$permissions->set(urldecode($route), urldecode($method), (bool) $granted, true);
}
}
$permissions->store();
PageLayout::postMessage(MessageBox::success(_('Die Zugriffsberechtigungen wurden erfolgreich gespeichert')));
$this->redirect($consumer_id ? 'admin/api' : 'admin/api/permissions');
return;
}
$title = $consumer_id ? _('Zugriffsberechtigungen') : _('Globale Zugriffsberechtigungen');
$title .= ' - ' . PageLayout::getTitle();
PageLayout::setTitle($title);
$this->consumer_id = $consumer_id;
$this->router = RESTAPI\Router::getInstance();
$this->routes = $this->router->getRoutes(true, false);
$this->permissions = RESTAPI\ConsumerPermissions::get($consumer_id ?: 'global');
$this->global = $consumer_id ? RESTAPI\ConsumerPermissions::get('global') : false;
}
示例14: is_string
$icon = is_string($row['icon']) ? Icon::create2(str_replace('/black/', '/blue/', $row['icon'])) : $row['icon'];
$widget->addElement(new InfoboxElement($row['text'], $icon));
}
}
$sidebar->addWidget($widget);
}
unset($infobox);
}
?>
<!DOCTYPE html>
<html class="no-js">
<head>
<meta charset="WINDOWS-1252">
<title>
<?php
echo htmlReady(PageLayout::getTitle() . ' - ' . $GLOBALS['UNI_NAME_CLEAN']);
?>
</title>
<?php
// needs to be included in lib/include/html_head.inc.php as well
include 'app/views/WysiwygHtmlHeadBeforeJS.php';
?>
<?php
echo PageLayout::getHeadElements();
?>
<script src="<?php
echo URLHelper::getScriptLink('dispatch.php/localizations/' . $_SESSION['_language']);
?>
"></script>
示例15: array
if ($perm->have_perm('admin')) {
if (Navigation::hasItem('/browse/my_courses/list')) {
Navigation::activateItem('/browse/my_courses/list');
}
} else {
if (Navigation::hasItem('/course/admin/main/archive')) {
Navigation::activateItem('/course/admin/main/archive');
}
}
PageLayout::setTitle(_("Archivieren von Veranstaltungen"));
//Change header_line if open object
if ($SessSemName[1]) {
PageLayout::setTitle(getHeaderLine($SessSemName[1]) . " - " . PageLayout::getTitle());
}
// single delete (a Veranstaltung is open)
if ($SessSemName[1]) {
$archiv_sem[] = "_id_" . $SessSemName[1];
$archiv_sem[] = "on";
}
if (!is_array($archiv_sem)) {
$archiv_sem = Request::quotedArray('archiv_sem');
}
// Handlings....
// Kill current list and stuff
if (Request::option('new_session'))
$_SESSION['archiv_assi_data'] = array();