51 |
$this->add_hidden_element( 't', 'News' ); |
$this->add_hidden_element( 't', 'News' ); |
52 |
$this->add_hidden_element( 'sub_lang', $_REQUEST['sub_lang'] ); |
$this->add_hidden_element( 'sub_lang', $_REQUEST['sub_lang'] ); |
53 |
|
|
54 |
$this->add_element( new FEText("Titel", true, 10, 20)); |
$this->add_element( new FEText("Titel", true, 50, 255)); |
55 |
$this->add_element( new FETextArea("kurzer Text", true, 10, 20)); |
$this->add_element( new FETextArea("kurzer Text", true, 10, 50, 50)); |
56 |
$this->add_element( new FETextArea("langer Text", true, 10, 20)); |
$this->add_element( new FETextArea("langer Text", true, 10, 50, 50)); |
57 |
$this->add_element( new FEText("Quelle", true, 10, 20)); |
$this->add_element( new FEText("Quelle", true, 50, 255)); |
58 |
|
|
59 |
$handle=opendir ($app->getConfig("path.news.img.archive")); |
$handle=opendir ($app->getConfig("path.news.img.archive")); |
60 |
$myFileList= array(); |
$myFileList= array(); |
63 |
} |
} |
64 |
closedir($handle); |
closedir($handle); |
65 |
|
|
66 |
$this->add_element( new FEListBox("Bilderarchiv", FALSE,"200px", "80px",$myFileList)); |
$this->add_element( new FEListBox("Bilderarchiv", FALSE,"300px", "150px",$myFileList)); |
67 |
|
|
68 |
} |
} |
69 |
function form_init_data() { |
function form_init_data() { |
141 |
// Implement some error-handling there or somewhere. |
// Implement some error-handling there or somewhere. |
142 |
$error = $this->data_prefetch(); |
$error = $this->data_prefetch(); |
143 |
|
|
|
//$error = $this->_datasource->set($item); |
|
|
/* if(!$error) { |
|
|
// fetch fresh data |
|
|
$this->_options['data_locator_meta']['action'] = "read"; |
|
|
// unset previous initialed 'data' var |
|
|
$this->_options['data_locator_meta']['data'] = NULL; |
|
|
$this->data_prefetch(); |
|
|
|
|
|
$this->set_action_message($this->_confirm_msg); |
|
|
return TRUE; |
|
|
} else { |
|
|
return FALSE; |
|
|
}*/ |
|
|
global $app; |
|
144 |
|
|
145 |
// This contains the image-file that has to be moved from the archive-dir to the online-dir. |
// This contains the image-file that has to be moved from the archive-dir to the online-dir. |
146 |
// The name of the file has to be changed to the name which is hardcoded in the news-templates. |
// The name of the file has to be changed to the name which is hardcoded in the news-templates. |
148 |
// Make sure that this will be removed also, so that there is only one file matching in the online-dir. |
// Make sure that this will be removed also, so that there is only one file matching in the online-dir. |
149 |
|
|
150 |
// prepare to copy selected file from archive-dir to online-dir |
// prepare to copy selected file from archive-dir to online-dir |
151 |
|
global $app; |
152 |
|
|
153 |
if ($this->get_element_value("Bilderarchiv")) { |
if ($this->get_element_value("Bilderarchiv")) { |
154 |
$_dest_file_suffix = substr($this->get_element_value("Bilderarchiv"), count($this->get_element_value("Bilderarchiv")) - 4, 4); |
$_dest_file_suffix = substr($this->get_element_value("Bilderarchiv"), count($this->get_element_value("Bilderarchiv")) - 4, 4); |
160 |
$handle=opendir ($app->getConfig("path.news.img.online") . $this->_language. "/"); |
$handle=opendir ($app->getConfig("path.news.img.online") . $this->_language. "/"); |
161 |
|
|
162 |
while ($myFile = readdir ($handle)) { |
while ($myFile = readdir ($handle)) { |
163 |
if (substr($myFile, 9, 1) == $this->_whichNews){unlink($app->getConfig("path.news.img.online") . "de/" . $myFile);} |
if (substr($myFile, 9, 1) == $this->_whichNews){unlink($app->getConfig("path.news.img.online") . $this->_language . "/" . $myFile);} |
164 |
} |
} |
165 |
closedir($handle); |
closedir($handle); |
166 |
|
|
167 |
copy($_source_file_name, $_dest_file_name); |
copy($_source_file_name, $_dest_file_name); |
168 |
} |
} |
169 |
|
|
170 |
|
if(!$error) { |
171 |
|
// fetch fresh data |
172 |
|
$this->_options['data_locator_meta']['action'] = "read"; |
173 |
|
// unset previous initialed 'data' var |
174 |
|
$this->_options['data_locator_meta']['data'] = NULL; |
175 |
|
$this->data_prefetch(); |
176 |
|
|
177 |
|
$this->set_action_message($this->_confirm_msg); |
178 |
|
return TRUE; |
179 |
|
} else { |
180 |
|
return FALSE; |
181 |
|
} |
182 |
|
|
183 |
} |
} |
184 |
function form_backend_validation() { |
function form_backend_validation() { |