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']);
}
Exemple #2
0
  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);
}
Exemple #3
0
    if (!preg_match("/utf(-)8\$/i", $lang)) {
        $lang .= ".UTF-8";
    }
} else {
    $lang = get_browser_language();
}
initLanguage($lang);
$smarty->assign("rtl", language_is_rtl($lang));
$smarty->assign("must", '<span class="must">*</span>');
/* Minimal config */
if (!session::global_is_set('config')) {
    $config = new config('');
    session::global_set('config', $config);
}
$config = session::global_get('config');
IconTheme::loadThemes('themes');
/* Fake user bypassing acl system */
$ui = new fake_userinfo();
/* Call setup */
$display = "";
require_once "../setup/main.inc";
$smarty->assign("rtl", language_is_rtl($lang));
$smarty->assign("date", date("l, dS F Y H:i:s O"));
$header = $smarty->fetch(get_template_path('headers.tpl'));
/* Set focus to the error button if we've an error message */
$focus = "";
if (session::is_set('errors') && session::get('errors') != "") {
    $focus = '<script type="text/javascript">';
    $focus .= 'document.forms[0].error_accept.focus();';
    $focus .= '</script>';
}