primo commit
This commit is contained in:
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,238 @@
|
||||
<?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
|
||||
* @component Phoca Gallery
|
||||
* @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;
|
||||
use Joomla\CMS\Router\Route;
|
||||
|
||||
$task = 'phocagallerym';
|
||||
|
||||
/*
|
||||
JHtml::_('bootstrap.tooltip');
|
||||
JHtml::_('behavior.multiselect');
|
||||
JHtml::_('dropdown.init');
|
||||
//JHtml::_('formbehavior.chosen', 'select');
|
||||
*/
|
||||
$r = $this->r;
|
||||
$app = Factory::getApplication();
|
||||
$option = $app->input->get('option');
|
||||
$tasks = $task . 's';
|
||||
|
||||
// phocagallerym-form renamed to adminForm because of used Joomla! javascript and its fixed value.
|
||||
|
||||
Factory::getDocument()->addScriptDeclaration(
|
||||
'Joomla.submitbutton = function(task)
|
||||
{
|
||||
if (task == "phocagallerym.cancel") {
|
||||
Joomla.submitform(task);
|
||||
}
|
||||
|
||||
if (task == "phocagallerym.save") {
|
||||
phocagallerymform = document.getElementById("adminForm");
|
||||
|
||||
if (phocagallerymform.boxchecked.value==0) {
|
||||
alert( "'. Text::_( "COM_PHOCAGALLERY_WARNING_SELECT_FILENAME_OR_FOLDER", true ).'" );
|
||||
} else {
|
||||
var f = phocagallerymform;
|
||||
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 (phocagallerymform.jform_catid.value == "" && nSelectedImages > 0){
|
||||
alert( "'. Text::_( "COM_PHOCAGALLERY_WARNING_IMG_SELECTED_SELECT_CATEGORY", true ).'" );
|
||||
} else {
|
||||
Joomla.submitform(task);
|
||||
}
|
||||
}
|
||||
}
|
||||
//Joomla.submitform(task);
|
||||
}'
|
||||
|
||||
);
|
||||
|
||||
echo $r->startHeader();
|
||||
echo '<div class="phoca-thumb-status">' . $this->t['enablethumbcreationstatus'] .'</div>';
|
||||
|
||||
echo $r->startForm($option, $task, 'adminForm', 'adminForm');
|
||||
echo '<div class="col-sm-4 form-horizontal" style="border-right: 1px solid #d3d3d3;padding-right: 5px;">';
|
||||
echo '<h4>'. Text::_('COM_PHOCAGALLERY_MULTIPLE_ADD'). '</h4>';
|
||||
|
||||
echo '<div>'."\n";
|
||||
$formArray = array ('title', 'alias','published', 'approved', 'ordering', 'catid', 'language');
|
||||
echo $r->group($this->form, $formArray);
|
||||
echo '</div>'. "\n";
|
||||
|
||||
echo '</div>';
|
||||
|
||||
|
||||
echo '<div class="col-sm-8 form-horizontal">';
|
||||
|
||||
echo '<div class="ph-admin-path">' . Text::_('COM_PHOCAGALLERY_PATH'). ': '.Path::clean($this->path->image_abs. $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"
|
||||
.'<input type="checkbox" name="checkall-toggle" value="" title="'.Text::_('JGLOBAL_CHECK_ALL').'" onclick="Joomla.checkAll(this)" />'. "\n"
|
||||
.'</th>'. "\n";
|
||||
echo '<th width="20"> </th>'
|
||||
.'<th width="95%">'.Text::_( 'COM_PHOCAGALLERY_FILENAME' ).'</th>'
|
||||
.'</tr>'
|
||||
.'</thead>';
|
||||
|
||||
echo '<tbody>';
|
||||
$link = 'index.php?option=com_phocagallery&view=phocagallerym&layout=edit&hidemainmenu=1&folder='.$this->folderstate->parent;
|
||||
echo '<tr><td> </td>'
|
||||
.'<td class="ph-img-table">'
|
||||
.'<a href="'.$link.'" >'
|
||||
//. JHtml::_( 'image', 'media/com_phocagallery/images/administrator/icon-16-up.png', '')
|
||||
.'<svg class="ph-si ph-si-up"><use xlink:href="#ph-si-up"></use></svg>'
|
||||
.'</a>'
|
||||
.'</td>'
|
||||
.'<td><a href="'.$link.'" >..</a></td>'
|
||||
.'</tr>';
|
||||
|
||||
if (count($this->images) > 0 || count($this->folders) > 0) {
|
||||
//FOLDERS
|
||||
for ($i = 0, $n = count($this->folders); $i<$n; $i++) {
|
||||
$checked = HTMLHelper::_( 'grid.id', $i, $this->folders[$i]->path_with_name_relative_no, false, 'foldercid' );
|
||||
//$checked = PhocaGalleryGrid::id( $i, $this->folders[$i]->path_with_name_relative_no, false, 'foldercid' );
|
||||
$link = 'index.php?option=com_phocagallery&view=phocagallerym&layout=edit&hidemainmenu=1&folder='
|
||||
.$this->folders[$i]->path_with_name_relative_no;
|
||||
echo '<tr>'
|
||||
.' <td>'. $checked .'</td>'
|
||||
.' <td class="ph-img-table"><a href="'. Route::_( $link ).'">'
|
||||
//. JHtml::_( 'image', 'media/com_phocagallery/images/administrator/icon-folder-small.gif', '')
|
||||
.'<svg class="ph-si ph-si-category"><use xlink:href="#ph-si-category"></use></svg>'
|
||||
|
||||
.'</a></td>'
|
||||
.' <td><a href="'. Route::_( $link ).'">'. $this->folders[$i]->name.'</a></td>'
|
||||
.'</tr>';
|
||||
}
|
||||
|
||||
//IMAGES
|
||||
for ($i = 0,$n = count($this->images); $i<$n; $i++) {
|
||||
$row = &$this->images[$i];
|
||||
$checked = HTMLHelper::_( 'grid.id', $i+count($this->folders), $this->images[$i]->nameno);
|
||||
//$checked = '<input type="checkbox" name="cid[]" value="'.$i.'" />';
|
||||
echo '<tr>'
|
||||
.' <td>'. $checked .'</td>'
|
||||
.' <td class="ph-img-table">'
|
||||
//. JHtml::_( 'image', 'media/com_phocagallery/images/administrator/icon-image-small.gif', '')
|
||||
.'<svg class="ph-si ph-si-image"><use xlink:href="#ph-si-image"></use></svg>'
|
||||
.'</td>'
|
||||
.' <td>'.$this->images[$i]->nameno.'</td>'
|
||||
.'</tr>';
|
||||
}
|
||||
} else {
|
||||
echo '<tr>'
|
||||
.'<td> </td>'
|
||||
.'<td> </td>'
|
||||
.'<td>'.Text::_( 'COM_PHOCAGALLERY_THERE_IS_NO_IMAGE' ).'</td>'
|
||||
.'</tr>';
|
||||
|
||||
}
|
||||
echo '</tbody>'
|
||||
.'</table>';
|
||||
|
||||
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 HTMLHelper::_('form.token');
|
||||
echo $r->endForm();
|
||||
|
||||
//echo '</div>';
|
||||
//echo '<div class="clearfix"></div>';
|
||||
|
||||
if ($this->t['displaytabs'] > 0) {
|
||||
|
||||
/*echo '<ul class="nav nav-tabs" id="configTabs">';
|
||||
|
||||
|
||||
if((int)$this->t['enablemultiple'] >= 0) {
|
||||
$label = HTMLHelper::_( 'image', 'media/com_phocagallery/images/administrator/icon-16-upload-multiple.png','') . ' '.Text::_('COM_PHOCAGALLERY_MULTIPLE_UPLOAD');
|
||||
echo '<li><a href="#multipleupload" data-toggle="tab">'.$label.'</a></li>';
|
||||
}
|
||||
|
||||
|
||||
$label = HTMLHelper::_( 'image', 'media/com_phocagallery/images/administrator/icon-16-upload.png','') . ' '.Text::_('COM_PHOCAGALLERY_UPLOAD');
|
||||
echo '<li><a href="#upload" data-toggle="tab">'.$label.'</a></li>';
|
||||
|
||||
|
||||
|
||||
if($this->t['enablejava'] >= 0) {
|
||||
|
||||
$label = HTMLHelper::_( 'image', 'media/com_phocagallery/images/administrator/icon-16-upload-java.png','') . ' '.Text::_('COM_PHOCAGALLERY_JAVA_UPLOAD');
|
||||
echo '<li><a href="#javaupload" data-toggle="tab">'.$label.'</a></li>';
|
||||
}
|
||||
$label = HTMLHelper::_( 'image', 'media/com_phocagallery/images/administrator/icon-16-folder.png','') . ' '.Text::_('COM_PHOCAGALLERY_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'] = '<svg class="ph-si ph-si-tab pg-icon-upload-multiple"><use xlink:href="#ph-si-upload-multiple"></use></svg>' . ' '.Text::_('COM_PHOCAGALLERY_MULTIPLE_UPLOAD');
|
||||
$tabs['upload'] = '<svg class="ph-si ph-si-tab pg-icon-upload"><use xlink:href="#ph-si-upload"></use></svg>' . ' '.Text::_('COM_PHOCAGALLERY_UPLOAD');
|
||||
$tabs['createfolder'] = '<svg class="ph-si ph-si-tab pg-icon-category"><use xlink:href="#ph-si-category"></use></svg>'. ' '.Text::_('COM_PHOCAGALLERY_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 PhocaGalleryFileUpload::renderCreateFolder($this->session->getName(), $this->session->getId(), $this->currentFolder, 'phocagallerym', 'tab=createfolder' );
|
||||
echo $r->endTab();
|
||||
|
||||
echo $r->endTabs();
|
||||
}
|
||||
|
||||
/*
|
||||
if ($this->t['tab'] != '') {$jsCt = 'a[href=#'.$this->t['tab'] .']';} else {$jsCt = 'a:first';}
|
||||
echo '<script type="text/javascript">';
|
||||
echo ' jQuery(\'#configTabs '.$jsCt.'\').tab(\'show\');'; // Select first tab
|
||||
echo '</script>';
|
||||
*/
|
||||
?>
|
||||
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/*
|
||||
* @package Joomla
|
||||
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
|
||||
*
|
||||
* @component Phoca Gallery
|
||||
* @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;
|
||||
if (!empty($this->t['ju_output'])) {
|
||||
echo '<div id="phocagallery-javaupload" class="ph-in">';
|
||||
echo '<form action="'. Uri::base().'index.php?option=com_phocagallery" >';
|
||||
if ($this->t['ftp']) {echo PhocaGalleryFileUpload::renderFTPaccess();}
|
||||
echo '<div class="control-label ph-head-form">' . Text::_( 'COM_PHOCAGALLERY_UPLOAD_FILE' ).' [ '. Text::_( 'COM_PHOCAGALLERY_MAX_SIZE' ).': '.$this->t['uploadmaxsizeread'].','
|
||||
.' '.Text::_('COM_PHOCAGALLERY_MAX_RESOLUTION').': '. $this->t['uploadmaxreswidth'].' x '.$this->t['uploadmaxresheight'].' px ]</div>';
|
||||
echo $this->t['ju_output'];
|
||||
echo '</form>';
|
||||
echo '</div>';
|
||||
}
|
||||
?>
|
||||
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
/*
|
||||
* @package Joomla
|
||||
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
|
||||
*
|
||||
* @component Phoca Gallery
|
||||
* @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="phocagallery-multipleupload" class="ph-in">';
|
||||
echo $this->t['mu_response_msg'] ;
|
||||
echo '<form action="'. Uri::base().'index.php?option=com_phocagallery" >';
|
||||
if ($this->t['ftp']) {echo PhocaGalleryFileUpload::renderFTPaccess();}
|
||||
echo '<div class="control-label ph-head-form-small">' . Text::_( 'COM_PHOCAGALLERY_UPLOAD_FILE' ).' [ ';
|
||||
|
||||
if ($this->t['uploadmaxsizeread'] != '0 B') {
|
||||
echo Text::_( 'COM_PHOCAGALLERY_MAX_SIZE' ).': '.$this->t['uploadmaxsizeread'].','.' ';
|
||||
}
|
||||
|
||||
echo Text::_('COM_PHOCAGALLERY_MAX_RESOLUTION').': '. $this->t['uploadmaxreswidth'].' x '.$this->t['uploadmaxresheight'].' px ]</div>';
|
||||
echo '<small>'.Text::_('COM_PHOCAGALLERY_SELECT_IMAGES').'. '.Text::_('COM_PHOCAGALLERY_ADD_IMAGES_TO_UPLOAD_QUEUE_AND_CLICK_START_BUTTON').'</small>';
|
||||
echo $this->t['mu_output'];
|
||||
echo '</form>';
|
||||
echo '</div>';
|
||||
?>
|
||||
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/*
|
||||
* @package Joomla
|
||||
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
|
||||
*
|
||||
* @component Phoca Gallery
|
||||
* @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="phocagallery-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 PhocaGalleryFileUpload::renderFTPaccess();}
|
||||
echo '<div class="control-label ph-head-form">'. Text::_( 'COM_PHOCAGALLERY_UPLOAD_FILE' ).' [ ';
|
||||
|
||||
if ($this->t['uploadmaxsizeread'] != '0 B') {
|
||||
echo Text::_( 'COM_PHOCAGALLERY_MAX_SIZE' ).': '.$this->t['uploadmaxsizeread'].','
|
||||
.' ';
|
||||
}
|
||||
echo Text::_('COM_PHOCAGALLERY_MAX_RESOLUTION').': '. $this->t['uploadmaxreswidth'].' x '.$this->t['uploadmaxresheight'].' px ]</div>';
|
||||
echo $this->t['su_output'];
|
||||
echo '</form>';
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
?>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,229 @@
|
||||
<?php
|
||||
/*
|
||||
* @package Joomla.Framework
|
||||
* @copyright Copyright (C) 2005 - 2010 Open Source Matters, Inc. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*
|
||||
* @component Phoca Component
|
||||
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License version 2 or later;
|
||||
*/
|
||||
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\Toolbar\ToolbarHelper;
|
||||
use Joomla\CMS\Toolbar\Toolbar;
|
||||
jimport( 'joomla.client.helper' );
|
||||
jimport( 'joomla.application.component.view' );
|
||||
jimport( 'joomla.html.pane' );
|
||||
phocagalleryimport( 'phocagallery.file.fileuploadmultiple' );
|
||||
phocagalleryimport( 'phocagallery.file.fileuploadsingle' );
|
||||
phocagalleryimport( 'phocagallery.file.fileuploadjava' );
|
||||
|
||||
class PhocaGalleryCpViewPhocaGalleryM extends HtmlView
|
||||
{
|
||||
protected $form;
|
||||
protected $folderstate;
|
||||
protected $images;
|
||||
protected $folders;
|
||||
protected $t;
|
||||
protected $r;
|
||||
protected $session;
|
||||
protected $currentFolder;
|
||||
protected $path;
|
||||
|
||||
public function display($tpl = null) {
|
||||
|
||||
$this->form = $this->get('Form');
|
||||
$this->folderstate = $this->get('FolderState');
|
||||
$this->images = $this->get('Images');
|
||||
$this->folders = $this->get('Folders');
|
||||
$this->session = Factory::getSession();
|
||||
$this->path = PhocaGalleryPath::getPath();
|
||||
|
||||
|
||||
$this->t = PhocaGalleryUtils::setVars('m');
|
||||
$this->r = new PhocaGalleryRenderAdminview();
|
||||
|
||||
// Set Default Value
|
||||
$this->form->setValue('published', '', 1);
|
||||
$this->form->setValue('approved', '', 1);
|
||||
$this->form->setValue('language', '', '*');
|
||||
|
||||
|
||||
|
||||
|
||||
$params = ComponentHelper::getParams('com_phocagallery');
|
||||
$this->t['enablethumbcreation'] = $params->get('enable_thumb_creation', 1 );
|
||||
$this->t['enablethumbcreationstatus'] = PhocaGalleryRenderAdmin::renderThumbnailCreationStatus((int)$this->t['enablethumbcreation']);
|
||||
$this->t['multipleuploadchunk'] = $params->get( 'multiple_upload_chunk', 0 );
|
||||
$this->t['large_image_width'] = $params->get( 'large_image_width', 640 );
|
||||
$this->t['large_image_height'] = $params->get( 'large_image_height', 480 );
|
||||
$this->t['javaboxwidth'] = $params->get( 'java_box_width', 480 );
|
||||
$this->t['javaboxheight'] = $params->get( 'java_box_height', 480 );
|
||||
$this->t['uploadmaxsize'] = $params->get( 'upload_maxsize', 3145728 );
|
||||
$this->t['uploadmaxsizeread'] = PhocaGalleryFile::getFileSizeReadable($this->t['uploadmaxsize']);
|
||||
$this->t['uploadmaxreswidth'] = $params->get( 'upload_maxres_width', 3072 );
|
||||
$this->t['uploadmaxresheight'] = $params->get( 'upload_maxres_height', 2304 );
|
||||
$this->t['enablejava'] = $params->get( 'enable_java', -1 );
|
||||
$this->t['enablemultiple'] = $params->get( 'enable_multiple', 0 );
|
||||
$this->t['multipleuploadmethod'] = $params->get( 'multiple_upload_method', 4 );
|
||||
$this->t['multipleresizewidth'] = $params->get( 'multiple_resize_width', -1 );
|
||||
$this->t['multipleresizeheight'] = $params->get( 'multiple_resize_height', -1 );
|
||||
|
||||
|
||||
if((int)$this->t['enablemultiple'] >= 0) {
|
||||
PhocaGalleryFileUploadMultiple::renderMultipleUploadLibraries();
|
||||
}
|
||||
$this->r = new PhocaGalleryRenderAdminView();
|
||||
|
||||
|
||||
$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;
|
||||
|
||||
// MULTIPLE UPLOAD
|
||||
if((int)$this->t['enablemultiple'] >= 0) {
|
||||
$this->t['currenttab']['multipleupload'] = $this->t['displaytabs'];
|
||||
$this->t['displaytabs']++;
|
||||
} else {
|
||||
$this->t['currenttab']['multipleupload'] = 0;
|
||||
}
|
||||
|
||||
// UPLOAD
|
||||
$this->t['currenttab']['upload'] = $this->t['displaytabs'];
|
||||
$this->t['displaytabs']++;
|
||||
|
||||
|
||||
|
||||
// MULTIPLE UPLOAD
|
||||
if($this->t['enablejava'] >= 0) {
|
||||
$this->t['currenttab']['javaupload'] = $this->t['displaytabs'];
|
||||
$this->t['displaytabs']++;
|
||||
} else {
|
||||
$this->t['currenttab']['javaupload'] = 0;
|
||||
}
|
||||
|
||||
// - - - - - - - - - - -
|
||||
// Upload
|
||||
// - - - - - - - - - - -
|
||||
$sU = new PhocaGalleryFileUploadSingle();
|
||||
$sU->returnUrl = 'index.php?option=com_phocagallery&view=phocagallerym&layout=edit&tab=upload&folder='. PhocaGalleryText::filterValue($this->currentFolder, 'folderpath');
|
||||
$sU->tab = 'upload';
|
||||
$this->t['su_output'] = $sU->getSingleUploadHTML();
|
||||
$this->t['su_url'] = Uri::base().'index.php?option=com_phocagallery&task=phocagalleryu.upload&'
|
||||
.$this->session->getName().'='.$this->session->getId().'&'
|
||||
. Session::getFormToken().'=1&viewback=phocagallerym&'
|
||||
.'folder='. PhocaGalleryText::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_PHOCAGALLERY_COUNT_UPLOADED_IMG'). ': ' . $muUploaded;
|
||||
}
|
||||
if ($muFailed > 0) {
|
||||
$muFailedMsg = Text::_('COM_PHOCAGALLERY_COUNT_NOT_UPLOADED_IMG'). ': ' . $muFailed;
|
||||
}
|
||||
|
||||
if ($muFailed > 0 && $muUploaded > 0) {
|
||||
$this->t['mu_response_msg'] = '<div class="alert alert-info">'
|
||||
.'<button type="button" class="close" data-dismiss="alert">×</button>'
|
||||
.Text::_('COM_PHOCAGALLERY_COUNT_UPLOADED_IMG'). ': ' . $muUploaded .'<br />'
|
||||
.Text::_('COM_PHOCAGALLERY_COUNT_NOT_UPLOADED_IMG'). ': ' . $muFailed.'</div>';
|
||||
} else if ($muFailed > 0 && $muUploaded == 0) {
|
||||
$this->t['mu_response_msg'] = '<div class="alert alert-error alert-danger">'
|
||||
.'<button type="button" class="close" data-dismiss="alert">×</button>'
|
||||
.Text::_('COM_PHOCAGALLERY_COUNT_NOT_UPLOADED_IMG'). ': ' . $muFailed.'</div>';
|
||||
} else if ($muFailed == 0 && $muUploaded > 0){
|
||||
$this->t['mu_response_msg'] = '<div class="alert alert-success">'
|
||||
.'<button type="button" class="close" data-dismiss="alert">×</button>'
|
||||
.Text::_('COM_PHOCAGALLERY_COUNT_UPLOADED_IMG'). ': ' . $muUploaded.'</div>';
|
||||
} else {
|
||||
$this->t['mu_response_msg'] = '';
|
||||
}
|
||||
|
||||
if((int)$this->t['enablemultiple'] >= 0) {
|
||||
|
||||
|
||||
$mU = new PhocaGalleryFileUploadMultiple();
|
||||
$mU->frontEnd = 0;
|
||||
$mU->method = $this->t['multipleuploadmethod'];
|
||||
$mU->url = Uri::base().'index.php?option=com_phocagallery&task=phocagalleryu.multipleupload&'
|
||||
.$this->session->getName().'='.$this->session->getId().'&'
|
||||
. Session::getFormToken().'=1&tab=multipleupload&folder='. PhocaGalleryText::filterValue($this->currentFolder, 'folderpath');
|
||||
$mU->reload = Uri::base().'index.php?option=com_phocagallery&view=phocagallerym&layout=edit&'
|
||||
.$this->session->getName().'='.$this->session->getId().'&'
|
||||
. Session::getFormToken().'=1&tab=multipleupload&folder='. PhocaGalleryText::filterValue($this->currentFolder, 'folderpath');
|
||||
$mU->maxFileSize = PhocaGalleryFileUploadMultiple::getMultipleUploadSizeFormat($this->t['uploadmaxsize']);
|
||||
$mU->chunkSize = '1mb';
|
||||
$mU->imageHeight = $this->t['multipleresizeheight'];
|
||||
$mU->imageWidth = $this->t['multipleresizewidth'];
|
||||
$mU->imageQuality = 100;
|
||||
$mU->renderMultipleUploadJS(0, $this->t['multipleuploadchunk']);
|
||||
$this->t['mu_output']= $mU->getMultipleUploadHTML();
|
||||
}
|
||||
|
||||
// - - - - - - - - - - -
|
||||
// Java Upload
|
||||
// - - - - - - - - - - -
|
||||
if((int)$this->t['enablejava'] >= 0) {
|
||||
$jU = new PhocaGalleryFileUploadJava();
|
||||
$jU->width = $this->t['javaboxwidth'];
|
||||
$jU->height = $this->t['javaboxheight'];
|
||||
$jU->resizewidth = $this->t['multipleresizewidth'];
|
||||
$jU->resizeheight = $this->t['multipleresizeheight'];
|
||||
$jU->uploadmaxsize = $this->t['uploadmaxsize'];
|
||||
$jU->returnUrl = Uri::base().'index.php?option=com_phocagallery&view=phocagallerym&layout=edit&tab=javaupload&folder='. PhocaGalleryText::filterValue($this->currentFolder, 'folderpath');
|
||||
$jU->url = Uri::base(). 'index.php?option=com_phocagallery&task=phocagalleryu.javaupload&'
|
||||
.$this->session->getName().'='.$this->session->getId().'&'
|
||||
. Session::getFormToken().'=1&viewback=phocagallerym&tab=javaupload&folder='. PhocaGalleryText::filterValue($this->currentFolder, 'folderpath');
|
||||
$jU->source = Uri::root(true).'/media/com_phocagallery/js/jupload/wjhk.jupload.jar';
|
||||
$this->t['ju_output'] = $jU->getJavaUploadHTML();
|
||||
|
||||
}
|
||||
$this->t['ftp'] = !ClientHelper::hasCredentials('ftp');
|
||||
|
||||
$this->addToolbar();
|
||||
parent::display($tpl);
|
||||
echo HTMLHelper::_('behavior.keepalive');
|
||||
}
|
||||
|
||||
protected function addToolbar() {
|
||||
|
||||
require_once JPATH_COMPONENT.'/helpers/phocagallerym.php';
|
||||
Factory::getApplication()->input->set('hidemainmenu', true);
|
||||
$state = $this->get('State');
|
||||
$canDo = PhocaGalleryMHelper::getActions($state->get('filter.multiple'));
|
||||
|
||||
ToolbarHelper::title( Text::_( 'COM_PHOCAGALLERY_MULTIPLE_ADD' ), 'plus' );
|
||||
|
||||
if ($canDo->get('core.create')){
|
||||
ToolbarHelper::save('phocagallerym.save', 'JToolbar_SAVE');
|
||||
}
|
||||
|
||||
ToolbarHelper::cancel('phocagallerym.cancel', 'JToolbar_CLOSE');
|
||||
ToolbarHelper::divider();
|
||||
ToolbarHelper::help( 'screen.phocagallery', true );
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user