mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-22 05:15:29 +09:00
Don't use home-made JSON encoder in display handlers
This commit is contained in:
parent
a74ed519e0
commit
6c5f9aadd1
3 changed files with 4 additions and 7 deletions
|
|
@ -14,14 +14,12 @@ class JSCallbackDisplayHandler
|
||||||
$variables = $oModule->getVariables();
|
$variables = $oModule->getVariables();
|
||||||
$variables['error'] = $oModule->getError();
|
$variables['error'] = $oModule->getError();
|
||||||
$variables['message'] = $oModule->getMessage();
|
$variables['message'] = $oModule->getMessage();
|
||||||
$json = str_replace(array("\r\n", "\n", "\t"), array('\n', '\n', '\t'), json_encode2($variables));
|
|
||||||
return sprintf('<script type="text/javascript">
|
return sprintf('<script type="text/javascript">
|
||||||
//<![CDATA[
|
//<![CDATA[
|
||||||
%s(%s);
|
%s(%s);
|
||||||
//]]>
|
//]]>
|
||||||
</script>', Context::getJSCallbackFunc(), $json);
|
</script>', Context::getJSCallbackFunc(), json_encode($variables));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
/* End of file JSCallback.class.php */
|
/* End of file JSCallback.class.php */
|
||||||
/* Location: ./classes/display/JSCallback.class.php */
|
/* Location: ./classes/display/JSCallback.class.php */
|
||||||
|
|
|
||||||
|
|
@ -14,8 +14,7 @@ class JSONDisplayHandler
|
||||||
$variables = $oModule->getVariables();
|
$variables = $oModule->getVariables();
|
||||||
$variables['error'] = $oModule->getError();
|
$variables['error'] = $oModule->getError();
|
||||||
$variables['message'] = $oModule->getMessage();
|
$variables['message'] = $oModule->getMessage();
|
||||||
$json = str_replace(array("\r\n", "\n", "\t"), array('\n', '\n', '\t'), json_encode2($variables));
|
return json_encode($variables);
|
||||||
return $json;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -73,11 +73,11 @@ class TemplateHandler
|
||||||
protected function init($tpl_path, $tpl_filename, $tpl_file = '')
|
protected function init($tpl_path, $tpl_filename, $tpl_file = '')
|
||||||
{
|
{
|
||||||
// verify arguments
|
// verify arguments
|
||||||
if(substr($tpl_path, -1) != '/')
|
if(!$tpl_path || substr($tpl_path, -1) != '/')
|
||||||
{
|
{
|
||||||
$tpl_path .= '/';
|
$tpl_path .= '/';
|
||||||
}
|
}
|
||||||
if(!is_dir($tpl_path))
|
if($tpl_path === '/' || !is_dir($tpl_path))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue