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

PHP userdate函数代码示例

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

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



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

示例1: test_postdate

 /**
  * Test for the forum email renderable postdate.
  *
  * @dataProvider postdate_provider
  *
  * @param array  $globalconfig      The configuration to set on $CFG
  * @param array  $forumconfig       The configuration for this forum
  * @param array  $postconfig        The configuration for this post
  * @param array  $discussionconfig  The configuration for this discussion
  * @param string $expectation       The expected date
  */
 public function test_postdate($globalconfig, $forumconfig, $postconfig, $discussionconfig, $expectation)
 {
     global $CFG, $DB;
     $this->resetAfterTest(true);
     // Apply the global configuration.
     foreach ($globalconfig as $key => $value) {
         $CFG->{$key} = $value;
     }
     // Create the fixture.
     $user = $this->getDataGenerator()->create_user();
     $course = $this->getDataGenerator()->create_course();
     $forum = $this->getDataGenerator()->create_module('forum', (object) array('course' => $course->id));
     $cm = get_coursemodule_from_instance('forum', $forum->id, $course->id, false, MUST_EXIST);
     $this->getDataGenerator()->enrol_user($user->id, $course->id);
     // Create a new discussion.
     $discussion = $this->getDataGenerator()->get_plugin_generator('mod_forum')->create_discussion((object) array_merge($discussionconfig, array('course' => $course->id, 'forum' => $forum->id, 'userid' => $user->id)));
     // Apply the discussion configuration.
     // Some settings are ignored by the generator and must be set manually.
     $discussion = $DB->get_record('forum_discussions', array('id' => $discussion->id));
     foreach ($discussionconfig as $key => $value) {
         $discussion->{$key} = $value;
     }
     $DB->update_record('forum_discussions', $discussion);
     // Apply the post configuration.
     // Some settings are ignored by the generator and must be set manually.
     $post = $DB->get_record('forum_posts', array('discussion' => $discussion->id));
     foreach ($postconfig as $key => $value) {
         $post->{$key} = $value;
     }
     $DB->update_record('forum_posts', $post);
     // Create the renderable.
     $renderable = new mod_forum\output\forum_post_email($course, $cm, $forum, $discussion, $post, $user, $user, true);
     // Check the postdate matches our expectations.
     $this->assertEquals(userdate($expectation, "", \core_date::get_user_timezone($user)), $renderable->get_postdate());
 }
开发者ID:evltuma,项目名称:moodle,代码行数:46,代码来源:output_email_test.php


示例2: get_comments

 /**
  * Return comments by pages
  * @param int $page
  * @return mixed
  */
 function get_comments($page)
 {
     global $DB, $CFG, $USER;
     $params = array();
     if ($page == 0) {
         $start = 0;
     } else {
         $start = $page * $this->perpage;
     }
     $sql = "SELECT c.id, c.contextid, c.itemid, c.commentarea, c.userid, c.content, u.firstname, u.lastname, c.timecreated\n            FROM {comments} c, {user} u\n            WHERE u.id=c.userid ORDER BY c.timecreated ASC";
     $comments = array();
     $formatoptions = array('overflowdiv' => true);
     if ($records = $DB->get_records_sql($sql, array(), $start, $this->perpage)) {
         foreach ($records as $item) {
             $item->fullname = fullname($item);
             $item->time = userdate($item->timecreated);
             $item->content = format_text($item->content, FORMAT_MOODLE, $formatoptions);
             $comments[] = $item;
             unset($item->firstname);
             unset($item->lastname);
             unset($item->timecreated);
         }
     }
     return $comments;
 }
开发者ID:vuchannguyen,项目名称:web,代码行数:30,代码来源:locallib.php


示例3: readquestions

 protected function readquestions($lines)
 {
     // For this class the method has been simplified as
     // there can never be more than one question for a
     // multianswer import
     $questions = array();
     $questiontext = array();
     $questiontext['text'] = implode('', $lines);
     $questiontext['format'] = 0;
     $questiontext['itemid'] = '';
     $question = qtype_multianswer_extract_question($questiontext);
     $question->questiontext = $question->questiontext['text'];
     $question->questiontextformat = 0;
     $question->qtype = MULTIANSWER;
     $question->generalfeedback = '';
     $question->course = $this->course;
     if (!empty($question)) {
         $name = html_to_text(implode(' ', $lines));
         $name = preg_replace('/{[^}]*}/', '', $name);
         $name = trim($name);
         if ($name) {
             $question->name = shorten_text($name, 45);
         } else {
             // We need some name, so use the current time, since that will be
             // reasonably unique.
             $question->name = userdate(time());
         }
         $questions[] = $question;
     }
     return $questions;
 }
开发者ID:sebastiansanio,项目名称:tallerdeprogramacion2fiuba,代码行数:31,代码来源:format.php


示例4: block_exabis_eportfolio_print_extcomments

function block_exabis_eportfolio_print_extcomments($itemid)
{
    $stredit = get_string('edit');
    $strdelete = get_string('delete');
    $comments = get_records("block_exabeporitemcomm", "itemid", $itemid, 'timemodified DESC');
    if (!$comments) {
        return;
    }
    foreach ($comments as $comment) {
        $user = get_record('user', 'id', $comment->userid);
        echo '<table cellspacing="0" class="forumpost blogpost blog" width="100%">';
        echo '<tr class="header"><td class="picture left">';
        print_user_picture($comment->userid, SITEID, $user->picture);
        echo '</td>';
        echo '<td class="topic starter"><div class="author">';
        $fullname = fullname($user, $comment->userid);
        $by = new object();
        $by->name = $fullname;
        $by->date = userdate($comment->timemodified);
        print_string('bynameondate', 'forum', $by);
        echo '</div></td></tr>';
        echo '<tr><td class="left side">';
        echo '</td><td class="content">' . "\n";
        echo format_text($comment->entry);
        echo '</td></tr></table>' . "\n\n";
    }
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:27,代码来源:externlib.php


示例5: definition

 public function definition()
 {
     global $CFG, $USER;
     $mform =& $this->_form;
     $course = $this->_customdata['course'];
     $cm = $this->_customdata['cm'];
     $modcontext = $this->_customdata['modcontext'];
     $attforsession = $this->_customdata['session'];
     $attblock = $this->_customdata['attendance'];
     $statuses = $attblock->get_statuses();
     $mform->addElement('hidden', 'sessid', null);
     $mform->setType('sessid', PARAM_INT);
     $mform->setConstant('sessid', $attforsession->id);
     $mform->addElement('hidden', 'sesskey', null);
     $mform->setType('sesskey', PARAM_INT);
     $mform->setConstant('sesskey', sesskey());
     // Set a title as the date and time of the session.
     $sesstiontitle = userdate($attforsession->sessdate, get_string('strftimedate')) . ' ' . userdate($attforsession->sessdate, get_string('strftimehm', 'mod_attendance'));
     $mform->addElement('header', 'session', $sesstiontitle);
     // If a session description is set display it.
     if (!empty($attforsession->description)) {
         $mform->addElement('html', $attforsession->description);
     }
     // Create radio buttons for setting the attendance status.
     $radioarray = array();
     foreach ($statuses as $status) {
         $radioarray[] =& $mform->createElement('radio', 'status', '', $status->description, $status->id, array());
     }
     // Add the radio buttons as a control with the user's name in front.
     $mform->addGroup($radioarray, 'statusarray', $USER->firstname . ' ' . $USER->lastname . ':', array(''), false);
     $mform->addRule('statusarray', get_string('attendancenotset', 'attendance'), 'required', '', 'client', false, false);
     $this->add_action_buttons();
 }
开发者ID:webcursosuai,项目名称:moodle-mod_attendance,代码行数:33,代码来源:student_attenance_form.php


示例6: _createElements

 function _createElements()
 {
     $this->_elements = array();
     for ($i = 1; $i <= 31; $i++) {
         $days[$i] = $i;
     }
     for ($i = 1; $i <= 12; $i++) {
         $months[$i] = userdate(gmmktime(12, 0, 0, $i, 15, 2000), "%B");
     }
     for ($i = $this->_options['startyear']; $i <= $this->_options['stopyear']; $i++) {
         $years[$i] = $i;
     }
     $this->_elements[] =& MoodleQuickForm::createElement('select', 'day', get_string('day', 'form'), $days, $this->getAttributes(), true);
     $this->_elements[] =& MoodleQuickForm::createElement('select', 'month', get_string('month', 'form'), $months, $this->getAttributes(), true);
     $this->_elements[] =& MoodleQuickForm::createElement('select', 'year', get_string('year', 'form'), $years, $this->getAttributes(), true);
     // If optional we add a checkbox which the user can use to turn if on
     if ($this->_options['optional']) {
         $this->_elements[] =& MoodleQuickForm::createElement('checkbox', 'off', null, get_string('disable'), $this->getAttributes(), true);
     }
     foreach ($this->_elements as $element) {
         if (method_exists($element, 'setHiddenLabel')) {
             $element->setHiddenLabel(true);
         }
     }
 }
开发者ID:JackCanada,项目名称:moodle-hacks,代码行数:25,代码来源:dateselector.php


示例7: execute

 function execute($data, $row, $user, $courseid, $starttime = 0, $endtime = 0)
 {
     global $DB, $CFG;
     if ($cm = $DB->get_record('course_modules', array('id' => $data->cmid))) {
         $mod = $DB->get_record('modules', array('id' => $cm->module));
         if ($instance = $DB->get_record("{$mod->name}", array('id' => $cm->instance))) {
             $libfile = "{$CFG->dirroot}/mod/{$mod->name}/lib.php";
             if (file_exists($libfile)) {
                 require_once $libfile;
                 $user_outline = $mod->name . "_user_outline";
                 if (function_exists($user_outline)) {
                     if ($course = $DB->get_record('course', array('id' => $this->report->courseid))) {
                         $result = $user_outline($course, $row, $mod, $instance);
                         if ($result) {
                             $returndata = '';
                             if (isset($result->info)) {
                                 $returndata .= $result->info . ' ';
                             }
                             if ((!isset($data->donotshowtime) || !$data->donotshowtime) && !empty($result->time)) {
                                 $returndata .= userdate($result->time);
                             }
                             return $returndata;
                         }
                     }
                 }
             }
         }
     }
     return '';
 }
开发者ID:saurabh947,项目名称:MoodleLearning,代码行数:30,代码来源:plugin.class.php


示例8: get_cells

    public function get_cells() {
        $this->init_cells();
        foreach ($this->reportdata->sessions as $sess) {
            if (array_key_exists($sess->id, $this->reportdata->sessionslog[$this->user->id])) {
                $statusid = $this->reportdata->sessionslog[$this->user->id][$sess->id]->statusid;
                if (array_key_exists($statusid, $this->reportdata->statuses)) {
                    $this->construct_existing_status_cell($this->reportdata->statuses[$statusid]->acronym);
                } else {
                    $this->construct_hidden_status_cell($this->reportdata->allstatuses[$statusid]->acronym);
                }
            } else {
                if ($this->user->enrolmentstart > $sess->sessdate) {
                    $starttext = get_string('enrolmentstart', 'local_attendance', userdate($this->user->enrolmentstart, '%d.%m.%Y'));
                    $this->construct_enrolments_info_cell($starttext);
                } else if ($this->user->enrolmentend and $this->user->enrolmentend < $sess->sessdate) {
                    $endtext = get_string('enrolmentend', 'local_attendance', userdate($this->user->enrolmentend, '%d.%m.%Y'));
                    $this->construct_enrolments_info_cell($endtext);
                } else if (!$this->user->enrolmentend and $this->user->enrolmentstatus == ENROL_USER_SUSPENDED) {
                    // No enrolmentend and ENROL_USER_SUSPENDED.
                    $suspendext = get_string('enrolmentsuspended', 'local_attendance', userdate($this->user->enrolmentend, '%d.%m.%Y'));
                    $this->construct_enrolments_info_cell($suspendext);
                } else {
                    if ($sess->groupid == 0 or array_key_exists($sess->groupid, $this->reportdata->usersgroups[$this->user->id])) {
                        $this->construct_not_taken_cell('?');
                    } else {
                        $this->construct_not_existing_for_user_session_cell('');
                    }
                }
            }
        }
        $this->finalize_cells();

        return $this->cells;
    }
开发者ID:anilch,项目名称:Personel,代码行数:34,代码来源:renderhelpers.php


示例9: definition

 public function definition()
 {
     $mform =& $this->_form;
     $mform->addElement('header', 'addactivity', get_string('addactivity', 'report_cpd'));
     $mform->addElement('hidden', 'cpdyearid', $this->_customdata['cpdyearid']);
     $mform->addElement('hidden', 'process', '1');
     if ($this->_customdata['cpdid']) {
         // This updates a CPD Report
         $mform->addElement('hidden', 'id', $this->_customdata['cpdid']);
     }
     $mform->addElement('textarea', 'objective', get_string('objective', 'report_cpd'), array('rows' => '2', 'cols' => '40'));
     $mform->addElement('textarea', 'development_need', get_string('developmentneed', 'report_cpd'), array('rows' => '2', 'cols' => '40'));
     if ($this->_customdata['activity_types']) {
         $mform->addElement('select', 'activitytypeid', get_string('activitytype', 'report_cpd'), $this->_customdata['activity_types']);
     }
     $mform->addElement('textarea', 'activity', get_string('activityplanned', 'report_cpd'), array('rows' => '2', 'cols' => '40'));
     // Get CPD start and end years
     $startyear = date('Y') - 5;
     $endyear = date('Y') + 5;
     if ($this->_customdata['cpdyear']) {
         $startyear = date('Y', $this->_customdata['cpdyear']->startdate);
         $endyear = date('Y', $this->_customdata['cpdyear']->enddate);
     }
     for ($i = 1; $i <= 31; $i++) {
         $days[$i] = $i;
     }
     for ($i = 1; $i <= 12; $i++) {
         $months[$i] = userdate(gmmktime(12, 0, 0, $i, 15, 2000), "%B");
     }
     for ($i = $startyear; $i <= $endyear; $i++) {
         $years[$i] = $i;
     }
     $startdate[] = $mform->createElement('select', 'startdate[d]', '', $days);
     $startdate[] = $mform->createElement('select', 'startdate[m]', '', $months);
     $startdate[] = $mform->createElement('select', 'startdate[Y]', '', $years);
     $mform->addGroup($startdate, 'startdate', get_string('datestart', 'report_cpd'), array(' '), false);
     $duedate[] = $mform->createElement('select', 'duedate[d]', '', $days);
     $duedate[] = $mform->createElement('select', 'duedate[m]', '', $months);
     $duedate[] = $mform->createElement('select', 'duedate[Y]', '', $years);
     $mform->addGroup($duedate, 'duedate', get_string('dateend', 'report_cpd'), array(' '), false);
     if ($this->_customdata['statuses']) {
         $mform->addElement('select', 'statusid', get_string('status', 'report_cpd'), $this->_customdata['statuses']);
     }
     $hours = null;
     $minutes = null;
     for ($i = 1; $i <= 20; $i++) {
         $hours[$i] = $i;
     }
     for ($i = 15; $i <= 45; $i += 15) {
         $minutes[$i] = $i;
     }
     $timetaken[] = $mform->createElement('select', 'timetaken[hours]', '', array('' => '--') + $hours);
     $timetaken[] = $mform->createElement('select', 'timetaken[minutes]', '', array('' => '--') + $minutes);
     $mform->addGroup($timetaken, 'timetaken', get_string('timetaken', 'report_cpd'), ':', false);
     $buttonarray[] = $mform->createElement('submit', 'submitbutton', get_string('update'));
     $buttonarray[] = $mform->createElement('reset', '', get_string('clear', 'report_cpd'));
     $mform->addGroup($buttonarray, 'buttonar', '', array(' '), false);
     $mform->closeHeaderBefore('buttonar');
     //$mform->addRule('objective', 'Please enter an objective.', 'required', null, 'client');
 }
开发者ID:rtsfc,项目名称:moodle-report_cpd,代码行数:60,代码来源:edit_activity_form.php


示例10: get_comments

 /**
  * Return comments by pages
  *
  * @global moodle_database $DB
  * @param int $page
  * @return array An array of comments
  */
 function get_comments($page)
 {
     global $DB;
     if ($page == 0) {
         $start = 0;
     } else {
         $start = $page * $this->perpage;
     }
     $comments = array();
     $sql = "SELECT c.id, c.contextid, c.itemid, c.commentarea, c.userid, c.content, u.firstname, u.lastname, c.timecreated\n                  FROM {comments} c\n                  JOIN {user} u\n                       ON u.id=c.userid\n              ORDER BY c.timecreated ASC";
     $rs = $DB->get_recordset_sql($sql, null, $start, $this->perpage);
     $formatoptions = array('overflowdiv' => true);
     foreach ($rs as $item) {
         // Set calculated fields
         $item->fullname = fullname($item);
         $item->time = userdate($item->timecreated);
         $item->content = format_text($item->content, FORMAT_MOODLE, $formatoptions);
         // Unset fields not related to the comment
         unset($item->firstname);
         unset($item->lastname);
         unset($item->timecreated);
         // Record the comment
         $comments[] = $item;
     }
     $rs->close();
     return $comments;
 }
开发者ID:nmicha,项目名称:moodle,代码行数:34,代码来源:locallib.php


示例11: display_browse_field

 function display_browse_field($recordid, $template)
 {
     global $CFG;
     if ($content = get_field('data_content', 'content', 'fieldid', $this->field->id, 'recordid', $recordid)) {
         return userdate($content, get_string('strftimedate'), 0);
     }
 }
开发者ID:veritech,项目名称:pare-project,代码行数:7,代码来源:field.class.php


示例12: block_campusclash_print_page

function block_campusclash_print_page($campusclash, $return = false)
{
    //Add Page Title
    global $OUTPUT, $COURSE;
    $display = $OUTPUT->heading($campusclash->pagetitle);
    //Open a box
    $display .= $OUTPUT->box_start();
    //Display the Date
    if ($campusclash->displaydate) {
        $display .= html_writer::start_tag('div', array('class' => 'displaydate'));
        $display .= userdate($campusclash->displaydate);
        $display .= html_writer::end_tag('div');
    }
    //Display Text
    $display .= clean_text($campusclash->displaytext);
    //close the box
    $display .= $OUTPUT->box_end();
    //Display the Picture
    if ($campusclash->displaypicture) {
        $display .= $OUTPUT->box_start();
        $images = block_campusclash_images();
        $display .= $images[$campusclash->picture];
        $display .= html_writer::start_tag('p');
        $display .= clean_text($campusclash->description);
        $display .= html_writer::end_tag('p');
        $display .= $OUTPUT->box_end();
    }
    //Check to ensure that it was set before trying to output it
    if ($return) {
        return $display;
    } else {
        echo $display;
    }
}
开发者ID:jpablonc94,项目名称:campusclashGithub,代码行数:34,代码来源:lib.php


示例13: col_timecreated

 /**
  * This function is called for each data row to allow processing of the
  * username value.
  *
  * @param object $values Contains object with all the values of record.
  * @return $string Return username with link to profile or username only
  *     when downloading.
  */
 function col_timecreated($values)
 {
     if ($values->timecreated > 0) {
         return userdate($values->timecreated);
     }
     return '';
 }
开发者ID:375michael40veit,项目名称:moodle-mod_booking,代码行数:15,代码来源:unbooked_users.php


示例14: glossary_show_entry_faq

function glossary_show_entry_faq($course, $cm, $glossary, $entry, $mode = "", $hook = "", $printicons = 1, $aliases = true)
{
    global $USER;
    if ($entry) {
        echo '<table class="glossarypost faq" cellspacing="0">';
        echo '<tr valign="top">';
        echo '<th class="entryheader">';
        $entry->course = $course->id;
        echo '<div class="concept">' . get_string('question', 'glossary') . ': ';
        glossary_print_entry_concept($entry);
        echo '</div>';
        echo '<span class="time">(' . get_string('lastedited') . ': ' . userdate($entry->timemodified) . ')</span>';
        echo '</th>';
        echo '<td class="entryattachment">';
        glossary_print_entry_approval($cm, $entry, $mode);
        echo '</td>';
        echo '</tr>';
        echo "\n<tr>";
        echo '<td colspan="2" class="entry">';
        echo '<b>' . get_string('answer', 'glossary') . ':</b> ';
        glossary_print_entry_definition($entry, $glossary, $cm);
        glossary_print_entry_attachment($entry, $cm, 'html');
        echo '</td></tr>';
        echo '<tr valign="top"><td colspan="3" class="entrylowersection">';
        glossary_print_entry_lower_section($course, $cm, $glossary, $entry, $mode, $hook, $printicons, $aliases);
        echo '</td></tr></table>';
    } else {
        echo '<div style="text-align:center">';
        print_string('noentry', 'glossary');
        echo '</div>';
    }
}
开发者ID:evltuma,项目名称:moodle,代码行数:32,代码来源:faq_format.php


示例15: definition

 public function definition()
 {
     global $CFG, $OUTPUT, $DB, $USER;
     $publication =& $this->_customdata['publication'];
     $this->instance = $publication->get_instance();
     $userids =& $this->_customdata['userids'];
     $mform = $this->_form;
     if ($publication->get_instance()->allowsubmissionsfromdate) {
         $mform->addElement('static', 'fromdate', get_string('allowsubmissionsfromdate', 'publication'), userdate($publication->get_instance()->allowsubmissionsfromdate));
     }
     if ($publication->get_instance()->duedate) {
         $mform->addElement('static', 'duedate', get_string('duedate', 'publication'), userdate($publication->get_instance()->duedate));
         $finaldate = $publication->get_instance()->duedate;
     }
     $mform->addElement('date_time_selector', 'extensionduedate', get_string('extensionduedate', 'publication'), array('optional' => true));
     $mform->setDefault('extensionduedate', $finaldate);
     if (count($userids) == 1) {
         $extensionduedate = $publication->user_extensionduedate($userids[0]);
         if ($extensionduedate) {
             $mform->setDefault('extensionduedate', $extensionduedate);
         }
     }
     $mform->addElement('hidden', 'id', $publication->get_coursemodule()->id);
     $mform->setType('id', PARAM_INT);
     foreach ($userids as $idx => $userid) {
         $mform->addElement('hidden', 'userids[' . $idx . ']', $userid);
         $mform->setType('userids[' . $idx . ']', PARAM_INT);
     }
     $this->add_action_buttons(true, get_string('save_changes', 'publication'));
 }
开发者ID:Kathrin84,项目名称:moodle-mod_publication,代码行数:30,代码来源:mod_publication_grantextension_form.php


示例16: definition

 /**
  * Defines the elements of the form used to mark a quiz submission.
  */
 public function definition()
 {
     global $OUTPUT;
     $mform =& $this->_form;
     $mform->addElement('hidden', 'attemptid');
     $mform->setType('attemptid', PARAM_INT);
     $mform->addElement('hidden', 'questionid');
     $mform->setType('questionid', PARAM_INT);
     $mform->addElement('hidden', 'sesskey', sesskey());
     $mform->setType('sesskey', PARAM_ALPHANUM);
     $mform->addElement('static', 'picture', $OUTPUT->user_picture($this->_customdata->user), fullname($this->_customdata->user, true) . '<br/>' . userdate($this->_customdata->submission->timemodified) . $this->_customdata->lateness);
     // Now come multiple (possibly) question comment fields.
     // Use $attemptobj->get_questions($arrayofquestionis) for this.
     foreach ($this->_customdata->questions as $questionid => $question) {
         $mform->addElement('header', 'question' . $questionid, get_string('question', 'modulename'));
         // Display question text.
         // Display user's answer.
         // Display comment form.
         $mform->addElement('editor', 'comment[' . $questionid . ']', get_string('comment', 'quiz') . ':', null, $this->get_editor_options());
         // Display grade selector.
         $grademenu = make_grades_menu($question->grade);
         $grademenu['-1'] = get_string('nograde');
         // TODO broken!
         $attributes = array();
         $mform->addElement('select', 'grade[' . $questionid . ']', get_string('grade') . ':', $grademenu, $attributes);
         // TODO set default to existing grade?
         $mform->setDefault('grade[' . $questionid . ']', -1);
     }
 }
开发者ID:nadavkav,项目名称:moodle-block_ajax_marking,代码行数:32,代码来源:block_ajax_marking_quiz_form.class.php


示例17: write_message_div

 /**
  * This function writes out the message div so the message can be viewed.
  *
  * @param object $record This is the DB record for the message to write out
  * @param string $outputbuffer The output html code will be written here.
  *
  */
 private function write_message_div($record, &$outputbuffer)
 {
     global $DB, $USER;
     $timesent = $record->timesent;
     $time = userdate($timesent, '%H:%M');
     $dates = usergetdate($timesent);
     $userfrom = block_course_message_map_ids_to_names($record->useridfrom, 'inbox');
     $userto = block_course_message_map_ids_to_names($record->recipients, 'sent');
     $outputbuffer .= "<div class='message_div_bar'><div class='message_bar_to'><span class='label'>To:</span>\n                          <span class='field'> {$userto}</span></div>";
     if ($record->carboncopy !== null) {
         $carboncopy = block_course_message_map_ids_to_names($record->carboncopy, 'sent');
         $outputbuffer .= "<div class='message_bar_to'><span class='label'>CC:</span>\n                              <span class='field'> {$carboncopy}</span></div>";
     }
     $outputbuffer .= "<div class='message_bar_from'><span class='label'>From:</span><span class='field'> {$userfrom}</span>\n                          </div><div class='message_bar_time'>{$time} {$dates['month']} {$dates['mday']}</div>";
     $outputbuffer .= "<div class='clear'></div></div>";
     $outputbuffer .= "<div class='message_container";
     if ($USER->id == $record->useridfrom) {
         $outputbuffer .= " usersent'>";
     } else {
         $outputbuffer .= " userrecieved'>";
     }
     // Message has already been cleaned when sent.
     $outputbuffer .= "<div class='message_div_body'>{$record->message}</div>";
     $this->process_attachment($record, $outputbuffer);
     // Close the message container div.
     $outputbuffer .= "</div>";
 }
开发者ID:MoodleMetaData,项目名称:MoodleMetaData,代码行数:34,代码来源:mail_view.class.php


示例18: get_other_values

 protected function get_other_values(renderer_base $output)
 {
     $other = array();
     if (!empty($this->related['actionuser'])) {
         $exporter = new user_summary_exporter($this->related['actionuser']);
         $actionuser = $exporter->export($output);
         $other['actionuser'] = $actionuser;
     }
     $other['description'] = $this->persistent->get_description();
     $other['userdate'] = userdate($this->persistent->get_timecreated());
     if ($this->persistent->get_grade() === null) {
         $gradename = '-';
     } else {
         $gradename = $this->related['scale']->scale_items[$this->persistent->get_grade() - 1];
     }
     $other['gradename'] = $gradename;
     // Try to guess the user from the user competency.
     $userid = null;
     if ($this->related['usercompetency']) {
         $userid = $this->related['usercompetency']->get_userid();
     } else {
         if ($this->related['usercompetencyplan']) {
             $userid = $this->related['usercompetencyplan']->get_userid();
         } else {
             $uc = user_competency::get_record(['id' => $this->persistent->get_usercompetencyid()]);
             $userid = $uc->get_userid();
         }
     }
     $other['candelete'] = evidence::can_delete_user($userid);
     return $other;
 }
开发者ID:evltuma,项目名称:moodle,代码行数:31,代码来源:evidence_exporter.php


示例19: apply

 public function apply($discussion, $all, $selected, $formdata)
 {
     global $COURSE, $USER, $CFG, $PAGE;
     $d = $discussion->get_id();
     $forum = $discussion->get_forum();
     $PAGE->set_pagelayout('embedded');
     $out = mod_forumng_utils::get_renderer();
     print $out->header();
     $backlink = new moodle_url('/mod/forumng/discuss.php', $discussion->get_link_params_array());
     print html_writer::start_tag('div', array('class' => 'forumng-printable-header'));
     print html_writer::tag('div', link_arrow_left($discussion->get_subject(), $backlink), array('class' => 'forumng-printable-backlink'));
     print html_writer::tag('div', get_string('printedat', 'forumngfeature_print', userdate(time())), array('class' => 'forumng-printable-date'));
     print html_writer::tag('div', '', array('class' => 'clearer'));
     print "\n";
     print $out->box(get_string('back', 'forumngfeature_print', $backlink->out()), 'generalbox forumng-donotprint');
     print html_writer::start_tag('div', array('class' => 'forumng-showprintable'));
     if ($all) {
         print $out->render_discussion($discussion, array(mod_forumng_post::OPTION_NO_COMMANDS => true, mod_forumng_post::OPTION_CHILDREN_EXPANDED => true, mod_forumng_post::OPTION_PRINTABLE_VERSION => true));
     } else {
         $allhtml = '';
         $alltext = '';
         $discussion->build_selected_posts_email($selected, $alltext, $allhtml, array(mod_forumng_post::OPTION_PRINTABLE_VERSION));
         print $allhtml;
     }
     print html_writer::end_tag('div');
     $forum->print_js(0, false);
     print $out->footer();
 }
开发者ID:ULCC-QMUL,项目名称:moodle-mod_forumng,代码行数:28,代码来源:print.php


示例20: definition

 public function definition()
 {
     global $OUTPUT;
     $mform = $this->_form;
     $user = $this->_customdata['user'];
     $lastupdate = $this->_customdata['lastupdate'];
     $dategraded = $this->_customdata['dategraded'];
     // Hidden params.
     $mform->addElement('hidden', 'userid', 0);
     $mform->setType('userid', PARAM_INT);
     $mform->addElement('hidden', 'id', 0);
     $mform->setType('id', PARAM_INT);
     $mform->addElement('static', 'picture', $OUTPUT->user_picture($user), fullname($user, true) . '<br/>' . get_string('lastupdated', 'mod_giportfolio') . date('l jS \\of F Y ', $lastupdate));
     $this->add_grades_section();
     $mform->addElement('header', 'Feed Back', get_string('feedback', 'grades'));
     $mform->addElement('textarea', 'feedback', get_string('feedback', 'grades'), 'wrap="virtual" rows="10" cols="50"');
     if ($dategraded) {
         $datestring = userdate($dategraded) . "&nbsp; (" . format_time(time() - $dategraded) . ")";
         $mform->addElement('header', 'Last Grade', get_string('lastgrade', 'assignment'));
         $mform->addElement('static', 'lastgrade', get_string('lastgrade', 'mod_giportfolio') . ':', $datestring);
     }
     // Buttons.
     $this->add_action_buttons();
     $mform->setDisableShortforms(true);
 }
开发者ID:andrewhancox,项目名称:moodle-mod_giportfolio,代码行数:25,代码来源:updategrade_form.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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