primo commit
This commit is contained in:
		| @ -0,0 +1 @@ | ||||
| <html><body bgcolor="#FFFFFF"></body></html> | ||||
| @ -0,0 +1,237 @@ | ||||
| <?php | ||||
| /* @package Joomla | ||||
|  * @copyright Copyright (C) Open Source Matters. All rights reserved. | ||||
|  * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php | ||||
|  * @extension Phoca Extension | ||||
|  * @copyright Copyright (C) Jan Pavelka www.phoca.cz | ||||
|  * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL | ||||
|  */ | ||||
|  defined('_JEXEC') or die('Restricted access'); | ||||
| use Joomla\CMS\HTML\HTMLHelper; | ||||
| use Joomla\CMS\Factory; | ||||
| use Joomla\CMS\Language\Text; | ||||
| use Joomla\CMS\Filesystem\Path; | ||||
| /* | ||||
| JHtml::_('bootstrap.tooltip'); | ||||
| JHtml::_('behavior.multiselect'); | ||||
| JHtml::_('dropdown.init'); | ||||
| JHtml::_('formbehavior.chosen', 'select');*/ | ||||
|  | ||||
| $r 			=  new PhocaDownloadRenderAdminView(); | ||||
|  | ||||
| //if ($this->manager == 'filemultiple') { | ||||
|  | ||||
|     Factory::getDocument()->addScriptDeclaration(' | ||||
| 	 | ||||
| 	Joomla.submitbutton = function(task) | ||||
| 	{ | ||||
| 		if (task == \'phocadownloadm.cancel\') { | ||||
| 			Joomla.submitform(task); | ||||
| 		} | ||||
|  | ||||
| 		if (task == \'phocadownloadm.save\') { | ||||
| 			var phocadownloadmform = document.getElementById(\'adminForm\'); | ||||
| 			if (phocadownloadmform.boxchecked.value==0) { | ||||
| 				alert( "'. Text::_( 'COM_PHOCADOWNLOAD_WARNING_SELECT_FILENAME_OR_FOLDER', true ).'" ); | ||||
| 			} else  { | ||||
| 				var f = phocadownloadmform; | ||||
| 				var nSelectedImages = 0; | ||||
| 				var nSelectedFolders = 0; | ||||
| 				var i=0; | ||||
| 				cb = eval( \'f.cb\' + i ); | ||||
| 				while (cb) { | ||||
| 					if (cb.checked == false) { | ||||
| 						// Do nothing | ||||
| 					} | ||||
| 					else if (cb.name == "cid[]") { | ||||
| 						nSelectedImages++; | ||||
| 					} | ||||
| 					else { | ||||
| 						nSelectedFolders++; | ||||
| 					} | ||||
| 					// Get next | ||||
| 					i++; | ||||
| 					cb = eval( \'f.cb\' + i ); | ||||
| 				} | ||||
|  | ||||
| 				if (phocadownloadmform.jform_catid.value == "" && nSelectedImages > 0){ | ||||
| 					alert( "'. Text::_( 'COM_PHOCADOWNLOAD_WARNING_FILE_SELECTED_SELECT_CATEGORY', true ).'" ); | ||||
| 				} else { | ||||
| 					Joomla.submitform(task); | ||||
| 				} | ||||
| 			} | ||||
| 		} | ||||
| 		//Joomla.submitform(task); | ||||
| 	}'); | ||||
|  | ||||
| //} | ||||
|  | ||||
| echo '<div id="phocadownloadmanager">'; | ||||
|  | ||||
| if ($this->manager == 'filemultiple') { | ||||
| 	echo $r->startForm($this->t['o'], $this->t['task'], 'adminForm', 'adminForm'); | ||||
| 	echo '<div class="col-sm-4 form-horizontal" style="border-right: 1px solid #d3d3d3;padding-right: 5px;">'; | ||||
| 	echo '<h4>'. Text::_('COM_PHOCADOWNLOAD_MULTIPLE_ADD').'</h4>'; | ||||
|  | ||||
| 	echo '<div>'."\n"; | ||||
| 	$formArray = array ('title', 'alias','published', 'approved', 'ordering', 'catid', 'language', 'pap_copy_m'); | ||||
| 	echo $r->group($this->form, $formArray); | ||||
| 	echo '</div>'. "\n"; | ||||
|  | ||||
| 	echo '</div>'. "\n"; | ||||
| } else { | ||||
|     echo $r->startForm($this->t['o'], $this->t['task'], 'adminForm', 'adminForm'); | ||||
| } | ||||
|  | ||||
| if ($this->manager == 'filemultiple') { | ||||
| 	echo '<div class="col-sm-8 form-horizontal">'; | ||||
| } else { | ||||
| 	echo '<div class="span12 form-horizontal">'; | ||||
| } | ||||
|  | ||||
| echo '<div class="pd-admin-path">' . Text::_('COM_PHOCADOWNLOAD_PATH'). ': '.Path::clean($this->t['path']['orig_abs_ds']. $this->folderstate->folder) .'</div>'; | ||||
|  | ||||
| //$countFaF =  count($this->images) + count($this->folders); | ||||
| echo '<table class="table table-hover table-condensed ph-multiple-table">' | ||||
| .'<thead>' | ||||
| .'<tr>'; | ||||
| echo '<th class="hidden-phone ph-check">'. "\n"; | ||||
| if ($this->manager == 'filemultiple') { | ||||
| 	echo '<input type="checkbox" name="checkall-toggle" value="" title="'.Text::_('JGLOBAL_CHECK_ALL').'" onclick="Joomla.checkAll(this)" />'. "\n"; | ||||
| } else { | ||||
|     echo '<div style="display:none"><input type="checkbox" name="checkall-toggle" value="" title="'.Text::_('JGLOBAL_CHECK_ALL').'" onclick="Joomla.checkAll(this)" /></div>'. "\n"; | ||||
| 	echo ''; | ||||
| } | ||||
| echo '</th>'. "\n"; | ||||
|  | ||||
| echo '<th width="20"> </th>' | ||||
| .'<th width="95%">'.Text::_( $this->t['l'].'_FILENAME' ).'</th>' | ||||
| .'</tr>' | ||||
| .'</thead>'; | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
| /* | ||||
| echo '<div class="pd-admin-files">'; | ||||
|  | ||||
| if ($this->manager == 'filemultiple' && (count($this->files) > 0 || count($this->folders) > 0)) { | ||||
| 	echo '<div class="pd-admin-file-checkbox">'; | ||||
| 	$fileFolders = count($this->files) + count($this->folders); | ||||
| 	echo '<input type="checkbox" name="toggle" value="" onclick="checkAll('.$fileFolders.');" />'; | ||||
| 	echo '  '. Text::_('COM_PHOCADOWNLOAD_CHECK_ALL'); | ||||
| 	echo '</div>'; | ||||
| }*/ | ||||
| echo '<tbody>'; | ||||
| echo $this->loadTemplate('up'); | ||||
| if (count($this->files) > 0 || count($this->folders) > 0) { ?> | ||||
| <div> | ||||
|  | ||||
| 	<?php for ($i=0,$n=count($this->folders); $i<$n; $i++) : | ||||
| 		$this->setFolder($i); | ||||
| 		$this->folderi = $i; | ||||
| 		echo $this->loadTemplate('folder'); | ||||
| 	endfor; ?> | ||||
|  | ||||
| 	<?php for ($i=0,$n=count($this->files); $i<$n; $i++) : | ||||
| 		$this->setFile($i); | ||||
| 		$this->filei = $i; | ||||
| 		echo $this->loadTemplate('file'); | ||||
| 	endfor; ?> | ||||
|  | ||||
| </div> | ||||
| <?php } else { | ||||
| 	echo '<tr>' | ||||
| 	.'<td> </td>' | ||||
| 	.'<td> </td>' | ||||
| 	.'<td>'.Text::_( $this->t['l'].'_THERE_IS_NO_FILE' ).'</td>' | ||||
| 	.'</tr>'; | ||||
| } | ||||
| echo '</tbody>' | ||||
| .'</table>'; | ||||
|  | ||||
|  | ||||
| // we have now delete function | ||||
|  | ||||
| //if ($this->manager == 'filemultiple') { | ||||
|  | ||||
| 	echo '<input type="hidden" name="task" value="" />'. "\n"; | ||||
| 	echo '<input type="hidden" name="boxchecked" value="0" />'. "\n"; | ||||
| 	echo '<input type="hidden" name="layout" value="edit" />'. "\n"; | ||||
|     echo '<input type="hidden" name="return-url" value="'. $this->returnUrl.'" />'; | ||||
|     echo '<input type="hidden" name="manager" value="'. $this->manager.'" />'; | ||||
| 	echo HTMLHelper::_('form.token'); | ||||
| 	echo $r->endForm(); | ||||
|  | ||||
| 	echo '</div>'; | ||||
| 	echo '<div class="clearfix"></div>'; | ||||
|  | ||||
| //} | ||||
| ?> | ||||
|  | ||||
| <div style="border-bottom:1px solid #cccccc;margin-bottom: 10px"> </div> | ||||
|  | ||||
| <?php | ||||
| if ($this->t['displaytabs'] > 0) { | ||||
|  | ||||
| 	/*echo '<ul class="nav nav-tabs" id="configTabs">'; | ||||
|  | ||||
| 	$label = HTMLHelper::_( 'image', $this->t['i'].'icon-16-upload.png','') . ' '.Text::_($this->t['l'].'_UPLOAD'); | ||||
| 	echo '<li><a href="#upload" data-toggle="tab">'.$label.'</a></li>'; | ||||
|  | ||||
| 	if((int)$this->t['enablemultiple']  > 0) { | ||||
| 		$label = HTMLHelper::_( 'image', $this->t['i'].'icon-16-upload-multiple.png','') . ' '.Text::_($this->t['l'].'_MULTIPLE_UPLOAD'); | ||||
| 		echo '<li><a href="#multipleupload" data-toggle="tab">'.$label.'</a></li>'; | ||||
| 	} | ||||
|  | ||||
| 	$label = HTMLHelper::_( 'image', $this->t['i'].'icon-16-folder.png','') . ' '.Text::_($this->t['l'].'_CREATE_FOLDER'); | ||||
| 	echo '<li><a href="#createfolder" data-toggle="tab">'.$label.'</a></li>'; | ||||
|  | ||||
| 	echo '</ul>';*/ | ||||
|  | ||||
| 	$activeTab = ''; | ||||
| 	if (isset($this->t['tab']) && $this->t['tab'] != '') { | ||||
| 	    $activeTab = $this->t['tab']; | ||||
|     } else  { | ||||
| 		$activeTab = 'multipleupload'; | ||||
| 	} | ||||
|  | ||||
| 	echo $r->startTabs($activeTab); | ||||
|  | ||||
| 	$tabs = array(); | ||||
| 	$tabs['multipleupload'] = '<span class="ph-cp-item"><i class="phi phi-fs-s phi-fc-bl duotone icon-upload"></i></span>' . ' '.Text::_('COM_PHOCADOWNLOAD_MULTIPLE_UPLOAD'); | ||||
| 	$tabs['upload'] = '<span class="ph-cp-item"><i class="phi phi-fs-s phi-fc-bd duotone icon-upload"></i></span>' . ' '.Text::_('COM_PHOCADOWNLOAD_UPLOAD'); | ||||
|  | ||||
| 	if (!empty($this->t['javaupload'])) { | ||||
| 	    $tabs['javaupload'] = '<span class="ph-cp-item"><i class="phi phi-fs-s phi-fc-rl duotone icon-upload"></i></span>' . ' '.Text::_('COM_PHOCADOWNLOAD_JAVA_UPLOAD'); | ||||
|     } | ||||
|  | ||||
| 	$tabs['createfolder'] = '<span class="ph-cp-item"><i class="phi phi-fs-s phi-fc-brd duotone icon-folder"></i></span>' . ' '.Text::_('COM_PHOCADOWNLOAD_CREATE_FOLDER'); | ||||
|  | ||||
| 	echo $r->navigation($tabs, $activeTab); | ||||
|  | ||||
| 	echo $r->startTab('multipleupload', $tabs['multipleupload'], $activeTab == 'multipleupload' ? 'active' : ''); | ||||
| 	echo $this->loadTemplate('multipleupload'); | ||||
| 	echo $r->endTab(); | ||||
|  | ||||
| 	echo $r->startTab('upload', $tabs['upload'], $activeTab == 'upload' ? 'active' : ''); | ||||
| 	echo $this->loadTemplate('upload'); | ||||
| 	echo $r->endTab(); | ||||
|  | ||||
| 	echo $r->startTab('createfolder', $tabs['createfolder'], $activeTab == 'createfolder' ? 'active' : ''); | ||||
|  | ||||
|  | ||||
| 	echo PhocaDownloadFileUpload::renderCreateFolder($this->session->getName(), $this->session->getId(), $this->currentFolder, 'phocadownloadmanager', 'manager='.PhocaDownloadUtils::filterValue($this->manager, 'alphanumeric').'&tab=createfolder&field='. PhocaDownloadUtils::filterValue($this->field, 'alphanumeric2') ); | ||||
| 	echo $r->endTab(); | ||||
|  | ||||
| 	echo $r->endTabs(); | ||||
| } | ||||
| echo '</div>'; | ||||
|  | ||||
| /* | ||||
| if ($this->t['tab'] != '') {$jsCt = 'a[href=#'.PhocaDownloadUtils::filterValue($this->t['tab'], 'alphanumeric') .']';} else {$jsCt = 'a:first';} | ||||
| echo '<script type="text/javascript">'; | ||||
| echo '   jQuery(\'#configTabs '.$jsCt.'\').tab(\'show\');'; // Select first tab | ||||
| echo '</script>'; | ||||
| */ | ||||
| ?> | ||||
| @ -0,0 +1,92 @@ | ||||
| <?php | ||||
| /* @package Joomla | ||||
|  * @copyright Copyright (C) Open Source Matters. All rights reserved. | ||||
|  * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php | ||||
|  * @extension Phoca Extension | ||||
|  * @copyright Copyright (C) Jan Pavelka www.phoca.cz | ||||
|  * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL | ||||
|  */ | ||||
|  defined('_JEXEC') or die('Restricted access'); | ||||
| use Joomla\CMS\HTML\HTMLHelper; | ||||
| use Joomla\CMS\Language\Text; | ||||
|  | ||||
| jimport( 'joomla.filesystem.file' ); | ||||
|  | ||||
| $ext 	= PhocaDownloadFile::getExtension( $this->_tmp_file->path_without_name_relative ); | ||||
| $group 	= PhocaDownloadSettings::getManagerGroup($this->manager); | ||||
|  | ||||
|  | ||||
|  | ||||
| $checked 	= HTMLHelper::_('grid.id', $this->filei + count($this->folders), $this->files[$this->filei]->path_with_name_relative_no ); | ||||
| $deleteCode = '<a class="ph-action-inline-icon-box ph-inline-task" href="javascript:void(0);" onclick="javascript:if (confirm(\''.Text::_('COM_PHOCADOWNLOAD_DELETE_FILE_SERVER_WARNING').'\')){ return Joomla.listItemTask(\'cb'.$this->filei + count($this->folders).'\',\'phocadownloadmanager.delete\');}" title="'.Text::_('COM_PHOCADOWNLOAD_DELETE').'"><span class="ph-cp-item ph-icon-task ph-icon-leftm"><i class="duotone icon-purge"></i></span></a>'; | ||||
|  | ||||
| if ($this->manager == 'filemultiple') { | ||||
|  | ||||
|  | ||||
| 	$icon		= PhocaDownloadFile::getMimeTypeIcon($this->_tmp_file->name); | ||||
|  | ||||
| 	//$fileNameEncode = urlencode($this->_tmp_file->path_with_name_relative_no); | ||||
| 	//$deleteCode = '<input class="form-check-input" autocomplete="off" type="checkbox" id="cid'.$fileNameEncode.'" name="cid['.$fileNameEncode.']" value="'.$fileNameEncode.'" onclick="Joomla.isChecked(this.checked);">'; | ||||
|  | ||||
|  | ||||
| 	echo '<tr>' | ||||
| 	.' <td>'. $checked .'</td>' | ||||
| 	.' <td class="ph-img-table">' | ||||
| 	. $icon .'</td>' | ||||
| 	.' <td>' | ||||
| 	.'<div class="ph-files-row">' | ||||
| 	.'<div>' . $this->_tmp_file->name . '</div>' | ||||
| 	.'<div class="ph-files-row-item">' . $deleteCode . '</div>' | ||||
| 	.'</div>' | ||||
| 	. '</td>' | ||||
| 	.'</tr>'; | ||||
|  | ||||
|  | ||||
| } else { | ||||
|  | ||||
|  | ||||
|  | ||||
| 	if (($group['i'] == 1) && ($ext == 'png' || $ext == 'jpg' || $ext == 'gif' || $ext == 'jpeg') ) { | ||||
|  | ||||
| 		echo '<tr>' | ||||
| 		.'<td><div style="display:none">'.$checked.'</div></td>' | ||||
| 		.'<td>' | ||||
| 		.'<a href="#" onclick="if (window.parent) window.parent.'. $this->fce.'(\'' .$this->_tmp_file->path_with_name_relative_no.'\')">' | ||||
| 		. HTMLHelper::_( 'image', str_replace( '../', '', $this->_tmp_file->path_without_name_relative), Text::_('COM_PHOCADOWNLOAD_INSERT'), array('title' => Text::_('COM_PHOCADOWNLOAD_INSERT_ICON'), 'class' => 'pd-file-image')) | ||||
| 		.'</a>' | ||||
| 		.'</td><td>' | ||||
| 		.'<div class="ph-files-row">' | ||||
| 		.'<div>' | ||||
| 		.'<a href="#" onclick="if (window.parent) window.parent.'. $this->fce.'(\'' . $this->_tmp_file->path_with_name_relative_no.'\')">' | ||||
| 		. $this->_tmp_file->name | ||||
| 		.'</a>' | ||||
| 		.'</div>' | ||||
| 		.'<div class="ph-files-row-item">' . $deleteCode . '</div>' | ||||
| 		.'</div>' | ||||
|  | ||||
| 		.'</td>' | ||||
| 		.'</tr>'; | ||||
|  | ||||
| 	} else { | ||||
|  | ||||
| 		echo '<tr>' | ||||
| 		.'<td><div style="display:none">'.$checked.'</div></td>' | ||||
| 		.'<td>' | ||||
| 		.'<a href="#" onclick="if (window.parent) window.parent.'. $this->fce.'(\'' .$this->_tmp_file->path_with_name_relative_no.'\')">' | ||||
| 		. HTMLHelper::_( 'image', $this->t['i'].'icon-file.png', '', Text::_('COM_PHOCADOWNLOAD_INSERT_FILENAME')) | ||||
| 		.'</a>' | ||||
| 		.'</td><td>' | ||||
| 		.'<div class="ph-files-row">' | ||||
| 		.'<div>' | ||||
| 		.'<a href="#" onclick="if (window.parent) window.parent.'. $this->fce.'(\'' .$this->_tmp_file->path_with_name_relative_no.'\')">' | ||||
| 		. $this->_tmp_file->name | ||||
| 		.'</a>' | ||||
| 		.'</div>' | ||||
| 		.'<div class="ph-files-row-item">' . $deleteCode . '</div>' | ||||
| 		.'</div>' | ||||
|  | ||||
| 		.'</td>' | ||||
| 		.'</tr>'; | ||||
| 	} | ||||
| } | ||||
| ?> | ||||
| @ -0,0 +1,46 @@ | ||||
| <?php | ||||
| /* @package Joomla | ||||
|  * @copyright Copyright (C) Open Source Matters. All rights reserved. | ||||
|  * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php | ||||
|  * @extension Phoca Extension | ||||
|  * @copyright Copyright (C) Jan Pavelka www.phoca.cz | ||||
|  * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL | ||||
|  */ | ||||
| defined('_JEXEC') or die('Restricted access'); | ||||
| use Joomla\CMS\HTML\HTMLHelper; | ||||
| use Joomla\CMS\Router\Route; | ||||
| use Joomla\CMS\Language\Text; | ||||
| $group 	= PhocaDownloadSettings::getManagerGroup($this->manager); | ||||
|  | ||||
| if ($this->manager == 'filemultiple') { | ||||
|  | ||||
| 	$checked 	= HTMLHelper::_('grid.id', $this->folderi, $this->folders[$this->folderi]->path_with_name_relative_no, 0, 'foldercid' ); | ||||
| 	$link		= 'index.php?option=com_phocadownload&view=phocadownloadmanager' | ||||
| 		 .'&manager='.htmlspecialchars($this->manager) | ||||
| 		 .$group['c'] | ||||
| 		 .'&folder='.htmlspecialchars($this->_tmp_folder->path_with_name_relative_no) | ||||
| 		 .'&field='. htmlspecialchars((string)$this->field); | ||||
|  | ||||
| 	echo '<tr>' | ||||
| 	.' <td>'. $checked .'</td>' | ||||
| 	.' <td class="ph-img-table"><a href="'. Route::_( $link ).'">' | ||||
| 	. HTMLHelper::_( 'image', $this->t['i'].'icon-16-folder-small.png', '').'</a></td>' | ||||
| 	.' <td><a href="'. Route::_( $link ).'">'. $this->_tmp_folder->name.'</a></td>' | ||||
| 	.'</tr>'; | ||||
|  | ||||
| } else { | ||||
|  | ||||
| 	$link		= 'index.php?option=com_phocadownload&view=phocadownloadmanager' | ||||
| 		 .'&manager='. $this->manager | ||||
| 		 . $group['c'] | ||||
| 		 .'&folder='.$this->_tmp_folder->path_with_name_relative_no | ||||
| 		 .'&field='. $this->field; | ||||
|  | ||||
| 	echo '<tr>' | ||||
| 	.' <td></td>' | ||||
| 	.' <td class="ph-img-table"><a href="'. Route::_( $link ).'">' | ||||
| 	. HTMLHelper::_( 'image', $this->t['i'].'icon-16-folder-small.png', Text::_('COM_PHOCADOWNLOAD_OPEN')).'</a></td>' | ||||
| 	.' <td><a href="'. Route::_( $link ).'">'. $this->_tmp_folder->name.'</a></td>' | ||||
| 	.'</tr>'; | ||||
| } | ||||
| ?> | ||||
| @ -0,0 +1,22 @@ | ||||
| <?php | ||||
| /* @package Joomla | ||||
|  * @copyright Copyright (C) Open Source Matters. All rights reserved. | ||||
|  * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php | ||||
|  * @extension Phoca Extension | ||||
|  * @copyright Copyright (C) Jan Pavelka www.phoca.cz | ||||
|  * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL | ||||
|  */ | ||||
| defined('_JEXEC') or die('Restricted access'); | ||||
| use Joomla\CMS\Uri\Uri; | ||||
| use Joomla\CMS\Language\Text; | ||||
| echo '<div id="'.$this->t['c'].'-multipleupload" class="ph-in">'; | ||||
| echo $this->t['mu_response_msg'] ; | ||||
| echo '<form action="'. Uri::base().'index.php?option='.$this->t['o'].'" >'; | ||||
| if ($this->t['ftp']) {echo PhocaDownloadFileUpload::renderFTPaccess();} | ||||
| echo '<div class="control-label ph-head-form-small">' . Text::_( $this->t['l'].'_UPLOAD_FILE' ).' ['. Text::_( $this->t['l'].'_MAX_SIZE' ).': '.$this->t['uploadmaxsizeread'] | ||||
| 	.']</div>'; | ||||
| echo '<small>'.Text::_($this->t['l'].'_SELECT_FILES').'. '.Text::_($this->t['l'].'_ADD_FILES_TO_UPLOAD_QUEUE_AND_CLICK_START_BUTTON').'</small>'; | ||||
| echo $this->t['mu_output']; | ||||
| echo '</form>'; | ||||
| echo '</div>'; | ||||
| ?> | ||||
| @ -0,0 +1,21 @@ | ||||
| <?php | ||||
| /* @package Joomla | ||||
|  * @copyright Copyright (C) Open Source Matters. All rights reserved. | ||||
|  * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php | ||||
|  * @extension Phoca Extension | ||||
|  * @copyright Copyright (C) Jan Pavelka www.phoca.cz | ||||
|  * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL | ||||
|  */ | ||||
|  defined('_JEXEC') or die('Restricted access'); | ||||
| use Joomla\CMS\HTML\HTMLHelper; | ||||
|  | ||||
| $group 	= PhocaDownloadSettings::getManagerGroup($this->manager); | ||||
|  | ||||
| $link = 'index.php?option='.$this->t['o'].'&view='. PhocaDownloadUtils::filterValue($this->t['task'], 'alphanumeric').'&manager='.PhocaDownloadUtils::filterValue($this->manager, 'alphanumeric'). $group['c'] .'&folder='.PhocaDownloadUtils::filterValue($this->folderstate->parent, 'folderpath') .'&field='. PhocaDownloadUtils::filterValue($this->field, 'alphanumeric2'); | ||||
| echo '<tr><td> </td>' | ||||
| .'<td class="ph-img-table">' | ||||
| .'<a href="'.$link.'" >' | ||||
| . HTMLHelper::_( 'image', $this->t['i'].'icon-16-up.png', '').'</a>' | ||||
| .'</td>' | ||||
| .'<td><a href="'.$link.'" >..</a></td>' | ||||
| .'</tr>'; | ||||
| @ -0,0 +1,20 @@ | ||||
| <?php | ||||
| /* @package Joomla | ||||
|  * @copyright Copyright (C) Open Source Matters. All rights reserved. | ||||
|  * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php | ||||
|  * @extension Phoca Extension | ||||
|  * @copyright Copyright (C) Jan Pavelka www.phoca.cz | ||||
|  * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL | ||||
|  */ | ||||
| defined('_JEXEC') or die('Restricted access'); | ||||
| use Joomla\CMS\Language\Text; | ||||
| echo '<div id="'.$this->t['c'].'-upload" class="ph-in">'; | ||||
| echo '<div id="upload-noflash" class="actions">'; | ||||
| echo '<form action="'. $this->t['su_url'] .'" id="uploadFormU" method="post" enctype="multipart/form-data">'; | ||||
| if ($this->t['ftp']) { echo PhocaDownloadFileUpload::renderFTPaccess();} | ||||
| echo '<div class="control-label ph-head-form">'. Text::_( $this->t['l'].'_UPLOAD_FILE' ).' ['. Text::_( $this->t['l'].'_MAX_SIZE' ).': '.$this->t['uploadmaxsizeread'].'] </div>'; | ||||
| echo $this->t['su_output']; | ||||
| echo '</form>'; | ||||
| echo '</div>'; | ||||
| echo '</div>'; | ||||
| ?> | ||||
| @ -0,0 +1 @@ | ||||
| <html><body bgcolor="#FFFFFF"></body></html> | ||||
| @ -0,0 +1,196 @@ | ||||
| <?php | ||||
| /* @package Joomla | ||||
|  * @copyright Copyright (C) Open Source Matters. All rights reserved. | ||||
|  * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php | ||||
|  * @extension Phoca Extension | ||||
|  * @copyright Copyright (C) Jan Pavelka www.phoca.cz | ||||
|  * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL | ||||
|  */ | ||||
| defined( '_JEXEC' ) or die(); | ||||
| use Joomla\CMS\MVC\View\HtmlView; | ||||
| use Joomla\CMS\Factory; | ||||
| use Joomla\CMS\Component\ComponentHelper; | ||||
| use Joomla\CMS\Uri\Uri; | ||||
| use Joomla\CMS\Session\Session; | ||||
| use Joomla\CMS\Language\Text; | ||||
| use Joomla\CMS\Client\ClientHelper; | ||||
| use Joomla\CMS\HTML\HTMLHelper; | ||||
| use Joomla\CMS\Object\CMSObject; | ||||
| use Joomla\CMS\Toolbar\ToolbarHelper; | ||||
| jimport( 'joomla.client.helper' ); | ||||
| jimport( 'joomla.application.component.view' ); | ||||
| jimport( 'joomla.html.pane' ); | ||||
|  | ||||
| class PhocaDownloadCpViewPhocaDownloadManager extends HtmlView | ||||
| { | ||||
| 	protected $field; | ||||
| 	protected $fce; | ||||
| 	protected $folderstate; | ||||
| 	protected $images; | ||||
| 	protected $folders; | ||||
| 	protected $tmpl; | ||||
| 	protected $session; | ||||
| 	protected $currentFolder; | ||||
| 	protected $t; | ||||
| 	protected $r; | ||||
| 	protected $returnUrl; | ||||
|  | ||||
| 	public function display($tpl = null) { | ||||
|  | ||||
| 		$this->t		= PhocaDownloadUtils::setVars('manager'); | ||||
| 		$this->r 		= new PhocaDownloadRenderAdminView(); | ||||
| 		$this->field	= Factory::getApplication()->input->get('field'); | ||||
| 		$this->fce 		= 'phocaSelectFileName_'.$this->field; | ||||
| 		$this->returnUrl = base64_encode(Uri::getInstance()->toString()); | ||||
| 		$this->folderstate	= $this->get('FolderState'); | ||||
| 		$this->files		= $this->get('Files'); | ||||
| 		$this->folders		= $this->get('Folders'); | ||||
| 		$this->session		= Factory::getSession(); | ||||
| 		$this->manager 		= Factory::getApplication()->input->get( 'manager', '',  'file' ); | ||||
|  | ||||
|  | ||||
| 		if ($this->manager == 'filemultiple') { | ||||
| 			$this->form			= $this->get('Form'); | ||||
| 		} | ||||
|  | ||||
| 		$params = ComponentHelper::getParams($this->t['o']); | ||||
|  | ||||
| 		$this->t['multipleuploadchunk']	= $params->get( 'multiple_upload_chunk', 0 ); | ||||
| 		$this->t['uploadmaxsize'] 		= $params->get( 'upload_maxsize', 3145728 ); | ||||
| 		$this->t['uploadmaxsizeread'] 	= PhocaDownloadFile::getFileSizeReadable($this->t['uploadmaxsize']); | ||||
| 		$this->t['enablemultiple'] 		= $params->get( 'enable_multiple_upload_admin', 1 ); | ||||
| 		$this->t['multipleuploadmethod'] = $params->get( 'multiple_upload_method', 4 ); | ||||
|  | ||||
| 		$this->currentFolder = ''; | ||||
| 		if (isset($this->folderstate->folder) && $this->folderstate->folder != '') { | ||||
| 			$this->currentFolder = $this->folderstate->folder; | ||||
| 		} | ||||
|  | ||||
| 		// - - - - - - - - - - | ||||
| 		//TABS | ||||
| 		// - - - - - - - - - - | ||||
| 		$this->t['tab'] 			= Factory::getApplication()->input->get('tab', '', '', 'string'); | ||||
| 		$this->t['displaytabs']	= 0; | ||||
|  | ||||
| 		// UPLOAD | ||||
| 		$this->t['currenttab']['upload'] = $this->t['displaytabs']; | ||||
| 		$this->t['displaytabs']++; | ||||
|  | ||||
| 		// MULTIPLE UPLOAD | ||||
| 		if((int)$this->t['enablemultiple']  >= 0) { | ||||
| 			$this->t['currenttab']['multipleupload'] = $this->t['displaytabs']; | ||||
| 			$this->t['displaytabs']++; | ||||
| 		} | ||||
|  | ||||
| 		$group 	= PhocaDownloadSettings::getManagerGroup($this->manager); | ||||
|  | ||||
| 		// - - - - - - - - - - - | ||||
| 		// Upload | ||||
| 		// - - - - - - - - - - - | ||||
| 		$sU							= new PhocaDownloadFileUploadSingle(); | ||||
| 		$sU->returnUrl				= 'index.php?option=com_phocadownload&view=phocadownloadmanager&tab=upload'.str_replace('&', '&', $group['c']).'&manager='.PhocaDownloadUtils::filterValue($this->manager, 'alphanumeric').'&field='.PhocaDownloadUtils::filterValue($this->field, 'alphanumeric2').'&folder='.PhocaDownloadUtils::filterValue($this->currentFolder, 'folderpath'); | ||||
| 		$sU->tab					= 'upload'; | ||||
| 		$this->t['su_output']	= $sU->getSingleUploadHTML(); | ||||
| 		$this->t['su_url']		= Uri::base().'index.php?option=com_phocadownload&task=phocadownloadupload.upload&' | ||||
| 								  .$this->session->getName().'='.$this->session->getId().'&' | ||||
| 								  . Session::getFormToken().'=1&viewback=phocadownloadmanager&manager='.PhocaDownloadUtils::filterValue($this->manager, 'alphanumeric').'&field='.PhocaDownloadUtils::filterValue($this->field, 'alphanumeric2').'&' | ||||
| 								  .'folder='. PhocaDownloadUtils::filterValue($this->currentFolder, 'folderpath').'&tab=upload'; | ||||
|  | ||||
|  | ||||
| 		// - - - - - - - - - - - | ||||
| 		// Multiple Upload | ||||
| 		// - - - - - - - - - - - | ||||
| 		// Get infos from multiple upload | ||||
| 		$muFailed						= Factory::getApplication()->input->get( 'mufailed', '0', '', 'int' ); | ||||
| 		$muUploaded						= Factory::getApplication()->input->get( 'muuploaded', '0', '', 'int' ); | ||||
| 		$this->t['mu_response_msg']	= $muUploadedMsg 	= ''; | ||||
|  | ||||
| 		if ($muUploaded > 0) { | ||||
| 			$muUploadedMsg = Text::_('COM_PHOCADOWNLOAD_COUNT_UPLOADED_FILE'). ': ' . $muUploaded; | ||||
| 		} | ||||
| 		if ($muFailed > 0) { | ||||
| 			$muFailedMsg = Text::_('COM_PHOCADOWNLOAD_COUNT_NOT_UPLOADED_FILE'). ': ' . $muFailed; | ||||
| 		} | ||||
| 		if ($muFailed > 0 && $muUploaded > 0) { | ||||
| 			$this->t['mu_response_msg'] = '<div class="alert alert-info alert-dismissible">' | ||||
| 			.'' | ||||
| 			.Text::_('COM_PHOCADOWNLOAD_COUNT_UPLOADED_FILE'). ': ' . $muUploaded .'<br />' | ||||
| 			.Text::_('COM_PHOCADOWNLOAD_COUNT_NOT_UPLOADED_FILE'). ': ' . $muFailed.'<button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>'; | ||||
| 		} else if ($muFailed > 0 && $muUploaded == 0) { | ||||
| 			$this->t['mu_response_msg'] = '<div class="alert alert-danger alert-dismissible">' | ||||
| 			.'' | ||||
| 			.Text::_('COM_PHOCADOWNLOAD_COUNT_NOT_UPLOADED_FILE'). ': ' . $muFailed.'<button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>'; | ||||
| 		} else if ($muFailed == 0 && $muUploaded > 0){ | ||||
| 			$this->t['mu_response_msg'] = '<div class="alert alert-success alert-dismissible">' | ||||
| 			.'' | ||||
| 			.Text::_('COM_PHOCADOWNLOAD_COUNT_UPLOADED_FILE'). ': ' . $muUploaded.'<button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>'; | ||||
| 		} else { | ||||
| 			$this->t['mu_response_msg'] = ''; | ||||
| 		} | ||||
|  | ||||
| 		if((int)$this->t['enablemultiple']  >= 0) { | ||||
|  | ||||
| 			PhocadownloadFileUploadMultiple::renderMultipleUploadLibraries(); | ||||
| 			$mU						= new PhocaDownloadFileUploadMultiple(); | ||||
| 			$mU->frontEnd			= 0; | ||||
| 			$mU->method				= $this->t['multipleuploadmethod']; | ||||
| 			$mU->url				= Uri::base().'index.php?option=com_phocadownload&task=phocadownloadupload.multipleupload&' | ||||
| 									 .$this->session->getName().'='.$this->session->getId().'&' | ||||
| 									 . Session::getFormToken().'=1&tab=multipleupload&manager='.PhocaDownloadUtils::filterValue($this->manager, 'alphanumeric').'&field='.PhocaDownloadUtils::filterValue($this->field, 'alphanumeric2').'&folder='. PhocaDownloadUtils::filterValue($this->currentFolder, 'folderpath'); | ||||
| 			$mU->reload				= Uri::base().'index.php?option=com_phocadownload&view=phocadownloadmanager' | ||||
| 									.str_replace('&', '&', $group['c']).'&' | ||||
| 									.$this->session->getName().'='.$this->session->getId().'&' | ||||
| 									. Session::getFormToken().'=1&tab=multipleupload&' | ||||
| 									.'manager='.PhocaDownloadUtils::filterValue($this->manager, 'alphanumeric').'&field='.PhocaDownloadUtils::filterValue($this->field, 'alphanumeric2').'&folder='. PhocaDownloadUtils::filterValue($this->currentFolder, 'folderpath'); | ||||
| 			$mU->maxFileSize		= PhocadownloadFileUploadMultiple::getMultipleUploadSizeFormat($this->t['uploadmaxsize']); | ||||
| 			$mU->chunkSize			= '1mb'; | ||||
|  | ||||
| 			$mU->renderMultipleUploadJS(0, $this->t['multipleuploadchunk']); | ||||
| 			$this->t['mu_output']= $mU->getMultipleUploadHTML(); | ||||
| 		} | ||||
|  | ||||
|  | ||||
| 		$this->t['ftp'] 			= !ClientHelper::hasCredentials('ftp'); | ||||
| 		$this->t['path']			= PhocaDownloadPath::getPathSet($this->manager); | ||||
|  | ||||
| 		$this->addToolbar(); | ||||
| 		parent::display($tpl); | ||||
| 		echo HTMLHelper::_('behavior.keepalive'); | ||||
| 	} | ||||
|  | ||||
| 	function setFolder($index = 0) { | ||||
| 		if (isset($this->folders[$index])) { | ||||
| 			$this->_tmp_folder = &$this->folders[$index]; | ||||
| 		} else { | ||||
| 			$this->_tmp_folder = new CMSObject; | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	function setFile($index = 0) { | ||||
| 		if (isset($this->files[$index])) { | ||||
| 			$this->_tmp_file = &$this->files[$index]; | ||||
| 		} else { | ||||
| 			$this->_tmp_file = new CMSObject; | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	protected function addToolbar() { | ||||
|  | ||||
| 		Factory::getApplication()->input->set('hidemainmenu', true); | ||||
| 		require_once JPATH_COMPONENT.'/helpers/'.$this->t['task'].'.php'; | ||||
| 		$state	= $this->get('State'); | ||||
| 		$class	= ucfirst($this->t['task']).'Helper'; | ||||
| 		$canDo	= $class::getActions($this->t, $state->get('filter.multiple')); | ||||
|  | ||||
| 		ToolbarHelper::title( Text::_( $this->t['l'].'_MULTIPLE_ADD' ), 'plus' ); | ||||
|  | ||||
| 		if ($canDo->get('core.create')){ | ||||
| 			ToolbarHelper::save($this->t['c'].'m.save', 'JTOOLBAR_SAVE'); | ||||
| 		} | ||||
|  | ||||
| 		ToolbarHelper::cancel($this->t['c'].'m.cancel', 'JTOOLBAR_CLOSE'); | ||||
| 		ToolbarHelper::divider(); | ||||
| 		ToolbarHelper::help( 'screen.'.$this->t['c'], true ); | ||||
| 	} | ||||
| } | ||||
| ?> | ||||
		Reference in New Issue
	
	Block a user