Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#11: Initial 'true' plugin implementation
... still need documentation updates!
- Loading branch information
Showing
14 changed files
with
1,032 additions
and
266 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
YOUR_ADMIN/includes/classes/observers/UsuAdminObserver.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php | ||
/** | ||
* Part of Ultimate URLs for Zen Cart. | ||
* | ||
* @copyright Copyright 2019 Cindy Merkin (vinosdefrutastropicales.com) | ||
* @license http://www.gnu.org/licenses/gpl.txt GNU GPL V3.0 | ||
*/ | ||
if (!defined('IS_ADMIN_FLAG') || IS_ADMIN_FLAG !== true) { | ||
die('Illegal Access'); | ||
} | ||
|
||
class UsuAdminObserver extends base | ||
{ | ||
public function __construct() | ||
{ | ||
$this->enabled = (defined('USU_ENABLED') && USU_ENABLED == 'true'); | ||
if ($this->enabled) { | ||
$this->attach ( | ||
$this, | ||
array( | ||
/* From /admin/includes/functions/html_output.php */ | ||
'NOTIFY_SEFU_INTERCEPT_ADMCATHREF', | ||
) | ||
); | ||
|
||
if (!class_exists('usu')) { | ||
require DIR_FS_CATALOG . DIR_WS_CLASSES . 'usu.php'; | ||
} | ||
$this->usu = new usu(); | ||
} | ||
} | ||
|
||
public function update(&$class, $eventID, $p1, &$p2, &$p3, &$p4, &$p5, &$p6, &$p7, &$p8) | ||
{ | ||
switch ($eventID) { | ||
// ----- | ||
// Issued at the top of the zen_catalog_href_link function to allow us to override the href-link | ||
// returned. | ||
// | ||
// On entry: | ||
// | ||
// $p1 ... n/a | ||
// $p2 ... A reference to the to-be-returned $link; set this to a non-null value to override. | ||
// $p3 ... A reference to the page associated with the to-be-generated link | ||
// $p4 ... A reference to the parameters associated with the to-be-generated link | ||
// $p5 ... A reference to the (input) connection type (either 'SSL' or 'NONSSL') to be used for the link | ||
// | ||
case 'NOTIFY_SEFU_INTERCEPT_ADMCATHREF': | ||
$p2 = $this->usu->href_link($p3, $p4, $p5); | ||
break; | ||
|
||
default: | ||
break; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
<?php | ||
/** | ||
* Part of Ultimate URLs for Zen Cart. | ||
* Part of Ultimate URLs for Zen Cart, v3.0.0+. | ||
* | ||
* @copyright Copyright 2019 Cindy Merkin (vinosdefrutastropicales.com) | ||
* @copyright Copyright 2013 - 2015 Andrew Ballanger | ||
* @license http://www.gnu.org/licenses/gpl.txt GNU GPL V3.0 | ||
*/ | ||
|
||
define('TABLE_USU_CACHE', DB_PREFIX . 'usu_cache'); | ||
|
||
define('FILENAME_USU_UNINSTALL', 'usu_uninstall'); |
Oops, something went wrong.