mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 10:24:26 +02:00
make popup_init xhtml compliant, minor variable name changes for consistancy
This commit is contained in:
1
NEWS
1
NEWS
@@ -1,3 +1,4 @@
|
|||||||
|
- updated popup_init to be xhtml compliant (Tom Oram, Monte)
|
||||||
- fix filename bug with windows (Gary Loescher, Monte)
|
- fix filename bug with windows (Gary Loescher, Monte)
|
||||||
- add ability to supply expire time in seconds when clearing
|
- add ability to supply expire time in seconds when clearing
|
||||||
cache or compile files (Monte)
|
cache or compile files (Monte)
|
||||||
|
@@ -947,15 +947,15 @@ function _generate_debug_output() {
|
|||||||
function _parse_file_path($file_base_path, $file_path, &$resource_type, &$resource_name)
|
function _parse_file_path($file_base_path, $file_path, &$resource_type, &$resource_name)
|
||||||
{
|
{
|
||||||
// split tpl_path by the first colon
|
// split tpl_path by the first colon
|
||||||
$file_path_parts = explode(':', $file_path, 2);
|
$_file_path_parts = explode(':', $file_path, 2);
|
||||||
|
|
||||||
if (count($file_path_parts) == 1) {
|
if (count($_file_path_parts) == 1) {
|
||||||
// no resource type, treat as type "file"
|
// no resource type, treat as type "file"
|
||||||
$resource_type = 'file';
|
$resource_type = 'file';
|
||||||
$resource_name = $file_path_parts[0];
|
$resource_name = $_file_path_parts[0];
|
||||||
} else {
|
} else {
|
||||||
$resource_type = $file_path_parts[0];
|
$resource_type = $_file_path_parts[0];
|
||||||
$resource_name = $file_path_parts[1];
|
$resource_name = $_file_path_parts[1];
|
||||||
if ($resource_type != 'file') {
|
if ($resource_type != 'file') {
|
||||||
$this->_load_resource_plugin($resource_type);
|
$this->_load_resource_plugin($resource_type);
|
||||||
}
|
}
|
||||||
@@ -965,13 +965,14 @@ function _generate_debug_output() {
|
|||||||
if (!preg_match("/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/", $resource_name)) {
|
if (!preg_match("/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/", $resource_name)) {
|
||||||
// relative pathname to $file_base_path
|
// relative pathname to $file_base_path
|
||||||
// use the first directory where the file is found
|
// use the first directory where the file is found
|
||||||
foreach ((array)$file_base_path as $curr_path) {
|
foreach ((array)$file_base_path as $_curr_path) {
|
||||||
if (@is_file($curr_path . DIR_SEP . $resource_name)) {
|
$_fullpath = $_curr_path . DIR_SEP . $resource_name;
|
||||||
$resource_name = $curr_path . DIR_SEP . $resource_name;
|
if (@is_file($_fullpath)) {
|
||||||
|
$resource_name = $_fullpath;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// didn't find the file, try include_path
|
// didn't find the file, try include_path
|
||||||
if($this->_get_include_path($curr_path . DIR_SEP . $resource_name, $_include_path)) {
|
if($this->_get_include_path($_fullpath, $_include_path)) {
|
||||||
$resource_name = $_include_path;
|
$resource_name = $_include_path;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@@ -947,15 +947,15 @@ function _generate_debug_output() {
|
|||||||
function _parse_file_path($file_base_path, $file_path, &$resource_type, &$resource_name)
|
function _parse_file_path($file_base_path, $file_path, &$resource_type, &$resource_name)
|
||||||
{
|
{
|
||||||
// split tpl_path by the first colon
|
// split tpl_path by the first colon
|
||||||
$file_path_parts = explode(':', $file_path, 2);
|
$_file_path_parts = explode(':', $file_path, 2);
|
||||||
|
|
||||||
if (count($file_path_parts) == 1) {
|
if (count($_file_path_parts) == 1) {
|
||||||
// no resource type, treat as type "file"
|
// no resource type, treat as type "file"
|
||||||
$resource_type = 'file';
|
$resource_type = 'file';
|
||||||
$resource_name = $file_path_parts[0];
|
$resource_name = $_file_path_parts[0];
|
||||||
} else {
|
} else {
|
||||||
$resource_type = $file_path_parts[0];
|
$resource_type = $_file_path_parts[0];
|
||||||
$resource_name = $file_path_parts[1];
|
$resource_name = $_file_path_parts[1];
|
||||||
if ($resource_type != 'file') {
|
if ($resource_type != 'file') {
|
||||||
$this->_load_resource_plugin($resource_type);
|
$this->_load_resource_plugin($resource_type);
|
||||||
}
|
}
|
||||||
@@ -965,13 +965,14 @@ function _generate_debug_output() {
|
|||||||
if (!preg_match("/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/", $resource_name)) {
|
if (!preg_match("/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/", $resource_name)) {
|
||||||
// relative pathname to $file_base_path
|
// relative pathname to $file_base_path
|
||||||
// use the first directory where the file is found
|
// use the first directory where the file is found
|
||||||
foreach ((array)$file_base_path as $curr_path) {
|
foreach ((array)$file_base_path as $_curr_path) {
|
||||||
if (@is_file($curr_path . DIR_SEP . $resource_name)) {
|
$_fullpath = $_curr_path . DIR_SEP . $resource_name;
|
||||||
$resource_name = $curr_path . DIR_SEP . $resource_name;
|
if (@is_file($_fullpath)) {
|
||||||
|
$resource_name = $_fullpath;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// didn't find the file, try include_path
|
// didn't find the file, try include_path
|
||||||
if($this->_get_include_path($curr_path . DIR_SEP . $resource_name, $_include_path)) {
|
if($this->_get_include_path($_fullpath, $_include_path)) {
|
||||||
$resource_name = $_include_path;
|
$resource_name = $_include_path;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@@ -18,7 +18,7 @@ function smarty_function_popup_init($params, &$smarty)
|
|||||||
|
|
||||||
if (!empty($params['src'])) {
|
if (!empty($params['src'])) {
|
||||||
echo '<div id="overDiv" style="position:absolute; visibility:hidden; z-index:'.$zindex.';"></div>'."\n";
|
echo '<div id="overDiv" style="position:absolute; visibility:hidden; z-index:'.$zindex.';"></div>'."\n";
|
||||||
echo '<script language="JavaScript" src="'.$params['src'].'"></script>'."\n";
|
echo '<script type="text/javascript" language="JavaScript" src="'.$params['src'].'"></script>'."\n";
|
||||||
} else {
|
} else {
|
||||||
$smarty->trigger_error("popup_init: missing src parameter");
|
$smarty->trigger_error("popup_init: missing src parameter");
|
||||||
}
|
}
|
||||||
|
@@ -18,7 +18,7 @@ function smarty_function_popup_init($params, &$smarty)
|
|||||||
|
|
||||||
if (!empty($params['src'])) {
|
if (!empty($params['src'])) {
|
||||||
echo '<div id="overDiv" style="position:absolute; visibility:hidden; z-index:'.$zindex.';"></div>'."\n";
|
echo '<div id="overDiv" style="position:absolute; visibility:hidden; z-index:'.$zindex.';"></div>'."\n";
|
||||||
echo '<script language="JavaScript" src="'.$params['src'].'"></script>'."\n";
|
echo '<script type="text/javascript" language="JavaScript" src="'.$params['src'].'"></script>'."\n";
|
||||||
} else {
|
} else {
|
||||||
$smarty->trigger_error("popup_init: missing src parameter");
|
$smarty->trigger_error("popup_init: missing src parameter");
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user