当前位置: 首页>>代码示例>>PHP>>正文


PHP Navigation::hasItem方法代码示例

本文整理汇总了PHP中Navigation::hasItem方法的典型用法代码示例。如果您正苦于以下问题:PHP Navigation::hasItem方法的具体用法?PHP Navigation::hasItem怎么用?PHP Navigation::hasItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Navigation的用法示例。


在下文中一共展示了Navigation::hasItem方法的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");
 }
开发者ID:noackorama,项目名称:GlobalSearchPlugin,代码行数:30,代码来源:GlobalSearchPlugin.class.php

示例2: setNavigation

 /**
  * @deprecated
  */
 function setNavigation(StudipPluginNavigation $navigation)
 {
     parent::setNavigation($navigation);
     if (Navigation::hasItem('/admin/plugins')) {
         Navigation::addItem('/admin/plugins/' . $this->getPluginclassname(), $navigation);
     }
 }
开发者ID:ratbird,项目名称:hope,代码行数:10,代码来源:AbstractStudIPAdministrationPlugin.class.php

示例3: before_filter

 function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     if (Navigation::hasItem("/tools/questionnaire")) {
         Navigation::activateItem("/tools/questionnaire");
     }
     Sidebar::Get()->setImage(Assets::image_path("sidebar/evaluation-sidebar.png"));
     PageLayout::setTitle(_("Fragebögen"));
     class_exists("Test");
     //trigger autoloading
 }
开发者ID:ratbird,项目名称:hope,代码行数:11,代码来源:questionnaire.php

示例4: setNavigation

 /**
  * Sets the navigation of this plugin.
  *
  * @deprecated
  */
 function setNavigation(StudipPluginNavigation $navigation)
 {
     parent::setNavigation($navigation);
     // prepend copy of navigation to its sub navigation
     $item_names = array_keys($navigation->getSubNavigation());
     $navigation_copy = clone $navigation;
     $navigation_copy->clearSubmenu();
     $navigation_copy->freezeActivation();
     $navigation->insertSubNavigation('self', $navigation_copy, $item_names[0]);
     $navigation->setTitle($this->getDisplayTitle());
     // Check activation for user and display if appropriate.
     if (Navigation::hasItem('/profile') && is_object($this->getRequestedUser()) && $GLOBALS['perm']->have_profile_perm('user', $this->getRequestedUser()->getUserid()) && PluginManager::getInstance()->isPluginActivatedForUser($this->getPluginId(), $this->getRequestedUser()->getUserid())) {
         Navigation::addItem('/profile/' . $this->getPluginclassname(), $navigation);
     }
 }
开发者ID:ratbird,项目名称:hope,代码行数:20,代码来源:AbstractStudIPHomepagePlugin.class.php

示例5: setupNavigation

 private function setupNavigation()
 {
     global $perm;
     $cid = $this->getContext();
     if (Request::isXhr() || Navigation::hasItem('/course/cliqr') || !$this->isActivated($cid) || !$perm->have_studip_perm("tutor", $cid)) {
         return;
     }
     # /course/cliqr -> plugins.php/cliqrplugin/questions
     $url = PluginEngine::getURL('cliqrplugin', compact('cid'), 'questions', true);
     $navigation = new Navigation(_('Cliqr'), $url);
     $navigation->setImage(Assets::image_path('icons/16/white/test.png'));
     $navigation->setActiveImage(Assets::image_path('icons/16/black/test.png'));
     # /course/cliqr/index -> plugins.php/cliqrplugin/questions#index
     $navigation->addSubNavigation("index", new Navigation(_("Fragen"), $url . '#index'));
     # /course/cliqr/new -> plugins.php/cliqrplugin/questions#new
     $navigation->addSubNavigation("new", new Navigation(_("Frage erstellen"), $url . '#new'));
     # /course/cliqr/help -> plugins.php/cliqrplugin/help
     $url = PluginEngine::getURL('cliqrplugin', compact('cid'), 'help', true);
     $navigation->addSubNavigation("help", new Navigation(_("Methodische Informationen"), $url));
     Navigation::addItem('/course/cliqr', $navigation);
 }
开发者ID:swindhab,项目名称:CliqrPlugin,代码行数:21,代码来源:CliqrPlugin.php

示例6: __construct

 /**
  * @var Container
  */
 public function __construct()
 {
     parent::__construct();
     global $perm;
     $this->course = Course::findCurrent();
     $this->course_id = $this->course->id;
     $this->course = Course::findCurrent();
     if ($this->course) {
         $this->setupStudIPNavigation();
         if (Navigation::hasItem('/course/admin') && $perm->have_studip_perm('dozent', $this->course_id)) {
             $url = PluginEngine::getURL($this);
             $scormItem = new Navigation(_('Inhaltselemente bearbeiten'), $url);
             Navigation::addItem('/course/admin/seminar_tabs', $scormItem);
         } else {
             if (Navigation::hasItem('/admin/course/details')) {
                 $url = PluginEngine::getURL($this);
                 $scormItem = new Navigation(_('Inhaltselemente bearbeiten'), $url);
                 Navigation::addItem('/admin/course/seminar_tabs', $scormItem);
             }
         }
     }
 }
开发者ID:anantace,项目名称:SeminarTabs,代码行数:25,代码来源:SeminarTabs.php

示例7: before_filter

 /**
  * Common actions before any other action
  *
  * @param String $action Action to be executed
  * @param Array $args Arguments passed to the action
  * @throws Trails_Exception when either no course was found or the user
  *                          may not access this area
  */
 public function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     // Try to find a valid course
     if (Course::findCurrent()) {
         $course_id = Course::findCurrent()->id;
     } else {
         throw new Trails_Exception(404, _('Es wurde keine Veranstaltung ausgewählt!'));
     }
     if (!$GLOBALS['perm']->have_studip_perm('tutor', $course_id)) {
         throw new Trails_Exception(400);
     }
     // Get seminar instance
     $this->course = Seminar::getInstance($course_id);
     if (Navigation::hasItem('course/admin/dates')) {
         Navigation::activateItem('course/admin/dates');
     }
     $this->show = array('regular' => true, 'irregular' => true, 'roomRequest' => true);
     PageLayout::setHelpKeyword('Basis.Veranstaltungen');
     PageLayout::addSqueezePackage('raumzeit');
     $title = _('Verwaltung von Zeiten und Räumen');
     $title = $this->course->getFullname() . ' - ' . $title;
     PageLayout::setTitle($title);
     $_SESSION['raumzeitFilter'] = Request::get('newFilter');
     // bind linkParams for chosen semester and opened dates
     URLHelper::bindLinkParam('raumzeitFilter', $_SESSION['raumzeitFilter']);
     $this->checkFilter();
     $this->selection = $this->getSemestersForCourse($this->course, $_SESSION['raumzeitFilter']);
     if (!Request::isXhr()) {
         $this->setSidebar();
     } elseif (Request::isXhr() && $this->flash['update-times']) {
         $semester_id = $GLOBALS['user']->cfg->MY_COURSES_SELECTED_CYCLE;
         if ($semester_id === 'all') {
             $semester_id = '';
         }
         $this->response->add_header('X-Raumzeit-Update-Times', json_encode(studip_utf8encode(array('course_id' => $this->course->id, 'html' => Seminar::GetInstance($this->course->id)->getDatesHTML(array('semester_id' => $semester_id, 'show_room' => true)) ?: _('nicht angegeben')))));
     }
 }
开发者ID:ratbird,项目名称:hope,代码行数:46,代码来源:timesrooms.php

示例8: before_filter

 public function before_filter(&$action, &$args)
 {
     $this->set_layout($GLOBALS['template_factory']->open('layouts/base_without_infobox'));
     $this->course = Course::findCurrent();
     if (!$this->course) {
         throw new CheckObjectException(_('Sie haben kein Objekt gewählt.'));
     } else {
         if (Navigation::hasItem('/course/admin')) {
             Navigation::activateItem('/course/admin/seminar_tabs');
         } else {
             if (Navigation::hasItem('/admin/course/seminar_tabs')) {
                 Navigation::activateItem('/admin/course/seminar_tabs');
             }
         }
         $this->ignore_tabs = array('modules', 'mini_course');
         $this->ignore_visibility_tabs = array('admin', 'main');
         $this->course_id = $this->course->id;
         $this->sem = Seminar::getInstance($this->course_id);
         $sem_class = $GLOBALS['SEM_CLASS'][$GLOBALS['SEM_TYPE'][$this->sem->status]['class']];
         $sem_class || ($sem_class = SemClass::getDefaultSemClass());
         $this->studygroup_mode = $SEM_CLASS[$SEM_TYPE[$this->sem->status]["class"]]["studygroup_mode"];
     }
 }
开发者ID:anantace,项目名称:SeminarTabs,代码行数:23,代码来源:show.php

示例9: if

echo Assets::url('sounds/blubb.ogg');
?>
" 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 ?>
开发者ID:anantace,项目名称:VHSView,代码行数:31,代码来源:header.php

示例10: object_set_visit

    object_set_visit($course_id, "sem");
}
// gibt es eine Anweisung zur Umleitung?
if (Request::get('redirect_to')) {
    $query_parts = explode('&', stristr(urldecode($_SERVER['QUERY_STRING']), 'redirect_to'));
    list(, $where_to) = explode('=', array_shift($query_parts));
    $new_query = $where_to . '?' . join('&', $query_parts);
    $new_query = preg_replace('/[^:0-9a-z+_\\-.#?&=\\/]/i', '', $new_query);
    header('Location: ' . URLHelper::getURL($new_query, array('cid' => $course_id)));
    die;
}
$sem_class = Seminar::getInstance($course_id)->getSemClass();
if ($sem_class->getSlotModule("overview")) {
    foreach ($sem_class->getNavigationForSlot("overview") as $nav) {
        header('Location: ' . URLHelper::getURL($nav->getURL()));
        die;
    }
} else {
    $Modules = new Modules();
    $course_modules = $Modules->getLocalModules($course_id);
    if (!$course_modules['overview'] && !$sem_class->isSlotMandatory("overview")) {
        //Keine Übersichtsseite. Anstatt eines Fehler wird der Nutzer zum ersten
        //Reiter der Veranstaltung weiter geleitet.
        if (Navigation::hasItem("/course")) {
            foreach (Navigation::getItem("/course")->getSubNavigation() as $navigation) {
                header('Location: ' . URLHelper::getURL($navigation->getURL()));
                die;
            }
        }
    }
}
开发者ID:ratbird,项目名称:hope,代码行数:31,代码来源:seminar_main.php

示例11: getTabNavigation

 /**
  * Returns the base navigation object (not its path) for the tabs.
  * May return NULL if tab display is disabled.
  */
 public static function getTabNavigation()
 {
     if (self::$tab_navigation === false) {
         self::$tab_navigation = Navigation::hasItem('/') ? Navigation::getItem('/')->activeSubNavigation() : null;
     }
     return self::$tab_navigation;
 }
开发者ID:ratbird,项目名称:hope,代码行数:11,代码来源:PageLayout.php

示例12: first_decision

 * "Ich will unsichtbar sein" angezeigt.
 *
 * Bei Nutzung dieser Funktion unbedingt die Texte unter locale/de/LC_HELP/visibility_decision.php bzw.
 * locale/en/LC_HELP/visibility_decision.php an die lokalen Verhältnisse anpassen!
 */
if ($GLOBALS['USER_VISIBILITY_CHECK'] && is_object($GLOBALS['user']) && $GLOBALS['user']->id != 'nobody') {
    require_once 'lib/user_visible.inc.php';
    first_decision($GLOBALS['user']->id);
}
if (PageLayout::isHeaderEnabled()) {
    $header_template = $GLOBALS['template_factory']->open('header');
    $header_template->current_page = PageLayout::getTitle();
    $header_template->link_params = array_fill_keys(array_keys(URLHelper::getLinkParams()), NULL);
    if (is_object($GLOBALS['user']) && $GLOBALS['user']->id != 'nobody') {
        // only mark course if user is logged in and free access enabled
        if (get_config('ENABLE_FREE_ACCESS') && Navigation::hasItem('/course') && Navigation::getItem('/course')->isActive()) {
            // indicate to the template that this course is publicly visible
            // need to handle institutes separately (always visible)
            if ($GLOBALS['SessSemName']['class'] == 'inst') {
                $header_template->public_hint = _('öffentliche Einrichtung');
            } else {
                if (Course::findCurrent()->lesezugriff == 0) {
                    $header_template->public_hint = _('öffentliche Veranstaltung');
                }
            }
        }
        if ($GLOBALS['user']->cfg->getValue('ACCESSKEY_ENABLE')) {
            $header_template->accesskey_enabled = true;
        }
        // fetch semester for quick search box in the link bar
        $semester_data = SemesterData::GetSemesterArray();
开发者ID:ratbird,项目名称:hope,代码行数:31,代码来源:header.php

示例13: testNavigationTree

 public function testNavigationTree()
 {
     $navigation = new Navigation('test');
     $nav1 = new Navigation('foo', NULL);
     $nav2 = new Navigation('bar', 'bar.php');
     $nav3 = new Navigation('baz', 'baz.php');
     $nav4 = new Navigation('egg', 'egg.php');
     $this->assertFalse(Navigation::hasItem('/test/a2'));
     Navigation::addItem('/test', $navigation);
     Navigation::addItem('/test/a1', $nav1);
     Navigation::addItem('/test/a2', $nav2);
     Navigation::addItem('/test/a3', $nav3);
     Navigation::addItem('/test/a2/b1', $nav4);
     $this->assertTrue(Navigation::hasItem('/test/a2'));
     $this->assertFalse(Navigation::getItem('/test')->isActive());
     $this->assertEquals('bar.php', Navigation::getItem('/test')->getURL());
     $this->assertEquals(array('a1' => $nav1, 'a2' => $nav2, 'a3' => $nav3), Navigation::getItem('/test')->getSubNavigation());
     Navigation::activateItem('/test/a2/b1');
     $this->assertTrue(Navigation::getItem('/test')->isActive());
     $this->assertTrue(Navigation::getItem('/test/a2')->isActive());
     $this->assertTrue(Navigation::getItem('/test/a2/b1')->isActive());
     Navigation::removeItem('/test/a3');
     Navigation::insertItem('/test/a3', $nav3, 'a2');
     Navigation::removeItem('/test/a1');
     Navigation::insertItem('/test/a2/a1', $nav1, '');
     $this->assertEquals('baz.php', Navigation::getItem('/test')->getURL());
     $this->assertEquals(array('a3' => $nav3, 'a2' => $nav2), Navigation::getItem('/test')->getSubNavigation());
     $this->assertEquals(array('b1' => $nav4, 'a1' => $nav1), Navigation::getItem('/test/a2')->getSubNavigation());
 }
开发者ID:ratbird,项目名称:hope,代码行数:29,代码来源:NavigationTest.php

示例14: htmlReady

">
<input type="hidden" id="user_id" value="<?php 
echo htmlReady($GLOBALS['user']->id);
?>
">
<input type="hidden" id="stream_time" value="<?php 
echo time();
?>
">
<input type="hidden" id="browser_start_time" value="">
<input type="hidden" id="orderby" value="mkdate">
<div id="editing_question" style="display: none;"><?php 
echo _("Wollen Sie den Beitrag wirklich bearbeiten?");
?>
</div>
<? if (Navigation::hasItem("/community/blubber")) : ?>
<p>
    <? switch ($thread['context_type']) {
        case "course":
            $overview_url = URLHelper::getURL("plugins.php/blubber/streams/forum", array('cid' => $thread['Seminar_id']));
            break;
        case "public":
            $overview_url = URLHelper::getURL("plugins.php/blubber/streams/profile", array('user_id' => $thread['user_id'], 'extern' => $thread['external_contact'] ? $thread['external_contact'] : null));
            break;
        default:
            $overview_url = URLHelper::getURL("plugins.php/blubber/streams/global");
    } ?>
    <a href="<?php 
echo URLHelper::getLink($overview_url);
?>
">
开发者ID:ratbird,项目名称:hope,代码行数:31,代码来源:thread.php

示例15: include_once

include 'lib/seminar_open.php'; // initialise Stud.IP-Session


// -- here you have to put initialisations for the current page

if (get_config('RESOURCES_ENABLE')) {
    include_once($GLOBALS['RELATIVE_PATH_RESOURCES'] . "/lib/DeleteResourcesUser.class.php");
}

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";
}
开发者ID:ratbird,项目名称:hope,代码行数:30,代码来源:archiv_assi.php


注:本文中的Navigation::hasItem方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。