本文整理汇总了PHP中Navigation::setURL方法的典型用法代码示例。如果您正苦于以下问题:PHP Navigation::setURL方法的具体用法?PHP Navigation::setURL怎么用?PHP Navigation::setURL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Navigation
的用法示例。
在下文中一共展示了Navigation::setURL方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testURL
public function testURL()
{
$navigation = new Navigation('test', 'foo.php');
$this->assertEquals($navigation->getURL(), 'foo.php');
$navigation->setURL('bar.php', array('fuzz' => 'yes'));
$this->assertEquals('bar.php?fuzz=yes', $navigation->getURL());
$this->assertTrue($navigation->isEnabled());
$navigation->setEnabled(false);
$this->assertFalse($navigation->isEnabled());
$this->assertFalse($navigation->isVisible(true));
$this->assertTrue($navigation->isVisible());
$navigation->setURL(NULL);
$this->assertFalse($navigation->isVisible());
}
示例2: __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"));
}
}
}
}
示例3: get_my_obj_values
/**
*
* @param unknown_type $my_obj
* @param unknown_type $user_id
* @param unknown_type $modules
*/
function get_my_obj_values(&$my_obj, $user_id, $modules = NULL)
{
$threshold = ($config = Config::get()->NEW_INDICATOR_THRESHOLD) ? strtotime("-{$config} days 0:00:00") : 0;
$db2 = new DB_seminar();
$db2->query("CREATE TEMPORARY TABLE IF NOT EXISTS myobj_" . $user_id . " ( object_id char(32) NOT NULL, PRIMARY KEY (object_id)) ENGINE = MEMORY");
$db2->query("REPLACE INTO myobj_" . $user_id . " (object_id) VALUES ('" . join("'),('", array_keys($my_obj)) . "')");
//dokumente
$unreadable_folders = array();
if (!$GLOBALS['perm']->have_perm('admin')) {
foreach (array_keys($my_obj) as $obj_id) {
if ($my_obj[$obj_id]['modules']['documents_folder_permissions'] || $my_obj[$obj_id]['obj_type'] == 'sem' && StudipDocumentTree::ExistsGroupFolders($obj_id)) {
$must_have_perm = $my_obj[$obj_id]['obj_type'] == 'sem' ? 'tutor' : 'autor';
if ($GLOBALS['perm']->permissions[$my_obj[$obj_id]['status']] < $GLOBALS['perm']->permissions[$must_have_perm]) {
$folder_tree = TreeAbstract::GetInstance('StudipDocumentTree', array('range_id' => $obj_id, 'entity_type' => $my_obj[$obj_id]['obj_type']));
$unreadable_folders = array_merge((array) $unreadable_folders, (array) $folder_tree->getUnReadableFolders($user_id));
}
}
}
}
$db2->query(get_obj_clause('dokumente a', 'Seminar_id', 'dokument_id', "(chdate > IFNULL(b.visitdate, {$threshold}) AND a.user_id !='{$user_id}')", 'documents', false, count($unreadable_folders) ? "AND a.range_id NOT IN('" . join("','", $unreadable_folders) . "')" : "", false, $user_id));
while ($db2->next_record()) {
$object_id = $db2->f('object_id');
if ($my_obj[$object_id]["modules"]["documents"]) {
$my_obj[$object_id]["neuedokumente"] = $db2->f("neue");
$my_obj[$object_id]["dokumente"] = $db2->f("count");
if ($my_obj[$object_id]['last_modified'] < $db2->f('last_modified')) {
$my_obj[$object_id]['last_modified'] = $db2->f('last_modified');
}
$nav = new Navigation('files');
if ($db2->f('neue')) {
$nav->setURL('folder.php?cmd=all');
$nav->setImage(Icon::create('files+new', 'attention', ["title" => sprintf(_('%s Dokumente, %s neue'), $db2->f('count'), $db2->f('neue'))]));
$nav->setBadgeNumber($db2->f('neue'));
} else {
if ($db2->f('count')) {
$nav->setURL('folder.php?cmd=tree');
$nav->setImage(Icon::create('files', 'inactive', ["title" => sprintf(_('%s Dokumente'), $db2->f('count'))]));
}
}
$my_obj[$object_id]['files'] = $nav;
}
}
//Ankündigungen
$db2->query(get_obj_clause('news_range a {ON_CLAUSE} LEFT JOIN news nw ON(a.news_id=nw.news_id AND UNIX_TIMESTAMP() BETWEEN date AND (date+expire))', 'range_id', 'nw.news_id', "(chdate > IFNULL(b.visitdate, {$threshold}) AND nw.user_id !='{$user_id}')", 'news', false, false, 'a.news_id', $user_id));
while ($db2->next_record()) {
$object_id = $db2->f('object_id');
$my_obj[$object_id]["neuenews"] = $db2->f("neue");
$my_obj[$object_id]["news"] = $db2->f("count");
if ($my_obj[$object_id]['last_modified'] < $db2->f('last_modified')) {
$my_obj[$object_id]['last_modified'] = $db2->f('last_modified');
}
$nav = new Navigation('news', '');
if ($db2->f('neue')) {
$nav->setURL('?new_news=true');
$nav->setImage(Icon::create('news+new', 'attention', ["title" => sprintf(_('%s Ankündigungen, %s neue'), $db2->f('count'), $db2->f('neue'))]));
$nav->setBadgeNumber($db2->f('neue'));
} else {
if ($db2->f('count')) {
$nav->setImage(Icon::create('news', 'inactive', ["title" => sprintf(_('%s Ankündigungen'), $db2->f('count'))]));
}
}
$my_obj[$object_id]['news'] = $nav;
}
// scm?
$db2->query(get_obj_clause('scm a', 'range_id', "IF(content !='',1,0)", "(chdate > IFNULL(b.visitdate, {$threshold}) AND a.user_id !='{$user_id}')", "scm", 'tab_name', false, false, $user_id));
while ($db2->next_record()) {
$object_id = $db2->f('object_id');
if ($my_obj[$object_id]["modules"]["scm"]) {
$my_obj[$object_id]["neuscmcontent"] = $db2->f("neue");
$my_obj[$object_id]["scmcontent"] = $db2->f("count");
$my_obj[$object_id]["scmtabname"] = $db2->f("tab_name");
if ($my_obj[$object_id]['last_modified'] < $db2->f('last_modified')) {
$my_obj[$object_id]['last_modified'] = $db2->f('last_modified');
}
$nav = new Navigation('scm', 'dispatch.php/course/scm');
if ($db2->f('count')) {
if ($db2->f('neue')) {
$image = Icon::create('infopage+new', 'new');
$nav->setBadgeNumber($db2->f('neue'));
if ($db2->f('count') == 1) {
$title = $db2->f('tab_name') . _(' (geändert)');
} else {
$title = sprintf(_('%s Einträge, %s neue'), $db2->f('count'), $db2->f('neue'));
}
} else {
$image = Icon::create('infopage', 'inactive');
if ($db2->f('count') == 1) {
$title = $db2->f('tab_name');
} else {
$title = sprintf(_('%s Einträge'), $db2->f('count'));
}
}
$nav->setImage($image, array('title' => $title));
}
//.........这里部分代码省略.........
示例4: __construct
/**
* Constructor of Plugin : adds Navigation and collects information for javascript-update.
*/
public function __construct()
{
parent::__construct();
if (UpdateInformation::isCollecting()) {
$data = Request::getArray("page_info");
if (stripos(Request::get("page"), "plugins.php/blubber") !== false && isset($data['Blubber'])) {
$output = array();
switch ($data['Blubber']['stream']) {
case "global":
$stream = BlubberStream::getGlobalStream();
break;
case "course":
$stream = BlubberStream::getCourseStream($data['Blubber']['context_id']);
break;
case "profile":
$stream = BlubberStream::getProfileStream($data['Blubber']['context_id']);
break;
case "thread":
$stream = BlubberStream::getThreadStream($data['Blubber']['context_id']);
break;
case "custom":
$stream = new BlubberStream($data['Blubber']['context_id']);
break;
}
$last_check = $data['Blubber']['last_check'] ? $data['Blubber']['last_check'] : time() - 5 * 60;
$new_postings = $stream->fetchNewPostings($last_check);
$factory = new Flexi_TemplateFactory($this->getPluginPath() . "/views");
foreach ($new_postings as $new_posting) {
if ($new_posting['root_id'] === $new_posting['topic_id']) {
$thread = $new_posting;
$template = $factory->open("streams/thread.php");
$template->set_attribute('thread', $new_posting);
} else {
$thread = new BlubberPosting($new_posting['root_id']);
$template = $factory->open("streams/comment.php");
$template->set_attribute('posting', $new_posting);
}
BlubberPosting::$course_hashes = $thread['user_id'] !== $thread['Seminar_id'] ? $thread['Seminar_id'] : false;
$template->set_attribute("course_id", $data['Blubber']['seminar_id']);
$output['postings'][] = array('posting_id' => $new_posting['topic_id'], 'discussion_time' => $new_posting['discussion_time'], 'mkdate' => $new_posting['mkdate'], 'root_id' => $new_posting['root_id'], 'content' => $template->render());
}
UpdateInformation::setInformation("Blubber.getNewPosts", $output);
//Events-Queue:
$db = DBManager::get();
$events = $db->query("SELECT event_type, item_id " . "FROM blubber_events_queue " . "WHERE mkdate >= " . $db->quote($last_check) . " " . "ORDER BY mkdate ASC " . "")->fetchAll(PDO::FETCH_ASSOC);
UpdateInformation::setInformation("Blubber.blubberEvents", $events);
$db->exec("DELETE FROM blubber_events_queue " . "WHERE mkdate < UNIX_TIMESTAMP() - 60 * 60 * 6 " . "");
}
}
if (Navigation::hasItem("/community")) {
$nav = new Navigation($this->getDisplayTitle(), PluginEngine::getURL($this, array(), "streams/global"));
$nav->addSubNavigation("global", new AutoNavigation(_("Globaler Stream"), PluginEngine::getURL($this, array(), "streams/global")));
foreach (BlubberStream::findMine() as $stream) {
$url = PluginEngine::getURL($this, array(), "streams/custom/" . $stream->getId());
$nav->addSubNavigation($stream->getId(), new AutoNavigation($stream['name'], $url));
if ($stream['defaultstream']) {
$nav->setURL($url);
}
}
$nav->addSubNavigation("add", new AutoNavigation(_("Neuen Stream erstellen"), PluginEngine::getURL($this, array(), "streams/edit")));
Navigation::insertItem("/community/blubber", $nav, "online");
Navigation::getItem("/community")->setURL($nav->getURL());
}
if (Navigation::hasItem("/profile") && $this->isActivated(get_userid(Request::username('username', $GLOBALS['auth']->auth['uname'])), 'user')) {
$nav = new AutoNavigation(_("Blubber"), PluginEngine::getURL($this, array('user_id' => get_userid(Request::get("username"))), "streams/profile"));
Navigation::addItem("/profile/blubber", $nav);
}
}
示例5: checkWiki
/**
* Check for new entries in wiki
* @param $my_obj
* @param $user_id
* @param $modules
*/
public static function checkWiki(&$my_obj, $user_id, $object_id)
{
if ($my_obj["modules"]["wiki"]) {
$sql = "SELECT COUNT(DISTINCT keyword) as count_d,\n COUNT(IF((chdate > IFNULL(ouv.visitdate, :threshold) AND wiki.user_id !=:user_id), keyword, NULL)) AS neue,\n MAX(IF((chdate > IFNULL(ouv.visitdate, :threshold) AND wiki.user_id !=:user_id), chdate, 0)) AS last_modified,\n COUNT(keyword) as count\n FROM\n wiki\n LEFT JOIN\n object_user_visits ouv ON(ouv . object_id = wiki . range_id AND ouv . user_id = :user_id and ouv . type = 'wiki')\n WHERE\n wiki . range_id = :course_id\n GROUP BY\n wiki.range_id";
$statement = DBManager::get()->prepare($sql);
$statement->bindValue(':user_id', $user_id);
$statement->bindValue(':course_id', $object_id);
$statement->bindValue(':threshold', ($threshold = Config::get()->NEW_INDICATOR_THRESHOLD) ? strtotime("-{$threshold} days 0:00:00") : 0);
$statement->execute();
$result = $statement->fetch(PDO::FETCH_ASSOC);
if (!empty($result)) {
if (!is_null($result['last_modified']) && (int) $result['last_modified'] != 0) {
if ($my_obj['last_modified'] < $result['last_modified']) {
$my_obj['last_modified'] = $result['last_modified'];
}
}
$nav = new Navigation('wiki');
if ((int) $result['neue']) {
$nav->setURL('wiki.php?view=listnew');
$nav->setImage(Icon::create('wiki+new', 'attention', ["title" => sprintf('%s %s, %s %s', $result['count_d'], _('WikiSeite(n)'), $result['neue'], _('Änderungen'))]));
$nav->setBadgeNumber($result['neue']);
} elseif ((int) $result['count']) {
$nav->setURL('wiki.php');
$nav->setImage(Icon::create('wiki', 'inactive', ["title" => sprintf('%s %s', $result['count_d'], _('WikiSeite(n)'))]));
}
return $nav;
}
}
return null;
}
示例6: initSubNavigation
/**
* Initialize the subnavigation of this item. This method
* is called once before the first item is added or removed.
*/
public function initSubNavigation()
{
global $SessionSeminar, $SessSemName, $archive_kill, $perm;
parent::initSubNavigation();
if ($SessSemName['class'] == 'inst') {
if (isset($_SESSION['links_admin_data']['referred_from']) && $_SESSION['links_admin_data']['referred_from'] == 'inst') {
$back_jump = _('zurück zur ausgewählten Einrichtung');
} else {
$back_jump = _('zur ausgewählten Einrichtung');
}
} else {
if ($SessSemName['class'] == 'sem') {
if (isset($_SESSION['links_admin_data']['referred_from']) && $_SESSION['links_admin_data']['referred_from'] == 'sem' && !$archive_kill && !(isset($_SESSION['links_admin_data']['assi']) && $_SESSION['links_admin_data']['assi'])) {
$back_jump = _('zurück zur ausgewählten Veranstaltung');
} else {
if (isset($_SESSION['links_admin_data']['referred_from']) && $_SESSION['links_admin_data']['referred_from'] == 'assi' && !$archive_kill) {
$back_jump = _('zur neu angelegten Veranstaltung');
} else {
if (!(isset($_SESSION['links_admin_data']['assi']) && $_SESSION['links_admin_data']['assi'])) {
$back_jump = _('zur ausgewählten Veranstaltung');
}
}
}
}
}
$sem_create_perm = in_array(Config::get()->SEM_CREATE_PERM, array('root', 'admin', 'dozent')) ? Config::get()->SEM_CREATE_PERM : 'dozent';
// global config / user administration
if (!Config::get()->RESTRICTED_USER_MANAGEMENT || $perm->have_perm('root')) {
$navigation = new Navigation(_('Benutzer'));
$navigation->setURL('dispatch.php/admin/user/');
$navigation->addSubNavigation('index', new Navigation(_('Benutzer'), 'dispatch.php/admin/user'));
if ($perm->have_perm('root')) {
$navigation->addSubNavigation('user_domains', new Navigation(_('Nutzerdomänen'), 'dispatch.php/admin/domain'));
}
$this->addSubNavigation('user', $navigation);
}
// institute administration
$navigation = new Navigation(_('Einrichtungen'));
$navigation->setURL('dispatch.php/institute/basicdata/index?cid=');
$navigation->addSubNavigation('details', new Navigation(_('Grunddaten'), 'dispatch.php/institute/basicdata/index'));
$navigation->addSubNavigation('faculty', new Navigation(_('Mitarbeiter'), 'dispatch.php/institute/members?admin_view=1'));
$navigation->addSubNavigation('groups', new Navigation(_('Funktionen / Gruppen'), 'dispatch.php/admin/statusgroups?type=inst'));
if (Config::get()->VOTE_ENABLE) {
$navigation->addSubNavigation('vote', new Navigation(_('Umfragen und Tests'), 'admin_vote.php?view=vote_inst'));
$navigation->addSubNavigation('evaluation', new Navigation(_('Evaluationen'), 'admin_evaluation.php?view=eval_inst'));
}
$navigation->addSubNavigation('modules', new Navigation(_('Inhaltselemente'), 'dispatch.php/course/plus/index'));
if (Config::get()->EXTERN_ENABLE) {
$navigation->addSubNavigation('external', new Navigation(_('Externe Seiten'), 'admin_extern.php?view=extern_inst'));
}
if ($perm->have_perm("root") || $perm->is_fak_admin() && Config::get()->INST_FAK_ADMIN_PERMS != 'none') {
$navigation->addSubNavigation('create', new Navigation(_('Neue Einrichtung anlegen'), 'dispatch.php/institute/basicdata/index?cid=&i_view=new'));
}
$this->addSubNavigation('institute', $navigation);
$navigation = new Navigation(_('Standort'));
if ($perm->have_perm(Config::get()->RANGE_TREE_ADMIN_PERM ? Config::get()->RANGE_TREE_ADMIN_PERM : 'admin')) {
$navigation->addSubNavigation('range_tree', new Navigation(_('Einrichtungshierarchie'), 'admin_range_tree.php'));
}
if ($perm->have_perm(Config::get()->SEM_TREE_ADMIN_PERM ? Config::get()->SEM_TREE_ADMIN_PERM : 'admin') && $perm->is_fak_admin()) {
$navigation->addSubNavigation('sem_tree', new Navigation(_('Veranstaltungshierarchie'), 'admin_sem_tree.php'));
}
if ($perm->have_perm(Config::get()->LOCK_RULE_ADMIN_PERM ? Config::get()->LOCK_RULE_ADMIN_PERM : 'admin')) {
$navigation->addSubNavigation('lock_rules', new Navigation(_('Sperrebenen'), 'dispatch.php/admin/lockrules'));
}
if ($perm->have_perm('root')) {
$navigation->addSubNavigation('auto_insert', new Navigation(_('Automatisiertes Eintragen'), 'dispatch.php/admin/autoinsert'));
if (Config::get()->SEMESTER_ADMINISTRATION_ENABLE) {
$navigation->addSubNavigation('semester', new Navigation(_('Semester'), 'dispatch.php/admin/semester'));
$navigation->addSubNavigation('holidays', new Navigation(_('Ferien'), 'dispatch.php/admin/holidays'));
}
if (Config::get()->EXTERN_ENABLE) {
$navigation->addSubNavigation('external', new Navigation(_('Externe Seiten'), 'admin_extern.php?list=TRUE&view=extern_global'));
}
$navigation->addSubNavigation('studycourse', new Navigation(_('Studiengänge'), 'dispatch.php/admin/studycourse/profession'));
$navigation->addSubNavigation('sem_classes', new Navigation(_('Veranstaltungskategorien'), 'dispatch.php/admin/sem_classes/overview'));
}
$this->addSubNavigation('locations', $navigation);
// global config / user administration
$navigation = new Navigation(_('System'));
if ($perm->have_perm('root')) {
$navigation->addSubNavigation('plugins', new Navigation(_('Plugins'), 'dispatch.php/admin/plugin'));
$navigation->addSubNavigation('roles', new Navigation(_('Rollen'), 'dispatch.php/admin/role'));
$navigation->addSubNavigation('datafields', new Navigation(_('Datenfelder'), 'dispatch.php/admin/datafields'));
$navigation->addSubNavigation('configuration', new Navigation(_('Konfiguration'), 'dispatch.php/admin/configuration/configuration'));
if (Config::get()->BANNER_ADS_ENABLE) {
$navigation->addSubNavigation('banner', new Navigation(_('Werbebanner'), 'dispatch.php/admin/banner'));
}
$navigation->addSubNavigation('coursewizardsteps', new Navigation(_('Anlegeassistent'), 'dispatch.php/admin/coursewizardsteps'));
$navigation->addSubNavigation('studygroup', new Navigation(_('Studiengruppen'), 'dispatch.php/course/studygroup/globalmodules'));
if (Config::get()->SMILEYADMIN_ENABLE) {
$navigation->addSubNavigation('smileys', new Navigation(_('Smileys'), 'dispatch.php/admin/smileys'));
}
if (Config::get()->TOURS_ENABLE) {
$navigation->addSubNavigation('tour', new Navigation(_('Touren'), 'dispatch.php/tour/admin_overview'));
}
$navigation->addSubNavigation('help_content', new Navigation(_('Hilfe-Texte'), 'dispatch.php/help_content/admin_overview'));
//.........这里部分代码省略.........