Permalink
Browse files

Allow all OSCOM::getLink() function parameters to be defined

  • Loading branch information...
haraldpdl committed Feb 12, 2014
1 parent ca49f80 commit 42d52eb622e9947dca8c49ee1041bdf38e23c9b5
Showing with 24 additions and 6 deletions.
  1. +24 −6 osCommerce/OM/Core/Template/Tag/link.php
@@ -1,20 +1,18 @@
<?php
/**
* osCommerce Online Merchant
- *
- * @copyright Copyright (c) 2012 osCommerce; http://www.oscommerce.com
+ *
+ * @copyright Copyright (c) 2014 osCommerce; http://www.oscommerce.com
* @license BSD License; http://www.oscommerce.com/bsdlicense.txt
*/
namespace osCommerce\OM\Core\Template\Tag;
- use osCommerce\OM\Core\OSCOM;
-
class link extends \osCommerce\OM\Core\Template\TagAbstract {
static protected $_parse_result = false;
static public function execute($string) {
- $params = explode('|', $string, 3);
+ $params = explode('|', $string);
if ( !isset($params[1]) ) {
$params[1] = null;
@@ -24,7 +22,27 @@ static public function execute($string) {
$params[2] = null;
}
- return OSCOM::getLink($params[1], $params[0], $params[2]);
+ $tmp = $params[1];
+ $params[1] = $params[0];
+ $params[0] = $tmp;
+
+ if ( isset($params[4]) ) {
+ if ( strtolower($params[4]) == 'true' ) {
+ $params[4] = true;
+ } elseif ( strtolower($params[4]) == 'false' ) {
+ $params[4] = false;
+ }
+ }
+
+ if ( isset($params[5]) ) {
+ if ( strtolower($params[5]) == 'true' ) {
+ $params[5] = true;
+ } elseif ( strtolower($params[5]) == 'false' ) {
+ $params[5] = false;
+ }
+ }
+
+ return call_user_func_array('osCommerce\OM\Core\OSCOM::getLink', $params);
}
}
?>

0 comments on commit 42d52eb

Please sign in to comment.