<div class="field-name-field-fam-breeding">

<?php 
//trim the text with http://api.drupalize.me/api/drupal/function/views_trim_text/7
$items_trim = array('max_length' => 300, 'word_boundary' => TRUE, 'ellipsis' => TRUE, 'html' => TRUE);
global $user;
if (arg(0) == 'node' && is_numeric(arg(1))) {
    $flag = flag_get_flag('highlighted');
}
if (empty($user->roles[5]) && empty($user->roles[6]) && empty($user->roles[7]) && empty($user->roles[4]) && empty($user->roles[3]) && (isset($flag) && !$flag->is_flagged($element['#object']->nid))) {
    print views_trim_text($items_trim, render($items));
    print '<span class="hide-text"></span><div class="avis">You are reading a trimmed version of the Breeding section.<br />Only members are able to see the rest of the text. To make the most of all of HBW\'s features, discover our subscriptions now.<div class="btn-container"><a title="Compare subscriptions" class="btn" href="/pricing">HBW Alive Plans & Pricing</a>&nbsp;&nbsp;' . l('Why subscribe', 'subscription-plans', array('attributes' => array('title' => t('Why subscribe ?'), 'class' => 'btn'))) . '<div class="sign-in">or <a title="Sign in now if you already have a membership" href="/user">sign in</a> if you already have a membership</div></div></div>';
} else {
    print render($items);
}
?>

</div>
Exemplo n.º 2
0
function _humanitarianresponse_flag_follow_us() {
  global $user;
  // Some typing shotcuts:
  $flag = flag_get_flag('hr_follow');
  $entity_id = 2490; // Hardcoded nid of the "About" space
  $action = $flag->is_flagged($entity_id) ? 'unflag' : 'flag';

  // Generate the link URL.
  $link_type = $flag->get_link_type();
  $link = module_invoke($link_type['module'], 'flag_link', $flag, $action, $entity_id);
  if (isset($link['title']) && empty($link['html'])) {
    $link['title'] = check_plain($link['title']);
  }

  // Replace the link with the access denied text if unable to flag.
  if ($action == 'unflag' && !$flag->access($entity_id, 'unflag')) {
    $link['title'] = $flag->get_label('unflag_denied_text', $entity_id);
    unset($link['href']);
  }

  // Anonymous users always need the JavaScript to maintain their flag state.
  if ($user->uid == 0) {
    $link_type['uses standard js'] = TRUE;
  }

  // Load the JavaScript/CSS, if the link type requires it.
  if (!isset($initialized[$link_type['name']])) {
    if ($link_type['uses standard css']) {
      drupal_add_css(drupal_get_path('module', 'flag') . '/theme/flag.css');
    }
    if ($link_type['uses standard js']) {
      drupal_add_js(drupal_get_path('module', 'flag') . '/theme/flag.js');
    }
    $initialized[$link_type['name']] = TRUE;
  }

  $vars['link_href'] = isset($link['href']) ? check_url(url($link['href'], $link)) : FALSE;
  $vars['link_title'] = ($action == 'flag' ? t('Follow Us') : t('Stop following us'));
  $vars['link_status'] = $action;
  return $vars;

}
        <?php 
        print $submitted;
        ?>
        </div>
      <?php 
    }
    ?>
    </div>
  <?php 
}
?>

  <div class="content">
    
    <?php 
$flag = flag_get_flag('suppress_featured_image') or die('no "suppress_featured_image" flag defined');
if (!$flag->is_flagged($node->nid) && $node->field_feature_image['0']['filepath']) {
    ?>
			<div class="featured_image">
				<?php 
    print theme('imagecache', 'full_node_featured_image', $node->field_feature_image['0']['filepath'], $node->field_feature_image['0']['data']['description'], $node->field_feature_image['0']['data']['description']);
    ?>
			</div>
		<?php 
}
?>
    
    <?php 
print $content;
?>
  </div>
<?php

/**
 * @file
 * Default view template to display items in a jQuery Masonry grid.
 */
// load the flag
$flag = flag_get_flag('cle_exemplary');
?>

<?php 
foreach ($rows as $id => $row) {
    // check for exemplary work
    $cle_classes = 'cle-masonry-item';
    // test that item is flagged
    if ($flag->is_flagged($view->result[$id]->nid)) {
        $cle_classes .= ' cle_exemplary';
    }
    ?>
  <div class="<?php 
    print $cle_classes;
    ?>
 masonry-item<?php 
    if ($classes_array[$id]) {
        print ' ' . $classes_array[$id];
    }
    ?>
">
    <?php 
    print $row;
    ?>
    print $node->title;
    ?>
            </h2>
            <!-- End Inscription TITLE-->

            <!-- ID of Inscription-->
            <h3 class="subtitle">
            <?php 
    print $contest->model . ' - ' . $node->nid;
    ?>
            </h3>
            <!-- End ID of Inscription -->

            <!-- FiveStar Widget -->
            <?php 
    $flag = flag_get_flag('finalist');
    if ($contest->field_contest_state[0]['value'] == ContestState::PUBLIC_CONTEST && $flag->is_flagged($node->nid)) {
        if (user_access('rate content') && fivestar_validate_target('node', $node->nid)) {
            print fivestar_widget_form($node);
        }
    }
    if ($contest->field_contest_state[0]['value'] == ContestState::FINISHED && $flag->is_flagged($node->nid)) {
        if (fivestar_validate_target('node', $node->nid)) {
            print fivestar_static('node', $node->nid, 'vote', 'inscription');
        }
    }
    ?>
            <!-- END FiveStar Widget -->

            <!-- University and Country -->
            <div class="university-country">
Exemplo n.º 6
0
$join_date = date('d F Y', $account->created);
$country = check_plain($content_profile->field_country[0]['value']);
$website = check_plain($content_profile->field_url[0]['value']);
$background = check_markup($content_profile->field_background[0]['value'], $content_profile->format, FALSE);
$opinions = check_markup($content_profile->field_opinions[0]['value'], $content_profile->format, FALSE);
$user_links = array();
$profile_is_approved = ($content_profile->status and !$content_profile->moderate);
$user_is_moderator = user_access('edit any profile content');
$is_own_profile = $user->uid == $account->uid;
if ($user->uid and $user->uid != $account->uid) {
    if (module_exists('private_messages')) {
        // if (function_exists('privatemsg_get_link')) {
        $user_links[] = array('title' => bts('Send message'), 'href' => privatemsg_get_link(array($account)));
    }
    if (module_exists('friends')) {
        $flag = flag_get_flag('friend');
        $friend_status = flag_friend_determine_friend_status($flag, $account->uid, $user->uid);
        switch ($friend_status) {
            case FLAG_FRIEND_BOTH:
            case FLAG_FRIEND_FLAGGED:
                $user_links[] = array('title' => bts('Remove friend'), 'href' => "flag/confirm/unfriend/friend/{$account->uid}");
                break;
            case FLAG_FRIEND_PENDING:
                $user_links[] = array('title' => bts('Cancel friend request'), 'href' => "flag/confirm/unflag/friend/{$account->uid}");
                break;
            case FLAG_FRIEND_APPROVAL:
                $user_links[] = array('title' => bts('Approve friend request'), 'href' => "flag/confirm/flag/friend/{$account->uid}");
                break;
            case FLAG_FRIEND_UNFLAGGED:
            default:
                $user_links[] = array('title' => bts('Add as friend'), 'href' => "flag/confirm/flag/friend/{$account->uid}");
Exemplo n.º 7
0
?>
        <?php 
print render($page['help']);
?>
        <?php 
if ($action_links) {
    ?>
<ul class="action-links"><?php 
    print render($action_links);
    ?>
</ul><?php 
}
?>
        <?php 
if (module_exists('flag')) {
    $flag = flag_get_flag('archived');
}
?>
        <?php 
if (isset($node) && module_exists('flag') && $flag && $flag->is_flagged($node->nid)) {
    ?>
          <section id="archived" class="alert alert-warning wb-inview" data-inview="archived-bnr">
            <h2><?php 
    print t('This page has been archived on the Web');
    ?>
</h2>
            <p><?php 
    print t('Information identified as archived is provided for reference, research or recordkeeping purposes. It is not subject to the Government of Canada Web Standards and has not been altered or updated since it was archived. Please contact us to request a format other than those available.');
    ?>
</p>
          </section>
Exemplo n.º 8
0
function nesi_bootstrap_proposal_status($nid)
{
    $current_proposal = node_load($nid);
    $proposal_state = 'Draft';
    $is_flagged = FALSE;
    // Get status for display
    if ($current_proposal->type == 'proposal_development_class' || $current_proposal->type == 'proposal_research_class') {
        $flag = flag_get_flag('p_submit_proposal');
        if ($flag->is_flagged($current_proposal->nid)) {
            $proposal_state = 'Pending';
            $is_flagged = TRUE;
        }
    }
    return $proposal_state;
}