Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Update for Smarty 3

  • Loading branch information...
commit 933ab212d0076dc3eafec90878bce7933b109656 1 parent 61e9983
@davejamesmiller authored
Showing with 6 additions and 9 deletions.
  1. +6 −9 smarty/function.select_country.php
View
15 smarty/function.select_country.php
@@ -24,11 +24,9 @@
* @license http://www.dave-miller.com/mit-license MIT License
*/
-require_once dirname(__FILE__) . '/../classes/djmCountries.php';
-
/**
* Generate <select> and <option> tags for country pickers.
- *
+ *
* @param array Smarty parameters
* - string <b>name</b> = null:
* The name of the <select> tag (default: no <select> tag is output).
@@ -44,16 +42,15 @@
*/
function smarty_function_select_country($params, &$smarty)
{
+ require_once dirname(__FILE__) . '/../classes/djmCountries.php';
+
$params['options'] = djmCountries::getList();
-
+
// Convert country name to code
if (!empty($params['selected']) && strlen($params['selected']) > 2) {
$params['selected'] = djmCountries::countryToCode($params['selected']);
}
-
- /**
- * @see function.options.php
- */
- require_once $smarty->_get_plugin_filepath('function', 'options');
+
+ $smarty->loadPlugin('smarty_function_options');
return smarty_function_options($params, $smarty);
}
Please sign in to comment.
Something went wrong with that request. Please try again.