Permalink
Browse files

updates

  • Loading branch information...
1 parent 0e1a4ce commit 36b4418605bd0640b59e1716d8e6afb9c8fa51dd @haraldpdl committed Mar 2, 2012
Showing with 11 additions and 9 deletions.
  1. +8 −6 osCommerce/OM/Core/Template.php
  2. +3 −3 osCommerce/OM/Core/Template/WidgetAbstract.php
@@ -637,7 +637,11 @@ public function setShowDebugMessages($bool) {
* @since HPDL
*/
- public function getContent() {
+ public function getContent($file = null) {
+ if ( !isset($file) ) {
+ $file = $this->getTemplateFile();
+ }
+
// The following is only needed until content pages no longer contain PHP; HPDL
$rick_astley = array('GLOBALS', '_GET', '_POST', '_COOKIE', '_SESSION', '_FILES', '_SERVER');
$never_gonna_give_you_up = array();
@@ -652,7 +656,7 @@ public function getContent() {
ob_start();
- require($this->getTemplateFile());
+ include($file);
$content = ob_get_clean();
@@ -668,9 +672,7 @@ public function parseContent($content) {
$pattern = '/{([[:alpha:]][[:alnum:]]*)\b( .*?)?}(.*?)?{\1}/s';
- $template_file = $this->getTemplateFile();
-
- $le = function ($matches) use (&$le, &$pattern, &$template_file) {
+ $le = function ($matches) use (&$le, &$pattern) {
$string = $matches[3];
if ( preg_match($pattern, $string) > 0 ) {
@@ -698,7 +700,7 @@ public function parseContent($content) {
trigger_error('Template Tag {' . $matches[1] . '} module does not implement TagInterface');
}
} else {
- trigger_error('Template Tag {' . $matches[1] . '} module not found in ' . $template_file);
+ trigger_error('Template Tag {' . $matches[1] . '} module does not exist');
return $matches[0];
}
@@ -11,19 +11,19 @@
use osCommerce\OM\Core\Registry;
abstract class WidgetAbstract {
- static public function initialize() {
+ static public function initialize($param = null) {
$widget = array_slice(explode('\\', get_called_class()), -2, 1);
Registry::get('Language')->loadIniFile('Modules/Template/Widgets/' . $widget[0] . '.php');
- return static::execute();
+ return static::execute($param);
}
/**
* Not declared as an abstract static function as it freaks PHP 5.3 out
*/
- static public function execute() {
+ static public function execute($param = null) {
return false;
}
}

0 comments on commit 36b4418

Please sign in to comment.