File: /var/www/vhosts/pgkdistribution.com.au/citisolar.com.au/tmp/admin/views/prod/view.html.php
<?php
/**
* @Copyright Freestyle Joomla (C) 2010
* @license GNU/GPL http://www.gnu.org/copyleft/gpl.html
*
* This file is part of Freestyle Testimonials
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
**/
?>
<?php
// No direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
jimport( 'joomla.application.component.view' );
class FstsViewProd extends JView
{
function display($tpl = null)
{
$prod =& $this->get('Data');
$isNew = ($prod->id < 1);
$text = $isNew ? JText::_("NEW") : JText::_("EDIT");
JToolBarHelper::title( JText::_("PRODUCT").': <small><small>[ ' . $text.' ]</small></small>', 'fst_prods' );
JToolBarHelper::save();
if ($isNew) {
JToolBarHelper::cancel();
} else {
// for existing items the button is renamed `close`
JToolBarHelper::cancel( 'cancel', 'Close' );
}
FSTAdminHelper::DoSubToolbar();
$this->assignRef('prod', $prod);
$path = JPATH_SITE.DS.'images'.DS.'fst'.DS.'products';
if (!file_exists($path))
mkdir($path,0777,true);
$files = JFolder::files($path,'.png$');
$sections[] = JHTML::_('select.option', '', JText::_("NO_IMAGE"), 'id', 'title');
foreach ($files as $file)
{
$sections[] = JHTML::_('select.option', $file, $file, 'id', 'title');
}
$lists['images'] = JHTML::_('select.genericlist', $sections, 'image', 'class="inputbox" size="1" ', 'id', 'title', $prod->image);
$this->assignRef('lists', $lists);
parent::display($tpl);
}
}