mirror of
https://github.com/e107inc/e107.git
synced 2025-08-01 20:30:39 +02:00
Use lanVars() instead of str_replace().
This commit is contained in:
@@ -87,10 +87,8 @@ class e_library_manager
|
|||||||
{
|
{
|
||||||
$library['error'] = LAN_LIBRARY_MANAGER_09;
|
$library['error'] = LAN_LIBRARY_MANAGER_09;
|
||||||
|
|
||||||
$replace = array('[x]');
|
|
||||||
$replace_with = array($library['name']);
|
$replace_with = array($library['name']);
|
||||||
|
$library['error message'] = e107::getParser()->lanVars(LAN_LIBRARY_MANAGER_03, $replace_with);
|
||||||
$library['error message'] = str_replace($replace, $replace_with, LAN_LIBRARY_MANAGER_03);
|
|
||||||
|
|
||||||
return $library;
|
return $library;
|
||||||
}
|
}
|
||||||
@@ -138,7 +136,6 @@ class e_library_manager
|
|||||||
// indexed array of multiple parameters.
|
// indexed array of multiple parameters.
|
||||||
if(isset($library['version arguments'][0]))
|
if(isset($library['version arguments'][0]))
|
||||||
{
|
{
|
||||||
|
|
||||||
if(isset($addonClass) && class_exists($addonClass)) /* @FIXME Perhaps use e107::callMethod() ? */
|
if(isset($addonClass) && class_exists($addonClass)) /* @FIXME Perhaps use e107::callMethod() ? */
|
||||||
{
|
{
|
||||||
$class = new $addonClass();
|
$class = new $addonClass();
|
||||||
@@ -171,10 +168,8 @@ class e_library_manager
|
|||||||
{
|
{
|
||||||
$library['error'] = LAN_LIBRARY_MANAGER_10;
|
$library['error'] = LAN_LIBRARY_MANAGER_10;
|
||||||
|
|
||||||
$replace = array('[x]');
|
|
||||||
$replace_with = array($library['name']);
|
$replace_with = array($library['name']);
|
||||||
|
$library['error message'] = e107::getParser()->lanVars(LAN_LIBRARY_MANAGER_04, $replace_with);
|
||||||
$library['error message'] = str_replace($replace, $replace_with, LAN_LIBRARY_MANAGER_04);
|
|
||||||
|
|
||||||
return $library;
|
return $library;
|
||||||
}
|
}
|
||||||
@@ -196,11 +191,8 @@ class e_library_manager
|
|||||||
{
|
{
|
||||||
$library['error'] = LAN_LIBRARY_MANAGER_11;
|
$library['error'] = LAN_LIBRARY_MANAGER_11;
|
||||||
|
|
||||||
$replace = array('[x]', '[y]');
|
|
||||||
$replace_with = array($library['version'], $library['name']);
|
$replace_with = array($library['version'], $library['name']);
|
||||||
|
$library['error message'] = e107::getParser()->lanVars(LAN_LIBRARY_MANAGER_05, $replace_with);
|
||||||
/* @XXX - $tp->lanVars() ? */
|
|
||||||
$library['error message'] = str_replace($replace, $replace_with, LAN_LIBRARY_MANAGER_05);
|
|
||||||
|
|
||||||
return $library;
|
return $library;
|
||||||
}
|
}
|
||||||
@@ -284,10 +276,8 @@ class e_library_manager
|
|||||||
{
|
{
|
||||||
$variant['error'] = LAN_LIBRARY_MANAGER_09;
|
$variant['error'] = LAN_LIBRARY_MANAGER_09;
|
||||||
|
|
||||||
$replace = array('[x]', '[y]');
|
|
||||||
$replace_with = array($variant_name, $library['name']);
|
$replace_with = array($variant_name, $library['name']);
|
||||||
|
$variant['error message'] = e107::getParser()->lanVars(LAN_LIBRARY_MANAGER_06, $replace_with);
|
||||||
$variant['error message'] = str_replace($replace, $replace_with, LAN_LIBRARY_MANAGER_06);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -725,20 +715,16 @@ class e_library_manager
|
|||||||
$library['installed'] = false;
|
$library['installed'] = false;
|
||||||
$library['error'] = LAN_LIBRARY_MANAGER_07;
|
$library['error'] = LAN_LIBRARY_MANAGER_07;
|
||||||
|
|
||||||
$replace = array('[x]', '[y]');
|
|
||||||
$replace_with = array($dependency['name'], $library['name']);
|
$replace_with = array($dependency['name'], $library['name']);
|
||||||
|
$library['error message'] = e107::getParser()->lanVars(LAN_LIBRARY_MANAGER_01, $replace_with);
|
||||||
$library['error message'] = str_replace($replace, $replace_with, LAN_LIBRARY_MANAGER_01); /* FIXME $tp->lanVars() */
|
|
||||||
}
|
}
|
||||||
elseif($this->checkIncompatibility($dependency_info, $dependency['version']))
|
elseif($this->checkIncompatibility($dependency_info, $dependency['version']))
|
||||||
{
|
{
|
||||||
$library['installed'] = false;
|
$library['installed'] = false;
|
||||||
$library['error'] = LAN_LIBRARY_MANAGER_08;
|
$library['error'] = LAN_LIBRARY_MANAGER_08;
|
||||||
|
|
||||||
$replace = array('[x]', '[y]', '[z]');
|
|
||||||
$replace_with = array($dependency['version'], $library['name'], $library['name']);
|
$replace_with = array($dependency['version'], $library['name'], $library['name']);
|
||||||
|
$library['error message'] = e107::getParser()->lanVars(LAN_LIBRARY_MANAGER_02, $replace_with);
|
||||||
$library['error message'] = str_replace($replace, $replace_with, LAN_LIBRARY_MANAGER_02); /* FIXME $tp->lanVars() */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove the version string from the dependency, so load() can load the libraries directly.
|
// Remove the version string from the dependency, so load() can load the libraries directly.
|
||||||
|
Reference in New Issue
Block a user