Commit 99387bad authored by Nigel McNie's avatar Nigel McNie
Browse files

More cleanups of theme_get_url usage.

parent 2f5d0fc9
......@@ -1352,9 +1352,9 @@ function pieform_element_textarea_configure($element) {
* artefact/file
*/
function pieform_template_dir($file, $pluginlocation='') {
$theme = theme_setup();
global $THEME;
foreach ($theme->inheritance as $themedir) {
foreach ($THEME->inheritance as $themedir) {
$filepath = get_config('docroot') . $pluginlocation . '/theme/' . $themedir . '/pieforms/' . $file;
if (is_readable($filepath)) {
return dirname($filepath);
......
......@@ -40,6 +40,7 @@ function smarty_resource_blocktype_trusted($tpl_name, &$smarty_obj)
}
function smarty_resource_blocktype_get_filepath($tpl_name) {
global $THEME;
static $filepaths = array();
if (isset($filepaths[$tpl_name])) {
return $filepaths[$tpl_name];
......@@ -58,7 +59,7 @@ function smarty_resource_blocktype_get_filepath($tpl_name) {
$basedir .= 'blocktype/' . $name[0] . '/theme/';
}
foreach (theme_setup()->inheritance as $theme) {
foreach ($THEME->inheritance as $theme) {
$filename = $basedir . $theme . '/' . $template_path;
if (is_readable($filename)) {
return $filepaths[$tpl_name] = $filename;
......
......@@ -322,7 +322,7 @@ EOF;
// look for extra stylesheets
if (isset($extraconfig['stylesheets']) && is_array($extraconfig['stylesheets'])) {
foreach ($extraconfig['stylesheets'] as $extrasheet) {
if ($sheets = theme_get_url($extrasheet, '', true)) {
if ($sheets = $THEME->get_url($extrasheet, true)) {
$stylesheets = array_merge($stylesheets, array_reverse($sheets));
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment