primo commit
This commit is contained in:
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,129 @@
|
||||
<?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;
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Language\Text;
|
||||
|
||||
$task = 'phocagalleryc';
|
||||
|
||||
//JHtml::_('behavior.tooltip');
|
||||
//JHtml::_('behavior.formvalidation');
|
||||
HtmlHelper::_('behavior.keepalive');
|
||||
//JHtml::_('formbehavior.chosen', 'select');
|
||||
|
||||
$r = $this->r;
|
||||
$app = Factory::getApplication();
|
||||
$option = $app->input->get('option');
|
||||
$OPT = strtoupper($option);
|
||||
|
||||
Factory::getDocument()->addScriptDeclaration(
|
||||
|
||||
'Joomla.submitbutton = function(task) {
|
||||
|
||||
if (task == "'. $this->t['task'].'.cancel" || document.formvalidator.isValid(document.getElementById("adminForm"))) {
|
||||
|
||||
if (task == "phocagalleryc.loadextimgp") {
|
||||
document.getElementById("phOverlayDiv").style.display="block";
|
||||
}
|
||||
if (task == "phocagalleryc.loadextimgf") {
|
||||
document.getElementById("phOverlayDiv").style.display="block";
|
||||
}
|
||||
if (task == "phocagalleryc.uploadextimgf") {
|
||||
document.getElementById("phOverlayDiv").style.display="block";
|
||||
}
|
||||
if (task == "phocagalleryc.loadextimgi") {
|
||||
document.getElementById("phOverlayDiv").style.display="block";
|
||||
}
|
||||
|
||||
Joomla.submitform(task, document.getElementById("adminForm"));
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}'
|
||||
|
||||
);
|
||||
|
||||
echo $r->startHeader();
|
||||
echo $r->startForm($option, $task, $this->item->id, 'adminForm', 'adminForm');
|
||||
// First Column
|
||||
echo '<div class="span12 form-horizontal">';
|
||||
$tabs = array (
|
||||
'general' => Text::_($OPT.'_GENERAL_OPTIONS'),
|
||||
'publishing' => Text::_($OPT.'_PUBLISHING_OPTIONS'),
|
||||
'metadata' => Text::_($OPT.'_METADATA_OPTIONS'),
|
||||
/*'picasa' => Text::_($OPT.'_PICASA_SETTINGS'),*/
|
||||
'imgur' => Text::_($OPT.'_IMGUR_SETTINGS')/*,
|
||||
'facebook' => Text::_($OPT.'_FB_SETTINGS')*/);
|
||||
echo $r->navigation($tabs);
|
||||
|
||||
|
||||
$formArray = array ('title', 'alias');
|
||||
echo $r->groupHeader($this->form, $formArray);
|
||||
|
||||
echo $r->startTabs();
|
||||
|
||||
echo $r->startTab('general', $tabs['general'], 'active');
|
||||
$formArray = array ('parent_id', 'image_id', 'ordering', 'access', 'accessuserid', 'uploaduserid', 'deleteuserid', 'owner_id', 'userfolder', 'latitude', 'longitude', 'zoom', 'geotitle');
|
||||
echo $r->group($this->form, $formArray);
|
||||
$formArray = array('description');
|
||||
echo $r->group($this->form, $formArray, 1);
|
||||
echo $r->endTab();
|
||||
|
||||
echo $r->startTab('publishing', $tabs['publishing']);
|
||||
foreach($this->form->getFieldset('publish') as $field) {
|
||||
echo '<div class="control-group">';
|
||||
if (!$field->hidden) {
|
||||
echo '<div class="control-label">'.$field->label.'</div>';
|
||||
}
|
||||
echo '<div class="controls">';
|
||||
echo $field->input;
|
||||
echo '</div></div>';
|
||||
}
|
||||
echo $r->endTab();
|
||||
|
||||
echo $r->startTab('metadata', $tabs['metadata']);
|
||||
echo $this->loadTemplate('metadata');
|
||||
echo $r->endTab();
|
||||
/*
|
||||
if ($this->t['enablepicasaloading'] == 1) {
|
||||
echo $r->startTab('picasa', $tabs['picasa']);
|
||||
$formArray = array ('extu', 'exta', 'extauth');
|
||||
echo $r->group($this->form, $formArray);
|
||||
echo $r->endTab();
|
||||
}
|
||||
*/
|
||||
echo $r->startTab('imgur', $tabs['imgur']);
|
||||
$formArray = array ('imgurclient', 'imguralbum');
|
||||
echo $r->group($this->form, $formArray);
|
||||
echo $r->endTab();
|
||||
///
|
||||
/*
|
||||
echo '<div class="tab-pane" id="facebook">'. "\n";
|
||||
// Extid is hidden - only for info if this is an external image (the filename field will be not required)
|
||||
$formArray = array ('extfbuid', 'extfbcatid');
|
||||
echo $r->group($this->form, $formArray);
|
||||
echo '</div>';
|
||||
*/
|
||||
echo $r->endTabs();
|
||||
echo '</div>';//end span10
|
||||
// Second Column
|
||||
//echo '<div class="span2"></div>';//end span2
|
||||
echo $r->formInputs($this->t['task']);
|
||||
echo $r->endForm();
|
||||
|
||||
echo '<div id="phOverlayDiv"><div id="phLoaderText">'.Text::_('COM_PHOCAGALLERY_IMGUR_LOADING_DATA').'</div><div id="phLoaderFull"></div></div>';
|
||||
/*
|
||||
?>
|
||||
<div id="loading-ext-imgp"><div class="loading"><div><div class="ph-lds-ellipsis"><div></div><div></div><div></div><div></div></div><div> </div><div><?php echo Text::_('COM_PHOCAGALLERY_PICASA_LOADING_DATA'); ?></div></div></div>
|
||||
<div id="loading-ext-imgf"><div class="loading"><div><div class="ph-lds-ellipsis"><div></div><div></div><div></div><div></div></div><div> </div><div><?php echo Text::_('COM_PHOCAGALLERY_FACEBOOK_LOADING_DATA'); ?></div></div></div>
|
||||
<div id="uploading-ext-imgf"><div class="loading"><div><div class="ph-lds-ellipsis"><div></div><div></div><div></div><div></div></div><div> </div><div><?php echo Text::_('COM_PHOCAGALLERY_FB_UPLOADING_DATA'); ?></div></div></div>
|
||||
<div id="loading-ext-imgi"><div class="loading"><div><div class="ph-lds-ellipsis"><div></div><div></div><div></div><div></div></div><div> </div><div><?php echo Text::_('COM_PHOCAGALLERY_IMGUR_LOADING_DATA'); ?></div></div></div>
|
||||
*/ ?>
|
||||
@ -0,0 +1,38 @@
|
||||
<?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;
|
||||
use Joomla\CMS\Language\Text;
|
||||
|
||||
$fieldSets = $this->form->getFieldsets('metadata');
|
||||
foreach ($fieldSets as $name => $fieldSet) :
|
||||
/*echo JHtml::_('sliders.panel',JText::_($fieldSet->label), $name.'-options');
|
||||
if (isset($fieldSet->description) && trim($fieldSet->description)) :
|
||||
echo '<p class="tip">'.$this->escape(Text::_($fieldSet->description)).'</p>';
|
||||
endif;*/
|
||||
?>
|
||||
<fieldset class="panelform">
|
||||
<div class="adminform">
|
||||
<?php if ($name == 'metadata') : // Include the real fields in this panel. ?>
|
||||
<div class="control-group">
|
||||
<div class="control-label"><?php echo $this->form->getLabel('metadesc'); ?></div>
|
||||
<div class="controls"><?php echo $this->form->getInput('metadesc'); ?></div></div>
|
||||
<div class="control-group">
|
||||
<div class="control-label"><?php echo $this->form->getLabel('metakey'); ?></div>
|
||||
<div class="controls"><?php echo $this->form->getInput('metakey'); ?></div></div>
|
||||
|
||||
<?php endif; ?>
|
||||
<?php foreach ($this->form->getFieldset($name) as $field) : ?>
|
||||
<div class="control-group">
|
||||
<div class="control-label"><?php echo $field->label; ?>
|
||||
<div class="controls"><?php echo $field->input; ?></div></div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</fieldset>
|
||||
<?php endforeach; ?>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,142 @@
|
||||
<?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\Object\CMSObject;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Toolbar\Toolbar;
|
||||
use Joomla\CMS\Toolbar\ToolbarHelper;
|
||||
jimport( 'joomla.application.component.view' );
|
||||
phocagalleryimport( 'phocagallery.access.access' );
|
||||
phocagalleryimport( 'phocagallery.rate.ratecategory' );
|
||||
phocagalleryimport( 'phocagallery.facebook.api' );
|
||||
|
||||
class PhocaGalleryCpViewPhocaGalleryC extends HtmlView
|
||||
{
|
||||
protected $state;
|
||||
protected $item;
|
||||
protected $form;
|
||||
protected $t;
|
||||
protected $r;
|
||||
|
||||
public function display($tpl = null) {
|
||||
|
||||
$this->state = $this->get('State');
|
||||
$this->form = $this->get('Form');
|
||||
$this->item = $this->get('Item');
|
||||
|
||||
$this->t = PhocaGalleryUtils::setVars('c');
|
||||
$this->r = new PhocaGalleryRenderAdminview();
|
||||
|
||||
|
||||
//$this->item->accessuserid = PhocaGalleryUtils::toArray($this->item->accessuserid);
|
||||
//$this->item->accessuserid = explode(',', $this->item->accessuserid);
|
||||
|
||||
|
||||
|
||||
$mainframe = Factory::getApplication();
|
||||
$db = Factory::getDBO();
|
||||
$uri = \Joomla\CMS\Uri\Uri::getInstance();
|
||||
$user = Factory::getUser();
|
||||
$model = $this->getModel();
|
||||
$editor = \Joomla\CMS\Editor\Editor::getInstance();
|
||||
$paramsC = ComponentHelper::getParams('com_phocagallery');
|
||||
|
||||
$this->t['enablepicasaloading'] = $paramsC->get( 'enable_picasa_loading', 1 );
|
||||
|
||||
//JHtml::_('behavior.calendar');
|
||||
|
||||
|
||||
//Data from model
|
||||
//$this->item =& $this->get('Data');
|
||||
|
||||
//Image button
|
||||
/* $link = 'index.php?option=com_phocagallery&view=phocagalleryf&tmpl=component';
|
||||
|
||||
$button = new CMSObject();
|
||||
$button->set('modal', true);
|
||||
$button->set('link', $link);
|
||||
$button->set('text', Text::_('COM_PHOCAGALLERY_FOLDER'));
|
||||
$button->set('name', 'image');
|
||||
$button->set('modalname', 'modal-button');
|
||||
$button->set('options', "{handler: 'iframe', size: {x: 620, y: 400}}");*/
|
||||
|
||||
$lists = array();
|
||||
$isNew = ((int)$this->item->id == 0);
|
||||
|
||||
// Edit or Create?
|
||||
if (!$isNew) {
|
||||
$model->checkout( $user->get('id') );
|
||||
} else {
|
||||
// initialise new record
|
||||
$this->item->approved = 1;
|
||||
$this->item->published = 1;
|
||||
$this->item->order = 0;
|
||||
$this->item->access = 0;
|
||||
}
|
||||
|
||||
$this->addToolbar();
|
||||
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
|
||||
protected function addToolbar() {
|
||||
|
||||
require_once JPATH_COMPONENT.'/helpers/phocagallerycs.php';
|
||||
Factory::getApplication()->input->set('hidemainmenu', true);
|
||||
$bar = Toolbar::getInstance('toolbar');
|
||||
$user = Factory::getUser();
|
||||
$isNew = ($this->item->id == 0);
|
||||
$checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id'));
|
||||
$canDo = PhocaGalleryCsHelper::getActions($this->state->get('filter.category_id'), $this->item->id);
|
||||
$paramsC = ComponentHelper::getParams('com_phocagallery');
|
||||
|
||||
|
||||
|
||||
$text = $isNew ? Text::_( 'COM_PHOCAGALLERY_NEW' ) : Text::_('COM_PHOCAGALLERY_EDIT');
|
||||
ToolbarHelper::title( Text::_( 'COM_PHOCAGALLERY_CATEGORY' ).': <small><small>[ ' . $text.' ]</small></small>' , 'folder');
|
||||
|
||||
// If not checked out, can save the item.
|
||||
if (!$checkedOut && $canDo->get('core.edit')){
|
||||
ToolbarHelper::apply('phocagalleryc.apply', 'JToolbar_APPLY');
|
||||
ToolbarHelper::save('phocagalleryc.save', 'JToolbar_SAVE');
|
||||
ToolbarHelper::addNew('phocagalleryc.save2new', 'JToolbar_SAVE_AND_NEW');
|
||||
/*$this->t['enablepicasaloading'] = $paramsC->get( 'enable_picasa_loading', 1 );
|
||||
///$this->t['enablefacebookloading'] = $paramsC->get( 'enable_facebook_loading', 1 );
|
||||
if($this->t['enablepicasaloading'] == 1){
|
||||
ToolbarHelper::custom('phocagalleryc.loadextimgp', 'loadextp.png', '', 'COM_PHOCAGALLERY_P_IMPORT' , false);
|
||||
}*/
|
||||
|
||||
ToolbarHelper::custom('phocagalleryc.loadextimgi', 'loadexti.png', '', 'COM_PHOCAGALLERY_I_IMPORT' , false);
|
||||
/// if($this->t['enablefacebookloading'] == 1){
|
||||
///JToolbarHelper::custom('phocagalleryc.loadextimgf', 'loadextf.png', '', 'COM_PHOCAGALLERY_FB_IMPORT' , false);
|
||||
///JToolbarHelper::custom('phocagalleryc.uploadextimgf', 'uploadextf.png', '', 'COM_PHOCAGALLERY_FB_EXPORT' , false);
|
||||
/// }
|
||||
}
|
||||
// If an existing item, can save to a copy.
|
||||
if (!$isNew && $canDo->get('core.create')) {
|
||||
//JToolbarHelper::custom('phocagalleryc.save2copy', 'copy.png', 'copy_f2.png', 'JToolbar_SAVE_AS_COPY', false);
|
||||
}
|
||||
if (empty($this->item->id)) {
|
||||
ToolbarHelper::cancel('phocagalleryc.cancel', 'JToolbar_CANCEL');
|
||||
}
|
||||
else {
|
||||
ToolbarHelper::cancel('phocagalleryc.cancel', 'JToolbar_CLOSE');
|
||||
}
|
||||
|
||||
ToolbarHelper::divider();
|
||||
ToolbarHelper::help( 'screen.phocagallery', true );
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,79 @@
|
||||
<?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;
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Language\Text;
|
||||
|
||||
$task = 'phocagalleryco';
|
||||
|
||||
//JHtml::_('behavior.tooltip');
|
||||
//JHtml::_('behavior.formvalidation');
|
||||
HtmlHelper::_('behavior.keepalive');
|
||||
//JHtml::_('formbehavior.chosen', 'select');
|
||||
|
||||
$r = $this->r;
|
||||
$app = Factory::getApplication();
|
||||
$option = $app->input->get('option');
|
||||
$OPT = strtoupper($option);
|
||||
Factory::getDocument()->addScriptDeclaration(
|
||||
|
||||
'Joomla.submitbutton = function(task) {
|
||||
if (task == "'. $this->t['task'].'.cancel" || document.formvalidator.isValid(document.getElementById("adminForm"))) {
|
||||
Joomla.submitform(task, document.getElementById("adminForm"));
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}'
|
||||
|
||||
);
|
||||
|
||||
echo $r->startHeader();
|
||||
echo $r->startForm($option, $task, $this->item->id, 'adminForm', 'adminForm');
|
||||
// First Column
|
||||
echo '<div class="span12 form-horizontal">';
|
||||
$tabs = array (
|
||||
'general' => Text::_($OPT.'_GENERAL_OPTIONS'),
|
||||
'publishing' => Text::_($OPT.'_PUBLISHING_OPTIONS'));
|
||||
echo $r->navigation($tabs);
|
||||
|
||||
|
||||
$formArray = array ('title');
|
||||
echo $r->groupHeader($this->form, $formArray);
|
||||
|
||||
echo $r->startTabs();
|
||||
|
||||
echo $r->startTab('general', $tabs['general'], 'active');
|
||||
$formArray = array ('usertitle', 'cattitle', 'ordering');
|
||||
echo $r->group($this->form, $formArray);
|
||||
$formArray = array('comment');
|
||||
echo $r->group($this->form, $formArray, 1);
|
||||
echo $r->endTab();
|
||||
|
||||
echo $r->startTab('publishing', $tabs['publishing']);
|
||||
foreach($this->form->getFieldset('publish') as $field) {
|
||||
echo '<div class="control-group">';
|
||||
if (!$field->hidden) {
|
||||
echo '<div class="control-label">'.$field->label.'</div>';
|
||||
}
|
||||
echo '<div class="controls">';
|
||||
echo $field->input;
|
||||
echo '</div></div>';
|
||||
}
|
||||
echo $r->endTab();
|
||||
echo $r->endTabs();
|
||||
echo '</div>';
|
||||
|
||||
// Second Column
|
||||
//echo '<div class="span2"></div>';//end span2
|
||||
echo $r->formInputs($this->t['task']);
|
||||
echo $r->endForm();
|
||||
?>
|
||||
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,119 @@
|
||||
<?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\Toolbar\Toolbar;
|
||||
use Joomla\CMS\Component\ComponentHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Toolbar\ToolbarHelper;
|
||||
jimport('joomla.application.component.view');
|
||||
|
||||
|
||||
class PhocaGalleryCpViewPhocaGalleryCo extends HtmlView
|
||||
{
|
||||
protected $item;
|
||||
protected $form;
|
||||
protected $state;
|
||||
protected $t;
|
||||
protected $r;
|
||||
|
||||
/**
|
||||
* Display the view
|
||||
*/
|
||||
public function display($tpl = null)
|
||||
{
|
||||
|
||||
|
||||
$this->state = $this->get('State');
|
||||
$this->item = $this->get('Item');
|
||||
$this->form = $this->get('Form');
|
||||
|
||||
$this->t = PhocaGalleryUtils::setVars('co');
|
||||
$this->r = new PhocaGalleryRenderAdminview();
|
||||
|
||||
$itemInfo = $this->getInfoValues();
|
||||
|
||||
if (isset($itemInfo->category_title)) {
|
||||
$this->form->setValue('cattitle', '', $itemInfo->category_title);
|
||||
}
|
||||
if (isset($itemInfo->username) && isset($itemInfo->usernameno)) {
|
||||
$this->form->setValue('usertitle', '', $itemInfo->usernameno . ' ('.$itemInfo->username.')');
|
||||
}
|
||||
|
||||
|
||||
if (count($errors = $this->get('Errors'))) {
|
||||
throw new Exception(implode("\n", $errors), 500);
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->addToolbar();
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
protected function getInfoValues() {
|
||||
|
||||
if (isset($this->item->id)) {
|
||||
$db = Factory::getDbo();
|
||||
$query = $db->getQuery(true);
|
||||
|
||||
// Select the required fields from the table.
|
||||
$query->select('a.id');
|
||||
|
||||
$query->from('`#__phocagallery_comments` AS a');
|
||||
|
||||
$query->select('c.title AS category_title, c.id AS category_id');
|
||||
$query->join('LEFT', '#__phocagallery_categories AS c ON c.id = a.catid');
|
||||
|
||||
$query->select('ua.username AS username, ua.name AS usernameno');
|
||||
$query->join('LEFT', '#__users AS ua ON ua.id=a.userid');
|
||||
|
||||
$query->where('a.id = ' . (int) $this->item->id);
|
||||
|
||||
$db->setQuery($query);
|
||||
$itemInfo = $db->loadObject();
|
||||
|
||||
/*if ($db->getErrorNum()) {
|
||||
throw new Exception($db->getErrorMsg(), 500);
|
||||
}*/
|
||||
|
||||
return $itemInfo;
|
||||
}
|
||||
}
|
||||
|
||||
protected function addToolbar() {
|
||||
|
||||
require_once JPATH_COMPONENT.'/helpers/phocagallerycos.php';
|
||||
Factory::getApplication()->input->set('hidemainmenu', true);
|
||||
$bar = Toolbar::getInstance('toolbar');
|
||||
$user = Factory::getUser();
|
||||
$isNew = ($this->item->id == 0);
|
||||
$checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id'));
|
||||
$canDo = PhocaGalleryCosHelper::getActions($this->state->get('filter.category_id'), $this->item->id);
|
||||
$paramsC = ComponentHelper::getParams('com_phocagallery');
|
||||
|
||||
$text = $isNew ? Text::_( 'COM_PHOCAGALLERY_NEW' ) : Text::_('COM_PHOCAGALLERY_EDIT');
|
||||
ToolbarHelper::title( Text::_( 'COM_PHOCAGALLERY_CAT_COMMENT' ).': <small><small>[ ' . $text.' ]</small></small>' , 'comment');
|
||||
|
||||
// If not checked out, can save the item.
|
||||
if (!$checkedOut && $canDo->get('core.edit')){
|
||||
ToolbarHelper::apply('phocagalleryco.apply', 'JToolbar_APPLY');
|
||||
ToolbarHelper::save('phocagalleryco.save', 'JToolbar_SAVE');
|
||||
}
|
||||
|
||||
ToolbarHelper::cancel('phocagalleryco.cancel', 'JToolbar_CLOSE');
|
||||
ToolbarHelper::divider();
|
||||
ToolbarHelper::help( 'screen.phocagallery', true );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,81 @@
|
||||
<?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;
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Language\Text;
|
||||
|
||||
$task = 'phocagallerycoimg';
|
||||
|
||||
//JHtml::_('behavior.tooltip');
|
||||
//JHtml::_('behavior.formvalidation');
|
||||
HtmlHelper::_('behavior.keepalive');
|
||||
//JHtml::_('formbehavior.chosen', 'select');
|
||||
|
||||
$r = $this->r;
|
||||
$app = Factory::getApplication();
|
||||
$option = $app->input->get('option');
|
||||
$OPT = strtoupper($option);
|
||||
Factory::getDocument()->addScriptDeclaration(
|
||||
|
||||
'Joomla.submitbutton = function(task) {
|
||||
if (task == "'. $this->t['task'].'.cancel" || document.formvalidator.isValid(document.getElementById("adminForm"))) {
|
||||
Joomla.submitform(task, document.getElementById("adminForm"));
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}'
|
||||
|
||||
);
|
||||
|
||||
echo $r->startHeader();
|
||||
echo $r->startForm($option, $task, $this->item->id, 'adminForm', 'adminForm');
|
||||
// First Column
|
||||
echo '<div class="span12 form-horizontal">';
|
||||
|
||||
$tabs = array (
|
||||
'general' => Text::_($OPT.'_GENERAL_OPTIONS'),
|
||||
'publishing' => Text::_($OPT.'_PUBLISHING_OPTIONS'));
|
||||
echo $r->navigation($tabs);
|
||||
|
||||
|
||||
$formArray = array ('title');
|
||||
echo $r->groupHeader($this->form, $formArray);
|
||||
|
||||
echo $r->startTabs();
|
||||
|
||||
echo $r->startTab('general', $tabs['general'], 'active');
|
||||
$formArray = array ('usertitle', 'cattitle', 'imagetitle', 'ordering');
|
||||
echo $r->group($this->form, $formArray);
|
||||
$formArray = array('comment');
|
||||
echo $r->group($this->form, $formArray, 1);
|
||||
echo $r->endTab();
|
||||
|
||||
echo $r->startTab('publishing', $tabs['publishing']);
|
||||
foreach($this->form->getFieldset('publish') as $field) {
|
||||
echo '<div class="control-group">';
|
||||
if (!$field->hidden) {
|
||||
echo '<div class="control-label">'.$field->label.'</div>';
|
||||
}
|
||||
echo '<div class="controls">';
|
||||
echo $field->input;
|
||||
echo '</div></div>';
|
||||
}
|
||||
echo $r->endTab();
|
||||
|
||||
echo $r->endTabs();
|
||||
echo '</div>';
|
||||
|
||||
// Second Column
|
||||
//echo '<div class="span2"></div>';//end span2
|
||||
echo $r->formInputs($this->t['task']);
|
||||
echo $r->endForm();
|
||||
?>
|
||||
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,125 @@
|
||||
<?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\Toolbar\Toolbar;
|
||||
use Joomla\CMS\Component\ComponentHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Toolbar\ToolbarHelper;
|
||||
jimport('joomla.application.component.view');
|
||||
|
||||
|
||||
class PhocaGalleryCpViewPhocaGalleryCoImg extends HtmlView
|
||||
{
|
||||
protected $item;
|
||||
protected $form;
|
||||
protected $state;
|
||||
protected $t;
|
||||
protected $r;
|
||||
|
||||
/**
|
||||
* Display the view
|
||||
*/
|
||||
public function display($tpl = null)
|
||||
{
|
||||
|
||||
|
||||
$this->state = $this->get('State');
|
||||
$this->item = $this->get('Item');
|
||||
$this->form = $this->get('Form');
|
||||
|
||||
$this->t = PhocaGalleryUtils::setVars('coimg');
|
||||
$this->r = new PhocaGalleryRenderAdminview();
|
||||
|
||||
$itemInfo = $this->getInfoValues();
|
||||
|
||||
if (isset($itemInfo->image_title)) {
|
||||
$this->form->setValue('imagetitle', '', $itemInfo->image_title);
|
||||
}
|
||||
if (isset($itemInfo->category_title)) {
|
||||
$this->form->setValue('cattitle', '', $itemInfo->category_title);
|
||||
}
|
||||
if (isset($itemInfo->username) && isset($itemInfo->usernameno)) {
|
||||
$this->form->setValue('usertitle', '', $itemInfo->usernameno . ' ('.$itemInfo->username.')');
|
||||
}
|
||||
|
||||
|
||||
if (count($errors = $this->get('Errors'))) {
|
||||
throw new Exception(implode("\n", $errors), 500);
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->addToolbar();
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
protected function getInfoValues() {
|
||||
|
||||
if (isset($this->item->id)) {
|
||||
$db = Factory::getDbo();
|
||||
$query = $db->getQuery(true);
|
||||
|
||||
// Select the required fields from the table.
|
||||
$query->select('a.id');
|
||||
|
||||
$query->from('`#__phocagallery_img_comments` AS a');
|
||||
|
||||
$query->select('i.title AS image_title, i.id AS image_id');
|
||||
$query->join('LEFT', '#__phocagallery AS i ON i.id = a.imgid');
|
||||
|
||||
$query->select('c.title AS category_title, c.id AS category_id');
|
||||
$query->join('LEFT', '#__phocagallery_categories AS c ON c.id = i.catid');
|
||||
|
||||
$query->select('ua.username AS username, ua.name AS usernameno');
|
||||
$query->join('LEFT', '#__users AS ua ON ua.id=a.userid');
|
||||
|
||||
$query->where('a.id = ' . (int) $this->item->id);
|
||||
|
||||
$db->setQuery($query);
|
||||
$itemInfo = $db->loadObject();
|
||||
|
||||
/*if ($db->getErrorNum()) {
|
||||
throw new Exception($db->getErrorMsg(), 500);
|
||||
}*/
|
||||
|
||||
return $itemInfo;
|
||||
}
|
||||
}
|
||||
|
||||
protected function addToolbar() {
|
||||
|
||||
require_once JPATH_COMPONENT.'/helpers/phocagallerycoimgs.php';
|
||||
Factory::getApplication()->input->set('hidemainmenu', true);
|
||||
$bar = Toolbar::getInstance('toolbar');
|
||||
$user = Factory::getUser();
|
||||
$isNew = ($this->item->id == 0);
|
||||
$checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id'));
|
||||
$canDo = PhocaGalleryCoImgsHelper::getActions($this->state->get('filter.category_id'), $this->item->id);
|
||||
$paramsC = ComponentHelper::getParams('com_phocagallery');
|
||||
|
||||
$text = $isNew ? Text::_( 'COM_PHOCAGALLERY_NEW' ) : Text::_('COM_PHOCAGALLERY_EDIT');
|
||||
ToolbarHelper::title( Text::_( 'COM_PHOCAGALLERY_IMAGE_COMMENT' ).': <small><small>[ ' . $text.' ]</small></small>' , 'comment');
|
||||
|
||||
// If not checked out, can save the item.
|
||||
if (!$checkedOut && $canDo->get('core.edit')){
|
||||
ToolbarHelper::apply('phocagallerycoimg.apply', 'JToolbar_APPLY');
|
||||
ToolbarHelper::save('phocagallerycoimg.save', 'JToolbar_SAVE');
|
||||
}
|
||||
|
||||
ToolbarHelper::cancel('phocagallerycoimg.cancel', 'JToolbar_CLOSE');
|
||||
ToolbarHelper::divider();
|
||||
ToolbarHelper::help( 'screen.phocagallery', true );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,170 @@
|
||||
<?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;
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Layout\LayoutHelper;
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Router\Route;
|
||||
use Joomla\CMS\Language\Text;
|
||||
|
||||
$task = 'phocagallerycoimg';
|
||||
|
||||
$r = $this->r;
|
||||
$app = Factory::getApplication();
|
||||
$option = $app->input->get('option');
|
||||
$tasks = $task . 's';
|
||||
$OPT = strtoupper($option);
|
||||
$user = Factory::getUser();
|
||||
$userId = $user->get('id');
|
||||
$listOrder = $this->escape($this->state->get('list.ordering'));
|
||||
$listDirn = $this->escape($this->state->get('list.direction'));
|
||||
$canOrder = $user->authorise('core.edit.state', $option);
|
||||
$saveOrder = $listOrder == 'a.ordering';
|
||||
$saveOrderingUrl = '';
|
||||
if ($saveOrder && !empty($this->items)) {
|
||||
$saveOrderingUrl = $r->saveOrder($this->t, $listDirn);
|
||||
}
|
||||
$sortFields = $this->getSortFields();
|
||||
|
||||
echo $r->startHeader();
|
||||
echo $r->jsJorderTable($listOrder);
|
||||
|
||||
echo $r->startForm($option, $tasks, 'adminForm');
|
||||
//echo $r->startFilter();
|
||||
//echo $r->endFilter();
|
||||
|
||||
echo $r->startMainContainer();
|
||||
/*
|
||||
echo $r->startFilterBar();
|
||||
echo $r->inputFilterSearch($OPT.'_FILTER_SEARCH_LABEL', $OPT.'_FILTER_SEARCH_DESC',
|
||||
$this->escape($this->state->get('filter.search')));
|
||||
echo $r->inputFilterSearchClear('JSEARCH_FILTER_SUBMIT', 'JSEARCH_FILTER_CLEAR');
|
||||
echo $r->inputFilterSearchLimit('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC', $this->pagination->getLimitBox());
|
||||
echo $r->selectFilterDirection('JFIELD_ORDERING_DESC', 'JGLOBAL_ORDER_ASCENDING', 'JGLOBAL_ORDER_DESCENDING', $listDirn);
|
||||
echo $r->selectFilterSortBy('JGLOBAL_SORT_BY', $sortFields, $listOrder);
|
||||
|
||||
echo $r->startFilterBar(2);
|
||||
echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED', $this->state->get('filter.published'));
|
||||
//echo $r->selectFilterLanguage('JOPTION_SELECT_LANGUAGE', $this->state->get('filter.language'));
|
||||
echo $r->selectFilterCategory(PhocaGalleryCategory::options($option), 'JOPTION_SELECT_CATEGORY', $this->state->get('filter.category_id'));
|
||||
echo $r->endFilterBar();
|
||||
|
||||
echo $r->endFilterBar();*/
|
||||
echo LayoutHelper::render('joomla.searchtools.default', array('view' => $this));
|
||||
|
||||
echo $r->startTable('categoryList');
|
||||
|
||||
echo $r->startTblHeader();
|
||||
|
||||
echo $r->firstColumnHeader($listDirn, $listOrder);
|
||||
echo $r->secondColumnHeader($listDirn, $listOrder);
|
||||
|
||||
|
||||
echo '<th class="ph-user">'.HTMLHelper::_('searchtools.sort', $OPT.'_USER', 'ua.username', $listDirn, $listOrder ).'</th>'."\n";
|
||||
echo '<th class="ph-title">'.HTMLHelper::_('searchtools.sort', $OPT.'_TITLE', 'a.title', $listDirn, $listOrder ).'</th>'."\n";
|
||||
echo '<th class="ph-date">'.HTMLHelper::_('searchtools.sort', $OPT.'_DATE', 'a.date', $listDirn, $listOrder ).'</th>'."\n";
|
||||
echo '<th class="ph-published">'.HTMLHelper::_('searchtools.sort', $OPT.'_PUBLISHED', 'a.published', $listDirn, $listOrder ).'</th>'."\n";
|
||||
echo '<th class="ph-imagetitle">'.HTMLHelper::_('searchtools.sort', $OPT.'_IMAGE', 'image_title', $listDirn, $listOrder ).'</th>'."\n";
|
||||
echo '<th class="ph-parentcattitle">'.HTMLHelper::_('searchtools.sort', $OPT.'_CATEGORY', 'category_title', $listDirn, $listOrder ).'</th>'."\n";
|
||||
echo '<th class="ph-id">'.HTMLHelper::_('searchtools.sort', $OPT.'_ID', 'a.id', $listDirn, $listOrder ).'</th>'."\n";
|
||||
|
||||
echo $r->endTblHeader();
|
||||
echo $r->startTblBody($saveOrder, $saveOrderingUrl, $listDirn);
|
||||
|
||||
$originalOrders = array();
|
||||
$j = 0;
|
||||
|
||||
if (is_array($this->items)) {
|
||||
foreach ($this->items as $i => $item) {
|
||||
//if ($i >= (int)$this->pagination->limitstart && $j < (int)$this->pagination->limit) {
|
||||
$j++;
|
||||
|
||||
$urlEdit = 'index.php?option='.$option.'&task='.$task.'.edit&id=';
|
||||
$urlTask = 'index.php?option='.$option.'&task='.$task;
|
||||
$orderkey = array_search($item->id, $this->ordering[$item->image_id]);
|
||||
$ordering = ($listOrder == 'a.ordering');
|
||||
$canCreate = $user->authorise('core.create', $option);
|
||||
$canEdit = $user->authorise('core.edit', $option);
|
||||
$canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out==$user->get('id') || $item->checked_out==0;
|
||||
$canChange = $user->authorise('core.edit.state', $option) && $canCheckin;
|
||||
$linkEdit = Route::_( $urlEdit. $item->id );
|
||||
$linkCat = Route::_( 'index.php?option=com_phocagallery&task=phocagalleryc.edit&id='.(int) $item->category_id );
|
||||
$canEditCat = $user->authorise('core.edit', $option);
|
||||
$linkImg = Route::_( 'index.php?option=com_phocagallery&task=phocagalleryimg.edit&id='.(int) $item->image_id );
|
||||
$canEditImg = $user->authorise('core.edit', 'com_phocagallery');
|
||||
|
||||
echo $r->startTr($i, isset($item->catid) ? (int)$item->catid : 0);
|
||||
echo $r->firstColumn($i, $item->id, $canChange, $saveOrder, $orderkey, $item->ordering);
|
||||
echo $r->secondColumn($i, $item->id, $canChange, $saveOrder, $orderkey, $item->ordering);
|
||||
|
||||
$usrO = $item->commentname;
|
||||
if ($item->commentusername) {$usrO = $usrO . ' ('.$item->commentusername.')';}
|
||||
echo $r->td($usrO, "small");
|
||||
$checkO = '';
|
||||
if ($item->checked_out) {
|
||||
$checkO .= HTMLHelper::_('jgrid.checkedout', $i, $item->editor, $item->checked_out_time, $tasks.'.', $canCheckin);
|
||||
}
|
||||
|
||||
if ($item->title == '') {
|
||||
$item->title = Text::_('COM_PHOCAGALLERY_NO_TITLE');
|
||||
}
|
||||
|
||||
if ($canCreate || $canEdit) {
|
||||
$checkO .= '<a href="'. Route::_($linkEdit).'">'. $this->escape($item->title);
|
||||
|
||||
|
||||
$checkO .= '</a>';
|
||||
if ($item->comment != '') {
|
||||
$checkO .='<br> <small>('.$this->escape($item->comment).')</small>';
|
||||
}
|
||||
} else {
|
||||
$checkO .= $this->escape($item->title);
|
||||
if ($item->comment != '') {
|
||||
$checkO .=' <small>('.$this->escape($item->comment).')</small>';
|
||||
}
|
||||
}
|
||||
|
||||
echo $r->td($checkO, "small");
|
||||
echo $r->td($item->date, "small");
|
||||
|
||||
echo $r->td(HTMLHelper::_('jgrid.published', $item->published, $i, $tasks.'.', $canChange), "small");
|
||||
|
||||
if ($canEditImg) {
|
||||
$imgO = '<a href="'. Route::_($linkImg).'">'. $this->escape($item->image_title).'</a>';
|
||||
} else {
|
||||
$imgO = $this->escape($item->image_title);
|
||||
}
|
||||
echo $r->td($imgO, "small");
|
||||
if ($canEditCat) {
|
||||
$catO = '<a href="'. Route::_($linkCat).'">'. $this->escape($item->category_title).'</a>';
|
||||
} else {
|
||||
$catO = $this->escape($item->category_title);
|
||||
}
|
||||
|
||||
echo $r->td($catO, "small");
|
||||
//echo $r->td($item->id . " - " . $item->ordering." - ", "small");
|
||||
|
||||
echo $r->td($item->id, "small");
|
||||
|
||||
echo $r->endTr();
|
||||
|
||||
//}
|
||||
}
|
||||
}
|
||||
echo $r->endTblBody();
|
||||
|
||||
echo $r->tblFoot($this->pagination->getListFooter(), 15);
|
||||
echo $r->endTable();
|
||||
|
||||
|
||||
echo $r->formInputsXML($listOrder, $listDirn, $originalOrders);
|
||||
echo $r->endMainContainer();
|
||||
echo $r->endForm();
|
||||
?>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,95 @@
|
||||
<?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\Toolbar\ToolbarHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Toolbar\Toolbar;
|
||||
jimport( 'joomla.application.component.view' );
|
||||
|
||||
class PhocaGalleryCpViewPhocaGalleryCoImgs extends HtmlView
|
||||
{
|
||||
protected $items;
|
||||
protected $pagination;
|
||||
protected $state;
|
||||
protected $r;
|
||||
protected $t;
|
||||
public $filterForm;
|
||||
public $activeFilters;
|
||||
|
||||
|
||||
function display($tpl = null) {
|
||||
|
||||
$this->items = $this->get('Items');
|
||||
$this->pagination = $this->get('Pagination');
|
||||
$this->state = $this->get('State');
|
||||
$this->filterForm = $this->get('FilterForm');
|
||||
$this->activeFilters = $this->get('ActiveFilters');
|
||||
|
||||
$this->r = new PhocaGalleryRenderAdminViews();
|
||||
$this->t = PhocaGalleryUtils::setVars('coimg');
|
||||
|
||||
|
||||
foreach ($this->items as &$item) {
|
||||
$this->ordering[$item->image_id][] = $item->id;
|
||||
}
|
||||
|
||||
// Check for errors.
|
||||
if (count($errors = $this->get('Errors'))) {
|
||||
throw new Exception(implode("\n", $errors), 500);
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->addToolbar();
|
||||
parent::display($tpl);
|
||||
|
||||
}
|
||||
|
||||
function addToolbar() {
|
||||
|
||||
require_once JPATH_COMPONENT.'/helpers/phocagallerycoimgs.php';
|
||||
|
||||
$state = $this->get('State');
|
||||
$canDo = PhocaGalleryCoImgsHelper::getActions($state->get('filter.category_id'));
|
||||
|
||||
ToolbarHelper::title( Text::_( 'COM_PHOCAGALLERY_IMAGE_COMMENTS' ), 'comment' );
|
||||
|
||||
if ($canDo->get('core.edit')) {
|
||||
ToolbarHelper::editList('phocagallerycoimg.edit','JToolbar_EDIT');
|
||||
}
|
||||
if ($canDo->get('core.edit.state')) {
|
||||
|
||||
ToolbarHelper::divider();
|
||||
ToolbarHelper::custom('phocagallerycoimgs.publish', 'publish.png', 'publish_f2.png','JToolbar_PUBLISH', true);
|
||||
ToolbarHelper::custom('phocagallerycoimgs.unpublish', 'unpublish.png', 'unpublish_f2.png', 'JToolbar_UNPUBLISH', true);
|
||||
}
|
||||
|
||||
if ($canDo->get('core.delete')) {
|
||||
ToolbarHelper::deleteList( Text::_( 'COM_PHOCAGALLERY_WARNING_DELETE_ITEMS' ), 'phocagallerycoimgs.delete', 'COM_PHOCAGALLERY_DELETE');
|
||||
}
|
||||
ToolbarHelper::divider();
|
||||
ToolbarHelper::help( 'screen.phocagallery', true );
|
||||
}
|
||||
|
||||
protected function getSortFields() {
|
||||
return array(
|
||||
'a.ordering' => Text::_('COM_PHOCAGALLERY_ORDERING'),
|
||||
'ua.username' => Text::_('COM_PHOCAGALLERY_USER'),
|
||||
'a.title' => Text::_('COM_PHOCAGALLERY_TITLE'),
|
||||
'a.date' => Text::_('COM_PHOCAGALLERY_DATE'),
|
||||
'a.published' => Text::_('COM_PHOCAGALLERY_PUBLISHED'),
|
||||
'image_title' => Text::_('COM_PHOCAGALLERY_IMAGE'),
|
||||
'category_title' => Text::_('COM_PHOCAGALLERY_CATEGORY'),
|
||||
'a.id' => Text::_('JGRID_HEADING_ID')
|
||||
);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,144 @@
|
||||
<?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;
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Layout\LayoutHelper;
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Router\Route;
|
||||
|
||||
$task = 'phocagalleryco';
|
||||
|
||||
$r = $this->r;
|
||||
$app = Factory::getApplication();
|
||||
$option = $app->input->get('option');
|
||||
$tasks = $task . 's';
|
||||
$OPT = strtoupper($option);
|
||||
$user = Factory::getUser();
|
||||
$userId = $user->get('id');
|
||||
$listOrder = $this->escape($this->state->get('list.ordering'));
|
||||
$listDirn = $this->escape($this->state->get('list.direction'));
|
||||
$canOrder = $user->authorise('core.edit.state', $option);
|
||||
$saveOrder = $listOrder == 'a.ordering';
|
||||
$saveOrderingUrl = '';
|
||||
if ($saveOrder && !empty($this->items)) {
|
||||
$saveOrderingUrl = $r->saveOrder($this->t, $listDirn);
|
||||
}
|
||||
$sortFields = $this->getSortFields();
|
||||
|
||||
echo $r->startHeader();
|
||||
echo $r->jsJorderTable($listOrder);
|
||||
|
||||
echo $r->startForm($option, $tasks, 'adminForm');
|
||||
//echo $r->startFilter();
|
||||
//echo $r->endFilter();
|
||||
|
||||
echo $r->startMainContainer();
|
||||
/*
|
||||
echo $r->startFilterBar();
|
||||
echo $r->inputFilterSearch($OPT.'_FILTER_SEARCH_LABEL', $OPT.'_FILTER_SEARCH_DESC',
|
||||
$this->escape($this->state->get('filter.search')));
|
||||
echo $r->inputFilterSearchClear('JSEARCH_FILTER_SUBMIT', 'JSEARCH_FILTER_CLEAR');
|
||||
echo $r->inputFilterSearchLimit('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC', $this->pagination->getLimitBox());
|
||||
echo $r->selectFilterDirection('JFIELD_ORDERING_DESC', 'JGLOBAL_ORDER_ASCENDING', 'JGLOBAL_ORDER_DESCENDING', $listDirn);
|
||||
echo $r->selectFilterSortBy('JGLOBAL_SORT_BY', $sortFields, $listOrder);
|
||||
|
||||
echo $r->startFilterBar(2);
|
||||
echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED', $this->state->get('filter.published'));
|
||||
//echo $r->selectFilterLanguage('JOPTION_SELECT_LANGUAGE', $this->state->get('filter.language'));
|
||||
echo $r->selectFilterCategory(PhocaGalleryCategory::options($option), 'JOPTION_SELECT_CATEGORY', $this->state->get('filter.category_id'));
|
||||
echo $r->endFilterBar();
|
||||
|
||||
|
||||
echo $r->endFilterBar();*/
|
||||
echo LayoutHelper::render('joomla.searchtools.default', array('view' => $this));
|
||||
|
||||
echo $r->startTable('categoryList');
|
||||
|
||||
echo $r->startTblHeader();
|
||||
|
||||
echo $r->firstColumnHeader($listDirn, $listOrder);
|
||||
echo $r->secondColumnHeader($listDirn, $listOrder);
|
||||
|
||||
|
||||
echo '<th class="ph-user">'.HTMLHelper::_('searchtools.sort', $OPT.'_USER', 'ua.username', $listDirn, $listOrder ).'</th>'."\n";
|
||||
echo '<th class="ph-title">'.HTMLHelper::_('searchtools.sort', $OPT.'_TITLE', 'a.title', $listDirn, $listOrder ).'</th>'."\n";
|
||||
echo '<th class="ph-date">'.HTMLHelper::_('searchtools.sort', $OPT.'_DATE', 'a.date', $listDirn, $listOrder ).'</th>'."\n";
|
||||
echo '<th class="ph-published">'.HTMLHelper::_('searchtools.sort', $OPT.'_PUBLISHED', 'a.published', $listDirn, $listOrder ).'</th>'."\n";
|
||||
echo '<th class="ph-parentcattitle">'.HTMLHelper::_('searchtools.sort', $OPT.'_CATEGORY', 'category_title', $listDirn, $listOrder ).'</th>'."\n";
|
||||
echo '<th class="ph-id">'.HTMLHelper::_('searchtools.sort', $OPT.'_ID', 'a.id', $listDirn, $listOrder ).'</th>'."\n";
|
||||
|
||||
echo $r->endTblHeader();
|
||||
echo $r->startTblBody($saveOrder, $saveOrderingUrl, $listDirn);
|
||||
|
||||
$originalOrders = array();
|
||||
$j = 0;
|
||||
|
||||
if (is_array($this->items)) {
|
||||
foreach ($this->items as $i => $item) {
|
||||
//if ($i >= (int)$this->pagination->limitstart && $j < (int)$this->pagination->limit) {
|
||||
$j++;
|
||||
|
||||
$urlEdit = 'index.php?option='.$option.'&task='.$task.'.edit&id=';
|
||||
$urlTask = 'index.php?option='.$option.'&task='.$task;
|
||||
$orderkey = array_search($item->id, $this->ordering[$item->catid]);
|
||||
$ordering = ($listOrder == 'a.ordering');
|
||||
$canCreate = $user->authorise('core.create', $option);
|
||||
$canEdit = $user->authorise('core.edit', $option);
|
||||
$canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out==$user->get('id') || $item->checked_out==0;
|
||||
$canChange = $user->authorise('core.edit.state', $option) && $canCheckin;
|
||||
$linkEdit = Route::_( $urlEdit. $item->id );
|
||||
$linkCat = Route::_( 'index.php?option=com_phocagallery&task=phocagalleryc.edit&id='.(int) $item->category_id );
|
||||
$canEditCat = $user->authorise('core.edit', $option);
|
||||
|
||||
echo $r->startTr($i, isset($item->catid) ? (int)$item->catid : 0);
|
||||
echo $r->firstColumn($i, $item->id, $canChange, $saveOrder, $orderkey, $item->ordering);
|
||||
echo $r->secondColumn($i, $item->id, $canChange, $saveOrder, $orderkey, $item->ordering);
|
||||
|
||||
$usrO = $item->commentname;
|
||||
if ($item->commentusername) {$usrO = $usrO . ' ('.$item->commentusername.')';}
|
||||
echo $r->td($usrO, "small");
|
||||
$checkO = '';
|
||||
if ($item->checked_out) {
|
||||
$checkO .= HTMLHelper::_('jgrid.checkedout', $i, $item->editor, $item->checked_out_time, $tasks.'.', $canCheckin);
|
||||
}
|
||||
if ($canCreate || $canEdit) {
|
||||
$checkO .= '<a href="'. Route::_($linkEdit).'">'. $this->escape($item->title). '</a><br><small>('.$this->escape($item->comment).')</small>';
|
||||
} else {
|
||||
$checkO .= $this->escape($item->title). ' <small>('.$this->escape($item->comment).')</small>';
|
||||
}
|
||||
|
||||
echo $r->td($checkO, "small");
|
||||
echo $r->td($item->date, "small");
|
||||
|
||||
echo $r->td(HTMLHelper::_('jgrid.published', $item->published, $i, $tasks.'.', $canChange), "small");
|
||||
|
||||
if ($canEditCat) {
|
||||
$catO = '<a href="'. Route::_($linkCat).'">'. $this->escape($item->category_title).'</a>';
|
||||
} else {
|
||||
$catO = $this->escape($item->category_title);
|
||||
}
|
||||
echo $r->td($catO, "small");
|
||||
echo $r->td($item->id, "small");
|
||||
|
||||
echo $r->endTr();
|
||||
|
||||
//}
|
||||
}
|
||||
}
|
||||
echo $r->endTblBody();
|
||||
|
||||
echo $r->tblFoot($this->pagination->getListFooter(), 15);
|
||||
echo $r->endTable();
|
||||
|
||||
|
||||
echo $r->formInputsXML($listOrder, $listDirn, $originalOrders);
|
||||
echo $r->endMainContainer();
|
||||
echo $r->endForm();
|
||||
?>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,95 @@
|
||||
<?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\Toolbar\ToolbarHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Toolbar\Toolbar;
|
||||
jimport( 'joomla.application.component.view' );
|
||||
|
||||
class PhocaGalleryCpViewPhocaGalleryCos extends HtmlView
|
||||
{
|
||||
protected $items;
|
||||
protected $pagination;
|
||||
protected $state;
|
||||
protected $r;
|
||||
protected $t;
|
||||
public $filterForm;
|
||||
public $activeFilters;
|
||||
|
||||
|
||||
function display($tpl = null) {
|
||||
|
||||
$this->items = $this->get('Items');
|
||||
$this->pagination = $this->get('Pagination');
|
||||
$this->state = $this->get('State');
|
||||
$this->filterForm = $this->get('FilterForm');
|
||||
$this->activeFilters = $this->get('ActiveFilters');
|
||||
|
||||
$this->r = new PhocaGalleryRenderAdminViews();
|
||||
$this->t = PhocaGalleryUtils::setVars('co');
|
||||
|
||||
// Preprocess the list of items to find ordering divisions.
|
||||
foreach ($this->items as &$item) {
|
||||
$this->ordering[$item->catid][] = $item->id;
|
||||
}
|
||||
|
||||
// Check for errors.
|
||||
if (count($errors = $this->get('Errors'))) {
|
||||
throw new Exception(implode("\n", $errors), 500);
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->addToolbar();
|
||||
parent::display($tpl);
|
||||
|
||||
}
|
||||
|
||||
|
||||
function addToolbar() {
|
||||
|
||||
require_once JPATH_COMPONENT.'/helpers/phocagallerycos.php';
|
||||
|
||||
$state = $this->get('State');
|
||||
$canDo = PhocaGalleryCosHelper::getActions($state->get('filter.category_id'));
|
||||
|
||||
ToolbarHelper::title( Text::_( 'COM_PHOCAGALLERY_CATEGORY_COMMENTS' ), 'comment' );
|
||||
|
||||
if ($canDo->get('core.edit')) {
|
||||
ToolbarHelper::editList('phocagalleryco.edit','JToolbar_EDIT');
|
||||
}
|
||||
if ($canDo->get('core.edit.state')) {
|
||||
|
||||
ToolbarHelper::divider();
|
||||
ToolbarHelper::custom('phocagallerycos.publish', 'publish.png', 'publish_f2.png','JToolbar_PUBLISH', true);
|
||||
ToolbarHelper::custom('phocagallerycos.unpublish', 'unpublish.png', 'unpublish_f2.png', 'JToolbar_UNPUBLISH', true);
|
||||
}
|
||||
|
||||
if ($canDo->get('core.delete')) {
|
||||
ToolbarHelper::deleteList( Text::_( 'COM_PHOCAGALLERY_WARNING_DELETE_ITEMS' ), 'phocagallerycos.delete', 'COM_PHOCAGALLERY_DELETE');
|
||||
}
|
||||
ToolbarHelper::divider();
|
||||
ToolbarHelper::help( 'screen.phocagallery', true );
|
||||
}
|
||||
|
||||
protected function getSortFields() {
|
||||
return array(
|
||||
'a.ordering' => Text::_('COM_PHOCAGALLERY_ORDERING'),
|
||||
'ua.username' => Text::_('COM_PHOCAGALLERY_USER'),
|
||||
'a.title' => Text::_('COM_PHOCAGALLERY_TITLE'),
|
||||
'a.date' => Text::_('COM_PHOCAGALLERY_DATE'),
|
||||
'a.published' => Text::_('COM_PHOCAGALLERY_PUBLISHED'),
|
||||
'category_title' => Text::_('COM_PHOCAGALLERY_CATEGORY'),
|
||||
'a.id' => Text::_('JGRID_HEADING_ID')
|
||||
);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,73 @@
|
||||
<?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\Language\Text;
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
|
||||
|
||||
$r = $this->r;
|
||||
echo $r->startCp();
|
||||
|
||||
echo '<div class="ph-box-cp">';
|
||||
echo '<div class="ph-left-cp">';
|
||||
|
||||
echo '<div class="ph-cp-item-box">';
|
||||
$link = 'index.php?option='.$this->t['o'].'&view=';
|
||||
foreach ($this->views as $k => $v) {
|
||||
$linkV = $link . $this->t['c'] . $k;
|
||||
echo $r->quickIconButton( $linkV, Text::_($v[0]), $v[1], $v[2]);
|
||||
}
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
|
||||
echo '<civ class="ph-right-cp">';
|
||||
|
||||
echo '<div class="ph-extension-info-box">';
|
||||
echo '<div class="ph-cpanel-logo">'.HTMLHelper::_('image', $this->t['i'] . 'logo-'.str_replace('phoca', 'phoca-', $this->t['c']).'.png', 'Phoca.cz') . '</div>';
|
||||
echo '<div class="ph-cpanel-logo-seal">'. HTMLHelper::_('image', $this->t['i'] . 'logo-phoca.png', 'Phoca.cz' ).'</div>';
|
||||
|
||||
echo '<h3>'. Text::_($this->t['l'] . '_VERSION').'</h3>'
|
||||
.'<p>'. $this->t['version'] .'</p>';
|
||||
|
||||
echo '<h3>'. Text::_($this->t['l'] . '_COPYRIGHT').'</h3>'
|
||||
.'<p>© 2007 - '. date("Y"). ' Jan Pavelka</p>'
|
||||
.'<p><a href="https://www.phoca.cz/" target="_blank">www.phoca.cz</a></p>';
|
||||
|
||||
echo '<h3>'. Text::_($this->t['l'] . '_LICENSE').'</h3>'
|
||||
.'<p><a href="http://www.gnu.org/licenses/gpl-2.0.html" target="_blank">GPLv2</a></p>';
|
||||
|
||||
echo '<h3>'. Text::_($this->t['l'] . '_TRANSLATION').': '. Text::_($this->t['l'] . '_TRANSLATION_LANGUAGE_TAG').'</h3>'
|
||||
.'<p>© 2007 - '. date("Y"). ' '. Text::_($this->t['l'] . '_TRANSLATER'). '</p>'
|
||||
.'<p>'.Text::_($this->t['l'] . '_TRANSLATION_SUPPORT_URL').'</p>';
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<p>Google™, Google Maps™, Google Picasa™, Google+™, Google Photos™ and YouTube Broadcast Yourself™ are registered trademarks of Google Inc.</p>
|
||||
|
||||
<?php
|
||||
|
||||
echo '<div class="ph-cp-hr"></div>'
|
||||
.'<div class="btn-group"><a class="btn btn-large btn-primary" href="https://www.phoca.cz/version/index.php?'.$this->t['c'].'='. $this->t['version'] .'" target="_blank"><i class="icon-loop icon-white"></i> '. Text::_($this->t['l'] . '_CHECK_FOR_UPDATE') .'</a></div>'
|
||||
.'<div style="float:right; margin: 0 10px"><a href="https://www.phoca.cz/" target="_blank">'.HtmlHelper::_('image', $this->t['i'] . 'logo.png', 'Phoca.cz' ).'</a></div>';
|
||||
|
||||
echo '</div>';
|
||||
|
||||
echo '<div class="ph-extension-links-box">';
|
||||
echo $r->getLinks();
|
||||
echo '</div>';
|
||||
|
||||
|
||||
echo '</div>';
|
||||
|
||||
echo '</div>';
|
||||
echo $r->endCp();
|
||||
|
||||
?>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,77 @@
|
||||
<?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\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Toolbar\ToolbarHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Toolbar\Toolbar;
|
||||
jimport( 'joomla.application.component.view' );
|
||||
phocagalleryimport( 'phocagallery.render.renderinfo' );
|
||||
|
||||
class PhocaGalleryCpViewPhocaGallerycp extends HtmlView
|
||||
{
|
||||
protected $t;
|
||||
protected $r;
|
||||
|
||||
public function display($tpl = null) {
|
||||
|
||||
$this->t = PhocaGalleryUtils::setVars('cp');
|
||||
$this->r = new PhocaGalleryRenderAdminview();
|
||||
|
||||
$i = ' icon-';
|
||||
$d = 'duotone ';
|
||||
|
||||
|
||||
$this->views= array(
|
||||
'imgs' => array($this->t['l'] . '_IMAGES', $d.$i.'pictures', '#dd5500'),
|
||||
'cs' => array($this->t['l'] . '_CATEGORIES', $d.$i.'folder-open', '#da7400'),
|
||||
't' => array($this->t['l'] . '_THEMES', $d.$i.'modules', '#cd76cc'),
|
||||
'ra' => array($this->t['l'] . '_CATEGORY_RATING', $i.'star-empty', '#ffd460'),
|
||||
'raimg' => array($this->t['l'] . '_IMAGE_RATING', $i.'star-empty', '#f5b300'),
|
||||
'cos' => array($this->t['l'] . '_CATEGORY_COMMENTS', $d.$i.'comment', '#399ed0'),
|
||||
'coimgs' => array($this->t['l'] . '_IMAGE_COMMENTS', $d.$i.'comment', '#1e6080'),
|
||||
'users' => array($this->t['l'] . '_USERS', $d.$i.'users', '#7faa7f'),
|
||||
///'fbs' => $this->t['l'] . '_FB',
|
||||
'tags' => array($this->t['l'] . '_TAGS', $d.$i.'tag-double', '#CC0033'),
|
||||
'efs' => array($this->t['l'] . '_STYLES', $i.'styles', '#9900CC'),
|
||||
'in' => array($this->t['l'] . '_INFO', $d.$i.'info-circle', '#3378cc')
|
||||
);
|
||||
|
||||
|
||||
|
||||
HTMLHelper::stylesheet( $this->t['s'] );
|
||||
////JHtml::_('behavior.tooltip');
|
||||
$this->t['version'] = PhocaGalleryRenderInfo::getPhocaVersion();
|
||||
|
||||
$this->addToolbar();
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
protected function addToolbar() {
|
||||
require_once JPATH_COMPONENT.'/helpers/phocagallerycp.php';
|
||||
|
||||
$state = $this->get('State');
|
||||
$canDo = PhocaGalleryCpHelper::getActions();
|
||||
ToolbarHelper::title( Text::_( 'COM_PHOCAGALLERY_PG_CONTROL_PANEL' ), 'home-2 cpanel' );
|
||||
|
||||
// This button is unnecessary but it is displayed because Joomla! design bug
|
||||
$bar = Toolbar::getInstance( 'toolbar' );
|
||||
$dhtml = '<a href="index.php?option=com_phocagallery" class="btn btn-primary btn-small"><i class="icon-home-2" title="'.Text::_('COM_PHOCAGALLERY_CONTROL_PANEL').'"></i> '.Text::_('COM_PHOCAGALLERY_CONTROL_PANEL').'</a>';
|
||||
$bar->appendButton('Custom', $dhtml);
|
||||
|
||||
if ($canDo->get('core.admin')) {
|
||||
ToolbarHelper::preferences('com_phocagallery');
|
||||
ToolbarHelper::divider();
|
||||
}
|
||||
|
||||
ToolbarHelper::help( 'screen.phocagallery', true );
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,179 @@
|
||||
<?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;
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Layout\LayoutHelper;
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Router\Route;
|
||||
|
||||
$task = 'phocagalleryc';
|
||||
|
||||
$r = $this->r;
|
||||
$app = Factory::getApplication();
|
||||
$option = $app->input->get('option');
|
||||
$tasks = $task . 's';
|
||||
$OPT = strtoupper($option);
|
||||
$user = Factory::getUser();
|
||||
$userId = $user->get('id');
|
||||
$listOrder = $this->escape($this->state->get('list.ordering'));
|
||||
$listDirn = $this->escape($this->state->get('list.direction'));
|
||||
$canOrder = $user->authorise('core.edit.state', $option);
|
||||
$saveOrder = $listOrder == 'a.ordering';
|
||||
$saveOrderingUrl = '';
|
||||
|
||||
if ($saveOrder && !empty($this->items)) {
|
||||
|
||||
$saveOrderingUrl = $r->saveOrder($this->t, $listDirn);
|
||||
}
|
||||
$sortFields = $this->getSortFields();
|
||||
|
||||
echo $r->startHeader();
|
||||
echo $r->jsJorderTable($listOrder);
|
||||
|
||||
echo '<div class="phoca-thumb-status">' . $this->t['enablethumbcreationstatus'] .'</div>';
|
||||
//echo '<div class="clearfix"></div>';
|
||||
|
||||
|
||||
echo $r->startForm($option, $tasks, 'adminForm');
|
||||
//echo $r->startFilter();
|
||||
//echo $r->endFilter();
|
||||
|
||||
echo $r->startMainContainer();
|
||||
if (isset($this->t['notapproved']->count) && (int)$this->t['notapproved']->count > 0 ) {
|
||||
|
||||
|
||||
echo '<div class="alert alert-error alert-dismissible fade show" role="alert">'. Text::_('COM_PHOCAGALLERY_NOT_APPROVED_CATEGORY_IN_GALLERY').': '
|
||||
.(int)$this->t['notapproved']->count.'<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="'.Text::_('COM_PHOCAGALLERY_CLOSE').'"></button></div>';
|
||||
}
|
||||
if ($this->t['search']) {
|
||||
echo '<div class="alert alert-message">' . Text::_('COM_PHOCAGALLERY_SEARCH_FILTER_IS_ACTIVE') .'</div>';
|
||||
}
|
||||
|
||||
/*echo $r->startFilterBar();
|
||||
echo $r->inputFilterSearch($OPT.'_FILTER_SEARCH_LABEL', $OPT.'_FILTER_SEARCH_DESC',
|
||||
$this->escape($this->state->get('filter.search')));
|
||||
echo $r->inputFilterSearchClear('JSEARCH_FILTER_SUBMIT', 'JSEARCH_FILTER_CLEAR', (int)$this->pagination->limit);
|
||||
echo $r->inputFilterSearchLimit('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC', $this->pagination->getLimitBox());
|
||||
echo $r->selectFilterDirection('JFIELD_ORDERING_DESC', 'JGLOBAL_ORDER_ASCENDING', 'JGLOBAL_ORDER_DESCENDING', $listDirn);
|
||||
echo $r->selectFilterSortBy('JGLOBAL_SORT_BY', $sortFields, $listOrder);
|
||||
|
||||
echo $r->startFilterBar(2);
|
||||
echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED', $this->state->get('filter.published'));
|
||||
echo $r->selectFilterLanguage('JOPTION_SELECT_LANGUAGE', $this->state->get('filter.language'));
|
||||
echo $r->selectFilterLevels('COM_PHOCAGALLERY_SELECT_MAX_LEVELS', $this->state->get('filter.level'));
|
||||
echo $r->endFilterBar();
|
||||
|
||||
//echo $r->endFilterBar();*/
|
||||
echo LayoutHelper::render('joomla.searchtools.default', array('view' => $this));
|
||||
|
||||
echo $r->startTable('categoryList');
|
||||
|
||||
echo $r->startTblHeader();
|
||||
|
||||
echo $r->firstColumnHeader($listDirn, $listOrder);
|
||||
echo $r->secondColumnHeader($listDirn, $listOrder);
|
||||
|
||||
|
||||
echo '<th class="ph-title">'.HTMLHelper::_('searchtools.sort', $OPT.'_TITLE', 'a.title', $listDirn, $listOrder ).'</th>'."\n";
|
||||
echo '<th class="ph-published">'.HTMLHelper::_('searchtools.sort', $OPT.'_PUBLISHED', 'a.published', $listDirn, $listOrder ).'</th>'."\n";
|
||||
echo '<th class="ph-approved">'.HTMLHelper::_('searchtools.sort', $OPT.'_APPROVED', 'a.approved', $listDirn, $listOrder ).'</th>'."\n";
|
||||
echo '<th class="ph-parentcattitle">'.HTMLHelper::_('searchtools.sort', $OPT.'_PARENT_CATEGORY', 'parentcat_title', $listDirn, $listOrder ).'</th>'."\n";
|
||||
echo '<th class="ph-access">'.Text::_($OPT.'_ACCESS').'</th>'."\n";
|
||||
echo '<th class="ph-owner">'.HTMLHelper::_('searchtools.sort', $OPT.'_OWNER', 'a.owner_id', $listDirn, $listOrder ).'</th>'."\n";
|
||||
echo '<th class="ph-rating">'.HTMLHelper::_('searchtools.sort', $OPT.'_RATING', 'ratingavg', $listDirn, $listOrder ).'</th>'."\n";
|
||||
echo '<th class="ph-hits">'.HTMLHelper::_('searchtools.sort', $OPT.'_HITS', 'a.hits', $listDirn, $listOrder ).'</th>'."\n";
|
||||
echo '<th class="ph-language">'.HTMLHelper::_('searchtools.sort', 'JGRID_HEADING_LANGUAGE', 'a.language', $listDirn, $listOrder ).'</th>'."\n";
|
||||
echo '<th class="ph-id">'.HTMLHelper::_('searchtools.sort', $OPT.'_ID', 'a.id', $listDirn, $listOrder ).'</th>'."\n";
|
||||
|
||||
echo $r->endTblHeader();
|
||||
echo $r->startTblBody($saveOrder, $saveOrderingUrl, $listDirn);
|
||||
|
||||
|
||||
$originalOrders = array();
|
||||
$parentsStr = "";
|
||||
$j = 0;
|
||||
|
||||
|
||||
if (is_array($this->items)) {
|
||||
foreach ($this->items as $i => $item) {
|
||||
if ($i >= (int)$this->pagination->limitstart && $j < (int)$this->pagination->limit) {
|
||||
$j++;
|
||||
|
||||
$urlEdit = 'index.php?option='.$option.'&task='.$task.'.edit&id=';
|
||||
$orderkey = array_search($item->id, $this->ordering[$item->parent_id]);
|
||||
$ordering = ($listOrder == 'a.ordering');
|
||||
$canCreate = $user->authorise('core.create', $option);
|
||||
$canEdit = $user->authorise('core.edit', $option);
|
||||
$canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out==$user->get('id') || $item->checked_out==0;
|
||||
$canChange = $user->authorise('core.edit.state', $option) && $canCheckin;
|
||||
$linkEdit = Route::_( $urlEdit.(int) $item->id );
|
||||
$linkParent = Route::_( $urlEdit.(int) $item->parent_id );
|
||||
$canEditParent = $user->authorise('core.edit', $option);
|
||||
|
||||
$parentsStr = '';
|
||||
if (isset($item->parentstree)) {
|
||||
$parentsStr = ' '.$item->parentstree;
|
||||
}
|
||||
if (!isset($item->level)) {
|
||||
$item->level = 0;
|
||||
}
|
||||
|
||||
echo $r->startTr($i, isset($item->catid) ? (int)$item->catid : 0, (int)$item->id);
|
||||
echo $r->firstColumn($i, $item->id, $canChange, $saveOrder, $orderkey, $item->ordering);
|
||||
echo $r->secondColumn($i, $item->id, $canChange, $saveOrder, $orderkey, $item->ordering);
|
||||
$checkO = '';
|
||||
if ($item->checked_out) {
|
||||
$checkO .= HTMLHelper::_('jgrid.checkedout', $i, $item->editor, $item->checked_out_time, $tasks.'.', $canCheckin);
|
||||
}
|
||||
if ($canCreate || $canEdit) {
|
||||
$checkO .= '<a href="'. Route::_($linkEdit).'">'. $this->escape($item->title).'</a>';
|
||||
} else {
|
||||
$checkO .= $this->escape($item->title);
|
||||
}
|
||||
$checkO .= ' <span class="smallsub">(<span>'.Text::_($OPT.'_FIELD_ALIAS_LABEL').':</span>'. $this->escape($item->alias).')</span>';
|
||||
|
||||
$indentation = $r->createIndentation($item->level);
|
||||
echo $r->td($indentation . $checkO, "small");
|
||||
echo $r->td(HTMLHelper::_('jgrid.published', $item->published, $i, $tasks.'.', $canChange), "small");
|
||||
echo $r->td(PhocaGalleryJGrid::approved( $item->approved, $i, $tasks.'.', $canChange), "small");
|
||||
|
||||
if ($canEditParent) {
|
||||
$parentO = '<a href="'. Route::_($linkParent).'">'. $this->escape($item->parentcat_title).'</a>';
|
||||
} else {
|
||||
$parentO = $this->escape($item->parentcat_title);
|
||||
}
|
||||
echo $r->td($parentO, "small");
|
||||
echo $r->td($this->escape($item->access_level), "small");
|
||||
|
||||
$usrO = $item->usernameno;
|
||||
if ($item->username) {$usrO = $usrO . ' ('.$item->username.')';}
|
||||
echo $r->td($usrO, "small");
|
||||
echo $r->tdRating($item->ratingavg);
|
||||
echo $r->td($item->hits, "small");
|
||||
echo $r->tdLanguage($item->language, $item->language_title, $this->escape($item->language_title));
|
||||
echo $r->td($item->id, "small");
|
||||
|
||||
echo $r->endTr();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
echo $r->endTblBody();
|
||||
|
||||
echo $r->tblFoot($this->pagination->getListFooter(), 12);
|
||||
echo $r->endTable();
|
||||
|
||||
echo $this->loadTemplate('batch');
|
||||
|
||||
echo $r->formInputsXML($listOrder, $listDirn, $originalOrders);
|
||||
echo $r->endMainContainer();
|
||||
echo $r->endForm();
|
||||
?>
|
||||
@ -0,0 +1,76 @@
|
||||
<?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;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Layout\LayoutHelper;
|
||||
|
||||
//$published = $this->state->get('filter.published');
|
||||
?>
|
||||
|
||||
<div id="collapseModal" role="dialog" tabindex="-1" class="joomla-modal modal fade">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h3 class="modal-title"><?php echo Text::_('COM_PHOCAGALLERY_BATCH_OPTIONS_CATEGORIES');?></h3>
|
||||
<button type="button" class="btn-close novalidate" data-bs-dismiss="modal" aria-label="<?php Text::_('COM_PHOCAGALLERY_CLOSE'); ?>">
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
<div class="p-3">
|
||||
<div class="row">
|
||||
<div class="form-group col-md-6">
|
||||
<div class="controls"><?php echo LayoutHelper::render('joomla.html.batch.access', []);?></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="form-group col-md-6">
|
||||
<div class="controls">
|
||||
<label id="batch-accessuserid-lbl" for="batch-accessuserid" class="modalTooltip" title="<strong><?php echo Text::_('COM_PHOCAGALLERY_SET_ACCESS_RIGHTS_LEVEL'); ?></strong><br /><?php echo Text::_('COM_PHOCAGALLERY_NOT_MAKING_SELECTION_WILL_KEEP_ORIGINAL_ACCESS_RIGHTS_LEVELS'); ?>"><?php echo Text::_('COM_PHOCAGALLERY_SET_ACCESS_RIGHTS_LEVEL'); ?></label>
|
||||
|
||||
<?php
|
||||
$userList = PhocaGalleryAccess::usersList( 'batch[accessuserid][]', 'batch-accessuserid', -3, 1, NULL, 'name', 0 );
|
||||
echo $userList
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="form-group col-md-6">
|
||||
<div class="controls"><?php echo LayoutHelper::render('joomla.html.batch.language', []); ?></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="form-group col-md-6">
|
||||
<div class="controls"><?php echo PhocaGalleryBatch::item('', 1); ?></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button class="btn" type="button" onclick="document.getElementById('batch-category-id').value='';document.getElementById('batch-access').value='';document.getElementById('batch-language-id').value=''" data-bs-dismiss="modal">
|
||||
<?php echo Text::_('JCANCEL'); ?>
|
||||
</button>
|
||||
<button class="btn btn-primary" type="submit" onclick="Joomla.submitbutton('phocagalleryc.batch');" id="batch-submit-button-id" data-submit-task="phocagalleryc.batch">
|
||||
<?php echo Text::_('JGLOBAL_BATCH_PROCESS'); ?>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,307 @@
|
||||
<?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();
|
||||
use Joomla\CMS\MVC\View\HtmlView;
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Pagination\Pagination;
|
||||
use Joomla\CMS\Component\ComponentHelper;
|
||||
use Joomla\CMS\Toolbar\Toolbar;
|
||||
use Joomla\CMS\Toolbar\ToolbarHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Object\CMSObject;
|
||||
jimport( 'joomla.application.component.view' );
|
||||
phocagalleryimport( 'phocagallery.rate.ratecategory' );
|
||||
|
||||
class PhocaGalleryCpViewPhocaGalleryCs extends HtmlView
|
||||
{
|
||||
protected $items;
|
||||
protected $pagination;
|
||||
protected $state;
|
||||
protected $t;
|
||||
protected $r;
|
||||
public $filterForm;
|
||||
public $activeFilters;
|
||||
//protected $_context = 'com_phocagallery.phocagalleryc';
|
||||
|
||||
function display($tpl = null) {
|
||||
|
||||
|
||||
$model = $this->getModel();
|
||||
$this->items = $this->get('Items');
|
||||
$this->pagination = $this->get('Pagination');
|
||||
$this->state = $this->get('State');
|
||||
$this->filterForm = $this->get('FilterForm');
|
||||
$this->activeFilters = $this->get('ActiveFilters');
|
||||
|
||||
$this->r = new PhocaGalleryRenderAdminViews();
|
||||
$this->t = PhocaGalleryUtils::setVars('c');
|
||||
|
||||
// Preprocess the list of items to find ordering divisions.
|
||||
foreach ($this->items as &$item) {
|
||||
$this->ordering[$item->parent_id][] = $item->id;
|
||||
}
|
||||
|
||||
// if search, don't do a tree, only display the searched items
|
||||
$this->t['search'] = $this->state->get('filter.search');
|
||||
/*
|
||||
* We need to load all items because of creating tree
|
||||
* After creating tree we get info from pagination
|
||||
* and will set displaying of categories for current pagination
|
||||
* E.g. pagination is limitstart 5, limit 5 - so only categories from 5 to 10 will be displayed
|
||||
*/
|
||||
|
||||
// the same for max levels
|
||||
$this->t['level'] = $this->state->get('filter.level');
|
||||
|
||||
if (!empty($this->items) && !$this->t['search']) {
|
||||
$text = ''; // text is tree name e.g. Category >> Subcategory
|
||||
$tree = array();
|
||||
|
||||
// Filter max levels
|
||||
if (isset($this->t['level']) && $this->t['level'] > 0) {
|
||||
$maxLevel = (int)$this->t['level'] + 1;
|
||||
} else {
|
||||
$maxLevel = false;
|
||||
}
|
||||
|
||||
$this->items = $this->processTree($this->items, $tree, 0, $text, -1, 0, '', $maxLevel);
|
||||
|
||||
// Re count the pagination
|
||||
$countTotal = count($this->items);
|
||||
$model->setTotal($countTotal);
|
||||
$this->pagination = $model->getPagination();
|
||||
|
||||
/*
|
||||
// PHOCAEDIT
|
||||
// Because of search, we load more items - e.g. if the searched string is in category which is on level 3
|
||||
// we have loaded parent categories of the level 3 category: level3 (searched string) - level2 - level1 (root)
|
||||
// Now we need to limit if, it is a paradox:
|
||||
// a) wee need to get parent categories - but only for creating tree
|
||||
// b) but we don't want to display them - so in model we load it moreover but now we need to remove again + we need to limit pagination
|
||||
|
||||
$app = Factory::getApplication('administrator');
|
||||
$search = $app->getUserStateFromRequest('com_phocagallery.phocagalleryimgs.filter.search', 'filter_search');
|
||||
|
||||
if ($search != '') {
|
||||
foreach ($this->items as $k => $v) {
|
||||
|
||||
$pos = strpos(strtolower($v->title_self), strtolower($search));
|
||||
if ($pos !== false) {
|
||||
|
||||
} else {
|
||||
unset($this->items[$k]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Correct the pagination
|
||||
$c = count($this->items);
|
||||
$this->pagination = new Pagination($c, $this->pagination->limitstart, $this->pagination->limit);
|
||||
// END PHOCAEDIT */
|
||||
}
|
||||
|
||||
|
||||
//$mainframe = JFactory::getApplication();
|
||||
//$document = JFactory::getDocument();
|
||||
//$uri = \Joomla\CMS\Uri\Uri::getInstance();
|
||||
|
||||
|
||||
|
||||
$this->t['notapproved'] = $this->get( 'NotApprovedCategory' );
|
||||
|
||||
|
||||
$params = ComponentHelper::getParams('com_phocagallery');
|
||||
|
||||
$this->t['enablethumbcreation'] = $params->get('enable_thumb_creation', 1 );
|
||||
$this->t['enablethumbcreationstatus'] = PhocaGalleryRenderAdmin::renderThumbnailCreationStatus((int)$this->t['enablethumbcreation']);
|
||||
|
||||
|
||||
$this->addToolbar();
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
protected function addToolbar() {
|
||||
|
||||
require_once JPATH_COMPONENT.'/helpers/phocagallerycs.php';
|
||||
|
||||
$state = $this->get('State');
|
||||
$canDo = PhocaGalleryCsHelper::getActions($state->get('filter.category_id'));
|
||||
$user = Factory::getUser();
|
||||
$bar = Toolbar::getInstance('toolbar');
|
||||
|
||||
ToolbarHelper::title( Text::_( 'COM_PHOCAGALLERY_CATEGORIES' ), 'folder' );
|
||||
if ($canDo->get('core.create')) {
|
||||
ToolbarHelper::addNew('phocagalleryc.add','JToolbar_NEW');
|
||||
}
|
||||
if ($canDo->get('core.edit')) {
|
||||
ToolbarHelper::editList('phocagalleryc.edit','JToolbar_EDIT');
|
||||
}
|
||||
|
||||
$dropdown = $bar->dropdownButton('status-group')->text('JTOOLBAR_CHANGE_STATUS')->toggleSplit(false)->icon('icon-ellipsis-h')->buttonClass('btn btn-action')->listCheck(true);
|
||||
$childBar = $dropdown->getChildToolbar();
|
||||
|
||||
|
||||
if ($canDo->get('core.edit.state')) {
|
||||
|
||||
/* ToolbarHelper::divider();
|
||||
ToolbarHelper::custom('phocagallerycs.publish', 'publish.png', 'publish_f2.png','JToolbar_PUBLISH', true);
|
||||
ToolbarHelper::custom('phocagallerycs.unpublish', 'unpublish.png', 'unpublish_f2.png', 'JToolbar_UNPUBLISH', true);
|
||||
ToolbarHelper::custom( 'phocagallerycs.approve', 'approve.png', '', 'COM_PHOCAGALLERY_APPROVE' , true);
|
||||
ToolbarHelper::custom( 'phocagallerycs.disapprove', 'disapprove.png', '', 'COM_PHOCAGALLERY_NOT_APPROVE' , true);
|
||||
//ToolbarHelper::custom('phocagallerycs.cooliris', 'cooliris.png', '', 'COM_PHOCAGALLERY_COOLIRIS' , true);*/
|
||||
|
||||
$childBar->publish('phocagallerycs.publish')->listCheck(true);
|
||||
$childBar->unpublish('phocagallerycs.unpublish')->listCheck(true);
|
||||
$childBar->standardButton('approve')->text('COM_PHOCAGALLERY_APPROVE')->task('phocagallerycs.approve')->listCheck(true);
|
||||
$childBar->standardButton('disapprove')->text('COM_PHOCAGALLERY_NOT_APPROVE')->task('phocagallerycs.disapprove')->listCheck(true);
|
||||
}
|
||||
|
||||
if ($canDo->get('core.delete')) {
|
||||
//ToolbarHelper::deleteList( Text::_( 'COM_PHOCAGALLERY_WARNING_DELETE_ITEMS' ), 'phocagallerycs.delete', 'COM_PHOCAGALLERY_DELETE');
|
||||
$childBar->delete('phocagallerycs.delete')->text('COM_PHOCAGALLERY_DELETE')->message('COM_PHOCAGALLERY_WARNING_DELETE_ITEMS')->icon('icon-trash')->listCheck(true);
|
||||
}
|
||||
// Add a batch button
|
||||
if ($user->authorise('core.edit'))
|
||||
{
|
||||
//HTMLHelper::_('bootstrap.renderModal', 'collapseModal');
|
||||
/*$title = Text::_('JToolbar_BATCH');
|
||||
|
||||
|
||||
$dhtml = '<joomla-toolbar-button id="toolbar-batch" list-selection>';
|
||||
$dhtml .= "<button data-bs-toggle=\"modal\" data-bs-target=\"#collapseModal\" class=\"btn btn-primary btn-small\">
|
||||
<i class=\"icon-checkbox-partial\" title=\"$title\"></i>
|
||||
$title</button>";
|
||||
$dhtml .= '</joomla-toolbar-button>';
|
||||
|
||||
$bar->appendButton('Custom', $dhtml, 'batch');*/
|
||||
|
||||
HTMLHelper::_('bootstrap.renderModal', 'collapseModal');
|
||||
$childBar->popupButton('batch')->text('JTOOLBAR_BATCH')->selector('collapseModal')->listCheck(true);
|
||||
|
||||
}
|
||||
ToolbarHelper::divider();
|
||||
ToolbarHelper::help( 'screen.phocagallery', true );
|
||||
}
|
||||
|
||||
|
||||
protected function processTree( $data, $tree, $id = 0, $text='', $currentId = 0, $level = 0, $parentsTreeString = '', $maxLevel = false) {
|
||||
|
||||
|
||||
$countItemsInCat = 0;// Ordering
|
||||
$level = $level + 1;
|
||||
$parentsTreeString = $id . ' '. $parentsTreeString;
|
||||
|
||||
|
||||
|
||||
|
||||
// Limit the level of tree
|
||||
if (!$maxLevel || ($maxLevel && $level < $maxLevel)) {
|
||||
foreach ($data as $key) {
|
||||
$show_text = $text . $key->title;
|
||||
|
||||
static $iCT = 0;// All displayed items
|
||||
|
||||
if ($key->parent_id == $id && $currentId != $id && $currentId != $key->id ) {
|
||||
|
||||
|
||||
$tree[$iCT] = new CMSObject();
|
||||
|
||||
|
||||
|
||||
// Ordering MUST be solved here
|
||||
if ($countItemsInCat > 0) {
|
||||
$tree[$iCT]->orderup = 1;
|
||||
} else {
|
||||
$tree[$iCT]->orderup = 0;
|
||||
}
|
||||
|
||||
if ($countItemsInCat < ($key->countid - 1)) {
|
||||
$tree[$iCT]->orderdown = 1;
|
||||
} else {
|
||||
$tree[$iCT]->orderdown = 0;
|
||||
}
|
||||
|
||||
$tree[$iCT]->level = $level;
|
||||
$tree[$iCT]->parentstree = $parentsTreeString;
|
||||
|
||||
$tree[$iCT]->id = $key->id;
|
||||
$tree[$iCT]->title = $show_text;
|
||||
$tree[$iCT]->title_self = $key->title;
|
||||
$tree[$iCT]->parent_id = $key->parent_id;
|
||||
$tree[$iCT]->owner_id = $key->owner_id;
|
||||
$tree[$iCT]->name = $key->name;
|
||||
$tree[$iCT]->alias = $key->alias;
|
||||
$tree[$iCT]->image = $key->image;
|
||||
$tree[$iCT]->section = $key->section;
|
||||
$tree[$iCT]->image_position = $key->image_position;
|
||||
$tree[$iCT]->description = $key->description;
|
||||
$tree[$iCT]->published = $key->published;
|
||||
$tree[$iCT]->editor = $key->editor;
|
||||
$tree[$iCT]->ordering = $key->ordering;
|
||||
$tree[$iCT]->access = $key->access;
|
||||
$tree[$iCT]->access_level = $key->access_level;
|
||||
$tree[$iCT]->count = $key->count;
|
||||
$tree[$iCT]->params = $key->params;
|
||||
$tree[$iCT]->checked_out = $key->checked_out;
|
||||
$tree[$iCT]->checked_out_time = $key->checked_out_time;
|
||||
$tree[$iCT]->groupname = 0;
|
||||
$tree[$iCT]->username = $key->username;
|
||||
$tree[$iCT]->usernameno = $key->usernameno;
|
||||
$tree[$iCT]->parentcat_title = $key->parentcat_title;
|
||||
$tree[$iCT]->parentcat_id = $key->parentcat_id;
|
||||
$tree[$iCT]->hits = $key->hits;
|
||||
$tree[$iCT]->ratingavg = $key->ratingavg;
|
||||
$tree[$iCT]->accessuserid = $key->accessuserid;
|
||||
$tree[$iCT]->uploaduserid = $key->uploaduserid;
|
||||
$tree[$iCT]->deleteuserid = $key->deleteuserid;
|
||||
$tree[$iCT]->userfolder = $key->userfolder;
|
||||
$tree[$iCT]->latitude = $key->latitude;
|
||||
$tree[$iCT]->longitude = $key->longitude;
|
||||
$tree[$iCT]->zoom = $key->zoom;
|
||||
$tree[$iCT]->geotitle = $key->geotitle;
|
||||
$tree[$iCT]->approved = $key->approved;
|
||||
$tree[$iCT]->language = $key->language;
|
||||
$tree[$iCT]->language_title = $key->language_title;
|
||||
$tree[$iCT]->link = '';
|
||||
$tree[$iCT]->filename = '';// Will be added in View (after items will be reduced)
|
||||
$tree[$iCT]->linkthumbnailpath = '';
|
||||
|
||||
|
||||
$iCT++;
|
||||
|
||||
|
||||
$tree = $this->processTree($data, $tree, $key->id, $show_text . " - ", $currentId, $level, $parentsTreeString, $maxLevel);
|
||||
|
||||
$countItemsInCat++;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return($tree);
|
||||
}
|
||||
|
||||
protected function getSortFields() {
|
||||
return array(
|
||||
'a.ordering' => Text::_('JGRID_HEADING_ORDERING'),
|
||||
'a.title' => Text::_('COM_PHOCAGALLERY_TITLE'),
|
||||
'a.published' => Text::_('COM_PHOCAGALLERY_PUBLISHED'),
|
||||
'a.approved' => Text::_('COM_PHOCAGALLERY_APPROVED'),
|
||||
'parent_title' => Text::_('COM_PHOCAGALLERY_PARENT_CATEGORY'),
|
||||
'a.owner' => Text::_('COM_PHOCAGALLERY_OWNER'),
|
||||
'ratingavg' => Text::_('COM_PHOCAGALLERY_RATING'),
|
||||
'a.hits' => Text::_('COM_PHOCAGALLERY_HITS'),
|
||||
'language' => Text::_('JGRID_HEADING_LANGUAGE'),
|
||||
'a.id' => Text::_('JGRID_HEADING_ID')
|
||||
);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,35 @@
|
||||
<?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\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Uri\Uri;
|
||||
<table border="0" width="100%">
|
||||
<tr>
|
||||
<td align="center" valign="middle" height="486"><?php
|
||||
if (isset($this->file->extid) && $this->file->extid !='') {
|
||||
$resW = explode(',', $this->file->extw);
|
||||
$resH = explode(',', $this->file->exth);
|
||||
|
||||
$correctImageRes = PhocaGalleryImage::correctSizeWithRate($resW[0], $resH[0], 640, 480);
|
||||
echo '<a href="#" onclick="SqueezeBox.close();">'. HTMLHelper::_('image', $this->file->extl .'?imagesid='.md5(uniqid(time())), '').'</a>';
|
||||
|
||||
} else if ($this->file->linkthumbnailpath=='') {
|
||||
echo '<center style="font-size:large;font-weight:bold;color:#b3b3b3;font-family: Helvetica, sans-serif;">'. Text::_( 'COM_PHOCAGALLERY_FILENAME_NOT_EXISTS' ).'</center>';
|
||||
} else {
|
||||
//echo '<a href="#" onclick="SqueezeBox.close();">'. JHtml::_('image', $this->file->linkthumbnailpath .'?imagesid='.md5(uniqid(time())), '').'</a>';
|
||||
|
||||
echo '<a href="#" onclick="SqueezeBox.close();"><img src="'.Uri::root().$this->file->linkthumbnailpath.'?imagesid='.md5(uniqid(time())).'" alt="" /></a>';
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,24 @@
|
||||
<?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;
|
||||
jimport( 'joomla.application.component.view');
|
||||
|
||||
class PhocaGalleryCpViewPhocaGalleryD extends HtmlView
|
||||
{
|
||||
protected $file;
|
||||
|
||||
public function display($tpl = null) {
|
||||
$this->file = $this->get('Data');
|
||||
parent::display($tpl);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,93 @@
|
||||
<?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;
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Language\Text;
|
||||
|
||||
$task = 'phocagalleryef';
|
||||
|
||||
//JHtml::_('behavior.tooltip');
|
||||
//JHtml::_('behavior.formvalidation');
|
||||
HtmlHelper::_('behavior.keepalive');
|
||||
//JHtml::_('formbehavior.chosen', 'select');
|
||||
|
||||
$r = $this->r;
|
||||
$app = Factory::getApplication();
|
||||
$option = $app->input->get('option');
|
||||
$OPT = strtoupper($option);
|
||||
Factory::getDocument()->addScriptDeclaration(
|
||||
|
||||
'Joomla.submitbutton = function(task) {
|
||||
if (task == "'. $this->t['task'].'.cancel" || document.formvalidator.isValid(document.getElementById("adminForm"))) {
|
||||
Joomla.submitform(task, document.getElementById("adminForm"));
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}'
|
||||
|
||||
);
|
||||
|
||||
echo $r->startHeader();
|
||||
echo $r->startForm($option, $task, $this->item->id, 'adminForm', 'adminForm');
|
||||
// First Column
|
||||
echo '<div class="span12 form-horizontal">';
|
||||
$tabs = array (
|
||||
'general' => Text::_($OPT.'_GENERAL_OPTIONS'),
|
||||
'publishing' => Text::_($OPT.'_PUBLISHING_OPTIONS'));
|
||||
echo $r->navigation($tabs);
|
||||
|
||||
echo $r->startTabs();
|
||||
|
||||
echo $r->startTab('general', $tabs['general'], 'active');
|
||||
|
||||
if (isset($this->t['ftp']) && $this->t['ftp']) { echo $this->loadTemplate('ftp');}
|
||||
|
||||
//$formArray = array ('title', 'type', 'filename', 'ordering');
|
||||
//echo $r->group($this->form, $formArray);
|
||||
|
||||
//echo '<div class="control-group">';
|
||||
echo $r->item($this->form, 'title');
|
||||
echo $this->form->getInput('type');
|
||||
echo $r->item($this->form, 'typeoutput');
|
||||
echo $r->item($this->form, 'filename', $this->t['suffixtype']);
|
||||
echo $r->item($this->form, 'ordering');
|
||||
|
||||
|
||||
|
||||
//echo '</div>';
|
||||
|
||||
echo '<div class="clr"></div>';
|
||||
echo $this->form->getLabel('source');
|
||||
echo '<div class="clr"></div>';
|
||||
echo '<div class="editor-border" id="ph-editor">';
|
||||
echo $this->form->getInput('source');
|
||||
echo '</div>';
|
||||
|
||||
echo $r->endTab();
|
||||
|
||||
echo $r->startTab('publishing', $tabs['publishing']);
|
||||
foreach($this->form->getFieldset('publish') as $field) {
|
||||
echo '<div class="control-group">';
|
||||
if (!$field->hidden) {
|
||||
echo '<div class="control-label">'.$field->label.'</div>';
|
||||
}
|
||||
echo '<div class="controls">';
|
||||
echo $field->input;
|
||||
echo '</div></div>';
|
||||
}
|
||||
echo $r->endTab();
|
||||
echo $r->endTabs();
|
||||
|
||||
// Second Column
|
||||
echo '<div class="span2"></div>';//end span2
|
||||
echo $r->formInputs($this->t['task']);
|
||||
echo $r->endForm();
|
||||
?>
|
||||
@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Administrator
|
||||
* @subpackage com_templates
|
||||
*
|
||||
* @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
use Joomla\CMS\Language\Text;
|
||||
?>
|
||||
<fieldset class="adminform" title="<?php echo Text::_('COM_PHOCAGALLERY_FTP_TITLE'); ?>">
|
||||
<legend><?php echo Text::_('COM_PHOCAGALLERY_FTP_TITLE'); ?></legend>
|
||||
|
||||
<?php echo Text::_('COM_PHOCAGALLERY_FTP_DESC'); ?>
|
||||
|
||||
<?php if ($this->t['ftp'] instanceof Exception): ?>
|
||||
<p class="error"><?php echo Text::_($this->t['ftp']->message); ?></p>
|
||||
<?php endif; ?>
|
||||
|
||||
<table class="adminform">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td width="120">
|
||||
<label for="username"><?php echo Text::_('JGLOBAL_USERNAME'); ?></label>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" id="username" name="username" class="form-control" size="70" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="120">
|
||||
<label for="password"><?php echo Text::_('JGLOBAL_PASSWORD'); ?></label>
|
||||
</td>
|
||||
<td>
|
||||
<input type="password" id="password" name="password" class="form-control" size="70" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</fieldset>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,107 @@
|
||||
<?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\Client\ClientHelper;
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Toolbar\Toolbar;
|
||||
use Joomla\CMS\Component\ComponentHelper;
|
||||
use Joomla\CMS\Toolbar\ToolbarHelper;
|
||||
jimport('joomla.application.component.view');
|
||||
|
||||
|
||||
class PhocaGalleryCpViewPhocaGalleryEf extends HtmlView
|
||||
{
|
||||
protected $item;
|
||||
protected $form;
|
||||
protected $state;
|
||||
protected $t;
|
||||
protected $r;
|
||||
|
||||
/**
|
||||
* Display the view
|
||||
*/
|
||||
public function display($tpl = null)
|
||||
{
|
||||
|
||||
|
||||
$this->state = $this->get('State');
|
||||
$this->item = $this->get('Item');
|
||||
$this->form = $this->get('Form');
|
||||
$this->t['ftp'] = ClientHelper::setCredentialsFromRequest('ftp');
|
||||
$this->t = new StdClass;
|
||||
$model = $this->getModel();
|
||||
|
||||
$this->t = PhocaGalleryUtils::setVars('ef');
|
||||
$this->r = new PhocaGalleryRenderAdminview();
|
||||
|
||||
// Set CSS for codemirror
|
||||
Factory::getApplication()->setUserState('editor.source.syntax', 'css');
|
||||
|
||||
|
||||
// New or edit
|
||||
if (!$this->form->getValue('id') || $this->form->getValue('id') == 0) {
|
||||
$this->form->setValue('source', null, '');
|
||||
$this->form->setValue('type', null, 2);
|
||||
$this->t['suffixtype'] = Text::_('COM_PHOCAGALERY_WILL_BE_CREATED_FROM_TITLE');
|
||||
|
||||
} else {
|
||||
$this->source = $model->getSource($this->form->getValue('id'), $this->form->getValue('filename'), $this->form->getValue('type'));
|
||||
$this->form->setValue('source', null, $this->source->source);
|
||||
$this->t['suffixtype'] = '';
|
||||
}
|
||||
|
||||
// Only help input form field - to display Main instead of 1 and Custom instead of 2
|
||||
if ($this->form->getValue('type') == 1) {
|
||||
$this->form->setValue('typeoutput', null, Text::_('COM_PHOCAGALLERY_MAIN_CSS'));
|
||||
} else {
|
||||
$this->form->setValue('typeoutput', null, Text::_('COM_PHOCAGALLERY_CUSTOM_CSS'));
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (count($errors = $this->get('Errors'))) {
|
||||
throw new Exception(implode("\n", $errors), 500);
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->addToolbar();
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
protected function addToolbar() {
|
||||
|
||||
require_once JPATH_COMPONENT.'/helpers/phocagalleryefs.php';
|
||||
Factory::getApplication()->input->set('hidemainmenu', true);
|
||||
$bar = Toolbar::getInstance('toolbar');
|
||||
$user = Factory::getUser();
|
||||
$isNew = ($this->item->id == 0);
|
||||
$checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id'));
|
||||
$canDo = PhocaGalleryEfsHelper::getActions($this->state->get('filter.category_id'), $this->item->id);
|
||||
$paramsC = ComponentHelper::getParams('com_phocagallery');
|
||||
|
||||
$text = $isNew ? Text::_( 'COM_PHOCAGALLERY_NEW' ) : Text::_('COM_PHOCAGALLERY_EDIT');
|
||||
ToolbarHelper::title( Text::_( 'COM_PHOCAGALLERY_STYLE' ).': <small><small>[ ' . $text.' ]</small></small>' , 'eye');
|
||||
|
||||
// If not checked out, can save the item.
|
||||
if (!$checkedOut && $canDo->get('core.edit')){
|
||||
ToolbarHelper::apply('phocagalleryef.apply', 'JToolbar_APPLY');
|
||||
ToolbarHelper::save('phocagalleryef.save', 'JToolbar_SAVE');
|
||||
}
|
||||
|
||||
ToolbarHelper::cancel('phocagalleryef.cancel', 'JToolbar_CLOSE');
|
||||
ToolbarHelper::divider();
|
||||
ToolbarHelper::help( 'screen.phocagallery', true );
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,153 @@
|
||||
<?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;
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Layout\LayoutHelper;
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Router\Route;
|
||||
use Joomla\CMS\Language\Text;
|
||||
|
||||
$task = 'phocagalleryef';
|
||||
|
||||
$r = $this->r;
|
||||
$app = Factory::getApplication();
|
||||
$option = $app->input->get('option');
|
||||
$tasks = $task . 's';
|
||||
$OPT = strtoupper($option);
|
||||
$user = Factory::getUser();
|
||||
$userId = $user->get('id');
|
||||
$listOrder = $this->escape($this->state->get('list.ordering'));
|
||||
$listDirn = $this->escape($this->state->get('list.direction'));
|
||||
$canOrder = $user->authorise('core.edit.state', $option);
|
||||
$saveOrder = $listOrder == 'a.ordering';
|
||||
$saveOrderingUrl = '';
|
||||
if ($saveOrder && !empty($this->items)) {
|
||||
$saveOrderingUrl = $r->saveOrder($this->t, $listDirn);
|
||||
}
|
||||
$sortFields = $this->getSortFields();
|
||||
|
||||
echo $r->startHeader();
|
||||
echo $r->jsJorderTable($listOrder);
|
||||
|
||||
echo $r->startForm($option, $tasks, 'adminForm');
|
||||
//echo $r->startFilter();
|
||||
//echo $r->endFilter();
|
||||
|
||||
echo $r->startMainContainer();
|
||||
/*echo $r->startFilterBar();
|
||||
echo $r->inputFilterSearch($OPT.'_FILTER_SEARCH_LABEL', $OPT.'_FILTER_SEARCH_DESC',
|
||||
$this->escape($this->state->get('filter.search')));
|
||||
echo $r->inputFilterSearchClear('JSEARCH_FILTER_SUBMIT', 'JSEARCH_FILTER_CLEAR');
|
||||
echo $r->inputFilterSearchLimit('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC', $this->pagination->getLimitBox());
|
||||
echo $r->selectFilterDirection('JFIELD_ORDERING_DESC', 'JGLOBAL_ORDER_ASCENDING', 'JGLOBAL_ORDER_DESCENDING', $listDirn);
|
||||
echo $r->selectFilterSortBy('JGLOBAL_SORT_BY', $sortFields, $listOrder);
|
||||
|
||||
echo $r->startFilterBar(2);
|
||||
echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED', $this->state->get('filter.published'));
|
||||
echo $r->selectFilterLanguage('JOPTION_SELECT_LANGUAGE', $this->state->get('filter.language'));
|
||||
echo $r->selectFilterCategory(PhocaGalleryCategory::options(1), 'COM_PHOCAGALLERY_FILTER_SELECT_TYPE', $this->state->get('filter.category_id'));
|
||||
echo $r->endFilterBar();
|
||||
|
||||
//echo $r->endFilterBar();*/
|
||||
echo LayoutHelper::render('joomla.searchtools.default', array('view' => $this));
|
||||
|
||||
echo $r->startTable('categoryList');
|
||||
|
||||
echo $r->startTblHeader();
|
||||
|
||||
echo $r->firstColumnHeader($listDirn, $listOrder);
|
||||
echo $r->secondColumnHeader($listDirn, $listOrder);
|
||||
|
||||
|
||||
echo '<th class="ph-title-short">'.HTMLHelper::_('searchtools.sort', $OPT.'_TITLE', 'a.title', $listDirn, $listOrder ).'</th>'."\n";
|
||||
echo '<th class="ph-filename-long">'.HTMLHelper::_('searchtools.sort', $OPT.'_FILENAME', 'a.title', $listDirn, $listOrder ).'</th>'."\n";
|
||||
echo '<th class="ph-published">'.HTMLHelper::_('searchtools.sort', $OPT.'_PUBLISHED', 'a.published', $listDirn, $listOrder ).'</th>'."\n";
|
||||
echo '<th class="ph-parentcattitle">'.HTMLHelper::_('searchtools.sort', $OPT.'_TYPE', 'a.type', $listDirn, $listOrder ).'</th>'."\n";
|
||||
echo '<th class="ph-language">'.HTMLHelper::_('searchtools.sort', 'JGRID_HEADING_LANGUAGE', 'a.language', $listDirn, $listOrder ).'</th>'."\n";
|
||||
echo '<th class="ph-id">'.HTMLHelper::_('searchtools.sort', $OPT.'_ID', 'a.id', $listDirn, $listOrder ).'</th>'."\n";
|
||||
|
||||
echo $r->endTblHeader();
|
||||
echo $r->startTblBody($saveOrder, $saveOrderingUrl, $listDirn);
|
||||
|
||||
$originalOrders = array();
|
||||
$j = 0;
|
||||
|
||||
if (is_array($this->items)) {
|
||||
foreach ($this->items as $i => $item) {
|
||||
//if ($i >= (int)$this->pagination->limitstart && $j < (int)$this->pagination->limit) {
|
||||
$j++;
|
||||
|
||||
$urlEdit = 'index.php?option='.$option.'&task='.$task.'.edit&id=';
|
||||
$urlTask = 'index.php?option='.$option.'&task='.$task;
|
||||
$orderkey = array_search($item->id, $this->ordering[$item->type]);
|
||||
$ordering = ($listOrder == 'a.ordering');
|
||||
$canCreate = $user->authorise('core.create', $option);
|
||||
$canEdit = $user->authorise('core.edit', $option);
|
||||
$canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out==$user->get('id') || $item->checked_out==0;
|
||||
$canChange = $user->authorise('core.edit.state', $option) && $canCheckin;
|
||||
$linkEdit = Route::_( $urlEdit. $item->id );
|
||||
|
||||
echo $r->startTr($i, isset($item->catid) ? (int)$item->catid : 0);
|
||||
echo $r->firstColumn($i, $item->id, $canChange, $saveOrder, $orderkey, $item->ordering);
|
||||
echo $r->secondColumn($i, $item->id, $canChange, $saveOrder, $orderkey, $item->ordering);
|
||||
|
||||
|
||||
$checkO = '';
|
||||
if ($item->checked_out) {
|
||||
$checkO .= HTMLHelper::_('jgrid.checkedout', $i, $item->editor, $item->checked_out_time, $tasks.'.', $canCheckin);
|
||||
}
|
||||
if ($canCreate || $canEdit) {
|
||||
$checkO .= '<a href="'. Route::_($linkEdit).'">'. $this->escape($item->title).'</a>';
|
||||
} else {
|
||||
$checkO .= $this->escape($item->title);
|
||||
}
|
||||
|
||||
echo $r->td($checkO, "small");
|
||||
|
||||
$filename = PhocaGalleryFile::existsCss($item->filename, $item->type);
|
||||
$main = '';
|
||||
if ((int)$item->type == 1) {
|
||||
$main = ' <span class="label label-warning badge bg-warning">'.Text::_('COM_PHOCAGALLERY_MAIN').'</span>';
|
||||
}
|
||||
if ($filename) {
|
||||
echo $r->td($item->filename . $main .' <span class="label label-success badge bg-success">'.Text::_('COM_PHOCAGALLERY_FILE_EXISTS').'</span>', "small");
|
||||
} else {
|
||||
echo $r->td($item->filename . $main .' <span class="label label-important label-danger badge bg-danger">'.Text::_('COM_PHOCAGALLERY_FILE_DOES_NOT_EXIST').'</span>', "small");
|
||||
}
|
||||
|
||||
echo $r->td(HTMLHelper::_('jgrid.published', $item->published, $i, $tasks.'.', $canChange), "small");
|
||||
|
||||
switch($item->type) {
|
||||
case 2:
|
||||
echo $r->td(Text::_('COM_PHOCAGALLERY_CUSTOM_CSS'), "small");
|
||||
break;
|
||||
case 1:
|
||||
default:
|
||||
echo $r->td(Text::_('COM_PHOCAGALLERY_MAIN_CSS'), "small");
|
||||
break;
|
||||
}
|
||||
echo $r->tdLanguage($item->language, $item->language_title, $this->escape($item->language_title));
|
||||
echo $r->td($item->id, "small");
|
||||
|
||||
echo $r->endTr();
|
||||
|
||||
//}
|
||||
}
|
||||
}
|
||||
echo $r->endTblBody();
|
||||
|
||||
echo $r->tblFoot($this->pagination->getListFooter(), 15);
|
||||
echo $r->endTable();
|
||||
|
||||
|
||||
echo $r->formInputsXML($listOrder, $listDirn, $originalOrders);
|
||||
echo $r->endMainContainer();
|
||||
echo $r->endForm();
|
||||
?>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,100 @@
|
||||
<?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\Toolbar\ToolbarHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Toolbar\Toolbar;
|
||||
jimport( 'joomla.application.component.view' );
|
||||
|
||||
class PhocaGalleryCpViewPhocaGalleryEfs extends HtmlView
|
||||
{
|
||||
protected $items;
|
||||
protected $pagination;
|
||||
protected $state;
|
||||
protected $r;
|
||||
protected $t;
|
||||
public $filterForm;
|
||||
public $activeFilters;
|
||||
|
||||
|
||||
function display($tpl = null) {
|
||||
|
||||
$model = $this->getModel();
|
||||
$model->checkItems();
|
||||
$this->items = $this->get('Items');
|
||||
$this->pagination = $this->get('Pagination');
|
||||
$this->state = $this->get('State');
|
||||
$this->filterForm = $this->get('FilterForm');
|
||||
$this->activeFilters = $this->get('ActiveFilters');
|
||||
|
||||
|
||||
$this->r = new PhocaGalleryRenderAdminViews();
|
||||
$this->t = PhocaGalleryUtils::setVars('ef');
|
||||
|
||||
foreach ($this->items as &$item) {
|
||||
$this->ordering[$item->type][] = $item->id;
|
||||
}
|
||||
|
||||
// Check for errors.
|
||||
if (count($errors = $this->get('Errors'))) {
|
||||
throw new Exception(implode("\n", $errors), 500);
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->addToolbar();
|
||||
parent::display($tpl);
|
||||
|
||||
}
|
||||
|
||||
function addToolbar() {
|
||||
|
||||
require_once JPATH_COMPONENT.'/helpers/phocagalleryefs.php';
|
||||
|
||||
$state = $this->get('State');
|
||||
$canDo = PhocaGalleryEfsHelper::getActions($state->get('filter.category_id'));
|
||||
|
||||
ToolbarHelper::title( Text::_( 'COM_PHOCAGALLERY_STYLES' ), 'eye' );
|
||||
|
||||
if ($canDo->get('core.create')) {
|
||||
ToolbarHelper::addNew( 'phocagalleryef.add','JToolbar_NEW');
|
||||
}
|
||||
|
||||
if ($canDo->get('core.edit')) {
|
||||
ToolbarHelper::editList('phocagalleryef.edit','JToolbar_EDIT');
|
||||
}
|
||||
if ($canDo->get('core.edit.state')) {
|
||||
|
||||
ToolbarHelper::divider();
|
||||
ToolbarHelper::custom('phocagalleryefs.publish', 'publish.png', 'publish_f2.png','JToolbar_PUBLISH', true);
|
||||
ToolbarHelper::custom('phocagalleryefs.unpublish', 'unpublish.png', 'unpublish_f2.png', 'JToolbar_UNPUBLISH', true);
|
||||
}
|
||||
|
||||
if ($canDo->get('core.delete')) {
|
||||
ToolbarHelper::deleteList( Text::_( 'COM_PHOCAGALLERY_WARNING_DELETE_ITEMS' ), 'phocagalleryefs.delete', 'COM_PHOCAGALLERY_DELETE');
|
||||
}
|
||||
ToolbarHelper::divider();
|
||||
ToolbarHelper::help( 'screen.phocagallery', true );
|
||||
}
|
||||
|
||||
protected function getSortFields() {
|
||||
return array(
|
||||
'a.ordering' => Text::_('COM_PHOCAGALLERY_ORDERING'),
|
||||
'a.title' => Text::_('COM_PHOCAGALLERY_TITLE'),
|
||||
'a.filename' => Text::_('COM_PHOCAGALLERY_FILENAME'),
|
||||
'a.published' => Text::_('COM_PHOCAGALLERY_PUBLISHED'),
|
||||
'a.type' => Text::_('COM_PHOCAGALLERY_TYPE'),
|
||||
'language' => Text::_('JGRID_HEADING_LANGUAGE'),
|
||||
'a.id' => Text::_('JGRID_HEADING_ID')
|
||||
);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,37 @@
|
||||
<?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;
|
||||
|
||||
$currentFolder = '';
|
||||
if (isset($this->t['state']->folder) && $this->t['state']->folder != '') {
|
||||
$currentFolder = $this->t['state']->folder;
|
||||
}
|
||||
|
||||
echo '<div class="ph-item-list-box ph-item-list-box-admin">';
|
||||
echo $this->loadTemplate('up');
|
||||
if (count($this->t['folders']) > 0) {
|
||||
for ($i=0,$n=count($this->t['folders']); $i<$n; $i++) {
|
||||
$this->setFolder($i);
|
||||
echo $this->loadTemplate('folder');
|
||||
}
|
||||
} else {
|
||||
echo '<div class="ph-item-list-box-head">'.Text::_( 'COM_PHOCAGALLERY_THERE_IS_NO_FOLDER' ).'</div>';
|
||||
}
|
||||
echo '</div>';
|
||||
|
||||
echo '<div style="clear:both"></div>';
|
||||
echo PhocaGalleryFileUpload::renderCreateFolder($this->t['session']->getName(), $this->t['session']->getId(), $currentFolder, 'phocagalleryf', 'field='.$this->field);
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,25 @@
|
||||
<?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
|
||||
*/
|
||||
|
||||
|
||||
use Joomla\CMS\Language\Text;
|
||||
|
||||
defined('_JEXEC') or die('Restricted access'); ?>
|
||||
|
||||
|
||||
<div class="ph-item-box">
|
||||
<div class="ph-item-image"><a title="<?php echo $this->_tmp_folder->name ?>" href="index.php?option=com_phocagallery&view=phocagalleryf&tmpl=component&folder=<?php echo $this->_tmp_folder->path_with_name_relative_no; ?>&field=<?php echo $this->field; ?>"><span class="ph-cp-item"><i class="phi duotone phi-fs-l phi-fc-brd icon-folder-close"></i></span></a></div>
|
||||
|
||||
<div class="ph-item-name"><a title="<?php echo $this->_tmp_folder->name ?>" href="index.php?option=com_phocagallery&view=phocagalleryf&tmpl=component&folder=<?php echo $this->_tmp_folder->path_with_name_relative_no; ?>&field=<?php echo $this->field; ?>"><span><?php echo PhocagalleryText::WordDelete($this->_tmp_folder->name, 15); ?></span></a></div>
|
||||
|
||||
<div class="ph-item-action-box">
|
||||
<a href="#" onclick="if (window.parent) window.parent.<?php echo $this->fce; ?>('<?php echo $this->_tmp_folder->path_with_name_relative_no; ?>');" title="<?php echo Text::_('COM_PHOCAGALLERY_INSERT_FOLDER') ?>"><span class="ph-cp-item"><i class="phi duotone phi-fs-m phi-fc-gd icon-download"></i></span></a></div>
|
||||
</div>
|
||||
@ -0,0 +1,19 @@
|
||||
<?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'); ?>
|
||||
|
||||
<div class="ph-item-box">
|
||||
<div class="ph-item-image"><a href="index.php?option=com_phocagallery&view=phocagalleryf&tmpl=component&folder=<?php echo PhocaGalleryText::filterValue($this->t['state']->parent, 'folderpath'); ?>&field=<?php echo htmlspecialchars($this->field); ?>" ><span class="ph-cp-item"><i class="phi duotone phi-fs-l phi-fc-bl icon-arrow-up"></i></span></a></div>
|
||||
|
||||
<div class="ph-item-name"><a href="index.php?option=com_phocagallery&view=phocagalleryf&tmpl=component&folder=<?php echo PhocaGalleryText::filterValue($this->t['state']->parent, 'folderpath'); ?>&field=<?php echo htmlspecialchars($this->field); ?>" >..</a></div>
|
||||
|
||||
<div class="ph-item-action-box"></div>
|
||||
</div>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,64 @@
|
||||
<?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\Component\ComponentHelper;
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Object\CMSObject;
|
||||
jimport( 'joomla.application.component.view');
|
||||
|
||||
class PhocaGalleryCpViewPhocagalleryF extends HtmlView
|
||||
{
|
||||
protected $field;
|
||||
protected $fce;
|
||||
protected $t;
|
||||
protected $r;
|
||||
|
||||
public function display($tpl = null) {
|
||||
|
||||
$params = ComponentHelper::getParams( 'com_phocagallery' );
|
||||
$app = Factory::getApplication();
|
||||
$app->allowCache(false);
|
||||
|
||||
$this->t = PhocaGalleryUtils::setVars('f');
|
||||
$this->r = new PhocaGalleryRenderAdminview();
|
||||
|
||||
|
||||
$document = Factory::getDocument();
|
||||
|
||||
|
||||
$path = PhocaGalleryPath::getPath();
|
||||
|
||||
$this->field = Factory::getApplication()->input->get('field');
|
||||
$this->fce = 'phocaSelectFolder_'.$this->field;
|
||||
|
||||
/*$this->assignRef('session', JFactory::getSession());
|
||||
$this->assign('path_orig_rel', $path->image_rel);
|
||||
$this->assignRef('folders', $this->get('folders'));
|
||||
$this->assignRef('state', $this->get('state'));*/
|
||||
|
||||
$this->t['session'] = Factory::getSession();
|
||||
$this->t['path_orig_rel'] = $path->image_rel;
|
||||
$this->t['folders'] = $this->get('folders');
|
||||
$this->t['state'] = $this->get('state');
|
||||
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
protected function setFolder($index = 0) {
|
||||
if (isset($this->t['folders'][$index])) {
|
||||
$this->_tmp_folder = $this->t['folders'][$index];
|
||||
} else {
|
||||
$this->_tmp_folder = new CMSObject;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,195 @@
|
||||
<?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;
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Language\Text;
|
||||
|
||||
$task = 'phocagalleryimg';
|
||||
|
||||
//JHtml::_('behavior.tooltip');
|
||||
//JHtml::_('behavior.formvalidation');
|
||||
HtmlHelper::_('behavior.keepalive');
|
||||
//JHtml::_('formbehavior.chosen', 'select');
|
||||
|
||||
$r = $this->r;
|
||||
$app = Factory::getApplication();
|
||||
$option = $app->input->get('option');
|
||||
$OPT = strtoupper($option);
|
||||
Factory::getDocument()->addScriptDeclaration(
|
||||
|
||||
'Joomla.submitbutton = function(task) {
|
||||
if (task == "'. $this->t['task'].'.cancel" || document.formvalidator.isValid(document.getElementById("adminForm"))) {
|
||||
Joomla.submitform(task, document.getElementById("adminForm"));
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}'
|
||||
|
||||
);
|
||||
|
||||
echo $r->startHeader();
|
||||
echo $r->startForm($option, $task, $this->item->id, 'adminForm', 'adminForm');
|
||||
// First Column
|
||||
echo '<div class="span12 form-horizontal">';
|
||||
$tabs = array (
|
||||
'application' => Text::_($OPT.'_FB_SETTINGS'),
|
||||
'publishing' => Text::_($OPT.'_PUBLISHING_OPTIONS')
|
||||
);
|
||||
echo $r->navigation($tabs);
|
||||
|
||||
echo $r->startTabs();
|
||||
|
||||
|
||||
echo $r->startTab('application', $tabs['application'], 'active');
|
||||
|
||||
echo '<h4>'. Text::_($OPT.'_FB_APPLICATION').'</h4>';
|
||||
|
||||
$formArray = array ('appid', 'appsid', 'ordering');
|
||||
echo $r->group($this->form, $formArray);
|
||||
|
||||
echo '<div class="clearfix"></div>'
|
||||
.'<div>'.Text::_('COM_PHOCAGALLERY_FB_INSTR1') .'</div>'
|
||||
.'<div style="text-align:right"><a style="text-decoration:underline;font-weight:bold;" href="https://developers.facebook.com/setup/" target="_blank" >'. Text::_('COM_PHOCAGALLERY_FB_CREATE_APP').'</a></div>'
|
||||
.'<div class="clearfix"></div>';
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (isset($this->item->appid) && $this->item->appid != ''
|
||||
&& isset($this->item->appsid) && $this->item->appsid != '') {
|
||||
|
||||
echo '<h4>'.Text::_('COM_PHOCAGALLERY_FB_USER_SETTINGS'). '</h4>';
|
||||
|
||||
$status = PhocaGalleryFb::getFbStatus($this->item->appid, $this->item->appsid);
|
||||
|
||||
echo $status['html'];
|
||||
|
||||
if ($status['session']['uid'] != ''
|
||||
/*&& $status['session']['base_domain'] != ''*/
|
||||
&& $status['session']['secret'] != ''
|
||||
//&& $status['session']['session_key'] != ''
|
||||
&& $status['session']['access_token'] != ''
|
||||
//&& $status['session']['sig'] != ''
|
||||
&& $status['u']['name'] != '') {
|
||||
/*$this->form->setValue('uid', '', $status['session']['uid']);
|
||||
$this->form->setValue('base_domain', '', $status['session']['base_domain']);
|
||||
$this->form->setValue('secret', '', $status['session']['secret']);
|
||||
$this->form->setValue('session_key', '', $status['session']['session_key']);
|
||||
$this->form->setValue('access_token', '', $status['session']['access_token']);
|
||||
$this->form->setValue('sig', '', $status['session']['sig']);
|
||||
if ($status['u']['name'] != '') {
|
||||
$this->form->setValue('name', '', $status['u']['name']);
|
||||
}
|
||||
*/
|
||||
|
||||
$div = array();
|
||||
$script = array();
|
||||
$fields = array( 'uid', 'secret', 'access_token');
|
||||
|
||||
$script[] = 'function pasteFbFields() {';
|
||||
foreach ($fields as $field) {
|
||||
if (!isset($status['session'][$field])) {
|
||||
$status['session'][$field] = '';
|
||||
}
|
||||
$script[] = ' document.getElementById(\'jform_'.$field.'\').value = document.getElementById(\'div_'.$field.'\').value;';
|
||||
$div[] = '<input type="hidden" id="div_'.$field.'" value="'.$status['session'][$field].'" />';
|
||||
|
||||
}
|
||||
$script[] = ' document.getElementById(\'jform_name\').value = document.getElementById(\'div_name\').value;';
|
||||
$div[] = '<input type="hidden" id="div_name" value="'.$status['u']['name'].'" />';
|
||||
$script[] = '}';
|
||||
|
||||
echo '<div style="display:none">';
|
||||
$n = "\n";
|
||||
echo implode($n, $div);
|
||||
echo '</div>';
|
||||
|
||||
// Add the script to the document head.
|
||||
Factory::getDocument()->addScriptDeclaration(implode("\n", $script));
|
||||
|
||||
echo '<div style="float:right;"><a href="javascript:void(0)" onclick="pasteFbFields()"><div class="btn btn-primary">'.Text::_('COM_PHOCAGALLERY_FB_PASTE_LOADED_DATA').'</div></a></div>';
|
||||
}
|
||||
|
||||
echo '<div class="clearfix"></div>';
|
||||
//$formArray = array ('name', 'uid', 'base_domain', 'secret', 'session_key', 'access_token', 'sig', 'fanpageid');
|
||||
$formArray = array ('name', 'uid', 'secret', 'access_token', 'fanpageid');
|
||||
echo $r->group($this->form, $formArray);
|
||||
echo '<input name="jform[expires]" id="jform_expires" value="0" readonly="readonly" type="hidden" />'. "\n";
|
||||
echo '<div class="clearfix"></div>';
|
||||
|
||||
echo '<h4>'. Text::_('COM_PHOCAGALLERY_FB_COMMENTS_SETTINGS') .'</h4>';
|
||||
foreach($this->form->getFieldset('comments') as $field) {
|
||||
echo '<div class="control-group">';
|
||||
if (!$field->hidden) {
|
||||
echo '<div class="control-label">'.$field->label.'</div>';
|
||||
}
|
||||
echo '<div class="controls">';
|
||||
echo $field->input;
|
||||
echo '</div></div>';
|
||||
}
|
||||
|
||||
}
|
||||
echo $r->endTab();
|
||||
|
||||
echo $r->startTab('publishing', $tabs['publishing']);
|
||||
foreach($this->form->getFieldset('publish') as $field) {
|
||||
echo '<div class="control-group">';
|
||||
if (!$field->hidden) {
|
||||
echo '<div class="control-label">'.$field->label.'</div>';
|
||||
}
|
||||
echo '<div class="controls">';
|
||||
echo $field->input;
|
||||
echo '</div></div>';
|
||||
}
|
||||
echo $r->endTab();
|
||||
echo $r->endTabs();
|
||||
|
||||
echo '</div>';//end span10
|
||||
// Second Column
|
||||
//echo '<div class="span2"></div>';//end span2
|
||||
echo $r->formInputs($this->t['task']);
|
||||
echo $r->endForm();
|
||||
|
||||
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,82 @@
|
||||
<?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\Toolbar\Toolbar;
|
||||
use Joomla\CMS\Component\ComponentHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Toolbar\ToolbarHelper;
|
||||
jimport('joomla.application.component.view');
|
||||
phocagalleryimport( 'phocagallery.facebook.fb' );
|
||||
phocagalleryimport( 'phocagallery.facebook.fbsystem' );
|
||||
|
||||
|
||||
class PhocaGalleryCpViewPhocaGalleryFb extends HtmlView
|
||||
{
|
||||
protected $item;
|
||||
protected $form;
|
||||
protected $state;
|
||||
protected $t;
|
||||
protected $r;
|
||||
|
||||
/**
|
||||
* Display the view
|
||||
*/
|
||||
public function display($tpl = null)
|
||||
{
|
||||
|
||||
|
||||
$this->state = $this->get('State');
|
||||
$this->item = $this->get('Item');
|
||||
$this->form = $this->get('Form');
|
||||
|
||||
$this->t = PhocaGalleryUtils::setVars('fb');
|
||||
$this->r = new PhocaGalleryRenderAdminview();
|
||||
|
||||
|
||||
if (count($errors = $this->get('Errors'))) {
|
||||
throw new Exception(implode("\n", $errors), 500);
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->addToolbar();
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
protected function addToolbar() {
|
||||
|
||||
require_once JPATH_COMPONENT.'/helpers/phocagalleryfbs.php';
|
||||
Factory::getApplication()->input->set('hidemainmenu', true);
|
||||
$bar = Toolbar::getInstance('toolbar');
|
||||
$user = Factory::getUser();
|
||||
$isNew = ($this->item->id == 0);
|
||||
$checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id'));
|
||||
$canDo = PhocaGalleryFbsHelper::getActions( $this->item->id);
|
||||
$paramsC = ComponentHelper::getParams('com_phocagallery');
|
||||
|
||||
$text = $isNew ? Text::_( 'COM_PHOCAGALLERY_NEW' ) : Text::_('COM_PHOCAGALLERY_EDIT');
|
||||
ToolbarHelper::title( Text::_( 'COM_PHOCAGALLERY_FB_USER' ).': <small><small>[ ' . $text.' ]</small></small>' , 'user');
|
||||
|
||||
// If not checked out, can save the item.
|
||||
if (!$checkedOut && $canDo->get('core.edit')){
|
||||
ToolbarHelper::apply('phocagalleryfb.apply', 'JToolbar_APPLY');
|
||||
ToolbarHelper::save('phocagalleryfb.save', 'JToolbar_SAVE');
|
||||
}
|
||||
|
||||
ToolbarHelper::cancel('phocagalleryfb.cancel', 'JToolbar_CLOSE');
|
||||
ToolbarHelper::divider();
|
||||
ToolbarHelper::help( 'screen.phocagallery', true );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,41 @@
|
||||
<?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;
|
||||
//JHtml::_('behavior.tooltip');
|
||||
|
||||
echo '<div id="phocagallery-fba">'. "\n"
|
||||
.'<h4>'.Text::_( 'COM_PHOCAGALLERY_FB_SELECT_ALBUM' ).'</h4>';
|
||||
|
||||
if ($this->userInfo == 1 ){
|
||||
|
||||
echo '<ul>';
|
||||
if(!empty($this->albums)) {
|
||||
foreach ($this->albums as $key => $album) {
|
||||
//.'<a href="#" onclick="if (window.parent) window.parent.'. $this->fce .' (\''. $album['aid'].'\');">'.$album['name'].'</a>'
|
||||
echo '<li class="icon-16-edb-categories">'
|
||||
.'<a href="#" onclick="if (window.parent) window.parent.'. $this->fce .' (\''. $album['id'].'\');">'.$album['name'].'</a>'
|
||||
.'</li>' . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
echo '</ul>'. "\n";
|
||||
} else {
|
||||
echo '<div>'.Text::_('COM_PHOCAGALLERY_FB_SELECT_USER').'</div>';
|
||||
echo '<p> </p>';
|
||||
echo '<div><a style="text-decoration:underline" href="#" onclick="window.parent.closeModal();">'.Text::_('COM_PHOCAGALLERY_CLOSE_WINDOW').'</a></div>';
|
||||
|
||||
}
|
||||
|
||||
echo '</div>'. "\n";
|
||||
|
||||
?>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,82 @@
|
||||
<?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 Component
|
||||
* @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;
|
||||
jimport( 'joomla.application.component.view' );
|
||||
phocagalleryimport( 'phocagallery.facebook.fb' );
|
||||
phocagalleryimport( 'phocagallery.facebook.fbsystem' );
|
||||
|
||||
class PhocaGalleryCpViewphocaGalleryFbA extends HtmlView
|
||||
{
|
||||
protected $r;
|
||||
protected $t;
|
||||
|
||||
function display($tpl = null) {
|
||||
$app = Factory::getApplication();
|
||||
$document = Factory::getDocument();
|
||||
$uri = \Joomla\CMS\Uri\Uri::getInstance();
|
||||
|
||||
$this->t = PhocaGalleryUtils::setVars('fba');
|
||||
$this->r = new PhocaGalleryRenderAdminview();
|
||||
|
||||
|
||||
$this->field = Factory::getApplication()->input->get('field');
|
||||
$this->fce = 'phocaSelectFbAlbum_'.$this->field;
|
||||
|
||||
//$eName = JFactory::getApplication()->input->get('editor');
|
||||
//$eName = preg_replace( '#[^A-Z0-9\-\_\[\]]#i', '', $eName );
|
||||
|
||||
|
||||
|
||||
$uid = Factory::getApplication()->input->get('uid', 0, '', 'int');
|
||||
|
||||
$db = Factory::getDBO();
|
||||
$query = 'SELECT a.*'
|
||||
. ' FROM #__phocagallery_fb_users AS a'
|
||||
. ' WHERE a.published = 1'
|
||||
. ' AND a.id = '.(int)$uid
|
||||
. ' ORDER BY a.ordering';
|
||||
$db->setQuery( $query );
|
||||
$user = $db->loadObject();
|
||||
|
||||
if(!isset($user->uid)) {
|
||||
$this->userInfo = 0;
|
||||
|
||||
} else {
|
||||
|
||||
$session = PhocaGalleryFbSystem::setSessionData($user);
|
||||
$albumN = PhocaGalleryFb::getFbAlbums($user->appid, $user->fanpageid, $user->appsid, $session);
|
||||
|
||||
$albumR = array();
|
||||
$i = 0;
|
||||
if (!empty($albumN)) {
|
||||
foreach($albumN as $k => $v) {
|
||||
if (!empty($v)) {
|
||||
foreach($v as $k2 => $v2) {
|
||||
$albumR[$i]['id'] = $v2['id'];
|
||||
$albumR[$i]['name'] = $v2['name'];
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->albums = $albumR;
|
||||
|
||||
$this->userInfo = 1;
|
||||
}
|
||||
|
||||
//$this->assignRef('tmpl', $t);
|
||||
parent::display($tpl);
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,153 @@
|
||||
<?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;
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Router\Route;
|
||||
|
||||
$task = 'phocagalleryfb';
|
||||
|
||||
$r = $this->r;
|
||||
$app = Factory::getApplication();
|
||||
$option = $app->input->get('option');
|
||||
$tasks = $task . 's';
|
||||
$OPT = strtoupper($option);
|
||||
$user = Factory::getUser();
|
||||
$userId = $user->get('id');
|
||||
$listOrder = $this->escape($this->state->get('list.ordering'));
|
||||
$listDirn = $this->escape($this->state->get('list.direction'));
|
||||
$canOrder = $user->authorise('core.edit.state', $option);
|
||||
$saveOrder = $listOrder == 'a.ordering';
|
||||
$saveOrderingUrl = '';
|
||||
if ($saveOrder && !empty($this->items)) {
|
||||
$saveOrderingUrl = $r->saveOrder($this->t, $listDirn);
|
||||
}
|
||||
$sortFields = $this->getSortFields();
|
||||
|
||||
echo $r->startHeader();
|
||||
echo $r->jsJorderTable($listOrder);
|
||||
|
||||
echo $r->startForm($option, $tasks, 'adminForm');
|
||||
//echo $r->startFilter();
|
||||
//echo $r->endFilter();
|
||||
|
||||
echo $r->startMainContainer();
|
||||
/*
|
||||
echo $r->startFilterBar();
|
||||
echo $r->inputFilterSearch($OPT.'_FILTER_SEARCH_LABEL', $OPT.'_FILTER_SEARCH_DESC',
|
||||
$this->escape($this->state->get('filter.search')));
|
||||
echo $r->inputFilterSearchClear('JSEARCH_FILTER_SUBMIT', 'JSEARCH_FILTER_CLEAR');
|
||||
echo $r->inputFilterSearchLimit('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC', $this->pagination->getLimitBox());
|
||||
echo $r->selectFilterDirection('JFIELD_ORDERING_DESC', 'JGLOBAL_ORDER_ASCENDING', 'JGLOBAL_ORDER_DESCENDING', $listDirn);
|
||||
echo $r->selectFilterSortBy('JGLOBAL_SORT_BY', $sortFields, $listOrder);
|
||||
|
||||
echo $r->startFilterBar(2);
|
||||
echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED', $this->state->get('filter.published'));
|
||||
echo $r->endFilterBar();
|
||||
|
||||
echo $r->endFilterBar();*/
|
||||
|
||||
echo $r->startTable('categoryList');
|
||||
|
||||
echo $r->startTblHeader();
|
||||
|
||||
echo $r->firstColumnHeader($listDirn, $listOrder);
|
||||
echo $r->secondColumnHeader($listDirn, $listOrder);
|
||||
|
||||
echo $r->thOrderingXML('JGRID_HEADING_ORDERING', $listDirn, $listOrder);
|
||||
echo $r->thCheck('JGLOBAL_CHECK_ALL');
|
||||
|
||||
echo '<th class="ph-image">'.Text::_('COM_PHOCAGALLERY_IMAGE').'</th>'."\n";
|
||||
echo '<th class="ph-name">'.HTMLHelper::_('searchtools.sort', $OPT.'_NAME', 'a.name', $listDirn, $listOrder ).'</th>'."\n";
|
||||
echo '<th class="ph-user">'.HTMLHelper::_('searchtools.sort', $OPT.'_FB_USER_ID', 'a.uid', $listDirn, $listOrder ).'</th>'."\n";
|
||||
echo '<th class="ph-user">'.HTMLHelper::_('searchtools.sort', $OPT.'_FB_APP_ID', 'a.appid', $listDirn, $listOrder ).'</th>'."\n";
|
||||
echo '<th class="ph-published">'.HTMLHelper::_('searchtools.sort', $OPT.'_PUBLISHED', 'a.published', $listDirn, $listOrder ).'</th>'."\n";
|
||||
echo '<th class="ph-id">'.HTMLHelper::_('searchtools.sort', $OPT.'_ID', 'a.id', $listDirn, $listOrder ).'</th>'."\n";
|
||||
|
||||
echo $r->endTblHeader();
|
||||
echo $r->startTblBody($saveOrder, $saveOrderingUrl, $listDirn);
|
||||
|
||||
$originalOrders = array();
|
||||
$j = 0;
|
||||
|
||||
if (is_array($this->items)) {
|
||||
foreach ($this->items as $i => $item) {
|
||||
//if ($i >= (int)$this->pagination->limitstart && $j < (int)$this->pagination->limit) {
|
||||
$j++;
|
||||
|
||||
$orderkey = array_search($item->id, $this->ordering[0]);
|
||||
$ordering = ($listOrder == 'a.ordering');
|
||||
$canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out==$user->get('id') || $item->checked_out==0;
|
||||
$canChange = $user->authorise('core.edit.state', $option) && $canCheckin;
|
||||
$linkEdit = Route::_( 'index.php?option=com_phocagallery&task=phocagalleryfb.edit&id='.(int) $item->id );
|
||||
$canCreate = $user->authorise('core.create', 'com_phocagallery');
|
||||
|
||||
echo $r->startTr($i, isset($item->catid) ? (int)$item->catid : 0);
|
||||
echo $r->firstColumn($i, $item->id, $canChange, $saveOrder, $orderkey, $item->ordering);
|
||||
echo $r->secondColumn($i, $item->id, $canChange, $saveOrder, $orderkey, $item->ordering);
|
||||
|
||||
if (isset($item->uid) && $item->uid!= '') {
|
||||
echo '<td><img src="https://graph.facebook.com/'. $item->uid .'/picture"></td>';
|
||||
} else {
|
||||
echo '<td></td>';
|
||||
}
|
||||
|
||||
$checkO = '';
|
||||
if ($item->checked_out) {
|
||||
$checkO .= HTMLHelper::_('jgrid.checkedout', $i, $item->editor, $item->checked_out_time, $tasks.'.', $canCheckin);
|
||||
}
|
||||
|
||||
if ($item->name == ''){
|
||||
$item->name = Text::_('COM_PHOCAGALLERY_NOT_SET_YET');
|
||||
}
|
||||
if ($canCreate || $canEdit) {
|
||||
$name = '<a href="'. Route::_($linkEdit).'">'. $this->escape($item->name).'</a>';
|
||||
} else {
|
||||
$name = $this->escape($item->name);
|
||||
}
|
||||
echo $r->td($checkO . $name, "small");
|
||||
|
||||
if ($item->uid == ''){
|
||||
$item->uid = Text::_('COM_PHOCAGALLERY_NOT_SET_YET');
|
||||
}
|
||||
if ($canCreate || $canEdit) {
|
||||
$uid = '<a href="'. Route::_($linkEdit).'">'. $this->escape($item->uid).'</a>';
|
||||
} else {
|
||||
$uid = $this->escape($item->uid);
|
||||
}
|
||||
echo $r->td($uid, "small");
|
||||
|
||||
if ($canCreate || $canEdit) {
|
||||
$appid = '<a href="'. Route::_($linkEdit).'">'. $this->escape($item->appid).'</a>';
|
||||
} else {
|
||||
$appid = $this->escape($item->appid);
|
||||
}
|
||||
|
||||
echo $r->td($appid, "small");
|
||||
|
||||
echo $r->td(HTMLHelper::_('jgrid.published', $item->published, $i, $tasks.'.', $canChange), "small");
|
||||
echo $r->td($item->id, "small");
|
||||
|
||||
echo $r->endTr();
|
||||
|
||||
//}
|
||||
}
|
||||
}
|
||||
echo $r->endTblBody();
|
||||
|
||||
echo $r->tblFoot($this->pagination->getListFooter(), 15);
|
||||
echo $r->endTable();
|
||||
|
||||
|
||||
echo $r->formInputsXML($listOrder, $listDirn, $originalOrders);
|
||||
echo $r->endMainContainer();
|
||||
echo $r->endForm();
|
||||
?>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,98 @@
|
||||
<?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\Toolbar\ToolbarHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Toolbar\Toolbar;
|
||||
jimport( 'joomla.application.component.view' );
|
||||
|
||||
class PhocaGalleryCpViewPhocaGalleryFbs extends HtmlView
|
||||
{
|
||||
protected $items;
|
||||
protected $pagination;
|
||||
protected $state;
|
||||
protected $r;
|
||||
protected $t;
|
||||
public $filterForm;
|
||||
public $activeFilters;
|
||||
|
||||
|
||||
function display($tpl = null) {
|
||||
|
||||
$this->items = $this->get('Items');
|
||||
$this->pagination = $this->get('Pagination');
|
||||
$this->state = $this->get('State');
|
||||
$this->filterForm = $this->get('FilterForm');
|
||||
$this->activeFilters = $this->get('ActiveFilters');
|
||||
|
||||
$this->r = new PhocaGalleryRenderAdminViews();
|
||||
$this->t = PhocaGalleryUtils::setVars('fb');
|
||||
|
||||
foreach ($this->items as &$item) {
|
||||
$this->ordering[0][] = $item->id;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Check for errors.
|
||||
if (count($errors = $this->get('Errors'))) {
|
||||
throw new Exception(implode("\n", $errors), 500);
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->addToolbar();
|
||||
parent::display($tpl);
|
||||
|
||||
}
|
||||
|
||||
|
||||
function addToolbar() {
|
||||
|
||||
require_once JPATH_COMPONENT.'/helpers/phocagalleryfbs.php';
|
||||
|
||||
$state = $this->get('State');
|
||||
$canDo = phocagalleryfbsHelper::getActions();
|
||||
|
||||
ToolbarHelper::title( Text::_( 'COM_PHOCAGALLERY_FB_USERS' ), 'user' );
|
||||
|
||||
if ($canDo->get('core.create')) {
|
||||
ToolbarHelper::addNew( 'phocagalleryfb.add','JToolbar_NEW');
|
||||
}
|
||||
if ($canDo->get('core.edit')) {
|
||||
ToolbarHelper::editList('phocagalleryfb.edit','JToolbar_EDIT');
|
||||
}
|
||||
if ($canDo->get('core.edit.state')) {
|
||||
|
||||
ToolbarHelper::divider();
|
||||
ToolbarHelper::custom('phocagalleryfbs.publish', 'publish.png', 'publish_f2.png','JToolbar_PUBLISH', true);
|
||||
ToolbarHelper::custom('phocagalleryfbs.unpublish', 'unpublish.png', 'unpublish_f2.png', 'JToolbar_UNPUBLISH', true);
|
||||
}
|
||||
|
||||
if ($canDo->get('core.delete')) {
|
||||
ToolbarHelper::deleteList( Text::_( 'COM_PHOCAGALLERY_WARNING_DELETE_ITEMS' ), 'phocagalleryfbs.delete', 'COM_PHOCAGALLERY_DELETE');
|
||||
}
|
||||
ToolbarHelper::divider();
|
||||
ToolbarHelper::help( 'screen.phocagallery', true );
|
||||
}
|
||||
|
||||
protected function getSortFields() {
|
||||
return array(
|
||||
'a.ordering' => Text::_('COM_PHOCAGALLERY_ORDERING'),
|
||||
'a.name' => Text::_('COM_PHOCAGALLERY_NAME'),
|
||||
'a.uid' => Text::_('COM_PHOCAGALLERY_FB_USER_ID'),
|
||||
'a.appid' => Text::_('COM_PHOCAGALLERY_FB_APP_ID'),
|
||||
'a.published' => Text::_('COM_PHOCAGALLERY_PUBLISHED'),
|
||||
'a.id' => Text::_('JGRID_HEADING_ID')
|
||||
);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,22 @@
|
||||
<?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');
|
||||
|
||||
|
||||
|
||||
echo '<div>';
|
||||
|
||||
echo '<div class="alert alert-error alert-danger">'.$this->t['errormessage'].'</div>';
|
||||
echo '</div>';
|
||||
?>
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,71 @@
|
||||
<?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\HTML\Helpers\Sidebar;
|
||||
use Joomla\CMS\MVC\View\HtmlView;
|
||||
use Joomla\CMS\Component\ComponentHelper;
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Toolbar\ToolbarHelper;
|
||||
use Joomla\CMS\Toolbar\Toolbar;
|
||||
jimport( 'joomla.application.component.view' );
|
||||
phocagalleryimport( 'phocagallery.render.renderinfo' );
|
||||
phocagalleryimport( 'phocagallery.utils.utils' );
|
||||
|
||||
class PhocaGalleryCpViewPhocaGalleryFe extends HtmlView
|
||||
{
|
||||
protected $t;
|
||||
protected $r;
|
||||
public function display($tpl = null) {
|
||||
|
||||
|
||||
$params = ComponentHelper::getParams('com_phocagallery');
|
||||
|
||||
$this->t = PhocaGalleryUtils::setVars('fe');
|
||||
$this->r = new PhocaGalleryRenderAdminview();
|
||||
|
||||
$this->sidebar = Sidebar::render();
|
||||
|
||||
HTMLHelper::stylesheet( 'media/com_phocagallery/css/administrator/phocagallery.css' );
|
||||
$app = Factory::getApplication();
|
||||
|
||||
$this->t['error'] = $app->input->get('error');
|
||||
switch ($this->t['error']) {
|
||||
case 1:
|
||||
$this->t['errormessage'] = Text::_('COM_PHOCAGALLERY_ERROR_1_MEMORY');
|
||||
break;
|
||||
|
||||
default:
|
||||
$this->t['errormessage'] = Text::_('COM_PHOCAGALLERY_ERROR_1_MEMORY');//TO DO
|
||||
break;
|
||||
}
|
||||
$this->addToolbar();
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
|
||||
protected function addToolBar(){
|
||||
require_once JPATH_COMPONENT.'/helpers/phocagallerycp.php';
|
||||
$canDo = PhocaGalleryCpHelper::getActions(NULL);
|
||||
ToolbarHelper::title(Text::_('COM_PHOCAGALLERY_PG_ERROR'), 'warning');
|
||||
|
||||
// This button is unnecessary but it is displayed because Joomla! design bug
|
||||
$bar = Toolbar::getInstance( 'toolbar' );
|
||||
$dhtml = '<a href="index.php?option=com_phocagallery" class="btn btn-primary btn-small"><i class="icon-home-2" title="'.Text::_('COM_PHOCAGALLERY_CONTROL_PANEL').'"></i> '.Text::_('COM_PHOCAGALLERY_CONTROL_PANEL').'</a>';
|
||||
$bar->appendButton('Custom', $dhtml);
|
||||
|
||||
if ($canDo->get('core.admin')) {
|
||||
ToolbarHelper::preferences('com_phocagallery');
|
||||
}
|
||||
ToolbarHelper::help( 'screen.phocagallery', true );
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,59 @@
|
||||
<?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;
|
||||
use Joomla\CMS\Factory;
|
||||
phocagalleryimport('phocagallery.render.rendermap');
|
||||
|
||||
|
||||
$map = new PhocaGalleryRenderMap();
|
||||
echo $map->loadApi();
|
||||
echo '<noscript>'.Text::_('COM_PHOCAGALLERY_GOOGLE_MAPS_ENABLE_JS').'</noscript>';
|
||||
echo '<div align="center" style="margin:0;padding:0;text-align: center;">';
|
||||
echo '<div id="phocaMap" style="margin:0 auto;padding:0;width:520px;height:460px;"></div></div>';
|
||||
|
||||
$document = Factory::getDocument();
|
||||
$document->addCustomTag( "<style type=\"text/css\"> \n"
|
||||
. '#phocaMap img {
|
||||
max-width: none;
|
||||
}'
|
||||
." </style> \n");
|
||||
|
||||
|
||||
//echo $map->loadApi();
|
||||
?><script type='text/javascript'>//<![CDATA[
|
||||
<?php
|
||||
|
||||
echo $map->createMap('phocaMap', 'mapPhocaMap', 'phocaLatLng', 'phocaOptions','tstPhocaMap', 'tstIntPhocaMap');
|
||||
echo $map->cancelEventF();
|
||||
echo $map->checkMapF();
|
||||
|
||||
|
||||
echo $map->startMapF();
|
||||
echo $map->setLatLng( $this->latitude, $this->longitude );
|
||||
echo $map->startOptions();
|
||||
echo $map->setZoomOpt($this->zoom).','."\n";
|
||||
echo $map->setCenterOpt().','."\n";
|
||||
echo $map->setTypeControlOpt().','."\n";
|
||||
echo $map->setNavigationControlOpt().','."\n";
|
||||
echo $map->setScaleControlOpt(1).','."\n";
|
||||
echo $map->setScrollWheelOpt(1).','."\n";
|
||||
echo $map->setDisableDoubleClickZoomOpt(0).','."\n";
|
||||
echo $map->setMapTypeOpt()."\n";
|
||||
echo $map->endOptions();
|
||||
echo $map->setMap();
|
||||
echo $map->exportZoom($this->zoom, '', 'phocaSelectMap_jform_zoom');
|
||||
echo $map->exportMarker(1, $this->latitude, $this->longitude, '', '', 'phocaSelectMap_jform_latitude', 'phocaSelectMap_jform_longitude');
|
||||
echo $map->setListener();
|
||||
echo $map->endMapF();
|
||||
echo $map->setInitializeF();
|
||||
?>//]]></script>
|
||||
<?php echo $map->loadApi(); ?>
|
||||
@ -0,0 +1,45 @@
|
||||
<?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');
|
||||
|
||||
$id = uniqid();
|
||||
$map = new PhocaGalleryRenderMaposm($id);
|
||||
$map->loadAPI();
|
||||
if ($this->type == 'marker') {
|
||||
$map->loadCoordinatesJS();
|
||||
}
|
||||
|
||||
|
||||
$map->createMap($this->latitude, $this->longitude, $this->zoom);
|
||||
$map->setMapType();
|
||||
$map->setMarker($id, '', '', $this->latitude, $this->longitude);
|
||||
|
||||
// Export, Move, Input, renderSearch are dependent
|
||||
$map->moveMarker();
|
||||
if ($this->type == 'marker') {
|
||||
$map->inputMarker('jform_latitude_id', 'jform_longitude_id', '', 1);
|
||||
} else {
|
||||
$map->inputMarker('jform_latitude_id', 'jform_longitude_id', 'jform_zoom_id', 0);
|
||||
}
|
||||
$map->exportMarker($id);
|
||||
$map->renderSearch($id);
|
||||
|
||||
$map->renderFullScreenControl();
|
||||
$map->renderCurrentPosition();
|
||||
|
||||
$map->renderMap();
|
||||
|
||||
echo '<div id="phocamaps" style="margin:0;padding:0;">';
|
||||
echo '<div align="center" style="margin:0;padding:0">';
|
||||
echo '<div id="phocaGalleryMap'.$id.'" style="margin:0;padding:0;width:100%;height:97vh"></div></div>';
|
||||
|
||||
|
||||
|
||||
echo '</div>';
|
||||
?>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,58 @@
|
||||
<?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;
|
||||
jimport( 'joomla.application.component.view');
|
||||
phocagalleryimport('phocagallery.render.rendermaposm');
|
||||
|
||||
class PhocaGalleryCpViewPhocagalleryG extends HtmlView
|
||||
{
|
||||
protected $latitude;
|
||||
protected $longitude;
|
||||
protected $zoom;
|
||||
protected $map_type;
|
||||
protected $type;
|
||||
protected $r;
|
||||
protected $t;
|
||||
|
||||
public function display($tpl = null) {
|
||||
|
||||
$app = Factory::getApplication();
|
||||
|
||||
$this->t = PhocaGalleryUtils::setVars('g');
|
||||
$this->r = new PhocaGalleryRenderAdminview();
|
||||
|
||||
$params = ComponentHelper::getParams( 'com_phocagallery' );
|
||||
$this->latitude = $app->input->get( 'lat', '50.079623358200884', 'get', 'string' );
|
||||
$this->longitude = $app->input->get( 'lng', '14.429919719696045', 'get', 'string' );
|
||||
$this->zoom = $app->input->get( 'zoom', '2', 'get', 'string' );
|
||||
$this->map_type = $params->get( 'map_type', 2 );
|
||||
|
||||
$this->type = 'map';
|
||||
|
||||
$document = Factory::getDocument();
|
||||
$document->addCustomTag( "<style type=\"text/css\"> \n"
|
||||
." html,body, .contentpane{overflow:hidden;background:#ffffff;} \n"
|
||||
." </style> \n");
|
||||
|
||||
|
||||
|
||||
|
||||
if ($this->map_type == 2) {
|
||||
parent::display('osm');
|
||||
} else {
|
||||
parent::display($tpl);
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,146 @@
|
||||
<?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;
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
|
||||
$r = $this->r;
|
||||
echo '<div class="ph-item-list-box ph-item-list-box-admin">';
|
||||
echo $this->loadTemplate('up');
|
||||
if (count($this->images) > 0 || count($this->folders) > 0) {
|
||||
for ($i=0,$n=count($this->folders); $i<$n; $i++) {
|
||||
$this->setFolder($i);
|
||||
echo $this->loadTemplate('folder');
|
||||
}
|
||||
for ($i=0,$n=count($this->images); $i<$n; $i++) {
|
||||
$this->setImage($i);
|
||||
echo $this->loadTemplate('image');
|
||||
}
|
||||
} else {
|
||||
echo '<div class="ph-item-list-box-head">'.Text::_( 'COM_PHOCAGALLERY_THERE_IS_NO_IMAGE' ).'</div>';
|
||||
}
|
||||
|
||||
echo '</div>';
|
||||
|
||||
echo '<div class="ph-item-list-box-hr"></div>';
|
||||
|
||||
|
||||
if ($this->t['displaytabs'] > 0) {
|
||||
|
||||
/*echo '<ul class="nav nav-tabs" id="configTabs">';
|
||||
|
||||
$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((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>';
|
||||
}
|
||||
|
||||
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'] = '<span class="ph-cp-item"><i class="phi phi-fs-s phi-fc-bl duotone icon-upload"></i></span>' . ' '.Text::_('COM_PHOCAGALLERY_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_PHOCAGALLERY_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_PHOCAGALLERY_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_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();
|
||||
|
||||
if (!empty($this->t['javaupload'])) {
|
||||
echo $r->startTab('javaupload', $tabs['javaupload'], $activeTab == 'javaupload' ? 'active' : '');
|
||||
echo $this->loadTemplate('javaupload');
|
||||
echo $r->endTab();
|
||||
}
|
||||
|
||||
echo $r->startTab('createfolder', $tabs['createfolder'], $activeTab == 'createfolder' ? 'active' : '');
|
||||
echo '<div id="phocagallery-multipleupload" class="ph-in">';
|
||||
echo PhocaGalleryFileUpload::renderCreateFolder($this->session->getName(), $this->session->getId(), $this->currentFolder, 'phocagalleryi', 'tab=createfolder&field='.PhocaGalleryText::filterValue($this->field, 'alphanumeric2'));
|
||||
echo '</div>';
|
||||
echo $r->endTab();
|
||||
|
||||
echo $r->endTabs();
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
/*
|
||||
if ($this->t['displaytabs'] > 0) {
|
||||
echo '<div id="phocagallery-pane">';
|
||||
//$pane =& J Pane::getInstance('Tabs', array('startOffset'=> $this->t['tab']));
|
||||
echo HTMLHelper::_('tabs.start', 'config-tabs-com_phocagallery-i', array('useCookie'=>1, 'startOffset'=> $this->t['tab']));
|
||||
//echo $pane->startPane( 'pane' );
|
||||
|
||||
//echo $pane->startPanel( JHtml::_( 'image', 'media/com_phocagallery/images/administrator/icon-16-upload.png','') . ' '.JText::_('COM_PHOCAGALLERY_UPLOAD'), 'upload' );
|
||||
echo HTMLHelper::_('tabs.panel', HTMLHelper::_( 'image', 'media/com_phocagallery/images/administrator/icon-16-upload.png','') . ' '.Text::_('COM_PHOCAGALLERY_UPLOAD'), 'upload' );
|
||||
echo $this->loadTemplate('upload');
|
||||
//echo $pane->endPanel();
|
||||
|
||||
if((int)$this->t['enablemultiple'] >= 0) {
|
||||
//echo $pane->startPanel( JHtml::_( 'image', 'media/com_phocagallery/images/administrator/icon-16-upload-multiple.png','') . ' '.JText::_('COM_PHOCAGALLERY_MULTIPLE_UPLOAD'), 'multipleupload' );
|
||||
echo HTMLHelper::_('tabs.panel', HTMLHelper::_( 'image', 'media/com_phocagallery/images/administrator/icon-16-upload-multiple.png','') . ' '.Text::_('COM_PHOCAGALLERY_MULTIPLE_UPLOAD'), 'multipleupload' );
|
||||
echo $this->loadTemplate('multipleupload');
|
||||
//echo $pane->endPanel();
|
||||
}
|
||||
|
||||
if($this->t['enablejava'] >= 0) {
|
||||
//echo $pane->startPanel( JHtml::_( 'image', 'media/com_phocagallery/images/administrator/icon-16-upload-java.png','') . ' '.JText::_('COM_PHOCAGALLERY_JAVA_UPLOAD'), 'javaupload' );
|
||||
echo HTMLHelper::_('tabs.panel', HTMLHelper::_( 'image', 'media/com_phocagallery/images/administrator/icon-16-upload-java.png','') . ' '.Text::_('COM_PHOCAGALLERY_JAVA_UPLOAD'), 'javaupload' );
|
||||
echo $this->loadTemplate('javaupload');
|
||||
//echo $pane->endPanel();
|
||||
}
|
||||
|
||||
//echo $pane->endPane();
|
||||
echo HTMLHelper::_('tabs.end');
|
||||
echo '</div>';// end phocagallery-pane
|
||||
}
|
||||
*/
|
||||
|
||||
//TEMP
|
||||
//$this->t['tab'] = 'multipleupload';
|
||||
/*if ($this->t['tab'] != '') {$jsCt = 'a[href=#'.PhocaGalleryText::filterValue($this->t['tab'], 'alphanumeric2') .']';} else {$jsCt = 'a:first';}
|
||||
echo '<script type="text/javascript">';
|
||||
echo ' jQuery(\'#configTabs '.$jsCt.'\').tab(\'show\');'; // Select first tab
|
||||
echo '</script>';*/
|
||||
?>
|
||||
@ -0,0 +1,21 @@
|
||||
<?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'); ?>
|
||||
|
||||
<div class="ph-item-box">
|
||||
<div class="ph-item-image"><a href="index.php?option=com_phocagallery&view=phocagalleryi&tmpl=component&folder=<?php echo $this->_tmp_folder->path_with_name_relative_no . '&field='.$this->field; ?>"><span class="ph-cp-item"><i class="phi duotone phi-fs-l phi-fc-brd icon-folder-close"></i></span></a></div>
|
||||
|
||||
<div class="ph-item-name"><a href="index.php?option=com_phocagallery&view=phocagalleryi&tmpl=component&folder=<?php echo $this->_tmp_folder->path_with_name_relative_no . '&field='.$this->field; ?>"><span><?php echo PhocagalleryText::WordDelete($this->_tmp_folder->name, 15); ?></span></a></div>
|
||||
|
||||
<div class="ph-item-action-box"></div>
|
||||
</div>
|
||||
|
||||
|
||||
@ -0,0 +1,62 @@
|
||||
<?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\Filesystem\File;
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
jimport( 'joomla.filesystem.file' );
|
||||
$image['width'] = $image['height'] = 100;
|
||||
|
||||
if (File::exists( $this->_tmp_img->linkthumbnailpathabs )) {
|
||||
list($width, $height) = GetImageSize( $this->_tmp_img->linkthumbnailpathabs );
|
||||
$image = PhocaGalleryImage::correctSizeWithRate($width, $height);
|
||||
}
|
||||
/*
|
||||
?><div class="phocagallery-box-file-i">
|
||||
<center>
|
||||
<div class="phocagallery-box-file-first-i">
|
||||
<div class="phocagallery-box-file-second">
|
||||
<div class="phocagallery-box-file-third">
|
||||
<center>
|
||||
<a href="#" onclick="if (window.parent) window.parent.<?php echo $this->fce; ?>('<?php echo $this->_tmp_img->nameno; ?>');">
|
||||
<?php
|
||||
|
||||
$imageRes = PhocaGalleryImage::getRealImageSize($this->_tmp_img->nameno, 'medium');
|
||||
$correctImageRes = PhocaGalleryImage::correctSizeWithRate($imageRes['w'], $imageRes['h'], 100, 100);
|
||||
echo HTMLHelper::_( 'image', $this->_tmp_img->linkthumbnailpath, '', array('width' => $image['width'], 'height' => $image['height']), '', null); ?></a>
|
||||
</center>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</center>
|
||||
|
||||
<div class="name"><?php echo $this->_tmp_img->name; ?></div>
|
||||
<div class="detail" style="text-align:right">
|
||||
<a href="#" onclick="if (window.parent) window.parent.<?php echo $this->fce; ?>('<?php echo $this->_tmp_img->nameno; ?>');"><?php echo HTMLHelper::_( 'image', 'media/com_phocagallery/images/administrator/icon-insert.gif', Text::_('COM_PHOCAGALLERY_INSERT_IMAGE'), array('title' => Text::_('COM_PHOCAGALLERY_INSERT_IMAGE'))); ?></a>
|
||||
</div>
|
||||
<div style="clear:both"></div>
|
||||
</div>
|
||||
*/
|
||||
|
||||
?><div class="ph-item-box">
|
||||
<div class="ph-item-image"><a title="<?php echo $this->_tmp_img->name ?>" href="#" onclick="if (window.parent) window.parent.<?php echo $this->fce; ?>('<?php echo $this->_tmp_img->nameno; ?>');"><?php
|
||||
|
||||
$imageRes = PhocaGalleryImage::getRealImageSize($this->_tmp_img->nameno, 'medium');
|
||||
$correctImageRes = PhocaGalleryImage::correctSizeWithRate($imageRes['w'], $imageRes['h'], 100, 100);
|
||||
echo HTMLHelper::_( 'image', $this->_tmp_img->linkthumbnailpath, '', array('width' => $image['width'], 'height' => $image['height']), '', null);
|
||||
|
||||
?></a></div>
|
||||
|
||||
<div class="ph-item-name" title="<?php echo $this->_tmp_img->name ?>"><?php echo PhocagalleryText::WordDelete($this->_tmp_img->name, 15); ?></div>
|
||||
|
||||
<div class="ph-item-action-box">
|
||||
<a href="#" onclick="if (window.parent) window.parent.<?php echo $this->fce; ?>('<?php echo $this->_tmp_img->nameno; ?>');" title="<?php echo Text::_('COM_PHOCAGALLERY_INSERT_IMAGE') ?>"><span class="ph-cp-item"><i class="phi duotone phi-fs-m phi-fc-gd icon-download"></i></span></a></div>
|
||||
</div>
|
||||
@ -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,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;
|
||||
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' ).' [ '. Text::_( 'COM_PHOCAGALLERY_MAX_SIZE' ).': '.$this->t['uploadmaxsizeread'].','
|
||||
.' '.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,21 @@
|
||||
<?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'); ?>
|
||||
|
||||
|
||||
|
||||
<div class="ph-item-box">
|
||||
<div class="ph-item-image"><a href="index.php?option=com_phocagallery&view=phocagalleryi&tmpl=component&folder=<?php echo PhocaGalleryText::filterValue($this->folderstate->parent, 'folderpath'); ?>&field=<?php echo htmlspecialchars($this->field); ?>" ><span class="ph-cp-item"><i class="phi duotone phi-fs-l phi-fc-bl icon-arrow-up"></i></span></a></div>
|
||||
|
||||
<div class="ph-item-name"><a href="index.php?option=com_phocagallery&view=phocagalleryf&tmpl=component&folder=<?php echo PhocaGalleryText::filterValue($this->folderstate->parent, 'folderpath'); ?>&field=<?php echo htmlspecialchars($this->field); ?>" >..</a></div>
|
||||
|
||||
<div class="ph-item-action-box"></div>
|
||||
</div>
|
||||
@ -0,0 +1,23 @@
|
||||
<?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' ).' [ '. 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['su_output'];
|
||||
echo '</form>';
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
?>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,213 @@
|
||||
<?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\Object\CMSObject;
|
||||
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 PhocaGalleryCpViewPhocagalleryI extends HtmlView
|
||||
{
|
||||
protected $field;
|
||||
protected $fce;
|
||||
protected $folderstate;
|
||||
protected $images;
|
||||
protected $folders;
|
||||
protected $t;
|
||||
protected $r;
|
||||
protected $session;
|
||||
protected $currentFolder;
|
||||
|
||||
public function display($tpl = null) {
|
||||
|
||||
$this->field = Factory::getApplication()->input->get('field');
|
||||
$this->fce = 'phocaSelectFileName_'.$this->field;
|
||||
|
||||
|
||||
$this->t = PhocaGalleryUtils::setVars('i');
|
||||
$this->r = new PhocaGalleryRenderAdminView();
|
||||
$this->folderstate = $this->get('FolderState');
|
||||
$this->images = $this->get('Images');
|
||||
$this->folders = $this->get('Folders');
|
||||
$this->session = Factory::getSession();
|
||||
|
||||
$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;
|
||||
|
||||
|
||||
// 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']++;
|
||||
}
|
||||
|
||||
// MULTIPLE UPLOAD
|
||||
if($this->t['enablejava'] >= 0) {
|
||||
$this->t['currenttab']['javaupload'] = $this->t['displaytabs'];
|
||||
$this->t['displaytabs']++;
|
||||
}
|
||||
|
||||
// - - - - - - - - - - -
|
||||
// Upload
|
||||
// - - - - - - - - - - -
|
||||
$sU = new PhocaGalleryFileUploadSingle();
|
||||
$sU->returnUrl = 'index.php?option=com_phocagallery&view=phocagalleryi&tab=upload&tmpl=component&field='.$this->field.'&folder='. $this->currentFolder;
|
||||
$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=phocagalleryi&field='.$this->field.'&'
|
||||
.'folder='. $this->currentFolder.'&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&field='.$this->field.'&folder='. $this->currentFolder;
|
||||
$mU->reload = Uri::base().'index.php?option=com_phocagallery&view=phocagalleryi&tmpl=component&'
|
||||
.$this->session->getName().'='.$this->session->getId().'&'
|
||||
. Session::getFormToken().'=1&tab=multipleupload&'
|
||||
.'field='.$this->field.'&folder='. $this->currentFolder;
|
||||
$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=phocagalleryi&tmpl=component&tab=javaupload&'
|
||||
.'field='.$this->field.'&folder='. $this->currentFolder;
|
||||
$jU->url = Uri::base().'index.php?option=com_phocagallery&task=phocagalleryu.javaupload&'
|
||||
.$this->session->getName().'='.$this->session->getId().'&'
|
||||
. Session::getFormToken().'=1&viewback=phocagalleryi&tab=javaupload'
|
||||
.'&field='.$this->field.'&folder='. $this->currentFolder;
|
||||
$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');
|
||||
|
||||
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 setImage($index = 0) {
|
||||
if (isset($this->images[$index])) {
|
||||
$this->_tmp_img = &$this->images[$index];
|
||||
} else {
|
||||
$this->_tmp_img = new CMSObject;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,233 @@
|
||||
<?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;
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Filesystem\File;
|
||||
use Joomla\CMS\Uri\Uri;
|
||||
|
||||
$task = 'phocagalleryimg';
|
||||
|
||||
//JHtml::_('behavior.tooltip');
|
||||
//JHtml::_('behavior.formvalidation');
|
||||
//JHtml::_('behavior.keepalive');
|
||||
//JHtml::_('formbehavior.chosen', 'select');
|
||||
|
||||
$r = $this->r;
|
||||
$app = Factory::getApplication();
|
||||
$option = $app->input->get('option');
|
||||
$OPT = strtoupper($option);
|
||||
|
||||
/*
|
||||
<script type="text/javascript">
|
||||
Joomla.submitbutton = function(task){
|
||||
if (task != 'phocagalleryimg.cancel' && document.getElementById('jform_catid').value == '') {
|
||||
alert('<?php echo $this->escape(Text::_('JGLOBAL_VALIDATION_FORM_FAILED')) . ' - '. $this->escape(Text::_('COM_PHOCAGALLERY_CATEGORY_NOT_SELECTED'));?>');
|
||||
} else if (task == 'phocagalleryimg.cancel' || document.formvalidator.isValid(document.getElementById('adminForm'))) {
|
||||
<?php //echo $this->form->getField('description')->save(); ?>
|
||||
Joomla.submitform(task, document.getElementById('adminForm'));
|
||||
}
|
||||
else {
|
||||
<?php /* Joomla.renderMessages({"error": ["<?php echo JText::_('JGLOBAL_VALIDATION_FORM_FAILED', true);?>"]});
|
||||
//alert('<?php echo JText::_('JGLOBAL_VALIDATION_FORM_FAILED', true);?>'); *//* ?>
|
||||
|
||||
// special case for modal popups validation response
|
||||
jQuery('#adminForm .modal-value.invalid').each(function(){
|
||||
|
||||
var field = jQuery(this),
|
||||
idReversed = field.attr('id').split('').reverse().join(''),
|
||||
separatorLocation = idReversed.indexOf('_'),
|
||||
nameId = '#' + idReversed.substr(separatorLocation).split('').reverse().join('') + 'name';
|
||||
alert(nameId);
|
||||
jQuery(nameId).addClass('invalid');
|
||||
});
|
||||
return false;
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
*/
|
||||
|
||||
|
||||
Factory::getDocument()->addScriptDeclaration(
|
||||
|
||||
'Joomla.submitbutton = function(task) {
|
||||
if (task != "'. $this->t['task'].'.cancel" && document.getElementById("jform_catid").value == "") {
|
||||
alert("'. Text::_('JGLOBAL_VALIDATION_FORM_FAILED', true) . ' - '. Text::_('COM_PHOCAGALLERY_CATEGORY_NOT_SELECTED', true).'");
|
||||
} else if (task == "'. $this->t['task'].'.cancel" || document.formvalidator.isValid(document.getElementById("adminForm"))) {
|
||||
Joomla.submitform(task, document.getElementById("adminForm"));
|
||||
} else {
|
||||
|
||||
// special case for modal popups validation response
|
||||
jQuery("#adminForm .modal-value.invalid").each(function(){
|
||||
|
||||
var field = jQuery(this),
|
||||
idReversed = field.attr("id").split("").reverse().join(""),
|
||||
separatorLocation = idReversed.indexOf("_"),
|
||||
nameId = "#" + idReversed.substr(separatorLocation).split("").reverse().join("") + "name";
|
||||
jQuery(nameId).addClass("invalid");
|
||||
});
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}'
|
||||
|
||||
);
|
||||
|
||||
echo $r->startHeader();
|
||||
echo $r->startForm($option, $task, $this->item->id, 'adminForm', 'adminForm');
|
||||
// First Column
|
||||
//echo '<div class="span12 form-horizontal">';
|
||||
echo '<div>';
|
||||
$tabs = array (
|
||||
'general' => Text::_($OPT.'_GENERAL_OPTIONS'),
|
||||
'publishing' => Text::_($OPT.'_PUBLISHING_OPTIONS'),
|
||||
'geo' => Text::_($OPT.'_GEO_OPTIONS'),
|
||||
'external' => Text::_($OPT.'_EXTERNAL_LINK_OPTIONS'),
|
||||
'metadata' => Text::_($OPT.'_METADATA_OPTIONS'));
|
||||
echo $r->navigation($tabs);
|
||||
|
||||
// Header
|
||||
// - - - - - - - - - -
|
||||
// Image
|
||||
|
||||
$fileOriginal = PhocaGalleryFile::getFileOriginal($this->item->filename);
|
||||
if (!File::exists($fileOriginal)) {
|
||||
$this->item->fileoriginalexist = 0;
|
||||
} else {
|
||||
$fileThumb = PhocaGalleryFileThumbnail::getOrCreateThumbnail($this->item->filename, '', 0, 0, 0);
|
||||
$this->item->linkthumbnailpath = $fileThumb['thumb_name_m_no_rel'];
|
||||
$this->item->fileoriginalexist = 1;
|
||||
}
|
||||
|
||||
$image = '';
|
||||
if (isset($this->item->extid) && $this->item->extid !='') {
|
||||
|
||||
$resW = explode(',', $this->item->extw);
|
||||
$resH = explode(',', $this->item->exth);
|
||||
$correctImageRes = PhocaGalleryImage::correctSizeWithRate($resW[2], $resH[2], 100, 100);
|
||||
$imgLink = $this->item->extl;
|
||||
|
||||
$image = '<img class="img-polaroid" src="'.$this->item->exts.'" width="'.$correctImageRes['width'].'" height="'.$correctImageRes['height'].'" alt="" />';
|
||||
|
||||
} else if (isset ($this->item->fileoriginalexist) && $this->item->fileoriginalexist == 1) {
|
||||
|
||||
$imageRes = PhocaGalleryImage::getRealImageSize($this->item->filename, 'medium');
|
||||
//$correctImageRes = PhocaGalleryImage::correctSizeWithRate($imageRes['w'], $imageRes['h'], 100, 100);
|
||||
$imgLink = PhocaGalleryFileThumbnail::getThumbnailName($this->item->filename, 'large');
|
||||
// TO DO check the image
|
||||
|
||||
$image = '<img class="img-polaroid" style="max-width:100px;" src="'.Uri::root().$this->item->linkthumbnailpath.'?imagesid='.md5(uniqid(time())).'" alt="" />'
|
||||
.'</a>';
|
||||
}
|
||||
$formArray = array ('title', 'alias');
|
||||
echo $r->groupHeader($this->form, $formArray, $image);
|
||||
|
||||
echo $r->startTabs();
|
||||
|
||||
echo $r->startTab('general', $tabs['general'], 'active');
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
echo '<div class="ph-float-right ph-admin-additional-box">';
|
||||
// PICASA
|
||||
if (isset($this->item->extid) && $this->item->extid !='') {
|
||||
|
||||
$resW = explode(',', $this->item->extw);
|
||||
$resH = explode(',', $this->item->exth);
|
||||
$correctImageRes = PhocaGalleryImage::correctSizeWithRate($resW[2], $resH[2], 100, 100);
|
||||
$imgLink = $this->item->extl;
|
||||
|
||||
echo '<img class="img-polaroid" src="'.$this->item->exts.'" width="'.$correctImageRes['width'].'" height="'.$correctImageRes['height'].'" alt="" />';
|
||||
|
||||
} else if (isset ($this->item->fileoriginalexist) && $this->item->fileoriginalexist == 1) {
|
||||
|
||||
$imageRes = PhocaGalleryImage::getRealImageSize($this->item->filename, 'medium');
|
||||
//$correctImageRes = PhocaGalleryImage::correctSizeWithRate($imageRes['w'], $imageRes['h'], 100, 100);
|
||||
$imgLink = PhocaGalleryFileThumbnail::getThumbnailName($this->item->filename, 'large');
|
||||
// TO DO check the image
|
||||
|
||||
echo '<img class="img-polaroid" style="max-width:100px;" src="'.Uri::root().$this->item->linkthumbnailpath.'?imagesid='.md5(uniqid(time())).'" alt="" />'
|
||||
.'</a>';
|
||||
} else {
|
||||
|
||||
}
|
||||
echo '</div>';
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
$formArray = array ('catid', 'ordering', 'filename', 'videocode', 'pcproductid');
|
||||
echo $r->group($this->form, $formArray);
|
||||
|
||||
echo $this->form->getInput('extid');
|
||||
|
||||
$formArray = array('description');
|
||||
echo $r->group($this->form, $formArray, 1);
|
||||
|
||||
|
||||
|
||||
|
||||
echo $r->endTab();
|
||||
|
||||
echo $r->startTab('publishing', $tabs['publishing']);
|
||||
foreach($this->form->getFieldset('publish') as $field) {
|
||||
echo '<div class="control-group">';
|
||||
if (!$field->hidden) {
|
||||
echo '<div class="control-label">'.$field->label.'</div>';
|
||||
}
|
||||
echo '<div class="controls">';
|
||||
echo $field->input;
|
||||
echo '</div></div>';
|
||||
}
|
||||
echo $r->endTab();
|
||||
|
||||
echo $r->startTab('geo', $tabs['geo']);
|
||||
$formArray = array ('latitude', 'longitude', 'zoom', 'geotitle');
|
||||
echo $r->group($this->form, $formArray);
|
||||
echo $r->endTab();
|
||||
|
||||
echo $r->startTab('external', $tabs['external']);
|
||||
echo '<div class="clearfix"></div>'. "\n";
|
||||
echo '<h3>'.Text::_('COM_PHOCAGALLERY_EXTERNAL_LINKS1').'</h3>'."\n";
|
||||
$formArray = array ('extlink1link', 'extlink1title', 'extlink1target', 'extlink1icon');
|
||||
echo $r->group($this->form, $formArray);
|
||||
|
||||
echo '<div class="clearfix"></div>'. "\n";
|
||||
echo '<h3>'.Text::_('COM_PHOCAGALLERY_EXTERNAL_LINKS2').'</h3>'."\n";
|
||||
$formArray = array ('extlink2link', 'extlink2title', 'extlink2target', 'extlink2icon');
|
||||
echo $r->group($this->form, $formArray);
|
||||
echo $r->endTab();
|
||||
|
||||
|
||||
echo $r->startTab('metadata', $tabs['metadata']);
|
||||
echo $this->loadTemplate('metadata');
|
||||
echo $r->endTab();
|
||||
|
||||
|
||||
//echo '</div>';//end span10
|
||||
// Second Column
|
||||
//echo '<div class="span2">';
|
||||
|
||||
|
||||
|
||||
|
||||
echo $r->endTabs();
|
||||
echo '</div>';
|
||||
|
||||
echo $r->formInputs($this->t['task']);
|
||||
echo $r->endForm();
|
||||
?>
|
||||
@ -0,0 +1,38 @@
|
||||
<?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;
|
||||
use Joomla\CMS\Language\Text;
|
||||
|
||||
$fieldSets = $this->form->getFieldsets('metadata');
|
||||
foreach ($fieldSets as $name => $fieldSet) :
|
||||
/*echo JHtml::_('sliders.panel',JText::_($fieldSet->label), $name.'-options');
|
||||
if (isset($fieldSet->description) && trim($fieldSet->description)) :
|
||||
echo '<p class="tip">'.$this->escape(Text::_($fieldSet->description)).'</p>';
|
||||
endif;*/
|
||||
?>
|
||||
<fieldset class="panelform">
|
||||
<div class="adminform">
|
||||
<?php if ($name == 'metadata') : // Include the real fields in this panel. ?>
|
||||
<div class="control-group">
|
||||
<div class="control-label"><?php echo $this->form->getLabel('metadesc'); ?></div>
|
||||
<div class="controls"><?php echo $this->form->getInput('metadesc'); ?></div></div>
|
||||
<div class="control-group">
|
||||
<div class="control-label"><?php echo $this->form->getLabel('metakey'); ?></div>
|
||||
<div class="controls"><?php echo $this->form->getInput('metakey'); ?></div></div>
|
||||
|
||||
<?php endif; ?>
|
||||
<?php foreach ($this->form->getFieldset($name) as $field) : ?>
|
||||
<div class="control-group">
|
||||
<div class="control-label"><?php echo $field->label; ?>
|
||||
<div class="controls"><?php echo $field->input; ?></div></div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</fieldset>
|
||||
<?php endforeach; ?>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,100 @@
|
||||
<?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\Component\ComponentHelper;
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Toolbar\Toolbar;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Toolbar\ToolbarHelper;
|
||||
jimport( 'joomla.application.component.view' );
|
||||
|
||||
class PhocaGalleryCpViewPhocaGalleryImg extends HtmlView
|
||||
{
|
||||
protected $state;
|
||||
protected $item;
|
||||
protected $form;
|
||||
protected $t;
|
||||
protected $r;
|
||||
|
||||
|
||||
public function display($tpl = null) {
|
||||
|
||||
$this->state = $this->get('State');
|
||||
$this->form = $this->get('Form');
|
||||
$this->item = $this->get('Item');
|
||||
|
||||
$this->t = PhocaGalleryUtils::setVars('img');
|
||||
$this->r = new PhocaGalleryRenderAdminview();
|
||||
|
||||
$params = ComponentHelper::getParams('com_phocagallery');
|
||||
|
||||
$this->t['enablethumbcreation'] = $params->get('enable_thumb_creation', 1 );
|
||||
$this->t['enablethumbcreationstatus'] = PhocaGalleryRenderAdmin::renderThumbnailCreationStatus((int)$this->t['enablethumbcreation']);
|
||||
|
||||
if ($this->item->extlink1 != '') {
|
||||
$extLink = PhocaGalleryRenderAdmin::renderExternalLink($this->item->extlink1);
|
||||
$this->form->setValue('extlink1link', '', $extLink[0]);
|
||||
$this->form->setValue('extlink1title', '', $extLink[1]);
|
||||
$this->form->setValue('extlink1target', '', $extLink[2]);
|
||||
$this->form->setValue('extlink1icon', '', $extLink[3]);
|
||||
}
|
||||
if ($this->item->extlink2 != '') {
|
||||
$extLink = PhocaGalleryRenderAdmin::renderExternalLink($this->item->extlink2);
|
||||
$this->form->setValue('extlink2link', '', $extLink[0]);
|
||||
$this->form->setValue('extlink2title', '', $extLink[1]);
|
||||
$this->form->setValue('extlink2target', '', $extLink[2]);
|
||||
$this->form->setValue('extlink2icon', '', $extLink[3]);
|
||||
}
|
||||
|
||||
$this->addToolbar();
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
|
||||
protected function addToolbar() {
|
||||
|
||||
require_once JPATH_COMPONENT.'/helpers/phocagalleryimgs.php';
|
||||
Factory::getApplication()->input->set('hidemainmenu', true);
|
||||
$bar = Toolbar::getInstance('toolbar');
|
||||
$user = Factory::getUser();
|
||||
$isNew = ($this->item->id == 0);
|
||||
$checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id'));
|
||||
$canDo = PhocaGalleryImgsHelper::getActions($this->state->get('filter.image_id'), $this->item->id);
|
||||
$paramsC = ComponentHelper::getParams('com_phocagallery');
|
||||
|
||||
|
||||
$text = $isNew ? Text::_( 'COM_PHOCAGALLERY_NEW' ) : Text::_('COM_PHOCAGALLERY_EDIT');
|
||||
ToolbarHelper::title( Text::_( 'COM_PHOCAGALLERY_IMAGE' ).': <small><small>[ ' . $text.' ]</small></small>' , 'image');
|
||||
|
||||
// If not checked out, can save the item.
|
||||
if (!$checkedOut && $canDo->get('core.edit')){
|
||||
ToolbarHelper::apply('phocagalleryimg.apply', 'JToolbar_APPLY');
|
||||
ToolbarHelper::save('phocagalleryimg.save', 'JToolbar_SAVE');
|
||||
ToolbarHelper::addNew('phocagalleryimg.save2new', 'JToolbar_SAVE_AND_NEW');
|
||||
|
||||
}
|
||||
// If an existing item, can save to a copy.
|
||||
if (!$isNew && $canDo->get('core.create')) {
|
||||
//JToolbarHelper::custom('phocagalleryc.save2copy', 'copy.png', 'copy_f2.png', 'JToolbar_SAVE_AS_COPY', false);
|
||||
}
|
||||
if (empty($this->item->id)) {
|
||||
ToolbarHelper::cancel('phocagalleryimg.cancel', 'JToolbar_CANCEL');
|
||||
}
|
||||
else {
|
||||
ToolbarHelper::cancel('phocagalleryimg.cancel', 'JToolbar_CLOSE');
|
||||
}
|
||||
|
||||
ToolbarHelper::divider();
|
||||
ToolbarHelper::help( 'screen.phocagallery', true );
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,220 @@
|
||||
<?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
|
||||
*/
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
use Joomla\CMS\Uri\Uri;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Layout\LayoutHelper;
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Router\Route;
|
||||
|
||||
$document = Factory::getDocument();
|
||||
$document->addStyleSheet(Uri::root(true).'/media/com_phocagallery/js/photoswipe/css/photoswipe.css');
|
||||
$document->addStyleSheet(Uri::root(true).'/media/com_phocagallery/js/photoswipe/css/default-skin/default-skin.css');
|
||||
$document->addStyleSheet(Uri::root(true).'/media/com_phocagallery/js/photoswipe/css/photoswipe-style.css');
|
||||
|
||||
$task = 'phocagalleryimg';
|
||||
|
||||
$r = $this->r;
|
||||
$app = Factory::getApplication();
|
||||
$option = $app->input->get('option');
|
||||
$tasks = $task . 's';
|
||||
$OPT = strtoupper($option);
|
||||
$user = Factory::getUser();
|
||||
$userId = $user->get('id');
|
||||
$listOrder = $this->escape($this->state->get('list.ordering'));
|
||||
$listDirn = $this->escape($this->state->get('list.direction'));
|
||||
$canOrder = $user->authorise('core.edit.state', $option);
|
||||
$saveOrder = $listOrder == 'a.ordering';
|
||||
$saveOrderingUrl = '';
|
||||
if ($saveOrder && !empty($this->items)) {
|
||||
$saveOrderingUrl = $r->saveOrder($this->t, $listDirn);
|
||||
}
|
||||
$sortFields = $this->getSortFields();
|
||||
|
||||
echo $r->startHeader();
|
||||
echo $r->jsJorderTable($listOrder);
|
||||
|
||||
echo '<div class="phoca-thumb-status">' . $this->t['enablethumbcreationstatus'] .'</div>';
|
||||
//echo '<div class="clearfix"></div>';
|
||||
|
||||
echo $r->startForm($option, $tasks, 'adminForm');
|
||||
//echo $r->startFilter();
|
||||
//echo $r->endFilter();
|
||||
|
||||
echo $r->startMainContainer();
|
||||
if (isset($this->t['notapproved']->count) && (int)$this->t['notapproved']->count > 0 ) {
|
||||
|
||||
echo '<div class="alert alert-error alert-dismissible fade show" role="alert">'. Text::_('COM_PHOCAGALLERY_NOT_APPROVED_IMAGE_IN_GALLERY').': '
|
||||
.(int)$this->t['notapproved']->count.'<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="'.Text::_('COM_PHOCAGALLERY_CLOSE').'"></button></div>';
|
||||
}
|
||||
/*
|
||||
echo $r->startFilterBar();
|
||||
echo $r->inputFilterSearch($OPT.'_FILTER_SEARCH_LABEL', $OPT.'_FILTER_SEARCH_DESC',
|
||||
$this->escape($this->state->get('filter.search')));
|
||||
echo $r->inputFilterSearchClear('JSEARCH_FILTER_SUBMIT', 'JSEARCH_FILTER_CLEAR');
|
||||
echo $r->inputFilterSearchLimit('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC', $this->pagination->getLimitBox());
|
||||
echo $r->selectFilterDirection('JFIELD_ORDERING_DESC', 'JGLOBAL_ORDER_ASCENDING', 'JGLOBAL_ORDER_DESCENDING', $listDirn);
|
||||
echo $r->selectFilterSortBy('JGLOBAL_SORT_BY', $sortFields, $listOrder);
|
||||
|
||||
echo $r->startFilterBar(2);
|
||||
echo $r->selectFilterPublished('JOPTION_SELECT_PUBLISHED', $this->state->get('filter.published'));
|
||||
echo $r->selectFilterLanguage('JOPTION_SELECT_LANGUAGE', $this->state->get('filter.language'));
|
||||
echo $r->selectFilterCategory(PhocaGalleryCategory::options($option, 1), 'JOPTION_SELECT_CATEGORY', $this->state->get('filter.category_id'));
|
||||
//echo $r->endFilterBar();
|
||||
|
||||
echo $r->endFilterBar();*/
|
||||
|
||||
echo LayoutHelper::render('joomla.searchtools.default', array('view' => $this));
|
||||
|
||||
echo '<div id="pg-msnr-container" class="pg-photoswipe pg-msnr-container pg-category-items-box" itemscope itemtype="http://schema.org/ImageGallery">';
|
||||
|
||||
echo $r->startTable('categoryList');
|
||||
|
||||
echo $r->startTblHeader();
|
||||
|
||||
echo $r->firstColumnHeader($listDirn, $listOrder);
|
||||
echo $r->secondColumnHeader($listDirn, $listOrder);
|
||||
|
||||
echo '<th class="ph-image">'.Text::_( $OPT. '_IMAGE' ).'</th>'."\n";
|
||||
echo '<th class="ph-title">'.HTMLHelper::_('searchtools.sort', $OPT.'_TITLE', 'a.title', $listDirn, $listOrder ).'</th>'."\n";
|
||||
echo '<th class="ph-filename">'.HTMLHelper::_('searchtools.sort', $OPT.'_FILENAME', 'a.filename', $listDirn, $listOrder ).'</th>'."\n";
|
||||
echo '<th class="ph-functions">'.Text::_( $OPT. '_FUNCTIONS' ).'</th>'."\n";
|
||||
echo '<th class="ph-published">'.HTMLHelper::_('searchtools.sort', $OPT.'_PUBLISHED', 'a.published', $listDirn, $listOrder ).'</th>'."\n";
|
||||
echo '<th class="ph-approved">'.HTMLHelper::_('searchtools.sort', $OPT.'_APPROVED', 'a.approved', $listDirn, $listOrder ).'</th>'."\n";
|
||||
echo '<th class="ph-parentcattitle">'.HTMLHelper::_('searchtools.sort', $OPT.'_CATEGORY', 'category_id', $listDirn, $listOrder ).'</th>'."\n";
|
||||
//echo '<th class="ph-access">'.JText::_($OPT.'_ACCESS').'</th>'."\n";
|
||||
//echo '<th class="ph-owner">'.HTMLHelper::_('searchtools.sort', $OPT.'_OWNER', 'category_owner_id', $listDirn, $listOrder ).'</th>'."\n";
|
||||
//echo '<th class="ph-uploaduser">'.HTMLHelper::_('searchtools.sort', $OPT.'_UPLOADED_BY', 'uploadusername', $listDirn, $listOrder ).'</th>'."\n";
|
||||
echo '<th class="ph-rating">'.HTMLHelper::_('searchtools.sort', $OPT.'_RATING', 'ratingavg', $listDirn, $listOrder ).'</th>'."\n";
|
||||
echo '<th class="ph-hits">'.HTMLHelper::_('searchtools.sort', $OPT.'_HITS', 'a.hits', $listDirn, $listOrder ).'</th>'."\n";
|
||||
echo '<th class="ph-language">'.HTMLHelper::_('searchtools.sort', 'JGRID_HEADING_LANGUAGE', 'a.language', $listDirn, $listOrder ).'</th>'."\n";
|
||||
echo '<th class="ph-id">'.HTMLHelper::_('searchtools.sort', $OPT.'_ID', 'a.id', $listDirn, $listOrder ).'</th>'."\n";
|
||||
|
||||
echo $r->endTblHeader();
|
||||
echo $r->startTblBody($saveOrder, $saveOrderingUrl, $listDirn);
|
||||
|
||||
$originalOrders = array();
|
||||
$parentsStr = "";
|
||||
$j = 0;
|
||||
|
||||
if (is_array($this->items)) {
|
||||
foreach ($this->items as $i => $item) {
|
||||
|
||||
//if ($i >= (int)$this->pagination->limitstart && $j < (int)$this->pagination->limit) {
|
||||
$j++;
|
||||
|
||||
$urlEdit = 'index.php?option='.$option.'&task='.$task.'.edit&id=';
|
||||
$urlTask = 'index.php?option='.$option.'&task='.$task;
|
||||
$orderkey = array_search($item->id, $this->ordering[$item->catid]);
|
||||
$ordering = ($listOrder == 'a.ordering');
|
||||
$canCreate = $user->authorise('core.create', $option);
|
||||
$canEdit = $user->authorise('core.edit', $option);
|
||||
$canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out==$user->get('id') || $item->checked_out==0;
|
||||
$canChange = $user->authorise('core.edit.state', $option) && $canCheckin;
|
||||
$linkEdit = Route::_( $urlEdit. $item->id );
|
||||
$linkRotate90 = Route::_( $urlTask.'.rotate&angle=90&id='. $item->id );
|
||||
$linkRotate270 = Route::_( $urlTask.'.rotate&angle=270&id='. $item->id );
|
||||
$linkDeleteThumbs= Route::_( $urlTask.'.recreate&cid[]='. (int)$item->id );
|
||||
|
||||
$linkCat = Route::_( 'index.php?option=com_phocagallery&task=phocagalleryc.edit&id='.(int) $item->category_id );
|
||||
$canEditCat = $user->authorise('core.edit', $option);
|
||||
|
||||
|
||||
echo $r->startTr($i, isset($item->catid) ? (int)$item->catid : 0);
|
||||
echo $r->firstColumn($i, $item->id, $canChange, $saveOrder, $orderkey, $item->ordering);
|
||||
echo $r->secondColumn($i, $item->id, $canChange, $saveOrder, $orderkey, $item->ordering);
|
||||
echo $r->tdImage($item, 'pg-photoswipe-button', 'COM_PHOCAGALLERY_ENLARGE_IMAGE');
|
||||
$checkO = '';
|
||||
if ($item->checked_out) {
|
||||
$checkO .= HTMLHelper::_('jgrid.checkedout', $i, $item->editor, $item->checked_out_time, $tasks.'.', $canCheckin);
|
||||
}
|
||||
if ($canCreate || $canEdit) {
|
||||
$checkO .= '<a href="'. Route::_($linkEdit).'">'. $this->escape($item->title).'</a>';
|
||||
} else {
|
||||
$checkO .= $this->escape($item->title);
|
||||
}
|
||||
$checkO .= ' <span class="smallsub">(<span>'.Text::_($OPT.'_FIELD_ALIAS_LABEL').':</span>'. $this->escape($item->alias).')</span>';
|
||||
echo $r->td($checkO, "small");
|
||||
|
||||
if (isset($item->extid) && $item->extid !='') {
|
||||
if (isset($item->exttype) && $item->exttype == 2) {
|
||||
echo $r->td(Text::_('COM_PHOCAGALLERY_IMGUR_STORED_FILE'));
|
||||
echo $r->td('');
|
||||
} else if (isset($item->exttype) && $item->exttype == 1) {
|
||||
echo $r->td(Text::_('COM_PHOCAGALLERY_FACEBOOK_STORED_FILE'));
|
||||
echo $r->td('');
|
||||
} else {
|
||||
echo $r->td(Text::_('COM_PHOCAGALLERY_PICASA_STORED_FILE'));
|
||||
echo $r->td('');
|
||||
}
|
||||
} else {
|
||||
echo $r->td(str_replace('/', ' / ', $item->filename), "small ph-list-filename");
|
||||
echo '<td align="center">';
|
||||
|
||||
echo '<div class="pha-toolbox">';
|
||||
echo '<a class="pha-no-underline" href="'. $linkRotate90 .'" title="'. Text::_( 'COM_PHOCAGALLERY_ROTATE_LEFT' ).'">'
|
||||
. '<span class="ph-cp-item"><i class="phi phi-mirror duotone icon-unblock phi-fs-m phi-fc-od" title="'. Text::_( 'COM_PHOCAGALLERY_ROTATE_LEFT' ).'"></i></span>'.'</a> '
|
||||
.'<a class="pha-no-underline" href="'. $linkRotate270 .'" title="'. Text::_( 'COM_PHOCAGALLERY_ROTATE_RIGHT' ).'">'
|
||||
. '<span class="ph-cp-item"><i class="phi duotone icon-unblock phi-fs-m phi-fc-od" title="'. Text::_( 'COM_PHOCAGALLERY_ROTATE_RIGHT' ).'"></i></span>'.'</a> '
|
||||
.'<a class="pha-no-underline" href="'. $linkDeleteThumbs.'" title="'. Text::_( 'COM_PHOCAGALLERY_RECREATE_THUMBS' ).'">'. '<span class="ph-cp-item"><i class="phi duotone icon-plus-circle phi-fs-m phi-fc-gd" title="'. Text::_( 'COM_PHOCAGALLERY_RECREATE_THUMBS' ).'"></i></span>'.'</a> '
|
||||
.'<a class="pha-no-underline" href="#" onclick="window.location.reload(true);" title="'. Text::_( 'COM_PHOCAGALLERY_RELOAD_SITE' ).'">'. '<span class="ph-cp-item"><i class="phi duotone icon-loop phi-fs-m phi-fc-bl " title="'. Text::_( 'COM_PHOCAGALLERY_RELOAD_SITE' ).'"></i></span>'.'</a>';
|
||||
|
||||
echo '</div>';
|
||||
echo '</td>';
|
||||
}
|
||||
|
||||
echo $r->td(HTMLHelper::_('jgrid.published', $item->published, $i, $tasks.'.', $canChange), "small");
|
||||
echo $r->td(PhocaGalleryJGrid::approved( $item->approved, $i, $tasks.'.', $canChange), "small");
|
||||
|
||||
if ($canEditCat) {
|
||||
$catO = '<a href="'. Route::_($linkCat).'">'. $this->escape($item->category_title).'</a>';
|
||||
} else {
|
||||
$catO = $this->escape($item->category_title);
|
||||
}
|
||||
echo $r->td($catO, "small");
|
||||
//echo $r->td($this->escape($item->access_level), "small");
|
||||
/*
|
||||
$usrO = $item->usernameno;
|
||||
if ($item->username) {$usrO = $usrO . ' ('.$item->username.')';}
|
||||
echo $r->td($usrO, "small");
|
||||
|
||||
$usrU = $item->uploadname;
|
||||
if ($item->uploadusername) {$usrU = $usrU . ' ('.$item->uploadusername.')';}
|
||||
echo $r->td($usrU, "small");
|
||||
*/
|
||||
echo $r->tdRating($item->ratingavg);
|
||||
echo $r->td($item->hits, "small");
|
||||
echo $r->tdLanguage($item->language, $item->language_title, $this->escape($item->language_title));
|
||||
echo $r->td($item->id, "small");
|
||||
|
||||
echo $r->endTr();
|
||||
|
||||
//}
|
||||
}
|
||||
|
||||
}
|
||||
echo $r->endTblBody();
|
||||
|
||||
echo $r->tblFoot($this->pagination->getListFooter(), 15);
|
||||
echo $r->endTable();
|
||||
echo "</div>";
|
||||
|
||||
echo $this->loadTemplate('batch');
|
||||
|
||||
echo $r->formInputsXML($listOrder, $listDirn, $originalOrders);
|
||||
echo $r->endMainContainer();
|
||||
echo $r->endForm();
|
||||
|
||||
// Modal window for images
|
||||
echo PhocaGalleryRenderDetailWindow::loadPhotoswipeBottom();
|
||||
?>
|
||||
@ -0,0 +1,60 @@
|
||||
<?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;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Layout\LayoutHelper;
|
||||
|
||||
//$published = $this->state->get('filter.published');
|
||||
?>
|
||||
|
||||
<div id="collapseModal" role="dialog" tabindex="-1" class="joomla-modal modal fade">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h3 class="modal-title"><?php echo Text::_('COM_PHOCAGALLERY_BATCH_OPTIONS_IMAGES');?></h3>
|
||||
<button type="button" class="btn-close novalidate" data-bs-dismiss="modal" aria-label="<?php Text::_('COM_PHOCAGALLERY_CLOSE'); ?>">
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
<div class="p-3">
|
||||
<div class="row">
|
||||
<div class="form-group col-md-6">
|
||||
<div class="controls"><?php echo LayoutHelper::render('joomla.html.batch.access', []);?></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="form-group col-md-6">
|
||||
<div class="controls"><?php echo LayoutHelper::render('joomla.html.batch.language', []); ?></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="form-group col-md-6">
|
||||
<div class="controls"><?php echo PhocaGalleryBatch::item(''); ?></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button class="btn" type="button" onclick="document.getElementById('batch-category-id').value='';document.getElementById('batch-access').value='';document.getElementById('batch-language-id').value=''" data-bs-dismiss="modal">
|
||||
<?php echo Text::_('JCANCEL'); ?>
|
||||
</button>
|
||||
<button class="btn btn-primary" type="submit" onclick="Joomla.submitbutton('phocagalleryimg.batch');" id="batch-submit-button-id" data-submit-task="phocagalleryimg.batch">
|
||||
<?php echo Text::_('JGLOBAL_BATCH_PROCESS'); ?>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,288 @@
|
||||
<?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();
|
||||
|
||||
use Joomla\CMS\Layout\FileLayout;
|
||||
use Joomla\CMS\MVC\View\HtmlView;
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Component\ComponentHelper;
|
||||
use Joomla\CMS\Object\CMSObject;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Toolbar\Toolbar;
|
||||
use Joomla\CMS\Toolbar\ToolbarHelper;
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Filesystem\File;
|
||||
jimport( 'joomla.application.component.view' );
|
||||
phocagalleryimport('phocagallery.library.library');
|
||||
phocagalleryimport('phocagallery.render.renderdetailwindow');
|
||||
|
||||
|
||||
class PhocaGalleryCpViewPhocaGalleryImgs extends HtmlView
|
||||
{
|
||||
|
||||
protected $items;
|
||||
protected $items_thumbnail;
|
||||
protected $pagination;
|
||||
protected $state;
|
||||
protected $button;
|
||||
protected $t;
|
||||
protected $r;
|
||||
public $filterForm;
|
||||
public $activeFilters;
|
||||
//public $_context = 'com_phocagallery.phocagalleryimg';
|
||||
|
||||
function display($tpl = null) {
|
||||
|
||||
|
||||
$this->items = $this->get('Items');
|
||||
$this->pagination = $this->get('Pagination');
|
||||
$this->state = $this->get('State');
|
||||
$this->filterForm = $this->get('FilterForm');
|
||||
$this->activeFilters = $this->get('ActiveFilters');
|
||||
|
||||
$this->r = new PhocaGalleryRenderAdminViews();
|
||||
$this->t = PhocaGalleryUtils::setVars('img');
|
||||
|
||||
// Preprocess the list of items to find ordering divisions.
|
||||
foreach ($this->items as &$item) {
|
||||
$this->ordering[$item->catid][] = $item->id;
|
||||
}
|
||||
|
||||
|
||||
$this->processImages();
|
||||
|
||||
|
||||
|
||||
$document = Factory::getDocument();
|
||||
|
||||
|
||||
|
||||
$params = ComponentHelper::getParams('com_phocagallery');
|
||||
|
||||
|
||||
$this->t['enablethumbcreation'] = $params->get('enable_thumb_creation', 1 );
|
||||
$this->t['enablethumbcreationstatus'] = PhocaGalleryRenderAdmin::renderThumbnailCreationStatus((int)$this->t['enablethumbcreation']);
|
||||
|
||||
|
||||
|
||||
/*$app = JFactory::getApplication();
|
||||
$uri = \Joomla\CMS\Uri\Uri::getInstance();
|
||||
|
||||
$db = JFactory::getDBO();*/
|
||||
|
||||
$this->t['notapproved'] = $this->get( 'NotApprovedImage' );
|
||||
|
||||
// Button
|
||||
/*
|
||||
$this->button = new CMSObject();
|
||||
$this->button->set('modal', true);
|
||||
$this->button->set('methodname', 'modal-button');
|
||||
//$this->button->set('link', $link);
|
||||
$this->button->set('text', Text::_('COM_PHOCAGALLERY_DISPLAY_IMAGE_DETAIL'));
|
||||
//$this->button->set('name', 'image');
|
||||
$this->button->set('modalname', 'modal_phocagalleryimgs');
|
||||
$this->button->set('options', "{handler: 'image', size: {x: 200, y: 150}}");*/
|
||||
|
||||
|
||||
$library = PhocaGalleryLibrary::getLibrary();
|
||||
$libraries = array();
|
||||
$btn = new PhocaGalleryRenderDetailWindow();
|
||||
$btn->popupWidth = '640';
|
||||
$btn->popupHeight = '480';
|
||||
$btn->backend = 1;
|
||||
|
||||
$btn->setButtons(14, $libraries, $library);
|
||||
$this->button = $btn->getB1();
|
||||
|
||||
|
||||
$this->addToolbar();
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected function addToolbar() {
|
||||
|
||||
require_once JPATH_COMPONENT.'/helpers/phocagalleryimgs.php';
|
||||
|
||||
|
||||
|
||||
$state = $this->get('State');
|
||||
$canDo = PhocaGalleryImgsHelper::getActions($state->get('filter.image_id'));
|
||||
$user = Factory::getUser();
|
||||
$bar = Toolbar::getInstance('toolbar');
|
||||
ToolbarHelper::title( Text::_('COM_PHOCAGALLERY_IMAGES'), 'image.png' );
|
||||
if ($canDo->get('core.create')) {
|
||||
ToolbarHelper::addNew( 'phocagalleryimg.add','JToolbar_NEW');
|
||||
ToolbarHelper::custom( 'phocagallerym.edit', 'multiple.png', '', 'COM_PHOCAGALLERY_MULTIPLE_ADD' , false);
|
||||
}
|
||||
if ($canDo->get('core.edit')) {
|
||||
ToolbarHelper::editList('phocagalleryimg.edit','JToolbar_EDIT');
|
||||
}
|
||||
|
||||
$dropdown = $bar->dropdownButton('status-group')->text('JTOOLBAR_CHANGE_STATUS')->toggleSplit(false)->icon('icon-ellipsis-h')->buttonClass('btn btn-action')->listCheck(true);
|
||||
$childBar = $dropdown->getChildToolbar();
|
||||
|
||||
if ($canDo->get('core.create')) {
|
||||
|
||||
/*
|
||||
$bar->appendButton( 'Custom', '<a href="#" onclick="javascript:if(document.adminForm.boxchecked.value==0){alert(\''.JText::_('COM_PHOCAGALLERY_WARNING_RECREATE_MAKE_SELECTION').'\');}else{if(confirm(\''.JText::_('COM_PHOCAGALLERY_WARNING_RECREATE_THUMBNAILS').'\')){Joomla.submitbutton(\'phocagalleryimg.recreate\');}}" class="toolbar"><span class="icon-32-recreate" title="'.JText::_('COM_PHOCAGALLERY_RECREATE_THUMBS').'" type="Custom"></span>'.JText::_('COM_PHOCAGALLERY_RECREATE').'</a>');*/
|
||||
|
||||
/* $dhtml = '<joomla-toolbar-button id="toolbar-recreate-thumbnails" list-selection>';
|
||||
$dhtml .= '<button class="btn btn-small" onclick="javascript:if(document.adminForm.boxchecked.value==0){alert(\''.Text::_('COM_PHOCAGALLERY_WARNING_RECREATE_MAKE_SELECTION').'\');}else{if(confirm(\''.Text::_('COM_PHOCAGALLERY_WARNING_RECREATE_THUMBNAILS').'\')){Joomla.submitbutton(\'phocagalleryimg.recreate\');}}" ><i class="icon-recreate" title="'.Text::_('COM_PHOCAGALLERY_RECREATE_THUMBS').'"></i> '.Text::_('COM_PHOCAGALLERY_RECREATE_THUMBS').'</button>';
|
||||
$dhtml .= '</joomla-toolbar-button>';
|
||||
$bar->appendButton('Custom', $dhtml);*/
|
||||
|
||||
$onClick = 'javascript:if(document.adminForm.boxchecked.value==0){alert(\''.Text::_('COM_PHOCAGALLERY_WARNING_RECREATE_MAKE_SELECTION').'\');}else{if(confirm(\''.Text::_('COM_PHOCAGALLERY_WARNING_RECREATE_THUMBNAILS').'\')){Joomla.submitbutton(\'phocagalleryimg.recreate\');}}';
|
||||
|
||||
$childBar->standardButton('recreate')->text('COM_PHOCAGALLERY_RECREATE_THUMBS')->onclick($onClick)->icon('icon-image');
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ($canDo->get('core.edit.state')) {
|
||||
|
||||
//ToolbarHelper::divider();
|
||||
/*ToolbarHelper::custom('phocagalleryimgs.publish', 'publish.png', 'publish_f2.png','JToolbar_PUBLISH', true);
|
||||
ToolbarHelper::custom('phocagalleryimgs.unpublish', 'unpublish.png', 'unpublish_f2.png', 'JToolbar_UNPUBLISH', true);
|
||||
ToolbarHelper::custom( 'phocagalleryimgs.approve', 'approve.png', '', 'COM_PHOCAGALLERY_APPROVE' , true);
|
||||
ToolbarHelper::custom( 'phocagalleryimgs.disapprove', 'disapprove.png', '', 'COM_PHOCAGALLERY_NOT_APPROVE' , true);
|
||||
*/
|
||||
$childBar->publish('phocagalleryimgs.publish')->listCheck(true);
|
||||
$childBar->unpublish('phocagalleryimgs.unpublish')->listCheck(true);
|
||||
$childBar->standardButton('approve')->text('COM_PHOCAGALLERY_APPROVE')->task('phocagalleryimgs.approve')->listCheck(true);
|
||||
$childBar->standardButton('disapprove')->text('COM_PHOCAGALLERY_NOT_APPROVE')->task('phocagalleryimgs.disapprove')->listCheck(true);
|
||||
|
||||
}
|
||||
|
||||
if ($canDo->get('core.delete')) {
|
||||
$childBar->delete($this->t['tasks'].'.delete')->text('COM_PHOCAGALLERY_DELETE')->message('COM_PHOCAGALLERY_WARNING_DELETE_ITEMS')->icon('icon-trash')->listCheck(true);
|
||||
//ToolbarHelper::deleteList( Text::_( 'COM_PHOCAGALLERY_WARNING_DELETE_ITEMS' ), 'phocagalleryimgs.delete', 'COM_PHOCAGALLERY_DELETE');
|
||||
}
|
||||
|
||||
// Add a batch button
|
||||
if ($user->authorise('core.edit'))
|
||||
{
|
||||
|
||||
//HTMLHelper::_('bootstrap.renderModal', 'collapseModal');
|
||||
/*$title = Text::_('JToolbar_BATCH');
|
||||
$dhtml = '<joomla-toolbar-button id="toolbar-batch" list-selection>';
|
||||
$dhtml .= "<button data-bs-toggle=\"modal\" data-bs-target=\"#collapseModal\" class=\"btn btn-small\">
|
||||
<i class=\"icon-checkbox-partial\" title=\"$title\"></i>
|
||||
$title</button>";
|
||||
$dhtml .= '</joomla-toolbar-button>';
|
||||
|
||||
$bar->appendButton('Custom', $dhtml, 'batch');*/
|
||||
|
||||
HTMLHelper::_('bootstrap.renderModal', 'collapseModal');
|
||||
$childBar->popupButton('batch')->text('JTOOLBAR_BATCH')->selector('collapseModal')->listCheck(true);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
ToolbarHelper::divider();
|
||||
ToolbarHelper::help( 'screen.phocagallery', true );
|
||||
}
|
||||
|
||||
|
||||
protected function processImages() {
|
||||
|
||||
if (!empty($this->items)) {
|
||||
|
||||
$params = ComponentHelper::getParams( 'com_phocagallery' );
|
||||
$pagination_thumbnail_creation = $params->get( 'pagination_thumbnail_creation', 0 );
|
||||
$clean_thumbnails = $params->get( 'clean_thumbnails', 0 );
|
||||
|
||||
|
||||
//Server doesn't have CPU power
|
||||
//we do thumbnail for all images - there is no pagination...
|
||||
//or we do thumbanil for only listed images
|
||||
if (empty($this->items_thumbnail)) {
|
||||
if ($pagination_thumbnail_creation == 1) {
|
||||
$this->items_thumbnail = $this->items;
|
||||
} else {
|
||||
$this->items_thumbnail = $this->get('ItemsThumbnail');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - -
|
||||
// Check if the file stored in database is on the server. If not please refer to user
|
||||
// Get filename from every object there is stored in database
|
||||
// file - abc.img, file_no - folder/abc.img
|
||||
// Get folder variables from Helper
|
||||
$path = PhocaGalleryPath::getPath();
|
||||
$origPath = $path->image_abs;
|
||||
$origPathServer = str_replace('\\', '/', $path->image_abs);
|
||||
|
||||
//-----------------------------------------
|
||||
//Do all thumbnails no limit no pagination
|
||||
if (!empty($this->items_thumbnail)) {
|
||||
foreach ($this->items_thumbnail as $key => $value) {
|
||||
$fileOriginalThumb = PhocaGalleryFile::getFileOriginal($value->filename);
|
||||
//Let the user know that the file doesn't exists and delete all thumbnails
|
||||
if (File::exists($fileOriginalThumb)) {
|
||||
$refreshUrlThumb = 'index.php?option=com_phocagallery&view=phocagalleryimgs';
|
||||
$fileThumb = PhocaGalleryFileThumbnail::getOrCreateThumbnail( $value->filename, $refreshUrlThumb, 1, 1, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->items_thumbnail = null; // delete data to reduce memory
|
||||
|
||||
//Only the the site with limitation or pagination...
|
||||
if (!empty($this->items)) {
|
||||
foreach ($this->items as $key => $value) {
|
||||
$fileOriginal = PhocaGalleryFile::getFileOriginal($value->filename);
|
||||
//Let the user know that the file doesn't exists and delete all thumbnails
|
||||
|
||||
if (!File::exists($fileOriginal)) {
|
||||
$this->items[$key]->filename = Text::_( 'COM_PHOCAGALLERY_IMG_FILE_NOT_EXISTS' );
|
||||
$this->items[$key]->fileoriginalexist = 0;
|
||||
} else {
|
||||
//Create thumbnails small, medium, large
|
||||
$refresh_url = 'index.php?option=com_phocagallery&view=phocagalleryimgs';
|
||||
$fileThumb = PhocaGalleryFileThumbnail::getOrCreateThumbnail($value->filename, $refresh_url, 1, 1, 1);
|
||||
|
||||
$this->items[$key]->linkthumbnailpath = $fileThumb['thumb_name_s_no_rel'];
|
||||
$this->items[$key]->fileoriginalexist = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Clean Thumbs Folder if there are thumbnail files but not original file
|
||||
if ($clean_thumbnails == 1) {
|
||||
PhocaGalleryFileFolder::cleanThumbsFolder();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected function getSortFields() {
|
||||
return array(
|
||||
'a.ordering' => Text::_('JGRID_HEADING_ORDERING'),
|
||||
'a.title' => Text::_('COM_PHOCAGALLERY_TITLE'),
|
||||
'a.filename' => Text::_('COM_PHOCAGALLERY_FILENAME'),
|
||||
'a.published' => Text::_('COM_PHOCAGALLERY_PUBLISHED'),
|
||||
'a.approved' => Text::_('COM_PHOCAGALLERY_APPROVED'),
|
||||
'category_id' => Text::_('COM_PHOCAGALLERY_CATEGORY'),
|
||||
'category_owner_id'=> Text::_('COM_PHOCAGALLERY_OWNER'),
|
||||
'uploadusername'=> Text::_('COM_PHOCAGALLERY_UPLOADED_BY'),
|
||||
'ratingavg' => Text::_('COM_PHOCAGALLERY_RATING'),
|
||||
'a.hits' => Text::_('COM_PHOCAGALLERY_HITS'),
|
||||
'language' => Text::_('JGRID_HEADING_LANGUAGE'),
|
||||
'a.id' => Text::_('JGRID_HEADING_ID')
|
||||
);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,366 @@
|
||||
<?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;
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Uri\Uri;
|
||||
|
||||
$r = $this->r;
|
||||
echo $r->startCp();
|
||||
|
||||
echo '<div class="ph-box-info">';
|
||||
|
||||
echo '<div style="float:right;margin:10px;">' . HTMLHelper::_('image', $this->t['i'] . 'logo-phoca.png', 'Phoca.cz' ) .'</div>'
|
||||
. '<div class="ph-cpanel-logo">'.HTMLHelper::_('image', $this->t['i'] . 'logo-'.str_replace('phoca', 'phoca-', $this->t['c']).'.png', 'Phoca.cz') . '</div>'
|
||||
.'<h3>'.Text::_($this->t['component_head']).' - '. Text::_($this->t['l'].'_INFORMATION').'</h3>'
|
||||
.'<div style="clear:both;"></div>';
|
||||
|
||||
|
||||
echo '<p>'. Text::_('COM_PHOCAGALLERY_RECOMMENDED_SETTINGS').'</p>'
|
||||
.'<div style="clear:both;"></div>';
|
||||
|
||||
echo '<table cellpadding="5" cellspacing="1" class="ph-recommended-settings-table">'
|
||||
.'<tr><td></td>'
|
||||
.'<td align="center">'.Text::_('COM_PHOCAGALLERY_RECOMMENDED').'</td>'
|
||||
.'<td align="center">'.Text::_('COM_PHOCAGALLERY_CURRENT').'</td></tr>';
|
||||
|
||||
if ($this->t['enablethumbcreation'] == 1) {
|
||||
$bgStyle = 'class="alert alert-error alert-danger"';
|
||||
} else {
|
||||
$bgStyle = 'class="alert alert-success"';
|
||||
}
|
||||
|
||||
|
||||
echo '<tr '.$bgStyle.'>'
|
||||
.'<td>'. Text::_('COM_PHOCAGALLERY_ENABLE_THUMBNAIL_GENERATION').'</td>'
|
||||
//.'<td align="center">'.JHtml::_('image','media/com_phocagallery/images/administrator/icon-16-false.png', JText::_('COM_PHOCAGALLERY_DISABLED') ) .'</td>'
|
||||
.'<td align="center" class="ph-info-item ph-cp-item"><i class="phi duotone icon-minus-circle" title="'. Text::_('COM_PHOCAGALLERY_DISABLED') .'"></i></td>'
|
||||
.'<td align="center">'.$this->t['enablethumbcreationstatus'].'</td>'
|
||||
.'</tr>'
|
||||
.'<tr>'
|
||||
.'<td colspan="3">'.Text::_('COM_PHOCAGALLERY_ENABLE_THUMBNAIL_GENERATION_INFO_DESC').'</td></tr>';
|
||||
|
||||
|
||||
if ($this->t['paginationthumbnailcreation'] == 1) {
|
||||
$bgStyle = 'class="alert alert-success"';
|
||||
$icon = 'success';
|
||||
$iconText = Text::_('COM_PHOCAGALLERY_ENABLED');
|
||||
} else {
|
||||
$bgStyle = 'class="alert alert-error alert-danger"';
|
||||
$icon = 'minus-circle';
|
||||
$iconText = Text::_('COM_PHOCAGALLERY_DISABLED');
|
||||
}
|
||||
|
||||
echo '<tr '.$bgStyle.'>'
|
||||
.'<td>'. Text::_('COM_PHOCAGALLERY_PAGINATION_THUMBNAIL_GENERATION').'</td>'
|
||||
//.'<td align="center">'. JHtml::_('image','media/com_phocagallery/images/administrator/icon-16-true.png', JText::_('COM_PHOCAGALLERY_ENABLED') ) .'</td>'
|
||||
//.'<td align="center">'. JHtml::_('image','media/com_phocagallery/images/administrator/icon-16-'.$icon.'.png', JText::_($iconText) ) .'</td>'
|
||||
|
||||
.'<td align="center" class="ph-info-item ph-cp-item"><i class="phi duotone icon-success" title="'. Text::_('COM_PHOCAGALLERY_ENABLED') .'"></i></td>'
|
||||
.'<td align="center" class="ph-info-item ph-cp-item"><i class="phi duotone icon-'.$icon.'" title="'. Text::_($iconText) .'"></i></td></tr>'
|
||||
|
||||
.'</tr>'
|
||||
.'<tr><td colspan="3">'. Text::_('COM_PHOCAGALLERY_PAGINATION_THUMBNAIL_GENERATION_INFO_DESC').'</td></tr>';
|
||||
|
||||
if ($this->t['cleanthumbnails'] == 0) {
|
||||
$bgStyle = 'class="alert alert-success"';
|
||||
$icon = 'minus-circle';
|
||||
$iconText = Text::_('COM_PHOCAGALLERY_DISABLED');
|
||||
|
||||
|
||||
} else {
|
||||
$bgStyle = 'class="alert alert-error alert-danger"';
|
||||
$icon = 'success';
|
||||
$iconText = Text::_('COM_PHOCAGALLERY_ENABLED');
|
||||
}
|
||||
echo '<tr '. $bgStyle.'>'
|
||||
.'<td>'. Text::_('COM_PHOCAGALLERY_CLEAN_THUMBNAILS').'</td>'
|
||||
//.'<td align="center">'. JHtml::_('image','media/com_phocagallery/images/administrator/icon-16-false.png' , JText::_('COM_PHOCAGALLERY_DISABLED') ) .'</td>'
|
||||
//.'<td align="center">'. JHtml::_('image','media/com_phocagallery/images//administrator/icon-16-'.$icon.'.png', JText::_($iconText) ) .'</td>'
|
||||
.'<td align="center" class="ph-info-item ph-cp-item"><i class="phi duotone icon-minus-circle" title="'. Text::_('COM_PHOCAGALLERY_DISABLED') .'"></i></td>'
|
||||
.'<td align="center" class="ph-info-item ph-cp-item"><i class="phi duotone icon-'.$icon.'" title="'. Text::_($iconText) .'"></i></td></tr>'
|
||||
.'</tr>'
|
||||
.'<tr><td colspan="3">'. Text::_('COM_PHOCAGALLERY_CLEAN_THUMBNAILS_INFO_DESC').'</td></tr>';
|
||||
|
||||
echo $this->foutput;
|
||||
echo '</table>';
|
||||
|
||||
|
||||
echo '<h3>'. Text::_($this->t['l'].'_HELP').'</h3>';
|
||||
|
||||
echo '<div>';
|
||||
if (!empty($this->t['component_links'])) {
|
||||
foreach ($this->t['component_links'] as $k => $v) {
|
||||
echo '<div><a href="'.$v[1].'" target="_blank">'.$v[0].'</a></div>';
|
||||
}
|
||||
}
|
||||
echo '</div>';
|
||||
|
||||
echo '<h3>'. Text::_($this->t['l'] . '_VERSION').'</h3>'
|
||||
.'<p>'. $this->t['version'] .'</p>';
|
||||
|
||||
echo '<h3>'. Text::_($this->t['l'] . '_COPYRIGHT').'</h3>'
|
||||
.'<p>© 2007 - '. date("Y"). ' Jan Pavelka</p>'
|
||||
.'<p><a href="https://www.phoca.cz/" target="_blank">www.phoca.cz</a></p>';
|
||||
|
||||
echo '<h3>'. Text::_($this->t['l'] . '_LICENSE').'</h3>'
|
||||
.'<p><a href="http://www.gnu.org/licenses/gpl-2.0.html" target="_blank">GPLv2</a></p>';
|
||||
|
||||
echo '<h3>'. Text::_($this->t['l'] . '_TRANSLATION').': '. Text::_($this->t['l'] . '_TRANSLATION_LANGUAGE_TAG').'</h3>'
|
||||
.'<p>© 2007 - '. date("Y"). ' '. Text::_($this->t['l'] . '_TRANSLATER'). '</p>'
|
||||
.'<p>'.Text::_($this->t['l'] . '_TRANSLATION_SUPPORT_URL').'</p>';
|
||||
|
||||
echo '<input type="hidden" name="task" value="" />'
|
||||
.'<input type="hidden" name="option" value="'.$this->t['o'].'" />'
|
||||
.'<input type="hidden" name="controller" value="'.$this->t['c'].'info" />';
|
||||
|
||||
echo HTMLHelper::_('image', $this->t['i'] . 'logo.png', 'Phoca.cz');
|
||||
|
||||
echo '<p> </p>';
|
||||
|
||||
|
||||
$wa = Factory::getApplication()->getDocument()->getWebAssetManager();
|
||||
$wa->addInlineStyle('
|
||||
|
||||
.upBox {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
margin-top:1em;
|
||||
margin-bottom: 2em;
|
||||
}
|
||||
|
||||
.upItemText {
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
.upItem {
|
||||
padding: 1em;
|
||||
text-align: center;
|
||||
width: calc(50% - 0.4em);
|
||||
margin: 0.2em;
|
||||
border-radius: 0.3em;
|
||||
}
|
||||
|
||||
.upItemD {
|
||||
background: #F5D042;
|
||||
color: #000;
|
||||
border: 2px solid #F5D042;
|
||||
|
||||
}
|
||||
.upItemPh {
|
||||
background: rgba(255,255,255,0.7);
|
||||
color: #000;
|
||||
border: 2px solid #000;
|
||||
}
|
||||
.upItemDoc {
|
||||
background: rgba(255,255,255,0.7);
|
||||
color: #000;
|
||||
border: 2px solid #000;
|
||||
}
|
||||
.upItemJ {
|
||||
background: rgba(255,255,255,0.7);
|
||||
color: #000;
|
||||
border: 2px solid #000;
|
||||
}
|
||||
|
||||
a.upItemLink {
|
||||
padding: 0.5em 1em;
|
||||
border-radius: 9999px;
|
||||
margin: 1em;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
a.upItemLink::before {
|
||||
content: none;
|
||||
}
|
||||
.upItemPh a.upItemLink {
|
||||
background: #000;
|
||||
color: #fff;
|
||||
}
|
||||
.upItemDoc a.upItemLink {
|
||||
background: #000;
|
||||
color: #fff;
|
||||
}
|
||||
.upItemJ a.upItemLink {
|
||||
background: #000;
|
||||
color: #fff;
|
||||
}
|
||||
');
|
||||
|
||||
$upEL = 'https://extensions.joomla.org/extension/phoca-gallery/';
|
||||
$upE = 'Phoca Gallery';
|
||||
|
||||
$o = '<div class="upBox">';
|
||||
|
||||
$o .= '<div class="upItem upItemD">';
|
||||
$o .= '<div class="upItemText">If you find this project useful, please support it with a donation</div>';
|
||||
$o .= '<form action="https://www.paypal.com/donate" method="post" target="_top">';
|
||||
$o .= '<input type="hidden" name="hosted_button_id" value="ZVPH25SQ2DDBY" />';
|
||||
$o .= '<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" title="PayPal - The safer, easier way to pay online!" alt="Donate with PayPal button" />';
|
||||
$o .= '<img alt="" border="0" src="https://www.paypal.com/en_CZ/i/scr/pixel.gif" width="1" height="1" />';
|
||||
$o .= '</form>';
|
||||
$o .= '</div>';
|
||||
|
||||
$o .= '<div class="upItem upItemJ">';
|
||||
$o .= '<div class="upItemText">If you find this project useful, please post a rating and review on the Joomla! Extension Directory website</div>';
|
||||
$o .= '<a class="upItemLink" target="_blank" href="'. $upEL.'">'. $upE.' (JED website)</a>';
|
||||
$o .= '</form>';
|
||||
$o .= '</div>';
|
||||
|
||||
$o .= '<div class="upItem upItemDoc">';
|
||||
$o .= '<div class="upItemText">If you need help, visit</div>';
|
||||
$o .= '<a class="upItemLink" target="_blank" href="https://www.phoca.cz/documentation">Phoca documentation website</a>';
|
||||
$o .= '<div class="upItemText">or ask directly in</div>';
|
||||
$o .= '<a class="upItemLink" target="_blank" href="https://www.phoca.cz/forum">Phoca forum website</a>';
|
||||
$o .= '</div>';
|
||||
|
||||
$o .= '<div class="upItem upItemPh">';
|
||||
$o .= '<div class="upItemText">There are over a hundred more useful Phoca extensions, discover them on</div>';
|
||||
$o .= '<a class="upItemLink" target="_blank" href="https://www.phoca.cz">Phoca website</a>';
|
||||
$o .= '</div>';
|
||||
|
||||
$o .= '</div>';
|
||||
echo $o;
|
||||
|
||||
echo '<div class="ph-cp-hr"></div>'.'<div class="btn-group">
|
||||
<a class="btn btn-large btn-primary" href="https://www.phoca.cz/version/index.php?'.$this->t['c'].'='. $this->t['version'] .'" target="_blank"><i class="icon-loop icon-white"></i> '. Text::_($this->t['l'].'_CHECK_FOR_UPDATE') .'</a></div>';
|
||||
|
||||
echo '<div style="margin-top:30px;height:39px;background: url(\''.Uri::root(true).'/media/com_'.$this->t['c'].'/images/administrator/line.png\') 100% 0 no-repeat;"> </div>';
|
||||
|
||||
echo '</div>';
|
||||
|
||||
|
||||
echo '</div>';
|
||||
echo $r->endCp();
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<?php /*
|
||||
defined('_JEXEC') or die;
|
||||
//JHtml::_('behavior.tooltip');
|
||||
|
||||
echo '<form action="index.php" method="post" name="adminForm" id="phocagalleryin-form">';
|
||||
echo '<div id="j-sidebar-container" class="span2">'.$this->sidebar.'</div>';
|
||||
echo '<div id="j-main-container" class="span10">'
|
||||
|
||||
.'<div style="float:right;margin:10px;">'
|
||||
. HTMLHelper::_('image', 'media/com_phocagallery/images/administrator/logo-phoca.png', 'Phoca.cz' )
|
||||
.'</div>';
|
||||
|
||||
|
||||
echo '<div class="ph-cpanel-logo">'.HTMLHelper::_('image', 'media/com_phocagallery/images/administrator/logo-phoca-gallery.png', 'Phoca.cz') . '</div>';
|
||||
//echo '<div style="clear:both;"></div>';
|
||||
echo '<h3>'.Text::_('COM_PHOCAGALLERY_PHOCA_GALLERY').' - '. Text::_('COM_PHOCAGALLERY_INFORMATION').'</h3>'
|
||||
.'<p>'. Text::_('COM_PHOCAGALLERY_RECOMMENDED_SETTINGS').'</p>'
|
||||
.'<div style="clear:both;"></div>';
|
||||
|
||||
echo '<table cellpadding="5" cellspacing="1">'
|
||||
.'<tr><td></td>'
|
||||
.'<td align="center">'.Text::_('COM_PHOCAGALLERY_RECOMMENDED').'</td>'
|
||||
.'<td align="center">'.Text::_('COM_PHOCAGALLERY_CURRENT').'</td></tr>';
|
||||
|
||||
if ($this->t['enablethumbcreation'] == 1) {
|
||||
$bgStyle = 'class="alert alert-error alert-danger"';
|
||||
} else {
|
||||
$bgStyle = 'class="alert alert-success"';
|
||||
}
|
||||
|
||||
|
||||
echo '<tr '.$bgStyle.'>'
|
||||
.'<td>'. Text::_('COM_PHOCAGALLERY_ENABLE_THUMBNAIL_GENERATION').'</td>'
|
||||
.'<td align="center">'.HTMLHelper::_('image','media/com_phocagallery/images/administrator/icon-16-false.png', Text::_('COM_PHOCAGALLERY_DISABLED') ) .'</td>'
|
||||
.'<td align="center">'.$this->t['enablethumbcreationstatus'].'</td>'
|
||||
.'</tr>'
|
||||
.'<tr>'
|
||||
.'<td colspan="3">'.Text::_('COM_PHOCAGALLERY_ENABLE_THUMBNAIL_GENERATION_INFO_DESC').'</td></tr>';
|
||||
|
||||
|
||||
if ($this->t['paginationthumbnailcreation'] == 1) {
|
||||
$bgStyle = 'class="alert alert-success"';
|
||||
$icon = 'true';
|
||||
$iconText = Text::_('COM_PHOCAGALLERY_ENABLED');
|
||||
} else {
|
||||
$bgStyle = 'class="alert alert-error alert-danger"';
|
||||
$icon = 'false';
|
||||
$iconText = Text::_('COM_PHOCAGALLERY_DISABLED');
|
||||
}
|
||||
|
||||
echo '<tr '.$bgStyle.'>'
|
||||
.'<td>'. Text::_('COM_PHOCAGALLERY_PAGINATION_THUMBNAIL_GENERATION').'</td>'
|
||||
.'<td align="center">'. HTMLHelper::_('image','media/com_phocagallery/images/administrator/icon-16-true.png', Text::_('COM_PHOCAGALLERY_ENABLED') ) .'</td>'
|
||||
.'<td align="center">'. HTMLHelper::_('image','media/com_phocagallery/images/administrator/icon-16-'.$icon.'.png', Text::_($iconText) ) .'</td>'
|
||||
.'</tr>'
|
||||
.'<tr><td colspan="3">'. Text::_('COM_PHOCAGALLERY_PAGINATION_THUMBNAIL_GENERATION_INFO_DESC').'</td></tr>';
|
||||
|
||||
if ($this->t['cleanthumbnails'] == 0) {
|
||||
$bgStyle = 'class="alert alert-success"';
|
||||
$icon = 'false';
|
||||
$iconText = Text::_('COM_PHOCAGALLERY_DISABLED');
|
||||
|
||||
|
||||
} else {
|
||||
$bgStyle = 'class="alert alert-error alert-danger"';
|
||||
$icon = 'true';
|
||||
$iconText = Text::_('COM_PHOCAGALLERY_ENABLED');
|
||||
}
|
||||
echo '<tr '. $bgStyle.'>'
|
||||
.'<td>'. Text::_('COM_PHOCAGALLERY_CLEAN_THUMBNAILS').'</td>'
|
||||
.'<td align="center">'. HTMLHelper::_('image','media/com_phocagallery/images/administrator/icon-16-false.png' , Text::_('COM_PHOCAGALLERY_DISABLED') ) .'</td>'
|
||||
.'<td align="center">'. JHtml::_('image','media/com_phocagallery/images//administrator/icon-16-'.$icon.'.png', JText::_($iconText) ) .'</td>'
|
||||
.'</tr>'
|
||||
.'<tr><td colspan="3">'. Text::_('COM_PHOCAGALLERY_CLEAN_THUMBNAILS_INFO_DESC').'</td></tr>';
|
||||
|
||||
echo $this->foutput;
|
||||
echo '</table>';
|
||||
|
||||
echo '<h3>'. Text::_('COM_PHOCAGALLERY_HELP').'</h3>';
|
||||
|
||||
echo '<p>'
|
||||
.'<a href="https://www.phoca.cz/phocagallery/" target="_blank">Phoca Gallery Main Site</a><br />'
|
||||
.'<a href="https://www.phoca.cz/documentation/" target="_blank">Phoca Gallery User Manual</a><br />'
|
||||
.'<a href="https://www.phoca.cz/forum/" target="_blank">Phoca Gallery Forum</a><br />'
|
||||
.'</p>';
|
||||
|
||||
echo '<h3>'. Text::_('COM_PHOCAGALLERY_VERSION').'</h3>'
|
||||
.'<p>'. $this->t['version'] .'</p>';
|
||||
|
||||
echo '<h3>'. Text::_('COM_PHOCAGALLERY_COPYRIGHT').'</h3>'
|
||||
.'<p>© 2007 - '. date("Y"). ' Jan Pavelka</p>'
|
||||
.'<p><a href="https://www.phoca.cz/" target="_blank">www.phoca.cz</a></p>';
|
||||
|
||||
echo '<h3>'. Text::_('COM_PHOCAGALLERY_LICENCE').'</h3>'
|
||||
.'<p><a href="http://www.gnu.org/licenses/gpl-2.0.html" target="_blank">GPLv2</a></p>';
|
||||
|
||||
echo '<h3>'. Text::_('COM_PHOCAGALLERY_TRANSLATION').': '. Text::_('COM_PHOCAGALLERY_TRANSLATION_LANGUAGE_TAG').'</h3>'
|
||||
.'<p>© 2007 - '. date("Y"). ' '. Text::_('COM_PHOCAGALLERY_TRANSLATER'). '</p>'
|
||||
.'<p>'.Text::_('COM_PHOCAGALLERY_TRANSLATION_SUPPORT_URL').'</p>';
|
||||
|
||||
echo '<input type="hidden" name="task" value="" />'
|
||||
.'<input type="hidden" name="option" value="com_phocagallery" />'
|
||||
.'<input type="hidden" name="controller" value="phocagalleryin" />';
|
||||
|
||||
echo HTMLHelper::_('image', 'media/com_phocagallery/images/administrator/logo.png', 'Phoca.cz');
|
||||
echo '<p> </p>';
|
||||
|
||||
echo '<div style="border-top:1px solid #eee"></div><p> </p>'
|
||||
.'<div class="btn-group">
|
||||
<a class="btn btn-large btn-primary" href="https://www.phoca.cz/version/index.php?phocagallery='. $this->t['version'] .'" target="_blank"><i class="icon-loop icon-white"></i> '. JText::_('COM_PHOCAGALLERY_CHECK_FOR_UPDATE') .'</a></div>';
|
||||
|
||||
|
||||
echo '<div style="margin-top:30px;height:39px;background: url(\''.Uri::root(true).'/media/com_phocagallery/images/administrator/line.png\') 100% 0 no-repeat;"> </div>';
|
||||
|
||||
|
||||
echo '</div>';
|
||||
//echo '<div class="span1"></div>';
|
||||
echo '</form>';
|
||||
*/
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,153 @@
|
||||
<?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\Component\ComponentHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Toolbar\ToolbarHelper;
|
||||
use Joomla\CMS\Toolbar\Toolbar;
|
||||
jimport( 'joomla.application.component.view' );
|
||||
phocagalleryimport( 'phocagallery.render.renderinfo' );
|
||||
phocagalleryimport( 'phocagallery.utils.utils' );
|
||||
|
||||
class PhocaGalleryCpViewPhocaGalleryIn extends HtmlView
|
||||
{
|
||||
protected $t;
|
||||
protected $r;
|
||||
protected $foutput;
|
||||
|
||||
public function display($tpl = null) {
|
||||
|
||||
|
||||
$params = ComponentHelper::getParams('com_phocagallery');
|
||||
|
||||
//$this->sidebar = Sidebar::render();
|
||||
$this->t = PhocaGalleryUtils::setVars('in');
|
||||
$this->r = new PhocaGalleryRenderAdminview();
|
||||
|
||||
$this->t['component_head'] = $this->t['l'].'_PHOCA_Gallery';
|
||||
$this->t['component_links'] = PhocaGalleryRenderAdmin::getLinks(1);
|
||||
|
||||
|
||||
$this->t['version'] = PhocaGalleryRenderInfo::getPhocaVersion();
|
||||
$this->t['enablethumbcreation'] = $params->get('enable_thumb_creation', 1 );
|
||||
$this->t['paginationthumbnailcreation']= $params->get('pagination_thumbnail_creation', 0 );
|
||||
$this->t['cleanthumbnails'] = $params->get('clean_thumbnails', 0 );
|
||||
$this->t['enablethumbcreationstatus'] = PhocaGalleryRenderAdmin::renderThumbnailCreationStatus((int)$this->t['enablethumbcreation'], 1);
|
||||
|
||||
//Main Function support
|
||||
|
||||
// echo '<table border="1" cellpadding="5" cellspacing="5" style="border:1px solid #ccc;border-collapse:collapse">';
|
||||
|
||||
$function = array('getImageSize','imageCreateFromJPEG', 'imageCreateFromPNG', 'imageCreateFromGIF', 'imageCreateFromWEBP', 'imageCreateFromAVIF', 'imageRotate', 'imageCreateTruecolor', 'imageCopyResampled', 'imageFill', 'imageColorTransparent', 'imageColorAllocate', 'exif_read_data');
|
||||
$this->foutput = '';
|
||||
foreach ($function as $key => $value) {
|
||||
|
||||
if (function_exists($value)) {
|
||||
$bgStyle = 'class="alert alert-success"';
|
||||
//$icon = 'true';
|
||||
$icon = 'success';
|
||||
$iconText = Text::_('COM_PHOCAGALLERY_ENABLED');
|
||||
} else {
|
||||
$bgStyle = 'class="alert alert-error alert-danger"';
|
||||
//$icon = 'false';
|
||||
$icon = 'minus-circle';
|
||||
$iconText = Text::_('COM_PHOCAGALLERY_DISABLED');
|
||||
}
|
||||
|
||||
$this->foutput .= '<tr '.$bgStyle.'><td>'.Text::_('COM_PHOCAGALLERY_FUNCTION') .' '. $value.'</td>';
|
||||
//$this->foutput .= '<td align="center">'.JHtml::_('image','media/com_phocagallery/images/administrator/icon-16-true.png', JText::_('COM_PHOCAGALLERY_ENABLED') ).'</td>';
|
||||
//$this->foutput .= '<td align="center">'. JHtml::_('image','media/com_phocagallery/images/administrator/icon-16-'.$icon.'.png', JText::_($iconText)).'</td></tr>';
|
||||
|
||||
$this->foutput .= '<td align="center" class="ph-info-item ph-cp-item"><i class="phi duotone icon-success" title="'. Text::_('COM_PHOCAGALLERY_ENABLED') .'"></i></td>';
|
||||
$this->foutput .= '<td align="center" class="ph-info-item ph-cp-item"><i class="phi duotone icon-'.$icon.'" title="'. Text::_($iconText) .'"></i></td></tr>';
|
||||
|
||||
}
|
||||
|
||||
// PICASA
|
||||
$this->foutput .= '<tr><td align="left"><b>'. Text::_('COM_PHOCAGALLERY_EXTERNAL_IMAGES_SUPPORT').'</b></td></tr>';
|
||||
|
||||
if(!PhocaGalleryUtils::iniGetBool('allow_url_fopen')){
|
||||
$bgStyle = 'class="alert alert-error alert-danger"';
|
||||
$icon = 'minus-circle';
|
||||
$iconText = Text::_('COM_PHOCAGALLERY_DISABLED');
|
||||
} else {
|
||||
$bgStyle = 'class="alert alert-success"';
|
||||
$icon = 'success';
|
||||
$iconText = Text::_('COM_PHOCAGALLERY_ENABLED');
|
||||
}
|
||||
|
||||
$this->foutput .= '<tr '.$bgStyle.'><td>'.Text::_('COM_PHOCAGALLERY_PHP_SETTINGS_PARAM') .' allow_url_fopen ('.Text::_('COM_PHOCAGALLERY_ENABLED_IF_CURL_DISABLED') .')</td>';
|
||||
//$this->foutput .= '<td align="center">'.JHtml::_('image','media/com_phocagallery/images/administrator/icon-16-true.png', JText::_('COM_PHOCAGALLERY_ENABLED') ).'</td>';
|
||||
//$this->foutput .= '<td align="center">'. JHtml::_('image','media/com_phocagallery/images/administrator/icon-16-'.$icon.'.png', JText::_($iconText)).'</td></tr>';
|
||||
$this->foutput .= '<td align="center" class="ph-info-item ph-cp-item"><i class="phi duotone icon-success" title="'. Text::_('COM_PHOCAGALLERY_ENABLED') .'"></i></td>';
|
||||
$this->foutput .= '<td align="center" class="ph-info-item ph-cp-item"><i class="phi duotone icon-'.$icon.'" title="'. Text::_($iconText) .'"></i></td></tr>';
|
||||
|
||||
|
||||
if(function_exists("curl_init")){
|
||||
$bgStyle = 'class="alert alert-success"';
|
||||
$icon = 'success';
|
||||
$iconText = Text::_('COM_PHOCAGALLERY_ENABLED');
|
||||
} else {
|
||||
$bgStyle = 'class="alert alert-error alert-danger"';
|
||||
$icon = 'minus-circle';
|
||||
$iconText = Text::_('COM_PHOCAGALLERY_DISABLED');
|
||||
}
|
||||
|
||||
if(function_exists("json_decode")){
|
||||
$bgStylej = 'class="alert alert-success"';
|
||||
$iconj = 'success';
|
||||
$iconTextj = Text::_('COM_PHOCAGALLERY_ENABLED');
|
||||
} else {
|
||||
$bgStylej = 'class="alert alert-error alert-danger"';
|
||||
$iconj = 'minus-circle';
|
||||
$iconTextj = Text::_('COM_PHOCAGALLERY_DISABLED');
|
||||
}
|
||||
|
||||
$this->foutput .= '<tr '.$bgStyle.'><td>'.Text::_('COM_PHOCAGALLERY_FUNCTION') .' cURL ('.Text::_('COM_PHOCAGALLERY_ENABLED_IF_FOPEN_DISABLED') .')</td>';
|
||||
//$this->foutput .= '<td align="center">'.JHtml::_('image','media/com_phocagallery/images/administrator/icon-16-true.png', JText::_('COM_PHOCAGALLERY_ENABLED') ).'</td>';
|
||||
//$this->foutput .= '<td align="center">'. JHtml::_('image','media/com_phocagallery/images/administrator/icon-16-'.$icon.'.png', JText::_($iconText)).'</td></tr>';
|
||||
|
||||
$this->foutput .= '<td align="center" class="ph-info-item ph-cp-item"><i class="phi duotone icon-success" title="'. Text::_('COM_PHOCAGALLERY_ENABLED') .'"></i></td>';
|
||||
$this->foutput .= '<td align="center" class="ph-info-item ph-cp-item"><i class="phi duotone icon-'.$icon.'" title="'. Text::_($iconText) .'"></i></td></tr>';
|
||||
|
||||
$this->foutput .= '<tr '.$bgStylej.'><td>'.Text::_('COM_PHOCAGALLERY_FUNCTION') .' json_decode</td>';
|
||||
//$this->foutput .= '<td align="center">'.JHtml::_('image','media/com_phocagallery/images/administrator/icon-16-true.png', JText::_('COM_PHOCAGALLERY_ENABLED') ).'</td>';
|
||||
//$this->foutput .= '<td align="center">'. JHtml::_('image','media/com_phocagallery/images/administrator/icon-16-'.$iconj.'.png', JText::_($iconTextj)).'</td></tr>';
|
||||
|
||||
$this->foutput .= '<td align="center" class="ph-info-item ph-cp-item"><i class="phi duotone icon-success" title="'. Text::_('COM_PHOCAGALLERY_ENABLED') .'"></i></td>';
|
||||
$this->foutput .= '<td align="center" class="ph-info-item ph-cp-item"><i class="phi duotone icon-'.$icon.'" title="'. Text::_($iconText) .'"></i></td></tr>';
|
||||
|
||||
|
||||
|
||||
|
||||
$this->addToolbar();
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
|
||||
protected function addToolBar(){
|
||||
require_once JPATH_COMPONENT.'/helpers/phocagallerycp.php';
|
||||
$canDo = PhocaGalleryCpHelper::getActions(NULL);
|
||||
ToolbarHelper::title(Text::_('COM_PHOCAGALLERY_PG_INFO'), 'info');
|
||||
|
||||
// This button is unnecessary but it is displayed because Joomla! design bug
|
||||
$bar = Toolbar::getInstance( 'toolbar' );
|
||||
$dhtml = '<a href="index.php?option=com_phocagallery" class="btn btn-primary btn-small"><i class="icon-home-2" title="'.Text::_('COM_PHOCAGALLERY_CONTROL_PANEL').'"></i> '.Text::_('COM_PHOCAGALLERY_CONTROL_PANEL').'</a>';
|
||||
$bar->appendButton('Custom', $dhtml);
|
||||
|
||||
if ($canDo->get('core.admin')) {
|
||||
ToolbarHelper::preferences('com_phocagallery');
|
||||
}
|
||||
ToolbarHelper::help( 'screen.phocagallery', true );
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,10 @@
|
||||
<?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();
|
||||
?>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
@ -0,0 +1,106 @@
|
||||
<?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\Session\Session;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Factory;
|
||||
jimport( 'joomla.application.component.view');
|
||||
|
||||
class PhocaGalleryCpViewPhocaGalleryItemA extends HtmlView
|
||||
{
|
||||
function display($tpl = null){
|
||||
|
||||
if (!Session::checkToken('request')) {
|
||||
$response = array(
|
||||
'status' => '0',
|
||||
'error' => '<span class="ph-result-txt ph-error-txt">' . Text::_('JINVALID_TOKEN') . '</span>');
|
||||
echo json_encode($response);
|
||||
return;
|
||||
}
|
||||
|
||||
$app = Factory::getApplication();
|
||||
$q = $app->input->get( 'q', '', 'string' );
|
||||
$id = $app->input->get( 'item_id', '', 'int' );
|
||||
|
||||
if (isset($q) && $q != '') {
|
||||
$db = Factory::getDbo();
|
||||
$query = $db->getQuery(true);
|
||||
|
||||
|
||||
$query->select('a.id as id, a.title as title, a.filename as filename, a.exts as exts');
|
||||
$query->from('`#__phocagallery` AS a');
|
||||
$query->select('c.title AS category_title, c.id AS category_id');
|
||||
$query->join('LEFT', '#__phocagallery_categories AS c ON c.id = a.catid');
|
||||
|
||||
|
||||
$search = $db->Quote('%'.$db->escape($q, true).'%');
|
||||
if ((int)$id > 0) {
|
||||
// It is not related function so we don't limit ID here, used when we ask in product edit other products
|
||||
// $query->where('( a.id <> '.(int)$id.')');
|
||||
}
|
||||
$query->where('( a.title LIKE '.$search.')');
|
||||
//$query->group($db->escape('a.id'));
|
||||
$query->group($db->escape('a.id, a.title, a.filename, a.exts, c.id, c.title'));
|
||||
$query->order($db->escape('a.ordering'));
|
||||
|
||||
$db->setQuery($query);
|
||||
|
||||
|
||||
|
||||
/*if (!$db->query()) {
|
||||
$response = array(
|
||||
'status' => '0',
|
||||
'error' => '<span class="ph-result-txt ph-error-txt">Database Error - Getting Selected Images</span>');
|
||||
echo json_encode($response);
|
||||
return;
|
||||
}*/
|
||||
|
||||
try {
|
||||
$items = $db->loadObjectList();
|
||||
} catch (\RuntimeException $e) {
|
||||
$response = array(
|
||||
'status' => '0',
|
||||
'error' => '<span class="ph-result-txt ph-error-txt">Database Error - Getting Selected Images</span>');
|
||||
echo json_encode($response);
|
||||
return;
|
||||
}
|
||||
|
||||
$itemsA = array();
|
||||
if (!empty($items)) {
|
||||
foreach ($items as $k => $v) {
|
||||
$itemsA[$k]['id'] = $v->id;
|
||||
$itemsA[$k]['title'] = $v->title . ' ('.$v->category_title.')';
|
||||
|
||||
if ($v->exts != '') {
|
||||
$itemsA[$k]['exts']= $v->exts;
|
||||
} else if ($v->filename != '') {
|
||||
$thumb = PhocaGalleryFileThumbnail::getOrCreateThumbnail($v->filename, '', 0, 0, 0, 0);
|
||||
if ($thumb['thumb_name_s_no_rel'] != '') {
|
||||
$itemsA[$k]['image']= $thumb['thumb_name_s_no_rel'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$response = array(
|
||||
'status' => '1',
|
||||
'items' => $itemsA);
|
||||
echo json_encode($response);
|
||||
return;
|
||||
}
|
||||
|
||||
$response = array(
|
||||
'status' => '1',
|
||||
'items' => array());
|
||||
echo json_encode($response);
|
||||
return;
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user