
Originally Posted by
carlwhat
it looks like your reference to $this in your mod must have somehow included the admin directory.
how have you initialized $this in your mod? and is your admin directory named admin?
Not quite carlwhat. See, the function/code that is trying to display the icon is located in the admin directory. The global $template variable is accessible from the admin, but the problem in the above code lies in the lack of "starting" directory. Therefore, the returned location is provided based on the current location which is the admin directory when the result(s) come back. It's centered around this function in includes/classes/template_func.php which "typically" looks in the includes/templates directory, but also could be used to look in other overrideable directories.
Code:
function get_template_dir($template_code, $current_template, $current_page, $template_dir, $debug=false) {
// echo 'template_default/' . $template_dir . '=' . $template_code;
if ($this->file_exists($current_template . $current_page, $template_code)) {
return $current_template . $current_page . '/';
} elseif ($this->file_exists(DIR_WS_TEMPLATES . 'template_default/' . $current_page, preg_replace('/\//', '', $template_code), $debug)) {
return DIR_WS_TEMPLATES . 'template_default/' . $current_page;
} elseif ($this->file_exists($current_template . $template_dir, preg_replace('/\//', '', $template_code), $debug)) {
return $current_template . $template_dir;
} else {
return DIR_WS_TEMPLATES . 'template_default/' . $template_dir;
// return $current_template . $template_dir;
}
}
The only thing about the provided suggestion from above is that the entire path of the store is made visible (on the admin side to which I just found a solution) instead of simply copying the file to somewhere admin side and referencing it from there such that the same image is presented in two locations on the server. But whatever is desired I guess...