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

PHP print_error函数代码示例

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

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



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

示例1: not_found

function not_found($courseid)
{
    global $CFG;
    header('HTTP/1.0 404 not found');
    print_error('filenotfound', 'error', $CFG->wwwroot . '/course/view.php?id=' . $courseid);
    //this is not displayed on IIS??
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:7,代码来源:sendfile.php


示例2: user_signup

 /**
  * Sign up a new user ready for confirmation.
  * Password is passed in plaintext.
  *
  * @param object $user new user object
  * @param boolean $notify print notice with link and terminate
  */
 function user_signup($user, $notify = true)
 {
     global $CFG, $DB;
     require_once $CFG->dirroot . '/user/profile/lib.php';
     $user->password = hash_internal_user_password($user->password);
     $user->id = $DB->insert_record('user', $user);
     /// Save any custom profile field information
     profile_save_data($user);
     $user = $DB->get_record('user', array('id' => $user->id));
     events_trigger('user_created', $user);
     if (!send_confirmation_email($user)) {
         print_error('auth_emailnoemail', 'auth_email');
     }
     if ($notify) {
         global $CFG, $PAGE, $OUTPUT;
         $emailconfirm = get_string('emailconfirm');
         $PAGE->navbar->add($emailconfirm);
         $PAGE->set_title($emailconfirm);
         $PAGE->set_heading($PAGE->course->fullname);
         echo $OUTPUT->header();
         notice(get_string('emailconfirmsent', '', $user->email), "{$CFG->wwwroot}/index.php");
     } else {
         return true;
     }
 }
开发者ID:JP-Git,项目名称:moodle,代码行数:32,代码来源:auth.php


示例3: moodleform_mod

 function moodleform_mod($current, $section, $cm, $course)
 {
     global $CFG;
     $this->current = $current;
     $this->_instance = $current->instance;
     $this->_section = $section;
     $this->_cm = $cm;
     if ($this->_cm) {
         $this->context = context_module::instance($this->_cm->id);
     } else {
         $this->context = context_course::instance($course->id);
     }
     // Set the course format.
     require_once $CFG->dirroot . '/course/format/lib.php';
     $this->courseformat = course_get_format($course);
     // Guess module name
     $matches = array();
     if (!preg_match('/^mod_([^_]+)_mod_form$/', get_class($this), $matches)) {
         debugging('Use $modname parameter or rename form to mod_xx_mod_form, where xx is name of your module');
         print_error('unknownmodulename');
     }
     $this->_modname = $matches[1];
     $this->init_features();
     parent::moodleform('modedit.php');
 }
开发者ID:alanaipe2015,项目名称:moodle,代码行数:25,代码来源:moodleform_mod.php


示例4: definition

 function definition()
 {
     global $CFG, $DB;
     $mform =& $this->_form;
     $strrequired = get_string('required');
     //-------------------------------------------------------------------------------
     $mform->addElement('header', 'general', get_string('general', 'form'));
     $mform->addElement('text', 'name', get_string('name'), array('size' => '64'));
     if (!empty($CFG->formatstringstriptags)) {
         $mform->setType('name', PARAM_TEXT);
     } else {
         $mform->setType('name', PARAM_CLEANHTML);
     }
     $mform->addRule('name', null, 'required', null, 'client');
     if (!($options = $DB->get_records_menu("survey", array("template" => 0), "name", "id, name"))) {
         print_error('cannotfindsurveytmpt', 'survey');
     }
     foreach ($options as $id => $name) {
         $options[$id] = get_string($name, "survey");
     }
     $options = array('' => get_string('choose') . '...') + $options;
     $mform->addElement('select', 'template', get_string("surveytype", "survey"), $options);
     $mform->addRule('template', $strrequired, 'required', null, 'client');
     $mform->addHelpButton('template', 'surveytype', 'survey');
     $this->standard_intro_elements(get_string('customintro', 'survey'));
     $this->standard_coursemodule_elements();
     //-------------------------------------------------------------------------------
     // buttons
     $this->add_action_buttons();
 }
开发者ID:evltuma,项目名称:moodle,代码行数:30,代码来源:mod_form.php


示例5: question_attempt_not_found

function question_attempt_not_found()
{
    global $CFG;
    header('HTTP/1.0 404 not found');
    print_error('filenotfound', 'error', $CFG->wwwroot);
    //this is not displayed on IIS??
}
开发者ID:nicolasconnault,项目名称:moodle2.0,代码行数:7,代码来源:file.php


示例6: quiz_create_attempt

/**
 * Creates an object to represent a new attempt at a quiz
 *
 * Creates an attempt object to represent an attempt at the quiz by the current
 * user starting at the current time. The ->id field is not set. The object is
 * NOT written to the database.
 *
 * @param object $quiz the quiz to create an attempt for.
 * @param int $attemptnumber the sequence number for the attempt.
 * @param object $lastattempt the previous attempt by this user, if any. Only needed
 *         if $attemptnumber > 1 and $quiz->attemptonlast is true.
 * @param int $timenow the time the attempt was started at.
 * @param bool $ispreview whether this new attempt is a preview.
 *
 * @return object the newly created attempt object.
 */
function quiz_create_attempt($quiz, $attemptnumber, $lastattempt, $timenow, $ispreview = false)
{
    global $USER;
    if ($attemptnumber == 1 || !$quiz->attemptonlast) {
        // We are not building on last attempt so create a new attempt.
        $attempt = new stdClass();
        $attempt->quiz = $quiz->id;
        $attempt->userid = $USER->id;
        $attempt->preview = 0;
        $attempt->layout = quiz_clean_layout($quiz->questions, true);
        if ($quiz->shufflequestions) {
            $attempt->layout = quiz_repaginate($attempt->layout, $quiz->questionsperpage, true);
        }
    } else {
        // Build on last attempt.
        if (empty($lastattempt)) {
            print_error('cannotfindprevattempt', 'quiz');
        }
        $attempt = $lastattempt;
    }
    $attempt->attempt = $attemptnumber;
    $attempt->timestart = $timenow;
    $attempt->timefinish = 0;
    $attempt->timemodified = $timenow;
    // If this is a preview, mark it as such.
    if ($ispreview) {
        $attempt->preview = 1;
    }
    return $attempt;
}
开发者ID:rosenclever,项目名称:moodle,代码行数:46,代码来源:locallib.php


示例7: open

 function open()
 {
     if ($this->_debug) {
         echo "Connecting to host ";
     }
     $host = $this->_hostname;
     $port = $this->_port;
     if ($this->_debug) {
         echo "[{$host}:{$port}]..";
     }
     // open the connection to the FirstClass server
     $conn = fsockopen($host, $port, $errno, $errstr, 5);
     if (!$conn) {
         print_error('auth_fcconnfail', 'auth_fc', '', array($errno, $errstr));
         return false;
     }
     // We are connected
     if ($this->_debug) {
         echo "connected!";
     }
     // Read connection message.
     $line = fgets($conn);
     //+0
     $line = fgets($conn);
     //new line
     // store the connection in this class, so we can use it later
     $this->_conn =& $conn;
     return true;
 }
开发者ID:ajv,项目名称:Offline-Caching,代码行数:29,代码来源:fcFPP.php


示例8: game_millionaire_html_getquestions

/**
 * This page export the game millionaire to html
 * 
 * @author  bdaloukas
 * @version $Id: exporthtml_millionaire.php,v 1.14 2012/07/25 11:16:03 bdaloukas Exp $
 * @package game
 **/
function game_millionaire_html_getquestions($game, $context, &$maxanswers, &$countofquestions, &$retfeedback, $destdir, &$files)
{
    global $CFG, $DB, $USER;
    $maxanswers = 0;
    $countofquestions = 0;
    $files = array();
    if ($game->sourcemodule != 'quiz' and $game->sourcemodule != 'question') {
        print_error(get_string('millionaire_sourcemodule_must_quiz_question', 'game', get_string('modulename', 'quiz')) . ' ' . get_string('modulename', $game->sourcemodule));
    }
    if ($game->sourcemodule == 'quiz') {
        if ($game->quizid == 0) {
            print_error(get_string('must_select_quiz', 'game'));
        }
        $select = "qtype='multichoice' AND quiz='{$game->quizid}' " . " AND qqi.question=q.id";
        $table = "{question} q,{quiz_question_instances} qqi";
    } else {
        if ($game->questioncategoryid == 0) {
            print_error(get_string('must_select_questioncategory', 'game'));
        }
        //include subcategories
        $select = 'category=' . $game->questioncategoryid;
        if ($game->subcategories) {
            $cats = question_categorylist($game->questioncategoryid);
            if (strpos($cats, ',') > 0) {
                $select = 'category in (' . $cats . ')';
            }
        }
        $select .= " AND qtype='multichoice'";
        $table = "{question} q";
    }
    $select .= " AND q.hidden=0";
    $sql = "SELECT q.id as id, q.questiontext FROM {$table} WHERE {$select}";
    $recs = $DB->get_records_sql($sql);
    $ret = '';
    $retfeedback = '';
    foreach ($recs as $rec) {
        $recs2 = $DB->get_records('question_answers', array('question' => $rec->id), 'fraction DESC', 'id,answer,feedback');
        //Must parse the questiontext and get the name of files.
        $line = $rec->questiontext;
        $line = game_export_split_files($game->course, $context, 'questiontext', $rec->id, $rec->questiontext, $destdir, $files);
        $linefeedback = '';
        foreach ($recs2 as $rec2) {
            $line .= '#' . str_replace(array('"', '#'), array("'", ' '), game_export_split_files($game->course, $context, 'answer', $rec2->id, $rec2->answer, $destdir, $files));
            $linefeedback .= '#' . str_replace(array('"', '#'), array("'", ' '), $rec2->feedback);
        }
        if ($ret != '') {
            $ret .= ",\r";
        }
        $ret .= '"' . base64_encode($line) . '"';
        if ($retfeedback != '') {
            $retfeedback .= ",\r";
        }
        $retfeedback .= '"' . base64_encode($linefeedback) . '"';
        if (count($recs2) > $maxanswers) {
            $maxanswers = count($recs2);
        }
        $countofquestions++;
    }
    return $ret;
}
开发者ID:janaece,项目名称:globalclassroom4_clean,代码行数:67,代码来源:exporthtml_millionaire.php


示例9: get_userinfo

 /**
  * Returns the user information for 'external' users. In this case the
  * attributes provided by Shibboleth
  *
  * @return array $result Associative array of user data
  */
 function get_userinfo($username)
 {
     // reads user information from shibboleth attributes and return it in array()
     global $CFG;
     // Check whether we have got all the essential attributes
     if (empty($_SERVER[$this->config->user_attribute])) {
         print_error('shib_not_all_attributes_error', 'auth', '', "'" . $this->config->user_attribute . "' ('" . $_SERVER[$this->config->user_attribute] . "'), '" . $this->config->field_map_firstname . "' ('" . $_SERVER[$this->config->field_map_firstname] . "'), '" . $this->config->field_map_lastname . "' ('" . $_SERVER[$this->config->field_map_lastname] . "') and '" . $this->config->field_map_email . "' ('" . $_SERVER[$this->config->field_map_email] . "')");
     }
     $attrmap = $this->get_attributes();
     $result = array();
     $search_attribs = array();
     foreach ($attrmap as $key => $value) {
         // Check if attribute is present
         if (!isset($_SERVER[$value])) {
             $result[$key] = '';
             continue;
         }
         // Make usename lowercase
         if ($key == 'username') {
             $result[$key] = strtolower($this->get_first_string($_SERVER[$value]));
         } else {
             $result[$key] = $this->get_first_string($_SERVER[$value]);
         }
     }
     // Provide an API to modify the information to fit the Moodle internal
     // data representation
     if ($this->config->convert_data && $this->config->convert_data != '' && is_readable($this->config->convert_data)) {
         // Include a custom file outside the Moodle dir to
         // modify the variable $moodleattributes
         include $this->config->convert_data;
     }
     return $result;
 }
开发者ID:r007,项目名称:PMoodle,代码行数:39,代码来源:auth.php


示例10: execute

 public function execute()
 {
     global $DB;
     $action = $this->arguments[0];
     $modulename = $this->arguments[1];
     // name of the module (in English)
     // Does module exists?
     if (!empty($modulename)) {
         if (!($module = $DB->get_record('modules', array('name' => $modulename)))) {
             print_error('moduledoesnotexist', 'error');
         }
     }
     switch ($action) {
         case 'show':
             $DB->set_field('modules', 'visible', '1', array('id' => $module->id));
             // Show module.
             break;
         case 'hide':
             $DB->set_field('modules', 'visible', '0', array('id' => $module->id));
             // Hide module.
             break;
         case 'delete':
             // Delete module from DB. Should we also delete it from disk?
             if ($this->expandedOptions['force']) {
                 // Delete module from disk too!
             }
             break;
     }
 }
开发者ID:dariogs,项目名称:moosh,代码行数:29,代码来源:ModuleManage.php


示例11: resource_base

 /**
  * Constructor for the base resource class
  *
  * Constructor for the base resource class.
  * If cmid is set create the cm, course, resource objects.
  * and do some checks to make sure people can be here, and so on.
  *
  * @param cmid   integer, the current course module id - not set for new resources
  */
 function resource_base($cmid = 0)
 {
     global $CFG, $COURSE, $DB;
     $this->navlinks = array();
     if ($cmid) {
         if (!($this->cm = get_coursemodule_from_id('resource', $cmid))) {
             print_error('invalidcoursemodule');
         }
         if (!($this->course = $DB->get_record("course", array("id" => $this->cm->course)))) {
             print_error('coursemisconf');
         }
         if (!($this->resource = $DB->get_record("resource", array("id" => $this->cm->instance)))) {
             print_error('invalidid', 'resource');
         }
         $this->strresource = get_string("modulename", "resource");
         $this->strresources = get_string("modulenameplural", "resource");
         if (!$this->cm->visible and !has_capability('moodle/course:viewhiddenactivities', get_context_instance(CONTEXT_MODULE, $this->cm->id))) {
             $pagetitle = strip_tags($this->course->shortname . ': ' . $this->strresource);
             $navigation = build_navigation($this->navlinks, $this->cm);
             print_header($pagetitle, $this->course->fullname, $navigation, "", "", true, '', navmenu($this->course, $this->cm));
             notice(get_string("activityiscurrentlyhidden"), "{$CFG->wwwroot}/course/view.php?id={$this->course->id}");
         }
     } else {
         $this->course = $COURSE;
     }
 }
开发者ID:nicolasconnault,项目名称:moodle2.0,代码行数:35,代码来源:lib.php


示例12: load_options

 /**
  * Loads the $options array into class properties
  * Possible options (these options are in addition to the standard autocomplete options
  *
  * contextlevel               The ELIS context level to search.possible values: 1001-1006
  *
  * instance fields            A list of fields from the instance table to search on. This should be an array like
  *                            (fieldname => label). For example array('idnumber'=>'IDNumber','firstname'=>'First Name')
  *
  * forced_custom_field_vals   An array like field_shortname => value that can be used to restrict results to
  *                            ones that have specific values for specific custom fields. Note that any fields
  *                            you enter here MUST be valid fields for the specified context level, and must be
  *                            included in the 'custom_fields' option (or have the 'custom_fields' set to '*')
  *
  * custom_fields              A list of the shortnames of custom fields to allow for searching. Note that this is NOT
  *                            the fields which will end up being searched/displayed - but those available for searching.
  *                            The actual list of fields to search/display is configured by an administration using
  *                            the configuration interface.
  *                            This can be an array of field shortnames, or '*' for all applicable fields.
  *
  * @param  array  $options   The options array passed into the class
  */
 public function load_options($options)
 {
     global $CFG, $DB;
     //instance fields - fields to search from the instance's table
     if (!isset($options['instance_fields'])) {
         print_error('autocomplete_noinstance', 'local_elisprogram');
     }
     $this->instance_fields = $options['instance_fields'];
     //get instance contextid
     if (!isset($options['contextlevel']) || !isset($this->context_level_map[$options['contextlevel']])) {
         print_error('autocomplete_nocontext', 'local_elisprogram');
     }
     $this->instancetable = $this->tablemap[$this->context_level_map[$options['contextlevel']]];
     $this->contextlevel = $options['contextlevel'];
     if (!empty($options['forced_custom_field_vals']) && is_array($options['forced_custom_field_vals'])) {
         $this->forced_custom_vals = $options['forced_custom_field_vals'];
     }
     //fetch info for custom fields
     if (!empty($options['custom_fields']) && (is_array($options['custom_fields']) || $options['custom_fields'] === '*')) {
         $sql = 'SELECT f.id, f.name, f.shortname, f.datatype ' . 'FROM {local_eliscore_field} f' . ' JOIN {local_eliscore_field_clevels} c ON c.fieldid=f.id' . ' WHERE (f.datatype="char" OR f.datatype="text") AND c.contextlevel=' . $options['contextlevel'];
         if (is_array($options['custom_fields'])) {
             $ids = implode('","', $options['custom_fields']);
             $sql .= ' AND f.shortname IN ("' . $ids . '")';
         }
         $custom_fields = $DB->get_records_sql($sql);
         if (is_array($custom_fields)) {
             foreach ($custom_fields as $field) {
                 $field_info = array('fieldid' => $field->id, 'label' => $field->name, 'shortname' => $field->shortname, 'datatype' => $field->datatype);
                 $this->custom_fields[$field->shortname] = $field_info;
             }
         }
     }
 }
开发者ID:jamesmcq,项目名称:elis,代码行数:55,代码来源:autocomplete_eliswithcustomfields.php


示例13: cegep_sisdb_init

function cegep_sisdb_init()
{
    global $CFG, $enroldb, $sisdb, $sisdbsource;
    // Verify if external database enrolment is enabled
    if (!in_array('database', explode(',', $CFG->enrol_plugins_enabled))) {
        print_error('errorenroldbnotavailable', 'block_cegep');
    }
    // Prepare external enrolment database connection
    if ($enroldb = enroldb_connect()) {
        $enroldb->Execute("SET NAMES 'utf8'");
    } else {
        error_log('[ENROL_DB] Could not make a connection');
        print_error('dbconnectionfailed', 'error');
    }
    // Prepare external SIS database connection
    if ($sisdb = sisdb_connect()) {
        $sisdb->Execute("SET NAMES 'utf8'");
    } else {
        error_log('[SIS_DB] Could not make a connection');
        print_error('dbconnectionfailed', 'error');
    }
    // Prepare external SIS source database connection
    if ($sisdbsource = sisdbsource_connect()) {
        //$sisdbsource->Execute("SET NAMES 'utf8'");
    } else {
        error_log('[SIS_DB_SOURCE] Could not make a connection');
        print_error('dbconnectionfailed', 'error');
    }
}
开发者ID:jcharaoui,项目名称:moodle-cegep,代码行数:29,代码来源:lib.php


示例14: organizer_make_infobox

function organizer_make_infobox($params, $organizer, $context, &$popups)
{
    global $PAGE;
    user_preference_allow_ajax_update('mod_organizer_showpasttimeslots', PARAM_BOOL);
    user_preference_allow_ajax_update('mod_organizer_showmyslotsonly', PARAM_BOOL);
    user_preference_allow_ajax_update('mod_organizer_showfreeslotsonly', PARAM_BOOL);
    $PAGE->requires->js_init_call('M.mod_organizer.init_infobox');
    $output = '';
    if ($organizer->alwaysshowdescription || time() > $organizer->allowregistrationsfromdate) {
        $output = organizer_make_description_section($organizer);
    }
    switch ($params['mode']) {
        case ORGANIZER_TAB_APPOINTMENTS_VIEW:
            break;
        case ORGANIZER_TAB_STUDENT_VIEW:
            $output .= organizer_make_myapp_section($params, $organizer, organizer_get_last_user_appointment($organizer), $popups);
            break;
        case ORGANIZER_TAB_REGISTRATION_STATUS_VIEW:
            $output .= organizer_make_reminder_section($params, $context);
            break;
        default:
            print_error("Wrong view mode: {$params['mode']}");
    }
    $output .= organizer_make_slotoptions_section($params);
    $output .= organizer_make_messages_section($params);
    return $output;
}
开发者ID:nmisic,项目名称:moodle-mod_organizer,代码行数:27,代码来源:infobox.php


示例15: execute_query

 public function execute_query($sql, $cursortype = SQLSRV_CURSOR_FORWARD)
 {
     $sqldirective = strtoupper(substr($sql, 0, strpos($sql, ' ')));
     switch ($sqldirective) {
         case 'SELECT':
             $type = SQL_QUERY_SELECT;
             break;
         case 'INSERT':
             $type = SQL_QUERY_INSERT;
             break;
         case 'UPDATE':
             $type = SQL_QUERY_UPDATE;
             break;
         case 'DELETE':
             $type = SQL_QUERY_UPDATE;
             break;
         default:
             print_error('unknownsqldirective', 'block_vmoodle');
             return false;
     }
     $this->query_start($sql, null, $type);
     $result = sqlsrv_query($this->sqlsrv, $sql, null, array('Scrollable' => $cursortype));
     $this->query_end($result);
     return $result;
 }
开发者ID:OctaveBabel,项目名称:moodle-itop,代码行数:25,代码来源:sqlsrv_itop_moodle_database.php


示例16: game_importsnakes_do

function game_importsnakes_do($newrec)
{
    global $DB;
    if (!$DB->insert_record('game_snakes_database', $newrec)) {
        print_error("Can't insert to table game_snakes_database");
    }
}
开发者ID:antoniorodrigues,项目名称:redes-digitais,代码行数:7,代码来源:importsnakes.php


示例17: ldap_init

function ldap_init()
{
    global $ds, $config;
    if (!is_resource($ds)) {
        print_debug("LDAP[Connecting to " . implode(",", $config['auth_ldap_server']) . "]");
        $ds = @ldap_connect(implode(",", $config['auth_ldap_server']), $config['auth_ldap_port']);
        print_debug("LDAP[Connected]");
        if ($config['auth_ldap_starttls'] && ($config['auth_ldap_starttls'] == 'optional' || $config['auth_ldap_starttls'] == 'require')) {
            $tls = ldap_start_tls($ds);
            if ($config['auth_ldap_starttls'] == 'require' && $tls == FALSE) {
                session_logout();
                print_error("Fatal error: LDAP TLS required but not successfully negotiated [" . ldap_error($ds) . "]");
                exit;
            }
        }
        if ($config['auth_ldap_referrals']) {
            ldap_set_option($ds, LDAP_OPT_REFERRALS, $config['auth_ldap_referrals']);
            print_debug("LDAP[Referrals][Set to " . $config['auth_ldap_referrals'] . "]");
        } else {
            ldap_set_option($ds, LDAP_OPT_REFERRALS, FALSE);
            print_debug("LDAP[Referrals][Disabled]");
        }
        if ($config['auth_ldap_version']) {
            ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, $config['auth_ldap_version']);
            print_debug("LDAP[Version][Set to " . $config['auth_ldap_version'] . "]");
        }
    }
}
开发者ID:skive,项目名称:observium,代码行数:28,代码来源:ldap.inc.php


示例18: makeMailText

 /**
  * Builds and returns the body of the email notification in plain text.
  *
  * @param object $post
  * @param object $userto
  * @return string The email body in plain text format.
  */
 public function makeMailText($post, $userto)
 {
     global $CFG, $cm;
     $praxe = praxe_record::getData();
     if (!isset($userto->viewfullnames[$praxe->id])) {
         if (!($cm = get_coursemodule_from_instance('praxe', $praxe->id, $this->course->id))) {
             print_error('Course Module ID was incorrect');
         }
         $modcontext = context_module::instance($cm->id);
         $viewfullnames = has_capability('moodle/site:viewfullnames', $modcontext, $userto->id);
     } else {
         $viewfullnames = $userto->viewfullnames[$praxe->id];
     }
     //$by = New stdClass;
     //$by->name = fullname($userfrom, $viewfullnames);
     //$by->date = userdate($post->modified, "", $userto->timezone);
     //$strbynameondate = get_string('bynameondate', 'forum', $by);
     $strpraxes = get_string('modulenameplural', 'praxe');
     $posttext = '';
     $posttext = $this->course->shortname . " -> " . $strpraxes . " -> " . format_string($praxe->name, true);
     $posttext .= "\n---------------------------------------------------------------------\n";
     $posttext .= format_string($this->subject, true);
     //$posttext .= "\n".$strbynameondate."\n";
     $posttext .= "\n---------------------------------------------------------------------\n";
     $posttext .= format_text_email(trusttext_strip($post), FORMAT_PLAIN);
     $posttext .= "\n\n---------------------------------------------------------------------\n";
     $site = get_site();
     foreach ($this->linkstofoot as $link) {
         $posttext .= $link->text . ": " . $link->link . "\t";
         //$posttext .= get_string('confirmorrefusestudent','praxe').": ".$CFG->wwwroot.'/course/view.php?id='.$cm->id."\n\n";
     }
     $posttext .= "\n\n" . $site->shortname . ": " . $CFG->wwwroot . "\n";
     return $posttext;
 }
开发者ID:jerab,项目名称:moodle-mod-praxe,代码行数:41,代码来源:mailing.php


示例19: get_jumptooptions

 public static function get_jumptooptions($firstpage, lesson $lesson)
 {
     global $DB, $PAGE;
     $jump = array();
     $jump[0] = get_string("thispage", "lesson");
     $jump[LESSON_NEXTPAGE] = get_string("nextpage", "lesson");
     $jump[LESSON_PREVIOUSPAGE] = get_string("previouspage", "lesson");
     $jump[LESSON_EOL] = get_string("endoflesson", "lesson");
     $jump[LESSON_UNSEENBRANCHPAGE] = get_string("unseenpageinbranch", "lesson");
     $jump[LESSON_RANDOMPAGE] = get_string("randompageinbranch", "lesson");
     $jump[LESSON_RANDOMBRANCH] = get_string("randombranch", "lesson");
     if (!$firstpage) {
         if (!($apageid = $DB->get_field("lesson_pages", "id", array("lessonid" => $lesson->id, "prevpageid" => 0)))) {
             print_error('cannotfindfirstpage', 'lesson');
         }
         while (true) {
             if ($apageid) {
                 $title = $DB->get_field("lesson_pages", "title", array("id" => $apageid));
                 $jump[$apageid] = $title;
                 $apageid = $DB->get_field("lesson_pages", "nextpageid", array("id" => $apageid));
             } else {
                 // last page reached
                 break;
             }
         }
     }
     return $jump;
 }
开发者ID:saurabh947,项目名称:MoodleLearning,代码行数:28,代码来源:branchtable.php


示例20: expand_blocks

 function expand_blocks($tag)
 {
     // get block $names
     //  [1] the full block name (including optional leading 'str' or 'incl')
     //  [2] leading 'incl' or 'str', if any
     //  [3] the real block name ([1] without [2])
     $search = '/\\[\\/((incl|str)?((?:\\w|\\.)+))\\]/';
     preg_match_all($search, $this->{$tag}, $names);
     $i_max = count($names[0]);
     for ($i = 0; $i < $i_max; $i++) {
         $method = $this->parent->template_dir . '_expand_' . str_replace('.', '', $names[3][$i]);
         if (method_exists($this, $method)) {
             eval('$value=$this->' . $method . '();');
             $search = '/\\[' . $names[1][$i] . '\\](.*?)\\[\\/' . $names[1][$i] . '\\]/s';
             preg_match_all($search, $this->{$tag}, $blocks);
             $ii_max = count($blocks[0]);
             for ($ii = 0; $ii < $ii_max; $ii++) {
                 $replace = empty($value) ? '' : $blocks[1][$ii];
                 $this->{$tag} = str_replace($blocks[0][$ii], $replace, $this->{$tag});
             }
         } else {
             print_error('cannotfindmethod', 'hotpot', $this->parent->course_homeurl, $method);
         }
     }
 }
开发者ID:nicolasconnault,项目名称:moodle2.0,代码行数:25,代码来源:default.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP print_error_box函数代码示例发布时间:2022-05-15
下一篇:
PHP print_enum_string_option_list函数代码示例发布时间: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