本文整理汇总了PHP中print_textarea函数的典型用法代码示例。如果您正苦于以下问题:PHP print_textarea函数的具体用法?PHP print_textarea怎么用?PHP print_textarea使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了print_textarea函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: wiki_print_editor_wiki
/**
* Printing wiki editor.
* Depending on where it is called , action will go to different destinations.
* If it is called from comments section, the return will be in comments section
* in any other case it will be in edit view section.
* @param $pageid. Current pageid
* @param $content. Content to be edited.
* @param $section. Current section, default null
* @param $comesfrom. Information about where the function call is made
* @param commentid. id comment of comment that will be edited.
*/
function wiki_print_editor_wiki($pageid, $content, $editor, $version = -1, $section = null, $upload = false, $deleteuploads = array(), $comesfrom = 'editorview', $commentid = 0) {
global $CFG, $OUTPUT, $PAGE;
if ($comesfrom == 'editcomments') {
$action = $CFG->wwwroot . '/mod/wiki/instancecomments.php?pageid=' . $pageid . '&id=' . $commentid . '&action=edit';
} else if ($comesfrom == 'addcomments') {
$action = $CFG->wwwroot . '/mod/wiki/instancecomments.php?pageid=' . $pageid . '&id=' . $commentid . '&action=add';
} else {
$action = $CFG->wwwroot . '/mod/wiki/edit.php?pageid=' . $pageid;
}
if (!empty($section)) {
$action .= "&section=" . urlencode($section);
}
///Get tags for every element we are displaying
$tag = getTokens($editor, 'bold');
$wiki_editor['bold'] = array('ed_bold.gif', get_string('wikiboldtext', 'wiki'), $tag[0], $tag[1], get_string('wikiboldtext', 'wiki'));
$tag = getTokens($editor, 'italic');
$wiki_editor['italic'] = array('ed_italic.gif', get_string('wikiitalictext', 'wiki'), $tag[0], $tag[1], get_string('wikiitalictext', 'wiki'));
$tag = getTokens($editor, 'link');
$wiki_editor['internal'] = array('ed_internal.gif', get_string('wikiinternalurl', 'wiki'), $tag[0], $tag[1], get_string('wikiinternalurl', 'wiki'));
$tag = getTokens($editor, 'url');
$wiki_editor['external'] = array('ed_external.gif', get_string('wikiexternalurl', 'wiki'), $tag[0], $tag[1], get_string('wikiexternalurl', 'wiki'));
$tag = getTokens($editor, 'list');
$wiki_editor['u_list'] = array('ed_ul.gif', get_string('wikiunorderedlist', 'wiki'), '\\n' . $tag[0], '', '');
$wiki_editor['o_list'] = array('ed_ol.gif', get_string('wikiorderedlist', 'wiki'), '\\n' . $tag[1], '', '');
$tag = getTokens($editor, 'image');
$wiki_editor['image'] = array('ed_img.gif', get_string('wikiimage', 'wiki'), $tag[0], $tag[1], get_string('wikiimage', 'wiki'));
$tag = getTokens($editor, 'header');
$wiki_editor['h1'] = array('ed_h1.gif', get_string('wikiheader', 'wiki', 1), '\\n' . $tag . ' ', ' ' . $tag . '\\n', get_string('wikiheader', 'wiki', 1));
$wiki_editor['h2'] = array('ed_h2.gif', get_string('wikiheader', 'wiki', 2), '\\n' . $tag . $tag . ' ', ' ' . $tag . $tag . '\\n', get_string('wikiheader', 'wiki', 2));
$wiki_editor['h3'] = array('ed_h3.gif', get_string('wikiheader', 'wiki', 3), '\\n' . $tag . $tag . $tag . ' ', ' ' . $tag . $tag . $tag . '\\n', get_string('wikiheader', 'wiki', 3));
$tag = getTokens($editor, 'line_break');
$wiki_editor['hr'] = array('ed_hr.gif', get_string('wikihr', 'wiki'), '\\n' . $tag . '\\n', '', '');
$tag = getTokens($editor, 'nowiki');
$wiki_editor['nowiki'] = array('ed_nowiki.gif', get_string('wikinowikitext', 'wiki'), $tag[0], $tag[1], get_string('wikinowikitext', 'wiki'));
$OUTPUT->heading(strtoupper(get_string('format' . $editor, 'wiki')), 3);
$PAGE->requires->js('/mod/wiki/editors/wiki/buttons.js');
echo $OUTPUT->container_start();
foreach ($wiki_editor as $button) {
echo "<a href=\"javascript:insertTags";
echo "('" . $button[2] . "','" . $button[3] . "','" . $button[4] . "');\">";
echo "<img width=\"23\" height=\"22\" src=\"$CFG->wwwroot/mod/wiki/editors/wiki/images/$button[0]\" alt=\"" . $button[1] . "\" title=\"" . $button[1] . "\" />";
echo "</a>";
}
echo $OUTPUT->container_end();
echo $OUTPUT->container_start();
echo '<form method="post" id="mform1" action="' . $action . '">';
echo $OUTPUT->container(print_textarea(false, 20, 60, 0, 0, "newcontent", $content, 0, true), false, 'wiki_editor');
echo $OUTPUT->container_start();
wiki_print_edit_form_default_fields($editor, $pageid, $version, $upload, $deleteuploads);
echo $OUTPUT->container_end();
echo '</form>';
echo $OUTPUT->container_end();
}
示例2: gen_textarea
function gen_textarea($usehtmleditor, $text = '')
{
// MDL-16018: Don't print htmlarea with < 7 lines height, causes visualization problem
$text = clean_text($text);
$this->field->param3 = $usehtmleditor && $this->field->param3 < 7 ? 7 : $this->field->param3;
return print_textarea($usehtmleditor, $this->field->param3, $this->field->param2, '', '', 'field_' . $this->field->id, $text, '', true, 'field_' . $this->field->id);
}
示例3: toHtml
/**
* Returns the input field in HTML
*
* @return string
*/
function toHtml()
{
if ($this->_flagFrozen) {
return $this->getFrozenHtml();
} else {
return $this->_getTabs() . print_textarea(true, $this->_options['rows'], $this->_options['cols'], $this->_options['width'], $this->_options['height'], $this->getName(), preg_replace("/(\r\n|\n|\r)/", '
', $this->getValue()), 0, true, $this->getAttribute('id'));
}
}
示例4: view
function view($editable, $issueid = 0)
{
$this->getvalue($issueid);
if ($editable) {
print_textarea(true, 10, 60, 680, 400, "element{$this->name}", $this->value);
} else {
echo format_text(format_string($this->value), $this->format);
}
}
示例5: dbmgr_main
function dbmgr_main()
{
echo '<link rel="stylesheet" href="include/styles/dbmanager.css" type="text/css" />';
$sql = (string) get_parameter('sql');
$clean_output = get_parameter("clean_output", 0);
if ($clean_output == 0) {
echo "<h1>" . __('Extensions') . " » " . __('Database interface');
$html_report_image = print_html_report_image("index.php?sec=godmode&sec2=godmode/setup/dbmanager&sql={$sql}", __("Report"));
if ($html_report_image) {
echo " " . $html_report_image;
}
echo "</h1>";
echo '<div class="note_simple">';
echo __("This is an advanced extension to interface with Integria IMS database directly using native SQL sentences. Please note that <b>you can damage</b> your Integria IMS installation if you don't know </b>exactly</b> what are you doing, this means that you can severily damage your setup using this extension. This extension is intended to be used <b>only by experienced users</b> with a depth knowledgue of Integria IMS.");
echo '</div>';
echo "<br />";
echo __("Some samples of usage:") . " <blockquote><em>SHOW STATUS;<br />DESCRIBE tincidencia<br />SELECT * FROM tincidencia<br />UPDATE tincidencia SET sla_disabled = 1 WHERE inicio < '2010-01-10 00:00:00';</em></blockquote>";
echo "<br /><br />";
echo "<form method='post' action=''>";
print_textarea('sql', 5, 50, html_entity_decode($sql, ENT_QUOTES));
echo "<div style='width: 99%; text-align: right; margin-top: 6px;'>";
print_submit_button(__('Execute SQL'), '', false, 'class="sub next"');
echo "</div>";
echo "</form>";
} else {
echo "<form method='post' action=''>";
print_textarea('sql', 2, 40, html_entity_decode($sql, ENT_QUOTES));
echo "<div style='width: 99%; text-align: right; margin-top: 6px;'>";
print_submit_button(__('Execute SQL'), '', false, 'class="sub next"');
echo "</div>";
echo "</form>";
}
// Processing SQL Code
if ($sql == '') {
return;
}
echo "<br />";
echo "<hr />";
echo "<br />";
$error = '';
$result = dbmanager_query($sql, $error);
if ($result === false) {
echo '<strong>An error has occured when querying the database.</strong><br />';
echo $error;
return;
}
if (!is_array($result)) {
echo "<strong>Output: <strong>" . $result;
return;
}
$table->width = '90%';
$table->class = 'dbmanager';
$table->head = array_keys($result[0]);
$table->data = $result;
print_table($table);
}
示例6: toHtml
function toHtml()
{
//if ($this->_canUseHtmlEditor && !$this->_flagFrozen){
// $script = '';
//} else {
// $script='';
//}
if ($this->_flagFrozen) {
return $this->getFrozenHtml();
} else {
return $this->_getTabs() . '<input type="hidden" name="filearea" value="' . $this->_options['filearea'] . '" />' . "\n" . print_textarea($this->_canUseHtmlEditor, $this->_options['rows'], $this->_options['cols'], $this->_options['width'], $this->_options['height'], $this->getName(), preg_replace("/(\r\n|\n|\r)/", '
', $this->getValue()), 0, true, $this->getAttribute('id'));
}
}
示例7: toHtml
function toHtml()
{
//if ($this->_canUseHtmlEditor && !$this->_flagFrozen){
// $script = '';
//} else {
// $script='';
//}
if ($this->_flagFrozen) {
return $this->getFrozenHtml();
} else {
return $this->_getTabs() . print_textarea($this->_canUseHtmlEditor, $this->_options['rows'], $this->_options['cols'], $this->_options['width'], $this->_options['height'], $this->getName(), preg_replace("/(\r\n|\n|\r)/", '
', $this->getValue()), 0, true, $this->getAttribute('id'));
//.$script;
}
}
示例8: toHtml
function toHtml()
{
if ($this->_canUseHtmlEditor && !$this->_flagFrozen) {
ob_start();
use_html_editor($this->getName(), '', $this->getAttribute('id'));
$script = ob_get_clean();
} else {
$script = '';
}
if ($this->_flagFrozen) {
return $this->getFrozenHtml();
} else {
return $this->_getTabs() . print_textarea($this->_canUseHtmlEditor, $this->_options['rows'], $this->_options['cols'], $this->_options['width'], $this->_options['height'], $this->getName(), preg_replace("/(\r\n|\n|\r)/", '
', $this->getValue()), $this->_options['course'], true, $this->getAttribute('id')) . $script;
}
}
示例9: wiki_print_editor_html
/**
* @TODO: Doc this function
*/
function wiki_print_editor_html($pageid, $content, $version = -1, $section = null, $upload = false, $deleteuploads = array())
{
global $CFG, $OUTPUT;
$OUTPUT->heading(strtoupper(get_string('formathtml', 'wiki')), 3);
$action = $CFG->wwwroot . '/mod/wiki/edit.php?pageid=' . $pageid;
if (!empty($section)) {
$action .= "§ion=" . urlencode($section);
}
echo $OUTPUT->container_start('mdl-align');
echo '<form method="post" action="' . $action . '">';
echo $OUTPUT->container(print_textarea(true, 20, 100, 0, 0, "newcontent", $content, 0, true, '', 'form-textarea-advanced'), 'wiki_editor');
wiki_print_edit_form_default_fields('html', $pageid, $version, $upload, $deleteuploads);
echo '</form>';
echo $OUTPUT->container_end();
}
示例10: print_question_formulation_and_controls
function print_question_formulation_and_controls(&$question, &$state, $cmoptions, $options)
{
global $CFG;
static $htmleditorused = false;
$answers =& $question->options->answers;
$readonly = empty($options->readonly) ? '' : 'disabled="disabled"';
// Only use the rich text editor for the first essay question on a page.
$usehtmleditor = can_use_html_editor() && !$htmleditorused;
$formatoptions = new stdClass();
$formatoptions->noclean = true;
$formatoptions->para = false;
$inputname = $question->name_prefix;
$stranswer = get_string("answer", "quiz") . ': ';
/// set question text and media
$questiontext = format_text($question->questiontext, $question->questiontextformat, $formatoptions, $cmoptions->course);
$image = get_question_image($question);
// feedback handling
$feedback = '';
if ($options->feedback && !empty($answers)) {
foreach ($answers as $answer) {
$feedback = format_text($answer->feedback, '', $formatoptions, $cmoptions->course);
}
}
// get response value
if (isset($state->responses[''])) {
$value = stripslashes_safe($state->responses['']);
} else {
$value = "";
}
// answer
if (empty($options->readonly)) {
// the student needs to type in their answer so print out a text editor
$answer = print_textarea($usehtmleditor, 18, 80, 630, 400, $inputname, $value, $cmoptions->course, true);
} else {
// it is read only, so just format the students answer and output it
$safeformatoptions = new stdClass();
$safeformatoptions->para = false;
$answer = format_text($value, FORMAT_MOODLE, $safeformatoptions, $cmoptions->course);
$answer = '<div class="answerreview">' . $answer . '</div>';
}
include "{$CFG->dirroot}/question/type/essay/display.html";
if ($usehtmleditor && empty($options->readonly)) {
use_html_editor($inputname);
$htmleditorused = true;
}
}
示例11: show_edit_label
function show_edit_label($item, $usehtmleditor = false)
{
$item->presentation = isset($item->presentation) ? $item->presentation : '';
?>
<table style="display:inline">
<tr><th><?php
print_string('label', 'feedback');
?>
</th></tr>
<tr>
<td>
<?php
print_textarea($usehtmleditor, 20, 60, 680, 400, "presentation", $item->presentation);
?>
<input type="hidden" id="itemname" name="itemname" value="label" />
</td>
</tr>
</table>
<div style="clear:both"></div>
<?php
if ($usehtmleditor) {
use_html_editor();
}
}
示例12: get_db_all_rows_sql
}
// Linked values
$sql = "SELECT id, label\n\t\tFROM tincident_type_field\t\n\t\tWHERE id_incident_type = {$id_incident_type}\n\t\t\tAND type = 'linked'";
$parents_result = get_db_all_rows_sql($sql);
if ($parents_result == false) {
$parents_result = array();
}
$parents = array();
foreach ($parents_result as $result) {
$parents[$result['id']] = $result['label'];
}
$table->data['id_parent_value'][0] = print_select($parents, 'parent', $parent, '', __('Select parent'), '0', true, 0, true, __("Parent"), $global_field);
$table->data['id_linked_value'][0] = print_textarea('linked_value', 15, 1, $linked_value, '', true, __('Linked value') . integria_help("linked_values", true), $global_field);
if ($global_field) {
$table->data['id_linked_value'][1] = "";
$table->data['id_linked_value'][2] = print_textarea('add_linked_value', 15, 1, $add_linked_value, '', true, __('Add values') . integria_help("linked_values", true));
}
// Buttons
if ($add_field) {
$button = print_input_hidden('add_field', 1, true);
$button .= print_submit_button(__('Create'), 'create_btn', false, 'class="sub next"', true);
} else {
if ($update_field) {
if (!$global_field && ($type != 'linked' || $type != 'combo') || $global_field && ($type == 'linked' || $type == 'combo')) {
$button = print_input_hidden('update_field', 1, true);
$button .= print_input_hidden('add_field', 0, true);
$button .= print_input_hidden('id_field', $id_field, true);
$button .= print_submit_button(__('Update'), 'update_btn', false, 'class="sub upd"', true);
}
}
}
示例13: print_string
<tr valign="top">
<td align="left"><b><?php
print_string('requirement', 'brainstorm');
?>
:</b></td>
<td align="right">
<?php
if ($brainstorm->oprequirementtype == 0) {
?>
<input type="text" size="60" name="config_requirement" value="<?php
echo stripslashes($currentoperator->configdata->requirement);
?>
" />
<?php
} elseif ($brainstorm->oprequirementtype == 2) {
print_textarea($usehtmleditor, 20, 50, 680, 400, 'config_requirement', stripslashes($currentoperator->configdata->requirement));
if (!$usehtmleditor) {
$brainstorm->oprequirementtype = 1;
} else {
$htmleditorneeded = true;
}
} elseif ($brainstorm->oprequirementtype == 1) {
?>
<textarea style="width:100%;height:150px" name="config_requirement"><?php
echo stripslashes($currentoperator->configdata->requirement);
?>
</textarea>
<?php
}
?>
<?php
示例14: __
$table->data[11][1] = "<h4>" . __("Newsletter SMTP Parameters") . "</h4>";
$table->data[12][0] = print_input_text("news_smtp_host", $config["news_smtp_host"], '', 35, 200, true, __('SMTP Host'));
$table->data[12][1] = print_input_text("news_smtp_port", $config["news_smtp_port"], '', 5, 10, true, __('SMTP Port'));
$table->data[13][0] = print_input_text("news_smtp_user", $config["news_smtp_user"], '', 25, 200, true, __('SMTP User'));
$table->data[13][1] = print_input_text("news_smtp_pass", $config["news_smtp_pass"], '', 25, 200, true, __('SMTP Password'));
$table->data[14][0] = print_input_text("news_batch_newsletter", $config["news_batch_newsletter"], '', 4, 255, true, __('Max. emails sent per execution'));
$table->data[14][0] .= print_help_tip(__("This means, in each execution of the batch external process (integria_cron). If you set your cron to execute each hour in each execution of that process will try to send this ammount of emails. If you set the cron to run each 5 min, will try this number of mails."), true);
$table->data[14][1] = print_input_text("batch_email_validation", $config["batch_email_validation"], '', 4, 255, true, __('Newsletter email validation batch'));
$table->data[14][1] .= print_help_tip(__("This means, in each execution of the batch external process (integria_cron) will try to validate this ammount of emails."), true);
$table->data[15][0] = print_checkbox("active_validate", 1, $config["active_validate"], true, __('Activate email validation'));
$table->data[16][1] = "<h4>" . __("Mail general texts") . "</h4>";
$table->colspan[17][0] = 3;
$table->colspan[18][0] = 3;
$table->colspan[19][0] = 3;
$table->data[17][0] = print_textarea("header_email", 5, 40, $config["HEADER_EMAIL"], '', true, __('Email header'));
$table->data[18][0] = print_textarea("footer_email", 5, 40, $config["FOOTER_EMAIL"], '', true, __('Email footer'));
$table->data[19][1] = "<h4>" . __("Mail queue control");
$total_pending = get_db_sql("SELECT COUNT(*) from tpending_mail");
$table->data[19][1] .= " : " . $total_pending . " " . __("mails in queue") . "</h4>";
if ($total_pending > 0) {
$table->colspan[20][0] = 3;
$mail_queue = "<div style='height: 250px; overflow-y: auto;'>";
$mail_queue .= "<table width=100% class=listing>";
$mail_queue .= "<tr><th>" . __("Date") . "<th>" . __("Recipient") . "<th>" . __("Subject") . "<th>" . __("Attempts") . "<th>" . __("Status") . "</tr>";
$mails = get_db_all_rows_sql("SELECT * FROM tpending_mail LIMIT 1000");
foreach ($mails as $mail) {
$mail_queue .= "<tr>";
$mail_queue .= "<td style='font-size: 9px;'>";
$mail_queue .= $mail["date"];
$mail_queue .= "<td>";
$mail_queue .= $mail["recipient"];
示例15: can_use_html_editor
echo '</li>';
echo '</ul>';
echo '</div>';
echo '</div>';
// class="userinfo"
echo '<div id="send">';
echo '<form id="editing" method="post" action="discussion.php">';
$usehtmleditor = can_use_html_editor() && get_user_preferences('message_usehtmleditor', 0);
echo '<h1><label for="edit-message">' . get_string('sendmessage', 'message') . '</label></h1>';
echo '<div>';
if ($usehtmleditor) {
print_textarea(true, 8, 34, 100, 100, 'message', $refreshedmessage);
use_html_editor('message', 'formatblock subscript superscript copy cut paste clean undo redo justifyleft justifycenter justifyright justifyfull lefttoright righttoleft insertorderedlist insertunorderedlist outdent indent inserthorizontalrule createanchor nolink inserttable');
echo '<input type="hidden" name="format" value="' . FORMAT_HTML . '" />';
} else {
print_textarea(false, 8, 50, 0, 0, 'message', $refreshedmessage);
echo '<input type="hidden" name="format" value="' . FORMAT_MOODLE . '" />';
}
echo '</div><div>';
echo '<input type="hidden" name="id" value="' . $user->id . '" />';
echo '<input type="hidden" name="start" value="' . $start . '" />';
echo '<input type="hidden" name="noframesjs" value="' . $noframesjs . '" />';
echo '<input type="hidden" name="last" value="' . time() . '" />';
echo '<input type="hidden" name="sesskey" value="' . $USER->sesskey . '" />';
echo '<input type="submit" value="' . get_string('sendmessage', 'message') . '" /> ';
echo '<input type="submit" name="refresh" value="' . get_string('refresh') . '" />';
echo '<input type="checkbox" name="newonly" id="newonly" ' . ($newonly ? 'checked="checked" ' : '') . '/><label for="newonly">' . get_string('newonlymsg', 'message') . '</label>';
echo '</div>';
echo '</form>';
echo '</div>';
echo '<div id="messages">';