Currently there is no easy way to replace the following pager tags with images/icons.
We are only allowed to do things like that
$variables['tags']['first'] = t('my_first');
$variables['tags']['previous'] = t('my_previous');
$variables['tags']['next'] = t('my_next');
$variables['tags']['last'] = t('my_last');
and not
$variables['tags']['first'] = '<img alt="first page" src="/..." />';
$variables['tags']['previous'] = '<img alt="previous page" src="/..." />';
$variables['tags']['next'] = '<img alt="next_page" src="/..." />';
$variables['tags']['last'] = '<img alt="last page" src="/..." />';
this because, the function theme_pager_link($variables) includes the check_plain($text)
return '<a' . drupal_attributes($attributes) . '>' . check_plain($text) . '</a>';
It would be great to add a test to know if an image is used and not only a text. Something like this:
function theme_pager_previous($variables) {
isset($variables['img'] ) ? $img = $variables['img'];
$text = $variables['text'];
$element = $variables['element'];
$interval = $variables['interval'];
$parameters = $variables['parameters'];
... // add $img if isset within $output
$output = theme('pager_link', array( 'img' => $img, 'text' => $text, 'page_new' => $page_new, 'element' => $element, 'parameters' => $parameters));
.... and inside function theme_pager_link($variables)
if ( isset($img) ){
return '<a' . drupal_attributes($attributes) . '>' . $img . '</a>';
}else{
return '<a' . drupal_attributes($attributes) . '>' . check_plain($text) . '</a>';
}
Closed: outdated
1.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.