forked from Sigsiu-NET/SobiPro
/
info.php
151 lines (132 loc) · 3.93 KB
/
info.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<?php
/**
* @package: SobiPro Component for Joomla!
* @author
* Name: Sigrid Suski & Radek Suski, Sigsiu.NET GmbH
* Email: sobi[at]sigsiu.net
* Url: https://www.Sigsiu.NET
* @copyright Copyright (C) 2006 - 2015 Sigsiu.NET GmbH (https://www.sigsiu.net). All rights reserved.
* @license GNU/GPL Version 3
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 3
* as published by the Free Software Foundation, and under the additional terms according section 7 of GPL v3.
* See http://www.gnu.org/licenses/gpl.html and https://www.sigsiu.net/licenses.
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*/
defined( 'SOBIPRO' ) || exit( 'Restricted access' );
SPLoader::loadClass( 'opt.fields.inbox' );
/**
* @author Radek Suski
* @version 1.0
* @created 09-Sep-2009 12:52:45 PM
*/
class SPField_Info extends SPField_Inbox implements SPFieldInterface
{
/** * @var string */
protected $cssClass = 'spClassInfo';
/** * @var string */
protected $cssClassEdit = 'spClassEditInfo';
/** * @var string */
protected $cssClassView = 'spClassViewInfo';
protected $viewInfo = '';
protected $entryInfo = '';
/** * @var int */
protected $bsWidth = 10;
public function __construct ( &$field ) {
parent::__construct( $field );
$this->viewInfo = SPLang::getValue( $this->nid . '-viewInfo', 'field_information', Sobi::Section(), null, null, $this->fid );
$this->entryInfo = SPLang::getValue( $this->nid . '-entryInfo', 'field_information', Sobi::Section(), null, null, $this->fid );
}
/**
* Shows the field in the edit entry or add entry form
* @param bool $return return or display directly
* @return string
*/
public function field( $return = false )
{
if ( !( $this->enabled ) ) {
return false;
}
$data = SPLang::getValue( $this->nid . '-entryInfo', 'field_information', Sobi::Section(), null, null, $this->fid );
$class = $this->cssClass . (strlen($this->cssClassEdit) ? ' ' . $this->cssClassEdit : '');
$field = '<div class="' . $class . '">' . $data . '</div>';
if ( !$return ) {
echo $field;
}
else {
return $field;
}
}
/**
* @return array
* Ausgabe des Feldes in DV and vCard
*/
public function struct()
{
$data = SPLang::getValue( $this->nid . '-viewInfo', 'field_information', Sobi::Section(), null, null, $this->fid );
$attributes = array();
if ( strlen( $data ) ) {
$this->cssClass = strlen( $this->cssClass ) ? $this->cssClass : 'spFieldsData';
$this->cssClass = $this->cssClass . ' ' . $this->nid;
$this->cleanCss();
$attributes = array(
'lang' => Sobi::Lang(),
'class' => $this->cssClass
);
}
else {
$this->cssClass = strlen( $this->cssClass ) ? $this->cssClass : 'spField';
}
return array(
'_complex' => 1,
'_data' => $data,
'_attributes' => $attributes
);
}
/**
* @param SPEntry $entry
* @param string $request
* @throws SPException
* @return string
*/
private function verify( $entry, $request )
{
}
/**
* Gets the data for a field, verify it and pre-save it.
* @param SPEntry $entry
* @param string $tsId
* @param string $request
* @return void
*/
public function submit( &$entry, $tsId = null, $request = 'POST' )
{
return array();
}
/**
* Returns the parameter list
* @return array
* Speichern der nicht übersetzbaren Elemente
*/
protected function getAttr()
{
return array( 'cssClassView', 'cssClassEdit', 'showEditLabel', 'bsWidth' );
}
/**
* Gets the data for a field and save it in the database
* @param SPEntry $entry
* @param string $request
* @return bool
*/
public function saveData( &$entry, $request = 'POST' )
{
return false;
}
/**
* @return bool
*/
public function searchData( $request, $section )
{
return false;
}
}