• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP print_simple_box函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: view

 function view()
 {
     global $USER;
     $context = get_context_instance(CONTEXT_MODULE, $this->cm->id);
     require_capability('mod/assignment:view', $context);
     add_to_log($this->course->id, "assignment-embedded", "view", "view-embedded.php?id={$this->cm->id}", $this->assignment->id, $this->cm->id);
     // $this->view_header();
     echo "<center>";
     $this->view_intro();
     echo "Hands-on exams will be graded within 10 business days. Results will be provided via email. If you do not receive your results within 10 business days of submitting your answer file, please open a ticket with Kaseya University at helpdesk.kaseya.com.";
     echo "</center>";
     $this->view_dates();
     $filecount = $this->count_user_files($USER->id);
     if ($submission = $this->get_submission()) {
         if ($submission->timemarked) {
             $this->view_feedback();
         }
         if ($filecount) {
             print_simple_box($this->print_user_files($USER->id, true), 'center');
         }
     }
     if (has_capability('mod/assignment:submit', $context) && $this->isopen() && (!$filecount || $this->assignment->resubmit || !$submission->timemarked)) {
         $this->view_upload_form();
     }
     // $this->view_footer();
 }
开发者ID:arshanam,项目名称:Moodle-ITScholars-LMS,代码行数:26,代码来源:assignment_embedded.class.php


示例2: display

 function display()
 {
     global $CFG;
     $formatoptions = new object();
     $formatoptions->noclean = true;
     /// Are we displaying the course blocks?
     if ($this->resource->options == 'showblocks') {
         parent::display_course_blocks_start();
         $entry = get_record('kaltura_entries', 'context', "R_" . "{$this->resource}->id");
         if (trim(strip_tags($this->resource->alltext))) {
             echo $entry->title;
             $player_url = $CFG->wwwroot . '/mod/kaltura/kswfdoc.php?context=' . $this->course->id . '&entry_id=' . $resource->alltext;
             $formatoptions = new object();
             $formatoptions->noclean = true;
             print_simple_box(format_text($resource->summary, FORMAT_MOODLE, $formatoptions, $this->course->id), "center");
             if ($resource->alltext) {
                 echo '<input style="margin-top:20px;" type="button" value="View video presentation" onclick="kalturaInitModalBox(\'' . $player_url . '\', {width:780, height:400});">';
             }
             //            echo embed_kaltura($resource->alltext,get_width($entry),get_height($entry),$entry->entry_type);
         }
         parent::display_course_blocks_end();
     } else {
         /// Set up generic stuff first, including checking for access
         parent::display();
         /// Set up some shorthand variables
         $cm = $this->cm;
         $course = $this->course;
         $resource = $this->resource;
         $entry = get_record('kaltura_entries', 'context', "R_" . "{$resource->id}");
         $pagetitle = strip_tags($course->shortname . ': ' . format_string($resource->name));
         $inpopup = optional_param('inpopup', '', PARAM_BOOL);
         add_to_log($course->id, "resource", "view", "view.php?id={$cm->id}", $resource->id, $cm->id);
         $navigation = build_navigation($this->navlinks, $cm);
         print_header($pagetitle, $course->fullname, $navigation, "", "", true, update_module_button($cm->id, $course->id, $this->strresource), navmenu($course, $cm));
         if (trim(strip_tags($this->resource->alltext))) {
             echo $entry->title;
         }
         $formatoptions = new object();
         $formatoptions->noclean = true;
         print_simple_box(format_text($resource->summary, FORMAT_MOODLE, $formatoptions, $this->course->id), "center");
         if (trim(strip_tags($this->resource->alltext))) {
             $player_url = $CFG->wwwroot . '/mod/kaltura/kswfdoc.php?context=' . $this->course->id . '&entry_id=' . $resource->alltext;
             if ($resource->alltext) {
                 echo '<input type="button" style="margin-top:20px;"  value="View video presentation" onclick="kalturaInitModalBox(\'' . $player_url . '\', {width:780, height:400});">';
             }
             //          echo embed_kaltura($resource->alltext,get_width($entry),get_height($entry),$entry->entry_type);
         }
         /*       print_simple_box(format_text($resource->alltext, $resource->reference, $formatoptions, $course->id),
                         "center", "", "", "20");
         */
         $strlastmodified = get_string("lastmodified");
         echo "<div class=\"modified\">{$strlastmodified}: " . userdate($resource->timemodified) . "</div>";
         print_footer($course);
     }
 }
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:55,代码来源:resource.class.php


示例3: csverror

function csverror($message, $link = '')
{
    global $CFG, $SESSION;
    print_header(get_string('error'));
    echo '<br />';
    $message = clean_text($message);
    print_simple_box('<span style="font-family:monospace;color:#000000;">' . $message . '</span>', 'center', '', '#FFBBBB', 5, 'errorbox');
    if (!$link) {
        if (!empty($SESSION->fromurl)) {
            $link = $SESSION->fromurl;
            unset($SESSION->fromurl);
        } else {
            $link = $CFG->wwwroot . '/';
        }
    }
    print_continue($link);
    print_footer();
    die;
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:19,代码来源:uploadcourse.php


示例4: if

 /*if (isset($_POST['cancel'])) {
 			print_simple_box(get_string('msgcancelok', 'block_file_manager'), 'center');
 			redirect("link_manage.php?id=$id&linkid=$zipid&rootdir=$rootdir");
 		} else if (isset($_POST['unzip'])) {*/
 if ($groupid == 0) {
     $zipfile = fm_get_user_link($zipid);
 } else {
     $zipfile = fm_get_group_link($zipid, $groupid);
 }
 if ($groupid == 0) {
     $zipfileloc = $CFG->dataroot . "/" . fm_get_user_dir_space() . fm_get_folder_path($zipfile->folder, false, $groupid) . "/" . $zipfile->link;
 } else {
     $zipfileloc = $CFG->dataroot . "/" . fm_get_group_dir_space($groupid) . fm_get_folder_path($zipfile->folder, false, $groupid) . "/" . $zipfile->link;
 }
 fm_unzip_file($zipfileloc, '', false, $zipfile->folder, $groupid);
 print_simple_box(get_string('msgmodificationok', 'block_file_manager'), "center", "", "#FFFFFF");
 redirect("view.php?id={$id}&rootdir={$rootdir}&groupid={$groupid}");
 //}
 /*$list = fm_view_zipped(fm_get_user_link($zipid), $groupid);
 		$fmdir = fm_get_root_dir();
 		echo "<form name=\"unzipform\" method=\"post\" action=\"$CFG->wwwroot/$fmdir/zip.php?id={$id}&rootdir={$rootdir}&zipid=$zipid&what='$action'\">";
 		print_simple_box_start('center','500','#C0C0C0');
 		echo "<table name=\"viewziptable\" cellspacing=\"5\" align=\"center\" width=\"375\">";
 			echo "<tr>";
 			echo "<td align='center' nowrap><b><u>".get_string("file",'block_file_manager')."</u></b></td>";
 			echo "<td align='center' nowrap><b><u>".get_string("compressedsize",'block_file_manager')."</u></b></td>";
 			echo "<td align='center' nowrap><b><u>".get_string("actualsize",'block_file_manager')."</u></b></td>";
 			echo "</tr>";
 		foreach($list as $l) {
 			echo "<tr>";
 			echo "<td align='center'>$l->name</td>";
开发者ID:nadavkav,项目名称:MoodleTAO,代码行数:31,代码来源:zip.php


示例5: print_error

        if (!confirm_sesskey()) {
            print_error('confirmsesskeybad', 'error');
        }
        set_config('sendcoursewelcomemessage', required_param('sendcoursewelcomemessage', PARAM_BOOL));
    }
}
/// Print the form
$str = get_strings(array('enrolmentplugins', 'users', 'administration', 'settings', 'edit'));
admin_externalpage_print_header();
$modules = get_list_of_plugins("enrol");
$options = array();
foreach ($modules as $module) {
    $options[$module] = get_string("enrolname", "enrol_{$module}");
}
asort($options);
print_simple_box(get_string('configenrolmentplugins', 'admin'), 'center', '700');
echo "<form {$CFG->frametarget} id=\"enrolmenu\" method=\"post\" action=\"enrol.php\">";
echo "<div>";
echo "<input type=\"hidden\" name=\"sesskey\" value=\"" . sesskey() . "\" />";
$table = new stdClass();
$table->head = array(get_string('name'), get_string('enable'), get_string('default'), $str->settings);
$table->align = array('left', 'center', 'center', 'center');
$table->size = array('60%', '', '', '15%');
$table->width = '700';
$table->data = array();
$modules = get_list_of_plugins("enrol");
$enabledplugins = explode(',', $CFG->enrol_plugins_enabled);
foreach ($modules as $module) {
    // skip if directory is empty
    if (!file_exists("{$CFG->dirroot}/enrol/{$module}/enrol.php")) {
        continue;
开发者ID:nicolasconnault,项目名称:moodle2.0,代码行数:31,代码来源:enrol.php


示例6: display


//.........这里部分代码省略.........
             }
             $fullurl = "{$CFG->wwwroot}{$relativeurl}";
         }
     }
     /// Print a notice and redirect if we are trying to access a file on a local file system
     /// and the config setting has been disabled
     if (!$CFG->resource_allowlocalfiles and strpos($resource->reference, RESOURCE_LOCALPATH) === 0) {
         if ($inpopup) {
             print_header($pagetitle, $course->fullname);
         } else {
             $this->navlinks[] = array('name' => format_string($resource->name), 'link' => null, 'type' => 'misc');
             $this->navigation = build_navigation($this->navlinks);
             print_header($pagetitle, $course->fullname, $this->navigation, "", "", true, update_module_button($cm->id, $course->id, $this->strresource), navmenu($course, $cm));
         }
         notify(get_string('notallowedlocalfileaccess', 'resource', ''));
         if ($inpopup) {
             close_window_button();
         }
         print_footer('none');
         die;
     }
     /// Check whether this is supposed to be a popup, but was called directly
     if ($resource->popup and !$inpopup) {
         /// Make a page and a pop-up window
         $this->navlinks[] = array('name' => format_string($resource->name), 'link' => null, 'type' => 'misc');
         $this->navigation = build_navigation($this->navlinks);
         print_header($pagetitle, $course->fullname, $this->navigation, "", "", true, update_module_button($cm->id, $course->id, $this->strresource), navmenu($course, $cm));
         echo "\n<script type=\"text/javascript\">";
         echo "\n<!--\n";
         echo "openpopup('/mod/resource/view.php?inpopup=true&id={$cm->id}','resource{$resource->id}','{$resource->popup}');\n";
         echo "\n-->\n";
         echo '</script>';
         if (trim(strip_tags($resource->summary))) {
             print_simple_box(format_text($resource->summary, FORMAT_MOODLE, $formatoptions), "center");
         }
         $link = "<a href=\"{$CFG->wwwroot}/mod/resource/view.php?inpopup=true&amp;id={$cm->id}\" " . "onclick=\"this.target='resource{$resource->id}'; return openpopup('/mod/resource/view.php?inpopup=true&amp;id={$cm->id}', " . "'resource{$resource->id}','{$resource->popup}');\">" . format_string($resource->name, true) . "</a>";
         echo '<div class="popupnotice">';
         print_string('popupresource', 'resource');
         echo '<br />';
         print_string('popupresourcelink', 'resource', $link);
         echo '</div>';
         print_footer($course);
         exit;
     }
     /// Now check whether we need to display a frameset
     $frameset = optional_param('frameset', '', PARAM_ALPHA);
     if (empty($frameset) and !$embedded and !$inpopup and $resource->options == "frame" and empty($USER->screenreader)) {
         @header('Content-Type: text/html; charset=utf-8');
         echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Frameset//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd\">\n";
         echo "<html dir=\"ltr\">\n";
         echo '<head>';
         echo '<meta http-equiv="content-type" content="text/html; charset=utf-8" />';
         echo "<title>" . format_string($course->shortname) . ": " . strip_tags(format_string($resource->name, true)) . "</title></head>\n";
         echo "<frameset rows=\"{$CFG->resource_framesize},*\">";
         echo "<frame src=\"view.php?id={$cm->id}&amp;type={$resource->type}&amp;frameset=top\" title=\"" . get_string('modulename', 'resource') . "\"/>";
         if (!empty($localpath)) {
             // Show it like this so we interpose some HTML
             echo "<frame src=\"view.php?id={$cm->id}&amp;type={$resource->type}&amp;inpopup=true\" title=\"" . get_string('modulename', 'resource') . "\"/>";
         } else {
             echo "<frame src=\"{$fullurl}\" title=\"" . get_string('modulename', 'resource') . "\"/>";
         }
         echo "</frameset>";
         echo "</html>";
         exit;
     }
     /// We can only get here once per resource, so add an entry to the log
开发者ID:BackupTheBerlios,项目名称:samouk-svn,代码行数:67,代码来源:resource.class.php


示例7: get_string

         } else {
             echo get_string('notabletodisplayfor', 'brainstorm', get_string($operator->id, 'brainstorm'));
         }
         print_simple_box_end();
     }
 }
 if (!$brainstorm->singlegrade && $brainstorm->seqaccessorganize) {
     echo '<br/>';
     print_string('gradefororganisation', 'brainstorm');
     echo ' : ';
     make_grading_menu($brainstorm, 'organize', @$gradeset->organize, false);
 }
 /// printing final feedback and report
 print_heading(get_string('feedback', 'brainstorm'), '', 3);
 $report = get_record('brainstorm_userdata', 'brainstormid', $brainstorm->id, 'userid', $gradefor);
 print_simple_box(format_string(format_text(@$report->report, @$report->reportformat)));
 if (!$brainstorm->singlegrade && $brainstorm->seqaccessfeedback) {
     echo '<br/>';
     print_string('gradeforfeedback', 'brainstorm');
     echo ' : ';
     make_grading_menu($brainstorm, 'feedback', @$gradeset->feedback, false);
 }
 // print a final feedback form
 echo '<br/><br/><table width="80%"><tr valign="top"><td><b>' . get_string('feedback') . ':</b></td><td>';
 $usehtmleditor = can_use_html_editor();
 print_textarea($usehtmleditor, 20, 50, 680, 400, 'teacherfeedback', @$report->feedback);
 if (!$usehtmleditor) {
     echo '<p align="right">';
     helpbutton('textformat', get_string('formattexttype'));
     print_string('formattexttype');
     echo ":&nbsp;";
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:31,代码来源:grade.php


示例8: view_intro

 /**
  * Display the assignment intro
  *
  */
 function view_intro()
 {
     parent::view_intro();
     print_simple_box($this->view_summary(null, true), 'center', '', '', 5, 'generalbox', 'intro');
 }
开发者ID:hit-moodle,项目名称:onlinejudge,代码行数:9,代码来源:assignment.class.php


示例9: foreach

            // reject if does not start with filter_
            foreach ($config as $name => $value) {
                set_config($name, stripslashes($value));
            }
        }
        redirect("{$CFG->wwwroot}/{$CFG->admin}/filters.php");
        exit;
    }
}
//==============================
// Display logic
//==============================
$filtername = ucfirst($filtername);
admin_externalpage_print_header($adminroot);
print_heading($filtername);
print_simple_box(get_string("configwarning", "admin"), "center", "50%");
echo "<br />";
print_simple_box_start("center", '');
?>
    <form action="filter.php?filter=<?php 
echo urlencode($param->filter);
?>
" method="post">
    <div style="text-align: center">
    <input type="hidden" name="sesskey" value="<?php 
echo sesskey();
?>
" />

    <?php 
include "{$CFG->dirroot}/{$param->filter}/filterconfig.html";
开发者ID:veritech,项目名称:pare-project,代码行数:31,代码来源:filter.php


示例10: error

             }
             if (!($sectionid = add_mod_to_section($mod))) {
                 error("Could not add the new course module to that section");
             }
             //We get the section's visible field status
             $visible = get_field("course_sections", "visible", "id", $sectionid);
             if (!set_field("course_modules", "visible", $visible, "id", $mod->coursemodule)) {
                 error("Could not update the course module with the correct visibility");
             }
             if (!set_field("course_modules", "section", $sectionid, "id", $mod->coursemodule)) {
                 error("Could not update the course module with the correct section");
             }
             add_to_log($course->id, "course", "add mod", "../mod/{$mod->modulename}/view.php?id={$mod->coursemodule}", "{$mod->modulename} {$mod->instance}");
             add_to_log($course->id, $mod->modulename, "add", "view.php?id={$mod->coursemodule}", "{$mod->instance}", $mod->coursemodule);
             rebuild_course_cache($course->id);
             print_simple_box(get_string("newglossarycreated", "glossary"), "center", "70%");
             echo '<p>';
         }
     } else {
         notify("Error while trying to create the new glossary.");
         print_footer($course);
         exit;
     }
 }
 $xmlentries = $xml['GLOSSARY']['#']['INFO'][0]['#']['ENTRIES'][0]['#']['ENTRY'];
 for ($i = 0; $i < sizeof($xmlentries); $i++) {
     // Inserting the entries
     $xmlentry = $xmlentries[$i];
     unset($newentry);
     $newentry->concept = trim(addslashes($xmlentry['#']['CONCEPT'][0]['#']));
     $newentry->definition = trusttext_strip(addslashes($xmlentry['#']['DEFINITION'][0]['#']));
开发者ID:veritech,项目名称:pare-project,代码行数:31,代码来源:import.php


示例11: _print_normal_error

/**
 * Internal function - do not use directly!!
 */
function _print_normal_error($errorcode, $module, $a, $link, $backtrace, $debuginfo = null, $showerrordebugwarning = false)
{
    global $CFG, $SESSION, $THEME, $DB, $PAGE;
    if ($DB) {
        //if you enable db debugging and exception is thrown, the print footer prints a lot of rubbish
        $DB->set_debug(0);
    }
    if ($module === 'error') {
        $modulelink = 'moodle';
    } else {
        $modulelink = $module;
    }
    $message = get_string($errorcode, $module, $a);
    if ($module === 'error' and strpos($message, '[[') === 0) {
        //search in moodle file if error specified - needed for backwards compatibility
        $message = get_string($errorcode, 'moodle', $a);
    }
    if (CLI_SCRIPT) {
        // Errors in cron should be mtrace'd.
        mtrace($message);
        die;
    }
    if (empty($link) and !defined('ADMIN_EXT_HEADER_PRINTED')) {
        if (!empty($SESSION->fromurl)) {
            $link = $SESSION->fromurl;
            unset($SESSION->fromurl);
        } else {
            $link = $CFG->wwwroot . '/';
        }
    }
    if (!empty($CFG->errordocroot)) {
        $errordocroot = $CFG->errordocroot;
    } else {
        if (!empty($CFG->docroot)) {
            $errordocroot = $CFG->docroot;
        } else {
            $errordocroot = 'http://docs.moodle.org';
        }
    }
    if (!$PAGE->headerprinted) {
        //header not yet printed
        @header('HTTP/1.0 404 Not Found');
        print_header(get_string('error'));
    } else {
        print_container_end_all(false, $THEME->open_header_containers);
    }
    echo '<br />';
    $message = clean_text('<p class="errormessage">' . $message . '</p>' . '<p class="errorcode">' . '<a href="' . $errordocroot . '/en/error/' . $modulelink . '/' . $errorcode . '">' . get_string('moreinformation') . '</a></p>');
    print_simple_box($message, '', '', '', '', 'errorbox');
    if ($showerrordebugwarning) {
        debugging('error() is a deprecated function, please call print_error() instead of error()', DEBUG_DEVELOPER);
    } else {
        if (debugging('', DEBUG_DEVELOPER)) {
            if ($debuginfo) {
                debugging($debuginfo, DEBUG_DEVELOPER, $backtrace);
            } else {
                notify('Stack trace:' . print_backtrace($backtrace, true), 'notifytiny');
            }
        }
    }
    if (!empty($link)) {
        print_continue($link);
    }
    print_footer();
    for ($i = 0; $i < 512; $i++) {
        // Padding to help IE work with 404
        echo ' ';
    }
    die;
}
开发者ID:nicolasconnault,项目名称:moodle2.0,代码行数:73,代码来源:weblib.php


示例12: print_heading

print_heading($strupgradinglogs);
if (!data_submitted() or empty($confirm) or !confirm_sesskey()) {
    $optionsyes = array('confirm' => '1', 'sesskey' => sesskey());
    notice_yesno(get_string('upgradeforumreadinfo', 'admin'), 'upgradelogs.php', 'index.php', $optionsyes, NULL, 'post', 'get');
    admin_externalpage_print_footer($adminroot);
    exit;
}
/// Try and extract as many cmids as possible from the existing logs
if ($coursemodules = get_records_sql("SELECT cm.*, m.name\n                                            FROM {$CFG->prefix}course_modules cm,\n                                                 {$CFG->prefix}modules m\n                                            WHERE cm.module = m.id")) {
    $cmcount = count($coursemodules);
    $count = 0;
    $starttime = time();
    $sleeptime = 0;
    $LIKE = sql_ilike();
    if ($cmcount > 10) {
        print_simple_box('This process may take a very long time ... please be patient and let it finish.', 'center', '', '#ffcccc');
        $sleeptime = 1;
    }
    foreach ($coursemodules as $cm) {
        switch ($cm->name) {
            case "forum":
                execute_sql("UPDATE {$CFG->prefix}log SET cmid = '{$cm->id}'\n                                 WHERE module = '{$cm->name}' AND url = 'view.php?id={$cm->id}'", false);
                execute_sql("UPDATE {$CFG->prefix}log SET cmid = '{$cm->id}'\n                                 WHERE module = '{$cm->name}' AND url = 'view.php?f={$cm->instance}'", false);
                if ($discussions = get_records("forum_discussions", "forum", $cm->instance)) {
                    foreach ($discussions as $discussion) {
                        execute_sql("UPDATE {$CFG->prefix}log SET cmid = '{$cm->id}'\n                                         WHERE module = '{$cm->name}' AND url {$LIKE} 'discuss.php?d={$discussion->id}%'", false);
                    }
                }
                break;
            case "glossary":
                execute_sql("UPDATE {$CFG->prefix}log SET cmid = '{$cm->id}'\n                                 WHERE module = '{$cm->name}' AND url {$LIKE} 'view.php?id={$cm->id}%'", false);
开发者ID:veritech,项目名称:pare-project,代码行数:31,代码来源:upgradelogs.php


示例13: foreach

$table->cellspacing = 0;
$table->width = '90%';
$table->align[] = 'right';
/// get all the roles identifier
foreach ($roles as $role) {
    $rolesname[] = format_string($role->name);
    $roleids[] = $role->id;
    $table->align[] = 'center';
    $table->wrap[] = 'nowrap';
}
$table->head = array_merge(array(''), $rolesname);
foreach ($roles as $role) {
    $beta = get_box_list($role->id, $roleids);
    $table->data[] = array_merge(array(format_string($role->name)), $beta);
}
print_simple_box(get_string('configallowoverride', 'admin'), 'center');
echo '<form action="allowoverride.php" method="post">';
print_table($table);
echo '<div class="buttons"><input type="submit" value="' . get_string('savechanges') . '"/>';
echo '<input type="hidden" name="dummy" value="1" />';
// this is needed otherwise we do not know a form has been submitted
echo '</div></form>';
admin_externalpage_print_footer();
// returns array
function get_box_list($roleid, $arraylist)
{
    foreach ($arraylist as $targetid) {
        if (get_record('role_allow_override', 'roleid', $roleid, 'allowoverride', $targetid)) {
            $array[] = '<input type="checkbox" name="s_' . $roleid . '_' . $targetid . '" value="1" checked="checked"/>';
        } else {
            $array[] = '<input type="checkbox" name="s_' . $roleid . '_' . $targetid . '" value="1" />';
开发者ID:BackupTheBerlios,项目名称:samouk-svn,代码行数:31,代码来源:allowoverride.php


示例14: main_upgrade


//.........这里部分代码省略.........
                    $mod->course = $course->id;
                    $mod->module = $module->id;
                    $mod->instance = $social->id;
                    $mod->section = 0;
                    if (!($mod->coursemodule = add_course_module($mod))) {
                        notify("Could not add a new course module to the course '" . format_string($course->fullname) . "'");
                        return false;
                    }
                    if (!($sectionid = add_mod_to_section($mod))) {
                        notify("Could not add the new course module to that section");
                        return false;
                    }
                    if (!set_field("course_modules", "section", $sectionid, "id", $mod->coursemodule)) {
                        notify("Could not update the course module with the correct section");
                        return false;
                    }
                }
            }
        }
    }
    if ($oldversion < 2002111003) {
        execute_sql(" ALTER TABLE `course` ADD `modinfo` TEXT NOT NULL AFTER `format` ");
        if ($courses = get_records_sql("SELECT * FROM course")) {
            require_once "{$CFG->dirroot}/course/lib.php";
            foreach ($courses as $course) {
                $modinfo = serialize(get_array_of_activities($course->id));
                if (!set_field("course", "modinfo", $modinfo, "id", $course->id)) {
                    notify("Could not cache module information for course '" . format_string($course->fullname) . "'!");
                }
            }
        }
    }
    if ($oldversion < 2002111100) {
        print_simple_box_start("CENTER", "", "#FFCCCC");
        echo "<FONT SIZE=+1>";
        echo "<P>Changes have been made to all built-in themes, to add the new popup navigation menu.";
        echo "<P>If you have customised themes, you will need to edit theme/xxxx/header.html as follows:";
        echo "<UL><LI>Change anywhere it says <B>\$" . "button</B> to say <B>\$" . "menu</B>";
        echo "<LI>Add <B>\$" . "button</B> elsewhere (eg at the end of the navigation bar)</UL>";
        echo "<P>See the standard themes for examples, eg: theme/standard/header.html";
        print_simple_box_end();
    }
    if ($oldversion < 2002111200) {
        execute_sql(" ALTER TABLE `course` ADD `showrecent` TINYINT(5) UNSIGNED DEFAULT '1' NOT NULL AFTER `numsections` ");
    }
    if ($oldversion < 2002111400) {
        // Rebuild all course caches, because some may not be done in new installs (eg site page)
        if ($courses = get_records_sql("SELECT * FROM course")) {
            require_once "{$CFG->dirroot}/course/lib.php";
            foreach ($courses as $course) {
                $modinfo = serialize(get_array_of_activities($course->id));
                if (!set_field("course", "modinfo", $modinfo, "id", $course->id)) {
                    notify("Could not cache module information for course '" . format_string($course->fullname) . "'!");
                }
            }
        }
    }
    if ($oldversion < 2002112000) {
        set_config("guestloginbutton", 1);
    }
    if ($oldversion < 2002122300) {
        execute_sql("ALTER TABLE `log` CHANGE `user` `userid` INT(10) UNSIGNED DEFAULT '0' NOT NULL ");
        execute_sql("ALTER TABLE `user_admins` CHANGE `user` `userid` INT(10) UNSIGNED DEFAULT '0' NOT NULL ");
        execute_sql("ALTER TABLE `user_students` CHANGE `user` `userid` INT(10) UNSIGNED DEFAULT '0' NOT NULL ");
        execute_sql("ALTER TABLE `user_teachers` CHANGE `user` `userid` INT(10) UNSIGNED DEFAULT '0' NOT NULL ");
        execute_sql("ALTER TABLE `user_students` CHANGE `start` `timestart` INT(10) UNSIGNED DEFAULT '0' NOT NULL ");
开发者ID:veritech,项目名称:pare-project,代码行数:67,代码来源:mysql.php


示例15: scorm_course_format_display

function scorm_course_format_display($user, $course)
{
    global $CFG;
    $strupdate = get_string('update');
    $strmodule = get_string('modulename', 'scorm');
    $context = get_context_instance(CONTEXT_COURSE, $course->id);
    echo '<div class="mod-scorm">';
    if ($scorms = get_all_instances_in_course('scorm', $course)) {
        // The module SCORM activity with the least id is the course
        $scorm = current($scorms);
        if (!($cm = get_coursemodule_from_instance('scorm', $scorm->id, $course->id))) {
            error('Course Module ID was incorrect');
        }
        $colspan = '';
        $headertext = '<table width="100%"><tr><td class="title">' . get_string('name') . ': <b>' . format_string($scorm->name) . '</b>';
        if (has_capability('moodle/course:manageactivities', $context)) {
            if (isediting($course->id)) {
                // Display update icon
                $path = $CFG->wwwroot . '/course';
                $headertext .= '<span class="commands">' . '<a title="' . $strupdate . '" href="' . $path . '/mod.php?update=' . $cm->id . '&amp;sesskey=' . sesskey() . '">' . '<img src="' . $CFG->pixpath . '/t/edit.gif" class="iconsmall" alt="' . $strupdate . '" /></a></span>';
            }
            $headertext .= '</td>';
            // Display report link
            $trackedusers = get_record('scorm_scoes_track', 'scormid', $scorm->id, '', '', '', '', 'count(distinct(userid)) as c');
            if ($trackedusers->c > 0) {
                $headertext .= '<td class="reportlink">' . '<a ' . $CFG->frametarget . '" href="' . $CFG->wwwroot . '/mod/scorm/report.php?id=' . $cm->id . '">' . get_string('viewallreports', 'scorm', $trackedusers->c) . '</a>';
            } else {
                $headertext .= '<td class="reportlink">' . get_string('noreports', 'scorm');
            }
            $colspan = ' colspan="2"';
        }
        $headertext .= '</td></tr><tr><td' . $colspan . '>' . format_text(get_string('summary') . ':<br />' . $scorm->summary) . '</td></tr></table>';
        print_simple_box($headertext, '', '100%');
        scorm_view_display($user, $scorm, 'view.php?id=' . $course->id, $cm, '100%');
    } else {
        if (has_capability('moodle/course:update', $context)) {
            // Create a new activity
            redirect($CFG->wwwroot . '/course/mod.php?id=' . $course->id . '&amp;section=0&sesskey=' . sesskey() . '&amp;add=scorm');
        } else {
            notify('Could not find a scorm course here');
        }
    }
    echo '</div>';
}
开发者ID:nadavkav,项目名称:MoodleTAO,代码行数:44,代码来源:locallib.php


示例16: substr

    if (substr($path, 0, 1) == '/') {
        $path = substr($path, 1);
    }
    $path = $CFG->dirroot . '/' . $path;
    if (substr($path, -1) == '/') {
        $path = substr($path, 0, -1);
    }
    $displaypath = substr($path, strlen($CFG->dirroot) + 1);
    $ok = true;
    if (is_file($path)) {
        $test->addTestFile($path);
    } else {
        if (is_dir($path)) {
            $test->findTestFiles($path);
        } else {
            print_simple_box(get_string('pathdoesnotexist', $langfile, $path), '', '', '', '', 'errorbox');
            $ok = false;
        }
    }
    // If we have something to test, do it.
    if ($ok) {
        if ($path == $CFG->dirroot) {
            $title = get_string('moodleunittests', $langfile, get_string('all', $langfile));
        } else {
            $title = get_string('moodleunittests', $langfile, $displaypath);
        }
        print_heading($title);
        $test->run($reporter);
    }
    $formheader = get_string('retest', $langfile);
} else {
开发者ID:r007,项目名称:PMoodle,代码行数:31,代码来源:index.php


示例17: events_trigger

    $eventdata->fullmessage = $form->text;
    $eventdata->fullmessageformat = FORMAT_PLAIN;
    $eventdata->fullmessagehtml = '';
    $eventdata->smallmessage = '';
    events_trigger('message_send', $eventdata);
    redirect($CFG->wwwroot . '/course/', 'Message sent, thanks', 3);
    exit;
}
$site = get_site();
$redirecturl = empty($_SERVER['REDIRECT_URL']) ? '' : $_SERVER['REDIRECT_URL'];
$httpreferer = empty($_SERVER['HTTP_REFERER']) ? '' : $_SERVER['HTTP_REFERER'];
$requesturi = empty($_SERVER['REQUEST_URI']) ? '' : $_SERVER['REQUEST_URI'];
header("HTTP/1.0 404 Not Found");
header("Status: 404 Not Found");
print_header($site->fullname . ':Error', $site->fullname . ': Error 404', 'Error 404 - File not Found', '');
print_simple_box('<p align="center">' . get_string('pagenotexist', 'error') . '<br />' . s($requesturi) . '</p>', 'center');
if (isloggedin()) {
    ?>
        <center>
        <p><?php 
    echo get_string('pleasereport', 'error');
    ?>
        <p><form action="<?php 
    echo $CFG->wwwroot;
    ?>
/error/index.php" method="post">
           <textarea rows="3" cols="50" name="text" id="text"></textarea><br />
           <input type="hidden" name="referer" value="<?php 
    p($httpreferer);
    ?>
">
开发者ID:nicolasconnault,项目名称:moodle2.0,代码行数:31,代码来源:index.php


示例18: require_login

}
require_login($course->id, false, $cm);
if (!has_capability('mod/assignment:grade', get_context_instance(CONTEXT_MODULE, $cm->id))) {
    print_error('cannotviewassignment', 'assignment');
}
if ($assignment->assignmenttype != 'upload') {
    print_error('invalidtype', 'assignment');
}
$assignmentinstance = new assignment_upload($cm->id, $assignment, $cm, $course);
$returnurl = "../../submissions.php?id={$assignmentinstance->cm->id}&amp;userid={$userid}&amp;offset={$offset}&amp;mode=single";
if ($submission = $assignmentinstance->get_submission($user->id) and !empty($submission->data1)) {
    print_header(fullname($user, true) . ': ' . $assignment->name);
    print_heading(get_string('notes', 'assignment') . ' - ' . fullname($user, true));
    print_simple_box(format_text($submission->data1, FORMAT_HTML), 'center', '100%');
    if ($mode != 'single') {
        close_window_button();
    } else {
        print_continue($returnurl);
    }
    print_footer('none');
} else {
    print_header(fullname($user, true) . ': ' . $assignment->name);
    print_heading(get_string('notes', 'assignment') . ' - ' . fullname($user, true));
    print_simple_box(get_string('notesempty', 'assignment'), 'center', '100%');
    if ($mode != 'single') {
        close_window_button();
    } else {
        print_continue($returnurl);
    }
    print_footer('none');
}
开发者ID:nicolasconnault,项目名称:moodle2.0,代码行数:31,代码来源:notes.php


示例19: restore_precheck


//.........这里部分代码省略.........
        $xml_file = $CFG->dataroot . "/temp/backup/" . $backup_unique_code . "/moodle.xml";
        if (!defined('RESTORE_SILENTLY')) {
            echo "<li>" . get_string("checkingbackup") . '</li>';
        }
        if (!($status = restore_check_moodle_file($xml_file))) {
            if (!is_file($xml_file)) {
                $errorstr = 'Error checking backup file. moodle.xml not found at root level of zip file.';
            } else {
                $errorstr = 'Error checking backup file. moodle.xml is incorrect or corrupted.';
            }
            if (!defined('RESTORE_SILENTLY')) {
                notify($errorstr);
            } else {
                return false;
            }
        }
    }
    $info = "";
    $course_header = "";
    //Now read the info tag (all)
    if ($status) {
        if (!defined('RESTORE_SILENTLY')) {
            echo "<li>" . get_string("readinginfofrombackup") . '</li>';
        }
        //Reading info  

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP print_simple_box_end函数代码示例发布时间:2022-05-15
下一篇:
PHP print_side_block函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap