Example #1
0
function print_results($results)
{
    foreach ($results as $id => $data) {
        printf("<h2>%s</h2>\n", $id);
        print_table($data);
    }
}
function print_results($results)
{
    printf("<h1>%d servers in list</h1>\n", count($results));
    foreach ($results as $id => $data) {
        printf("<h2>%s</h2>\n", $id);
        print_table($data);
    }
}
Example #3
0
function print_results($gamequery)
{
    foreach ($gamequery as $id => $data) {
        if ($id != $_GET['id']) {
            continue;
        }
        print_table($data);
    }
}
 function render()
 {
     $text = "Lorem ipsum";
     $im = new \Imagick();
     $draw = new \ImagickDraw();
     $draw->setStrokeColor("none");
     $draw->setFont("../fonts/Arial.ttf");
     $draw->setFontSize(96);
     $draw->setTextAlignment(\Imagick::ALIGN_LEFT);
     $metrics = $im->queryFontMetrics($draw, $text);
     return print_table($metrics);
 }
Example #5
0
 function display()
 {
     global $CFG, $PAGE, $COURSE;
     $moving = optional_param('moving', 0, PARAM_INT);
     require_capability('format/page:managepages', $this->context);
     $PAGE->print_tabs('manage');
     if ($pages = page_get_all_pages($COURSE->id, 'flat')) {
         $table->head = array(get_string('pagename', 'format_page'), get_string('pageoptions', 'format_page'), get_string('displaytheme', 'format_page'), get_string('displaymenu', 'format_page'), get_string('publish', 'format_page'), get_string('locks', 'format_page'));
         $table->align = array('left', 'center', 'center', 'center', 'center', 'center');
         $table->width = '70%';
         $table->cellspacing = '0';
         $table->id = 'editing-table';
         $table->class = 'generaltable pageeditingtable';
         $table->data = array();
         foreach ($pages as $page) {
             $a = strip_tags(format_string($page->nameone));
             $editalt = get_string('edita', 'format_page', $a);
             $movealt = get_string('movea', 'format_page', $a);
             $delealt = get_string('deletea', 'format_page', $a);
             // Page link/name
             $name = page_pad_string('<a href="' . $PAGE->url_build('page', $page->id) . '" title="' . $a . '">' . format_string($page->nameone) . '</a>', $page->depth);
             // Edit, move and delete widgets
             $widgets = '<a title="' . $editalt . '" href="' . $PAGE->url_build('page', $page->id, 'action', 'editpage', 'returnaction', 'manage') . '" class="icon edit"><img src="' . $CFG->pixpath . '/t/edit.gif" alt="' . $editalt . '" /></a>&nbsp;';
             $widgets .= '<a title="' . $movealt . '" href="' . $PAGE->url_build('action', 'moving', 'moving', $page->id, 'sesskey', sesskey()) . '" class="icon move"><img src="' . $CFG->pixpath . '/t/move.gif" alt="' . $movealt . '" /></a>&nbsp;';
             $widgets .= '<a title="' . $delealt . '" href="' . $PAGE->url_build('action', 'confirmdelete', 'page', $page->id, 'sesskey', sesskey()) . '" class="icon delete"><img src="' . $CFG->pixpath . '/t/delete.gif" alt="' . $delealt . '" /></a>';
             // Theme, menu and publish widgets
             if ($page->parent == 0) {
                 // Only master pages get this one
                 $theme = $this->manage_showhide($page, DISP_THEME);
             } else {
                 //$theme = '';
                 $theme = $this->manage_showhide($page, DISP_THEME);
             }
             $menu = $this->manage_showhide($page, DISP_MENU);
             $publish = $this->manage_showhide($page, DISP_PUBLISH);
             if (empty($page->locks)) {
                 $lockalt = get_string('notlockedalt', 'format_page');
                 $lockicon = 'lock.gif';
             } else {
                 $lockalt = get_string('lockedalt', 'format_page');
                 $lockicon = 'unlock.gif';
             }
             $lock = '<a title="' . $lockalt . '" href="' . $PAGE->url_build('page', $page->id, 'action', 'lock') . '" class="icon lock"><img src="' . $CFG->pixpath . '/t/' . $lockicon . '" alt="' . $lockalt . '" /></a>';
             $table->data[] = array($name, $widgets, $theme, $menu, $publish, $lock);
         }
         print_table($table);
     } else {
         error(get_string('nopages', 'format_page'), $PAGE->url_build('action', 'editpage'));
     }
 }
/**
 * @param $print_flag
 */
function calculate_page_content($print_flag)
{
    $specmanagement_print_api = new specmanagement_print_api();
    html_page_top1(plugin_lang_get('menu_versgraph'));
    echo '<link rel="stylesheet" href="' . SPECMANAGEMENT_PLUGIN_URL . 'files/specmanagement.css">';
    if (!$print_flag) {
        html_page_top2();
        if (plugin_is_installed('WhiteboardMenu') && file_exists(config_get_global('plugin_path') . 'WhiteboardMenu')) {
            require_once WHITEBOARDMENU_CORE_URI . 'whiteboard_print_api.php';
            $whiteboard_print_api = new whiteboard_print_api();
            $whiteboard_print_api->printWhiteboardMenu();
        }
        $specmanagement_print_api->print_plugin_menu();
        echo '<div align="center">';
        echo '<hr size="1" width="100%" />';
    }
    print_table($print_flag);
    if (!$print_flag) {
        html_page_bottom1();
    }
}
 function display()
 {
     global $PAGE, $COURSE;
     $moving = required_param('moving', PARAM_INT);
     require_capability('format/page:managepages', $this->context);
     $PAGE->print_tabs('manage');
     if ($pages = page_get_all_pages($COURSE->id)) {
         if (!($name = get_field('format_page', 'nameone', 'id', $moving))) {
             error('Cannot get the name of the page');
         }
         $a = new stdClass();
         $a->name = format_string($name);
         $a->url = $PAGE->url_get_full(array('action' => 'manage'));
         $table->head = array(get_string('movingpage', 'format_page', $a));
         $table->cellpadding = '2px';
         $table->cellspacing = '0';
         $table->width = '30%';
         $table->wrap = array('nowrap');
         $table->id = 'editing-table';
         $table->class = 'pageeditingtable';
         $table->data = array();
         $sortorder = 1;
         $data = array();
         $data[] = $this->movehere_widget($moving, 0, 0, -2, get_string('asamasterpageone', 'format_page'));
         foreach ($pages as $page) {
             if ($page->id != $moving) {
                 $data = array_merge($data, $this->print_moving_hierarchy($page, $moving));
                 $data[] = $this->movehere_widget($moving, 0, $sortorder, -2, get_string('asamasterpageafter', 'format_page', format_string($page->nameone)));
                 $sortorder++;
             }
         }
         // Convert each item in $data into a table row
         foreach ($data as $row) {
             $table->data[] = array($row);
         }
         print_table($table);
     } else {
         error(get_string('nopages', 'format_page'), $PAGE->url_build('action', 'editpage'));
     }
 }
Example #8
0
function make_html($link, $data_date, $base_table)
{
    if ($base_table == 'okato') {
        $classif = "ОКАТО";
    } else {
        $classif = "ОКТМО";
    }
    echo date("H:i:s") . " Генерация html для классификатора {$classif}\n\n";
    $time = -time();
    print_table($link, $data_date, $base_table, '', 'html');
    $i = 1;
    $query = 'SELECT mergedcode FROM ' . $base_table . ' WHERE mergedcode<>\'00000000\' AND exist<>0';
    $result = mysqli_query($link, $query);
    $num_pages = mysqli_num_rows($result);
    while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
        $percents = 100 * $i / $num_pages;
        $status = sprintf("%3d", $percents) . '% Обработано ' . sprintf("%7d", $i) . ' из ' . sprintf("%7d", $num_pages) . ' ';
        fwrite(STDERR, "\r{$status}");
        print_table($link, $data_date, $base_table, $row['mergedcode'], 'html');
        $i++;
    }
    $time += time();
    echo "\n\n" . date("H:i:s") . " Генерация html для {$classif} выполнена за " . hms($time) . "\n\n";
}
Example #9
0
function print_aside_deck($id)
{
    global $DECK_SINGLE_TABLE_ATTR;
    $table = get_deck_table_name($id);
    print_msg(get_deck_name_by_id($id));
    $total = print_table($table, $DECK_SINGLE_TABLE_ATTR, 'print_single_deck_table_callback');
    print_msg("total = {$total}");
}
Example #10
0
function survey_print_all_responses($cmid, $results, $courseid)
{
    $table->head = array("", get_string("name"), get_string("time"));
    $table->align = array("", "left", "left");
    $table->size = array(35, "", "");
    foreach ($results as $a) {
        $table->data[] = array(print_user_picture($a->id, $courseid, $a->picture, false, true, false), "<a href=\"report.php?action=student&amp;student={$a->id}&amp;id={$cmid}\">" . fullname($a) . "</a>", userdate($a->time));
    }
    print_table($table);
}
 /**
  * Display auto generated info about the assignment
  */
 function view_summary($submission = null, $return = false)
 {
     global $USER, $CFG;
     $table = new Object();
     $table->id = 'summary';
     $table->class = 'generaltable';
     $table->align = array('right', 'left');
     $table->size = array('20%', '');
     $table->width = '100%';
     // Language
     $item_name = get_string('assignmentlangs', 'assignment_onlinejudge') . ':';
     $lang = get_string('lang' . $this->onlinejudge->language, 'assignment_onlinejudge');
     $table->data[] = array($item_name, $lang);
     if (is_null($submission)) {
         $submission = $this->get_submission();
     }
     // Status
     $item_name = get_string('status') . helpbutton('status', get_string('status'), 'assignment_onlinejudge', true, false, '', true) . ':';
     $item = get_string('notavailable');
     if (!empty($submission->status)) {
         $item = get_string('status' . $submission->status, 'assignment_onlinejudge');
     }
     $table->data[] = array($item_name, $item);
     // Judge time
     $item_name = get_string('judgetime', 'assignment_onlinejudge') . ':';
     $item = get_string('notavailable');
     if (isset($submission->judgetime)) {
         $item = userdate($submission->judgetime) . '&nbsp(' . get_string('early', 'assignment', format_time(time() - $submission->judgetime)) . ')';
     }
     $table->data[] = array($item_name, $item);
     // Information
     $item_name = get_string('info', 'assignment_onlinejudge') . ':';
     $item = get_string('notavailable');
     if (isset($submission->status)) {
         if ($submission->status === 'pending') {
             if (empty($CFG->assignment_oj_daemon_pid)) {
                 //Judge from cron
                 $lastcron = get_field('modules', 'lastcron', 'name', 'assignment');
                 $left = ceil(($lastcron + $CFG->assignment_oj_cronfreq - time()) / 60);
                 $left = $left > 0 ? $left : 0;
                 $submission->info = get_string('infopending', 'assignment_onlinejudge', $left);
             } else {
                 $submission->info = get_string('notavailable');
             }
         } else {
             if ($submission->status !== 'ac' && $submission->status !== 'ce' && empty($submission->info)) {
                 $submission->info = get_string('info' . $submission->status, 'assignment_onlinejudge');
             }
         }
         if (!empty($submission->info)) {
             $item = $submission->info;
         }
     }
     $options = new stdClass();
     $options->para = false;
     $table->data[] = array($item_name, format_text(stripslashes($item), FORMAT_MOODLE, $options));
     // Statistics
     $item_name = get_string('statistics', 'assignment_onlinejudge') . ':';
     $item = get_string('notavailable');
     if (isset($submission->id)) {
         $item = '';
         $ac_rate = $this->get_statistics($submission, &$item);
         if (!empty($item)) {
             $item .= '<br />' . get_string('successrate', 'assignment_onlinejudge') . ': ' . round($ac_rate * 100, 2) . '%';
         }
     }
     $table->data[] = array($item_name, $item);
     // Output (Show to teacher only)
     $context = get_context_instance(CONTEXT_MODULE, $this->cm->id);
     if (has_capability('mod/assignment:grade', $context) && isset($submission->output)) {
         $table->data[] = array(get_string('output', 'assignment_onlinejudge') . ':', format_text(stripslashes($submission->output), FORMAT_PLAIN));
     }
     $output = print_table($table, true);
     if ($return) {
         return $output;
     }
     echo $output;
 }
<?php

print_topic("VIEWING MEMBERS");
include get_file_loc('menue.inc');
print_galactic_post_menue();
$container = array();
$container["url"] = "skeleton.php";
$container["body"] = "galactic_post_view_members.php";
if ($action == "Remove") {
    $db->query("DELETE FROM galactic_post_writer WHERE game_id = {$player->game_id} AND account_id = {$var['id']}");
}
$db->query("SELECT * FROM galactic_post_writer WHERE game_id = {$player->game_id} AND account_id != {$player->account_id}");
if ($db->nf()) {
    print_table();
    print "<tr>";
    print "<th align=\"center\">Player Name</th>";
    print "<th align=\"center\">Last Wrote</th>";
    print "<th align=\"center\">Options</th>";
    print "</tr>";
    while ($db->next_record()) {
        $curr_writter = new SMR_PLAYER($db->f("account_id"), $player->game_id);
        $time = $db->f("last_wrote");
        print "<tr>";
        print "<td align=\"center\">{$curr_writter->player_name}</td>";
        print "<td align=\"center\"> " . date("n/j/Y g:i:s A", $time) . "</td>";
        $container["id"] = $curr_writter->account_id;
        print_form($container);
        print "<td>";
        print_submit("Remove");
        print "</td>";
        print "</tr>";
Example #13
0
 function history($question, $state, $number, $cmoptions, $options)
 {
     $history = '';
     if (isset($options->history) and $options->history) {
         if ($options->history == 'all') {
             // show all states
             $states = get_records_select('question_states', "attempt = '{$state->attempt}' AND question = '{$question->id}' AND event > '0'", 'seq_number ASC');
         } else {
             // show only graded states
             $states = get_records_select('question_states', "attempt = '{$state->attempt}' AND question = '{$question->id}' AND event IN (" . QUESTION_EVENTS_GRADED . ")", 'seq_number ASC');
         }
         if (count($states) > 1) {
             $strreviewquestion = get_string('reviewresponse', 'quiz');
             $table = new stdClass();
             $table->width = '100%';
             if ($options->scores) {
                 $table->head = array(get_string('numberabbr', 'quiz'), get_string('action', 'quiz'), get_string('response', 'quiz'), get_string('time'), get_string('score', 'quiz'), get_string('grade', 'quiz'));
             } else {
                 $table->head = array(get_string('numberabbr', 'quiz'), get_string('action', 'quiz'), get_string('response', 'quiz'), get_string('time'));
             }
             foreach ($states as $st) {
                 $st->responses[''] = $st->answer;
                 $this->restore_session_and_responses($question, $st);
                 $b = $state->id == $st->id ? '<b>' : '';
                 $be = $state->id == $st->id ? '</b>' : '';
                 if ($state->id == $st->id) {
                     $link = '<b>' . $st->seq_number . '</b>';
                 } else {
                     if (isset($options->questionreviewlink)) {
                         $link = link_to_popup_window($options->questionreviewlink . '?state=' . $st->id . '&amp;number=' . $number, 'reviewquestion', $st->seq_number, 450, 650, $strreviewquestion, 'none', true);
                     } else {
                         $link = $st->seq_number;
                     }
                 }
                 if ($options->scores) {
                     $table->data[] = array($link, $b . get_string('event' . $st->event, 'quiz') . $be, $b . $this->response_summary($question, $st) . $be, $b . userdate($st->timestamp, get_string('timestr', 'quiz')) . $be, $b . round($st->raw_grade, $cmoptions->decimalpoints) . $be, $b . round($st->grade, $cmoptions->decimalpoints) . $be);
                 } else {
                     $table->data[] = array($link, $b . get_string('event' . $st->event, 'quiz') . $be, $b . $this->response_summary($question, $st) . $be, $b . userdate($st->timestamp, get_string('timestr', 'quiz')) . $be);
                 }
             }
             $history = print_table($table, true);
         }
     }
     return $history;
 }
Example #14
0
    $export_pdf_form = new DataForm(DataForm::TYPE_EXPORT_PDF, 'export_pdf_form', null, api_get_self() . '?exportpdf=&offset=' . intval($_GET['offset']) . '&selectcat=' . intval($_GET['selectcat']) . '&' . api_get_cidreq(), '_blank', '');
    if ($export_pdf_form->validate()) {
        $params = $export_pdf_form->exportValues();
        Display::set_header(null, false, false);
        $params['join_firstname_lastname'] = true;
        $params['show_official_code'] = true;
        $params['export_pdf'] = true;
        $params['only_total_category'] = false;
        GradebookUtils::export_pdf_flatview($flatviewtable, $cat, $users, $alleval, $alllinks, $params, $mainCourseCategory[0]);
    } else {
        Display::display_header(get_lang('ExportPDF'));
    }
}
if (isset($_GET['print'])) {
    $printable_data = GradebookUtils::get_printable_data($cat[0], $users, $alleval, $alllinks, $params, $mainCourseCategory[0]);
    echo print_table($printable_data[1], $printable_data[0], get_lang('FlatView'), $cat[0]->get_name());
    exit;
}
if (!empty($_GET['export_report']) && $_GET['export_report'] == 'export_report') {
    if (api_is_platform_admin() || api_is_course_admin() || api_is_course_coach() || $isDrhOfCourse) {
        $user_id = null;
        if (empty($_SESSION['export_user_fields'])) {
            $_SESSION['export_user_fields'] = false;
        }
        if (!api_is_allowed_to_edit(false, false) and !api_is_course_tutor()) {
            $user_id = api_get_user_id();
        }
        $printable_data = GradebookUtils::get_printable_data($cat[0], $users, $alleval, $alllinks, $params, $mainCourseCategory[0]);
        switch ($_GET['export_format']) {
            case 'xls':
                $export = new GradeBookResult();
function dialogue_list_conversations_inout($dialogue, $inout)
{
    // list open conversations of the current user awaiting their reply
    global $USER, $CFG;
    if (!($course = get_record("course", "id", $dialogue->course))) {
        error("Course is misconfigured");
    }
    if (!($cm = get_coursemodule_from_instance("dialogue", $dialogue->id, $course->id))) {
        error("Course Module ID was incorrect");
    }
    $context = get_context_instance(CONTEXT_MODULE, $cm->id);
    $dialoguemanagers = array_keys(get_users_by_capability($context, 'mod/dialogue:manage'));
    $params->pane = optional_param('pane', '', PARAM_TEXT);
    $timenow = time();
    $showbutton = false;
    if (empty($params->order)) {
        $params->order = 'c.timemodified ASC';
    } else {
        $params->order = rtrim(ltrim(optional_param('order', '', PARAM_TEXT), "\\'"), "\\'");
    }
    // list the conversations requiring a resonse from this user in full
    if ($conversations = dialogue_get_conversations_unique_subject($dialogue, $USER, 'closed = 0 ', $params->order)) {
        // reorder the conversations by (other) name
        foreach ($conversations as $conversation) {
            if ($inout == 'outgoing' && !($USER->id == $conversation->userid)) {
                continue;
            }
            if ($inout == 'incoming' && !($USER->id == $conversation->recipientid)) {
                continue;
            }
            if (in_array($USER->id, $dialoguemanagers)) {
                if (!in_array($conversation->userid, $dialoguemanagers)) {
                    if (!($with = get_record("user", "id", $conversation->userid))) {
                        error("User's record not found");
                    }
                } else {
                    if (!($with = get_record("user", "id", $conversation->recipientid))) {
                        //continue;
                        error("User's record not found");
                    }
                }
            } else {
                if ($USER->id != $conversation->userid) {
                    if (!($with = get_record("user", "id", $conversation->userid))) {
                        error("User's record not found");
                    }
                } else {
                    if (!($with = get_record("user", "id", $conversation->recipientid))) {
                        error("User's record not found");
                    }
                }
            }
            $names[$conversation->id] = fullname($with);
        }
        // used to sord by names, i disabled it to have the table be sorted by clicking the arrows
        // on each column's header title.
        //natcasesort($names);
        print_simple_box_start("center");
        $table->head = array(get_string("dialoguewith", "dialogue"), get_string("subject", "dialogue"), get_string("lastentry", "dialogue") . "<a href=\"view.php?id={$cm->id}&amp;pane={$params->pane}&amp;order='c.timemodified ASC'\">" . "<img src=\"{$CFG->wwwroot}/mod/dialogue/pix/arrow-down.png\" height=16 width=16></a>" . "<a href=\"view.php?id={$cm->id}&amp;pane={$params->pane}&amp;order='c.timemodified DESC'\">" . "<img src=\"{$CFG->wwwroot}/mod/dialogue/pix/arrow-up.png\" height=16 width=16></a>", get_string("actions", "dialogue"));
        $table->width = "80%";
        $table->align = array("left", "left", "left", "center");
        $table->size = array("*", "*", "*", "*");
        $table->cellpadding = 2;
        $table->cellspacing = 0;
        foreach ($names as $cid => $name) {
            $conversation = $conversations[$cid];
            $hasattachmenticon = "&nbsp";
            if ($entries = get_records_select("dialogue_entries", "conversationid = {$conversation->id}", "id")) {
                foreach ($entries as $entry) {
                    if (!empty($entry->attachment)) {
                        $hasattachmenticon = "&nbsp<img src=\"{$CFG->wwwroot}/mod/dialogue/pix/paperclip.gif\" height=11 width=14>&nbsp";
                    }
                }
            }
            if ($conversation->total - $conversation->readings > 0) {
                $mailstatusicon = "pix/pmmail.gif";
                $unread = '<span class="unread">' . ($conversation->total - $conversation->readings) . '</span>';
            } else {
                $unread = 0;
                $mailstatusicon = "pix/answermail.gif";
            }
            $actions = "&nbsp";
            $actions .= "<a href=\"dialogues.php?id={$cm->id}&amp;action=deleteconversation&amp;cid={$conversation->id}\">" . "<img src=\"{$CFG->wwwroot}/mod/dialogue/pix/mail-delete.png\" height=11 width=14 alt=\"" . get_string("deleteconversation", "dialogue") . "\" title=\"" . get_string("deleteconversation", "dialogue") . "\" >&nbsp</a>";
            //        $actions .= "<a href=\"dialogues.php?id=$cm->id&amp;action=confirmclose&amp;cid=$conversation->id&pane=2\">".
            //	  "<img src=\"$CFG->wwwroot/mod/dialogue/pix/mail-archive.png\" height=11 width=14 alt=\"".get_string("archiveconversation", "dialogue")."\" title=\"".get_string("archiveconversation", "dialogue")."\" >&nbsp</a>";
            $table->data[] = array($name, "<img src=\"{$CFG->wwwroot}/mod/dialogue/{$mailstatusicon}\" height=14 width=15>&nbsp" . "<a href=\"dialogues.php?id={$cm->id}&amp;action=printdialogue&amp;cid={$conversation->id}\">" . clean_text($conversation->subject) . "</a>" . $hasattachmenticon, userdate($conversation->timemodified), $actions);
        }
        print_table($table);
        print_simple_box_end();
    }
}
Example #16
0
function list_dir($dir)
{
    // list directory contents
    global $dir_up, $mosConfig_live_site, $_VERSION;
    $allow = ($GLOBALS["permissions"] & 01) == 01;
    $admin = ($GLOBALS["permissions"] & 04) == 04 || ($GLOBALS["permissions"] & 02) == 02;
    $dir_up = dirname($dir);
    if ($dir_up == ".") {
        $dir_up = "";
    }
    if (!get_show_item($dir_up, basename($dir))) {
        ext_Result::sendResult('', false, $dir . " : " . $GLOBALS["error_msg"]["accessdir"]);
    }
    // make file & dir tables, & get total filesize & number of items
    make_tables($dir, $dir_list, $file_list, $tot_file_size, $num_items);
    $dirs = explode("/", $dir);
    $implode = "";
    $dir_links = "<a href=\"" . make_link("list", "", null) . "\">..</a>&nbsp;/&nbsp;";
    foreach ($dirs as $directory) {
        if ($directory != "") {
            $implode .= $directory . "/";
            $dir_links .= "<a href=\"" . make_link("list", $implode, null) . "\">{$directory}</a>&nbsp;/&nbsp;";
        }
    }
    echo '<div class="componentheading">' . $GLOBALS["messages"]["actdir"] . ": " . $dir_links . '</div>';
    // Sorting of items
    $images = "&nbsp;<img width=\"10\" height=\"10\" border=\"0\" align=\"absmiddle\" src=\"" . _EXT_URL . "/images/";
    if ($GLOBALS["direction"] == "ASC") {
        $_srt = "DESC";
        $images .= "_arrowup.gif\" alt=\"^\">";
    } else {
        $_srt = "ASC";
        $images .= "_arrowdown.gif\" alt=\"v\">";
    }
    // Toolbar
    /*echo "<br><table width=\"95%\"><tr><td><table><tr>\n";
    	
    	// PARENT DIR
    	echo "<td>";
    	if( $dir != "" ) {
    	  echo "<a href=\"".make_link("list",$dir_up,NULL)."\">";
    	  echo "<img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" src=\""._EXT_URL."/images/_up.png\" ";
    	  echo "alt=\"".$GLOBALS["messages"]["uplink"]."\" title=\"".$GLOBALS["messages"]["uplink"]."\"></a>";
    	}
    	echo "</td>\n";
    	// HOME DIR
    	echo "<td><a href=\"".make_link("list",NULL,NULL)."\">";
    	echo "<img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" src=\""._EXT_URL."/images/_home.gif\" ";
    	echo "alt=\"".$GLOBALS["messages"]["homelink"]."\" title=\"".$GLOBALS["messages"]["homelink"]."\"></a></td>\n";
    	// RELOAD
    	echo "<td><a href=\"javascript:location.reload();\"><img border=\"0\" width=\"22\" height=\"22\" ";
    	echo "align=\"absmiddle\" src=\""._EXT_URL."/images/_refresh.gif\" alt=\"".$GLOBALS["messages"]["reloadlink"];
    	echo "\" title=\"".$GLOBALS["messages"]["reloadlink"]."\"></A></td>\n";
    	// SEARCH
    	echo "<td><a href=\"".make_link("search",$dir,NULL)."\">";
    	echo "<img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" src=\""._EXT_URL."/images/_search.gif\" ";
    	echo "alt=\"".$GLOBALS["messages"]["searchlink"]."\" title=\"".$GLOBALS["messages"]["searchlink"];
    	echo "\"></a></td>\n";
    	
    	echo "<td><img src=\"images/menu_divider.png\" height=\"22\" width=\"2\" border=\"0\" alt=\"|\" /></td>";
    	
    	// Joomla Sysinfo
    	echo "<td><a href=\"".make_link("sysinfo",$dir,NULL)."\">";
    	echo "<img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" src=\""._EXT_URL."/images/systeminfo.gif\" ";
    	echo "alt=\"" . $GLOBALS['messages']['mossysinfolink'] . "\" title=\"" .$GLOBALS['messages']['mossysinfolink'] . "\"></a></td>\n";
    	
    	echo "<td><img src=\"images/menu_divider.png\" height=\"22\" width=\"2\" border=\"0\" alt=\"|\" /></td>";
    	
    	if($allow) {
    		// COPY
    		echo "<td><a href=\"javascript:Copy();\"><img border=\"0\" width=\"22\" height=\"22\" ";
    		echo "align=\"absmiddle\" src=\""._EXT_URL."/images/_copy.gif\" alt=\"".$GLOBALS["messages"]["copylink"];
    		echo "\" title=\"".$GLOBALS["messages"]["copylink"]."\"></a></td>\n";
    		// MOVE
    		echo "<td><a href=\"javascript:Move();\"><img border=\"0\" width=\"22\" height=\"22\" ";
    		echo "align=\"absmiddle\" src=\""._EXT_URL."/images/_move.gif\" alt=\"".$GLOBALS["messages"]["movelink"];
    		echo "\" title=\"".$GLOBALS["messages"]["movelink"]."\"></A></td>\n";
    		// DELETE
    		echo "<td><a href=\"javascript:Delete();\"><img border=\"0\" width=\"22\" height=\"22\" ";
    		echo "align=\"absmiddle\" src=\""._EXT_URL."/images/_delete.gif\" alt=\"".$GLOBALS["messages"]["dellink"];
    		echo "\" title=\"".$GLOBALS["messages"]["dellink"]."\"></A></td>\n";
    		// CHMOD
    		echo "<td><a href=\"javascript:Chmod();\"><img border=\"0\" width=\"22\" height=\"22\" ";
    		echo "align=\"absmiddle\" src=\""._EXT_URL."/images/_chmod.gif\" alt=\"chmod\" title=\"" . $GLOBALS['messages']['chmodlink'] . "\"></a></td>\n";
    		// UPLOAD
    		if(ini_get("file_uploads")) {
    			echo "<td><a href=\"".make_link("upload",$dir,NULL)."\">";
    			echo "<img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" ";
    			echo "src=\""._EXT_URL."/images/_upload.gif\" alt=\"".$GLOBALS["messages"]["uploadlink"];
    			echo "\" title=\"".$GLOBALS["messages"]["uploadlink"]."\"></A></td>\n";
    		} else {
    			echo "<td><img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" ";
    			echo "src=\""._EXT_URL."/images/_upload_.gif\" alt=\"".$GLOBALS["messages"]["uploadlink"];
    			echo "\" title=\"".$GLOBALS["messages"]["uploadlink"]."\"></td>\n";
    		}
    		// ARCHIVE
    		if($GLOBALS["zip"] || $GLOBALS["tar"] || $GLOBALS["tgz"]) {
    			echo "<td><a href=\"javascript:Archive();\"><img border=\"0\" width=\"22\" height=\"22\" ";
    			echo "align=\"absmiddle\" src=\""._EXT_URL."/images/_archive.gif\" alt=\"".$GLOBALS["messages"]["comprlink"];
    			echo "\" title=\"".$GLOBALS["messages"]["comprlink"]."\"></A></td>\n";
    		}
    	} else {
    		// COPY
    		echo "<td><img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" ";
    		echo "src=\""._EXT_URL."/images/_copy_.gif\" alt=\"".$GLOBALS["messages"]["copylink"]."\" title=\"";
    		echo $GLOBALS["messages"]["copylink"]."\"></td>\n";
    		// MOVE
    		echo "<td><img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" ";
    		echo "src=\""._EXT_URL."/images/_move_.gif\" alt=\"".$GLOBALS["messages"]["movelink"]."\" title=\"";
    		echo $GLOBALS["messages"]["movelink"]."\"></td>\n";
    		// DELETE
    		echo "<td><img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" ";
    		echo "src=\""._EXT_URL."/images/_delete_.gif\" alt=\"".$GLOBALS["messages"]["dellink"]."\" title=\"";
    		echo $GLOBALS["messages"]["dellink"]."\"></td>\n";
    		// UPLOAD
    		echo "<td><img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" ";
    		echo "src=\""._EXT_URL."/images/_upload_.gif\" alt=\"".$GLOBALS["messages"]["uplink"];
    		echo "\" title=\"".$GLOBALS["messages"]["uplink"]."\"></td>\n";
    	}
    
    	// ADMIN & LOGOUT
    	if($GLOBALS["require_login"]) {
    		echo "<td>::</td>";
    		// ADMIN
    		if($admin) {
    			echo "<td><a href=\"".make_link("admin",$dir,NULL)."\">";
    			echo "<img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" ";
    			echo "src=\""._EXT_URL."/images/_admin.gif\" alt=\"".$GLOBALS["messages"]["adminlink"]."\" title=\"";
    			echo $GLOBALS["messages"]["adminlink"]."\"></A></td>\n";
    		}
    		// LOGOUT
    		echo "<td><a href=\"".make_link("logout",NULL,NULL)."\">";
    		echo "<img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" ";
    		echo "src=\""._EXT_URL."/images/_logout.gif\" alt=\"".$GLOBALS["messages"]["logoutlink"]."\" title=\"";
    		echo $GLOBALS["messages"]["logoutlink"]."\"></a></td>\n";
    	}
    	// Logo
    	echo "<td style=\"padding-left:10px;\">";
    	//echo "<div style=\"margin-left:10px;float:right;\" width=\"305\" >";
    	echo "<a href=\"".$GLOBALS['ext_home']."\" target=\"_blank\" title=\"joomlaXplorer Project\"><img border=\"0\" align=\"absmiddle\" id=\"ext_logo\" style=\"filter:alpha(opacity=10);-moz-opacity:.10;opacity:.10;\" onmouseover=\"opacity('ext_logo', 60, 99, 500);\" onmouseout=\"opacity('ext_logo', 100, 60, 500);\" ";
    	echo "src=\""._EXT_URL."/images/logo.gif\" align=\"right\" alt=\"" . $GLOBALS['messages']['logolink'] . "\"></a>";
    	//echo "</div>";
    	echo "</td>\n";
    	
    	echo "</tr></table></td>\n";
    	
    	// Create File / Dir
    	
    	if($allow && is_writable($GLOBALS['home_dir'].'/'.$dir)) {
    		echo "<td align=\"right\"><table><form action=\"".make_link("mkitem",$dir,NULL)."\" method=\"post\">\n<tr><td>";
    		echo "<select name=\"mktype\"><option value=\"file\">".$GLOBALS["mimes"]["file"]."</option>";
    		echo "<option value=\"dir\">".$GLOBALS["mimes"]["dir"]."</option></select>\n";
    		echo "<input name=\"mkname\" type=\"text\" size=\"15\">";
    		echo "<input type=\"submit\" value=\"".$GLOBALS["messages"]["btncreate"];
    		echo "\"></td></tr></form></table></td>\n";
    	}
    	
    	echo "</tr></table>\n";
    	*/
    // End Toolbar
    // Begin Table + Form for checkboxes
    echo "<table width=\"95%\" cellpadding=\"5\" cellspacing=\"2\"><tr class=\"sectiontableheader\">\n";
    echo "<th width=\"44%\"><b>\n";
    if ($GLOBALS["order"] == "name") {
        $new_srt = $_srt;
    } else {
        $new_srt = "yes";
    }
    echo "<a href=\"" . make_link("list", $dir, NULL, "name", $new_srt) . "\">" . $GLOBALS["messages"]["nameheader"];
    if ($GLOBALS["order"] == "name") {
        echo $images;
    }
    echo "</a></b></td>\n<th width=\"10%\"><b>";
    if ($GLOBALS["order"] == "size") {
        $new_srt = $_srt;
    } else {
        $new_srt = "yes";
    }
    echo "<a href=\"" . make_link("list", $dir, NULL, "size", $new_srt) . "\">" . $GLOBALS["messages"]["sizeheader"];
    if ($GLOBALS["order"] == "size") {
        echo $images;
    }
    echo "</a></b></th>\n<th width=\"12%\" ><b>";
    if ($GLOBALS["order"] == "type") {
        $new_srt = $_srt;
    } else {
        $new_srt = "yes";
    }
    echo "<a href=\"" . make_link("list", $dir, NULL, "type", $new_srt) . "\">" . $GLOBALS["messages"]["typeheader"];
    if ($GLOBALS["order"] == "type") {
        echo $images;
    }
    echo "</a></b></th>\n<th width=\"12%\"><b>";
    if ($GLOBALS["order"] == "mod") {
        $new_srt = $_srt;
    } else {
        $new_srt = "yes";
    }
    echo "<a href=\"" . make_link("list", $dir, NULL, "mod", $new_srt) . "\">" . $GLOBALS["messages"]["modifheader"];
    if ($GLOBALS["order"] == "mod") {
        echo $images;
    }
    echo "</a></b></th></tr>\n";
    // make & print Table using lists
    print_table($dir, make_list($dir_list, $file_list), $allow);
    // print number of items & total filesize
    echo "<tr><td colspan=\"4\"><hr/></td></tr><tr>\n<td>&nbsp;</td>";
    echo "<td>" . $num_items . " " . $GLOBALS["messages"]["miscitems"] . " " . parse_file_size($tot_file_size) . "</td>\n";
    echo "<td>&nbsp;</td><td>&nbsp;</td>";
    echo "</tr>\n<tr><td colspan=\"4\"><hr/></td></tr></table>\n";
}
Example #17
0
function restore_print_course_header($course_header)
{
    $status = true;
    if ($course_header) {
        $table = new object();
        //This is tha align to every ingo table
        $table->align = array("right", "left");
        //The width
        $table->width = "70%";
        //Put interesting course header in table
        //The course name
        $tab[0][0] = "<b>" . get_string("name") . ":</b>";
        $tab[0][1] = $course_header->course_fullname . " (" . $course_header->course_shortname . ")";
        //The course summary
        $tab[1][0] = "<b>" . get_string("summary") . ":</b>";
        $tab[1][1] = $course_header->course_summary;
        $table->data = $tab;
        //Print title
        print_heading(get_string("course") . ":");
        //Print backup course header info
        print_table($table);
    } else {
        $status = false;
    }
    return $status;
}
Example #18
0
function search_items($dir)
{
    // search for item
    if (isset($GLOBALS['__POST']["searchitem"])) {
        $searchitem = stripslashes($GLOBALS['__POST']["searchitem"]);
        $subdir = isset($GLOBALS['__POST']["subdir"]) && $GLOBALS['__POST']["subdir"] == "y";
        $list = make_list($dir, $searchitem, $subdir);
    } else {
        $searchitem = NULL;
        $subdir = true;
    }
    $msg = $GLOBALS["messages"]["actsearchresults"];
    if ($searchitem != NULL) {
        $msg .= ": (/" . get_rel_item($dir, $searchitem) . ")";
    }
    show_header($msg);
    // Search Box
    echo "<BR><TABLE><FORM name=\"searchform\" action=\"" . make_link("search", $dir, NULL);
    echo "\" method=\"post\">\n<TR><TD><INPUT name=\"searchitem\" type=\"text\" size=\"25\" value=\"";
    echo $searchitem . "\"><INPUT type=\"submit\" value=\"" . $GLOBALS["messages"]["btnsearch"];
    echo "\">&nbsp;<input type=\"button\" value=\"" . $GLOBALS["messages"]["btnclose"];
    echo "\" onClick=\"javascript:location='" . make_link("list", $dir, NULL);
    echo "';\"></TD></TR><TR><TD><INPUT type=\"checkbox\" name=\"subdir\" value=\"y\"";
    echo ($subdir ? " checked>" : ">") . $GLOBALS["messages"]["miscsubdirs"] . "</TD></TR></FORM></TABLE>\n";
    // Results
    if ($searchitem != NULL) {
        echo "<TABLE width=\"95%\"><TR><TD colspan=\"2\"><HR></TD></TR>\n";
        if (count($list) > 0) {
            // Table Header
            echo "<TR>\n<TD WIDTH=\"42%\" class=\"header\"><B>" . $GLOBALS["messages"]["nameheader"];
            echo "</B></TD>\n<TD WIDTH=\"58%\" class=\"header\"><B>" . $GLOBALS["messages"]["pathheader"];
            echo "</B></TD></TR>\n<TR><TD colspan=\"2\"><HR></TD></TR>\n";
            // make & print table of found items
            print_table($list);
            echo "<TR><TD colspan=\"2\"><HR></TD></TR>\n<TR><TD class=\"header\">" . count($list) . " ";
            echo $GLOBALS["messages"]["miscitems"] . ".</TD><TD class=\"header\"></TD></TR>\n";
        } else {
            echo "<TR><TD>" . $GLOBALS["messages"]["miscnoresult"] . "</TD></TR>";
        }
        echo "<TR><TD colspan=\"2\"><HR></TD></TR></TABLE>\n";
    }
    ?>
<script language="JavaScript1.2" type="text/javascript">
<!--
	if(document.searchform) document.searchform.searchitem.focus();
// -->
</script><?php 
}
Example #19
0
		
		//mode: list, tree, pure
		$table_search->data[3][0] .= print_input_hidden ('mode', $params['mode'], true, false, 'mode');

		//csv querys
		$filter["query"] = $sql_search;
		$filter["query_pag"] = $sql_search_pagination;
		serialize_in_temp($filter, $config["id_user"]);
		
		//tree_search_submit()
		$table_search->data[3][1] = print_button(__('Export to CSV'), '', false, 'tree_search_submit(); window.open(\'' . 'include/export_csv.php?export_csv_inventory=1'.'\');', 'class="sub csv"', true);

		//button
		$table_search->data[3][2] = print_submit_button (__('Search'), 'search', false, 'class="sub search"', true);

		$search_other .= print_table($table_search, true);
		$search_other .= '</div>';
		
		print_container_div("inventory_form",__("Inventory form search"),$search_other, 'open', false, false);
	echo '</form>';
}

$write_permission = enterprise_hook ('inventory_check_acl', array ($config['id_user'], $id, true));	
$page = (int)get_parameter('page', 1);

switch ($mode) {
	case 'tree':
		echo '<div class = "inventory_tree_table" id = "inventory_tree_table">';
			inventories_print_tree($sql_search_pagination, $last_update);
		echo '</div>';
		break;
 /**
  * Return the HTML to edit a specific instructor.
  * This could be extended to allow for application specific editing, for example
  * a Moodle interface to its formslib.
  *
  * @param $formid string A suffix to put on all 'id' and index for all 'name' attributes.
  *                       This should be unique if being used more than once in a form.
  * @param $extraclass string Any extra class information to add to the output.
  *
  * @return string The form HTML, without the form.
  */
 function edit_form_html($classid, $sort = 'name', $dir = 'ASC', $page = 0, $perpage = 0, $namesearch = '', $alpha = '')
 {
     global $CFG;
     $output = '';
     ob_start();
     $table = new stdClass();
     if (empty($this->id)) {
         $columns = array('assign' => 'Assign', 'idnumber' => 'ID Number', 'name' => 'Name', 'assigntime' => 'Assigned Time', 'completetime' => 'Completion Time');
     } else {
         $columns = array('idnumber' => 'ID Number', 'name' => 'Name', 'assigntime' => 'Assigned Time', 'completetime' => 'Completion Time');
     }
     foreach ($columns as $column => $cdesc) {
         if ($sort != $column) {
             $columnicon = "";
             $columndir = "ASC";
         } else {
             $columndir = $dir == "ASC" ? "DESC" : "ASC";
             $columnicon = $dir == "ASC" ? "down" : "up";
             $columnicon = " <img src=\"{$CFG->pixpath}/t/{$columnicon}.gif\" alt=\"\" />";
         }
         if ($column == 'name' || $column == 'description') {
             ${$column} = "<a href=\"index.php?s=ins&amp;section=curr&amp;id={$classid}&amp;" . "action=add&amp;sort={$column}&amp;dir={$columndir}&amp;search=" . urlencode(stripslashes($namesearch)) . "&amp;alpha={$alpha}\">" . $cdesc . "</a>{$columnicon}";
         } else {
             ${$column} = $cdesc;
         }
         $table->head[] = ${$column};
         $table->align[] = "left";
         $table->wrap[] = true;
     }
     if (empty($this->id)) {
         $users = $this->get_users_avail($sort, $dir, $page * $perpage, $perpage, $namesearch, $alpha);
         $usercount = $this->count_users_avail($namesearch, $alpha);
         $alphabet = explode(',', get_string('alphabet'));
         $strall = get_string('all');
         /// Bar of first initials
         echo "<p style=\"text-align:center\">";
         echo get_string('tag_name', 'block_curr_admin') . " : ";
         if ($alpha) {
             echo " <a href=\"index.php?s=ins&amp;section=curr&amp;action=add&amp;id={$classid}&amp;" . "sort=name&amp;dir=ASC&amp;perpage={$perpage}\">{$strall}</a> ";
         } else {
             echo " <b>{$strall}</b> ";
         }
         foreach ($alphabet as $letter) {
             if ($letter == $alpha) {
                 echo " <b>{$letter}</b> ";
             } else {
                 echo " <a href=\"index.php?s=ins&amp;section=curr&amp;action=add&amp;id={$classid}&amp;" . "sort=name&amp;dir=ASC&amp;perpage={$perpage}&amp;alpha={$letter}\">{$letter}</a> ";
             }
         }
         echo "</p>";
         print_paging_bar($usercount, $page, $perpage, "index.php?s=ins&amp;section=curr&amp;id={$classid}&amp;action=add&amp;" . "sort={$sort}&amp;dir={$dir}&amp;perpage={$perpage}&amp;alpha={$alpha}&amp;" . "search=" . urlencode(stripslashes($namesearch)) . "&amp;");
         flush();
     } else {
         $user = $this->user;
         $user->name = cm_fullname($this->user);
         $users[] = $user;
         $usercount = 0;
     }
     if (empty($this->id) && !$users) {
         $match = array();
         if ($namesearch !== '') {
             $match[] = s($namesearch);
         }
         if ($alpha) {
             $match[] = 'name' . ": {$alpha}" . "___";
         }
         $matchstring = implode(", ", $match);
         echo get_string('no_users_matching', 'block_curr_admin') . $matchstring;
         $table = NULL;
     } else {
         $insobj = new instructor();
         $table->width = "100%";
         foreach ($users as $user) {
             $newarr = array();
             foreach ($columns as $column => $cdesc) {
                 switch ($column) {
                     case 'assign':
                         $newarr[] = '<input type="checkbox" name="users[' . $user->id . '][assign]" value="1" />' . '<input type="hidden" name="users[' . $user->id . '][idnumber]" ' . 'value="' . $user->idnumber . '" />';
                         break;
                     case 'name':
                     case 'idnumber':
                     case 'description':
                         $newarr[] = $user->{$column};
                         break;
                     case 'assigntime':
                         $newarr[] = cm_print_date_selector('users[' . $user->id . '][startday]', 'users[' . $user->id . '][startmonth]', 'users[' . $user->id . '][startyear]', $this->assigntime, true);
                         break;
                     case 'completetime':
                         $newarr[] = cm_print_date_selector('users[' . $user->id . '][endday]', 'users[' . $user->id . '][endmonth]', 'users[' . $user->id . '][endyear]', $this->completetime, true);
                         break;
                     default:
                         $newarr[] = '';
                         break;
                 }
             }
             $table->data[] = $newarr;
         }
     }
     if (empty($this->id)) {
         echo "<table class=\"searchbox\" style=\"margin-left:auto;margin-right:auto\" cellpadding=\"10\"><tr><td>";
         echo "<form action=\"index.php\" method=\"get\"><fieldset>";
         echo '<input type="hidden" name="s" value="ins" />';
         echo '<input type="hidden" name="section" value="curr" />';
         echo '<input type="hidden" name="action" value="add" />';
         echo '<input type="hidden" name="id" value="' . $classid . '" />';
         echo '<input type="hidden" name="sort" value="' . $sort . '" />';
         echo '<input type="hidden" name="dir" value="' . $dir . '" />';
         echo "<input type=\"text\" name=\"search\" value=\"" . s($namesearch, true) . "\" size=\"20\" />";
         echo "<input type=\"submit\" value=\"" . get_string('search', 'block_curr_admin') . "\" />";
         if ($namesearch) {
             echo "<input type=\"button\" onclick=\"document.location='index.php?s=ins&amp;section=curr&amp;" . "action=add&amp;id={$classid}';\" value=\"" . get_string('show_all_users', 'block_curr_admin') . "\" />";
         }
         echo "</fieldset></form>";
         echo "</td></tr></table>";
         echo '<form method="post" action="index.php?s=ins&amp;section=curr&amp;id=' . $classid . '" >' . "\n";
         echo '<input type="hidden" name="action" value="savenew" />' . "\n";
     } else {
         echo '<form method="post" action="index.php?s=ins&amp;section=curr&amp;id=' . $classid . '" >' . "\n";
         echo '<input type="hidden" name="action" value="update" />' . "\n";
         echo '<input type="hidden" name="association_id" value="' . $this->id . '" />' . "\n";
         echo '<input type="hidden" name="id" value="' . $this->classid . '" />' . "\n";
         echo '<input type="hidden" name="userid" value="' . $this->userid . '" />' . "\n";
     }
     if (!empty($table)) {
         print_table($table);
         print_paging_bar($usercount, $page, $perpage, "index.php?s=ins&amp;section=curr&amp;id={$classid}&amp;action=add&amp;" . "sort={$sort}&amp;dir={$dir}&amp;perpage={$perpage}&amp;alpha={$alpha}&amp;" . "search=" . urlencode(stripslashes($namesearch)) . "&amp;");
     }
     if (empty($this->id)) {
         echo '<br /><input type="submit" value="' . get_string('assign_selected', 'block_curr_admin') . '">' . "\n";
     } else {
         echo '<br /><input type="submit" value="' . get_string('update_assignment', 'block_curr_admin') . '">' . "\n";
     }
     echo '</form>' . "\n";
     $output = ob_get_contents();
     ob_end_clean();
     return $output;
 }
Example #21
0
                }
                //Get html code for RSS link
                $row[] = rss_get_link($course->id, $userid, "forum", $forum->id, $tooltiptext);
            }
            $learningtable->data[] = $row;
        }
    }
}
/// Output the page
$navlinks = array();
$navlinks[] = array('name' => $strforums, 'link' => '', 'type' => 'activity');
print_header("{$course->shortname}: {$strforums}", $course->fullname, build_navigation($navlinks), "", "", true, $searchform, navmenu($course));
if (!isguest()) {
    print_box_start('subscription');
    echo '<span class="helplink">';
    echo '<a href="index.php?id=' . $course->id . '&amp;subscribe=1">' . get_string('allsubscribe', 'forum') . '</a>';
    echo '</span><br /><span class="helplink">';
    echo '<a href="index.php?id=' . $course->id . '&amp;subscribe=0">' . get_string('allunsubscribe', 'forum') . '</a>';
    echo '</span>';
    print_box_end();
    print_box('&nbsp;', 'clearer');
}
if ($generalforums) {
    print_heading(get_string("generalforums", "forum"));
    print_table($generaltable);
}
if ($learningforums) {
    print_heading(get_string("learningforums", "forum"));
    print_table($learningtable);
}
print_footer($course);
Example #22
0
function list_dir($dir)
{
    // list directory contents
    global $dir_up, $mosConfig_live_site, $_VERSION;
    ?>
	<script type="text/javascript" src="<?php 
    echo $mosConfig_live_site;
    ?>
/includes/js/overlib_mini.js"></script>
	<div id="overDiv" style="position:absolute; visibility:hidden; z-index:10000;"></div>
	<?php 
    $allow = ($GLOBALS["permissions"] & 01) == 01;
    $admin = ($GLOBALS["permissions"] & 04) == 04 || ($GLOBALS["permissions"] & 02) == 02;
    $dir_up = dirname($dir);
    if ($dir_up == ".") {
        $dir_up = "";
    }
    if (!get_show_item($dir_up, basename($dir))) {
        show_error($dir . " : " . $GLOBALS["error_msg"]["accessdir"]);
    }
    // make file & dir tables, & get total filesize & number of items
    make_tables($dir, $dir_list, $file_list, $tot_file_size, $num_items);
    $dirs = explode("/", $dir);
    $implode = "";
    $dir_links = "<a href=\"" . make_link("list", "", null) . "\">..</a>/";
    foreach ($dirs as $directory) {
        if ($directory != "") {
            $implode .= $directory . "/";
            $dir_links .= "<a href=\"" . make_link("list", $implode, null) . "\">{$directory}</a>/";
        }
    }
    show_header($GLOBALS["messages"]["actdir"] . ": " . $dir_links);
    // Javascript functions:
    include _QUIXPLORER_PATH . "/include/javascript.php";
    // Sorting of items
    $images = "&nbsp;<img width=\"10\" height=\"10\" border=\"0\" align=\"absmiddle\" src=\"" . _QUIXPLORER_URL . "/images/";
    if ($GLOBALS["srt"] == "yes") {
        $_srt = "no";
        $images .= "_arrowup.gif\" alt=\"^\">";
    } else {
        $_srt = "yes";
        $images .= "_arrowdown.gif\" alt=\"v\">";
    }
    // Toolbar
    echo "<br><table width=\"95%\"><tr><td><table><tr>\n";
    // PARENT DIR
    echo "<td>";
    if ($dir != "") {
        echo "<a href=\"" . make_link("list", $dir_up, NULL) . "\">";
        echo "<img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" src=\"" . _QUIXPLORER_URL . "/images/_up.png\" ";
        echo "alt=\"" . $GLOBALS["messages"]["uplink"] . "\" title=\"" . $GLOBALS["messages"]["uplink"] . "\"></a>";
    }
    echo "</td>\n";
    // HOME DIR
    echo "<td><a href=\"" . make_link("list", NULL, NULL) . "\">";
    echo "<img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" src=\"" . _QUIXPLORER_URL . "/images/_home.gif\" ";
    echo "alt=\"" . $GLOBALS["messages"]["homelink"] . "\" title=\"" . $GLOBALS["messages"]["homelink"] . "\"></a></td>\n";
    // RELOAD
    echo "<td><a href=\"javascript:location.reload();\"><img border=\"0\" width=\"22\" height=\"22\" ";
    echo "align=\"absmiddle\" src=\"" . _QUIXPLORER_URL . "/images/_refresh.gif\" alt=\"" . $GLOBALS["messages"]["reloadlink"];
    echo "\" title=\"" . $GLOBALS["messages"]["reloadlink"] . "\"></A></td>\n";
    // SEARCH
    if (!jx_isFTPMode()) {
        echo "<td><a href=\"" . make_link("search", $dir, NULL) . "\">";
        echo "<img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" src=\"" . _QUIXPLORER_URL . "/images/_search.gif\" ";
        echo "alt=\"" . $GLOBALS["messages"]["searchlink"] . "\" title=\"" . $GLOBALS["messages"]["searchlink"];
        echo "\"></a></td>\n";
    }
    echo "<td><img src=\"images/menu_divider.png\" height=\"22\" width=\"2\" border=\"0\" alt=\"|\" /></td>";
    // Joomla Sysinfo
    echo "<td><a href=\"" . make_link("sysinfo", $dir, NULL) . "\">";
    echo "<img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" src=\"" . _QUIXPLORER_URL . "/images/systeminfo.gif\" ";
    echo "alt=\"" . $GLOBALS['messages']['mossysinfolink'] . "\" title=\"" . $GLOBALS['messages']['mossysinfolink'] . "\"></a></td>\n";
    echo "<td><img src=\"images/menu_divider.png\" height=\"22\" width=\"2\" border=\"0\" alt=\"|\" /></td>";
    if ($allow) {
        // COPY
        echo "<td><a href=\"javascript:Copy();\"><img border=\"0\" width=\"22\" height=\"22\" ";
        echo "align=\"absmiddle\" src=\"" . _QUIXPLORER_URL . "/images/_copy.gif\" alt=\"" . $GLOBALS["messages"]["copylink"];
        echo "\" title=\"" . $GLOBALS["messages"]["copylink"] . "\"></a></td>\n";
        // MOVE
        echo "<td><a href=\"javascript:Move();\"><img border=\"0\" width=\"22\" height=\"22\" ";
        echo "align=\"absmiddle\" src=\"" . _QUIXPLORER_URL . "/images/_move.gif\" alt=\"" . $GLOBALS["messages"]["movelink"];
        echo "\" title=\"" . $GLOBALS["messages"]["movelink"] . "\"></A></td>\n";
        // DELETE
        echo "<td><a href=\"javascript:Delete();\"><img border=\"0\" width=\"22\" height=\"22\" ";
        echo "align=\"absmiddle\" src=\"" . _QUIXPLORER_URL . "/images/_delete.gif\" alt=\"" . $GLOBALS["messages"]["dellink"];
        echo "\" title=\"" . $GLOBALS["messages"]["dellink"] . "\"></A></td>\n";
        // CHMOD
        echo "<td><a href=\"javascript:Chmod();\"><img border=\"0\" width=\"22\" height=\"22\" ";
        echo "align=\"absmiddle\" src=\"" . _QUIXPLORER_URL . "/images/_chmod.gif\" alt=\"chmod\" title=\"" . $GLOBALS['messages']['chmodlink'] . "\"></a></td>\n";
        // UPLOAD
        if (ini_get("file_uploads")) {
            echo "<td><a href=\"" . make_link("upload", $dir, NULL) . "\">";
            echo "<img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" ";
            echo "src=\"" . _QUIXPLORER_URL . "/images/_upload.gif\" alt=\"" . $GLOBALS["messages"]["uploadlink"];
            echo "\" title=\"" . $GLOBALS["messages"]["uploadlink"] . "\"></A></td>\n";
        } else {
            echo "<td><img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" ";
            echo "src=\"" . _QUIXPLORER_URL . "/images/_upload_.gif\" alt=\"" . $GLOBALS["messages"]["uploadlink"];
            echo "\" title=\"" . $GLOBALS["messages"]["uploadlink"] . "\"></td>\n";
        }
        // ARCHIVE
        if (($GLOBALS["zip"] || $GLOBALS["tar"] || $GLOBALS["tgz"]) && !jx_isFTPMode()) {
            echo "<td><a href=\"javascript:Archive();\"><img border=\"0\" width=\"22\" height=\"22\" ";
            echo "align=\"absmiddle\" src=\"" . _QUIXPLORER_URL . "/images/_archive.gif\" alt=\"" . $GLOBALS["messages"]["comprlink"];
            echo "\" title=\"" . $GLOBALS["messages"]["comprlink"] . "\"></a></td>\n";
        }
    } else {
        // COPY
        echo "<td><img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" ";
        echo "src=\"" . _QUIXPLORER_URL . "/images/_copy_.gif\" alt=\"" . $GLOBALS["messages"]["copylink"] . "\" title=\"";
        echo $GLOBALS["messages"]["copylink"] . "\"></td>\n";
        // MOVE
        echo "<td><img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" ";
        echo "src=\"" . _QUIXPLORER_URL . "/images/_move_.gif\" alt=\"" . $GLOBALS["messages"]["movelink"] . "\" title=\"";
        echo $GLOBALS["messages"]["movelink"] . "\"></td>\n";
        // DELETE
        echo "<td><img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" ";
        echo "src=\"" . _QUIXPLORER_URL . "/images/_delete_.gif\" alt=\"" . $GLOBALS["messages"]["dellink"] . "\" title=\"";
        echo $GLOBALS["messages"]["dellink"] . "\"></td>\n";
        // UPLOAD
        echo "<td><img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" ";
        echo "src=\"" . _QUIXPLORER_URL . "/images/_upload_.gif\" alt=\"" . $GLOBALS["messages"]["uplink"];
        echo "\" title=\"" . $GLOBALS["messages"]["uplink"] . "\"></td>\n";
    }
    // ADMIN & LOGOUT
    if ($GLOBALS["require_login"]) {
        echo "<td>::</td>";
        // ADMIN
        if ($admin) {
            echo "<td><a href=\"" . make_link("admin", $dir, NULL) . "\">";
            echo "<img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" ";
            echo "src=\"" . _QUIXPLORER_URL . "/images/_admin.gif\" alt=\"" . $GLOBALS["messages"]["adminlink"] . "\" title=\"";
            echo $GLOBALS["messages"]["adminlink"] . "\"></A></td>\n";
        }
        // LOGOUT
        echo "<td><a href=\"" . make_link("logout", NULL, NULL) . "\">";
        echo "<img border=\"0\" width=\"22\" height=\"22\" align=\"absmiddle\" ";
        echo "src=\"" . _QUIXPLORER_URL . "/images/_logout.gif\" alt=\"" . $GLOBALS["messages"]["logoutlink"] . "\" title=\"";
        echo $GLOBALS["messages"]["logoutlink"] . "\"></a></td>\n";
    }
    // Logo
    echo "<td style=\"padding-left:10px;\">";
    //echo "<div style=\"margin-left:10px;float:right;\" width=\"305\" >";
    echo "<a href=\"" . $GLOBALS['jx_home'] . "\" target=\"_blank\" title=\"joomlaXplorer Project\"><img border=\"0\" align=\"absmiddle\" id=\"jx_logo\" style=\"filter:alpha(opacity=10);-moz-opacity:.10;opacity:.10;\" onmouseover=\"opacity('jx_logo', 60, 99, 500);\" onmouseout=\"opacity('jx_logo', 100, 60, 500);\" ";
    echo "src=\"" . _QUIXPLORER_URL . "/images/logo.gif\" align=\"right\" alt=\"" . $GLOBALS['messages']['logolink'] . "\"></a>";
    //echo "</div>";
    echo "</td>\n";
    echo "</tr></table></td>\n";
    // Create File / Dir
    if ($allow && @$GLOBALS['jx_File']->is_writable(get_abs_dir($dir))) {
        echo "<td align=\"right\">\n\t\t\t\t<form action=\"" . make_link("mkitem", $dir, NULL) . "\" method=\"post\" name=\"mkitemform\">\n\n\t\t\t\t<table><tr><td>\n\t\t\t\t\t<select name=\"mktype\" onchange=\"checkMkitemForm(this.options[this.selectedIndex])\">\n\t\t\t\t\t\t<option value=\"file\">" . $GLOBALS["mimes"]["file"] . "</option>\n\t\t\t\t\t\t<option value=\"dir\">" . $GLOBALS["mimes"]["dir"] . "</option>";
        if (!jx_isFTPMode() && !$GLOBALS['isWindows']) {
            echo "\t\t\t<option value=\"symlink\">" . $GLOBALS["mimes"]["symlink"] . "</option>\n";
        }
        echo "\t\t</select>\n\t\t\t\t\t<input name=\"symlink_target\" type=\"hidden\" size=\"25\" title=\"{$GLOBALS['messages']['symlink_target']}\" value=\"{$GLOBALS['mosConfig_absolute_path']}\" />\n\t\t\t\t\t<input name=\"mkname\" type=\"text\" size=\"15\" title=\"{$GLOBALS['messages']['nameheader']}\" />\n\t\t\t\t\t<input type=\"submit\" value=\"" . $GLOBALS["messages"]["btncreate"] . "\" />\n\t\t\t\t\t</td></tr>\n\t\t\t\t\t<tr><td id=\"quick_jumpto\">" . list_bookmarks($dir) . "</td></tr>\n\t\t\t\t</table>\n\t\t\t\t<script type=\"text/javascript\">function checkMkitemForm( el ) { if( el.value =='symlink' ) document.mkitemform.symlink_target.type='text'; else document.mkitemform.symlink_target.type='hidden';} </script>\n\t\t\t\t</form>\n\t\t\t  </td>\n";
    } else {
        echo "<td align=\"right\">\n\t\t\t\t<table><tr><td id=\"quick_jumpto\">" . list_bookmarks($dir) . "</td></tr></table>\n\t\t\t </td>";
    }
    echo "</tr></table>\n";
    // End Toolbar
    // Begin Table + Form for checkboxes
    echo "<form name=\"selform\" method=\"post\" action=\"" . make_link("post", $dir, null) . "\">\n\t<input type=\"hidden\" name=\"do_action\" /><input type=\"hidden\" name=\"first\" value=\"y\" />\n\t<table class=\"adminlist\" width=\"95%\">\n";
    if (extension_loaded("posix")) {
        $owner_info = '<th width="15%" class="title">' . $GLOBALS['messages']['miscowner'] . '&nbsp;';
        if (jx_isFTPMode()) {
            $my_user_info = posix_getpwnam($_SESSION['ftp_login']);
            $my_group_info = posix_getgrgid($my_user_info['gid']);
        } else {
            $my_user_info = posix_getpwuid(posix_geteuid());
            $my_group_info = posix_getgrgid(posix_getegid());
        }
        $owner_info .= mosTooltip(mysql_escape_string(sprintf($GLOBALS['messages']['miscownerdesc'], $my_user_info['name'], $my_user_info['uid'], $my_group_info['name'], $my_group_info['gid'])));
        // new [mic]
        $owner_info .= "</th>\n";
        $colspan = 8;
    } else {
        $owner_info = "";
        $colspan = 7;
    }
    // Table Header
    echo "<tr>\n\t<th width=\"2%\" class=\"title\">\n\t\t<input type=\"checkbox\" name=\"toggleAllC\" onclick=\"javascript:ToggleAll(this);\" />\n\t</th>\n\t<th width=\"34%\" class=\"title\">\n";
    if ($GLOBALS["order"] == "name") {
        $new_srt = $_srt;
    } else {
        $new_srt = "yes";
    }
    echo "<a href=\"" . make_link("list", $dir, NULL, "name", $new_srt) . "\">" . $GLOBALS["messages"]["nameheader"];
    if ($GLOBALS["order"] == "name") {
        echo $images;
    }
    echo '</a>';
    echo "</th>\n\t<th width=\"10%\" class=\"title\">";
    if ($GLOBALS["order"] == "size") {
        $new_srt = $_srt;
    } else {
        $new_srt = "yes";
    }
    echo "<a href=\"" . make_link("list", $dir, NULL, "size", $new_srt) . "\">" . $GLOBALS["messages"]["sizeheader"];
    if ($GLOBALS["order"] == "size") {
        echo $images;
    }
    echo "</a></th>\n\t<th width=\"14%\" class=\"title\">";
    if ($GLOBALS["order"] == "type") {
        $new_srt = $_srt;
    } else {
        $new_srt = "yes";
    }
    echo "<a href=\"" . make_link("list", $dir, NULL, "type", $new_srt) . "\">" . $GLOBALS["messages"]["typeheader"];
    if ($GLOBALS["order"] == "type") {
        echo $images;
    }
    echo "</a></th>\n\t<th width=\"14%\" class=\"title\">";
    if ($GLOBALS["order"] == "mod") {
        $new_srt = $_srt;
    } else {
        $new_srt = "yes";
    }
    echo "<a href=\"" . make_link("list", $dir, NULL, "mod", $new_srt) . "\">" . $GLOBALS["messages"]["modifheader"];
    if ($GLOBALS["order"] == "mod") {
        echo $images;
    }
    echo "</a></th>\n\t<th width=\"2%\" class=\"title\">" . $GLOBALS["messages"]["permheader"] . "\n";
    echo "</th>";
    echo $owner_info;
    echo "<th width=\"10%\" class=\"title\">" . $GLOBALS["messages"]["actionheader"] . "</th>\n\t\n\t</tr>\n";
    // make & print Table using lists
    print_table($dir, make_list($dir_list, $file_list), $allow);
    // print number of items & total filesize
    echo "<tr><td colspan=\"{$colspan}\"><hr/></td></tr><tr>\n<td class=\"title\"></td>";
    echo "<td class=\"title\">" . $num_items . " " . $GLOBALS["messages"]["miscitems"] . " (";
    if (function_exists("disk_free_space")) {
        $size = disk_free_space($GLOBALS['home_dir'] . $GLOBALS['separator']);
        $free = parse_file_size($size);
    } elseif (function_exists("diskfreespace")) {
        $size = diskfreespace($GLOBALS['home_dir'] . $GLOBALS['separator']);
        $free = parse_file_size($size);
    } else {
        $free = "?";
    }
    echo $GLOBALS["messages"]["miscfree"] . ": " . $free . ")</td>\n";
    echo "<td class=\"title\">" . parse_file_size($tot_file_size) . "</td>\n";
    for ($i = 0; $i < $colspan - 3; ++$i) {
        echo "<td class=\"title\"></td>";
    }
    echo "</tr>\n<tr><td colspan=\"{$colspan}\"><hr/></td></tr></table>\n\t\t</form>";
    ?>
<script type="text/javascript"><!--
	// Uncheck all items (to avoid problems with new items)
	var ml = document.selform;
	var len = ml.elements.length;
	for(var i=0; i<len; ++i) {
		var e = ml.elements[i];
		if(e.name == "selitems[]" && e.checked == true) {
			e.checked=false;
		}
	}
	opacity('jx_logo', 10, 60, 2000);
// --></script>

<?php 
}
 function get_completion_page($crsid)
 {
     global $CFG;
     $output = '';
     $crs = new course($crsid);
     $table = new stdClass();
     $elements = $crs->get_completion_elements();
     if ($elements) {
         $columns = array('idnumber' => get_string('completion_idnumber', 'block_curr_admin'), 'name' => get_string('completion_name', 'block_curr_admin'), 'description' => get_string('completion_description', 'block_curr_admin'), 'completion_grade' => get_string('completion_grade', 'block_curr_admin'), 'required' => get_string('required', 'block_curr_admin'));
         foreach ($columns as $column => $cdesc) {
             $columndir = "ASC";
             $columnicon = $columndir == "ASC" ? "down" : "up";
             $columnicon = " <img src=\"{$CFG->pixpath}/t/{$columnicon}.gif\" alt=\"\" />";
             ${$column} = $cdesc;
             $table->head[] = ${$column};
             $table->align[] = "left";
             $table->wrap[] = false;
         }
         $table->head[] = "";
         $table->align[] = "center";
         $table->wrap[] = true;
         foreach ($elements as $element) {
             $deletebutton = '<a href="index.php?s=crs&amp;section=curr&amp;action=delem&amp;id=' . $crs->id . '&amp;elemid=' . $element->id . '">' . '<img src="pix/delete.gif" alt="Delete" title="Delete" /></a>';
             $editbutton = '<a href="index.php?s=crs&amp;section=curr&amp;action=eelem&amp;id=' . $crs->id . '&amp;elemid=' . $element->id . '">' . '<img src="pix/edit.gif" alt="Edit" title="Edit" /></a>';
             $newarr = array();
             foreach ($columns as $column => $cdesc) {
                 if ($column == 'required') {
                     $newarr[] = empty($element->required) ? get_string('no') : get_string('yes');
                 } else {
                     $newarr[] = $element->{$column};
                 }
             }
             $newarr[] = $editbutton . ' ' . $deletebutton;
             $table->data[] = $newarr;
         }
         $output .= print_table($table, true);
     } else {
         $output .= '<div align="center">' . get_string('no_completion_elements', 'block_curr_admin') . '</div>';
     }
     $output .= '<br clear="all" />' . "\n";
     $output .= '<div align="center">';
     $options = array('s' => 'crs', 'section' => 'curr', 'action' => 'celem', 'id' => $crs->id);
     $output .= print_single_button('index.php', $options, 'Add Element', 'get', '_self', true, 'Add New Element');
     $output .= '</div>';
     return $output;
 }
Example #24
0
        $jsdescription = addslashes_js(trim(format_text($groups[$gpid]->description)));
        if (empty($jsdescription)) {
            $line[] = $name;
        } else {
            $jsstrdescription = addslashes_js($strdescription);
            $overlib = "return overlib('{$jsdescription}', BORDER, 0, FGCLASS, 'description', " . "CAPTIONFONTCLASS, 'caption', CAPTION, '{$jsstrdescription}');";
            $line[] = '<span onmouseover="' . s($overlib) . '" onmouseout="return nd();">' . $name . '</span>';
        }
        $fullnames = array();
        foreach ($users as $user) {
            $fullnames[] = '<a href="' . $CFG->wwwroot . '/user/view.php?id=' . $user->id . '&amp;course=' . $course->id . '">' . fullname($user, true) . '</a>';
        }
        $line[] = implode(', ', $fullnames);
        $line[] = count($users);
        $table->data[] = $line;
    }
    if ($groupid and empty($table->data)) {
        continue;
    }
    if (!empty($CFG->enablegroupings)) {
        if ($gpgid < 0) {
            print_heading($strnotingrouping, '', 3);
        } else {
            print_heading(format_string($groupings[$gpgid]->name), '', 3);
            print_box(format_text($groupings[$gpgid]->description), 'generalbox boxwidthnarrow boxaligncenter');
        }
    }
    print_table($table, false);
    $printed = true;
}
print_footer($course);
Example #25
0
<?php 
include "header.htm";
?>

<?php 
auth_header();
?>

<div class="content">
<h1>
Výpis z databáze
</h1>
<h2>
Diety
</h2>

<?php 
if (auth()) {
    echo "<p>";
    echo "<a href=\"form_diety_edit.php\">přidat nový záznam</a>";
    echo "</p>";
}
?>

<?php 
print_table("diety,employees", "diety.id,date,employees.name,amount", "diety.employee=employees.id", "date desc", "id,datum,zaměstnanec,částka", auth() ? "diety" : "");
?>
</div>

<?php 
include "footer.htm";
             $line[] = '<span class="notifyproblem">' . get_string('groupnameexists', 'group', $group['name']) . '</span>';
             $error = get_string('groupnameexists', 'group', $group['name']);
         } else {
             $line[] = $group['name'];
         }
         if ($data->allocateby != 'no') {
             $unames = array();
             foreach ($group['members'] as $user) {
                 $unames[] = fullname($user, true);
             }
             $line[] = implode(', ', $unames);
             $line[] = count($group['members']);
         }
         $table->data[] = $line;
     }
     $preview .= print_table($table, true);
 } else {
     $grouping = null;
     $createdgrouping = null;
     $createdgroups = array();
     $failed = false;
     // prepare grouping
     if (!empty($data->grouping)) {
         $groupingname = trim($data->groupingname);
         if ($data->grouping < 0) {
             $grouping = new object();
             $grouping->courseid = $COURSE->id;
             $grouping->name = $groupingname;
             if (!($grouping->id = groups_create_grouping(addslashes_recursive($grouping)))) {
                 $error = 'Can not create grouping';
                 //should not happen
 /**
  * Render the tab for importing slides from some source.
  * If necessary, this will first display a form letting the user select which importer to use.
  * It will then rely on the plugin to sort out everything else.
  */
 function render_import_slides()
 {
     global $CFG;
     // Construct an array of available importers, associating the identifier to the human-readable name.
     $availableimporters = array();
     $pluginids = $this->_session->plugins->get_plugin_ids('presenter-importer');
     if (!$pluginids) {
         error('Failed to load any SLOODLE Presenter importer plugins. Please check your plugins folder.');
     }
     foreach ($pluginids as $pluginid) {
         // Fetch the plugin and store its human-readable name
         $plugin = $this->_session->plugins->get_plugin('presenter-importer', $pluginid);
         $availableimporters[$pluginid] = $plugin->get_plugin_name();
     }
     // We are expecting a few parameters
     $position = (int) optional_param('sloodleentryposition', '-1', PARAM_INT);
     $plugintype = strtolower(optional_param('sloodleplugintype', '', PARAM_CLEAN));
     // Fetch translation strings
     $strselectimporter = get_string('presenter:selectimporter', 'sloodle');
     $strsubmit = get_string('submit');
     $strincompatible = get_string('incompatible', 'sloodle');
     $strcompatible = get_string('compatible', 'sloodle');
     $strincompatibleplugin = get_string('incompatibleplugin', 'sloodle');
     $strcheck = get_string('check', 'sloodle');
     $strclicktocheck = get_string('clicktocheckcompatibility', 'sloodle');
     $strclicktochecknoperm = get_string('clicktocheckcompatibility:nopermission', 'sloodle');
     // Do we have a valid plugin type already specified?
     if (empty($plugintype) || !array_key_exists($plugintype, $availableimporters)) {
         // No - display a menu to select the desired importer
         // Sort the list of importers by name
         natcasesort($availableimporters);
         // Setup a base link for all importer types
         $baselink = "{$CFG->wwwroot}/mod/sloodle/view.php?id={$this->cm->id}&amp;mode=importslides";
         // Setup a base link for checking compatibility
         $checklink = "{$CFG->wwwroot}/mod/sloodle/view.php?id={$this->cm->id}&amp;mode=compatibility";
         // Make sure this user has site configuration permission, as running this test may reveal sensitive information about server architecture
         $module_context = get_context_instance(CONTEXT_MODULE, $this->cm->id);
         $cancheckcompatibility = (bool) has_capability('moodle/site:config', $module_context);
         // Go through each one and display it in a menu
         $table = new stdClass();
         $table->head = array(get_string('name', 'sloodle'), get_string('description'), get_string('compatibility', 'sloodle'));
         $table->size = array('20%', '70%', '10%');
         $table->align = array('center', 'left', 'center');
         $table->data = array();
         foreach ($availableimporters as $importerident => $importername) {
             // Get the description of the plugin
             $plugin = $this->_session->plugins->get_plugin('presenter-importer', $importerident);
             $desc = $plugin->get_plugin_description();
             // Check the compatibility of the plugin
             $linkclass = '';
             $compatibility = '';
             if (!$plugin->check_compatibility()) {
                 $linkclass = ' class="dimmed"';
                 $compatibility = '<abbr title="' . $plugin->get_compatibility_summary() . '"><span class="highlight2" style="font-weight:bold;">[ ' . $strincompatible . ' ]</span></abbr>';
             }
             // Construct this line of the table
             $line = array();
             // Add the name of the importer to the table as a link
             $link = "{$baselink}&amp;sloodleplugintype={$importerident}";
             $line[] = "<span style=\"font-size:120%; font-weight:bold;\"><a href=\"{$link}\" title=\"{$desc}\" {$linkclass}>{$importername}</a></span><br/>{$compatibility}";
             // Add the description
             $line[] = $desc;
             // Add a link to a compatibility check if the user has permission.
             if ($cancheckcompatibility) {
                 $link = "{$checklink}&amp;sloodleplugintype={$importerident}";
                 $line[] = "<a href=\"{$link}\" title=\"{$strclicktocheck}\">{$strcheck}</a>";
             } else {
                 $line[] = "<span title=\"{$strclicktochecknoperm}\">-</span>";
             }
             $table->data[] = $line;
         }
         echo "<h4>{$strselectimporter}: </h4>\n";
         print_table($table);
         return;
     }
     // Grab the importer plugin object
     $importer = $this->_session->plugins->get_plugin('presenter-importer', $plugintype);
     // Display a heading for this importer
     echo '<h2 style="margin-bottom:0px; padding-bottom:0px;">' . $importer->get_plugin_name() . "</h2>\n";
     // Render the plugin display
     $importer->render("{$CFG->wwwroot}/mod/sloodle/view.php?id={$this->cm->id}", $this->presenter);
 }
Example #28
0
/**
 * All question categories and their questions are deleted for this activity.
 *
 * @param object $cm the course module object representing the activity
 * @param boolean $feedback to specify if the process must output a summary of its work
 * @return boolean
 */
function question_delete_activity($cm, $feedback = true)
{
    //To store feedback to be showed at the end of the process
    $feedbackdata = array();
    //Cache some strings
    $strcatdeleted = get_string('unusedcategorydeleted', 'quiz');
    $modcontext = get_context_instance(CONTEXT_MODULE, $cm->id);
    if ($categoriesmods = get_records('question_categories', 'contextid', $modcontext->id, 'parent', 'id, parent, name')) {
        //Sort categories following their tree (parent-child) relationships
        //this will make the feedback more readable
        $categoriesmods = sort_categories_by_tree($categoriesmods);
        foreach ($categoriesmods as $category) {
            //Delete it completely (questions and category itself)
            //deleting questions
            if ($questions = get_records("question", "category", $category->id)) {
                foreach ($questions as $question) {
                    delete_question($question->id);
                }
                delete_records("question", "category", $category->id);
            }
            //delete the category
            delete_records('question_categories', 'id', $category->id);
            //Fill feedback
            $feedbackdata[] = array($category->name, $strcatdeleted);
        }
        //Inform about changes performed if feedback is enabled
        if ($feedback) {
            $table = new stdClass();
            $table->head = array(get_string('category', 'quiz'), get_string('action'));
            $table->data = $feedbackdata;
            print_table($table);
        }
    }
    return true;
}
Example #29
0
$table->size = array();
$table->style = array();
$table->style[0] = 'font-weight: bold';
$table->colspan[1][0] = 3;
$table->colspan[2][0] = 3;
$table->colspan[3][0] = 3;
$table->data[0][0] = print_input_text("from", $from, "", 30, 100, true, __('From'));
$table->data[0][1] = print_input_text("to", $to, "", 30, 100, true, __('To'));
$table->data[0][2] = print_input_text("cco", $cco, "", 30, 100, true, __('Send a copy to'));
$table->data[1][0] = print_input_text("subject", $subject, "", 130, 100, true, __('Subject'));
$table->data[2][0] = print_textarea("mail", 10, 1, $mail, 'style="height:350px;"', true, __('E-mail'));
$table->data[3][0] = print_submit_button(__('Send email'), 'apply_btn', false, 'class="sub upd"', true);
$table->data[3][0] .= print_input_hidden('id', $id, true);
$table->data[3][0] .= print_input_hidden('send', 1, true);
echo '<form method="post" id="lead_mail_go">';
print_table($table);
echo "</form>";
?>

<script type="text/javascript" src="include/js/jquery.validate.js"></script>
<script type="text/javascript" src="include/js/jquery.validation.functions.js"></script>

<script type="text/javascript" >

validate_form("#lead_mail_go");
// Rules: #text-from
rules = {
	required: true,
	email: true
};
messages = {
Example #30
0
function lesson_user_complete($course, $user, $mod, $lesson)
{
    /// Print a detailed representation of what a  user has done with
    /// a given particular instance of this module, for user activity reports.
    if ($attempts = get_records_select("lesson_attempts", "lessonid = {$lesson->id} AND userid = {$user->id}", "retry, timeseen")) {
        print_simple_box_start();
        $table->head = array(get_string("attempt", "lesson"), get_string("numberofpagesviewed", "lesson"), get_string("numberofcorrectanswers", "lesson"), get_string("time"));
        $table->width = "100%";
        $table->align = array("center", "center", "center", "center");
        $table->size = array("*", "*", "*", "*");
        $table->cellpadding = 2;
        $table->cellspacing = 0;
        $retry = 0;
        $npages = 0;
        $ncorrect = 0;
        foreach ($attempts as $attempt) {
            if ($attempt->retry == $retry) {
                $npages++;
                if ($attempt->correct) {
                    $ncorrect++;
                }
                $timeseen = $attempt->timeseen;
            } else {
                $table->data[] = array($retry + 1, $npages, $ncorrect, userdate($timeseen));
                $retry++;
                $npages = 1;
                if ($attempt->correct) {
                    $ncorrect = 1;
                } else {
                    $ncorrect = 0;
                }
            }
        }
        if ($npages) {
            $table->data[] = array($retry + 1, $npages, $ncorrect, userdate($timeseen));
        }
        print_table($table);
        print_simple_box_end();
        // also print grade summary
        if ($grades = get_records_select("lesson_grades", "lessonid = {$lesson->id} AND userid = {$user->id}", "grade DESC")) {
            foreach ($grades as $grade) {
                $max_grade = number_format($grade->grade * $lesson->grade / 100.0, 1);
                break;
            }
            if ($lesson->retake) {
                echo "<p>" . get_string("gradeis", "lesson", $max_grade) . " (" . get_string("attempts", "lesson") . ": " . count($grades) . ")</p>";
            } else {
                echo "<p>" . get_string("gradeis", "lesson", $max_grade) . "</p>";
            }
        }
    } else {
        echo get_string("no") . " " . get_string("attempts", "lesson");
    }
    return true;
}