Skip to content
Snippets Groups Projects
Commit 9784c4d4 authored by Reinhold Kainhofer's avatar Reinhold Kainhofer
Browse files

V3.99a: Old php versions don't support anonymous functions

parent 76ca0bb9
Branches
Tags
No related merge requests found
BASE=ordernumber
PLUGINTYPE=vmshopper
VERSION=3.99
VERSION=3.99a
PLUGINFILES=$(BASE).php ordernumber_helper_joomla.php $(BASE).script.php $(BASE).xml index.html library/
......
......@@ -155,7 +155,6 @@ a#credentials_check {
if ($this->value!=1) {
$this->value=0;
}
// if ($this->value==1) {
return "<input type='hidden' id=\"update_credentials_hidden_checked\" name='".$this->name."' value='".$this->value."' /><div class='credentials_checked credentials_checked_".$this->value."'><a href=\"#\" class=\"btn btn-info credentials_check\" id=\"credentials_check\" onclick=\"checkUpdateCredentials()\" >".JText::_('OPENTOOLS_CHECK_CREDENTIALS')."</a></div>";
}
}
......@@ -297,11 +297,14 @@ class OrdernumberHelper {
}
}
protected function no_array($v) {
return !is_array($v);
}
protected function doReplacements ($fmt, $reps) {
// First, replace all random...[n] fields. This needs to be done with a regexp and a callback:
$fmt = preg_replace_callback ('/\[(random)(.*?)([0-9]*?)\]/', array($this, 'replaceRandom'), $fmt);
// Only use string-valued variables for replacement (array-valued variables can be used in custom variable definitions!)
$reps = array_filter($reps, function($v) { return !is_array($v);} );
$reps = array_filter($reps, array($this, "no_array") );
return str_ireplace (array_keys($reps), array_values($reps), $fmt);
}
......
......@@ -7,7 +7,7 @@
<authorUrl>http://www.open-tools.net/</authorUrl>
<copyright>Copyright (C) 2012-2015 Reinhold Kainhofer. All rights reserved.</copyright>
<license>http://www.gnu.org/licenses/gpl-3.0.html GNU/GPLv3</license>
<version>3.99</version>
<version>3.99a</version>
<releaseDate>2015-05-23</releaseDate>
<releaseType>Minor update</releaseType>
<downloadUrl>http://open-tools.net/virtuemart/advanced-ordernumbers.html</downloadUrl>
......
File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment