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


PHP Navigation::removeItem方法代码示例

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


在下文中一共展示了Navigation::removeItem方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: global_action

 /**
  * Displays global-stream
  */
 public function global_action()
 {
     PageLayout::setTitle(_("Globaler Blubberstream"));
     Navigation::activateItem("/community/blubber");
     if (Request::get("delete_stream")) {
         $stream = new BlubberStream(Request::option("delete_stream"));
         if ($stream['user_id'] === $GLOBALS['user']->id) {
             $stream->delete();
             PageLayout::postMessage(MessageBox::success(_("Stream wurde erfolgreich gelöscht.")));
             Navigation::removeItem("/community/blubber/" . Request::option("delete_stream"));
         }
     }
     $globalstream = BlubberStream::getGlobalStream();
     $this->tags = $globalstream->fetchTags();
     if (Request::get("hash")) {
         $this->search = Request::get("hash");
         $globalstream = new BlubberStream();
         $globalstream->filter_hashtags = array(Request::get("hash"));
     }
     $this->threads = $globalstream->fetchThreads(0, $this->max_threads + 1);
     $this->more_threads = count($this->threads) > $this->max_threads;
     if ($this->more_threads) {
         $this->threads = array_slice($this->threads, 0, $this->max_threads);
     }
     $this->contact_groups = DBManager::get()->query("SELECT statusgruppen.* " . "FROM statusgruppen " . "WHERE statusgruppen.range_id = " . DBManager::get()->quote($GLOBALS['user']->id) . " " . "ORDER BY name ASC " . "")->fetchAll(PDO::FETCH_ASSOC);
     $this->favourite_tags = $globalstream->fetchTags(time() - 86400 * 30, 50);
 }
开发者ID:ratbird,项目名称:hope,代码行数:30,代码来源:streams.php

示例2: __construct

 public function __construct()
 {
     parent::__construct();
     // instantiate patching template factory
     $GLOBALS['template_factory'] = new VHS\PatchTemplateFactory($GLOBALS['template_factory'], realpath($this->getPluginPath() . '/templates'));
     global $perm;
     $username = Request::get('username', $auth->auth['uname']);
     PageLayout::addStylesheet($this->getPluginUrl() . '/css/startseite.css');
     PageLayout::addStylesheet($this->getPluginUrl() . '/css/courseware.css');
     //falls Mooc.IP aktiviert ist, Icon aus der Kopfzeile ausblenden
     if (Navigation::hasItem('/mooc')) {
         Navigation::removeItem('/mooc');
     }
     if (!$perm->have_perm('admin') && $perm->get_perm() != 'nobody') {
         if (Navigation::hasItem('/search')) {
             Navigation::removeItem('/search');
         }
         if (Navigation::hasItem('/tools')) {
             if (!$perm->have_perm('dozent')) {
                 if (Navigation::hasItem('/tools/elearning')) {
                     Navigation::removeItem('/tools/elearning');
                 }
                 if (Navigation::hasItem('/tools/evaluation')) {
                     Navigation::removeItem('/tools/evaluation');
                 }
             }
         }
         /**		
         			if (Navigation::hasItem('/course/main/courses')){
         			//	Navigation::removeItem('/course/main/courses');
         			}
         			
         			if (Navigation::hasItem('/course/main/schedule')){
         			//	Navigation::removeItem('/course/main/schedule');
         			}
         		**/
         if (Navigation::hasItem('/tools')) {
             Navigation::getItem('/tools')->setImage(NULL);
         }
         if (Navigation::hasItem('/tools/rss')) {
             Navigation::removeItem('/tools/rss');
         }
         if (Navigation::hasItem('/tools/literature')) {
             Navigation::removeItem('/tools/literature');
         }
         if (Navigation::hasItem('/profile/edit/study_data')) {
             Navigation::removeItem('/profile/edit/study_data');
         }
         if (Navigation::hasItem('/start/search')) {
             Navigation::removeItem('/start/search');
         }
         if (Navigation::hasItem('/browse')) {
             $stmt = DBManager::get()->prepare("SELECT su.seminar_id FROM seminar_user su\n\t\t\t\t\tWHERE su.user_id = ?");
             $stmt->execute(array($GLOBALS['user']->id));
             $count = $stmt->rowCount();
             if ($count == 1) {
                 $result = $stmt->fetch();
                 Navigation::getItem('/browse')->setURL("/seminar_main.php?auswahl=" . $result['seminar_id']);
                 Navigation::getItem('/browse')->setTitle("Mein Kurs");
             }
             if ($count == 0 && !$perm->have_perm('tutor')) {
                 Navigation::removeItem('/browse');
             }
         }
         if (Navigation::hasItem('/course')) {
             $stmt = DBManager::get()->prepare("SELECT su.seminar_id FROM seminar_user su\n\t\t\t\t\tWHERE su.user_id = ?");
             $stmt->execute(array($GLOBALS['user']->id));
             $count = $stmt->rowCount();
             if ($count == 1) {
                 $result = $stmt->fetch();
                 Navigation::getItem('/course')->setURL("/seminar_main.php?auswahl=" . $result['seminar_id']);
                 Navigation::getItem('/course')->setTitle("Mein Kurs");
             }
         }
         if (Navigation::hasItem('/start/my_courses')) {
             if (Navigation::hasItem('/start/my_courses/browse')) {
                 Navigation::removeItem('/start/my_courses/browse');
             }
             if (Navigation::hasItem('/start/my_courses/new_studygroup')) {
                 Navigation::removeItem('/start/my_courses/new_studygroup');
             }
             if (Navigation::hasItem('/start/tools')) {
                 Navigation::removeItem('/start/tools');
             }
             $stmt = DBManager::get()->prepare("SELECT su.seminar_id FROM seminar_user su\n\t\t\t\t\tWHERE su.user_id = ?");
             $stmt->execute(array($GLOBALS['user']->id));
             $count = $stmt->rowCount();
             if ($count == 1) {
                 $result = $stmt->fetch();
                 Navigation::getItem('/start/my_courses')->setURL("/seminar_main.php?auswahl=" . $result['seminar_id']);
                 Navigation::getItem('/start/my_courses')->setTitle("Mein Kurs");
             }
             if ($count == 0) {
                 Navigation::removeItem('/start/my_courses');
             }
             if ($count > 1) {
                 Navigation::getItem('/start/my_courses')->setTitle("Kurse");
             }
         }
         if (Navigation::hasItem('/start/community/browse')) {
//.........这里部分代码省略.........
开发者ID:anantace,项目名称:VHSView,代码行数:101,代码来源:VHSViewPlugin.php

示例3: setDisplayType

 /**
  * define where the plugin will be visible (toolbar and/or start page)
  *
  * @deprecated
  */
 function setDisplayType($display_type)
 {
     $changes = $this->display_type ^ $display_type;
     $this->display_type = $display_type;
     if ($this->hasNavigation()) {
         if ($changes & SYSTEM_PLUGIN_TOOLBAR) {
             if ($this->getDisplayType(SYSTEM_PLUGIN_TOOLBAR)) {
                 Navigation::addItem('/' . $this->getPluginclassname(), $this->getNavigation());
             } else {
                 Navigation::removeItem('/' . $this->getPluginclassname());
             }
         }
         if ($changes & SYSTEM_PLUGIN_STARTPAGE) {
             if ($this->getDisplayType(SYSTEM_PLUGIN_STARTPAGE)) {
                 Navigation::insertItem('/start/' . $this->getPluginclassname(), $this->getNavigation(), 'search');
             } else {
                 Navigation::removeItem('/start/' . $this->getPluginclassname());
             }
         }
     }
 }
开发者ID:ratbird,项目名称:hope,代码行数:26,代码来源:AbstractStudIPSystemPlugin.class.php

示例4: 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


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