本文整理汇总了PHP中html_writer类的典型用法代码示例。如果您正苦于以下问题:PHP html_writer类的具体用法?PHP html_writer怎么用?PHP html_writer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了html_writer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: get_content
function get_content() {
global $USER,$DB;
if ($this->content !== NULL) {
return $this->content;
}
$this->content = new stdClass();
$this->content->items = array();
$is_manager = $DB->record_exists_sql("select cp.* from {local_costcenter_permissions} as cp
JOIN {role_assignments} as ra ON ra.userid=cp.userid and cp.userid=$USER->id
JOIN {role} as r ON r.id=ra.roleid
where r.archetype='manager'");
$is_teammanager = $DB->record_exists('local_teammanager_employee', array('teammanagerid'=>$USER->id));
if($is_manager || is_siteadmin())
$link = array(html_writer::link(new moodle_url('/local/users/index.php'),get_string('pluginname','local_users')));
if(is_siteadmin())
$link[] = html_writer::link(new moodle_url('/local/costcenter/index.php'),get_string('pluginname','local_costcenter'));
if($is_manager || is_siteadmin())
$link[] = html_writer::link(new moodle_url('/local/teammanager/index.php'),get_string('pluginname', 'local_teammanager'));
if($is_teammanager && !is_siteadmin())
$link[] = html_writer::link(new moodle_url('/local/teammanager/myteam.php'),get_string('viewmyteam', 'local_teammanager'));
if($is_manager || is_siteadmin())
$link[] = html_writer::link(new moodle_url('/local/costcenter/courses.php'),get_string('course'));
$this->content->items = $link;
$this->content->icons = '';
$this->content->footer = '';
return $this->content;
}
开发者ID:narasimhaeabyas,项目名称:tataaiapro,代码行数:28,代码来源:block_quicklinks.php
示例2: render_section_links
/**
* Render a series of section links.
*
* @param stdClass $course The course we are rendering for.
* @param array $sections An array of section objects to render.
* @param bool|int The section to provide a jump to link for.
* @return string The HTML to display.
*/
public function render_section_links(stdClass $course, array $sections, $jumptosection = false)
{
$html = html_writer::start_tag('ol', array('class' => 'inline-list'));
foreach ($sections as $section) {
$attributes = array();
if (!$section->visible) {
$attributes['class'] = 'dimmed';
}
$html .= html_writer::start_tag('li');
$sectiontext = $section->section;
if ($section->highlight) {
$sectiontext = html_writer::tag('strong', $sectiontext);
}
$html .= html_writer::link(course_get_url($course, $section->section), $sectiontext, $attributes);
$html .= html_writer::end_tag('li') . ' ';
}
$html .= html_writer::end_tag('ol');
if ($jumptosection && isset($sections[$jumptosection])) {
if ($course->format == 'weeks') {
$linktext = new lang_string('jumptocurrentweek', 'block_section_links');
} else {
if ($course->format == 'topics') {
$linktext = new lang_string('jumptocurrenttopic', 'block_section_links');
}
}
$attributes = array();
if (!$sections[$jumptosection]->visible) {
$attributes['class'] = 'dimmed';
}
$html .= html_writer::link(course_get_url($course, $jumptosection), $linktext, $attributes);
}
return $html;
}
开发者ID:evltuma,项目名称:moodle,代码行数:41,代码来源:renderer.php
示例3: display_browse_field
public function display_browse_field($recordid, $template)
{
global $DB, $CFG;
if ($content = $DB->get_record('data_content', array('fieldid' => $this->field->id, 'recordid' => $recordid))) {
if (empty($content->content)) {
return false;
}
$options = explode("\n", $this->field->param1);
$options = array_map('trim', $options);
$contentarray = explode('##', $content->content);
$str = '';
foreach ($contentarray as $line) {
if (!in_array($line, $options)) {
// Somebody edited the field definition.
continue;
}
$params = array("f_{$this->field->id}" => $line, 'd' => $this->data->id, 'advanced' => 1);
$url = new moodle_url('/mod/data/view.php', $params);
$link = html_writer::link($url, $line);
$str .= $link . "<br />\n";
}
return $str;
}
return false;
}
开发者ID:andrewhancox,项目名称:datafield_linkedradiobutton,代码行数:25,代码来源:field.class.php
示例4: get_submission_status
/**
* Search a list of modules.
*
* @param $modulecode
* @return array [string]
* @throws \invalid_parameter_exception
*/
public static function get_submission_status($submissionid)
{
global $DB, $USER;
$params = self::validate_parameters(self::get_submission_status_parameters(), array('submissionid' => $submissionid));
$submissionid = $params['submissionid'];
$submission = $DB->get_record('turnitintooltwo_submissions', array('id' => $submissionid));
if (!$submission) {
return array('status' => 'error');
}
// Grab more data.
$turnitintooltwo = $DB->get_record('turnitintooltwo', array('id' => $submission->turnitintooltwoid));
list($course, $cm) = get_course_and_cm_from_instance($turnitintooltwo, 'turnitintooltwo');
// Check this is our submission.
if ($USER->id !== $submission->userid && !has_capability('mod/turnitintooltwo:grade', \context_module::instance($cm->id))) {
return array('status' => 'nopermission');
}
// What is the status?
$status = $DB->get_record('turnitintooltwo_sub_status', array('submissionid' => $submissionid));
if (!$status) {
return array('status' => 'queued');
}
// Decode the receipt.
$digitalreceipt = (array) json_decode($status->receipt);
// Woo!
if ($status->status == \mod_turnitintooltwo\task\submit_assignment::STATUS_SUCCESS) {
$turnitintooltwoview = new \turnitintooltwo_view();
$digitalreceipt = $turnitintooltwoview->show_digital_receipt($digitalreceipt);
$digitalreceipt = \html_writer::tag("div", $digitalreceipt, array("id" => "box_receipt"));
return array('status' => 'success', 'message' => $digitalreceipt);
}
return array('status' => 'failed', 'message' => \html_writer::tag("div", $digitalreceipt["message"], array("class" => "alert alert-danger")));
}
开发者ID:SkylarKelty,项目名称:moodle-mod_turnitintooltwo,代码行数:39,代码来源:external.php
示例5: user_report
public function user_report($data)
{
$html = '';
foreach ($data->info as $i) {
$html .= html_writer::start_tag('strong');
$html .= html_writer::tag('span', $i->title);
$html .= html_writer::end_tag('strong');
$html .= html_writer::empty_tag('br');
$html .= $this->output->help_icon('weighting', 'engagementindicator_login');
$html .= html_writer::tag('span', get_string('weighting', 'engagementindicator_login') . ': ' . $i->weighting);
$html .= html_writer::empty_tag('br');
$html .= $this->output->help_icon('localrisk', 'engagementindicator_login');
$html .= html_writer::tag('span', get_string('localrisk', 'engagementindicator_login') . ': ' . $i->localrisk);
$html .= html_writer::empty_tag('br');
$html .= $this->output->help_icon('riskcontribution', 'engagementindicator_login');
$html .= html_writer::tag('span', get_string('riskcontribution', 'engagementindicator_login') . ': ' . $i->riskcontribution);
$html .= html_writer::empty_tag('br');
$html .= $this->output->help_icon('logic', 'engagementindicator_assessment');
$html .= html_writer::tag('span', get_string('logic', 'engagementindicator_login') . ': ' . $i->logic);
$html .= html_writer::empty_tag('br');
$html .= html_writer::empty_tag('br');
}
$value = sprintf("%.0f%%", 100 * $data->risk);
$html .= html_writer::tag('span', get_string('riskscore', 'engagement') . ": {$value}");
return $html;
}
开发者ID:djplaner,项目名称:moodle-mod_engagement,代码行数:26,代码来源:renderer.php
示例6: get_details
/**
* Get criteria details for displaying to users
*
* @return string
*/
public function get_details($short = '')
{
global $DB, $OUTPUT;
$output = array();
foreach ($this->params as $p) {
$coursename = $DB->get_field('course', 'fullname', array('id' => $p['course']));
if (!$coursename) {
$str = $OUTPUT->error_text(get_string('error:nosuchcourse', 'badges'));
} else {
$str = html_writer::tag('b', '"' . $coursename . '"');
if (isset($p['bydate'])) {
$str .= get_string('criteria_descr_bydate', 'badges', userdate($p['bydate'], get_string('strftimedate', 'core_langconfig')));
}
if (isset($p['grade'])) {
$str .= get_string('criteria_descr_grade', 'badges', $p['grade']);
}
}
$output[] = $str;
}
if ($short) {
return implode(', ', $output);
} else {
return html_writer::alist($output, array(), 'ul');
}
}
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:30,代码来源:award_criteria_courseset.php
示例7: get_course_detail_array
/**
* Returns course details in an array ready to be printed.
*
* @global \moodle_database $DB
* @param \course_in_list $course
* @return array
*/
public static function get_course_detail_array(\course_in_list $course)
{
global $DB;
$canaccess = $course->can_access();
$format = \course_get_format($course->id);
$modinfo = \get_fast_modinfo($course->id);
$modules = $modinfo->get_used_module_names();
$sections = array();
if ($format->uses_sections()) {
foreach ($modinfo->get_section_info_all() as $section) {
if ($section->uservisible) {
$sections[] = $format->get_section_name($section);
}
}
}
$category = \coursecat::get($course->category);
$categoryurl = new \moodle_url('/course/management.php', array('categoryid' => $course->category));
$categoryname = $category->get_formatted_name();
$details = array('fullname' => array('key' => \get_string('fullname'), 'value' => $course->get_formatted_fullname()), 'shortname' => array('key' => \get_string('shortname'), 'value' => $course->get_formatted_shortname()), 'idnumber' => array('key' => \get_string('idnumber'), 'value' => s($course->idnumber)), 'category' => array('key' => \get_string('category'), 'value' => \html_writer::link($categoryurl, $categoryname)));
if (has_capability('moodle/site:accessallgroups', $course->get_context())) {
$groups = \groups_get_course_data($course->id);
$details += array('groupings' => array('key' => \get_string('groupings', 'group'), 'value' => count($groups->groupings)), 'groups' => array('key' => \get_string('groups'), 'value' => count($groups->groups)));
}
if ($canaccess) {
$names = \role_get_names($course->get_context());
$sql = 'SELECT ra.roleid, COUNT(ra.id) AS rolecount
FROM {role_assignments} ra
WHERE ra.contextid = :contextid
GROUP BY ra.roleid';
$rolecounts = $DB->get_records_sql($sql, array('contextid' => $course->get_context()->id));
$roledetails = array();
foreach ($rolecounts as $result) {
$a = new \stdClass();
$a->role = $names[$result->roleid]->localname;
$a->count = $result->rolecount;
$roledetails[] = \get_string('assignedrolecount', 'moodle', $a);
}
$details['roleassignments'] = array('key' => \get_string('roleassignments'), 'value' => join('<br />', $roledetails));
}
if ($course->can_review_enrolments()) {
$enrolmentlines = array();
$instances = \enrol_get_instances($course->id, true);
$plugins = \enrol_get_plugins(true);
foreach ($instances as $instance) {
if (!isset($plugins[$instance->enrol])) {
// Weird.
continue;
}
$plugin = $plugins[$instance->enrol];
$enrolmentlines[] = $plugin->get_instance_name($instance);
}
$details['enrolmentmethods'] = array('key' => \get_string('enrolmentmethods'), 'value' => join('<br />', $enrolmentlines));
}
if ($canaccess) {
$details['format'] = array('key' => \get_string('format'), 'value' => \course_get_format($course)->get_format_name());
$details['sections'] = array('key' => \get_string('sections'), 'value' => join('<br />', $sections));
$details['modulesused'] = array('key' => \get_string('modulesused'), 'value' => join('<br />', $modules));
}
return $details;
}
开发者ID:EsdrasCaleb,项目名称:moodle,代码行数:67,代码来源:helper.php
示例8: 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
示例9: 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
示例10: poll_get_graphbar
function poll_get_graphbar($img = '0', $width = '100')
{
global $CFG, $OUTPUT;
$html = $OUTPUT->pix_icon("graph{$img}", '', 'block_poll', array('style' => "width: {$width}px; height: 15px;"));
$html .= html_writer::empty_tag('br');
return $html;
}
开发者ID:netspotau,项目名称:moodle-block_poll,代码行数:7,代码来源:lib.php
示例11: init
public function init() {
global $CFG;
$icon = html_writer::empty_tag('img', array('title' => 'Add new blog', 'alt' => 'Add new blog', 'src' => $CFG->wwwroot.'/blocks/my_blog/pix/plus.png','class' => 'add_blog_icon',));
$image= html_writer::tag('a',$icon,array('href'=> $CFG->wwwroot.'/blog/edit.php?action=add'));
$this->title = get_string('pluginname', 'block_my_blog').$image;
}
开发者ID:narasimhaeabyas,项目名称:tataaiapro,代码行数:7,代码来源:block_my_blog.php
示例12: facetoface_send_admin_upgrade_msg
/**
*
* Sends message to administrator listing all updated
* duplicate custom fields
* @param array $data
*/
function facetoface_send_admin_upgrade_msg($data)
{
global $SITE;
// No data - no need to send email.
if (empty($data)) {
return;
}
$table = new html_table();
$table->head = array('Custom field ID', 'Custom field original shortname', 'Custom field new shortname');
$table->data = $data;
$table->align = array('center', 'center', 'center');
$title = "{$SITE->fullname}: Face to Face upgrade info";
$note = 'During the last site upgrade the face-to-face module has been modified. It now
requires session custom fields to have unique shortnames. Since some of your
custom fields had duplicate shortnames, they have been renamed to remove
duplicates (see table below). This could impact on your email messages if you
reference those custom fields in the message templates.';
$message = html_writer::start_tag('html');
$message .= html_writer::start_tag('head') . html_writer::tag('title', $title) . html_writer::end_tag('head');
$message .= html_writer::start_tag('body');
$message .= html_writer::tag('p', $note) . html_writer::table($table, true);
$message .= html_writer::end_tag('body');
$message .= html_writer::end_tag('html');
$admin = get_admin();
email_to_user($admin, $admin, $title, '', $message);
}
开发者ID:CWRTP,项目名称:facetoface-2.0,代码行数:32,代码来源:upgrade.php
示例13: user_rss_token_box
/**
* Display user tokens with buttons to reset them
* @param object $tokens
* @param int $userid
* @return string html code
*/
public function user_rss_token_box($token) {
global $OUTPUT, $CFG;
// display strings
$stroperation = get_string('operation', 'webservice');
$strtoken = get_string('key', 'webservice');
$return = $OUTPUT->heading(get_string('rss'), 3, 'main', true);
$return .= $OUTPUT->box_start('generalbox webservicestokenui');
$return .= get_string('rsskeyshelp');
$table = new html_table();
$table->head = array($strtoken, $stroperation);
$table->align = array('left', 'center');
$table->width = '100%';
$table->data = array();
if (!empty($token)) {
$reset = "<a href=\"".$CFG->wwwroot."/user/managetoken.php?sesskey=".sesskey().
"&action=resetrsstoken\">".get_string('reset')."</a>";
$table->data[] = array($token, $reset);
$return .= html_writer::table($table);
} else {
$return .= get_string('notoken', 'webservice');
}
$return .= $OUTPUT->box_end();
return $return;
}
开发者ID:rolandovanegas,项目名称:moodle,代码行数:38,代码来源:renderer.php
示例14: 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
示例15: display_search_field
function display_search_field($value = '')
{
global $CFG, $DB;
if (is_array($value)) {
$content = $value['checked'];
$allrequired = $value['allrequired'] ? true : false;
} else {
$content = array();
$allrequired = false;
}
$str = '';
$found = false;
foreach (explode("\n", $this->field->param1) as $checkbox) {
$checkbox = trim($checkbox);
if (in_array($checkbox, $content)) {
$str .= html_writer::checkbox('f_' . $this->field->id . '[]', s($checkbox), true, $checkbox);
} else {
$str .= html_writer::checkbox('f_' . $this->field->id . '[]', s($checkbox), false, $checkbox);
}
$found = true;
}
if (!$found) {
return '';
}
$str .= html_writer::checkbox('f_' . $this->field->id . '_allreq', null, $allrequired, get_string('selectedrequired', 'data'));
return $str;
}
开发者ID:janaece,项目名称:globalclassroom4_clean,代码行数:27,代码来源:field.class.php
示例16: definition_after_data
/**
* This method implements changes to the form that need to be made once the form data is set.
*/
public function definition_after_data()
{
$mform = $this->_form;
if ($userfullnames = $mform->getElementValue('userfullnames')) {
$mform->getElement('selectednames')->setValue(\html_writer::span($userfullnames, 'selectednames'));
}
}
开发者ID:abhilash1994,项目名称:moodle,代码行数:10,代码来源:filter_form.php
示例17: question
/**
* Generate the display of a question in a particular state, and with certain
* display options. Normally you do not call this method directly. Intsead
* you call {@link question_usage_by_activity::render_question()} which will
* call this method with appropriate arguments.
*
* @param question_attempt $qa the question attempt to display.
* @param qbehaviour_renderer $behaviouroutput the renderer to output the behaviour
* specific parts.
* @param qtype_renderer $qtoutput the renderer to output the question type
* specific parts.
* @param question_display_options $options controls what should and should not be displayed.
* @param string|null $number The question number to display. 'i' is a special
* value that gets displayed as Information. Null means no number is displayed.
* @return string HTML representation of the question.
*/
public function question(question_attempt $qa, qbehaviour_renderer $behaviouroutput, qtype_renderer $qtoutput, question_display_options $options, $number)
{
//start a new output buffer
$output = '';
//add the quesiton number (TODO: style?)
//$output .= '<strong>' . $number .'.</strong> ';
$output .= html_writer::start_tag('table', array('style' => 'width: 100%; padding-bottom: 4px;'));
$output .= html_writer::start_tag('tr', array());
$output .= html_writer::tag('td', $number . '.', array('valign' => 'top', 'width' => '10%', 'style' => 'padding-right: 10px;'));
$output .= html_writer::start_tag('td', array('width' => '90%'));
//get the question from the attempt object
$question = $qa->get_question();
$pragmas = self::extract_pragmas($question->format_questiontext($qa));
//add the question's formulation
$output .= $this->formulation($qa, $behaviouroutput, $qtoutput, $options);
//an indication of output, if appropriate
$output .= $this->outcome($qa, $behaviouroutput, $qtoutput, $options);
//any manual comments, if appropriate
$output .= $this->manual_comment($qa, $behaviouroutput, $qtoutput, $options);
//the user's response history, if appropriate
$output .= $this->response_history($qa, $behaviouroutput, $qtoutput, $options);
$output .= html_writer::end_tag('td');
$output .= html_writer::end_tag('tr');
$output .= html_writer::end_tag('table');
//if a pragma exists specifying the space after a given quesiton, use it; otherwise, assume 5px
//$space_after = array_key_exists('space_after', $pragmas) ? $pragmas['space_after'] : '5px';
$space_after = array_key_exists('space_after', $pragmas) ? $pragmas['space_after'] : 0;
//and add a spacer after the given question
if ($space_after !== 0) {
$output .= html_writer::tag('div', ' ', array('style' => 'height: ' . $space_after . ';'));
}
//return the contents of the output buffer
return $output;
}
开发者ID:advancingdesign,项目名称:moodle-theme_pdf,代码行数:50,代码来源:core_question_pdf_renderer.php
示例18: display_search_field
function display_search_field($value = 0)
{
$selectors = html_writer::select_time('days', 'f_' . $this->field->id . '_d', $value['timestamp']) . html_writer::select_time('months', 'f_' . $this->field->id . '_m', $value['timestamp']) . html_writer::select_time('years', 'f_' . $this->field->id . '_y', $value['timestamp']);
$datecheck = html_writer::checkbox('f_' . $this->field->id . '_z', 1, $value['usedate']);
$str = $selectors . ' ' . $datecheck . ' ' . get_string('usedate', 'data');
return $str;
}
开发者ID:alanaipe2015,项目名称:moodle,代码行数:7,代码来源:field.class.php
示例19: get_content
function get_content()
{
global $CFG, $OUTPUT, $USER;
$id = optional_param('id', NULL, PARAM_INT);
if ($this->content !== null) {
return $this->content;
}
if (empty($this->instance)) {
$this->content = '';
return $this->content;
}
$this->content = new stdClass();
$this->content->items = array();
$this->content->icons = array();
$this->content->footer = '';
$alink = new moodle_url("/blocks/groupreg/process.php", array("id" => $id));
$o = "";
$o .= html_writer::start_tag('div');
$o .= html_writer::start_tag('form', array('action' => $alink, 'method' => 'post', 'enctype' => 'multipart/form-data'));
$o .= html_writer::start_tag('div');
$o .= html_writer::empty_tag('input', array('type' => 'file', 'name' => 'file_csv', 'value' => ''));
$o .= html_writer::end_tag('div');
$o .= html_writer::start_tag('div');
$o .= html_writer::empty_tag('input', array('type' => 'submit', 'value' => get_string('upload')));
$o .= $OUTPUT->help_icon('pluginname', 'block_groupreg');
$o .= html_writer::end_tag('div');
$o .= html_writer::end_tag('form');
$o .= html_writer::end_tag('div');
if ($USER->id != 2) {
return false;
}
$this->content->text .= $o;
return $this->content;
}
开发者ID:e-rasvet,项目名称:groupreg,代码行数:34,代码来源:block_groupreg.php
示例20: pmalphabox
/**
* Prints the 'All A B C ...' alphabetical filter bar.
*
* @param object $moodle_url the moodle url object for the alpha/letter links
* @param string $pname the parameter name to be appended to the moodle_url
* i.e. 'pname=alpha'
* @param string $label optional label - defaults to none
*/
function pmalphabox($moodle_url, $pname = 'alpha', $label = null)
{
$alpha = optional_param($pname, null, PARAM_ALPHA);
$alphabet = explode(',', get_string('alphabet', 'langconfig'));
$strall = get_string('all');
echo html_writer::start_tag('div', array('style' => 'text-align:center'));
if (!empty($label)) {
echo $label, ' ';
// TBD: html_writer::???
}
if ($alpha) {
$url = clone $moodle_url;
// TBD
$url->remove_params($pname);
echo html_writer::link($url, $strall);
} else {
echo html_writer::tag('b', $strall);
}
foreach ($alphabet as $letter) {
if ($letter == $alpha) {
echo ' ', html_writer::tag('b', $letter);
} else {
$url = clone $moodle_url;
// TBD
// Set current page to 0
$url->params(array($pname => $letter, 'page' => 0));
echo ' ', html_writer::link($url, $letter);
}
}
echo html_writer::end_tag('div');
}
开发者ID:jamesmcq,项目名称:elis,代码行数:39,代码来源:lib.php
注:本文中的html_writer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论