Skip to content

Commit

Permalink
3.0.0 RC3
Browse files Browse the repository at this point in the history
  • Loading branch information
PhocaCz committed Oct 18, 2016
1 parent 9249e21 commit 052f48a
Show file tree
Hide file tree
Showing 373 changed files with 9,200 additions and 1,518 deletions.
292 changes: 245 additions & 47 deletions config.xml

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die('Restricted access');
defined('_JEXEC') or die;

jimport('joomla.application.component.controller');
$app = JFactory::getApplication();
Expand Down Expand Up @@ -34,6 +34,8 @@
$l['do'] = array('COM_PHOCACART_DOWNLOADS', 'phocacartdownloads');
$l['tg'] = array('COM_PHOCACART_TAGS', 'phocacarttags');
$l['fd'] = array('COM_PHOCACART_XML_FEEDS', 'phocacartfeeds');
$l['wl'] = array('COM_PHOCACART_WISH_LISTS', 'phocacartwishlists');
$l['qu'] = array('COM_PHOCACART_QUESTIONS', 'phocacartquestions');
$l['sc'] = array('COM_PHOCACART_STATISTICS', 'phocacartstatistics');
$l['lo'] = array('COM_PHOCACART_SYSTEM_LOG', 'phocacartlogs');
$l['in'] = array('COM_PHOCACART_INFO', 'phocacartinfo');
Expand Down
2 changes: 1 addition & 1 deletion controllers/phocacartcart.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function &getModel($name = 'PhocaCartCart', $prefix = 'PhocaCartCpModel',
}

function emptycart() {
if (!JRequest::checkToken('request')) {
if (!JSession::checkToken('request')) {
$app->enqueueMessage('Invalid Token', 'message');
return false;
}
Expand Down
12 changes: 8 additions & 4 deletions controllers/phocacartcategory.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,25 @@
class PhocaCartCpControllerPhocaCartCategory extends PhocaCartCpControllerPhocaCartCommon
{
public function batch($model = null) {
JRequest::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
$model = $this->getModel('phocacartcategory', '', array());
$this->setRedirect(JRoute::_('index.php?option=com_phocacart&view=phocacartcategories'.$this->getRedirectToListAppend(), false));
return parent::batch($model);
}

function recreate() {
$app = JFactory::getApplication();
$cid = JRequest::getVar( 'cid', array(), '', 'array' );
$cid = JFactory::getApplication()->input->get( 'cid', array(), '', 'array' );
JArrayHelper::toInteger($cid);

$message = '';

if (count( $cid ) < 1) {
JError::raiseError(500, JText::_( 'COM_PHOCACART_SELECT_ITEM_RECREATE' ) );
$message = JText::_( 'COM_PHOCACART_SELECT_ITEM_RECREATE' );
$app->enqueueMessage($message, 'error');
$app->redirect('index.php?option=com_phocacart&view=phocacartcategories');
}
$message = '';

$model = $this->getModel( 'phocacartcategory' );
if(!$model->recreate($cid, $message)) {
$message = PhocaCartUtils::setMessage($message, JText::_( 'COM_PHOCACART_ERROR_THUMBS_REGENERATING' ));
Expand Down
2 changes: 1 addition & 1 deletion controllers/phocacarteditstatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function &getModel($name = 'PhocaCartEditStatus', $prefix = 'PhocaCartCpM

function editstatus() {

if (!JRequest::checkToken('request')) {
if (!JSession::checkToken('request')) {
$app->enqueueMessage('Invalid Token', 'message');
return false;
}
Expand Down
31 changes: 18 additions & 13 deletions controllers/phocacartformfields.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,23 @@ public function &getModel($name = 'PhocaCartFormfield', $prefix = 'PhocaCartCpMo
}

function displaybilling() {
JRequest::checkToken() or die(JText::_('JINVALID_TOKEN'));

$cid = JRequest::getVar('cid', array(), '', 'array');
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));

$app = JFactory::getApplication();
$cid = $app->input->get('cid', array(), '', 'array');
$data = array('displaybilling' => 1, 'hidebilling' => 0);
$task = $this->getTask();
$value = JArrayHelper::getValue($data, $task, 0, 'int');



if (empty($cid)) {
JError::raiseWarning(500, JText::_($this->text_prefix.'_NO_ITEM_SELECTED'));
$app->enqueueMessage(JText::_($this->text_prefix.'_NO_ITEM_SELECTED'), 'error');
} else {
$model = $this->getModel();
JArrayHelper::toInteger($cid);
if (!$model->displayItem($cid, $value, 'display_billing')) {
JError::raiseWarning(500, $model->getError());
$app->enqueueMessage($model->getError(), 'error');
} else {
if ($value == 1) {
$ntext = $this->text_prefix.'_N_ITEMS_DISPLAYED';
Expand All @@ -53,20 +56,21 @@ function displaybilling() {
}

function displayshipping() {
JRequest::checkToken() or die(JText::_('JINVALID_TOKEN'));
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));

$cid = JRequest::getVar('cid', array(), '', 'array');
$app = JFactory::getApplication();
$cid = $app->input->get('cid', array(), '', 'array');
$data = array('displayshipping' => 1, 'hideshipping' => 0);
$task = $this->getTask();
$value = JArrayHelper::getValue($data, $task, 0, 'int');

if (empty($cid)) {
JError::raiseWarning(500, JText::_($this->text_prefix.'_NO_ITEM_SELECTED'));
$app->enqueueMessage(JText::_($this->text_prefix.'_NO_ITEM_SELECTED'), 'error');
} else {
$model = $this->getModel();
JArrayHelper::toInteger($cid);
if (!$model->displayItem($cid, $value, 'display_shipping')) {
JError::raiseWarning(500, $model->getError());
$app->enqueueMessage($model->getError(), 'error');
} else {
if ($value == 1) {
$ntext = $this->text_prefix.'_N_ITEMS_DISPLAYED';
Expand All @@ -80,20 +84,21 @@ function displayshipping() {
}

function displayaccount() {
JRequest::checkToken() or die(JText::_('JINVALID_TOKEN'));
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));

$cid = JRequest::getVar('cid', array(), '', 'array');
$app = JFactory::getApplication();
$cid = $app->input->get('cid', array(), '', 'array');
$data = array('displayaccount' => 1, 'hideaccount' => 0);
$task = $this->getTask();
$value = JArrayHelper::getValue($data, $task, 0, 'int');

if (empty($cid)) {
JError::raiseWarning(500, JText::_($this->text_prefix.'_NO_ITEM_SELECTED'));
$app->enqueueMessage(JText::_($this->text_prefix.'_NO_ITEM_SELECTED'), 'error');
} else {
$model = $this->getModel();
JArrayHelper::toInteger($cid);
if (!$model->displayItem($cid, $value, 'display_account')) {
JError::raiseWarning(500, $model->getError());
$app->enqueueMessage($model->getError(), 'error');
} else {
if ($value == 1) {
$ntext = $this->text_prefix.'_N_ITEMS_DISPLAYED';
Expand Down
8 changes: 5 additions & 3 deletions controllers/phocacartitem.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
class PhocaCartCpControllerPhocaCartItem extends PhocaCartCpControllerPhocaCartCommon
{
public function batch($model = null) {
JRequest::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
$model = $this->getModel('phocacartitem', '', array());
$this->setRedirect(JRoute::_('index.php?option=com_phocacart&view=phocacartitems'.$this->getRedirectToListAppend(), false));

Expand All @@ -21,11 +21,13 @@ public function batch($model = null) {

function recreate() {
$app = JFactory::getApplication();
$cid = JRequest::getVar( 'cid', array(), '', 'array' );
$cid = JFactory::getApplication()->input->get( 'cid', array(), '', 'array' );
JArrayHelper::toInteger($cid);

if (count( $cid ) < 1) {
JError::raiseError(500, JText::_( 'COM_PHOCACART_SELECT_ITEM_RECREATE' ) );
$message = JText::_( 'COM_PHOCACART_SELECT_ITEM_RECREATE' );
$app->enqueueMessage($message, 'error');
$app->redirect('index.php?option=com_phocacart&view=phocacartcategories');
}
$message = '';
$model = $this->getModel( 'phocacartitem' );
Expand Down
23 changes: 9 additions & 14 deletions controllers/phocacartitems.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public function featured()
// Check for request forgeries
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));

$app = JFactory::getApplication();
$user = JFactory::getUser();
$ids = $this->input->get('cid', array(), 'array');
$values = array('featured' => 1, 'unfeatured' => 0);
Expand All @@ -38,26 +39,20 @@ public function featured()
{
// Prune items that you can't change.
unset($ids[$i]);
JError::raiseNotice(403, JText::_('JLIB_APPLICATION_ERROR_EDITSTATE_NOT_PERMITTED'));
$this->setError(JText::_('JLIB_APPLICATION_ERROR_EDITSTATE_NOT_PERMITTED'));
$this->setMessage($this->getError(), 'error');
}
}

if (empty($ids))
{
JError::raiseWarning(500, JText::_('JERROR_NO_ITEMS_SELECTED'));
}
else
{
// Get the model.
$model = $this->getModel();
if (empty($ids)) {
$app->enqueueMessage(JText::_('COM_PHOCACART_ERROR_NO_ITEMS_SELECTED'), 'error');
} else {

// Publish the items.
if (!$model->featured($ids, $value))
{
JError::raiseWarning(500, $model->getError());
$model = $this->getModel();
if (!$model->featured($ids, $value)) {
$app->enqueueMessage($model->getError(), 'error');
}
}

$this->setRedirect('index.php?option=com_phocacart&view=phocacartitems');
}
}
Expand Down
12 changes: 12 additions & 0 deletions controllers/phocacartquestion.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?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();
require_once JPATH_COMPONENT.'/controllers/phocacartcommon.php';
class PhocaCartCpControllerPhocaCartQuestion extends PhocaCartCpControllerPhocaCartCommon {}
?>
18 changes: 18 additions & 0 deletions controllers/phocacartquestions.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?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();
require_once JPATH_COMPONENT.'/controllers/phocacartcommons.php';
class PhocaCartCpControllerPhocaCartQuestions extends PhocaCartCpControllerPhocaCartCommons
{
public function &getModel($name = 'PhocaCartQuestion', $prefix = 'PhocaCartCpModel', $config = array()) {
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
return $model;
}
}
?>
24 changes: 12 additions & 12 deletions controllers/phocacartupload.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function __construct() {
}

function createfolder() {
JRequest::checkToken() or jexit( 'COM_PHOCADOWNLOAD_INVALID_TOKEN' );
JSession::checkToken() or jexit( 'COM_PHOCADOWNLOAD_INVALID_TOKEN' );
$app = JFactory::getApplication();

// Set FTP credentials, if given
Expand All @@ -29,13 +29,13 @@ function createfolder() {
$folder_permissions = $paramsC->get( 'folder_permissions', 0755 );
//$folder_permissions = octdec((int)$folder_permissions);

$folderNew = JRequest::getCmd( 'foldername', '');
$folderCheck = JRequest::getVar( 'foldername', null, '', 'string', JREQUEST_ALLOWRAW);
$parent = JRequest::getVar( 'folderbase', '', '', 'path' );
$tab = JRequest::getVar( 'tab', 0, '', 'string' );
$field = JRequest::getVar( 'field');
$viewBack = JRequest::getVar( 'viewback', '', '', 'phocacartmanager' );
$manager = JRequest::getVar( 'manager', 'file', '', 'string' );
$folderNew = $app->input->get( 'foldername', '');
$folderCheck = $app->input->get( 'foldername', null, 'raw');
$parent = $app->input->get( 'folderbase', '', 'path' );
$tab = $app->input->get( 'tab', 0, 'string' );
$field = $app->input->get( 'field');
$viewBack = $app->input->get( 'viewback', 'phocacartmanager' );
$manager = $app->input->get( 'manager', 'file', 'string' );


$link = '';
Expand All @@ -49,14 +49,14 @@ function createfolder() {
exit;
}

JRequest::setVar('folder', $parent);
JFactory::getApplication()->input->set('folder', $parent);

if (($folderCheck !== null) && ($folderNew !== $folderCheck)) {
$app->redirect($link, JText::_('COM_PHOCACART_WARNING_DIRNAME'));
}

if (strlen($folderNew) > 0) {
$folder = JPath::clean($path['orig_abs_ds'].$parent.DS.$folderNew);
$folder = JPath::clean($path['orig_abs_ds'].$parent.'/'.$folderNew);

if (!JFolder::exists($folder) && !JFile::exists($folder)) {
//JFolder::create($path, $folder_permissions );
Expand All @@ -81,7 +81,7 @@ function createfolder() {
}
if (isset($folder)) {
$data = "<html>\n<body bgcolor=\"#FFFFFF\">\n</body>\n</html>";
JFile::write($folder.DS."index.html", $data);
JFile::write($folder."/index.html", $data);
} else {
$app->redirect($link, JText::_('COM_PHOCACART_ERROR_FOLDER_CREATING'));
}
Expand All @@ -90,7 +90,7 @@ function createfolder() {
} else {
$app->redirect($link, JText::_('COM_PHOCACART_ERROR_FOLDER_CREATING_EXISTS'));
}
//JRequest::setVar('folder', ($parent) ? $parent.'/'.$folder : $folder);
//JFactory::getApplication()->input->set('folder', ($parent) ? $parent.'/'.$folder : $folder);
}
$app->redirect($link);
}
Expand Down
2 changes: 1 addition & 1 deletion controllers/phocacartuser.json.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class PhocaCartCpControllerPhocaCartUser extends JControllerForm
{
public function setregion() {

if (!JRequest::checkToken('request')) {
if (!JSession::checkToken('request')) {
$response = array(
'status' => '0',
'error' => '<div class="alert alert-danger">' . JText::_('JINVALID_TOKEN') . '</div>');
Expand Down
12 changes: 12 additions & 0 deletions controllers/phocacartwishlist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?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();
require_once JPATH_COMPONENT.'/controllers/phocacartcommon.php';
class PhocaCartCpControllerPhocaCartWishList extends PhocaCartCpControllerPhocaCartCommon {}
?>
18 changes: 18 additions & 0 deletions controllers/phocacartwishlists.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?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();
require_once JPATH_COMPONENT.'/controllers/phocacartcommons.php';
class PhocaCartCpControllerPhocaCartWishLists extends PhocaCartCpControllerPhocaCartCommons
{
public function &getModel($name = 'PhocaCartWishList', $prefix = 'PhocaCartCpModel', $config = array()) {
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
return $model;
}
}
?>
2 changes: 1 addition & 1 deletion help/en-GB/screen.phocacart.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php defined('_JEXEC') or die('Restricted access');?>
<?php defined('_JEXEC') or die;?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en_GB" xml:lang="en_GB">
Expand Down
2 changes: 1 addition & 1 deletion help/screen.phocacart.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php defined('_JEXEC') or die('Restricted access');?>
<?php defined('_JEXEC') or die;?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en_GB" xml:lang="en_GB">
Expand Down
15 changes: 15 additions & 0 deletions helpers/phocacartquestions.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?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();
require_once JPATH_COMPONENT.'/helpers/phocacartcommon.php';
class PhocaCartQuestionsHelper extends PhocaCartCommonHelper
{

}
?>
Loading

0 comments on commit 052f48a

Please sign in to comment.