function output_tabs($current_tab, $changes) { global $_base_path; $tabs = get_tabs(); $num_tabs = count($tabs); ?> <div class="etabbed-list-container"> <ul class="etabbed-list" > <?php for ($i=0; $i < $num_tabs; $i++): if ($current_tab == $i):?> <li class="prefs_tab_selected"> <?php if ($changes[$i]): ?> <img src="<?php echo $_base_path; ?>images/changes_bullet.gif" alt="<?php echo _AT('usaved_changes_made'); ?>" height="12" width="15" /> <?php echo '<input type="submit" name="button_'.$i.'" value="'._AT($tabs[$i][0]).'" title="'._AT($tabs[$i][0]).' - alt '.$tabs[$i][2].'" class="prefs_buttontab" accesskey="'.$tabs[$i][2].'" onmouseover="this.style.cursor=\'pointer\';" '.$clickEvent.' />'; ?> <?php endif; ?> <?php echo _AT($tabs[$i][0]); ?> </li> <?php else: ?> <li class="prefs_tab" > <?php if ($changes[$i]): ?> <img src="<?php echo $_base_path; ?>images/changes_bullet.gif" alt="<?php echo _AT('usaved_changes_made'); ?>" height="12" width="15" /> <?php endif; ?> <?php echo '<input type="submit" name="button_'.$i.'" value="'._AT($tabs[$i][0]).'" title="'._AT($tabs[$i][0]).' - alt '.$tabs[$i][2].'" class="prefs_buttontab" accesskey="'.$tabs[$i][2].'" onmouseover="this.style.cursor=\'pointer\';" '.$clickEvent.' />'; ?> </li> <?php endif; ?> <?php endfor; ?> </ul> </div> <?php }
function output_tabs($current_tab, $changes) { global $_base_path; $tabs = get_tabs(); $num_tabs = count($tabs); ?> <br /><br /><table class="etabbed-table" border="0" cellpadding="0" cellspacing="0"> <tr> <?php for ($i=0; $i < $num_tabs; $i++): if ($current_tab == $i):?> <td class="editor_tab_selected"> <?php if ($changes[$i]): ?> <img src="<?php echo $_base_path; ?>images/changes_bullet.gif" alt="<?php echo _AT('usaved_changes_made'); ?>" height="12" width="15" /> <?php endif; ?> <?php echo _AT($tabs[$i][0]); ?> </td> <td class="tab-spacer"> </td> <?php else: ?> <td class="editor_tab"> <?php if ($changes[$i]): ?> <img src="<?php echo $_base_path; ?>images/changes_bullet.gif" alt="<?php echo _AT('usaved_changes_made'); ?>" height="12" width="15" /> <?php endif; ?> <?php echo '<input type="submit" name="button_'.$i.'" value="'._AT($tabs[$i][0]).'" title="'._AT($tabs[$i][0]).' - alt '.$tabs[$i][2].'" class="editor_buttontab" accesskey="'.$tabs[$i][2].'" onmouseover="this.style.cursor=\'pointer\';" '.$clickEvent.' />'; ?> </td> <td class="tab-spacer"> </td> <?php endif; ?> <?php endfor; ?> <td > </td> </tr> </table> <?php }
* @uses PMA_DBI_QUERY_STORE * @uses PMA_getRelationsParam() * @uses PMA_backquote() * @uses PMA_DBI_fetch_result() * @uses count() * @return array table positions and sizes */ function get_tab_pos() { $cfgRelation = PMA_getRelationsParam(); if (!$cfgRelation['designerwork']) { return null; } $query = "\r\n SELECT CONCAT_WS('.', `db_name`, `table_name`) AS `name`,\r\n `x` AS `X`,\r\n `y` AS `Y`,\r\n `v` AS `V`,\r\n `h` AS `H`\r\n FROM " . PMA_backquote($cfgRelation['db']) . "." . PMA_backquote($cfgRelation['designer_coords']); $tab_pos = PMA_DBI_fetch_result($query, 'name', null, $GLOBALS['controllink'], PMA_DBI_QUERY_STORE); return count($tab_pos) ? $tab_pos : null; } /** * returns distinct values from $GLOBALS['PMD']['OWNER'] * * @uses array_values() * @uses array_unique() * @uses $GLOBALS['PMD']['OWNER'] * @return array owner */ function get_owners() { return array_values(array_unique($GLOBALS['PMD']['OWNER'])); } get_tabs();
<?php $tabs = get_tabs(); $num_tabs = count($tabs); $current_tab = 0; // set default tab $switch_tab = false; for ($i=0; $i < $num_tabs; $i++) { if (isset($_POST['button_'.$i]) && ($_POST['button_'.$i] != -1)) { $current_tab = $i; $switch_tab = true; break; } } if (!$switch_tab && isset($_REQUEST['current_tab'])) { $current_tab = intval($_REQUEST['current_tab']); } if ($current_tab == 1) { global $_custom_head, $onload; $_custom_head = "<script language=\"JavaScript\" src=\"jscripts/lib/TILE.js\" type=\"text/javascript\"></script>"; $onload = "setPreviewFace(); setPreviewSize(); setPreviewColours();"; } require(AT_INCLUDE_PATH.'header.inc.php');
$index = new moodle_url($CFG->wwwroot . '/blocks/timetracker/index.php', $urlparams); $index->remove_params('userid', 'start', 'end'); $timesheeturl = new moodle_url($CFG->wwwroot . '/blocks/timetracker/timesheet.php', $urlparams); $timesheeturl->remove_params('start', 'end'); $workersigurl = new moodle_url($CFG->wwwroot . '/blocks/timetracker/workersig.php', $urlparams); $conflicts = check_worker_hours_for_conflicts($userid, $start, $end); if (sizeof($conflicts) == 0) { redirect($workersigurl); } $strtitle = get_string('pluginname', 'block_timetracker'); $PAGE->set_url($timesheeturl); $PAGE->set_title($strtitle); $PAGE->set_heading($strtitle); $PAGE->set_pagelayout('base'); echo $OUTPUT->header(); $tabs = get_tabs($urlparams, false, $courseid); $tabs = array($tabs); print_tabs($tabs, 'home'); echo $OUTPUT->box_start(); echo "<p><h3>There are work units in this time range that conflict with your scheduled class\n times. Please alert the below units to your supervisor and wait for them to be\n corrected before you submit a timesheet.</h3></p>"; //echo '<p>'.$OUTPUT->action_link($timesheeturl, 'Timesheets').'</p>'; echo $OUTPUT->box_end(); $alertlink = new moodle_url($CFG->wwwroot . '/blocks/timetracker/alert.php'); //display any units that are conflicts, if they exist echo $OUTPUT->box_start(); $htmldoc = '<table align="center" width="95%" style="border: 1px solid #000;">'; $htmldoc .= '<tr> <th colspan="3">Class Schedule Conflicts</th> </tr> <tr> <td style="font-weight: bold">Class Meeting</td>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <?php include 'php/util/db.php'; include 'php/util/common.php'; $q = isset($_REQUEST["page"]) ? $_REQUEST["page"] : "home"; $PAGES_DIR = "./php/pages/"; $conn = init_db(); $page = get_page($conn, $q); $tabs = get_tabs($conn); //page - file, name, display_name $show_ticker = $show_slideshow = $q == "home"; ?> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta http-equiv="content-language" content="en" /> <meta name="robots" content="all,follow" /> <meta name="author" lang="en" content="All: Satheesh Kumar M [sathyz.wordpress.com]; e-mail: sathyz@gmail.com" /> <meta name="description" content="Rainbow Novelties - specialises in creating custom designed bags for the discerning corporations" /> <meta name="keywords" content="rainbow novelties bags apparels gifts" /> <link rel="icon" type="image/x-icon" href="logo.ico" /> <link rel="stylesheet" media="screen,projection" type="text/css" href="css/reset.css" /> <link rel="stylesheet" media="screen,projection" type="text/css" href="css/main.css" /> <!--[if lte IE 6]><link rel="stylesheet" type="text/css" href="css/main-msie.css" /><![endif]--> <link rel="stylesheet" media="screen,projection" type="text/css" href="css/style.css" /> <link rel="stylesheet" media="print" type="text/css" href="css/print.css" />
$DB->delete_records('block_timetracker_pending', array('id' => $unitid)); } if (!$ispending && $mailok) { $DB->delete_records('block_timetracker_workunit', array('id' => $unitid)); } if (!$mailok) { print_error("Error sending message to {$user->firstname} {$user->lastname}"); } } else { print_error("Failed mailing user {$tid}"); } } } } else { //print out an error saying we can't handle this alert } } $status = get_string('emessagesent', 'block_timetracker'); redirect($nextpage, $status, 1); } else { //form is shown for the first time echo $OUTPUT->header(); $maintabs = get_tabs($urlparams, $canview, $courseid); //print_object($urlparams); $maintabs[] = new tabobject('postalert', new moodle_url($CFG->wwwroot . '/blocks/timetracker/index.php?', $urlparams), 'Post alert'); $tabs = array($maintabs); print_tabs($tabs, 'postalert'); $mform->display(); echo $OUTPUT->footer(); } }
function return_navigation_array() { $navigation = array(); $menu_navigation = array(); $possible_tabs = get_tabs(); // Campus Homepage if (api_get_setting('show_tabs', 'campus_homepage') == 'true') { $navigation[SECTION_CAMPUS] = $possible_tabs[SECTION_CAMPUS]; } else { $menu_navigation[SECTION_CAMPUS] = $possible_tabs[SECTION_CAMPUS]; } if (api_get_user_id() && !api_is_anonymous()) { // My Courses if (api_get_setting('show_tabs', 'my_courses') == 'true') { $navigation['mycourses'] = $possible_tabs['mycourses']; } else { $menu_navigation['mycourses'] = $possible_tabs['mycourses']; } // My Profile if (api_get_setting('show_tabs', 'my_profile') == 'true' && api_get_setting('allow_social_tool') != 'true') { $navigation['myprofile'] = $possible_tabs['myprofile']; } else { $menu_navigation['myprofile'] = $possible_tabs['myprofile']; } // My Agenda if (api_get_setting('show_tabs', 'my_agenda') == 'true') { $navigation['myagenda'] = $possible_tabs['myagenda']; } else { $menu_navigation['myagenda'] = $possible_tabs['myagenda']; } // Gradebook if (api_get_setting('gradebook_enable') == 'true') { if (api_get_setting('show_tabs', 'my_gradebook') == 'true') { $navigation['mygradebook'] = $possible_tabs['mygradebook']; } else { $menu_navigation['mygradebook'] = $possible_tabs['mygradebook']; } } // Reporting if (api_get_setting('show_tabs', 'reporting') == 'true') { if (api_is_allowed_to_create_course() || api_is_drh() || api_is_session_admin()) { $navigation['session_my_space'] = $possible_tabs['session_my_space']; } else { $navigation['session_my_space'] = $possible_tabs['session_my_progress']; } } else { if (api_is_allowed_to_create_course() || api_is_drh() || api_is_session_admin()) { $menu_navigation['session_my_space'] = $possible_tabs['session_my_space']; } else { $menu_navigation['session_my_space'] = $possible_tabs['session_my_progress']; } } // Social Networking if (api_get_setting('show_tabs', 'social') == 'true') { if (api_get_setting('allow_social_tool') == 'true') { $navigation['social'] = isset($possible_tabs['social']) ? $possible_tabs['social'] : null; } } else { $menu_navigation['social'] = isset($possible_tabs['social']) ? $possible_tabs['social'] : null; } // Dashboard if (api_get_setting('show_tabs', 'dashboard') == 'true') { if (api_is_platform_admin() || api_is_drh() || api_is_session_admin()) { $navigation['dashboard'] = isset($possible_tabs['dashboard']) ? $possible_tabs['dashboard'] : null; } } else { $menu_navigation['dashboard'] = isset($possible_tabs['dashboard']) ? $possible_tabs['dashboard'] : null; } // Administration if (api_is_platform_admin(true)) { if (api_get_setting('show_tabs', 'platform_administration') == 'true') { $navigation['platform_admin'] = $possible_tabs['platform_admin']; } else { $menu_navigation['platform_admin'] = $possible_tabs['platform_admin']; } } // Reports if (!empty($possible_tabs['reports'])) { if (api_get_setting('show_tabs', 'reports') == 'true') { if ((api_is_platform_admin() || api_is_drh() || api_is_session_admin()) && Rights::hasRight('show_tabs:reports')) { $navigation['reports'] = $possible_tabs['reports']; } } else { $menu_navigation['reports'] = $possible_tabs['reports']; } } // Custom tabs $customTabs = getCustomTabs(); if (!empty($customTabs)) { foreach ($customTabs as $tab) { if (api_get_setting($tab['variable'], $tab['subkey']) == 'true' && isset($possible_tabs[$tab['subkey']])) { $possible_tabs[$tab['subkey']]['url'] = api_get_path(WEB_PATH) . $possible_tabs[$tab['subkey']]['url']; $navigation[$tab['subkey']] = $possible_tabs[$tab['subkey']]; } else { if (isset($possible_tabs[$tab['subkey']])) { $possible_tabs[$tab['subkey']]['url'] = api_get_path(WEB_PATH) . $possible_tabs[$tab['subkey']]['url']; $menu_navigation[$tab['subkey']] = $possible_tabs[$tab['subkey']]; } } } } } return array('menu_navigation' => $menu_navigation, 'navigation' => $navigation, 'possible_tabs' => $possible_tabs); }
} if ($mform->is_cancelled()) { //user clicked cancel redirect($nextpage); } else { if ($formdata = $mform->get_data()) { $formdata->courseid = $formdata->id; unset($formdata->id); $formdata->id = $formdata->unitid; $formdata->lastedited = time(); $formdata->lasteditedby = $formdata->editedby; //print_object($formdata); //$DB->update_record('block_timetracker_workunit', $formdata); update_unit($formdata); $status = 'Work unit edited successfully.'; //error_log($nextpage); unset($nextpage->unitid); redirect($nextpage, $status, 1); } else { //form is shown for the first time //error_log('edit unit: '.qualified_me()); echo $OUTPUT->header(); $tabs = get_tabs($urlparams, $canmanage, $courseid); $tabs[] = new tabobject('editunit', new moodle_url($CFG->wwwroot . '/blocks/timetracker/index.php#', $urlparams), 'Edit Work Unit'); $tabs = array($tabs); print_tabs($tabs, 'editunit'); $mform->set_data($nextdata); $mform->display(); echo $OUTPUT->footer(); } }
<?php if (!is_admin()) { die; } $modulePath = $_GET['module']; $tabs = array('home.php'); $tabs = array_merge($tabs, get_tabs($modulePath)); $selectedtab = isset($_GET['tab']) ? strtolower($_GET['tab']) : 'home'; ?> <div class="span9"> <ul class="nav nav-pills"> <?php foreach ($tabs as $tab) { $tab = str_replace('.php', '', $tab); $active = strtolower($selectedtab) === strtolower($tab) ? 'active' : ''; $formatted_tab = ucwords($tab); echo "<li class='{$active}'><a href='index.php?module={$_GET['module']}&tab={$tab}'>{$formatted_tab}</a></li>"; } ?> </ul> <?php include "../core/Modules/{$modulePath}/tabs/{$selectedtab}.php"; if ($selectedtab == "home") { constructAdminFooter($modulePath); } ?>
public function get_content() { global $USER, $PAGE, $COURSE, $DB, $CFG; require_once $CFG->dirroot . '/mod/occapira/locallib.php'; require_once dirname(__FILE__) . '/locallib.php'; $latest = 1; $latest_chapter = 0; $next = false; $records = $DB->get_records_sql('SELECT * FROM {course_sections} WHERE course = ? AND section != 0 ORDER BY section DESC', array($COURSE->id)); foreach ($records as $record) { $percentage = occapira_get_section_percentage($record->course, $record->id); //echo $record->course.' '.$record->section.'<br />'; if ($percentage > 0) { //echo $record->course.' '.$record->section.': '.$percentage.'<br />'; $latest = $record->section; if ($percentage == 100 and $next = true) { $latest++; } break; } $next = true; } if ($latest > 0) { $lc = get_chapter_for_lection($latest, $this->config->chapter_configtext); $latest_chapter = $lc['number']; //print_object($latest_chapter); } //echo $latest_chapter.' '.$latest.'<br />'; if ($this->content !== null) { return $this->content; } $content = ''; ///////////////////////////////////////////////////////////////////////////////////////////////////// // Zuerst müssen die 5 Tabs gerendert werden (Teilnehmer + Map, Newsforum, Badges, Social Media, Kurs) //print_object($COURSE);die(); if ($COURSE) { $content .= get_tabs($COURSE->id, $this->config->socialmedia_link, $this->config->discussion_link, $latest_chapter, $latest) . '<br />'; } ////////////////////////////////////////////////////////////////////// // Ab hier werden die Kapitelbildchen zum durchscrollen/wischen gebaut // $img_urls['0.png'] == https://mooin.oncampus.de/pluginfile.php/79/mod_folder/content/0/0.png?oid=1424271017 $img_urls = get_img_urls($this->config->directory_link); $chapter_configtext = $this->config->chapter_configtext; $chapters = get_chapters($chapter_configtext); //print_object($chapters); $exploded = explode('?', $PAGE->url->out(false)); $context = get_context_instance(CONTEXT_COURSE, $COURSE->id); $is_teacher = has_capability('moodle/course:update', $context); //has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM)); // nur anzeigen, wenn wir in der Kursansicht sind if ($CFG->wwwroot . '/course/view.php' == $exploded[0]) { $active_chapter = optional_param('chapter', 0, PARAM_INT); if (!$is_teacher) { $hidden = 0; $cha = 0; foreach ($chapters as $ch) { if ($cha == $active_chapter) { break; } if ($ch['enabled'] == 'hidden') { $hidden++; } $cha++; } $active_chapter = $active_chapter - $hidden; } $content .= '<script>var chapter = ' . $active_chapter . ';</script>'; $content .= '<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>'; // TODO jquery.js im block-verzeichnis verwenden $content .= '<script src="' . new moodle_url('/blocks/oc_mooc_nav/js/vendor/modernizr.js') . '"></script>'; $content .= '<script src="' . new moodle_url('/blocks/oc_mooc_nav/js/vendor/plugins.js') . '"></script>'; $content .= '<script src="' . new moodle_url('/blocks/oc_mooc_nav/js/sly.js') . '"></script>'; $content .= '<script src="' . new moodle_url('/blocks/oc_mooc_nav/js/centered.js') . '"></script>'; $content .= '<link rel="stylesheet" type="text/css" href="' . new moodle_url('/blocks/oc_mooc_nav/css/nav.css') . '">'; $content .= '<div align="center" class="wrap">'; $content .= ' <button class="btn prev btn_prev_left"><!-- prev --></button> <button class="btn next btn_next_right"><!-- next --></button> '; $content .= '<div class="frame" id="forcecentered"> <ul class="clearfix oc-kapitelzahl-' . count($chapters) . '">'; // li-tags mit den Bildern für die Navigation erzeugen $i = 0; foreach ($chapters as $chapter) { // $all_chapters //$img_url = $img_path.$chapter['number'].'.png'; if ($chapter['enabled'] != 'hidden' or $is_teacher) { $img_url = $img_urls[$chapter['img']]; $class = ''; if ($chapter['enabled'] == 'false') { $class = 'chapter-disabled'; } if ($i == 0) { $content .= '<li class="first-chapter' . $class . '">'; } else { if ($i == count($chapters) - 1) { $content .= '<li class="last-chapter' . $class . '">'; } else { $content .= '<li class="' . $class . '">'; } } $low = $chapter['first_lection']; $content .= '<a href="../course/view.php?id=' . $COURSE->id . '&chapter=' . $chapter['number'] . '&selected_week=' . $low . '"><img src="' . $img_url . '" data-item="' . $chapter['number'] . '"/></a></li>'; } $i++; } $content .= '</ul> </div>'; $content .= '</div>'; } $this->content = new stdClass(); $this->content->text = $content; return $this->content; }
/** * Tabs * * Creating jQuery UI Tabs * * <b>Usage:</b> * <code> * $elements = array( * array( * 'title' => 'Tab 1 title', * 'content' => 'Tab 1 content is here.' * ), * array( * 'title' => 'Tab 2 title', * 'content' => 'Tab 2 content is here.' * ) * ); * skip_tabs( $elements, $args ); // echo tabs * * // If you don't want to print out tabs and get back HTML use the get function * $tabs_html = get_skip_tabs( $elements, $args ); * </code> * * @package Skip\Animated * @since 1.0 * * @param array $elements Elements array structured [ 'title' ], [ 'content' ] and [ 'args' ] * @param array $args Args array of [ 'id' ], [ 'classes' ], [ 'params' ] * @param string $return How to return 'echo', 'object' or 'html' */ function tabs($elements, $args = array()) { get_tabs($elements, $args, 'echo'); }