本文整理汇总了PHP中text_area函数的典型用法代码示例。如果您正苦于以下问题:PHP text_area函数的具体用法?PHP text_area怎么用?PHP text_area使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了text_area函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: input
function input($objectName, $method, $object, $options = array())
{
$attr = $object->getAttribute($method);
switch ($attr->type) {
case 'string':
$str = text_field($objectName, $method, $object, $options);
break;
case 'text':
$str = text_area($objectName, $method, $object, $options);
break;
case 'date':
$str = date_select($objectName, $method, $object);
break;
case 'datetime':
$str = date_time_select($objectName, $method, $object);
break;
case 'integer':
$str = text_field($objectName, $method, $object, $options);
break;
case 'float':
$str = text_field($objectName, $method, $object, $options);
break;
case 'boolean':
$str = check_box($objectName, $method, $object, $options);
break;
default:
$str = hidden_field($objectName, $method, $object);
break;
}
return error_wrapping($str, isset($object->errors[$method]));
}
示例2: export
/**
* Weave the current template and show it ready to paste.
*/
static function export()
{
$f = file_get_contents(txpath . self::$template);
foreach (self::$what as $table => $columns) {
$tick = '`';
$cols = empty($columns) ? '*' : $tick . join('`,`', doSlash($columns)) . $tick;
$rs = safe_rows($cols, $table, (empty($columns) ? '1=1' : $columns[0] . ' not like \'%.min%\'') . (empty($columns) ? '' : ' ORDER BY `' . $columns[0] . '`'));
$rows = array();
foreach ($rs as $a) {
// Enforce *nix new-lines
$a = str_replace("\r\n", "\n", $a);
// Literal backslash into corresponding MySQL literal
foreach ($a as &$v) {
$v = addcslashes(addcslashes($v, '\\'), '\\');
}
$a = "'" . join("', '", doSlash($a)) . "'";
$rows[] = self::$where . ' = "INSERT INTO `".PFX."' . $table . '`(' . $cols . ') VALUES(' . $a . ')";';
}
$f = preg_replace("#(// sql:{$table}).*(// /sql:{$table})#s", '$1' . n . join(n, $rows) . n . '$2', $f);
}
echo text_area('code', 600, '', $f, 'code');
echo script_js(<<<EOS
\t\t\$('#code').focus(function() {
\t\t\tthis.select();
\t\t});
EOS
);
}
示例3: simple_wysiwyg
public function simple_wysiwyg($object, $attribute, $options = array(), $with_label = true)
{
if ($options["class"]) {
$options["class"] .= " widgEditor";
} else {
$options["class"] = "widgEditor";
}
return text_area($object, $attribute, $options, $with_label, "Put your content here");
}
示例4: image_edit
function image_edit($message = '', $id = '')
{
if (!$id) {
$id = gps('id');
}
global $txpcfg, $img_dir;
pagetop('image', $message);
$categories = getTree("root", "image");
$rs = safe_row("*", "txp_image", "id='{$id}'");
if ($rs) {
extract($rs);
echo startTable('list'), tr(td('<img src="' . hu . $img_dir . '/' . $id . $ext . '" height="' . $h . '" width="' . $w . '" alt="" />' . br . upload_form(gTxt('replace_image'), 'replace_image_form', 'image_replace', 'image', $id))), tr(td(join('', array($thumbnail ? '<img src="' . hu . $img_dir . '/' . $id . 't' . $ext . '" alt="" />' . br : '', upload_form(gTxt('upload_thumbnail'), 'upload_thumbnail', 'thumbnail_insert', 'image', $id))))), function_exists("imagecreatefromjpeg") ? thumb_ui($id) : '', tr(td(form(graf(gTxt('image_name') . br . fInput('text', 'name', $name, 'edit')) . graf(gTxt('image_category') . br . treeSelectInput('category', $categories, $category)) . graf(gTxt('alt_text') . br . fInput('text', 'alt', $alt, 'edit', '', '', 50)) . graf(gTxt('caption') . br . text_area('caption', '100', '400', $caption)) . graf(fInput('submit', '', gTxt('save'), 'publish')) . hInput('id', $id) . eInput('image') . sInput('image_save')))), endTable();
}
}
示例5: field_html
function field_html($args)
{
switch ($args[2]) {
case 'textarea':
return text_area($args);
case 'checkbox':
case 'radio':
case 'button':
case 'text':
return text_button($args);
case 'submit':
default:
return text_field($args);
}
}
示例6: field_html
function field_html($args, $arrSlide = array())
{
switch ($args['type']) {
case 'textarea':
return text_area($args, $arrSlide);
case 'checkbox':
return checkbox_field($args, $arrSlide);
case 'select':
return select_field($args, $arrSlide);
case 'image':
return image_field($args, $arrSlide);
default:
return text_field($args, $arrSlide);
}
}
示例7: field_html
function field_html($args)
{
switch ($args[2]) {
case 'textarea':
return text_area($args);
case 'checkbox':
// To Do
// To Do
case 'radio':
// To Do
// To Do
case 'text':
default:
return text_field($args);
}
}
示例8: field_html
function field_html($args)
{
switch ($args[2]) {
case 'textarea':
return text_area($args);
case 'checkbox':
// Checkbox
return check_box($args);
case 'background_variant':
// Dropmenu
return background_variant($args);
case 'image_url':
// Image URL
return image_url($args);
case 'text':
default:
return text_field($args);
}
}
示例9: field_html
function field_html($args)
{
switch ($args[2]) {
case 'textarea':
return text_area($args);
case 'checkbox':
// Checkbox
return check_box($args);
case 'dropmenu':
// Checkbox
return dropmenu_sidebaropt($args);
case 'radio':
// To Do
// To Do
case 'text':
default:
return text_field($args);
}
}
示例10: text_field_tag
<td><?php
echo text_field_tag("tag_alias->name", array('size' => 40));
?>
</td>
</tr>
<tr>
<th><label for="tag_alias_alias">Alias to</label></th>
<td><?php
echo text_field_tag("tag_alias->alias", array('size' => 40));
?>
</td>
</tr>
<tr>
<th><label for="tag_alias_reason">Reason</label></th>
<td><?php
echo text_area("tag_alias->reason", array('size' => "40x2"));
?>
</td>
</tr>
<tr>
<td colspan="2"><?php
echo submit_tag("Submit");
?>
</td>
</tr>
</table>
</form>
</div>
<div id="paginator">
<?php
示例11: file_edit
function file_edit($message = '', $id = '')
{
global $txpcfg, $file_base_path, $levels, $path_from_root;
extract(doSlash(gpsa(array('name', 'category', 'permissions', 'description'))));
if (!$id) {
$id = gps('id');
}
pagetop('file', $message);
$categories = getTree("root", "file");
$rs = safe_row("*", "txp_file", "id='{$id}'");
if ($rs) {
extract($rs);
if ($permissions == '') {
$permissions = '-1';
}
$file_exists = file_exists(build_file_path($file_base_path, $filename));
$existing_files = get_filenames();
$status = '<span style="color:';
$status .= $file_exists ? 'green' : 'red';
$status .= '">';
$status .= $file_exists ? gTxt('file_status_ok') : gTxt('file_status_missing');
$status .= '</span>';
$downloadlink = $file_exists ? make_download_link($id, $filename, $filename) : $filename;
$form = '';
if ($file_exists) {
$form = tr(td(form(graf(gTxt('file_category') . br . treeSelectInput('category', $categories, $category)) . graf(gTxt('description') . br . text_area('description', '100', '400', $description)) . graf(fInput('submit', '', gTxt('save'))) . hInput('filename', $filename) . hInput('id', $id) . eInput('file') . sInput('file_save'))));
} else {
$form = tr(tda(hed(gTxt('file_relink'), 3) . file_upload_form(gTxt('upload_file'), 'upload', 'file_replace', $id) . form(graf(gTxt('existing_file') . ' ' . selectInput('filename', $existing_files, "", 1) . fInput('submit', '', gTxt('Save'), 'smallerbox') . eInput('file') . hInput('id', $id) . hInput('category', $category) . hInput('perms', $permissions == '-1' ? '' : $permissions) . hInput('description', $description) . sInput('file_save'))), ' colspan="4" style="border:0"'));
}
echo startTable('list'), tr(td(graf(gTxt('file_status') . br . $status) . graf(gTxt('file_name') . br . $downloadlink) . graf(gTxt('file_download_count') . br . (isset($downloads) ? $downloads : 0)))), $form, endTable();
}
}
示例12: edit_view
function edit_view($id = '')
{
global $txpcfg, $img_dir, $file_max_upload_size;
$out = array();
if (!$id) {
$id = assert_int(gps('id'));
}
extract($this->context);
$categories = tree_get('txp_category', NULL, "type='image'");
$rs = safe_row("*", "txp_image", "id = {$id}");
if ($rs) {
extract($rs);
if ($ext != '.swf') {
$img = '<img src="' . hu . $img_dir . '/' . $id . $ext . '" height="' . $h . '" width="' . $w . '" alt="" "title="' . $id . $ext . ' (' . $w . ' × ' . $h . ')" />';
} else {
$img = '';
}
if ($thumbnail and $ext != '.swf') {
$thumb = '<img src="' . hu . $img_dir . '/' . $id . 't' . $ext . '" alt="" />';
} else {
$thumb = '';
}
$out[] = startTable('edit') . tr(td($img . br . upload_form(gTxt('replace_image'), 'replace_image_form', 'replace', $this->event, $id, $file_max_upload_size, 'image-replace', ''))) . tr(td(join('', array($thumbnail ? $thumb . br : '', upload_form(gTxt('upload_thumbnail'), 'upload_thumbnail', 'thumbnail_insert', $this->event, $id, $file_max_upload_size, 'upload-thumbnail', '')))));
$out[] = check_gd($ext) ? $this->thumb_ui($id, $thumbnail) : '';
$out[] = tr(td(form(graf('<label for="image-name">' . gTxt('image_name') . '</label>' . br . fInput('text', 'name', $name, 'edit', '', '', '', '', 'image-name')) . graf('<label for="image-category">' . gTxt('image_category') . '</label>' . br . categorySelectInput('image', 'category', $category, 'image-category')) . graf('<label for="alt-text">' . gTxt('alt_text') . '</label>' . br . fInput('text', 'alt', $alt, 'edit', '', '', 50, '', 'alt-text')) . graf('<label for="caption">' . gTxt('caption') . '</label>' . br . text_area('caption', '100', '400', $caption, 'caption')) . n . graf(fInput('submit', '', gTxt('save'), 'publish')) . n . hInput('id', $id) . n . eInput($this->event) . n . sInput('save') . n . hInput('sort', $sort) . n . hInput('dir', $dir) . n . hInput('page', $page) . n . hInput('search_method', $search_method) . n . hInput('crit', $crit)))) . endTable();
}
return join('', $out);
}
示例13: prefs
function prefs($event, $step)
{
pagetop('hak_tinymce ' . gTxt('preferences'), $step == 'update' ? gTxt('preferences_saved') : '');
if ($step == 'install') {
// Install the preferences table.
hak_tinymce::install();
}
if ($step == 'uninstall') {
//remove table
safe_query("DROP TABLE " . PFX . "txp_hak_tinymce");
}
if ($step == 'update') {
extract(doSlash(gpsa(array('hak_show_toggle', 'hak_hide_on_textile_edit', 'hak_tinymce_path', 'hak_tinymce_body_init', 'hak_tinymce_excerpt_init', 'hak_tinymce_callbacks', 'hak_hide_textile_select', 'hak_enable_body', 'hak_enable_excerpt', 'hak_use_compressor', 'hak_tinymce_compressor_init'))));
safe_update('txp_hak_tinymce', "pref_value = '{$hak_show_toggle}'", "pref_name = 'show_toggle'");
safe_update('txp_hak_tinymce', "pref_value = '{$hak_hide_on_textile_edit}'", "pref_name = 'hide_on_textile_edit'");
safe_update('txp_hak_tinymce', "pref_value = '{$hak_tinymce_path}'", "pref_name = 'tinymce_path'");
safe_update('txp_hak_tinymce', "pref_value = '{$hak_tinymce_body_init}'", "pref_name = 'body_init'");
safe_update('txp_hak_tinymce', "pref_value = '{$hak_tinymce_excerpt_init}'", "pref_name = 'excerpt_init'");
safe_update('txp_hak_tinymce', "pref_value = '{$hak_tinymce_callbacks}'", "pref_name = 'callbacks'");
safe_update('txp_hak_tinymce', "pref_value = '{$hak_hide_textile_select}'", "pref_name = 'hide_textile_select'");
safe_update('txp_hak_tinymce', "pref_value = '{$hak_enable_body}'", "pref_name = 'enable_body'");
safe_update('txp_hak_tinymce', "pref_value = '{$hak_enable_excerpt}'", "pref_name = 'enable_excerpt'");
safe_update('txp_hak_tinymce', "pref_value = '{$hak_use_compressor}'", "pref_name = 'use_compressor'");
safe_update('txp_hak_tinymce', "pref_value = '{$hak_tinymce_compressor_init}'", "pref_name = 'compressor_init'");
}
if (hak_tinymce::check_install()) {
extract(hak_tinymce::getPrefs());
echo n . t . '<div style="margin: auto; width:40%;">' . n . t . t . hed('hak_tinymce ' . gTxt('Preferences'), '1') . n . n . form(n . eInput('hak_tinymce_prefs') . n . sInput('update') . n . fInput('submit', 'update', 'Update', 'smallerbox') . n . graf(hak_tinymce::mce_gTxt('hak_show_toggle') . br . n . yesnoRadio('hak_show_toggle', $show_toggle) . br . n . tag(tag(hak_tinymce::mce_gTxt('auto_disable'), "em"), "small")) . n . graf(hak_tinymce::mce_gTxt('hak_hide_on_textile_edit') . br . n . yesnoRadio('hak_hide_on_textile_edit', $hide_on_textile_edit)) . n . graf(hak_tinymce::mce_gTxt('hak_hide_textile_select') . br . n . yesnoRadio('hak_hide_textile_select', $hide_textile_select)) . n . graf(hak_tinymce::mce_gTxt('hak_tinymce_path') . br . n . finput('text', 'hak_tinymce_path', $tinymce_path, '', '', '', 60, '', 'hak_tinymce_path') . hak_tinymce::file_exists($tinymce_path)) . n . graf(hak_tinymce::mce_gTxt('enable_body') . br . n . yesnoRadio('hak_enable_body', $enable_body)) . n . graf(hak_tinymce::mce_gTxt('hak_tinymce_body_init') . br . tag(tag("(" . hak_tinymce::mce_gTxt('line_end') . ")", "em"), "small") . n . href(hak_tinymce::mce_gTxt('documentation'), "http://tinymce.moxiecode.com/documentation.php") . br . n . text_area('hak_tinymce_body_init', 200, 400, $body_init)) . n . graf(hak_tinymce::mce_gTxt('enable_excerpt') . br . n . yesnoRadio('hak_enable_excerpt', $enable_excerpt)) . n . graf(hak_tinymce::mce_gTxt('hak_tinymce_excerpt_init') . br . tag(tag("(" . hak_tinymce::mce_gTxt('line_end') . ")", "em"), "small") . n . href(hak_tinymce::mce_gTxt('documentation'), "http://tinymce.moxiecode.com/documentation.php") . br . n . text_area('hak_tinymce_excerpt_init', 200, 400, $excerpt_init)) . n . graf(hak_tinymce::mce_gTxt('hak_tinymce_callbacks') . br . n . text_area('hak_tinymce_callbacks', 200, 400, $callbacks)) . n . graf(hak_tinymce::mce_gTxt('use_compressor') . br . n . yesnoRadio('hak_use_compressor', $use_compressor) . hak_tinymce::file_exists(hak_compressor_path($tinymce_path), "compressor_not_found")) . n . graf(hak_tinymce::mce_gTxt('hak_tinymce_compressor_init') . br . tag(tag("(" . hak_tinymce::mce_gTxt('compressor_line_end') . ")", "em"), "small") . n . href(hak_tinymce::mce_gTxt('documentation'), "http://wiki.moxiecode.com/index.php/TinyMCE:Compressor/PHP") . br . n . text_area('hak_tinymce_compressor_init', 200, 400, $compressor_init)) . n . n . fInput('submit', 'update', 'Update', 'smallerbox')) . '</div>';
echo n . t . '<div style="margin: 60px auto 0; width:40%;">' . n . hed(hak_tinymce::mce_gTxt('uninstall'), '1') . n . t . t . graf(hak_tinymce::mce_gTxt('uninstall_message')) . n . n . form(n . eInput('hak_tinymce_prefs') . n . sInput('uninstall') . n . n . fInput('submit', 'uninstall', 'Uninstall ', 'smallerbox'), "", "confirm('" . hak_tinymce::mce_gTxt('uninstall_confirm') . "')") . '</div>';
} else {
echo n . t . '<div style="margin: auto; width:40%;">' . n . t . t . hed('hak_tinymce ' . gTxt('Preferences'), '1') . n . graf(hak_tinymce::mce_gTxt('install_message')) . n . n . form(n . eInput('hak_tinymce_prefs') . n . sInput('install') . n . n . fInput('submit', 'install', 'Install ', 'smallerbox')) . '</div>';
}
}
示例14: article_partial_description
/**
* Renders description partial.
*
* The rendered widget can be customised via the 'article_ui > description'
* pluggable UI callback event.
*
* @param array $rs Article data
* @return string HTML
*/
function article_partial_description($rs)
{
$out = graf('<label for="description">' . gTxt('description') . '</label>' . popHelp('description') . br . text_area('description', 0, 0, article_partial_description_value($rs), 'description', TEXTAREA_HEIGHT_SMALL, INPUT_LARGE), ' class="description"');
return pluggable_ui('article_ui', 'description', $out, $rs);
}
示例15: image_edit
function image_edit($message = '', $id = '')
{
global $prefs, $file_max_upload_size, $txp_user, $event, $all_image_cats;
if (!$id) {
$id = gps('id');
}
$id = assert_int($id);
$rs = safe_row("*, unix_timestamp(date) as uDate", "txp_image", "id = {$id}");
if ($rs) {
extract($rs);
if (!has_privs('image.edit') && !($author === $txp_user && has_privs('image.edit.own'))) {
image_list(gTxt('restricted_area'));
return;
}
pagetop(gTxt('edit_image'), $message);
extract(gpsa(array('page', 'sort', 'dir', 'crit', 'search_method')));
if ($ext != '.swf') {
$aspect = $h == $w ? ' square' : ($h > $w ? ' portrait' : ' landscape');
$img_info = $id . $ext . ' (' . $w . ' × ' . $h . ')';
$img = '<div class="fullsize-image"><img class="content-image" src="' . imagesrcurl($id, $ext) . "?{$uDate}" . '" alt="' . $img_info . '" title="' . $img_info . '" /></div>';
} else {
$img = $aspect = '';
}
if ($thumbnail and $ext != '.swf') {
$thumb_info = $id . 't' . $ext . ' (' . $thumb_w . ' × ' . $thumb_h . ')';
$thumb = '<img class="content-image" src="' . imagesrcurl($id, $ext, true) . "?{$uDate}" . '" alt="' . $thumb_info . '" ' . ($thumb_w ? 'width="' . $thumb_w . '" height="' . $thumb_h . '" title="' . $thumb_info . '"' : '') . ' />';
} else {
$thumb = '';
if ($thumb_w == 0) {
$thumb_w = get_pref('thumb_w', 0);
}
if ($thumb_h == 0) {
$thumb_h = get_pref('thumb_h', 0);
}
}
echo n . '<div id="' . $event . '_container" class="txp-container">';
echo pluggable_ui('image_ui', 'fullsize_image', $img, $rs), '<section class="txp-edit">', hed(gTxt('edit_image'), 2), pluggable_ui('image_ui', 'image_edit', wrapGroup('image_edit_group', upload_form('', '', 'image_replace', 'image', $id, $file_max_upload_size, 'image_replace', 'image-replace'), 'replace_image', 'replace-image', 'replace_image_form'), $rs), pluggable_ui('image_ui', 'thumbnail_image', '<div class="thumbnail-edit">' . ($thumbnail ? $thumb . n . dLink('image', 'thumbnail_delete', 'id', $id, '', '', '', '', array($page, $sort, $dir, $crit, $search_method)) : '') . '</div>', $rs), pluggable_ui('image_ui', 'thumbnail_edit', wrapGroup('thumbnail_edit_group', upload_form('', '', 'thumbnail_insert', 'image', $id, $file_max_upload_size, 'upload_thumbnail', 'thumbnail-upload'), 'upload_thumbnail', 'thumbnail-upload', 'upload_thumbnail'), $rs), check_gd($ext) ? pluggable_ui('image_ui', 'thumbnail_create', wrapGroup('thumbnail_create_group', form(graf(n . '<label for="width">' . gTxt('thumb_width') . '</label>' . fInput('text', 'width', @$thumb_w, 'input-xsmall', '', '', INPUT_XSMALL, '', 'width') . n . '<label for="height">' . gTxt('thumb_height') . '</label>' . fInput('text', 'height', @$thumb_h, 'input-xsmall', '', '', INPUT_XSMALL, '', 'height') . n . '<label for="crop">' . gTxt('keep_square_pixels') . '</label>' . checkbox('crop', 1, @$prefs['thumb_crop'], '', 'crop') . fInput('submit', '', gTxt('Create')), ' class="edit-alter-thumbnail"') . hInput('id', $id) . eInput('image') . sInput('thumbnail_create') . hInput('sort', $sort) . hInput('dir', $dir) . hInput('page', $page) . hInput('search_method', $search_method) . hInput('crit', $crit), '', '', 'post', 'edit-form', '', 'thumbnail_alter_form'), 'create_thumbnail', 'thumbnail-alter', 'create_thumbnail'), $rs) : '', '<div class="image-detail">', form(inputLabel('image_name', fInput('text', 'name', $name, '', '', '', INPUT_REGULAR, '', 'image_name'), 'image_name') . inputLabel('image_category', treeSelectInput('category', $all_image_cats, $category, 'image_category'), 'image_category') . inputLabel('image_alt_text', fInput('text', 'alt', $alt, '', '', '', INPUT_REGULAR, '', 'image_alt_text'), 'alt_text') . inputLabel('image_caption', text_area('caption', 0, 0, $caption, 'image_caption', TEXTAREA_HEIGHT_SMALL, INPUT_LARGE), 'caption', '', '', '') . pluggable_ui('image_ui', 'extend_detail_form', '', $rs) . graf(fInput('submit', '', gTxt('save'), 'publish')) . hInput('id', $id) . eInput('image') . sInput('image_save') . hInput('sort', $sort) . hInput('dir', $dir) . hInput('page', $page) . hInput('search_method', $search_method) . hInput('crit', $crit), '', '', 'post', 'edit-form', '', 'image_details_form'), '</div>', '</section>' . n . '</div>';
}
}