Skip to content

Commit

Permalink
Merge branch 'master' of bitbucket.org:comercia/mollie
Browse files Browse the repository at this point in the history
  • Loading branch information
maximj committed Jan 8, 2019
2 parents c11c8ad + 309801a commit 478ef6c
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 10 deletions.
4 changes: 2 additions & 2 deletions admin/controller/payment/mollie/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,9 @@ public function clearData() {
public function index ()
{
// Double-check if clean-up has been done - For upgrades
if (empty($this->config->get('payment_mollie_version')) || $this->config->get('payment_mollie_version') < MOLLIE_VERSION) {
if (empty($this->config->get('mollie_payment_version')) || $this->config->get('mollie_payment_version') < MOLLIE_VERSION) {
$this->cleanUp();
Util::config(0)->set('payment_mollie', 'payment_mollie_version', MOLLIE_VERSION);
Util::config(0)->set('mollie_payment', 'mollie_payment_version', MOLLIE_VERSION);
}

$adminThemeDir = DIR_APPLICATION . 'view/template/';
Expand Down
37 changes: 29 additions & 8 deletions system/comercia/load.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ function library($library)
$bestOption = $this->findBestOption($libDir, $library, "php");
if (!class_exists($className)) {
if (class_exists("VQMod")) {
@include_once(\VQMod::modCheck($libDir . $bestOption["name"] . ".php"));
@include_once(\VQMod::modCheck(modification($libDir . $bestOption["name"] . ".php"), $libDir . $bestOption["name"] . ".php"));
} else {
@include_once($libDir . $bestOption["name"] . ".php");
@include_once(modification($libDir . $bestOption["name"] . ".php"));
}
}

Expand Down Expand Up @@ -108,9 +108,9 @@ function model($model)
$className = $route["class"];
if (!class_exists($className)) {
if (class_exists("VQMod")) {
@include_once(\VQMod::modCheck($modelDir . $route["file"] . ".php"));
@include_once(\VQMod::modCheck(modification($modelDir . $route["file"] . ".php"), $modelDir . $route["file"] . ".php"));
} else {
@include_once($modelDir . $route["file"] . ".php");
@include_once(modification($modelDir . $route["file"] . ".php"));
}
}

Expand Down Expand Up @@ -234,9 +234,9 @@ function view($view, $data = array())
}
$fakeControllerFile = __DIR__ . "/fakeController.php";
if (class_exists("VQMod")) {
require_once(\VQMod::modCheck($fakeControllerFile));
require_once(\VQMod::modCheck(modification($fakeControllerFile), $fakeControllerFile));
} else {
require_once($fakeControllerFile);
require_once(modification($fakeControllerFile));
}
$controller = new FakeController($registry);
$result = $controller->getView($view, $data);
Expand Down Expand Up @@ -326,9 +326,9 @@ function controller($controller)
$className = $route["class"];
if (!class_exists($className)) {
if (class_exists("VQMod")) {
@include_once(\VQMod::modCheck($controllerDir . $route["file"] . ".php"));
@include_once(\VQMod::modCheck(modification($controllerDir . $route["file"] . ".php"), $controllerDir . $route["file"] . ".php"));
} else {
@include_once($controllerDir . $route["file"] . ".php");
@include_once(modification($controllerDir . $route["file"] . ".php"));
}
}

Expand Down Expand Up @@ -393,6 +393,27 @@ private function rewriteLanguage($model)
]
);
}

// Modification Override
function modification($filename) {
if (defined('DIR_CATALOG')) {
$file = DIR_MODIFICATION . 'admin/' . substr($filename, strlen(DIR_APPLICATION));
} elseif (defined('DIR_OPENCART')) {
$file = DIR_MODIFICATION . 'install/' . substr($filename, strlen(DIR_APPLICATION));
} else {
$file = DIR_MODIFICATION . 'catalog/' . substr($filename, strlen(DIR_APPLICATION));
}

if (substr($filename, 0, strlen(DIR_SYSTEM)) == DIR_SYSTEM) {
$file = DIR_MODIFICATION . 'system/' . substr($filename, strlen(DIR_SYSTEM));
}

if (is_file($file)) {
return $file;
}

return $filename;
}
}

?>

0 comments on commit 478ef6c

Please sign in to comment.