primo commit
This commit is contained in:
@ -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 );
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user