Skip to content

Instantly share code, notes, and snippets.

@newism
Created April 13, 2009 06:45
Show Gist options
  • Save newism/94313 to your computer and use it in GitHub Desktop.
Save newism/94313 to your computer and use it in GitHub Desktop.
function insert($at, $html)
{
global $SESS;
$SESS->cache['lg'][LG_POL_addon_id]['snippets'][$at][] = $html;
}
function insert_css($css, $file = TRUE, $at = "head")
{
if($file)
{
$this->insert($at, '<link rel="stylesheet" type="text/css" charset="utf-8" href="'.$css.'">');
}
else
{
$this->insert($at, '<style type="text/css" charset="utf-8">'.NL.$css.NL.'</style>');
}
}
function insert_js($js, $file = TRUE, $at = "body")
{
if($file)
{
$this->insert($at, '<script type="text/javascript" src="'.$js.'" charset="utf-8"></script>');
}
else
{
$this->insert($at, '<script type="text/javascript">'.NL.$js.NL.'</script>');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment