diff --git a/flag.module b/flag.module index eefd815..a94620a 100644 --- a/flag.module +++ b/flag.module @@ -938,7 +938,6 @@ function flag_entity_view($entity, $type, $view_mode, $langcode) { $entity_id = $flag->get_entity_id($entity); if ($flag->show_as_field) { $entity->content['flag-' . $flag->name] = array( - // ARGH needs extra wrapping! '#markup' => $flag->theme($flag->is_flagged($entity_id) ? 'unflag' : 'flag', $entity_id), ); } @@ -1486,6 +1485,7 @@ function flag_theme() { 'action' => NULL, 'entity_id' => NULL, 'after_flagging' => FALSE, + 'needs_wrapping_element' => TRUE, 'errors' => array(), ), 'template' => 'flag', @@ -1535,6 +1535,7 @@ function flag_theme() { * - $entity_id * - $after_flagging * - $errors + * - $needs_wrapping_element * * See 'flag.tpl.php' for their documentation. */ diff --git a/theme/flag.tpl.php b/theme/flag.tpl.php index df6bfdc..9bc2b2c 100644 --- a/theme/flag.tpl.php +++ b/theme/flag.tpl.php @@ -27,6 +27,8 @@ * flagged. If displaying to the user immediately after flagging, this value * will be boolean TRUE. This is usually used in conjunction with immedate * JavaScript-based toggling of flags. + * - $needs_wrapping_element: By default is true. Determines if flag displays a + * wrapping element or not. * * Template suggestions available, listed from the most specific template to * the least. Drupal will use the most specific template it finds: @@ -38,6 +40,9 @@ */ ?> + +

+   @@ -48,4 +53,7 @@ + +

+