Commit 57360d17 authored by Reinhold Kainhofer's avatar Reinhold Kainhofer
Browse files

Make it work with the new VM Framework

parent f4628973
......@@ -34,7 +34,7 @@ class VirtuemartControllerEuRecap extends VmController {
function __construct(){
parent::__construct();
// Add the proper view pathes...
$this->addViewPath(JPATH_PLUGINS.DS . 'vmextended' . DS . 'eurecap' . DS . 'views');
$this->addViewPath(JPATH_PLUGINS.DS . 'vmextended' . DS . 'eurecap' . DS . 'views' . DS . 'eurecap');
}
public function cancel(){
......
......@@ -24,7 +24,7 @@ class plgVmExtendedEuRecap extends vmExtendedPlugin {
public function __construct (&$subject, $config=array()) {
parent::__construct($subject, $config);
$this->_path = JPATH_PLUGINS.DS.'vmextended'.DS.$this->getName();
JPlugin::loadLanguage('plg_vmextended_'.$this->getName());
$this->loadLanguage('plg_vmextended_'.$this->getName());
}
// public function getVmPluginCreateTableSQL () {
......@@ -45,13 +45,21 @@ class plgVmExtendedEuRecap extends vmExtendedPlugin {
*/
public function onVmAdminController ($controller) {
if ($controller == 'eurecap') {
VmModel::addIncludePath($this->_path . DS . 'models');
// TODO: Make sure the model exists. We probably should find a better way to load this automatically!
// Currently, some path config seems missing, so the model is not found by default.
require_once($this->_path.DS.'models'.DS.'eurecap.php');
require_once($this->_path.DS.'models'.DS.'eurecap_config.php');
VmModel::addIncludePath($this->_path . DS . 'models', 'VirtueMartModel');
// require_once($this->_path.DS.'models'.DS.'eurecap.php');
// require_once($this->_path.DS.'models'.DS.'eurecap_config.php');
require_once($this->_path.DS.'controllers'.DS.'eurecap.php');
// In later VM versions, we can execute the controller here:
$_class = 'VirtueMartController'.ucfirst($controller);
if(!class_exists($_class)){
vmError('Serious Error could not find controller '.$_class,'Serious error, unable to find class');
$app = vFactory::getApplication();
$app->redirect('index.php?option=com_virtuemart');
}
$controller = new $_class();
$controller->execute(vRequest::getCmd('task', $controller));
$controller->redirect();
return true;
}
}
......
......@@ -7,7 +7,7 @@
<authorUrl>http://www.open-tools.net/</authorUrl>
<copyright>Copyright (C) 2015 Reinhold Kainhofer. All rights reserved.</copyright>
<license>http://www.gnu.org/licenses/gpl-3.0.html GNU/GPLv3</license>
<version>0.4</version>
<version>0.5</version>
<releaseDate>2016-01-01</releaseDate>
<releaseType>Update</releaseType>
<downloadUrl>http://www.open-tools.net</downloadUrl>
......
......@@ -252,7 +252,7 @@ vmDebug("SQL: SELECT ".$selectString.$joinedTables.$whereString.$groupBy.$orderB
}
sort($templates, SORT_STRING);
$templates = array_unique($templates);
$options = array();
foreach ($templates as $tmpl) {
$value = substr($tmpl, 7, -4); // Cut off export_ and .php
$options[] = JHtml::_('select.option', vmText::_('VMEXT_EU_RECAP_EXPORT_' . strtoupper($value)), $value);
......
......@@ -34,9 +34,8 @@ if(!defined('VM_VERSION') or VM_VERSION < 3){
class VirtuemartViewEuRecap extends VmViewAdmin {
function __construct(){
parent::__construct();
// Add the proper view pathes...
$this->_addPath('template', JPATH_PLUGINS.DS . 'vmextended' . DS . 'eurecap' . DS . 'views' . DS . $this->getName() . DS . 'tmpl');
// $this->_addPath('models', JPATH_PLUGINS.DS . 'vmextended' . DS . 'eurecap' . DS . 'models' );
$this->_name = "eurecap";
$this->addLayoutPath($this->getName(), JPATH_PLUGINS.DS . 'vmextended' . DS . $this->getName() . DS . 'views' . DS . $this->getName() . DS . 'tmpl');
}
/**
......@@ -47,7 +46,7 @@ class VirtuemartViewEuRecap extends VmViewAdmin {
if (!class_exists('VmHTML'))
require(VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php');
$model = VmModel::getModel();
$model = VmModel::getModel('eurecap');
$this->addStandardDefaultViewLists($model);
vRequest::setvar('task','');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment