function uc_store_token_values in Ubercart 5
Same name and namespace in other branches
- 6.2 uc_store/uc_store.module \uc_store_token_values()
Implementation of hook_token_values(). (token.module)
File
- uc_store/
uc_store.module, line 345 - Contains global Ubercart functions and store administration functionality.
Code
function uc_store_token_values($type, $object = NULL) {
global $base_url;
switch ($type) {
case 'global':
$login_link = url('user', NULL, NULL, TRUE);
$values['site-login'] = l($login_link, $login_link);
$theme_key = variable_get('theme_default', 'garland');
$settings = theme_get_settings($theme_key);
$themes = list_themes();
$theme_object = $themes[$theme_key];
if ($settings['toggle_logo']) {
if ($settings['default_logo']) {
$settings['logo'] = dirname($theme_object->filename) . '/logo.png';
}
elseif ($settings['logo_path']) {
$settings['logo'] = $settings['logo_path'];
}
}
$values['site-logo'] = '<img src="' . url($base_url . '/' . $settings['logo'], NULL, NULL, TRUE) . '" />';
$values['store-name'] = variable_get('uc_store_name', t('Our store'));
$values['store-url'] = variable_get('uc_store_url', $base_url);
$values['store-link'] = l(variable_get('uc_store_name', t('Our store')), variable_get('uc_store_url', $base_url));
$values['store-owner'] = variable_get('uc_store_owner', '');
$values['store-email'] = variable_get('uc_store_email', '');
$values['store-phone'] = variable_get('uc_store_phone', '');
$values['store-address'] = uc_store_address();
$values['store-help-url'] = url(variable_get('uc_notify_store_help_page', ''), NULL, NULL, TRUE);
break;
}
return $values;
}