1: <?php
2:
3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13:
14:
15: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
16:
17: cInclude('includes', 'functions.con.php');
18: cInclude('includes', 'functions.upl.php');
19:
20: 21: 22: 23: 24: 25:
26: class cContentTypeImgeditor extends cContentTypeAbstractTabbed {
27:
28: 29: 30: 31: 32:
33: private $_dirname;
34:
35: 36: 37: 38: 39:
40: private $_filename;
41:
42: 43: 44: 45: 46:
47: protected $_imagePath;
48:
49: 50: 51: 52: 53:
54: private $_fileType;
55:
56: 57: 58: 59: 60:
61: private $_fileSize;
62:
63: 64: 65: 66: 67:
68: private $_medianame;
69:
70: 71: 72: 73: 74:
75: protected $_description;
76:
77: 78: 79: 80: 81:
82: private $_keywords;
83:
84: 85: 86: 87: 88:
89: private $_internalNotice;
90:
91: 92: 93: 94: 95:
96: private $_copyright;
97:
98: 99: 100: 101: 102: 103: 104: 105: 106: 107:
108: public function __construct($rawSettings, $id, array $contentTypes) {
109:
110:
111: global $area;
112:
113:
114: $this->_type = 'CMS_IMGEDITOR';
115: $this->_prefix = 'imgeditor';
116: $this->_formFields = array(
117: 'image_filename',
118: 'image_medianame',
119: 'image_description',
120: 'image_keywords',
121: 'image_internal_notice',
122: 'image_copyright'
123: );
124:
125:
126: parent::__construct($rawSettings, $id, $contentTypes);
127:
128:
129:
130:
131: if (isset($_POST[$this->_prefix . '_action']) && $_POST[$this->_prefix . '_action'] === 'store' && isset($_POST[$this->_prefix . '_id']) && (int) $_POST[$this->_prefix . '_id'] == $this->_id) {
132: $this->_storeSettings();
133: }
134:
135:
136: $upload = new cApiUpload($this->_rawSettings);
137: $this->_filename = $upload->get('filename');
138: $this->_dirname = $upload->get('dirname');
139: $this->_imagePath = $this->_generateImagePath();
140: $this->_fileType = $upload->get('filetype');
141: $this->_fileSize = $upload->get('size');
142:
143:
144: $uploadMeta = new cApiUploadMeta();
145: $uploadMeta->loadByMany(array(
146: 'idupl' => $this->_rawSettings,
147: 'idlang' => $this->_lang
148: ));
149: $this->_medianame = ($uploadMeta->get('medianame') !== false) ? $uploadMeta->get('medianame') : '';
150: $this->_description = ($uploadMeta->get('description') !== false) ? $uploadMeta->get('description') : '';
151: $this->_keywords = ($uploadMeta->get('keywords') !== false) ? $uploadMeta->get('keywords') : '';
152: $this->_internalNotice = ($uploadMeta->get('internal_notice') !== false) ? $uploadMeta->get('internal_notice') : '';
153: $this->_copyright = ($uploadMeta->get('copyright') !== false) ? $uploadMeta->get('copyright') : '';
154:
155: }
156:
157: 158: 159: 160: 161: 162: 163: 164: 165: 166: 167: 168:
169: protected function _getRawSettings($contentTypeName, $id, array $contentTypes, $editable = false) {
170: global $cfg;
171:
172: if (!isset($contentTypes[$contentTypeName][$id])) {
173: $idArtLang = cRegistry::getArticleLanguageId();
174:
175: $typeItem = new cApiType();
176: $typeItem->loadByType($contentTypeName);
177: $idtype = $typeItem->get('idtype');
178:
179:
180: if ($editable = false) {
181: $content = new cApiContent();
182: $content->loadByMany(array(
183: 'idartlang' => $idArtLang,
184: 'idtype' => $idtype,
185: 'typeid' => $id
186: ));
187: return $content->get('value');
188: } else if ($editable = true) {
189: $db = cRegistry::getDb();
190: $sql = "SELECT max(version) AS max
191: FROM " . $cfg["tab"]["content_version"] . " WHERE idartlang = " . $idArtLang . " AND typeid = " . $id .
192: " AND idtype = '" . $idtype . "'";
193: $db->query($sql);
194: while($db->nextRecord()) {
195: $idContentVersion = $db->f('max');
196: }
197:
198: $contentVersion = new cApiContentVersion($idContentVersion);
199:
200: if ($contentVersion->get('deleted') != 1) {
201: return $contentVersion->get('value');
202: }
203: }
204: } else {
205: return $contentTypes[$contentTypeName][$id];
206: }
207: }
208:
209: 210: 211: 212: 213:
214: public function getAbsolutePath() {
215: return $this->_cfgClient[$this->_client]['upl']['path'] . $this->_dirname . $this->_filename;
216: }
217:
218: 219: 220: 221: 222:
223: public function getRelativePath() {
224: return $this->_dirname . $this->_filename;
225: }
226:
227: 228: 229: 230: 231:
232: public function getAbsoluteURL() {
233: return $this->_generateImagePath();
234: }
235:
236: 237: 238: 239: 240:
241: public function getRelativeURL() {
242: if (!empty($this->_filename)) {
243: if (cApiDbfs::isDbfs($this->_dirname)) {
244: return 'dbfs.php?file=' . urlencode($this->_dirname . $this->_filename);
245: } else {
246: return $this->_cfgClient[$this->_client]['upload'] . $this->_dirname . $this->_filename;
247: }
248: }
249:
250: return '';
251: }
252:
253: 254: 255: 256: 257: 258: 259: 260: 261: 262: 263: 264:
265: public function getMetaData() {
266: return array(
267: 'medianame' => $this->_medianame,
268: 'description' => $this->_description,
269: 'keywords' => $this->_keywords,
270: 'internalnotice' => $this->_internalNotice,
271: 'copyright' => $this->_copyright
272: );
273: }
274:
275: 276: 277: 278: 279: 280:
281: private function _generateImagePath() {
282: if (!empty($this->_filename)) {
283: if (cApiDbfs::isDbfs($this->_dirname)) {
284: return $this->_cfgClient[$this->_client]['path']['htmlpath'] . 'dbfs.php?file=' . urlencode($this->_dirname . $this->_filename);
285: } else {
286: return $this->_cfgClient[$this->_client]['path']['htmlpath'] . $this->_cfgClient[$this->_client]['upload'] . $this->_dirname . $this->_filename;
287: }
288: }
289:
290: return '';
291: }
292:
293: 294: 295: 296:
297: protected function _storeSettings() {
298:
299: $filename = basename($_POST['image_filename']);
300: $dirname = dirname($_POST['image_filename']);
301: if ($dirname === '\\' || $dirname === '/') {
302: $dirname = '';
303: } else {
304: $dirname .= '/';
305: }
306:
307:
308: $upload = new cApiUpload();
309: $upload->loadByMany(array(
310: 'filename' => $filename,
311: 'dirname' => $dirname,
312: 'idclient' => $this->_client
313: ), false);
314:
315: $this->_rawSettings = $upload->get('idupl');
316:
317:
318: conSaveContentEntry($this->_idArtLang, 'CMS_IMGEDITOR', $this->_id, $this->_rawSettings);
319: $versioning = new cContentVersioning();
320: if ($versioning->getState() != 'advanced') {
321: conMakeArticleIndex($this->_idartlang, $this->_idart);
322: }
323: conGenerateCodeForArtInAllCategories($this->_idArt);
324:
325:
326: $medianame = $_POST['image_medianame'];
327: $description = $_POST['image_description'];
328: $keywords = $_POST['image_keywords'];
329: $internal_notice = $_POST['image_internal_notice'];
330: $copyright = $_POST['image_copyright'];
331:
332:
333: $uploadMeta = new cApiUploadMeta();
334: $uploadMeta->loadByMany(array(
335: 'idupl' => $this->_rawSettings,
336: 'idlang' => $this->_lang
337: ));
338:
339: if ($uploadMeta->get('id_uplmeta') != false) {
340: $uploadMeta->set('idupl', $this->_rawSettings);
341: $uploadMeta->set('idlang', $this->_lang);
342: $uploadMeta->set('medianame', $medianame);
343: $uploadMeta->set('description', $description);
344: $uploadMeta->set('keywords', $keywords);
345: $uploadMeta->set('internal_notice', $internal_notice);
346: $uploadMeta->set('copyright', $copyright);
347: $uploadMeta->store();
348: } else {
349:
350: $uploadMetaCollection = new cApiUploadMetaCollection();
351: $uploadMetaCollection->create($this->_rawSettings, $this->_lang, $medianame, $description, $keywords, $internal_notice, $copyright);
352: }
353: }
354:
355: 356: 357: 358: 359: 360: 361:
362: public function generateViewCode() {
363: $image = new cHTMLImage($this->_imagePath);
364: $image->setAlt($this->_description);
365:
366: return $this->_encodeForOutput($image->render());
367: }
368:
369: 370: 371: 372: 373: 374:
375: public function generateEditCode() {
376:
377: $templateTop = new cTemplate();
378: $templateTop->set('s', 'ICON', 'images/but_editimage.gif');
379: $templateTop->set('s', 'ID', $this->_id);
380: $templateTop->set('s', 'PREFIX', $this->_prefix);
381: $templateTop->set('s', 'HEADLINE', i18n('Image settings'));
382: $codeTop = $templateTop->generate($this->_cfg['path']['contenido'] . 'templates/standard/template.cms_abstract_tabbed_edit_top.html', true);
383:
384: $tabMenu = array(
385: 'directories' => i18n('Directories'),
386: 'meta' => i18n('Meta'),
387: 'upload' => i18n('Upload')
388: );
389:
390: $templateTabs = new cTemplate();
391:
392:
393: $templateTabs->set('d', 'TAB_ID', 'upload');
394: $templateTabs->set('d', 'TAB_CLASS', 'upload');
395: $templateTabs->set('d', 'TAB_CONTENT', $this->_generateTabUpload());
396: $templateTabs->set('s', 'PREFIX', $this->_prefix);
397: $templateTabs->next();
398:
399:
400: $templateTabs->set('d', 'TAB_ID', 'directories');
401: $templateTabs->set('d', 'TAB_CLASS', 'directories');
402: $templateTabs->set('d', 'TAB_CONTENT', $this->_generateTabDirectories());
403: $templateTabs->next();
404:
405:
406: $templateTabs->set('d', 'TAB_ID', 'meta');
407: $templateTabs->set('d', 'TAB_CLASS', 'meta');
408: $templateTabs->set('d', 'TAB_CONTENT', $this->_generateTabMeta());
409: $templateTabs->next();
410:
411: $codeTabs = $templateTabs->generate($this->_cfg['path']['contenido'] . 'templates/standard/template.cms_abstract_tabbed_edit_tabs.html', true);
412:
413:
414: $templateBottom = new cTemplate();
415: $templateBottom->set('s', 'PATH_FRONTEND', $this->_cfgClient[$this->_client]['path']['htmlpath']);
416: $templateBottom->set('s', 'ID', $this->_id);
417: $templateBottom->set('s', 'PREFIX', $this->_prefix);
418: $templateBottom->set('s', 'IDARTLANG', $this->_idArtLang);
419: $templateBottom->set('s', 'FIELDS', "'" . implode("','", $this->_formFields) . "'");
420: $templateBottom->set('s', 'SETTINGS', json_encode($this->_settings));
421: $templateBottom->set('s', 'JS_CLASS_SCRIPT', $this->_cfg['path']['contenido_fullhtml'] . 'scripts/content_types/cmsImgeditor.js');
422: $templateBottom->set('s', 'JS_CLASS_NAME', 'Con.cContentTypeImgeditor');
423: $codeBottom = $templateBottom->generate($this->_cfg['path']['contenido'] . 'templates/standard/template.cms_abstract_tabbed_edit_bottom.html', true);
424:
425: $code = $this->_encodeForOutput($codeTop);
426: $code .= $this->_generateTabMenuCode($tabMenu);
427: $code .= $this->_encodeForOutput($codeTabs);
428: $code .= $this->_generateActionCode();
429: $code .= $this->_encodeForOutput($codeBottom);
430:
431: return $code;
432: }
433:
434: 435: 436: 437: 438: 439: 440:
441: private function _generateTabDirectories() {
442:
443:
444: $wrapper = new cHTMLDiv();
445: $wrapperContent = array();
446:
447: $directoryList = new cHTMLDiv('', 'directoryList', 'directoryList' . '_' . $this->_id);
448: $liRoot = new cHTMLListItem('root', 'root');
449: $aUpload = new cHTMLLink('#');
450: $aUpload->setClass('on');
451: $aUpload->setAttribute('title', 'upload');
452: $aUpload->setContent('Uploads');
453: $directoryListCode = $this->generateDirectoryList($this->buildDirectoryList());
454: $div = new cHTMLDiv(array(
455: '<em><a href="#"></a></em>',
456: $aUpload
457: ));
458: $liRoot->setContent(array(
459: $div,
460: $directoryListCode
461: ));
462: $conStrTree = new cHTMLList('ul', 'con_str_tree', 'con_str_tree', $liRoot);
463: $directoryList->setContent($conStrTree);
464: $wrapperContent[] = $directoryList;
465:
466: $wrapperContent[] = new cHTMLDiv($this->generateFileSelect($this->_dirname), 'directoryFile', 'directoryFile' . '_' . $this->_id);
467:
468: $directoryShow = new cHTMLDiv('', 'directoryShow', 'directoryShow_' . $this->_id);
469: $imagePath = $this->_imagePath;
470: $imageFilename = str_replace($this->_cfgClient[$this->_client]['path']['htmlpath'], $this->_cfgClient[$this->_client]['path']['frontend'], $imagePath);
471: $imageFiletype = substr($imagePath, strlen($imagePath) - 4, 4);
472: $imageExtensions = array(
473: '.gif',
474: '.png',
475: '.jpg',
476: 'jpeg'
477: );
478: if (in_array($imageFiletype, $imageExtensions)) {
479: $imagePath = cApiImgScale($imageFilename, 428, 210);
480: }
481: $image = new cHTMLImage($imagePath);
482: $directoryShow->setContent($image);
483: $wrapperContent[] = $directoryShow;
484:
485: $wrapper->setContent($wrapperContent);
486: return $wrapper->render();
487: }
488:
489: 490: 491: 492: 493: 494: 495:
496: private function _generateTabMeta() {
497:
498: $wrapper = new cHTMLDiv();
499: $wrapperContent = array();
500:
501: $imageMetaUrl = new cHTMLSpan();
502: $imageMetaUrl->setID('image_meta_url_' . $this->_id);
503: $imageMetaUrl->setClass('image_meta_url');
504: $wrapperContent[] = new cHTMLDiv(array(
505: '<b>' . i18n('Selected file') . '</b>',
506: $imageMetaUrl
507: ));
508: $wrapperContent[] = new cHTMLLabel(i18n('Title'), 'image_medianame_' . $this->_id);
509: $wrapperContent[] = new cHTMLTextbox('image_medianame', $this->_medianame, '', '', 'image_medianame_' . $this->_id);
510: $wrapperContent[] = new cHTMLLabel(i18n('Description'), 'image_description_' . $this->_id);
511: $wrapperContent[] = new cHTMLTextarea('image_description', $this->_description, '', '', 'image_description_' . $this->_id);
512: $wrapperContent[] = new cHTMLLabel(i18n('Keywords'), 'image_keywords_' . $this->_id);
513: $wrapperContent[] = new cHTMLTextbox('image_keywords', $this->_keywords, '', '', 'image_keywords_' . $this->_id);
514: $wrapperContent[] = new cHTMLLabel(i18n('Internal notes'), 'image_internal_notice_' . $this->_id);
515: $wrapperContent[] = new cHTMLTextbox('image_internal_notice', $this->_internalNotice, '', '', 'image_internal_notice_' . $this->_id);
516: $wrapperContent[] = new cHTMLLabel(i18n('Copyright'), 'image_copyright_' . $this->_id);
517: $wrapperContent[] = new cHTMLTextbox('image_copyright', $this->_copyright, '', '', 'image_copyright_' . $this->_id);
518:
519: $wrapper->setContent($wrapperContent);
520: return $wrapper->render();
521: }
522:
523: 524: 525: 526: 527: 528:
529: private function _generateTabUpload() {
530:
531: $wrapper = new cHTMLDiv();
532: $wrapperContent = array();
533:
534:
535: $newDirForm = new cHTMLForm();
536: $newDirForm->setAttribute('name', 'newdir');
537: $newDirForm->setAttribute('method', 'post');
538: $newDirForm->setAttribute('action', $this->_cfg['path']['contenido_fullhtml'] . 'main.php');
539: $caption1Span = new cHTMLSpan();
540: $caption1Span->setID('caption1');
541: $newDirHead = new cHTMLDiv(array(
542: '<b>' . i18n('Create a directory in') . '</b>',
543: $caption1Span
544: ));
545: $area = new cHTMLHiddenField('area', 'upl');
546: $action = new cHTMLHiddenField('action', 'upl_mkdir');
547: $frame = new cHTMLHiddenField('frame', '2');
548: $appendparameters = new cHTMLHiddenField('appendparameters');
549: $contenido = new cHTMLHiddenField('contenido', $_REQUEST['contenido']);
550: $path = new cHTMLHiddenField('path');
551: $foldername = new cHTMLTextbox('foldername');
552: $button = new cHTMLButton('', '', '', false, NULL, '', 'image');
553: $button->setAttribute('src', $this->_cfg['path']['contenido_fullhtml'] . 'images/submit.gif');
554: $newDirContent = new cHTMLDiv(array(
555: $area,
556: $action,
557: $frame,
558: $appendparameters,
559: $contenido,
560: $path,
561: $foldername,
562: $button
563: ));
564: $newDirForm->setContent(array(
565: $newDirHead,
566: $newDirContent
567: ));
568: $wrapperContent[] = $newDirForm;
569:
570:
571: $propertiesForm = new cHTMLForm();
572: $propertiesForm->setID('properties' . $this->_id);
573: $propertiesForm->setAttribute('name', 'properties');
574: $propertiesForm->setAttribute('method', 'post');
575: $propertiesForm->setAttribute('action', $this->_cfg['path']['contenido_fullhtml'] . 'main.php');
576: $propertiesForm->setAttribute('enctype', 'multipart/form-data');
577: $frame = new cHTMLHiddenField('frame', '4');
578: $area = new cHTMLHiddenField('area', 'upl');
579: $path = new cHTMLHiddenField('path');
580: $file = new cHTMLHiddenField('file');
581: $action = new cHTMLHiddenField('action', 'upl_upload');
582: $appendparameters = new cHTMLHiddenField('appendparameters');
583: $contenido = new cHTMLHiddenField('contenido', $_REQUEST['contenido']);
584: $caption2Span = new cHTMLSpan();
585: $caption2Span->setID('caption2');
586: $propertiesHead = new cHTMLDiv(array(
587: '<b>' . i18n('Path') . '</b>',
588: $caption2Span
589: ));
590: $imageUpload = new cHTMLUpload('file[]', '', '', 'cms_image_m' . $this->_id, false, '', '', 'file');
591: $imageUpload->setClass('jqueryAjaxUpload');
592: $propertiesForm->setContent(array(
593: $frame,
594: $area,
595: $path,
596: $file,
597: $action,
598: $appendparameters,
599: $contenido,
600: $propertiesHead,
601: $imageUpload
602: ));
603: $wrapperContent[] = $propertiesForm;
604:
605: $wrapperContent[] = new cHTMLImage($this->_cfg['path']['contenido_fullhtml'] . 'images/ajax-loader.gif', 'loading');
606:
607: $wrapper->setContent($wrapperContent);
608: return $wrapper->render();
609: }
610:
611: 612: 613: 614: 615: 616: 617: 618: 619:
620: public function generateFileSelect($directoryPath = '') {
621:
622: if (substr($directoryPath, -1) != '/') {
623: $directoryPath .= '/';
624: }
625:
626: $htmlSelect = new cHTMLSelectElement('image_filename', '', 'image_filename_' . $this->_id);
627: $htmlSelect->setSize(16);
628: $htmlSelectOption = new cHTMLOptionElement('Kein', '', false);
629: $htmlSelect->addOptionElement(0, $htmlSelectOption);
630:
631: $files = array();
632: if (is_dir($this->_uploadPath . $directoryPath)) {
633: if (false !== ($handle = cDirHandler::read($this->_uploadPath . $directoryPath, false, false, true))) {
634: foreach ($handle as $entry) {
635: if (false === cFileHandler::fileNameBeginsWithDot($entry)) {
636: $file = array();
637: $file["name"] = $entry;
638: $file["path"] = $directoryPath . $entry;
639: $files[] = $file;
640: }
641: }
642: }
643: }
644:
645: usort($files, function($a, $b) {
646: $a = mb_strtolower($a["name"]);
647: $b = mb_strtolower($b["name"]);
648: if($a < $b) {
649: return -1;
650: } else if($a > $b) {
651: return 1;
652: } else {
653: return 0;
654: }
655: });
656:
657: $i = 1;
658: foreach($files as $file) {
659: $htmlSelectOption = new cHTMLOptionElement($file["name"], $file["path"]);
660: $htmlSelect->addOptionElement($i, $htmlSelectOption);
661: $i++;
662: }
663:
664: if ($i === 0) {
665: $htmlSelectOption = new cHTMLOptionElement(i18n('No files found'), '', false);
666: $htmlSelectOption->setAlt(i18n('No files found'));
667: $htmlSelectOption->setDisabled(true);
668: $htmlSelect->addOptionElement($i, $htmlSelectOption);
669: $htmlSelect->setDisabled(true);
670: }
671:
672:
673: if (isset($this->_dirname)) {
674: $htmlSelect->setDefault($this->_dirname . $this->_filename);
675: } else {
676: $htmlSelect->setDefault('');
677: }
678:
679: return $htmlSelect->render();
680: }
681:
682: 683: 684: 685: 686: 687: 688: 689: 690: 691:
692: protected function _isActiveDirectory(array $dirData) {
693: return $dirData['path'] . $dirData['name'] . '/' === $this->_dirname;
694: }
695:
696: 697: 698: 699: 700: 701: 702: 703: 704: 705:
706: protected function _shouldDirectoryBeExpanded(array $dirData) {
707: return $this->_isSubdirectory($dirData['path'] . $dirData['name'], $this->_dirname);
708: }
709:
710: 711: 712: 713: 714: 715: 716: 717: 718: 719:
720: public function getImageMeta($filename, $dirname) {
721: $upload = new cApiUpload();
722: $upload->loadByMany(array(
723: 'filename' => $filename,
724: 'dirname' => $dirname,
725: 'idclient' => $this->_client
726: ), false);
727: $idupl = $upload->get('idupl');
728:
729: $uploadMeta = new cApiUploadMeta();
730: $uploadMeta->loadByMany(array(
731: 'idupl' => $idupl,
732: 'idlang' => $this->_lang
733: ));
734:
735: $imageMeta = array();
736: $imageMeta['medianame'] = ($uploadMeta->get('medianame') !== false) ? $uploadMeta->get('medianame') : '';
737: $imageMeta['description'] = ($uploadMeta->get('description') !== false) ? $uploadMeta->get('description') : '';
738: $imageMeta['keywords'] = ($uploadMeta->get('keywords') !== false) ? $uploadMeta->get('keywords') : '';
739: $imageMeta['internal_notice'] = ($uploadMeta->get('internal_notice') !== false) ? $uploadMeta->get('internal_notice') : '';
740: $imageMeta['copyright'] = ($uploadMeta->get('copyright') !== false) ? $uploadMeta->get('copyright') : '';
741:
742: return json_encode($imageMeta);
743: }
744:
745: 746: 747: 748: 749: 750: 751: 752: 753: 754: 755: 756:
757: public function uplmkdir($path, $name) {
758: return uplmkdir($path, $name);
759: }
760:
761: 762: 763: 764: 765: 766: 767: 768:
769: public function uplupload($path) {
770: if (count($_FILES) === 1) {
771: foreach ($_FILES['file']['name'] as $key => $value) {
772: if (file_exists($_FILES['file']['tmp_name'][$key])) {
773: $friendlyName = uplCreateFriendlyName($_FILES['file']['name'][$key]);
774: move_uploaded_file($_FILES['file']['tmp_name'][$key], $this->_cfgClient[$this->_client]['upl']['path'] . $path . $friendlyName);
775:
776: cDebug::out(":::" . $path);
777: uplSyncDirectory($path);
778:
779: $upload = new cApiUpload();
780: $upload->loadByMany(array(
781: 'dirname' => $path,
782: 'filename' => $_FILES['file']['name'][$key]
783: ), false);
784: if ($upload->get('idupl') != false) {
785: $uplfilename = $this->_cfgClient[$this->_client]['upl']['htmlpath'] . $upload->get('dirname') . $upload->get('filename');
786: } else {
787: $uplfilename = 'error';
788: }
789: }
790: }
791: }
792:
793: return $uplfilename;
794: }
795:
796: }
797: