本文整理汇总了PHP中get_string函数的典型用法代码示例。如果您正苦于以下问题:PHP get_string函数的具体用法?PHP get_string怎么用?PHP get_string使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_string函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: invitetogroup_submit
function invitetogroup_submit(Pieform $form, $values)
{
global $SESSION, $USER, $group, $user;
group_invite_user($group, $user->id, $USER, isset($values['role']) ? $values['role'] : null);
$SESSION->add_ok_msg(get_string('userinvited', 'group'));
redirect(profile_url($user));
}
示例2: dump_export_data
public function dump_export_data()
{
if ($this->exporter->get('viewexportmode') == PluginExport::EXPORT_LIST_OF_VIEWS && $this->exporter->get('artefactexportmode') == PluginExport::EXPORT_ARTEFACTS_FOR_VIEWS) {
// Dont' care about profile information in this case
return;
}
$smarty = $this->exporter->get_smarty('../../', 'internal');
$smarty->assign('page_heading', get_string('profilepage', 'artefact.internal'));
// Profile page
$profileviewid = $this->exporter->get('user')->get_profile_view()->get('id');
foreach ($this->exporter->get('views') as $viewid => $view) {
if ($profileviewid == $viewid) {
$smarty->assign('breadcrumbs', array(array('text' => 'Profile page', 'path' => 'profilepage.html')));
$view = $this->exporter->get('user')->get_profile_view();
$outputfilter = new HtmlExportOutputFilter('../../');
$smarty->assign('view', $outputfilter->filter($view->build_columns()));
$content = $smarty->fetch('export:html/internal:profilepage.tpl');
if (!file_put_contents($this->fileroot . 'profilepage.html', $content)) {
throw new SystemException("Unable to write profile page");
}
$this->profileviewexported = true;
break;
}
}
// Generic profile information
$smarty->assign('page_heading', get_string('profileinformation', 'artefact.internal'));
$smarty->assign('breadcrumbs', array(array('text' => 'Profile information', 'path' => 'index.html')));
// Organise profile information by sections, ordered how it's ordered
// on the 'edit profile' page
$sections = array('aboutme' => array(), 'contact' => array(), 'messaging' => array(), 'general' => array());
$elementlist = call_static_method('ArtefactTypeProfile', 'get_all_fields');
$elementlistlookup = array_flip(array_keys($elementlist));
$profilefields = get_column_sql('SELECT id FROM {artefact} WHERE owner=? AND artefacttype IN (' . join(",", array_map(create_function('$a', 'return db_quote($a);'), array_keys($elementlist))) . ")", array($this->exporter->get('user')->get('id')));
foreach ($profilefields as $id) {
$artefact = artefact_instance_from_id($id);
$rendered = $artefact->render_self(array('link' => true));
if ($artefact->get('artefacttype') == 'introduction') {
$outputfilter = new HtmlExportOutputFilter('../../');
$rendered['html'] = $outputfilter->filter($rendered['html']);
}
$sections[$this->get_category_for_artefacttype($artefact->get('artefacttype'))][$artefact->get('artefacttype')] = array('html' => $rendered['html'], 'weight' => $elementlistlookup[$artefact->get('artefacttype')]);
}
// Sort the data and then drop the weighting information
foreach ($sections as &$section) {
uasort($section, create_function('$a, $b', 'return $a["weight"] > $b["weight"];'));
foreach ($section as &$data) {
$data = $data['html'];
}
}
$smarty->assign('sections', $sections);
$iconid = $this->exporter->get('user')->get('profileicon');
if ($iconid) {
$icon = artefact_instance_from_id($iconid);
$smarty->assign('icon', '<img src="../../static/profileicons/200px-' . PluginExportHtml::sanitise_path($icon->get('title')) . '" alt="Profile Icon">');
}
$content = $smarty->fetch('export:html/internal:index.tpl');
if (!file_put_contents($this->fileroot . 'index.html', $content)) {
throw new SystemException("Unable to write profile information page");
}
}
示例3: definition
/**
* Definition of the Mform for filters displayed in the report.
*/
public function definition()
{
$mform = $this->_form;
$course = $this->_customdata['course'];
$itemids = $this->_customdata['itemids'];
$graders = $this->_customdata['graders'];
$userbutton = $this->_customdata['userbutton'];
$names = \html_writer::span('', 'selectednames');
$mform->addElement('static', 'userselect', get_string('selectusers', 'gradereport_history'), $userbutton);
$mform->addElement('static', 'selectednames', get_string('selectedusers', 'gradereport_history'), $names);
$mform->addElement('select', 'itemid', get_string('gradeitem', 'grades'), $itemids);
$mform->setType('itemid', PARAM_INT);
$mform->addElement('select', 'grader', get_string('grader', 'gradereport_history'), $graders);
$mform->setType('grader', PARAM_INT);
$mform->addElement('date_selector', 'datefrom', get_string('datefrom', 'gradereport_history'), array('optional' => true));
$mform->addElement('date_selector', 'datetill', get_string('datetill', 'gradereport_history'), array('optional' => true));
$mform->addElement('checkbox', 'revisedonly', get_string('revisedonly', 'gradereport_history'));
$mform->addHelpButton('revisedonly', 'revisedonly', 'gradereport_history');
$mform->addElement('hidden', 'id', $course->id);
$mform->setType('id', PARAM_INT);
$mform->addElement('hidden', 'userids');
$mform->setType('userids', PARAM_SEQUENCE);
$mform->addElement('hidden', 'userfullnames');
$mform->setType('userfullnames', PARAM_TEXT);
// Add a submit button.
$mform->addElement('submit', 'submitbutton', get_string('submit'));
}
示例4: suspend_submit
function suspend_submit(Pieform $form, $values)
{
global $SESSION;
suspend_user($values['id'], $values['reason']);
$SESSION->add_ok_msg(get_string('usersuspended', 'admin'));
redirect('/user/view.php?id=' . $values['id']);
}
示例5: definition
public function definition() {
global $USER, $CFG, $DB;
$mform = $this->_form;
$enrol = $this->_customdata['enrolid'];
if(is_siteadmin())
$costcenterid = $DB->get_field_sql('select costcenter from {course} as c join {enrol} as e ON c.id=e.courseid where e.id='.$enrol.'');
if(!is_siteadmin())
$costcenterid = $DB->get_field('local_userdata','costcenterid',array('userid'=>$USER->id));
$sql = 'select distinct(lp.id) as position_key,lp.fullname as position_value from {local_positions} as lp JOIN {local_userdata} as ud ON lp.id=ud.position where ud.position!="" AND ud.costcenterid='.$costcenterid.'';
$position_list = $DB->get_records_sql_menu($sql);
$mform->addElement('select', 'position', get_string('positions', 'local_costcenter'), $position_list, array('multiple' => 'multiple','class'=>'filter_drop'));
$mform->setType('position', PARAM_RAW);
$batch_list = $DB->get_records_sql_menu('select id as name_key,name as name_value from {cohort} where id in(select batchid from {local_costcenter_batch} where costcenterid='.$costcenterid.')');
$mform->addElement('select', 'batch', get_string('batch', 'local_costcenter'), $batch_list, array('multiple' => 'multiple','class'=>'filter_drop'));
$mform->setType('batch', PARAM_INT);
$skillset_list = $DB->get_records_sql_menu('select distinct(skillset) as skillset_key,skillset as skillset_value from {local_userdata} where skillset!="" and costcenterid='.$costcenterid.'');
$mform->addElement('select', 'skillset', get_string('skillset', 'local_costcenter'), $skillset_list, array('multiple' => 'multiple','class'=>'filter_drop'));
$mform->setType('skillset', PARAM_RAW);
$sub_skillset_list = $DB->get_records_sql_menu('select distinct(subskillset) as sub_skillset_key,subskillset as sub_skillset_value from {local_userdata} where subskillset!="" and costcenterid='.$costcenterid.'');
$mform->addElement('select', 'sub_skillset', get_string('subskillset', 'local_costcenter'), $sub_skillset_list, array('multiple' => 'multiple','class'=>'filter_drop'));
$mform->setType('sub_skillset', PARAM_RAW);
$mform->addElement('hidden','enrolid');
$mform->setType('enrolid',PARAM_INT);
$mform->setDefault('enrolid',$enrol);
$this->add_action_buttons('true', 'Filter');
}
示例6: get_content
function get_content()
{
global $CFG, $OUTPUT;
if ($this->content !== NULL) {
return $this->content;
}
$this->content = new stdClass();
$this->content->items = array();
$this->content->icons = array();
$this->content->footer = '';
if (!defined('FEEDBACK_BLOCK_LIB_IS_OK')) {
$this->content->items = array(get_string('missing_feedback_module', 'block_feedback'));
return $this->content;
}
$courseid = $this->page->course->id;
if ($courseid <= 0) {
$courseid = SITEID;
}
$icon = '<img src="' . $OUTPUT->pix_url('icon', 'feedback') . '" class="icon" alt="" />';
if (empty($this->instance->pageid)) {
$this->instance->pageid = SITEID;
}
if ($feedbacks = feedback_get_feedbacks_from_sitecourse_map($courseid)) {
$baseurl = new moodle_url('/mod/feedback/view.php');
foreach ($feedbacks as $feedback) {
$url = new moodle_url($baseurl);
$url->params(array('id' => $feedback->cmid, 'courseid' => $courseid));
$this->content->items[] = '<a href="' . $url->out() . '">' . $icon . $feedback->name . '</a>';
}
}
return $this->content;
}
示例7: deletecpdform_submit
function deletecpdform_submit(Pieform $form, $values)
{
global $SESSION, $todelete;
$todelete->delete();
$SESSION->add_ok_msg(get_string('cpddeletedsuccessfully', 'artefact.cpds'));
redirect('/artefact/cpds/');
}
示例8: definition
function definition()
{
global $CFG;
$mform =& $this->_form;
$mnetprofileimportfields = '';
if (isset($CFG->mnetprofileimportfields)) {
$mnetprofileimportfields = str_replace(',', ', ', $CFG->mnetprofileimportfields);
}
$mnetprofileexportfields = '';
if (isset($CFG->mnetprofileexportfields)) {
$mnetprofileexportfields = str_replace(',', ', ', $CFG->mnetprofileexportfields);
}
$mform->addElement('hidden', 'hostid', $this->_customdata['hostid']);
$mform->setType('hostid', PARAM_INT);
$fields = mnet_profile_field_options();
// Fields to import ----------------------------------------------------
$mform->addElement('header', 'import', get_string('importfields', 'mnet'));
$select = $mform->addElement('select', 'importfields', get_string('importfields', 'mnet'), $fields['optional']);
$select->setMultiple(true);
$mform->addElement('checkbox', 'importdefault', get_string('leavedefault', 'mnet'), $mnetprofileimportfields);
// Fields to export ----------------------------------------------------
$mform->addElement('header', 'export', get_string('exportfields', 'mnet'));
$select = $mform->addElement('select', 'exportfields', get_string('exportfields', 'mnet'), $fields['optional']);
$select->setMultiple(true);
$mform->addElement('checkbox', 'exportdefault', get_string('leavedefault', 'mnet'), $mnetprofileexportfields);
$this->add_action_buttons();
}
示例9: 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;
}
示例10: booktool_wordimport_extend_settings_navigation
/**
* Adds module specific settings to the settings block
*
* @param settings_navigation $settings The settings navigation object
* @param navigation_node $node The node to add module settings to
*/
function booktool_wordimport_extend_settings_navigation(settings_navigation $settings, navigation_node $node)
{
global $PAGE;
if ($PAGE->cm->modname !== 'book') {
return;
}
$params = $PAGE->url->params();
if (empty($params['id']) and empty($params['cmid'])) {
return;
}
if (empty($PAGE->cm->context)) {
$PAGE->cm->context = get_context_module::instance($PAGE->cm->instance);
}
if (!(has_capability('booktool/wordimport:import', $PAGE->cm->context) and has_capability('mod/book:edit', $PAGE->cm->context))) {
return;
}
// Configure Import link, and pass in the current chapter in case the insert should happen here rather than at the end.
$url1 = new moodle_url('/mod/book/tool/wordimport/index.php', array('id' => $PAGE->cm->id, 'chapterid' => $params['chapterid']));
$node->add(get_string('importchapters', 'booktool_wordimport'), $url1, navigation_node::TYPE_SETTING, null, null, new pix_icon('f/document', '', 'moodle', array('class' => 'iconsmall', 'title' => '')));
// Configure Export links for book and current chapter.
$url2 = new moodle_url('/mod/book/tool/wordimport/index.php', array('id' => $PAGE->cm->id, 'action' => 'export'));
$node->add(get_string('exportbook', 'booktool_wordimport'), $url2, navigation_node::TYPE_SETTING, null, null, new pix_icon('f/document', '', 'moodle', array('class' => 'iconsmall', 'title' => '')));
$url3 = new moodle_url('/mod/book/tool/wordimport/index.php', array('id' => $PAGE->cm->id, 'chapterid' => $params['chapterid'], 'action' => 'export'));
$node->add(get_string('exportchapter', 'booktool_wordimport'), $url3, navigation_node::TYPE_SETTING, null, null, new pix_icon('f/document', '', 'moodle', array('class' => 'iconsmall', 'title' => '')));
}
示例11: test_interactive
public function test_interactive()
{
// Create a gapselect question.
$q = test_question_maker::make_question('calculated');
$q->hints = array(new question_hint(1, 'This is the first hint.', FORMAT_HTML), new question_hint(2, 'This is the second hint.', FORMAT_HTML));
$this->start_attempt_at_question($q, 'interactive', 3, 1);
$values = $q->vs->get_values();
$this->assertEquals($values, $q->datasetloader->load_values(1));
// Check the initial state.
$this->check_current_state(question_state::$todo);
$this->check_current_mark(null);
$this->check_current_output($this->get_contains_marked_out_of_summary(), $this->get_contains_submit_button_expectation(true), $this->get_does_not_contain_feedback_expectation(), $this->get_does_not_contain_validation_error_expectation(), $this->get_does_not_contain_try_again_button_expectation(), $this->get_no_hint_visible_expectation());
// Submit blank.
$this->process_submission(array('-submit' => 1, 'answer' => ''));
// Verify.
$this->check_current_state(question_state::$invalid);
$this->check_current_mark(null);
$this->check_current_output($this->get_contains_marked_out_of_summary(), $this->get_contains_submit_button_expectation(true), $this->get_does_not_contain_feedback_expectation(), $this->get_contains_validation_error_expectation(), $this->get_does_not_contain_try_again_button_expectation(), $this->get_no_hint_visible_expectation());
// Sumit something that does not look like a number.
$this->process_submission(array('-submit' => 1, 'answer' => 'newt'));
// Verify.
$this->check_current_state(question_state::$invalid);
$this->check_current_mark(null);
$this->check_current_output($this->get_contains_marked_out_of_summary(), $this->get_contains_submit_button_expectation(true), $this->get_does_not_contain_feedback_expectation(), $this->get_contains_validation_error_expectation(), new question_pattern_expectation('/' . preg_quote(get_string('invalidnumber', 'qtype_numerical'), '/') . '/'), $this->get_does_not_contain_try_again_button_expectation(), $this->get_no_hint_visible_expectation());
// Now get it right.
$this->process_submission(array('-submit' => 1, 'answer' => $values['a'] + $values['b']));
// Verify.
$this->check_current_state(question_state::$gradedright);
$this->check_current_mark(3);
$this->check_current_output($this->get_contains_mark_summary(3), $this->get_does_not_contain_submit_button_expectation(), $this->get_contains_correct_expectation(), $this->get_does_not_contain_validation_error_expectation(), $this->get_no_hint_visible_expectation());
}
示例12: definition
/**
* Define this form - called from the parent constructor
*/
function definition() {
$mform = $this->_form;
$instance = $this->_customdata;
$mform->addElement('header', 'general', get_string('gradingoptions', 'assign'));
// visible elements
$options = array(-1=>'All',10=>'10', 20=>'20', 50=>'50', 100=>'100');
$mform->addElement('select', 'perpage', get_string('assignmentsperpage', 'assign'), $options, array('class'=>'ignoredirty'));
$options = array(''=>get_string('filternone', 'assign'), ASSIGN_FILTER_SUBMITTED=>get_string('filtersubmitted', 'assign'), ASSIGN_FILTER_REQUIRE_GRADING=>get_string('filterrequiregrading', 'assign'));
$mform->addElement('select', 'filter', get_string('filter', 'assign'), $options, array('class'=>'ignoredirty'));
// quickgrading
if ($instance['showquickgrading']) {
$mform->addElement('checkbox', 'quickgrading', get_string('quickgrading', 'assign'), '', array('class'=>'ignoredirty'));
$mform->addHelpButton('quickgrading', 'quickgrading', 'assign');
$mform->setDefault('quickgrading', $instance['quickgrading']);
}
// hidden params
$mform->addElement('hidden', 'contextid', $instance['contextid']);
$mform->setType('contextid', PARAM_INT);
$mform->addElement('hidden', 'id', $instance['cm']);
$mform->setType('id', PARAM_INT);
$mform->addElement('hidden', 'userid', $instance['userid']);
$mform->setType('userid', PARAM_INT);
$mform->addElement('hidden', 'action', 'saveoptions');
$mform->setType('action', PARAM_ALPHA);
// buttons
$this->add_action_buttons(false, get_string('updatetable', 'assign'));
}
示例13: definition
function definition()
{
$mform =& $this->_form;
$mnet_peer =& $this->_customdata['peer'];
$myservices =& mnet_get_service_info($mnet_peer);
$mform->addElement('hidden', 'hostid', $mnet_peer->id);
$count = 0;
foreach ($myservices as $name => $versions) {
$version = current($versions);
$langmodule = ($version['plugintype'] == 'mod' ? '' : $version['plugintype'] . '_') . $version['pluginname'];
// TODO there should be a moodle-wide way to do this
if ($count > 0) {
$mform->addElement('html', '<hr />');
}
$mform->addElement('html', '<h3>' . get_string($name . '_name', $langmodule, $mnet_peer->name) . '</h3>' . get_string($name . '_description', $langmodule, $mnet_peer->name));
$mform->addElement('hidden', 'exists[' . $version['serviceid'] . ']', 1);
$pubstr = get_string('publish', 'mnet');
if (!empty($version['hostsubscribes'])) {
$pubstr .= ' <a class="notifysuccess" title="' . s(get_string('issubscribed', 'mnet', $mnet_peer->name)) . '">√</a> ';
}
$mform->addElement('advcheckbox', 'publish[' . $version['serviceid'] . ']', $pubstr);
$substr = get_string('subscribe', 'mnet');
if (!empty($version['hostpublishes'])) {
$substr .= ' <a class="notifysuccess" title="' . s(get_string('ispublished', 'mnet', $mnet_peer->name)) . '">√</a> ';
}
$mform->addElement('advcheckbox', 'subscribe[' . $version['serviceid'] . ']', $substr);
$count++;
}
$this->add_action_buttons();
}
示例14: get_init_params
protected function get_init_params($elementid, array $options = null)
{
global $CFG, $PAGE, $OUTPUT;
//TODO: we need to implement user preferences that affect the editor setup too
$directionality = get_string('thisdirection', 'langconfig');
$strtime = get_string('strftimetime');
$strdate = get_string('strftimedaydate');
$lang = current_language();
$contentcss = $PAGE->theme->editor_css_url()->out(false);
$context = empty($options['context']) ? get_context_instance(CONTEXT_SYSTEM) : $options['context'];
$xmedia = 'moodlemedia,';
// HQ thinks it should be always on, so it is no matter if it will actually work or not
/*
if (!empty($options['legacy'])) {
$xmedia = 'moodlemedia,';
} else {
if (!empty($options['noclean']) or !empty($options['trusted'])) {
}
}*/
$filters = filter_get_active_in_context($context);
if (array_key_exists('filter/tex', $filters)) {
$xdragmath = 'dragmath,';
} else {
$xdragmath = '';
}
if (array_key_exists('filter/emoticon', $filters)) {
$xemoticon = 'moodleemoticon,';
} else {
$xemoticon = '';
}
$params = array('mode' => "exact", 'elements' => $elementid, 'relative_urls' => false, 'document_base_url' => $CFG->httpswwwroot, 'content_css' => $contentcss, 'language' => $lang, 'directionality' => $directionality, 'plugin_insertdate_dateFormat ' => $strdate, 'plugin_insertdate_timeFormat ' => $strtime, 'theme' => "advanced", 'skin' => "o2k7", 'skin_variant' => "silver", 'apply_source_formatting' => true, 'remove_script_host' => false, 'entity_encoding' => "raw", 'plugins' => "{$xmedia}advimage,safari,table,style,layer,advhr,advlink,emotions,inlinepopups,searchreplace,paste,directionality,fullscreen,moodlenolink,{$xemoticon}{$xdragmath}nonbreaking,contextmenu,insertdatetime,save,iespell,preview,print,noneditable,visualchars,xhtmlxtras,template,pagebreak,spellchecker", 'theme_advanced_font_sizes' => "1,2,3,4,5,6,7", 'theme_advanced_layout_manager' => "SimpleLayout", 'theme_advanced_toolbar_align' => "left", 'theme_advanced_buttons1' => "fontselect,fontsizeselect,formatselect", 'theme_advanced_buttons1_add' => "|,undo,redo,|,search,replace,|,fullscreen", 'theme_advanced_buttons2' => "bold,italic,underline,strikethrough,sub,sup,|,justifyleft,justifycenter,justifyright", 'theme_advanced_buttons2_add' => "|,cleanup,removeformat,pastetext,pasteword,|,forecolor,backcolor,|,ltr,rtl", 'theme_advanced_buttons3' => "bullist,numlist,outdent,indent,|,link,unlink,moodlenolink,|,image,{$xemoticon}{$xmedia}{$xdragmath}nonbreaking,charmap", 'theme_advanced_buttons3_add' => "table,|,code,spellchecker", 'theme_advanced_fonts' => "Trebuchet=Trebuchet MS,Verdana,Arial,Helvetica,sans-serif;Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,times new roman,times,serif;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times,serif;Verdana=verdana,arial,helvetica,sans-serif;Impact=impact;Wingdings=wingdings", 'theme_advanced_resize_horizontal' => true, 'theme_advanced_resizing' => true, 'theme_advanced_resizing_min_height' => 30, 'theme_advanced_toolbar_location' => "top", 'theme_advanced_statusbar_location' => "bottom", 'spellchecker_rpc_url' => $CFG->wwwroot . "/lib/editor/tinymce/tiny_mce/{$this->version}/plugins/spellchecker/rpc.php", 'spellchecker_languages' => get_config('editor_tinymce', 'spelllanguagelist'));
if ($xemoticon) {
$manager = get_emoticon_manager();
$emoticons = $manager->get_emoticons();
$imgs = array();
// see the TinyMCE plugin moodleemoticon for how the emoticon index is (ab)used :-S
$index = 0;
foreach ($emoticons as $emoticon) {
$imgs[$emoticon->text] = $OUTPUT->render($manager->prepare_renderable_emoticon($emoticon, array('class' => 'emoticon emoticon-index-' . $index++)));
}
$params['moodleemoticon_emoticons'] = json_encode($imgs);
}
if (empty($CFG->xmlstrictheaders) and (!empty($options['legacy']) or !empty($options['noclean']) or !empty($options['trusted']))) {
// now deal somehow with non-standard tags, people scream when we do not make moodle code xtml strict,
// but they scream even more when we strip all tags that are not strict :-(
$params['valid_elements'] = 'script[src|type],*[*]';
// for some reason the *[*] does not inlcude javascript src attribute MDL-25836
$params['invalid_elements'] = '';
}
if (empty($options['legacy'])) {
if (isset($options['maxfiles']) and $options['maxfiles'] != 0) {
$params['file_browser_callback'] = "M.editor_tinymce.filepicker";
}
}
//Add onblur event for client side text validation
if (!empty($options['required'])) {
$params['init_instance_callback'] = 'M.editor_tinymce.onblur_event';
}
return $params;
}
示例15: print_login
public function print_login() {
$keyword = new stdClass();
$keyword->label = get_string('keyword', 'repository_wikimedia').': ';
$keyword->id = 'input_text_keyword';
$keyword->type = 'text';
$keyword->name = 'wikimedia_keyword';
$keyword->value = '';
if ($this->options['ajax']) {
$form = array();
$form['login'] = array($keyword);
$form['nologin'] = true;
$form['norefresh'] = true;
$form['nosearch'] = true;
$form['allowcaching'] = true; // indicates that login form can be cached in filepicker.js
return $form;
} else {
echo <<<EOD
<table>
<tr>
<td>{$keyword->label}</td><td><input name="{$keyword->name}" type="text" /></td>
</tr>
</table>
<input type="submit" />
EOD;
}
}