NAME

Presentation.pm - ïîäïðîãðàììû îòðèñîâêè ýëåìåíòîâ ÃÈÏ.

install_drawer

Çàãðóçêà ãðàôè÷åñêîãî äðàéâåðà. Æåëàòåëüíî âûçûâàòü ïðè ñòàðòå ìàòåðèíñêîãî ýêçåìïëÿðà Apache.

Èñïîëüçîâàíèå

Zanas::install_drawer ('MSIE_5');

drawer_call

Ïðîöåäóðà-"îá¸ðòêà", ïåðåäàþùàÿ âûçîâû íóæíîìó äðàéâåðó. Íå äîëæíà èñïîëüçîâàòüñÿ íàïðÿìóþ.

Èñïîëüçîâàíèå

return drawer_call ('draw_text_cell', @_);

js_escape

Ïðåîáðàçîâàíèå ñòðîêè ñèìâîëîâ â êîððåêòíûé ñ òî÷êè çðåíèÿ javaScript ëèòåðàë.

Èñïîëüçîâàíèå

return js_escape ('Ñòðîêà ïî-ðóññêè');

create_url

Ïðîöåäóðà ãåíåðàöèè url ñ ñîõðàíåíèåì ñåññèè è âñåõ CGI-ïàðàìåòðîâ, êðîìå ÿâíî ïåðåîïðåäåëÿåìûõ è òåõ, èìåíà êîòîðûõ íà÷èíàþòñÿ ñ '_'.

Èñïîëüçîâàíèå

# Òåêóùèé url: /?sid=666&type=foo&_x=1&id=1

my $url = create_url (id => 2, n => 5);

# Òåïåðü $url eq '/?sid=666&type=foo&id=2&n=5'

check_href

Ïðîöåäóðà êîððåêöèè êîìïîíåíòà href çàäàííîãî õýøà, ïåðåäàííîãî ïî ññûëêå, íà ïðåäìåò ðàññòàíîâêè ïàðàìåòðîâ sid è _salt. Äëÿ javascript-ññûëîê îñòàâëÿåò àðãóìåíò áåç èçìåíåíèÿ.

Èñïîëüçîâàíèå

# Òåêóùèé $options: {href => '/?type=foo&_x=1&id=1'}, sid = 666

check_href ($options);

# Òåïåðü $options: {href => '/?type=foo&_x=1&id=1&sid=666&_salt=0.357357387387'}

draw_page

Ïðîöåäóðà îòðèñîâêè ñòðàíèöû â öåëîì. Èñïîëüçóåòñÿ îñíîâíûì îáðàáîò÷èêîì, íå äîëæíà âûçûâàòüñÿ íàïðÿìóþ.

draw_menu

Ïðîöåäóðà ãåíåðàöèè îñíîâíîãî ìåíþ ñèñòåìû. Èñïîëüçóåòñÿ îñíîâíûì îáðàáîò÷èêîì, íå äîëæíà âûçûâàòüñÿ íàïðÿìóþ.

draw_hr

Îòðèñîâêà âåðòèêàòüíîãî ðàçäåëèòåëÿ çàäàííîé âûñîòû.

Ïàðàìåòðû

height

âûñîòà â ïèêñåëÿõ

class

CSS-êëàññ ôîíà, ïî óìîë÷àíèþ - ôîí ñòðàíèöû (bgr8)

Èñïîëüçîâàíèå

draw_hr ({ height => 10 });

draw_text_cell

Îòðèñîâêà êëåòêè òàáëèöû (ïðåäïîëîæèòåëüíî, ïëîñêîé âûáîðêè) ñ çàäàííûì òåêñòîâûì ñîäåðæèìûì. Åñëè çàäàí href áåç íîìåðà ñåññèè, òî îí ïðèïèñûâàåòñÿ àâòîìàòè÷åñêè.

Ïàðàìåòðû

label

òåêñò, îòîáðàæàåìûé â êëåòêå

max_len

îãðàíè÷åíèå äëèíû ñòðîêè. Ïî óìîë÷àíèþ $conf -> {max_len}. Ïî óìîë÷àíèþ 30.

href

(åñëè íå undef) ãèïåðññûëêà ñ òåêñòà

target

öåëåâîå îêíî/ôðåéì äëÿ ññûëêè

attributes

äîïîëíèòåëüíûå HTML-àòðèáóòû äëÿ òåãà td.

a_class

CSS-êëàññ ññûëêè. Ïî óìîë÷àíèþ ðàâåí lnk4.

picture

×èñëîâîé ôîðìàò.

Èñïîëüçîâàíèå

draw_text_cell ({ 
	label   => 1000000,
	picture => '$ ### ### ###',
	href    => '/?type=bank&action=pillage',
	target  => 'invisible',
	max_len => 255,
	attributes => {
		width => '1%',
		align => 'right',
	},
	a_class => 'red_hot_link'
});

draw_text_cells

Èñïîëüçîâàíèå

draw_text_cells ([

	{ 
		label   => 'foo',
	},
	
	{ 
		label   => 1000000,
		picture => '$ ### ### ###',
		href    => '/?type=bank&action=pillage',
		target  => 'invisible',
		max_len => 255,
		attributes => {
			width => '1%',
			align => 'right',
		},
		a_class => 'red_hot_link'
	},

]);

draw_checkbox_cell

Îòðèñîâêà êëåòêè òàáëèöû (ïðåäïîëîæèòåëüíî, ïëîñêîé âûáîðêè) ñ checkbox'îì âíóòðè.

Ïàðàìåòðû

name

èìÿ CGI-ïàðàìåòðà

checked

îòìå÷åí ëè checkbox ïðè îòðèñîâêå

attributes

äîïîëíèòåëüíûå HTML-àòðèáóòû äëÿ òåãà td.

Èñïîëüçîâàíèå

draw_text_cell ({ 
	label   => '$1 000 000',
	href    => '/?type=bank&action=pillage',
	target  => 'invisible',
	max_len => 255,
	attributes => {
		width => '1%',
		align => 'right',
	},
	a_class => 'red_hot_link'
});

draw_tr

Îòðèñîâêà ñòðîêè òàáëèöû èç çàäàííûõ êëåòîê.

Ïàðàìåòðû

Íè÷åãî (ïîêà) íå çíà÷àùèå îïöèè, ïîòîì ñïèñîê HTML-ñòðîê êëåòîê.

Èñïîëüçîâàíèå

draw_tr ({}, $td1, $td2);

draw_one_cell_table

Îáâÿçêà: òàáëèöà 100% øèðèíû ñî âñòðîåííîé ôîðìîé. Ïðåäíàçíà÷åíà äëÿ íåñòàíäàðòíûõ ôîðì ðåäàêòèðîâàíèÿ, êîòîðûå íå óêëàäûâàþòñÿ â ðàìêè draw_form: íàïðèìåð, ôîðì, ãåíåðèðóåìûõ ïîä Excel.

Ïàðàìåòðû

Íè÷åãî (ïîêà) íå çíà÷àùèå îïöèè, ïîòîì âíóòðåííèé HTML.

Èñïîëüçîâàíèå

draw_one_cell_table ({}, $the_very_table);

draw_table

Îòðèñîâêà òàáëèöû äëÿ ïëîñêîé âûáîðêè.

Ïàðàìåòðû

Åñëè ïåðâûé ïàðàìåòð -- ARRAYREF, òî îí ñîäåðæèò ñïèñîê çàãîëîâêîâ.

Ñëåäóþùèé ïàðàìåòð -- callback-ôóíêöèÿ, âûçûâàåìàÿ äëÿ êàæäîé çàïèñè. Çàïèñü âèäíà èç callback'à êàê ïåðåìåííàÿ $i.

Ñëåäóþùèé ïàðàìåòð -- ññûëêà íà ñïèñîê çàïèñåé (recordset).

Ïîñëåäíèé, íåîáÿçàòåëüíûé ïàðàìåòð -- îïöèè.

Îïöèè

off

åñëè èñòèíà, òî áóäåò âîçâðàùåíà ïóñòàÿ ñòðîêà.

Èñïîëüçîâàíèå

draw_table (

	[
		'Íîìåð', 
		{
			label => 'Èìÿ', 
			off => 0, 
			href => 'javaScript:alert("Joke!")'
		}, 
		''
	],
	
	sub {		
		draw_text_cell ({label => $i -> {id}}) . 
		draw_text_cell ({label => $i -> {name}, off => 0}) . 
		draw_row_buttons ({}, [{
			icon => 'delete', 
			label => 'Óäàëèòü', 
			href => "/?type=mytype&action=delete&id=$$i{id}", 
			confirm => "Óäàëèòü $$i{name}?"
		}])				
	},
	
	$data,
	
	{off => @$data == 0}
	
);

draw_path

Îòðèñîâêà ïóòè ê òåêóùåìó îáúåêòó.

Ïàðàìåòðû

Ïåðâûé ïàðàìåòð -- îïöèè:

multiline

åñëè èñòèíà, òî ïóòü ðàçáèâàåòñÿ íà ñòðîêè

id_param

èìÿ ïàðàìåòðà, êîòîðûé ñ÷èòàåòñÿ id ïî óìîë÷àíèþ.

Ïîñëåäíèé ïàðàìåòð -- ññûëêà íà ñïèñîê çàïèñåé ýòàæåé. Îáû÷íî ôîðìèðóåòñÿ â content-ïðîöåäóðå.

Äëÿ êàæäîãî ýòàæà îòîáðàæàåòñÿ êîìïîíåíò name, èç îñòàëüíûõ ôîðìèðóåòñÿ url. Åñëè çàäàí êîìïîíåíò id_param, òî çíà÷åíèå id ïåðåäà¸òñÿ íå êàê 'id', à êàê $id_param. Ýòî òðåáóåòñÿ, íàïðèìåð, åñëè òåêóùèé id íà ïðîøëîì ýòàæå ôèãóðèðîâàë êàê id_rubric.

Èñïîëüçîâàíèå

draw_path ({}, [	
	{type => 'forms', name => 'Ôîðìû'},
	{type => 'forms', name => $form -> {label}, id => $form -> {id}},	
])

draw_window_title

Îòðèñîâêà çàãîëîâêà îêíà.

Ïàðàìåòðû

label

çàãîëîâîê îêíà.

off

åñëè èñòèíà, òî áóäåò âîçâðàùåíà ïóñòàÿ ñòðîêà.

Èñïîëüçîâàíèå

draw_window_title ({
	label => 'Ìî¸ îêíî',
	off   => $no_title,
})

draw_toolbar

Âåðõíÿÿ ïàíåëü ñ êíîïêàìè.

Ïàðàìåòðû

Ïåðâûé ïàðàìåòð -- îïöèè (íå èñïîëüçóåòñÿ, çàðåçåðâèðîâàíî), ïîòîì -- ñïèñîê HTML êíîïîê.

Èñïîëüçîâàíèå

draw_toolbar ({}, 
	
	draw_toolbar_button ({
		icon  => 'create',
		label => 'Äîáàâèòü',
		href  => '?type=mytype&action=create',
	}),
	
)

draw_toolbar_button

Êíîïêà, âñòðàèâàåìàÿ â ïàíåëü. Íîìåð ñåññèè ïðèïèñûâàåòñÿ ê href àâòîìàòè÷åñêè. Öåëåâûì ôðåéìîì ññûëêè âñåãäà ÿâëÿåòñÿ invisible.

Ïàðàìåòðû

icon

íàçâàíèå èêîíêè

label

òåêñòîâàÿ ïîäïèñü

href

ãèïåðññûëêà

off

åñëè èñòèíà, òî áóäåò âîçâðàùåíà ïóñòàÿ ñòðîêà.

Èñïîëüçîâàíèå

draw_toolbar_button ({
	icon  => 'create',
	label => 'Äîáàâèòü',
	href  => '?type=mytype&action=create',
})

draw_toolbar_input_text

Ôîðìà ââîäà êîðîòêîé ñòðîêè, âñòðàèâàåìàÿ â ïàíåëü. Èñïîëüçóåòñÿ äëÿ îðãàíèçàöèè ïîèñêà â äëèííûõ âûáîðêàõ.

Ïàðàìåòðû

icon

íàçâàíèå èêîíêè

label

òåêñòîâàÿ ïîäïèñü

q

èìÿ ââîäèìîãî CGI-ïàðàìåòðà

value

çíà÷åíèå ïî óìîë÷àíèþ

Èñïîëüçîâàíèå

draw_toolbar_input_text ({
	icon   => 'tv',
	label  => 'Èñêàòü',
	name   => 'q',
}),

draw_toolbar_pager

Íàâèãàöèÿ ïî ñòðàíèöàì äëèííîé âûáîðêè (âïåð¸ä-íàçàä, íàäåíî ... èç ...). Âñå ñîäåðæàòåëüíûå ïàðàìåòðû áåðóòñÿ èç url. Íîìåð òåêóùåé ñòðàíèöû óïðàâëÿåòñÿ CGI-ïàðàìåòðîì start.

Ïàðàìåòðû

cnt

êîëè÷åñòâî ñòðîê íà òåêóùåé ñòðàíèöå

total

îáùåå ÷èñëî ñòðîê â âûáîðêå

Èñïîëüçîâàíèå

draw_toolbar_pager ({
	cnt    => 0 + @{$data -> {forms}},
	total  => $data -> {cnt},
})

draw_row_button

Ýòó ôóíêöèþ íå íàäî âûçûâàòü íàïðÿìóþ. Èñïîëüçóéòå draw_row_buttons.

draw_row_buttons

Ðÿä êíîïîê, âñòðàèâàåìûõ â ñòðîêó òàáëèöû.

Ïàðàìåòðû

Ñíà÷àëà îïöèè, ïîòîì -- îïèñàíèÿ êíîïîê. Êàæäîå îïèñàíèå ñîäåðæèò ïîëÿ:

icon

èìÿ èêîíêè

label

îòîáðàæàåìàÿ òåêñòîâàÿ ñòðîêà

Èñïîëüçîâàíèå

draw_row_buttons ({},	[
		{
			icon => 'delete', 
			label => 'Óäàëèòü', 
			href => "/?type=forms\&action=delete_multiple\&n=$$i{n}\&id_form=$$data{id}\&period=" . $_CALENDAR -> period (), 
			confirm => "Óäàëèòü ñòðîêó $$i{n}?",
		},
	]
))

draw_form

Ôîðìà äëÿ ðåäàêòèðîâàíèÿ ñêàëÿðíûõ ïîëåé îáúåêòà. Åñëè îïðåäåëåíà îïöèÿ bottom_toolbar, òî å¸ çíà÷åíèå (HTML, êîòîðûé æåëàòåëüíî ãåíåðèðîâàòü ïðîöåäóðîé draw_centered_toolbar) äîáàâëÿåòñÿ ñíèçó îñíîâíîé òàáëèöû.  ïðîòèâíîì ñëó÷àå íèæíÿÿ ïàíåëü ãåíåðèðóåòñÿ àâòîìàòè÷åñêè è ñîäåðæèò êíîïêè "OK" è "Îòìåíà", ïðè÷¸ì ññûëêà ñ ïîñëåäíåé áåð¸òñÿ èç îïöèè esc.

Ïàðàìåòðû

Îïöèè, äàííûå, îïèñàíèÿ ïîëåé.

Îïöèè:

action

Çíà÷åíèå CGI-ïàðàìåòðà action. Ïî óìîë÷àíèþ 'update'.

type

Çíà÷åíèå CGI-ïàðàìåòðà type. Ïî óìîë÷àíèþ ñîõðàíÿåòñÿ òî æå, ÷òî äëÿ òåêóùåé ñòðàíèöû.

id

Çíà÷åíèå CGI-ïàðàìåòðà id. Ïî óìîë÷àíèþ ñîõðàíÿåòñÿ òî æå, ÷òî äëÿ òåêóùåé ñòðàíèöû.

esc

Ññûëêà, íà êîòîðóþ âåä¸ò êíîïêà 'Îòìåíà', åñëè íå çàäàíà îïöèÿ bottom_toolbar.

name

Èìÿ ôîðìû. Ïî óìîë÷àíèþ 'form'.

Èñïîëüçîâàíèå

draw_form ({esc => "/?type=forms&search=1"}, 
	{
		name   => 'form1',
		period => 1,
	}		
	[
		{
			name  => 'name',
			label => 'Ñèìâîëè÷åñêîå èìÿ',
			mandatory => 1,
			attributes => {
				disabled => '1',
			}
		},
		{
			name   => 'period',
			label  => 'Ïåðèîäè÷íîñòü',
			type   => 'radio',
			values => [
				{id => 1, label => 'Ãîäè÷íàÿ'},
				{id => 3, label => 'Êâàðòàëüíàÿ'},
			],
		},
	]
);

draw_form_field_string

Îòðèñîâêà ïîëÿ ôîðìû òèïà 'string'. Âûçûâàåòñÿ àâòîìàòè÷åñêè èç-ïîä draw_form.

Îïöèè

name

Èìÿ CGI-ïàðàìåòðà è îäíîâðåìåííî êëþ÷à â õýøðåôå $data.

label

Îòîáðàæàåìîå èìÿ

size

Çíà÷åíèå àòðèáóòîâ size è maxlength

draw_form_field_file

Îòðèñîâêà ïîëÿ ôîðìû òèïà 'file'. Âûçûâàåòñÿ àâòîìàòè÷åñêè èç-ïîä draw_form.

Îïöèè

name

Èìÿ CGI-ïàðàìåòðà è îäíîâðåìåííî êëþ÷à â õýøðåôå $data.

label

Îòîáðàæàåìîå èìÿ

size

Çíà÷åíèå àòðèáóòà size

draw_form_field_button

Îòðèñîâêà ïîëÿ ôîðìû òèïà 'button'. Âûçûâàåòñÿ àâòîìàòè÷åñêè èç-ïîä draw_form.

Îïöèè

name

Èìÿ ýëåìåíòà óïðàâëåíèÿ<$data>.

value

Çíà÷åíèå HTML-àòðèáóòà value. Ïî óìîë÷àíèþ ðàâíî name.

onclick

Îáðàáîò÷èê ñîáûòèÿ onclick.

draw_form_field_hgroup

Îòðèñîâêà ïîëÿ ôîðìû òèïà 'text': ãðóïïà ïîëåé, ðàñïîëîæåííûõ â îäíó ñòðîêó ïî ãîðèçîíòàëè. Âûçûâàåòñÿ àâòîìàòè÷åñêè èç-ïîä draw_form.

Îïöèè

label

Îòîáðàæàåìîå èìÿ.

items

Îïèñàíèÿ ïîëåé ââîäà.

draw_form_field_text

Îòðèñîâêà ïîëÿ ôîðìû òèïà 'text': textarea. Âûçûâàåòñÿ àâòîìàòè÷åñêè èç-ïîä draw_form.

Îïöèè

name

Èìÿ CGI-ïàðàìåòðà è îäíîâðåìåííî êëþ÷à â õýøðåôå $data.

label

Îòîáðàæàåìîå èìÿ

rows

Êîëè÷åñòâî ñòðîê. Ïî óìîëàíèþ 25.

cols

Êîë÷èåñòâî ñòîëáöîâ. Ïî óìîëàíèþ 60.

value

Çíà÷åíèå ïî óìîë÷àíèþ.

draw_form_field_hidden

Îòðèñîâêà ïîëÿ ôîðìû òèïà 'text': textarea. Âûçûâàåòñÿ àâòîìàòè÷åñêè èç-ïîä draw_form.

Îïöèè

name

Èìÿ CGI-ïàðàìåòðà è îäíîâðåìåííî êëþ÷à â õýøðåôå $data.

value

Çíà÷åíèå íà òîò ñëó÷àé, åñëè íå !$data{$$options{name}}.

draw_form_field_checkbox

Îòðèñîâêà ïîëÿ ôîðìû òèïà checkbox ñî çíà÷åíèåì 1. Âûçûâàåòñÿ àâòîìàòè÷åñêè èç-ïîä draw_form.

Îïöèè

name

Èìÿ CGI-ïàðàìåòðà è îäíîâðåìåííî êëþ÷à â õýøðåôå $data.

label

Îòîáðàæàåìîå èìÿ

checked

1, åñëè íàäî ôîðñèðîâàííî îòìåòèòü.

draw_form_field_checkboxes

Îòðèñîâêà ãðóïïû ïîëåé ôîðìû òèïà checkbox. Âûçûâàåòñÿ àâòîìàòè÷åñêè èç-ïîä draw_form.

Îïöèè

name

Èìÿ CGI-ïàðàìåòðà è îäíîâðåìåííî êëþ÷à â õýøðåôå $data.

label

Îòîáðàæàåìîå èìÿ

values

Ññûëêà íà ñïèñîê âèäà:

[
	{id => 'çíà÷åíèå 1', label => 'ñòðîêà 1'},
	{id => 'çíà÷åíèå 2', label => 'ñòðîêà 2'},
	
	. . .
	
	{id => 'çíà÷åíèå n', label => 'ñòðîêà n'},
]

draw_form_field_password

Îòðèñîâêà ïîëÿ ôîðìû òèïà 'password'. Âûçûâàåòñÿ àâòîìàòè÷åñêè èç-ïîä draw_form.

Îïöèè

name

Èìÿ CGI-ïàðàìåòðà è îäíîâðåìåííî êëþ÷à â õýøðåôå $data.

label

Îòîáðàæàåìîå èìÿ

draw_form_field_static

Îòðèñîâêà ïîëÿ ôîðìû òèïà 'static': ñîáñòâåííî, ýòî íå ïîëå ââîäà, à ïîêàç çíà÷åíèÿ ïîëÿ. Íóæíî â òîì ñëó÷àå, åñëè ÷àñòü ôîðìû read only. Âûçûâàåòñÿ àâòîìàòè÷åñêè èç-ïîä draw_form.

Îïöèè

name

Èìÿ CGI-ïàðàìåòðà è îäíîâðåìåííî êëþ÷à â õýøðåôå $data.

label

Îòîáðàæàåìîå èìÿ

value

Îòîáðàæàåìîå çíà÷åíèå (åñëè íå îïðåäåëåíî â $data)

hidden_value

Ïåðåäàâàåìîå çíà÷åíèå (äîëæíî îòëè÷àòüñÿ îò value)

values

Ìàïïèíã îò hidden_value ê value.

href

Ãèïåðññûëêà.

target

Öåëåâîå îêíî ãèïåðññûëêè.

a_class

CSS-êëàññ ãèïåðññûëêè.

draw_form_field_radio

Îòðèñîâêà ãðóïïû ðàäèîêíîïîê. Âûçûâàåòñÿ àâòîìàòè÷åñêè èç-ïîä draw_form.

Îïöèè

name

Èìÿ CGI-ïàðàìåòðà è îäíîâðåìåííî êëþ÷à â õýøðåôå $data.

label

Îòîáðàæàåìîå èìÿ

values

Ññûëêà íà ñïèñîê âèäà:

[
	{id => 'çíà÷åíèå 1', label => 'ñòðîêà 1'},
	{id => 'çíà÷åíèå 2', label => 'ñòðîêà 2'},
	
	. . .
	
	{id => 'çíà÷åíèå n', label => 'ñòðîêà n'},
]

draw_form_field_select

Îòðèñîâêà dropdown-ñïèñêà âûáîðà. Âûçûâàåòñÿ àâòîìàòè÷åñêè èç-ïîä draw_form.

Îïöèè

name

Èìÿ CGI-ïàðàìåòðà è îäíîâðåìåííî êëþ÷à â õýøðåôå $data.

label

Îòîáðàæàåìîå èìÿ

values

Ññûëêà íà ñïèñîê âèäà:

[
	{id => 'çíà÷åíèå 1', label => 'ñòðîêà 1'},
	{id => 'çíà÷åíèå 2', label => 'ñòðîêà 2'},
	
	. . .
	
	{id => 'çíà÷åíèå n', label => 'ñòðîêà n'},
]
empty

Åñëè çàäàíà, òî â íà÷àëî ñïèñêà äîáàâëÿåòñÿ ïóñòàÿ ñòðîêà ñ äàííîé ïîäïèñüþ è id=0.

draw_esc_toolbar

Íèæíÿÿ ïàíåëü ñ êíîïêîé "Îòìåíà". Ðèñóåòñÿ àâòîìàòè÷åñêè ïðè âûçîâå draw_form ïðè íàëè÷èè îïöèé esc è no_ok.

draw_ok_esc_toolbar

Íèæíÿÿ ïàíåëü ñ êíîïêàìè "ÎÊ" è "Îòìåíà". Ðèñóåòñÿ àâòîìàòè÷åñêè ïðè âûçîâå draw_form ïðè íàëè÷èè îïöèè esc.

Îïöèè:

esc

Ññûëêà ñ êíîïêè 'îòìåíà'.

name

Èìÿ ôîðìû. Ïî óìîë÷àíèþ 'form'.

draw_back_next_toolbar

Íèæíÿÿ ïàíåëü ñ êíîïêàìè "Íàçàä" è "Äàëåå". Ðèñóåòñÿ àâòîìàòè÷åñêè ïðè âûçîâå draw_form ïðè íàëè÷èè îïöèè back.

draw_close_toolbar

Íèæíÿÿ ïàíåëü ñ êíîïêîé "Çàêðûòü". Ðèñóåòñÿ àâòîìàòè÷åñêè ïðè âûçîâå draw_form ïðè èñòèííîì çíà÷åíèè ïàðàìåòðà __no_navigation.

draw_centered_toolbar_button

Îòðèñîâêà êíîïêè äëÿ ïàíåëè ïîä ôîðìîé (òèïà OK/Cancel èëè Back/Next).

Îïöèè:

href

Ññûëêà ñ êíîïêè. Åñëè íå óêàçàí ïàðàìåòð sid è ññûëêà íå javaScript, òî íîìåð ñåññè ïðèïèñûâàåòñÿ àâòîìàòè÷åñêè.

onclick

Îáðàáîò÷èê ñîáûòèÿ onclick.

target

Öåëåâîå îêíî (ôðåéì) ññûëêè.  îòëè÷èå îò draw_toolbar_button, ïî óìîë÷àíèþ íå invisible, à ïóñòî.

label

Íàäïèñü íà êíîïêå.

icon

Èçîáðàæåíèå íà êíîïêå (çàðåçåðâèðîâàíî, íå èñïîëüçóåòñÿ).

draw_centered_toolbar

Íèæíÿÿ ïàíåëü ñ êíîïêàìè: òðåáóåòñÿ â òåõ ñëó÷àÿõ, êîãäà âìåñòî draw_form èñïîëüçóåòñÿ å¸ àíàëîã.

Ïàðàìåòðû

Îïöèè, äàííûå, îïèñàíèÿ ïîëåé.

Îïöèè:

action

Çíà÷åíèå CGI-ïàðàìåòðà action. Ïî óìîë÷àíèþ 'update'.

esc

Ññûëêà, íà êîòîðóþ âåä¸ò êíîïêà 'îòìåíà'.

Èñïîëüçîâàíèå

draw_centered_toolbar ({}, [
	{
		icon => 'ok',     
		label => 'ïðèìåíèòü', 
		href => '#', 
		onclick => 'document.form.submit()',
	},		
	{	
		icon => 'cancel', 
		label => 'âåðíóòüñÿ', 
		href => "/?type=forms",
	},		
	{
		icon => 'tv', 
		label => 'îïóáëèêîâàòü', 
		href => "javaScript:..."},
	} 
])

draw_auth_toolbar

Îòðèñîâêà âåðõíåé ïàíåëè ñ êàëåíäàð¸ì, èìåíåì ïîëüçîâàòåëÿ è êíîïêîé âûõîäà. Èñïîëüçóåòñÿ ïðè îáùåé îòðèñîâêå ñòðàíèöû, íå äîëæíà âûçûâàòüñÿ íàïðÿìóþ.

draw_calendar

Îòðèñîâêà êàëåíäàðÿ íà âåðõíåé ïàíåëè. Èñïîëüçóåòñÿ ïðè îáùåé îòðèñîâêå ñòðàíèöû, íå äîëæíà âûçûâàòüñÿ íàïðÿìóþ.

draw_form_field_string

Îòðèñîâêà WYSIWYG-ðåäàêòîðà äëÿ HTML. Âûçûâàåòñÿ àâòîìàòè÷åñêè èç-ïîä draw_form. Ðàáîòàåò òîëüêî äëÿ MSIE 5+.

Îïöèè

name

Èìÿ CGI-ïàðàìåòðà è îäíîâðåìåííî êëþ÷à â õýøðåôå $data.

label

Îòîáðàæàåìîå èìÿ

width

Øèðèíà

height

Âûñîòà

2 POD Errors

The following errors were encountered while parsing the POD:

Around line 10:

Non-ASCII character seen before =encoding in 'ïîäïðîãðàììû'. Assuming CP1252

Around line 438:

You forgot a '=back' before '=head2'