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


PHP print_heading_block函数代码示例

本文整理汇总了PHP中print_heading_block函数的典型用法代码示例。如果您正苦于以下问题:PHP print_heading_block函数的具体用法?PHP print_heading_block怎么用?PHP print_heading_block使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: get_dashboard


//.........这里部分代码省略.........
             } else {
                 // Keep note of the classid's regardless if set archived or not for later use in determining non-curricula courses
                 if ($courses = curriculumcourse_get_listing($usercur->curid, 'curcrs.position, crs.name', 'ASC')) {
                     foreach ($courses as $course) {
                         if ($cdata = student_get_class_from_course($course->courseid, $this->id)) {
                             foreach ($cdata as $classdata) {
                                 if (!in_array($classdata->id, $classids)) {
                                     $classids[] = $classdata->id;
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
     // Show different css for IE below version 8
     if (check_browser_version('MSIE', 7.0) && !check_browser_version('MSIE', 8.0)) {
         // IEs that are lower than version 8 do not get the float because it messes up the tabs at the top of the page for some reason
         $float_style = 'text-align:right;';
     } else {
         // Sane browsers get the float tag
         $float_style = 'text-align:right; float:right;';
     }
     // Tab header
     $field_exists = field::get_for_context_level_with_name('curriculum', $archive_var);
     if (!empty($field_exists)) {
         $tabrow = array();
         $tabrow[] = new tabobject('currentlp', $CFG->wwwroot . '/curriculum/index.php?tab=currentlp', get_string('tab_current_learning_plans', 'block_curr_admin'));
         $tabrow[] = new tabobject('archivedlp', $CFG->wwwroot . '/curriculum/index.php?tab=archivedlp', get_string('tab_archived_learning_plans', 'block_curr_admin'));
         $tabrows = array($tabrow);
         print_tabs($tabrows, $tab);
     }
     $content .= print_heading_block(get_string('learningplanwelcome', 'block_curr_admin', fullname($this)), '', true);
     if ($totalcurricula === 0) {
         $blank_lang = $tab == 'archivedlp' ? 'noarchivedplan' : 'nolearningplan';
         $content .= '<br /><center>' . get_string($blank_lang, 'block_curr_admin') . '</center>';
     }
     // Load the user preferences for hide/show button states
     if ($collapsed = get_user_preferences('crlm_learningplan_collapsed_curricula')) {
         $collapsed_array = explode(',', $collapsed);
     } else {
         $collapsed = '';
         $collapsed_array = array();
     }
     $content .= '<input type="hidden" name="collapsed" id="collapsed" value="' . $collapsed . '">';
     if (!empty($usercurs)) {
         foreach ($usercurs as $usercur) {
             if (!isset($curriculas[$usercur->curid])) {
                 continue;
             }
             $curricula = $curriculas[$usercur->curid];
             $table = new stdClass();
             $table->head = array(get_string('class', 'block_curr_admin'), get_string('description', 'block_curr_admin'), get_string('score', 'block_curr_admin'), get_string('completed_label', 'block_curr_admin'), get_string('date', 'block_curr_admin'));
             $table->data = $curricula['data'];
             $curricula_name = empty($CURMAN->config->disablecoursecatalog) ? '<a href="index.php?s=crscat&section=curr&showcurid=' . $curricula['id'] . '">' . $curricula['name'] . '</a>' : $curricula['name'];
             $header_curr_name = get_string('learningplanname', 'block_curr_admin', $curricula_name);
             if (in_array($curricula['id'], $collapsed_array)) {
                 $button_label = get_string('showcourses', 'block_curr_admin');
                 $extra_class = ' hide';
             } else {
                 $button_label = get_string('hidecourses', 'block_curr_admin');
                 $extra_class = '';
             }
             $heading = '<div class="clearfix"></div>' . '<div style="' . $float_style . '">' . '<script id="curriculum' . $curricula['id'] . 'script" type="text/javascript">toggleVisibleInitWithState("curriculum' . $curricula['id'] . 'script", "curriculum' . $curricula['id'] . 'button", "' . $button_label . '", "' . get_string('hidecourses', 'block_curr_admin') . '", "' . get_string('showcourses', 'block_curr_admin') . '", "curriculum-' . $curricula['id'] . '");</script></div>' . $header_curr_name;
             $content .= '<div class="dashboard_curricula_block">';
开发者ID:remotelearner,项目名称:elis.cm,代码行数:67,代码来源:user.class.php

示例2: email_printblocks

$options->id = $courseid;
$options->folderid = $folderid;
$options->filterid = $filterid;
/// Print the main part of the page
// Print principal table. This have 2 columns . . .  and possibility to add right column.
echo '<table id="layout-table">
  			<tr>';
// Print "blocks" of this account
echo '<td style="width: 180px;" id="left-column">';
email_printblocks($USER->id, $courseid, ($search == get_string('searchtext', 'block_email_list') or $search == '') ? true : false);
// Close left column
echo '</td>';
// Print principal column
echo '<td id="middle-column">';
// Print middle table
print_heading_block($strsearch);
echo '<div>&#160;</div>';
// Create advanced search form
$advancedsearch = new advanced_search_form();
if (($search == get_string('searchtext', 'block_email_list') or $search == '') and !$advancedsearch->is_submitted()) {
    if (!$action) {
        echo $OUTPUT->notification(get_string('emptysearch', 'block_email_list'), '');
        echo $OUTPUT->notification(get_string('wantadvancedsearch', 'block_email_list'), 'notifysuccess');
    }
    // Print advanced search form
    $advancedsearch->display();
} else {
    if ($advancedsearch->is_cancelled()) {
        // Cancelled form
        redirect($CFG->wwwroot . '/blocks/email_list/email/index.php?id=' . $courseid, '', 1);
    } else {
开发者ID:saurabh947,项目名称:MoodleLearning,代码行数:31,代码来源:search.php

示例3: print_heading_block

                     if (!empty($clear) && $clear == 1) {
                         echo "DELETED";
                         //clearExamTables($cid);
                         //redirect("$CFG->wwwroot/schedule.php");
                     }
                 } else {
                     print_heading_block("Clear Exam Records");
                     print_simple_box_start('center', '60%', '#FFFFFF', 20, 'noticebox');
                     echo "There are no record(s) to be deleted.<br/><br/>";
                     print_single_button($mainurl, null);
                     print_simple_box_end();
                 }
             }
         } else {
             // Course Creator/Teacher Role
             print_heading_block("Clear Exam Records");
             print_simple_box_start('center', '60%', '#FFFFFF', 20, 'noticebox');
             if ($userRole->roleid == 2 || $userRole->roleid == 3) {
                 echo "Only an Administrator can delete records.<br/><br/>";
             } else {
                 redirect($mainurl);
             }
             print_single_button($mainurl, null);
             print_simple_box_end();
         }
     }
     print_container_end();
     // End - Middle Container Content
     echo '</td>';
     break;
 case 'right':
开发者ID:arshanam,项目名称:Moodle-ITScholars-LMS,代码行数:31,代码来源:clearexm.php

示例4: foreach

            }
            $preview .= "</ul>\n</li>\n";
        }
        $preview .= '</ul>';
    } else {
        /// Save the groups data
        foreach ($groups as $group) {
            $newgroup->timecreated = time();
            $newgroup->timemodified = $newgroup->timecreated;
            $newgroup->courseid = $data->courseid;
            $newgroup->name = $group['name'];
            $groupid = insert_record('groups', $newgroup);
            foreach ($group['members'] as $user) {
                $member->groupid = $groupid;
                $member->userid = $user->id;
                $member->timeadded = time();
                insert_record('groups_members', $member);
            }
        }
        redirect($returnurl);
    }
}
/// Print header
print_header_simple($strgroups, ': ' . $strgroups, $navigation, '', '', true, '', navmenu($course));
/// Display the form
$editform->display();
if (isset($preview)) {
    print_heading_block(get_string('groupspreview', 'group'));
    print_box($preview);
}
print_footer($course);
开发者ID:BackupTheBerlios,项目名称:samouk-svn,代码行数:31,代码来源:autogroup.php

示例5: get_string

$strgroupmy = get_string('groupmy');
$editing = $PAGE->user_is_editing();
echo '<table id="layout-table" cellspacing="0" summary="' . get_string('layouttable') . '">';
echo '<tr>';
if (blocks_have_content($pageblocks, BLOCK_POS_LEFT) || $editing) {
    echo '<td style="width:' . $preferred_width_left . 'px" id="left-column">';
    print_container_start();
    blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT);
    print_container_end();
    echo '</td>';
}
echo '<td id="middle-column">';
print_container_start();
echo skip_main_destination();
if ($forum = forum_get_course_forum($course->id, 'social')) {
    print_heading_block(get_string('socialheadline'));
    $cm = get_coursemodule_from_instance('forum', $forum->id);
    $context = get_context_instance(CONTEXT_MODULE, $cm->id);
    echo '<div class="subscribelink">', forum_get_subscribe_link($forum, $context), '</div>';
    forum_print_latest_discussions($course, $forum, 10, 'plain', '', false);
} else {
    notify('Could not find or create a social forum here');
}
print_container_end();
echo '</td>';
// The right column
if (blocks_have_content($pageblocks, BLOCK_POS_RIGHT) || $editing) {
    echo '<td style="width:' . $preferred_width_right . 'px" id="right-column">';
    print_container_start();
    blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT);
    print_container_end();
开发者ID:r007,项目名称:PMoodle,代码行数:31,代码来源:format.php

示例6: email_printblocks

// Print "blocks" of this account
echo '<td style="width: 180px;" id="left-column">';
email_printblocks($USER->id, $courseid);
// Close left column
echo '</td>';
// Print principal column
echo '<td id="middle-column">';
// Get actual folder, for show
if (!($folder = email_get_folder($folderoldid))) {
    if (!($folder = email_get_folder($folderid))) {
        // Default, is inbox
        $folder = email_get_root_folder($USER->id, EMAIL_INBOX);
    }
}
// Print middle table
print_heading_block(get_string('mailbox', 'block_email_list') . ': ' . $folder->name);
echo '<div>&#160;</div>';
// Print tabs options
email_print_tabs_options($courseid, $folderid);
/// Prepare action
if (!empty($action) and $mailid > 0) {
    // When remove an mail, this functions only accept array in param, overthere converting this param ...
    if (!is_array($mailid)) {
        $mailids = array($mailid);
    } else {
        $mailids = $mailid;
    }
    // Print action in case . . .
    switch ($action) {
        case 'removemail':
            // Fix bug
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:31,代码来源:index.php

示例7: action_default

 function action_default()
 {
     global $CFG, $CURMAN, $USER;
     $context = get_context_instance(CONTEXT_SYSTEM);
     if (has_capability('block/curr_admin:managecurricula', $context)) {
         echo print_heading_block('Administrator Dashboard', '', true);
         echo '<p>';
         echo get_string('elis_doc_class_link', 'block_curr_admin');
         echo '</p><p>';
         echo $this->last_cron_runtimes();
         echo '</p>';
         $healthpg = new healthpage();
         if ($healthpg->can_do_default()) {
             echo '<p>', get_string('health_check_link', 'block_curr_admin', $CFG->wwwroot), '</p>';
         }
         echo print_heading(get_string('elisversion', 'block_curr_admin') . ': ' . $CURMAN->release, 'right', '4', 'main', true);
     }
     if ($cmuid = cm_get_crlmuserid($USER->id)) {
         $user = new user($cmuid);
         echo $user->get_dashboard();
     }
 }
开发者ID:remotelearner,项目名称:elis.cm,代码行数:22,代码来源:dashboardpage.class.php

示例8: popup_form

                echo '</td></tr>';
                echo '<tr class="section separator"><td colspan="3" class="spacer"></td></tr>';
            }
            //                     $section++;
            //                 }
            echo '</table>';
            if (!empty($sectionmenu)) {
                echo '<div align="center" class="jumpmenu">';
                echo popup_form($CFG->wwwroot . '/course/view.php?id=' . $course->id . '&amp;', $sectionmenu, 'sectionmenu', '', get_string('jumpto'), '', '', true);
                echo '</div>';
            }
            print_container_end();
            if (right_to_left()) {
                print_heading_block($imgright . ' (Previous page) ' . get_string('chapter', 'format_ebook') . " {$ebook->chapter} " . get_string('page', 'format_ebook') . " {$ebook->page} (Next page) {$imgleft}", 'outline');
            } else {
                print_heading_block("{$imgleft}   " . get_string('page', 'format_ebook') . " {$ebook->page}    {$imgright}", 'outline');
            }
            echo '</td>';
            break;
        case 'right':
            // The right column
            if (blocks_have_content($pageblocks, BLOCK_POS_RIGHT) || $editing) {
                echo '<td style="width:' . $preferred_width_right . 'px" id="right-column">';
                print_container_start();
                blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT);
                print_container_end();
                echo '</td>';
            }
            break;
    }
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:31,代码来源:format.php

示例9: notice

    notice(get_string("activityiscurrentlyhidden"));
}
add_to_log($course->id, "mail", "view", "view.php?id={$cm->id}", $mail->id, $cm->id);
/// Printing the heading
$strmails = get_string("modulenameplural", "mail");
$strmail = get_string("modulename", "mail");
$navigation = "<a href=\"index.php?id={$course->id}\">{$strmails}</a> ->";
print_header_simple(format_string($mail->name), "", "{$navigation} " . format_string($mail->name), "", "", true, update_module_button($cm->id, $course->id, $strmail), navmenu($course, $cm));
/// If no search results then get potential students for this course excluding users already in course
if (count($SESSION->selectedto) > 0) {
    $existinguserlist = implode(',', $SESSION->selectedto);
} else {
    $existinguserlist = "";
}
if (!($students = get_course_students($course->id, "u.firstname ASC, u.lastname ASC, u.username ASC", "", 0, 99999, '', '', NULL, '', 'u.id,u.username,u.firstname,u.lastname', $existinguserlist))) {
    $students = array();
}
if (!($teachers = get_course_teachers($course->id, '', $existinguserlist))) {
    $teachers = array();
}
$numusers = count($students) + count($teachers);
mail_start_print_table_main($mail, $cm, $course);
print_heading_block("<center>" . get_string("groups", "mail") . "</center>");
echo "<br>";
include 'groups.html';
mail_end_print_table_main($mail);
/// Finish the page
print_footer($course);
?>

开发者ID:henriquecrang,项目名称:e-UNI,代码行数:29,代码来源:groups.php

示例10: page_frontpage_settings

/**
 * Called from {@link page_print_position()} and it is
 * supposed to print the front page settings in the
 * center column for the site course and only for
 * the default page (EG: the landing page).
 *
 * @return boolean
 **/
function page_frontpage_settings()
{
    global $CFG, $SESSION, $SITE, $PAGE, $COURSE;
    // Cheap check first - course ID
    if ($COURSE->id != SITEID) {
        return false;
    }
    // More expensive check - make sure we are viewing default page
    $default = page_get_default_page();
    $current = $PAGE->get_formatpage();
    if (empty($default->id) or empty($current->id) or $default->id != $current->id) {
        return false;
    }
    $editing = $PAGE->user_is_editing();
    /// START COPY/PASTE FROM INDEX.PHP
    print_container_start();
    /// Print Section
    if ($SITE->numsections > 0) {
        if (!($section = get_record('course_sections', 'course', $SITE->id, 'section', 1))) {
            delete_records('course_sections', 'course', $SITE->id, 'section', 1);
            // Just in case
            $section->course = $SITE->id;
            $section->section = 1;
            $section->summary = '';
            $section->sequence = '';
            $section->visible = 1;
            $section->id = insert_record('course_sections', $section);
        }
        if (!empty($section->sequence) or !empty($section->summary) or $editing) {
            print_box_start('generalbox sitetopic');
            /// If currently moving a file then show the current clipboard
            if (ismoving($SITE->id)) {
                $stractivityclipboard = strip_tags(get_string('activityclipboard', '', addslashes($USER->activitycopyname)));
                echo '<p><font size="2">';
                echo "{$stractivityclipboard}&nbsp;&nbsp;(<a href=\"course/mod.php?cancelcopy=true&amp;sesskey={$USER->sesskey}\">" . get_string('cancel') . '</a>)';
                echo '</font></p>';
            }
            $options = NULL;
            $options->noclean = true;
            echo format_text($section->summary, FORMAT_HTML, $options);
            if ($editing) {
                $streditsummary = get_string('editsummary');
                echo "<a title=\"{$streditsummary}\" " . " href=\"course/editsection.php?id={$section->id}\"><img src=\"{$CFG->pixpath}/t/edit.gif\" " . " class=\"iconsmall\" alt=\"{$streditsummary}\" /></a><br /><br />";
            }
            get_all_mods($SITE->id, $mods, $modnames, $modnamesplural, $modnamesused);
            print_section($SITE, $section, $mods, $modnamesused, true);
            if ($editing) {
                print_section_add_menus($SITE, $section->section, $modnames);
            }
            print_box_end();
        }
    }
    if (isloggedin() and !isguest() and isset($CFG->frontpageloggedin)) {
        $frontpagelayout = $CFG->frontpageloggedin;
    } else {
        $frontpagelayout = $CFG->frontpage;
    }
    foreach (explode(',', $frontpagelayout) as $v) {
        switch ($v) {
            /// Display the main part of the front page.
            case FRONTPAGENEWS:
                if ($SITE->newsitems) {
                    // Print forums only when needed
                    require_once $CFG->dirroot . '/mod/forum/lib.php';
                    if (!($newsforum = forum_get_course_forum($SITE->id, 'news'))) {
                        error('Could not find or create a main news forum for the site');
                    }
                    if (!empty($USER->id)) {
                        $SESSION->fromdiscussion = $CFG->wwwroot;
                        if (forum_is_subscribed($USER->id, $newsforum)) {
                            $subtext = get_string('unsubscribe', 'forum');
                        } else {
                            $subtext = get_string('subscribe', 'forum');
                        }
                        print_heading_block($newsforum->name);
                        echo '<div class="subscribelink"><a href="mod/forum/subscribe.php?id=' . $newsforum->id . '">' . $subtext . '</a></div>';
                    } else {
                        print_heading_block($newsforum->name);
                    }
                    forum_print_latest_discussions($SITE, $newsforum, $SITE->newsitems, 'plain', 'p.modified DESC');
                }
                break;
            case FRONTPAGECOURSELIST:
                if (isloggedin() and !has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM)) and !isguest() and empty($CFG->disablemycourses)) {
                    print_heading_block(get_string('mycourses'));
                    print_my_moodle();
                } else {
                    if (!has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM)) and !isguest() or count_records('course') <= FRONTPAGECOURSELIMIT) {
                        // admin should not see list of courses when there are too many of them
                        print_heading_block(get_string('availablecourses'));
                        print_courses(0);
                    }
//.........这里部分代码省略.........
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:101,代码来源:lib.php

示例11: print_heading_block

         if (!empty($THEME->roundcorners)) {
             echo '</div></div></div>';
             echo '<div class="bb"><div></div></div>';
         }
         echo '</td>';
     }
     break;
 case 'middle':
     /// Start main column
     echo '<td id="middle-column">';
     if (!empty($THEME->roundcorners)) {
         echo '<div class="bt"><div></div></div>';
         echo '<div class="i1"><div class="i2"><div class="i3">';
     }
     echo '<a name="startofcontent"></a>';
     print_heading_block(get_string('projectoutline', 'format_project'), 'outline');
     echo '<table class="topics" width="100%" summary="' . get_string('layouttable') . '">';
     /// If currently moving a file then show the current clipboard
     if (ismoving($course->id)) {
         $stractivityclipboard = strip_tags(get_string('activityclipboard', '', addslashes($USER->activitycopyname)));
         $strcancel = get_string('cancel');
         echo '<tr class="clipboard">';
         echo '<td colspan="3">';
         echo $stractivityclipboard . '&nbsp;&nbsp;(<a href="mod.php?cancelcopy=true&amp;sesskey=' . $USER->sesskey . '">' . $strcancel . '</a>)';
         echo '</td>';
         echo '</tr>';
     }
     /// Print Section 0
     $section = 0;
     $thissection = $sections[$section];
     if ($thissection->summary or $thissection->sequence or isediting($course->id)) {
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:31,代码来源:format.php

示例12: email_printblocks

    // Required
    $PAGE->set_title("{$course->shortname}: {$stremail}");
    echo $OUTPUT->header("{$navigation} <a href=index.php?id={$course->id}>{$stremails}</a> -> {$strsearch}");
}
// Print principal table. This have 2 columns . . .  and possibility to add right column.
echo '<table id="layout-table">
  			<tr>';
// Print "blocks" of this account
echo '<td style="width: 180px;" id="left-column">';
email_printblocks($USER->id, $courseid);
// Close left column
echo '</td>';
// Print principal column
echo '<td id="middle-column">';
// Print block
print_heading_block('');
echo '<div>&#160;</div>';
if (isset($folderid)) {
    $folder = $DB->get_record('block_email_list_folder', array('id' => $folderid));
}
require_login($course->id, false);
if ($course->id == SITEID) {
    $context = get_context_instance(CONTEXT_SYSTEM, SITEID);
    // SYSTEM context
} else {
    $context = get_context_instance(CONTEXT_COURSE, $course->id);
    // Course context
}
switch ($action) {
    case md5('admin'):
        $hassubfolders = email_print_administration_folders($options);
开发者ID:saurabh947,项目名称:MoodleLearning,代码行数:31,代码来源:folder.php

示例13: print_header

    print_header();
    notice(get_string("activityiscurrentlyhidden"));
}
add_to_log($course->id, "portafolio", "view", "view.php?id={$cm->id}", $portafolio->id, $cm->id);
/// Processing standard security processes
$navigation = "";
if ($course->category) {
    $navigation = "<a href=\"../../course/view.php?id={$course->id}\">{$course->shortname}</a> ->";
    require_login($course->id);
}
if (!$cm->visible and !isteacher($course->id)) {
    print_header();
    notice(get_string("activityiscurrentlyhidden"));
}
add_to_log($course->id, "mail", "view", "view.php?id={$cm->id}", $mail->id, $cm->id);
/// Printing the heading
$strmails = get_string("modulenameplural", "mail");
$strmail = get_string("modulename", "mail");
$navigation = "<a href=\"index.php?id={$course->id}\">{$strmails}</a> ->";
print_header_simple(format_string($mail->name), "", "{$navigation} " . format_string($mail->name), "", "", true, update_module_button($cm->id, $course->id, $strmail), navmenu($course, $cm));
/// If no search results then get potential students for this course excluding users already in course
mail_start_print_table_main($mail, $cm, $course);
print_heading_block("<center>" . get_string("folders", "mail") . "</center>");
echo "<br>";
include 'folders.html';
mail_end_print_table_main($mail);
/// Finish the page
print_footer($course);
?>

开发者ID:henriquecrang,项目名称:e-UNI,代码行数:29,代码来源:folders.php

示例14: switch

 switch ($column) {
     case 'left':
         if (blocks_have_content($pageblocks, BLOCK_POS_LEFT) || $editing) {
             echo '<td style="width:' . $preferred_width_left . 'px" id="left-column">';
             print_container_start();
             blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT);
             print_container_end();
             echo '</td>';
         }
         break;
     case 'middle':
         /// Start main column
         echo '<td id="middle-column">';
         print_container_start();
         echo skip_main_destination();
         print_heading_block(get_string('topicoutline'), 'outline');
         echo '<table class="topics" width="100%" summary="' . get_string('layouttable') . '">';
         /// If currently moving a file then show the current clipboard
         if (ismoving($course->id)) {
             $stractivityclipboard = strip_tags(get_string('activityclipboard', '', addslashes($USER->activitycopyname)));
             $strcancel = get_string('cancel');
             echo '<tr class="clipboard">';
             echo '<td colspan="3">';
             echo $stractivityclipboard . '&nbsp;&nbsp;(<a href="mod.php?cancelcopy=true&amp;sesskey=' . $USER->sesskey . '">' . $strcancel . '</a>)';
             echo '</td>';
             echo '</tr>';
         }
         /// Print Section 0
         $section = 0;
         $thissection = $sections[$section];
         if ($thissection->summary or $thissection->sequence or isediting($course->id)) {
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:31,代码来源:format.php

示例15: fn_display_category_content

/**
 * Function used by the site index page to display category specific information.
 */
function fn_display_category_content($course, $catid)
{
    global $USER, $CFG;
    $totcount = 99;
    $isteacher = isteacher($course->id);
    $isediting = isediting($course->id);
    $ismoving = ismoving($course->id);
    if (!($category = get_record('course_categories', 'id', $catid))) {
        error('Invalid category requested.');
    }
    $courses = get_courses_page($catid, 'c.sortorder ASC', 'c.id,c.sortorder,c.shortname,c.fullname,c.summary,c.visible,c.teacher,c.guest,c.password', $totcount);
    /// Store a course section per category id. Code it by using the 'catid' plus 10 as the section number.
    $sectnum = $catid + 10;
    if (!($section = get_record('course_sections', 'course', $course->id, 'section', $sectnum))) {
        $section = new stdClass();
        $section->course = $course->id;
        $section->section = $sectnum;
        $section->summary = $category->name;
        $section->sequence = '';
        $section->visible = 1;
        if (!($section->id = insert_record('course_sections', $section))) {
            error('Could not create section for category ' . $category->name);
        }
    }
    if (!empty($section) || $isediting) {
        get_all_mods($course->id, $mods, $modnames, $modnamesplural, $modnamesused);
    }
    $groupbuttons = $course->groupmode;
    $groupbuttonslink = !$course->groupmodeforce;
    if ($ismoving) {
        $strmovehere = get_string('movehere');
        $strmovefull = strip_tags(get_string('movefull', '', "'{$USER->activitycopyname}'"));
        $strcancel = get_string('cancel');
        $stractivityclipboard = $USER->activitycopyname;
    }
    $modinfo = unserialize($course->modinfo);
    $editbuttons = '';
    print_simple_box_start("center", "100%", '', 5, "coursebox");
    echo '<table class="topics" width="100%">';
    echo '<tr id="section-' . $section . '" class="section main">';
    echo '<td class="content">';
    print_heading_block('<div align="center">' . $category->name . '</div>');
    echo '<table class="section" width="100%">';
    if (!empty($section) && !empty($section->sequence)) {
        $sectionmods = explode(',', $section->sequence);
        foreach ($sectionmods as $modnumber) {
            if (empty($mods[$modnumber])) {
                continue;
            }
            $mod = $mods[$modnumber];
            if ($isediting && !$ismoving) {
                if ($groupbuttons) {
                    if (!($mod->groupmodelink = $groupbuttonslink)) {
                        $mod->groupmode = $course->groupmode;
                    }
                } else {
                    $mod->groupmode = false;
                }
                $editbuttons = '<br />' . make_editing_buttons($mod, true, true);
            } else {
                $editbuttons = '';
            }
            if ($mod->visible || $isteacher) {
                echo '<tr><td class="activity ' . $mod->modname . '">';
                if ($ismoving) {
                    if ($mod->id == $USER->activitycopy) {
                        continue;
                    }
                    echo '<a title="' . $strmovefull . '" href="' . $CFG->wwwroot . '/course/mod.php?moveto=' . $mod->id . '&amp;sesskey=' . $USER->sesskey . '">' . '<img height="16" width="80" src="' . $CFG->pixpath . '/movehere.gif" alt="' . $strmovehere . '" border="0" /></a>';
                }
                $instancename = urldecode($modinfo[$modnumber]->name);
                $instancename = format_string($instancename, true, $course->id);
                $linkcss = $mod->visible ? '' : ' class="dimmed" ';
                if (!empty($modinfo[$modnumber]->extra)) {
                    $extra = urldecode($modinfo[$modnumber]->extra);
                } else {
                    $extra = '';
                }
                if (!empty($modinfo[$modnumber]->icon)) {
                    $icon = $CFG->pixpath . '/' . urldecode($modinfo[$modnumber]->icon);
                } else {
                    $icon = $CFG->modpixpath . '/' . $mod->modname . '/icon.gif';
                }
                if ($mod->modname == 'label') {
                    echo format_text($extra, FORMAT_HTML) . $editbuttons;
                } else {
                    echo '<img src="' . $icon . '" height="16" width="16" alt="' . $mod->modfullname . '" /> ' . '<a title="' . $mod->modfullname . '" ' . $linkcss . ' ' . $extra . ' href="' . $CFG->wwwroot . '/mod/' . $mod->modname . '/view.php?id=' . $mod->id . '">' . $instancename . '</a>' . $editbuttons;
                }
                echo "</td>";
                echo "</tr>";
            }
        }
    } else {
        echo "<tr><td></td></tr>";
        // needed for XHTML compatibility
    }
    if ($ismoving) {
//.........这里部分代码省略.........
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:101,代码来源:lib.php


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