/** * Implements EntityReferenceHandler::getReferencableEntities(). */ public function getReferencableEntities($match = NULL, $match_operator = 'CONTAINS', $limit = 0) { $gid = oa_core_get_space_context(); $space = node_load($gid); $type = variable_get_value('oa_worktracker_assigned_to_users'); if ($type === OA_WORKTRACKER_ASSIGN_TO_INHERITED_USERS && !module_exists('oa_subspaces')) { $type = OA_WORKTRACKER_ASSIGN_TO_ONLY_LOCAL_USERS; } $uids = array(); switch ($type) { case OA_WORKTRACKER_ASSIGN_TO_INHERITED_USERS: $uids = og_subgroups_get_users_group('node', $space); $uids = $uids['user']; $inherited = _og_subgroups_get_inherited_users('node', $gid); foreach ($inherited as $inherited_uid => $data) { $uids[] = $inherited_uid; } break; case OA_WORKTRACKER_ASSIGN_TO_ONLY_LOCAL_USERS: $query = new EntityFieldQuery(); $query->entityCondition('entity_type', 'og_membership')->propertyCondition('group_type', 'node', '=')->propertyCondition('gid', $gid, '=')->propertyCondition('entity_type', 'user', '=')->propertyCondition('state', OG_STATE_ACTIVE, '='); $result = $query->execute(); if (!empty($result['og_membership'])) { $og_memberships = og_membership_load_multiple(array_keys($result['og_membership'])); foreach ($og_memberships as $og_membership) { $uids[] = $og_membership->etid; } } break; case OA_WORKTRACKER_ASSIGN_TO_ANY_USERS: $query = db_select('users', 'u')->fields('u', array('uid'))->condition('status', 1); $uids = $query->execute()->fetchCol(); break; } $options = array('user' => array()); if (!empty($uids)) { // Get the user label and make sure that the user can access the space. $users = user_load_multiple($uids); foreach ($users as $uid => $account) { if (node_access('view', $space, $account)) { $options['user'][$uid] = check_plain($this->getLabel($account)); } } asort($options['user']); } return $options; }
?> <div class="navbar-btn navbar-right"> <?php $register_url = (module_exists('obiba_agate') ? 'agate' : 'user') . '/register/'; ?> <?php $option_sign_up = array('attributes' => array('class' => array('redirection-place-holder', 'btn btn-info'))); if (module_exists('obiba_agate')) { $option_sign_up = array_merge($option_sign_up, array('fragment' => 'join')); } ?> <?php print l(variable_get_value('access_signup_button'), $register_url, $option_sign_up); ?> <?php print l(variable_get_value('access_signin_button'), 'user/login', array('attributes' => array('class' => array('redirection-place-holder', 'btn btn-default')), 'query' => array('destination' => current_path()))); ?> </div> <?php } ?> </div> </div> </header> <div class="main-container container" ng-app="mica" ng-controller="MainController"> <header role="banner" id="page-header"> <?php if (!empty($site_slogan)) {
function getAuthLink() { return $this->_helper->getLoginUrl(variable_get_value('social_aggregator:FACEBOOK_APP_REDIRECT_URL'), $this->_permissions); }
/** * Implements template_preprocess_page(). */ function oa_radix_preprocess_page(&$vars) { // Rework search_form to our liking. $vars['search_form'] = ''; if (module_exists('search') && user_access('search content')) { $search_box_form = drupal_get_form('search_form'); $search_box_form['basic']['keys']['#title'] = ''; $search_box_form['basic']['keys']['#attributes'] = array('placeholder' => 'Search'); $search_box_form['basic']['keys']['#attributes']['class'][] = 'search-query'; $search_box_form['basic']['submit']['#value'] = t('Search'); $search_box_form['#attributes']['class'][] = 'navbar-form'; $search_box_form['#attributes']['class'][] = 'pull-right'; $search_box = drupal_render($search_box_form); $vars['search_form'] = user_access('search content') ? $search_box : NULL; } $vars['user_badge'] = ''; $vars['mobile_buttons'] = ''; if (module_exists('oa_toolbar')) { // Add user_badge to header. $user_badge = module_invoke('oa_toolbar', 'block_view', 'oa_user_badge'); $vars['user_badge'] = $user_badge['content']; $vars['mobile_buttons'] = theme('oa_toolbar_mobile'); } $toolbar_name = variable_get_value('oa_layouts_minipanel_header', array('defaults' => 'oa_toolbar_panel')); $toolbar = panels_mini_block_view($toolbar_name); $vars['oa_toolbar_panel'] = isset($toolbar) ? $toolbar['content'] : ''; $footer_name = variable_get_value('oa_layouts_minipanel_footer', array('defaults' => 'oa_footer_panel')); $footer = panels_mini_block_view($footer_name); $vars['oa_footer_panel'] = isset($footer) ? $footer['content'] : ''; ctools_include('content'); $banner = ctools_content_render('oa_space_banner', '', array('banner_position' => 2)); if (!empty($banner->content)) { $vars['oa_banner'] = $banner->content; } $vars['oa_space_menu'] = ''; $space_id = oa_core_get_space_context(); if (variable_get('oa_space_menu_' . $space_id, TRUE)) { $space_menu = ctools_content_render('oa_space_menu', '', array(), array()); if (!empty($space_menu->content)) { $vars['oa_space_menu'] = $space_menu->content; } } }