function smarty_function_iconPath($params, &$smarty) { $config = session::global_get('config'); /* Set theme */ $theme = IconTheme::$default_theme; if (isset($config)) { $theme = $config->get_cfg_value("theme"); } return IconTheme::findThemeIcon($theme, $params['context'], $params['icon'], $params['size']); }
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Basic setup, remove eventually registered sessions */ @(require_once "../include/php_setup.inc"); @(require_once "functions.inc"); @(require_once "variables.inc"); session_cache_limiter("private"); session::start(); session::global_set('errorsAlreadyPosted', array()); $theme = ''; if (session::global_is_set('config')) { $config = session::global_get('config'); $theme = $config->get_cfg_value('theme'); } else { header("cache-control: no-cache"); } IconTheme::$extensions = array('png'); $src = IconTheme::findThemeIcon($theme, $_GET['context'], $_GET['icon'], $_GET['size']); header("Content-Type: image/png"); if (isset($_GET['disabled']) && $_GET['disabled']) { $im = imagecreatefrompng($src); imageAlphaBlending($im, TRUE); imageSaveAlpha($im, TRUE); imagefilter($im, IMG_FILTER_GRAYSCALE); imagepng($im); imagedestroy($im); } else { readfile($src); }