Line # Revision Author
1 3 ahitrov@rambler.ru package Contenido::Document;
2
3 # ----------------------------------------------------------------------------
4 # ����� ��������
5 # ----------------------------------------------------------------------------
6
7 use strict;
8 use warnings;
9 use locale;
10
11 use base 'Contenido::Object';
12
13 use Utils;
14 use Contenido::Globals;
15 use Data::Dumper;
16
17 sub class_name {
18 return '��������';
19 }
20
21 sub class_description {
22 return '�������� �� ���������';
23 }
24
25 # ���� ���������� �������
26 sub class_table {
27 return 'SQL::DocumentTable';
28 }
29
30 # ----------------------------------------------------------------------------
31 # �����������. ������� ����� ������ ��� ������ � ����������� � ����� ����
32 # ������ PostgreSQL.
33 #
34 # ������ �������������:
35 # Contenido::Document->new()
36 # Contenido::Document->new($keeper)
37 # Contenido::Document->new($keeper, $id)
38 #
39 # ���������� ���� �������� ��������, ���� ��� ����������, ���� ����.
40 # ----------------------------------------------------------------------------
41 sub new {
42 my ($proto, $keeper, $id) = @_;
43 my $class = ref($proto) || $proto;
44 my $self;
45
46 if (defined($id) && ($id>0) && defined($keeper)) {
47 $self=$keeper->get_document_by_id($id, class=>$class);
48 } else {
49 $self = {};
50 bless($self, $class);
51 $self->init();
52 $self->class($class);
53 $self->keeper($keeper) if (ref $keeper);
54 }
55 return $self;
56 }
57
58 # ���������� ������� ������ (������)...
59 # ��� ����� ��� ���������� ��� ;))
60 # �������� ������� ��� �� �������� � ������ ��� ��� ����
61 sub section {
62 shift @{[shift->sections()]};
63 }
64
65
66 ####
67 # ��������� ����� ��� ����������� �����, �� ������� ����� ������.
68 # ���������������� � ����������, ���������� ������ �������� �����.
69 ##################################################################
70 sub search_fields {
71 return ('name');
72 }
73
74 ####
75 # ��������� ����� ��� �������� ����� � ���������� ������ �������,
76 # ��������� � ������ ���������� ������ ������-�-������ �� ����
77 # field ��������� ������ class � id ������� ���������
78 #
79 # ������:
80 # {
81 # name => '�������� �����',
82 # class => 'project::Class',
83 # filter => 'filter_name'
84 # field => 'table_field'
85 # }
86 #
87 ##################################################################
88 sub table_links {
89 return undef;
90 }
91
92
93 ####
94 # ��������� ������������ Jevix
95 ##################################################################
96 sub jevix_conf
97 {
98 my $jevix_conf = {
99 isHTML => 1, # �������� � ������ ����������� (� ������ �������� ������ �������� �������)
100 lineBreaks => 0, # ����������� �������� ����� <br />
101 paragraphs => 0, # ��������� ��������� <p>
102 dashes => 1, # ����
103 dots => 1, # ����������
104 edgeSpaces => 1, # ������� ���������� ������� � ������ � ����� ������
105 tagSpaces => 1, # ������� ������� ����� ������ (</td> <td>)
106 multiSpaces => 1, # ���������� ������������� ������� � ���������
107 redundantSpaces => 1, # ������� ������� ���, ��� �� �� ������ ����
108 compositeWords => 0, # ��������� ��������� ����� � ��� <nobr>
109 compositeWordsLength => 10, # ������������ ����� ���������� �����, ������������ � ��� <nobr>
110 nbsp => 0, # ����������� ����������� �������
111 quotes => 1, # �������� �������
112 qaType => 0, # ��� ������� ������� (��. ��������� ����������� ���������� �� http://jevix.ru/)
113 qbType => 1, # ��� ��������� �������
114 misc => 1, # ������ ������ (&copy, ����� � ������)
115 codeMode => 2, # ������ ��������� ����. �������� (0: ANSI <...>, 1: HTML-��� <&#133;>, 2: HTML-�������� <&hellip;>)
116 tagsDenyAll => 0, # �� ��������� ��������� ��� ����
117 tagsDeny => 'script', # ������ �����ݣ���� �����
118 tagsAllow => '', # ������ �����ۣ���� ����� (��������� ��, ����� ���������� ������ ����)
119 tagCloseSingle => 0, # ��������� ��������� ����, ����� ��� �� �������
120 tagNamesToLower => 0, # ��������� ����� ����� � ������� ��������
121 tagNamesToUpper => 0, # ��������� ����� ����� � �������� ��������
122 tagAttributesToLower => 0, # ��������� ����� ��������� ����� � ������� ��������
123 tagAttributesToUpper => 0, # ��������� ����� ��������� ����� � �������� ��������
124 tagQuoteValues => 0, # �������� � ������� �������� ��������� �����
125 tagUnQuoteValues => 0, # ������� ������� ������ �������� ��������� �����
126 simpleXSS => 1, # �������� ��������� XSS-���� � ���� ���������
127 checkHTML => 0, # ��������� ����������� HTML
128 logErrors => 0 # ����� ������ ������
129 };
130 return $jevix_conf;
131 }
132
133
134 1;
135