本文整理汇总了PHP中form_textarea函数的典型用法代码示例。如果您正苦于以下问题:PHP form_textarea函数的具体用法?PHP form_textarea怎么用?PHP form_textarea使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了form_textarea函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: search_form_widget_form
function search_form_widget_form($num = 1)
{
$widget = 'search_form_widget_' . $num;
// имя для формы и опций = виджет + номер
// получаем опции
$options = mso_get_option($widget, 'plugins', array());
if (!isset($options['header'])) {
$options['header'] = '';
}
if (!isset($options['text'])) {
$options['text'] = t('Что искать?');
}
if (!isset($options['submit'])) {
$options['submit'] = t('Поиск');
}
if (!isset($options['style_text'])) {
$options['style_text'] = '';
}
if (!isset($options['style_submit'])) {
$options['style_submit'] = '';
}
if (!isset($options['text_posle'])) {
$options['text_posle'] = '';
}
// вывод самой формы
$CI =& get_instance();
$CI->load->helper('form');
$form = mso_widget_create_form(t('Заголовок'), form_input(array('name' => $widget . 'header', 'value' => $options['header'])));
$form .= mso_widget_create_form(t('Текст подсказки'), form_input(array('name' => $widget . 'text', 'value' => $options['text'])));
$form .= mso_widget_create_form(t('Текст на кнопке'), form_input(array('name' => $widget . 'submit', 'value' => $options['submit'])));
$form .= mso_widget_create_form(t('CSS-стиль текста'), form_input(array('name' => $widget . 'style_text', 'value' => $options['style_text'])));
$form .= mso_widget_create_form(t('CSS-стиль кнопки'), form_input(array('name' => $widget . 'style_submit', 'value' => $options['style_submit'])));
$form .= mso_widget_create_form(t('Текст внизу'), form_textarea(array('name' => $widget . 'text_posle', 'value' => $options['text_posle'], 'rows' => '3')));
return $form;
}
示例2: build
/**
* build (only) the field (widhout labels or borders)
*
* @access public
* @return void
*/
function build()
{
$output = "";
if (!isset($this->cols)) {
$this->cols = 42;
}
if (!isset($this->rows)) {
$this->rows = 15;
}
$this->_getValue();
switch ($this->status) {
case "disabled":
case "show":
if (!isset($this->value)) {
$output = RAPYD_FIELD_SYMBOL_NULL;
} elseif ($this->value == "") {
$output = "";
} else {
$output = '<span style="font-size:9px; width: 100%; height:100px; overflow: auto">' . nl2br(htmlspecialchars($this->value)) . '</span>';
//I know I know..
}
break;
case "create":
case "modify":
$attributes = array('name' => $this->name, 'id' => $this->name, 'cols' => $this->cols, 'rows' => $this->rows, 'onclick' => $this->onclick, 'onchange' => $this->onchange, 'class' => $this->css_class, 'style' => $this->style);
$output = form_textarea($attributes, $this->value) . $this->extra_output;
break;
case "hidden":
$output = form_hidden($this->name, $this->value);
break;
default:
}
$this->output = $output;
}
示例3: generateForm
function generateForm()
{
$output = form_hidden('edit[step]', 'confirm');
$player = $this->registration->user();
if (!$player) {
return false;
}
$noneditable = array();
$noneditable[] = array('Name', l($player->fullname, url("person/view/{$player->id}")));
$noneditable[] = array('Member ID', $player->member_id);
$noneditable[] = array('Event', l($this->event->name, url("event/view/{$this->event->registration_id}")));
$noneditable[] = array('Registered Price', $this->registration->total_amount);
$form = '<div class="pairtable">' . table(NULL, $noneditable) . '</div>';
$pay_opts = getOptionsFromEnum('registrations', 'payment');
array_shift($pay_opts);
$form .= form_select('Registration Status', 'edit[payment]', $this->registration->payment, $pay_opts);
$form .= form_textarea('Notes', 'edit[notes]', $this->registration->notes, 45, 5);
$output .= form_group('Registration details', $form);
if ($this->formbuilder) {
$this->formbuilder->bulk_set_answers_sql('SELECT qkey, akey FROM registration_answers WHERE order_id = ?', array($this->registration->order_id));
if (count($this->formbuilder->_answers) > 0) {
$output .= form_group('Registration answers', $this->formbuilder->render_editable(true));
} else {
$output .= form_group('Registration answers', $this->formbuilder->render_editable(false));
}
}
$output .= form_submit('Submit') . form_reset('Reset');
return form($output);
}
示例4: form_control
function form_control(&$setting)
{
switch ($setting->type) {
default:
case 'text':
$form_control = form_input(array('id' => $setting->slug, 'name' => $setting->slug, 'value' => $setting->value, 'class' => 'text width-20'));
break;
case 'textarea':
$form_control = form_textarea(array('id' => $setting->slug, 'name' => $setting->slug, 'value' => $setting->value, 'class' => 'width-20'));
break;
case 'password':
$form_control = form_password(array('id' => $setting->slug, 'name' => $setting->slug, 'value' => $setting->value, 'class' => 'text width-20'));
break;
case 'select':
$form_control = form_dropdown($setting->slug, $this->_format_options($setting->options), $setting->value, 'class="width-20"');
break;
case 'checkbox':
case 'radio':
$func = $setting->type == 'checkbox' ? 'form_checkbox' : 'form_radio';
$form_control = '';
foreach ($this->_format_options($setting->options) as $value => $label) {
$form_control .= ' ' . form_radio(array('id' => $setting->slug, 'name' => $setting->slug, 'checked' => $setting->value == $value, 'value' => $value)) . ' ' . $label;
}
break;
}
return $form_control;
}
示例5: foundation_form_input
function foundation_form_input($name, $args = array())
{
$isValid = form_error($name) ? false : true;
if (!empty($args['default_value'])) {
$default_value = $args['default_value'];
} else {
$default_value = null;
}
$class = !empty($args['class']) ? $args['class'] : '';
$node = "<label>" . humanize($name);
if (!empty($args['as'])) {
switch ($args['as']) {
case 'collection':
if (!empty($args['collection'])) {
if ($args['allow_blank']) {
$args['collection'] = array_merge(array(" " => " "), $args['collection']);
}
$node .= form_dropdown($name, $args['collection'], set_value($name));
}
break;
case 'text':
$node .= form_textarea($name, set_value($name, $default_value));
break;
default:
# ...
break;
}
} else {
$node .= form_input($name, set_value($name, $default_value));
}
$node .= form_error($name, '<div class="error">', '</div>');
$node .= "</label>";
return $node;
}
示例6: build
/**
* build (only) the field (widhout labels or borders)
*
* @access public
* @return void
*/
function build()
{
$output = "";
if (!isset($this->cols)) {
$this->cols = 42;
}
if (!isset($this->rows)) {
$this->rows = 15;
}
$this->_getValue();
switch ($this->status) {
case "disabled":
case "show":
if (!isset($this->value)) {
$output = RAPYD_FIELD_SYMBOL_NULL;
} elseif ($this->value == "") {
$output = "";
} else {
$output = '<div style=" font: 11px \'courier new\',tahoma; color: #111; width: 100%; overflow: auto"><pre>' . htmlspecialchars($this->value) . '</pre></div>';
}
break;
case "create":
case "modify":
$attributes = array('name' => $this->name, 'id' => $this->name, 'cols' => $this->cols, 'rows' => $this->rows, 'onclick' => $this->onclick, 'onchange' => $this->onchange, 'class' => $this->css_class, 'style' => 'font-size:9px;font: 11px \'courier new\',tahoma; color: #111;');
$output = form_textarea($attributes, $this->value) . $this->extra_output;
break;
case "hidden":
$output = "";
//form_hidden($this->name, $this->value);
break;
default:
}
$this->output = $output;
}
示例7: centinelas
function centinelas()
{
$this->load->helper('directory');
$this->load->library('table');
$tmpl = array('row_start' => '<tr valign="top">');
$this->table->set_template($tmpl);
$map = directory_map('./system/logs/');
$lista = array();
foreach ($map as $file) {
if ($file != 'index.html') {
$lista[] = anchor("supervisor/mantenimiento/borracentinela/{$file}", 'X') . " <a href='javascript:void(0)' onclick=\"carga('{$file}')\" >{$file}</a>";
}
}
$copy = "<br><a href='javascript:void(0)' class='mininegro' onclick=\"copiar()\" >Copiar texto</a>";
$tadata = array('name' => 'sql', 'id' => 'log', 'rows' => '20', 'cols' => '60');
$form = form_open('ejecutasql/filteredgrid/process') . form_textarea($tadata) . '<br>' . form_submit('mysubmit', 'Ejecutar como SQL') . form_close();
$this->table->add_row(ul($lista), '<b id="fnom">Seleccione un archivo de centinela</b><br>' . $form);
$link = site_url('supervisor/mantenimiento/vercentinela');
$data['script'] = "<script>\n\t\t function carga(arch){\n\t\t link='{$link}'+'/'+arch;\n\t\t //alert(link);\n\t\t \$('#fnom').text(arch);\n\t\t \$('#log').load(link);\n\t\t };\n\t\t function copiar(){\n\t\t \$('#log').copy();\n\t\t };\n\t\t</script>";
$data['content'] = $this->table->generate();
$data['title'] = " Centinelas ";
//script('plugins/jquery.clipboard.pack.js')
$data["head"] = script("jquery.pack.js") . script('plugins/jquery.copy.min.js') . $this->rapyd->get_head() . style('marcos.css') . style('estilos.css');
$this->load->view('view_ventanas', $data);
}
示例8: display_settings
/**
* Display settings sub-form for this variable type
*
* @param mixed $var_id The id of the variable: 'new' or numeric
* @param array $var_settings The settings of the variable
* @return array
*/
function display_settings($var_id, $var_settings)
{
// -------------------------------------
// Init return value
// -------------------------------------
$r = array();
// -------------------------------------
// Build setting: options
// -------------------------------------
$options = $this->get_setting('options', $var_settings);
$r[] = array($this->setting_label(lang('variable_options'), lang('variable_options_help')), form_textarea(array('name' => $this->input_name('options'), 'value' => $options, 'rows' => '7', 'cols' => '40', 'style' => 'width:75%')));
// -------------------------------------
// Build setting: multiple?
// -------------------------------------
$multiple = $this->get_setting('multiple', $var_settings);
$r[] = array($this->setting_label(lang('allow_multiple_items')), '<label class="low-checkbox">' . form_checkbox($this->input_name('multiple'), 'y', $multiple == 'y', 'class="low-allow-multiple"') . lang('allow_multiple_items_label') . '</label>');
// -------------------------------------
// Build setting: separator
// -------------------------------------
$separator = $this->get_setting('separator', $var_settings);
$r[] = array($this->setting_label(lang('separator_character')), $this->separator_select($separator));
// -------------------------------------
// Build setting: multi interface
// -------------------------------------
$multi_interface = $this->get_setting('multi_interface', $var_settings);
$r[] = array($this->setting_label(lang('multi_interface')), $this->interface_select($multi_interface));
// -------------------------------------
// Return output
// -------------------------------------
return $r;
}
示例9: form_output
/**
* Output form input
*
* @param array
* @param array
* @return string
*/
public function form_output($data)
{
$options['name'] = $data['form_slug'];
$options['id'] = $data['form_slug'];
$options['value'] = $data['value'];
return form_textarea($options);
}
示例10: form_fckeditor
function form_fckeditor($data = '', $value = '', $extra = '')
{
$CI =& get_instance();
$fckeditor_basepath = $CI->config->item('fckeditor_basepath');
require_once $_SERVER["DOCUMENT_ROOT"] . '/' . $fckeditor_basepath . 'fckeditor.php';
$instanceName = is_array($data) && isset($data['name']) ? $data['name'] : $data;
$fckeditor = new FCKeditor($instanceName);
if ($fckeditor->IsCompatible()) {
$fckeditor->Value = html_entity_decode($value);
$fckeditor->BasePath = $fckeditor_basepath;
if ($fckeditor_toolbarset = $CI->config->item('fckeditor_toolbarset_default')) {
$fckeditor->ToolbarSet = $fckeditor_toolbarset;
}
if (is_array($data)) {
if (isset($data['value'])) {
$fckeditor->Value = html_entity_decode($data['value']);
}
if (isset($data['basepath'])) {
$fckeditor->BasePath = $data['basepath'];
}
if (isset($data['toolbarset'])) {
$fckeditor->ToolbarSet = $data['toolbarset'];
}
if (isset($data['width'])) {
$fckeditor->Width = $data['width'];
}
if (isset($data['height'])) {
$fckeditor->Height = $data['height'];
}
}
return $fckeditor->CreateHtml();
} else {
return form_textarea($data, $value, $extra);
}
}
示例11: display_field
function display_field($data)
{
// Set a boolean telling if we're in Grid AND this textarea has
// markItUp enabled
$grid_markitup = $this->content_type() == 'grid' && isset($this->settings['show_formatting_buttons']) && $this->settings['show_formatting_buttons'] == 1;
if ($grid_markitup) {
// Load the Grid cell display binding only once
if (!ee()->session->cache(__CLASS__, 'grid_js_loaded')) {
ee()->javascript->output('
Grid.bind("textarea", "display", function(cell)
{
var textarea = $("textarea.markItUp", cell);
// Only apply file browser trigger if a field was found
if (textarea.size())
{
textarea.markItUp(mySettings);
EE.publish.file_browser.textarea(cell);
}
});
');
ee()->session->set_cache(__CLASS__, 'grid_js_loaded', TRUE);
}
}
return form_textarea(array('name' => $this->name(), 'value' => $data, 'rows' => $this->settings['field_ta_rows'], 'dir' => $this->settings['field_text_direction'], 'class' => $grid_markitup ? 'markItUp' : ''));
}
示例12: test_form_textarea
public function test_form_textarea()
{
$expected = <<<EOH
<textarea name="notes" cols="40" rows="10" >Notes</textarea>
EOH;
$this->assertEquals($expected, form_textarea('notes', 'Notes'));
}
示例13: ShiftType_edit_view
function ShiftType_edit_view($name, $angeltype_id, $angeltypes, $description, $shifttype_id)
{
$angeltypes_select = ['' => _('All')];
foreach ($angeltypes as $angeltype) {
$angeltypes_select[$angeltype['id']] = $angeltype['name'];
}
return page_with_title($shifttype_id ? _('Edit shifttype') : _('Create shifttype'), [msg(), buttons([button(page_link_to('shifttypes'), shifttypes_title(), 'back')]), form([form_text('name', _('Name'), $name), form_select('angeltype_id', _('Angeltype'), $angeltypes_select, $angeltype_id), form_textarea('description', _('Description'), $description), form_info('', _('Please use markdown for the description.')), form_submit('submit', _('Save'))])]);
}
示例14: ShiftEntry_edit_view
/**
* Display form for adding/editing a shift entry.
* @param string $angel
* @param string $date
* @param string $location
* @param string $title
* @param string $type
* @param string $comment
*
* @return string
*/
function ShiftEntry_edit_view($angel, $date, $location, $title, $type, $comment, $freeloaded, $freeload_comment, $user_admin_shifts = false)
{
if ($user_admin_shifts) {
$freeload_form = array(form_checkbox('freeloaded', _("Freeloaded"), $freeloaded), form_textarea('freeload_comment', _("Freeload comment (Only for shift coordination):"), $freeload_comment));
} else {
$freeload_form = array();
}
return page_with_title(_("Edit shift entry"), array(form(array(form_info(_("Angel:"), $angel), form_info(_("Date, Duration:"), $date), form_info(_("Location:"), $location), form_info(_("Title:"), $title), form_info(_("Type:"), $type), form_textarea('comment', _("Comment (for your eyes only):"), $comment), join("", $freeload_form), form_submit('submit', _("Save"))))));
}
示例15: bsText
function bsText($title, $name, $value = '', $rows = 0, $cols = 0)
{
$cols = $cols == 0 ? 60 : $cols;
$rows = $rows == 0 ? 3 : $rows;
$data = array('name' => $name, 'id' => 'input_' . $name, 'value' => $value, 'class' => 'form-control', 'rows' => $rows, 'cols' => $cols);
$inp = form_textarea($data);
$str = '<div class="form-group">
<label for="input_' . $name . '">' . $title . '</label>' . $inp . '</div>';
return $str;
}