from template_preprocess_flag()
These two classes are applied whatever the state of isset($link['href'])
$variables['flag_classes_array'][] = $variables['action'] . '-action';
$variables['flag_classes_array'][] = 'flag-link-' . $flag->link_type;
This makes it difficult to style a link differently depending on if it is active or not.
Would suggest something like
if (isset($link['href'])) {
$variables['flag_classes_array'][] = $variables['action'] . '-action';
$variables['flag_classes_array'][] = 'flag-link-' . $flag->link_type;
}
else {
$variables['flag_classes_array'][] = $variables['action'] . '-disabled';
}
Does this make sense?
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | flag-1826184.patch | 1.01 KB | JeremyFrench |
Comments
Comment #1
joachim commentedSeems a reasonable thing to do, though when do we get here without a link?
Will need applying to 3.x first.
Comment #2
JeremyFrench commentedSeem to get there when flag is allowed and unflagging isn't.
Comment #3
joachim commentedAha, yes that makes sense.
Can you make a patch for your suggested change?
Comment #4
JeremyFrench commentedSure, attached.
Comment #5
JeremyFrench commentedComment #6
joachim commentedThanks! Fixed.
Issue #1826184 by JeremyFrench: Added class to flag link to distinguish 'unflag denied' non-links.
I've written a change record for this: http://drupal.org/node/1828936
Could you check it please, and maybe give some examples of what the classes look like before and after?