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

PHP format_text函数代码示例

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

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



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

示例1: format_message_text

 /**
  * The HTML version of the e-mail message.
  *
  * @param \stdClass $cm
  * @param \stdClass $post
  * @return string
  */
 public function format_message_text($cm, $post)
 {
     $message = file_rewrite_pluginfile_urls($post->message, 'pluginfile.php', \context_module::instance($cm->id)->id, 'mod_forum', 'post', $post->id);
     $options = new \stdClass();
     $options->para = true;
     return format_text($message, $post->messageformat, $options);
 }
开发者ID:evltuma,项目名称:moodle,代码行数:14,代码来源:renderer.php


示例2: test_ampersands

 /**
  * Test ampersands.
  */
 public function test_ampersands()
 {
     global $CFG;
     $this->resetAfterTest(true);
     // Enable glossary filter at top level.
     filter_set_global_state('glossary', TEXTFILTER_ON);
     $CFG->glossary_linkentries = 1;
     // Create a test course.
     $course = $this->getDataGenerator()->create_course();
     $context = context_course::instance($course->id);
     // Create a glossary.
     $glossary = $this->getDataGenerator()->create_module('glossary', array('course' => $course->id, 'mainglossary' => 1));
     // Create two entries with ampersands and one normal entry.
     $generator = $this->getDataGenerator()->get_plugin_generator('mod_glossary');
     $normal = $generator->create_content($glossary, array('concept' => 'normal'));
     $amp1 = $generator->create_content($glossary, array('concept' => 'A&B'));
     $amp2 = $generator->create_content($glossary, array('concept' => 'C&D'));
     // Format text with all three entries in HTML.
     $html = '<p>A&amp;B C&amp;D normal</p>';
     $filtered = format_text($html, FORMAT_HTML, array('context' => $context));
     // Find all the glossary links in the result.
     $matches = array();
     preg_match_all('~courseid=' . $course->id . '&amp;eid=([0-9]+).*?title="(.*?)"~', $filtered, $matches);
     // There should be 3 glossary links.
     $this->assertEquals(3, count($matches[1]));
     $this->assertEquals($amp1->id, $matches[1][0]);
     $this->assertEquals($amp2->id, $matches[1][1]);
     $this->assertEquals($normal->id, $matches[1][2]);
     // Check text and escaping of title attribute.
     $this->assertEquals($glossary->name . ': A&amp;B', $matches[2][0]);
     $this->assertEquals($glossary->name . ': C&amp;D', $matches[2][1]);
     $this->assertEquals($glossary->name . ': normal', $matches[2][2]);
 }
开发者ID:EmmanuelYupit,项目名称:educursos,代码行数:36,代码来源:filter_test.php


示例3: 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


示例4: postprocess_data

 /**
  * If exists, this method can process local alternative values for
  * realizing the template, after all standard translations have been performed. 
  * Type information structure and application context dependant.
  */
 public function postprocess_data($course = null)
 {
     global $CFG, $COURSE, $DB;
     if (is_null($course)) {
         $course =& $COURSE;
     }
     // Get virtual fields from course title.
     $this->data->courseheading = format_string($course->fullname);
     $this->data->coursedesc = format_text($course->summary, $course->summaryformat);
     $this->data->idnumber = $course->idnumber;
     $this->data->shortname = $course->shortname;
     $storedimage = $this->get_file_url('image');
     $imageurl = !empty($storedimage) ? $storedimage : $this->fields['image']->default;
     if ($this->data->imagepositionoption == 'left') {
         $this->data->imageL = "<td width=\"100\" class=\"custombox-icon-left courseheading\" align=\"center\" style=\"background:url({$imageurl}) 50% 50% no-repeat transparent\">{$this->data->overimagetext}</td>";
         $this->data->imageR = '';
     } elseif ($this->data->imagepositionoption == 'right') {
         $this->data->imageL = '';
         $this->data->imageR = "<td width=\"100\" class=\"custombox-icon-right courseheading\" align=\"center\" style=\"background:url({$imageurl}) 50% 50% no-repeat transparent\">{$this->data->overimagetext}</td>";
     } else {
         $this->data->imageL = '';
         $this->data->imageR = '';
     }
     $cat = $DB->get_record('course_categories', array('id' => $course->category));
     $this->data->category = $cat->name;
 }
开发者ID:OctaveBabel,项目名称:moodle-itop,代码行数:31,代码来源:customlabel.class.php


示例5: 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


示例6: get_content

 function get_content()
 {
     if ($this->content !== NULL) {
         return $this->content;
     }
     $search_string = $this->config->search_string;
     $search_string_enc = urlencode($search_string);
     $no_tweets = $this->config->no_tweets;
     $url = "http://search.twitter.com/search.atom?q={$search_string_enc}&rpp={$no_tweets}";
     $ch = curl_init($url);
     curl_setopt($ch, CURLOPT_HEADER, 0);
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
     $xml = curl_exec($ch);
     curl_close($ch);
     $dom = DOMDocument::loadXML($xml);
     $tweets = $dom->getElementsByTagName('entry');
     $output = "<ul class='list'>";
     foreach ($tweets as $tweet) {
         $output .= "<li style='border-top:1px dotted #aaa;padding:4px'>";
         $author = $tweet->getElementsByTagName('author')->item(0);
         $authorname = $author->getElementsByTagName('name')->item(0)->textContent;
         $authorlink = $author->getElementsByTagName('uri')->item(0)->textContent;
         $output .= "<a href='{$authorlink}'>{$authorname}</a>: ";
         $output .= format_text($tweet->getElementsByTagName('content')->item(0)->textContent, FORMAT_HTML);
         $output .= "</li>";
     }
     $output .= "</ul>";
     $this->title = $search_string . get_string('ontwitter', 'block_twitter_search');
     $this->content = new stdClass();
     $this->content->text = $output;
     $this->content->footer = '';
     return $this->content;
 }
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:33,代码来源:block_twitter_search.php


示例7: contact

 /**
  * Render a single contact.
  *
  * @param \stdClass $contact
  *
  * @return string
  */
 public function contact(stdClass $contact)
 {
     $url = new moodle_url('/user/profile.php', array('id' => $contact->id));
     $userpic = $this->output->user_picture($contact, array('size' => '100', 'class' => 'profilepicture'));
     $description = format_text($contact->description, $contact->descriptionformat);
     return html_writer::start_tag('li', array('class' => 'contact')) . html_writer::start_tag('div', array('class' => 'contactpic')) . $userpic . html_writer::end_tag('div') . html_writer::start_tag('a', array('href' => $url)) . fullname($contact) . html_writer::end_tag('a') . html_writer::start_tag('div', array('class' => 'contactdetails')) . $description . html_writer::end_tag('div') . html_writer::end_tag('li');
 }
开发者ID:AVADOLearning,项目名称:moodle-block_mycontacts,代码行数:14,代码来源:renderer.php


示例8: generate_message

 /**
  * Generates the message object for a give subscription and event.
  *
  * @param int $subscriptionid Subscription instance
  * @param \stdClass $eventobj Event data
  *
  * @return false|\stdClass message object
  */
 protected function generate_message($subscriptionid, \stdClass $eventobj)
 {
     try {
         $subscription = subscription_manager::get_subscription($subscriptionid);
     } catch (\dml_exception $e) {
         // Race condition, someone deleted the subscription.
         return false;
     }
     $user = \core_user::get_user($subscription->userid);
     $context = \context_user::instance($user->id, IGNORE_MISSING);
     if ($context === false) {
         // User context doesn't exist. Should never happen, nothing to do return.
         return false;
     }
     $template = $subscription->template;
     $template = $this->replace_placeholders($template, $subscription, $eventobj, $context);
     $msgdata = new \stdClass();
     $msgdata->component = 'tool_monitor';
     // Your component name.
     $msgdata->name = 'notification';
     // This is the message name from messages.php.
     $msgdata->userfrom = \core_user::get_noreply_user();
     $msgdata->userto = $user;
     $msgdata->subject = $subscription->get_name($context);
     $msgdata->fullmessage = format_text($template, $subscription->templateformat, array('context' => $context));
     $msgdata->fullmessageformat = $subscription->templateformat;
     $msgdata->fullmessagehtml = format_text($template, $subscription->templateformat, array('context' => $context));
     $msgdata->smallmessage = '';
     $msgdata->notification = 1;
     // This is only set to 0 for personal messages between users.
     return $msgdata;
 }
开发者ID:HuiChangZhai,项目名称:moodle,代码行数:40,代码来源:notification_task.php


示例9: display_reported_images

 public function display_reported_images(Page $page, $reports)
 {
     global $config;
     $h_reportedimages = "";
     $n = 0;
     foreach ($reports as $report) {
         $image = $report['image'];
         $h_reason = format_text($report['reason']);
         if ($config->get_bool('report_image_show_thumbs')) {
             $image_link = $this->build_thumb_html($image);
         } else {
             $image_link = "<a href=\"" . make_link("post/view/{$image->id}") . "\">{$image->id}</a>";
         }
         $reporter_name = html_escape($report['reporter_name']);
         $userlink = "<a href='" . make_link("user/{$reporter_name}") . "'>{$reporter_name}</a>";
         global $user;
         $iabbe = new ImageAdminBlockBuildingEvent($image, $user);
         send_event($iabbe);
         ksort($iabbe->parts);
         $actions = join("<br>", $iabbe->parts);
         $oe = $n++ % 2 == 0 ? "even" : "odd";
         $h_reportedimages .= "\n\t\t\t\t<tr class='{$oe}'>\n\t\t\t\t\t<td>{$image_link}</td>\n\t\t\t\t\t<td>Report by {$userlink}: {$h_reason}</td>\n\t\t\t\t\t<td class='formstretch'>\n\t\t\t\t\t\t<form action='" . make_link("image_report/remove") . "' method='POST'>\n\t\t\t\t\t\t\t<input type='hidden' name='id' value='{$report['id']}'>\n\t\t\t\t\t\t\t<input type='submit' value='Remove Report'>\n\t\t\t\t\t\t</form>\n\n\t\t\t\t\t\t<br>{$actions}\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t";
     }
     $thumb_width = $config->get_int("thumb_width");
     $html = "\n\t\t\t<table id='reportedimage' class='zebra'>\n\t\t\t\t<thead><td width='{$thumb_width}'>Image</td><td>Reason</td><td width='128'>Action</td></thead>\n\t\t\t\t{$h_reportedimages}\n\t\t\t</table>\n\t\t";
     $page->set_title("Reported Images");
     $page->set_heading("Reported Images");
     $page->add_block(new NavBlock());
     $page->add_block(new Block("Reported Images", $html));
 }
开发者ID:jackrabbitjoey,项目名称:shimmie2,代码行数:30,代码来源:theme.php


示例10: get_content

 function get_content()
 {
     global $CFG;
     require_once $CFG->libdir . '/filelib.php';
     if ($this->content !== NULL) {
         return $this->content;
     }
     $filteropt = new stdClass();
     $filteropt->overflowdiv = true;
     if ($this->content_is_trusted()) {
         // fancy html allowed only on course, category and system blocks.
         $filteropt->noclean = true;
     }
     $this->content = new stdClass();
     $this->content->footer = '';
     if (isset($this->config->text)) {
         // rewrite url
         $this->config->text = file_rewrite_pluginfile_urls($this->config->text, 'pluginfile.php', $this->context->id, 'block_html', 'content', NULL);
         // Default to FORMAT_HTML which is what will have been used before the
         // editor was properly implemented for the block.
         $format = FORMAT_HTML;
         // Check to see if the format has been properly set on the config
         if (isset($this->config->format)) {
             $format = $this->config->format;
         }
         $this->content->text = format_text($this->config->text, $format, $filteropt);
     } else {
         $this->content->text = '';
     }
     unset($filteropt);
     // memory footprint
     return $this->content;
 }
开发者ID:saurabh947,项目名称:MoodleLearning,代码行数:33,代码来源:block_html.php


示例11: definition

    function definition() {
        $mform =& $this->_form;
        $contextid = $this->_customdata['contextid'];

        $export = $mform->addElement('hidden', 'export', ''); // Will be overwritten below

        $table = new html_table();
        /* Styling done using HTML table and CSS */
        $table->attributes['class'] = 'export_form_table';
        $table->align = array('left', 'left', 'left', 'center');
        $table->wrap = array('nowrap', '', 'nowrap', 'nowrap');
        $table->data = array();

        $table->head = array(get_string('name'),
                            get_string('description'),
                            get_string('shortname'),
                            get_string('export', 'report_rolesmigration'));

        $roles = get_all_roles();
        foreach ($roles as $role) {
            $row = array();
            $roleurl = new moodle_url('/admin/roles/define.php', array('roleid' => $role->id, 'action' => 'view'));
            $row[0] = '<a href="'.$roleurl.'">'.format_string($role->name).'</a>';
            $row[1] = format_text($role->description, FORMAT_HTML);
            $row[2] = ($role->shortname);
            /* Export values are added from role checkboxes */
            $row[3] = '<input type="checkbox" name="export[]" value="'.$role->shortname.'" />';

            $table->data[] = $row;
        }

        $mform->addElement('html', html_writer::table($table));
        $mform->addElement('hidden', 'contextid', $contextid);
        $this->add_action_buttons(false, get_string('submitexport', 'report_rolesmigration'));
    }
开发者ID:ncsu-delta,项目名称:moodle-report_rolesmigration,代码行数:35,代码来源:exportroles_form.php


示例12: get_content

 function get_content()
 {
     global $CFG;
     require_once $CFG->libdir . '/filelib.php';
     if ($this->content !== NULL) {
         return $this->content;
     }
     $filteropt = new stdClass();
     $filteropt->overflowdiv = true;
     if ($this->content_is_trusted()) {
         // fancy html allowed only on course, category and system blocks.
         $filteropt->noclean = true;
     }
     $this->content = new stdClass();
     $this->content->footer = '';
     if (isset($this->config->text)) {
         // rewrite url
         $this->config->text = file_rewrite_pluginfile_urls($this->config->text, 'pluginfile.php', $this->context->id, 'block_html', 'content', NULL);
         $this->content->text = format_text($this->config->text, $this->config->format, $filteropt);
     } else {
         $this->content->text = '';
     }
     unset($filteropt);
     // memory footprint
     return $this->content;
 }
开发者ID:sebastiansanio,项目名称:tallerdeprogramacion2fiuba,代码行数:26,代码来源:block_html.php


示例13: get_content

 function get_content()
 {
     global $CFG;
     if ($this->content !== NULL) {
         return $this->content;
     }
     if (empty($this->instance)) {
         return '';
     }
     $this->content = new object();
     $options = new object();
     $options->noclean = true;
     // Don't clean Javascripts etc
     $this->content->text = format_text($this->page->course->summary, FORMAT_HTML, $options);
     if ($this->page->user_is_editing()) {
         if ($this->page->course->id == SITEID) {
             $editpage = $CFG->wwwroot . '/' . $CFG->admin . '/settings.php?section=frontpagesettings';
         } else {
             $editpage = $CFG->wwwroot . '/course/edit.php?id=' . $this->page->course->id;
         }
         $this->content->text .= "<div class=\"editbutton\"><a href=\"{$editpage}\"><img src=\"{$CFG->pixpath}/t/edit.gif\" alt=\"" . get_string('edit') . "\" /></a></div>";
     }
     $this->content->footer = '';
     return $this->content;
 }
开发者ID:nicolasconnault,项目名称:moodle2.0,代码行数:25,代码来源:block_course_summary.php


示例14: definition_inner

 /**
  * Define the elements to be displayed at the form
  *
  * Called by the parent::definition()
  *
  * @return void
  */
 protected function definition_inner(&$mform)
 {
     $fields = $this->_customdata['fields'];
     $current = $this->_customdata['current'];
     $nodims = $this->_customdata['nodims'];
     // number of assessment dimensions
     $mform->addElement('hidden', 'nodims', $nodims);
     $mform->setType('nodims', PARAM_INT);
     for ($i = 0; $i < $nodims; $i++) {
         // dimension header
         $dimtitle = get_string('dimensionnumber', 'workshopform_comments', $i + 1);
         $mform->addElement('header', 'dimensionhdr__idx_' . $i, $dimtitle);
         // dimension id
         $mform->addElement('hidden', 'dimensionid__idx_' . $i, $fields->{'dimensionid__idx_' . $i});
         $mform->setType('dimensionid__idx_' . $i, PARAM_INT);
         // grade id
         $mform->addElement('hidden', 'gradeid__idx_' . $i);
         // value set by set_data() later
         $mform->setType('gradeid__idx_' . $i, PARAM_INT);
         // dimension description
         $desc = '<div id="id_dim_' . $fields->{'dimensionid__idx_' . $i} . '_desc" class="fitem description comments">' . "\n";
         $desc .= format_text($fields->{'description__idx_' . $i}, $fields->{'description__idx_' . $i . 'format'});
         $desc .= "\n</div>";
         $mform->addElement('html', $desc);
         // comment
         $label = get_string('dimensioncomment', 'workshopform_comments');
         //$mform->addElement('editor', 'peercomment__idx_' . $i, $label, null, array('maxfiles' => 0));
         $mform->addElement('textarea', 'peercomment__idx_' . $i, $label, array('cols' => 60, 'rows' => 10));
         $mform->addRule('peercomment__idx_' . $i, null, 'required', null, 'client');
     }
     $this->set_data($current);
 }
开发者ID:alanaipe2015,项目名称:moodle,代码行数:39,代码来源:assessment_form.php


示例15: get_content

 function get_content()
 {
     global $CFG, $OUTPUT;
     require_once $CFG->libdir . '/filelib.php';
     if ($this->content !== NULL) {
         return $this->content;
     }
     if (empty($this->instance)) {
         return '';
     }
     $this->content = new stdClass();
     $options = new stdClass();
     $options->noclean = true;
     // Don't clean Javascripts etc
     $options->overflowdiv = true;
     $context = context_course::instance($this->page->course->id);
     $this->page->course->summary = file_rewrite_pluginfile_urls($this->page->course->summary, 'pluginfile.php', $context->id, 'course', 'summary', NULL);
     $this->content->text = format_text($this->page->course->summary, $this->page->course->summaryformat, $options);
     if ($this->page->user_is_editing()) {
         if ($this->page->course->id == SITEID) {
             $editpage = $CFG->wwwroot . '/' . $CFG->admin . '/settings.php?section=frontpagesettings';
         } else {
             $editpage = $CFG->wwwroot . '/course/edit.php?id=' . $this->page->course->id;
         }
         $this->content->text .= "<div class=\"editbutton\"><a href=\"{$editpage}\"><img src=\"" . $OUTPUT->pix_url('t/edit') . "\" alt=\"" . get_string('edit') . "\" /></a></div>";
     }
     $this->content->footer = '';
     return $this->content;
 }
开发者ID:bobpuffer,项目名称:moodleUCLA-LUTH,代码行数:29,代码来源:block_course_summary.php


示例16: get_body

 private function get_body()
 {
     // returns just the contents of the body
     global $config;
     $base_href = get_base_href();
     $sitename = $config->get_string('title');
     $contact_link = $config->get_string('contact_link');
     $counter_dir = $config->get_string('home_counter', 'default');
     $total = Image::count_images();
     $strtotal = "{$total}";
     $num_comma = number_format($total);
     $counter_text = "";
     $length = strlen($strtotal);
     for ($n = 0; $n < $length; $n++) {
         $cur = $strtotal[$n];
         $counter_text .= " <img alt='{$cur}' src='{$base_href}/ext/home/counters/{$counter_dir}/{$cur}.gif' />  ";
     }
     // get the homelinks and process them
     if (strlen($config->get_string('home_links', '')) > 0) {
         $main_links = $config->get_string('home_links');
     } else {
         $main_links = '[url=site://post/list]Posts[/url] [url=site://comment/list]Comments[/url] [url=site://tags]Tags[/url]';
         if (class_exists("Pools")) {
             $main_links .= ' [url=site://pool]Pools[/url]';
         }
         if (class_exists("Wiki")) {
             $main_links .= ' [url=site://wiki]Wiki[/url]';
         }
         $main_links .= ' [url=site://ext_doc]Documentation[/url]';
     }
     $main_links = format_text($main_links);
     $main_text = $config->get_string('home_text');
     return $this->theme->build_body($sitename, $main_links, $main_text, $contact_link, $num_comma, $counter_text);
 }
开发者ID:thelectronicnub,项目名称:shimmie2,代码行数:34,代码来源:main.php


示例17: config_form_criteria

 /**
  * Add appropriate form elements to the criteria form
  *
  * @param stdClass $data details of overall criterion
  */
 public function config_form_criteria($data)
 {
     global $OUTPUT;
     $prefix = 'criteria-' . $this->id;
     if (count($data->criteria) > 2) {
         echo $OUTPUT->box_start();
         if (!empty($this->description)) {
             $badge = new badge($this->badgeid);
             echo $OUTPUT->box(format_text($this->description, $this->descriptionformat, array('context' => $badge->get_context())), 'criteria-description');
         }
         echo $OUTPUT->heading($this->get_title(), 2);
         $agg = $data->get_aggregation_methods();
         if (!$data->is_locked() && !$data->is_active()) {
             $editurl = new moodle_url('/badges/criteria_settings.php', array('badgeid' => $this->badgeid, 'edit' => true, 'type' => $this->criteriatype, 'crit' => $this->id));
             $editaction = $OUTPUT->action_icon($editurl, new pix_icon('t/edit', get_string('edit')), null, array('class' => 'criteria-action'));
             echo $OUTPUT->box($editaction, array('criteria-header'));
             $url = new moodle_url('criteria.php', array('id' => $data->id, 'sesskey' => sesskey()));
             echo $OUTPUT->single_select($url, 'update', $agg, $data->get_aggregation_method($this->criteriatype), null, null, array('aria-describedby' => 'overall'));
             echo html_writer::span(get_string('overallcrit', 'badges'), '', array('id' => 'overall'));
         } else {
             echo $OUTPUT->box(get_string('criteria_descr_' . $this->criteriatype, 'badges', core_text::strtoupper($agg[$data->get_aggregation_method()])), 'clearfix');
         }
         echo $OUTPUT->box_end();
     }
 }
开发者ID:evltuma,项目名称:moodle,代码行数:30,代码来源:award_criteria_overall.php


示例18: getListOfTopics

function getListOfTopics($course, $current)
{
    $section = 0;
    while ($section <= $course->numsections) {
        if (!($thissection = get_record('course_sections', 'course', $course->id, 'section', $section))) {
            notify('Error getting course_sections!');
        }
        $desc = format_text($thissection->summary, FORMAT_MOODLE, null, $course->id);
        $textByLines = explode("<br />", $desc);
        //we use <br /> to explode because the wysiwig editor add this element for line return
        $descTxt = strip_tags($textByLines[0]);
        $minidesc = substr($descTxt, 0, 20);
        if ($thissection->summary != null && strlen($descTxt) > 20) {
            $minidesc .= "...";
        } else {
            if ($thissection->summary == null) {
                $minidesc = "Topic";
            }
        }
        if ($current == $section) {
            echo '<OPTION selected value=' . $section . '>' . $section . ". " . $minidesc . '</OPTION>';
        } else {
            echo '<OPTION value=' . $section . '>' . $section . ". " . $minidesc . '</OPTION>';
        }
        $section++;
    }
}
开发者ID:nagyistoce,项目名称:moodle-Teach-Pilot,代码行数:27,代码来源:WimbaLib.php


示例19: format

 /**
  * Format the text
  */
 public function format($value)
 {
     if (is_null($value)) {
         return $this->isnull;
     }
     return format_text($value, $this->format, $this->options);
 }
开发者ID:bgao-ca,项目名称:moodle-local_mr,代码行数:10,代码来源:text.php


示例20: get_setting

 public static function get_setting($setting, $format = false, $theme = null)
 {
     if (empty($theme)) {
         if (empty(self::$theme)) {
             self::$theme = \theme_config::load('essential');
         }
         $theme = self::$theme;
     }
     global $CFG;
     require_once $CFG->dirroot . '/lib/weblib.php';
     if (empty($theme->settings->{$setting})) {
         return false;
     } else {
         if (!$format) {
             return $theme->settings->{$setting};
         } else {
             if ($format === 'format_text') {
                 return format_text($theme->settings->{$setting}, FORMAT_PLAIN);
             } else {
                 if ($format === 'format_html') {
                     return format_text($theme->settings->{$setting}, FORMAT_HTML, array('trusted' => true, 'noclean' => true));
                 } else {
                     return format_string($theme->settings->{$setting});
                 }
             }
         }
     }
 }
开发者ID:RobsonTK,项目名称:Moodle,代码行数:28,代码来源:toolbox.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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