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