本文整理汇总了PHP中Navigation::getItem方法的典型用法代码示例。如果您正苦于以下问题:PHP Navigation::getItem方法的具体用法?PHP Navigation::getItem怎么用?PHP Navigation::getItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Navigation
的用法示例。
在下文中一共展示了Navigation::getItem方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
parent::__construct();
if (false) {
//Suche ersetzen
if (Navigation::hasItem("/search")) {
$nav = Navigation::getItem("/search");
$nav->setURL(PluginEngine::getURL($this, array(), "search"));
foreach ($nav->getSubNavigation() as $name => $nav_object) {
$nav->removeSubNavigation($name);
}
$tab = new AutoNavigation(_("Suche"), PluginEngine::getURL($this, array(), "search"));
$nav->addSubNavigation('search', $tab);
}
} else {
//Suche erweitern
if (Navigation::hasItem("/search")) {
$nav = Navigation::getItem("/search");
$nav->setURL(PluginEngine::getURL($this, array(), "search"));
$tab = new AutoNavigation(_("Suche"), PluginEngine::getURL($this, array(), "search"));
$nav->addSubNavigation('search', $tab);
}
}
//Observer definieren:
NotificationCenter::addObserver($this, "show_user_avatar", "WillDisplaySearchResultItem");
NotificationCenter::addObserver($this, "show_seminar_avatar", "WillDisplaySearchResultItem");
NotificationCenter::addObserver($this, "show_document_avatar", "WillDisplaySearchResultItem");
NotificationCenter::addObserver($this, "add_calculator", "LastAlteringOfSearchResults");
NotificationCenter::addObserver($this, "filter_study_areas", "GlobalSearchFilter");
}
示例2: sortCourseNavigation
private function sortCourseNavigation()
{
global $perm;
$restNavigation = array();
$newNavigation = Navigation::getItem('/course');
foreach (Navigation::getItem('/course') as $key => $tab) {
$block = SeminarTab::findOneBySQL('seminar_id = ? AND tab IN (?) ORDER BY position ASC', array($this->getSeminarId(), $key));
if ($block) {
$tab->setTitle($block->getValue('title'));
if ($block->getValue('tn_visible') == true || $perm->have_studip_perm('dozent', Request::get('cid'))) {
$subNavigations[$block->getValue('position')][$key] = $tab;
}
} else {
//keine Info bezüglich Reihenfolge also hinten dran
//greift bei neu aktivierten Navigationselementen
$restNavigation[$key] = $tab;
}
$newNavigation->removeSubNavigation($key);
}
ksort($subNavigations);
foreach ($subNavigations as $subNavs) {
foreach ($subNavs as $key => $subNav) {
$newNavigation->addSubNavigation($key, $subNav);
}
}
if (count($restNavigation) > 0) {
foreach ($restNavigation as $key => $restNav) {
$newNavigation->addSubNavigation($key, $restNav);
}
}
Navigation::addItem('/course', $newNavigation);
}
示例3: index_action
/**
* show the administration page for mass-editing forum-entries
*/
function index_action()
{
ForumPerm::check('admin', $this->getId());
$nav = Navigation::getItem('course/forum2');
$nav->setImage(Icon::create('forum', 'info'));
Navigation::activateItem('course/forum2/admin');
$list = ForumEntry::getList('flat', $this->getId());
// sort by cat
$new_list = array();
// iterate over all categories and add the belonging areas to them
foreach ($categories = ForumCat::getListWithAreas($this->getId(), false) as $category) {
if ($category['topic_id']) {
$new_list[$category['category_id']][$category['topic_id']] = $list['list'][$category['topic_id']];
unset($list['list'][$category['topic_id']]);
} else {
if (ForumPerm::has('add_area', $this->seminar_id)) {
$new_list[$category['category_id']] = array();
}
}
$this->categories[$category['category_id']] = $category['entry_name'];
}
if (!empty($list['list'])) {
// append the remaining entries to the standard category
$new_list[$this->getId()] = array_merge((array) $new_list[$this->getId()], $list['list']);
}
$this->list = $new_list;
}
示例4: __construct
public function __construct()
{
parent::__construct();
if ($GLOBALS['perm']->have_perm("root")) {
$processes = FleximportProcess::findBySQL("1=1 ORDER BY name ASC");
$navigation = new Navigation($this->getDisplayName());
$navigation->setURL(PluginEngine::getURL($this, array(), 'import/overview' . (count($processes) ? "/" . $processes[0]['process_id'] : "")));
Navigation::addItem('/start/fleximport', $navigation);
Navigation::addItem('/fleximport', $navigation);
if (count($processes)) {
foreach ($processes as $process) {
$navigation = new Navigation($process['name'], PluginEngine::getURL($this, array(), 'import/overview/' . $process->getId()));
Navigation::addItem('/fleximport/process_' . $process->getId(), $navigation);
}
} else {
$navigation = new Navigation(_("Import"), PluginEngine::getURL($this, array(), 'import/overview'));
Navigation::addItem('/fleximport/overview', $navigation);
}
$navigation = new Navigation(_("Konfiguration"), PluginEngine::getURL($this, array(), 'config/overview'));
Navigation::addItem('/fleximport/config', $navigation);
if (FleximportConfig::get("DISPLAY_AT_HEADER")) {
if (is_numeric(FleximportConfig::get("DISPLAY_AT_HEADER"))) {
Navigation::getItem('/fleximport')->setImage(version_compare($GLOBALS['SOFTWARE_VERSION'], "3.4", ">=") ? Icon::create("install", "navigation") : Assets::image_path("icons/lightblue/install.svg"));
} else {
Navigation::getItem('/fleximport')->setImage(version_compare($GLOBALS['SOFTWARE_VERSION'], "3.4", ">=") ? Icon::create(FleximportConfig::get("DISPLAY_AT_HEADER"), "navigation") : FleximportConfig::get("DISPLAY_AT_HEADER"));
}
}
}
}
示例5: before_filter
public function before_filter(&$action, &$args)
{
parent::before_filter($action, $args);
PageLayout::setTitle(_('Studiengruppen suchen'));
Navigation::activateItem('/community/studygroups/browse');
PageLayout::setHelpKeyword('Basis.SuchenStudiengruppen');
// add skip link
SkipLinks::addIndex(Navigation::getItem('/community/studygroups/browse')->getTitle(), 'layout_content', 100);
Sidebar::get()->setImage('sidebar/studygroup-sidebar.png');
}
示例6: configuration_action
public function configuration_action()
{
$template_factory = new Flexi_TemplateFactory(__DIR__ . '/templates');
$template = $template_factory->open('edit');
$template->links = Navigation::getItem('/start');
$template->config = WidgetHelper::getWidgetUserConfig($GLOBALS['user']->id, 'QUICK_SELECTION');
$template->plugin = $this;
header('X-Title: ' . _('Schnellzugriff konfigurieren'));
echo studip_utf8encode($template->render());
}
示例7: index_action
public function index_action()
{
global $perm;
$this->courseadmin = $perm->have_studip_perm('tutor', $this->course_id);
//Tabs und zugehörige Einstellung laden
$position = 100;
foreach (Navigation::getItem('course') as $key => $tab) {
//systemtabs anlegen/abfragen
$query = "SELECT title FROM `system_tabs` WHERE tab IN (:key)";
$statement = DBManager::get()->prepare($query);
$statement->execute(array('key' => $key));
$orig_title = $statement->fetchAll(PDO::FETCH_ASSOC);
//Spezialfall Reiter die nur TN sehen (zB Courseware Fortschrittsübersicht)
if ($key == 'mooc_courseware') {
$query2 = "SELECT title FROM `system_tabs` WHERE tab IN (:key)";
$statement2 = DBManager::get()->prepare($query2);
$statement2->execute(array('key' => 'mooc_progress'));
$orig_title2 = $statement2->fetchAll(PDO::FETCH_ASSOC);
if (!$orig_title2[0]) {
$values2 = array('id' => md5('mooc_progress'), 'tab' => 'mooc_progress', 'title' => 'Fortschrittsübersicht');
$query2 = "INSERT INTO `system_tabs` (`id`, `tab`, `title`) VALUES (:id, :tab, :title)";
$statement2 = DBManager::get()->prepare($query2);
$statement2->execute($values2);
$orig_title2[0]['title'] = "Fortschrittsübersicht";
}
$block = SeminarTab::findOneBySQL('seminar_id = ? AND tab IN (?) ORDER BY position ASC', array($this->course_id, 'mooc_progress'));
if ($block) {
$this->tabs[] = array('tab' => $block->getValue('tab'), 'title' => $block->getValue('title'), 'position' => $block->getValue('position'), 'orig_title' => $orig_title2[0]['title'], 'visible' => $block->getValue('tn_visible') ? 'checked' : '');
} else {
$this->tabs[] = array('tab' => 'mooc_progress', 'title' => 'Fortschrittsübersicht', 'position' => $position, 'orig_title' => $orig_title2[0]['title'], 'visible' => 'checked');
}
$position++;
}
//Ende Sonderfall
if (!$orig_title[0]) {
$values = array('id' => md5($key), 'tab' => $key, 'title' => $tab->getTitle());
$query = "INSERT INTO `system_tabs` (`id`, `tab`, `title`) VALUES (:id, :tab, :title)";
$statement = DBManager::get()->prepare($query);
$statement->execute($values);
$orig_title[0]['title'] = $tab->getTitle();
}
if (!in_array($tab->getTitle(), $this->ignore_tabs)) {
$block = SeminarTab::findOneBySQL('seminar_id = ? AND tab IN (?) ORDER BY position ASC', array($this->course_id, $key));
if ($block && !in_array($key, $this->ignore_tabs)) {
$this->tabs[] = array('tab' => $block->getValue('tab'), 'title' => $block->getValue('title'), 'position' => $block->getValue('position'), 'orig_title' => $orig_title[0]['title'], 'visible' => $block->getValue('tn_visible') ? 'checked' : '');
} else {
if (!in_array($key, $this->ignore_tabs)) {
$this->tabs[] = array('tab' => $key, 'title' => $tab->getTitle(), 'position' => $position, 'orig_title' => $orig_title[0]['title'], 'visible' => 'checked');
}
}
$position++;
}
}
$this->tabs = $this->array_sort($this->tabs, 'position', SORT_ASC);
}
示例8: before_filter
public function before_filter(&$action, &$args)
{
parent::before_filter($action, $args);
global $perm;
checkObject();
checkObjectModule("participants");
$this->course_id = $_SESSION['SessSemName'][1];
$this->course_title = $_SESSION['SessSemName'][0];
$this->user_id = $GLOBALS['auth']->auth['uid'];
// Check dozent-perms
if ($perm->have_studip_perm('dozent', $this->course_id)) {
$this->is_dozent = true;
}
// Check tutor-perms
if ($perm->have_studip_perm('tutor', $this->course_id)) {
$this->is_tutor = true;
}
// Check autor-perms
if ($perm->have_studip_perm('autor', $this->course_id)) {
$this->is_autor = true;
}
if ($this->is_tutor) {
PageLayout::setHelpKeyword("Basis.VeranstaltungenVerwaltenTeilnehmer");
} else {
PageLayout::setHelpKeyword("Basis.InVeranstaltungTeilnehmer");
}
// Check lock rules
$this->dozent_is_locked = LockRules::Check($this->course_id, 'dozent');
$this->tutor_is_locked = LockRules::Check($this->course_id, 'tutor');
$this->is_locked = LockRules::Check($this->course_id, 'participants');
// Layoutsettings
PageLayout::setTitle(sprintf('%s - %s', Course::findCurrent()->getFullname(), _("Teilnehmende")));
PageLayout::addScript('members.js');
SkipLinks::addIndex(Navigation::getItem('/course/members')->getTitle(), 'main_content', 100);
object_set_visit_module('participants');
$this->last_visitdate = object_get_visit($this->course_id, 'participants');
// Check perms and set the last visit date
if (!$this->is_tutor) {
$this->last_visitdate = time() + 10;
}
// Get the max-page-value for the pagination
$this->max_per_page = Config::get()->ENTRIES_PER_PAGE;
$this->status_groups = array('dozent' => get_title_for_status('dozent', 2), 'tutor' => get_title_for_status('tutor', 2), 'autor' => get_title_for_status('autor', 2), 'user' => get_title_for_status('user', 2), 'accepted' => get_title_for_status('accepted', 2), 'awaiting' => _("Wartende Personen"), 'claiming' => _("Wartende Personen"));
// StatusGroups for the view
$this->decoratedStatusGroups = array('dozent' => get_title_for_status('dozent', 1), 'autor' => get_title_for_status('autor', 1), 'tutor' => get_title_for_status('tutor', 1), 'user' => get_title_for_status('user', 1));
//check for admission / waiting list
update_admission($this->course_id);
// Create new MembersModel, to get additionanl informations to a given Seminar
$this->members = new MembersModel($this->course_id, $this->course_title);
$this->members->checkUserVisibility();
// Set default sidebar image
$sidebar = Sidebar::get();
$sidebar->setImage('sidebar/person-sidebar.png');
}
示例9: index_action
/**
* The only method, loads the navigation object and displays it.
*/
public function index_action()
{
PageLayout::setTitle(_('Sitemap'));
foreach (Navigation::getItem('/start') as $nav) {
$nav->setEnabled(false);
}
$this->navigation = Navigation::getItem('/');
$this->quicklinks = Navigation::getItem('/links');
$this->footer = Navigation::getItem('/footer');
// Add sidebar
$sidebar = Sidebar::get();
$sidebar->setImage('sidebar/admin-sidebar.png');
$info = new InfoboxWidget();
$info->setTitle(_('Hinweise'));
$info->addElement(new WidgetElement(_('Auf dieser Seite finden Sie eine Übersicht über alle verfügbaren Seiten.')));
$sidebar->addWidget($info);
}
示例10: getNavigationArray
/**
* Returns the current navigation as an array.
*
* @return Array containing the navigation
*/
public static function getNavigationArray()
{
$navigation = array();
foreach (Navigation::getItem('/')->getSubNavigation() as $path => $nav) {
if (!$nav->isVisible(true)) {
continue;
}
$image = $nav->getImage();
$image_src = $image ? $image->asImagePath() : false;
$item = array('icon' => $image_src ? self::getAssetsURL($image_src) : false, 'title' => $nav->getTitle(), 'url' => self::getURL($nav->getURL()), 'active' => $nav->isActive());
if ($nav->getSubnavigation()) {
$item['children'] = self::getChildren($nav, $path);
}
$navigation[$path] = $item;
}
return $navigation;
}
示例11: before_filter
function before_filter(&$action, &$args)
{
global $SEM_TYPE, $SEM_CLASS;
parent::before_filter($action, $args);
checkObject();
$this->course = Course::findCurrent();
if (!$this->course) {
throw new CheckObjectException(_('Sie haben kein Objekt gewählt.'));
}
$this->course_id = $this->course->id;
PageLayout::setHelpKeyword("Basis.InVeranstaltungKurzinfo");
PageLayout::setTitle($GLOBALS['SessSemName']["header_line"] . " - " . _("Kurzinfo"));
Navigation::activateItem('/course/main/info');
// add skip link
SkipLinks::addIndex(Navigation::getItem('/course/main/info')->getTitle(), 'main_content', 100);
$this->sem = Seminar::getInstance($this->course_id);
$sem_class = $this->sem->getSemClass();
$this->studygroup_mode = $sem_class["studygroup_mode"];
}
示例12: show_action
function show_action()
{
$this->url_params = array();
if (Request::get('from')) {
$this->url_params['from'] = Request::get('from');
}
if (Request::get('open_node')) {
$this->url_params['open_node'] = Request::get('open_node');
}
if (!Request::isXhr()) {
Navigation::activateItem('course/admin/study_areas');
$sidebar = Sidebar::get();
$sidebar->setImage('sidebar/admin-sidebar.png');
if ($this->course) {
$links = new ActionsWidget();
foreach (Navigation::getItem('/course/admin/main') as $nav) {
if ($nav->isVisible(true)) {
$image = $nav->getImage();
$links->addLink($nav->getTitle(), URLHelper::getLink($nav->getURL(), array('studip_ticket' => Seminar_Session::get_ticket())), $image);
}
}
$sidebar->addWidget($links);
// Entry list for admin upwards.
if ($GLOBALS['perm']->have_studip_perm("admin", $GLOBALS['SessionSeminar'])) {
$list = new SelectorWidget();
$list->setUrl("?#admin_top_links");
$list->setSelectParameterName("cid");
foreach (AdminCourseFilter::get()->getCoursesForAdminWidget() as $seminar) {
$list->addElement(new SelectElement($seminar['Seminar_id'], $seminar['Name']), 'select-' . $seminar['Seminar_id']);
}
$list->setSelection($this->course->id);
$sidebar->addWidget($list);
}
}
}
if (Request::get('open_node')) {
$this->values['StudyAreasWizardStep']['open_node'] = Request::get('open_node');
}
$this->tree = $this->step->getStepTemplate($this->values, 0, 0);
}
示例13: jQuery
<script>
jQuery(function ($) {
STUDIP.Dialog.fromURL('<?php
echo $controller->url_for('messages/read/' . $message_id);
?>
');
});
</script>
<? 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"));
示例14: index_action
public function index_action()
{
$this->prelim_discussion = vorbesprechung($this->course->id);
$this->title = $this->course->getFullname();
$this->course_domains = UserDomain::getUserDomainsForSeminar($this->course->id);
$this->sem = new Seminar($this->course);
if ($studienmodulmanagement = PluginEngine::getPlugin('StudienmodulManagement')) {
foreach ($this->course->study_areas->filter(function ($m) {
return $m->isModule();
}) as $module) {
$this->studymodules[] = array('nav' => $studienmodulmanagement->getModuleInfoNavigation($module->id, $this->course->start_semester->id), 'title' => $studienmodulmanagement->getModuleTitle($module->id, $this->course->start_semester->id));
}
}
// Retrive display of sem_tree
if (Config::get()->COURSE_SEM_TREE_DISPLAY) {
$this->studyAreaTree = StudipStudyArea::backwards($this->course->study_areas);
} else {
$this->study_areas = $this->course->study_areas->filter(function ($m) {
return !$m->isModule();
});
}
if (Request::isXhr()) {
$this->set_layout(null);
$this->response->add_header('Content-Type', 'text/html;charset=Windows-1252');
header('X-Title: ' . $this->title);
} else {
PageLayout::setHelpKeyword("Basis.InVeranstaltungDetails");
PageLayout::setTitle($this->title . " - " . _("Details"));
PageLayout::addSqueezePackage('admission');
PageLayout::addSqueezePackage('enrolment');
if ($GLOBALS['SessionSeminar'] == $this->course->id) {
Navigation::activateItem('/course/main/details');
SkipLinks::addIndex(Navigation::getItem('/course/main/details')->getTitle(), 'main_content', 100);
} else {
$sidebarlink = true;
$enrolment_info = $this->sem->getEnrolmentInfo($GLOBALS['user']->id);
}
$sidebar = Sidebar::Get();
if ($sidebarlink) {
$sidebar->setContextAvatar(CourseAvatar::getAvatar($this->course->id));
}
$sidebar->setTitle(_('Details'));
$links = new ActionsWidget();
$links->addLink(_("Drucken"), URLHelper::getScriptLink("dispatch.php/course/details/index/" . $this->course->id), Icon::create('print', 'clickable'), array('class' => 'print_action', 'target' => '_blank'));
if ($enrolment_info['enrolment_allowed'] && $sidebarlink) {
if (in_array($enrolment_info['cause'], words('member root courseadmin'))) {
$abo_msg = _("direkt zur Veranstaltung");
} else {
$abo_msg = _("Zugang zur Veranstaltung");
}
$links->addLink($abo_msg, URLHelper::getScriptLink("dispatch.php/course/enrolment/apply/" . $this->course->id), Icon::create('door-enter', 'clickable'), array('data-dialog' => ''));
}
if (Config::get()->SCHEDULE_ENABLE && !$GLOBALS['perm']->have_studip_perm("user", $this->course->id) && !$GLOBALS['perm']->have_perm('admin') && $this->sem->getMetaDateCount()) {
$query = "SELECT COUNT(*) FROM schedule_seminare WHERE seminar_id = ? AND user_id = ?";
if (!DBManager::Get()->fetchColumn($query, array($this->course->id, $GLOBALS['user']->id))) {
$links->addLink(_("Nur im Stundenplan vormerken"), URLHelper::getLink("dispatch.php/calendar/schedule/addvirtual/" . $this->course->id), Icon::create('info', 'clickable'));
}
}
if ($this->send_from_search_page) {
$links->addLink(_("Zurück zur letzten Auswahl"), URLHelper::getLink($this->send_from_search_page), Icon::create('link-intern', 'clickable'));
}
if ($links->hasElements()) {
$sidebar->addWidget($links);
}
$sidebar->setImage('sidebar/seminar-sidebar.png');
$sidebar->setContextAvatar(CourseAvatar::getAvatar($this->course->id));
$sidebar = Sidebar::Get();
$sidebar->setImage('sidebar/seminar-sidebar.png');
$sidebar->setContextAvatar(CourseAvatar::getAvatar($this->course->id));
if ($enrolment_info['description']) {
PageLayout::postMessage(MessageBox::info($enrolment_info['description']));
}
}
}
示例15: if
?>
" type="audio/ogg">
<source src="<?php
echo Assets::url('sounds/blubb.mp3');
?>
" type="audio/mpeg">
</audio>
<? endif ?>
</li>
<? endif ?>
<? if (isset($search_semester_nr)) : ?>
<li>
</li>
<? endif ?>
<? if (Navigation::hasItem('/links')) : ?>
<? foreach (Navigation::getItem('/links') as $nav) : ?>
<? if ($nav->isVisible()) : ?>
<li <? if ($nav->isActive()) echo 'class="active"'; ?>>
<a
<? if (is_internal_url($url = $nav->getURL())) : ?>
href="<?php
echo URLHelper::getLink($url, $link_params);
?>
"
<? else : ?>
href="<?php
echo htmlReady($url);
?>
" target="_blank"
<? endif ?>
<? if ($nav->getDescription()): ?>