function bootstrap_theme_collection_page($collection_id = 0)
{
    $collection = node_load($collection_id);
    $form = drupal_get_form('bootstrap_theme_collection_contributions_form', $collection_id);
    $contributions_list_form = drupal_get_form('bootstrap_theme_collection_contributions_list_form');
    bootstrap_theme_set_page_title_block('<a href="' . url('dashboard/collections') . '" class="button">Return to My Collection</a>');
    global $user;
    $output = '<div class="collection-page">';
    $output .= bootstrap_theme_collections_sidebar();
    $output .= '<div id="collection-contributions">
					<h4 style="margin-top:0;">' . $collection->title . '</h4>';
    if ($user->uid == $collection->uid) {
        $output .= 'Remove contribution(s) from your collection<br>';
    }
    $output .= drupal_render($form);
    $output .= '</div>';
    if ($user->uid == $collection->uid) {
        $output .= '<br><div style="clear:both;"></div><br><div id="all-contributions">Add contribution(s) to your collection<br>';
        $output .= drupal_render($contributions_list_form);
        $output .= '</div>';
        $output .= '<div>';
    }
    return $output;
}
function _bootstrap_theme_dashboard_all_collections_tab_contents($form = null, $form_state = null)
{
    if ($form == null && $form_state == null) {
        $form = drupal_get_form('bootstrap_theme_dashboard_create_collection_form');
        $form_output = drupal_render($form);
    } else {
        $form_output = drupal_render(drupal_rebuild_form('bootstrap_theme_dashboard_create_collection_form', $form_state));
    }
    drupal_set_title('All Collections');
    bootstrap_theme_set_page_title_block('<div class="dashboard-search-form"></div>');
    $output = '
        <div id="dashboard-my-collections" class="dashboard-my-collections">
            <!--div class="dashboard-create-collection-form">
                <h4>Create a New Collection</h4>' . '<div id="dashboard_create_collection_form">' . $form_output . '</div>' . '
            </div-->
            <div id="dashboard_a_collections">
            ' . _bootstrap_theme_all_collections_html() . '
            </div>
         </div>
    ';
    return $output;
}
示例#3
0
function bootstrap_theme_messages_page($arg)
{
    bootstrap_theme_set_page_content_class('messages-board');
    bootstrap_theme_set_page_title_block('<div class="buttons"><a href="' . url('messages/new') . '" class="button">Compose</a></div>');
    return bootstrap_theme_messages_list();
}
示例#4
0
function bootstrap_theme_display_node_content($node)
{
    global $user;
    //$flag = flag_get_flag('testflag');
    //echo $flag->is_flagged($node->nid);
    if ($node->status == NODE_NOT_PUBLISHED) {
        drupal_access_denied();
        exit;
    }
    $referer_url = $_SERVER['HTTP_REFERER'];
    $output = '';
    $account = user_load($node->uid);
    $badge_uri = '';
    $badge_img = '';
    if (isset($node->field_cnob_assigned_badge[$node->language][0]['value'])) {
        $query = db_select('file_managed', 'fm');
        $query = $query->fields('fm', array('filename', 'uri'));
        $query->leftJoin('field_data_field_badges_badge_image', 'fbbi', 'fbbi.field_badges_badge_image_fid=fm.fid');
        $query->condition('fbbi.entity_id', $node->field_cnob_assigned_badge[$node->language][0]['value'], '=');
        $result = $query->execute();
        foreach ($result as $data) {
            $badge_uri = $data->uri;
            $badge_img = $data->filename;
        }
    }
    if (trim($badge_uri) == '') {
        if (!in_array('administrator', $user->roles) && trim($node->type) == 'badges') {
            bootstrap_theme_set_page_title_block('<div class="buttons"><a href="../dashboard/badges" class="button">Return to Badges</a></div>');
        } else {
            bootstrap_theme_set_page_title_block('<div class="buttons"><a href="' . (strpos($referer_url, '/search/site') > 0 ? $referer_url : $referer_url) . '" class="button">Return to Results</a></div>');
        }
    } else {
        bootstrap_theme_set_page_title_block('<div style="padding:25px;float:left;"><img src="' . image_style_url('badge_thumb', $badge_uri) . '" alt="' . $badge_img . '"/></div><div class="buttons"><a href="' . (strpos($referer_url, '/search/site') > 0 ? $referer_url : $referer_url) . '" class="button">Return to Results</a></div>');
    }
    if ($node->type == NODE_TYPE_CLAS_CONTRIBUTOR) {
        $change_collection_form = drupal_get_form('bootstrap_theme_change_collection_form', $node);
        bootstrap_theme_set_page_small_title('<span>Submitted by ' . format_username($account) . ' on ' . date('F j, Y - g:sa', $node->created) . '</span>');
        bootstrap_theme_set_page_content_class('page-view-container node-view');
        //bootstrap_theme_set_page_title_block('<div class="buttons"><a href="'.((strpos($referer_url, '/search/site') > 0)? $referer_url : "#").'" class="button">Return to Results</a></div>');
        /*echo "<pre>";
        		print_r($node);
        		echo "</pre>";
        		die;*/
        $material_type = taxonomy_term_load($node->field_cnob_learning_object_type[$node->language][0]['tid'])->name;
        if (!empty($node->field_cno_associated_materials)) {
            $contributor_material = $node->field_cno_associated_materials[$node->language][0];
        } else {
            $contributor_material = null;
        }
        $output .= '<div class="page-container">';
        $output .= '<div class="node-view-left">';
        //$output .= '<img src="'.file_create_url($badge_uri).'" alt="'.$badge_img.'" hwight="50" width="50"/>';
        if ($material_type == 'Video') {
            /*$output .= '<div class="node-view-video">';
                  $output .= '<video controls="">';
                      $output .= '<source src="'.file_create_url($contributor_material['uri']).'" />';
                  $output .= '</video>';
              $output .= '</div>';*/
            //$videofile = file_load($node->field_cnob_learn_obj_res_video['und'][0]['fid'])
            $output .= '<div class="node-view-video">';
            $video = array('#theme' => 'video_embed_field_embed_code', '#style' => 'normal', '#url' => $node->field_cnob_learn_obj_res_video['und'][0]['video_url']);
            $output .= drupal_render($video);
            $output .= '</div>';
        }
        if ($material_type == 'Audio') {
            $fload = file_load($node->field_cnob_learn_obj_res_audio['und'][0]['fid']);
            $audiofile = file_create_url($fload->uri);
            $info = pathinfo($audiofile);
            $op = $info['extension'];
            $output .= '<div class="node-view-audio">';
            $output .= audiofield_get_player($audiofile, $op);
            $output .= '</div>';
        }
        $area_of_study = taxonomy_term_load($node->field_cnob_area_of_study[$node->language][0]['tid']);
        $output .= '<ul class="node-view-fields">';
        $output .= '<li><strong>Category:</strong><span>' . taxonomy_term_load($node->field_cnob_category[$node->language][0]['tid'])->name . '</span></li>';
        $output .= '<li><strong>User Type:</strong><span>' . $node->field_cnob_user_type[$node->language][0]['value'] . '</span></li>';
        $output .= '<li><strong>Area of Study:</strong><span>' . (!empty($area_of_study) ? $area_of_study->name : '') . '</span></li>';
        $output .= '<li><strong>Grade Level:</strong><span>' . taxonomy_term_load($node->field_cnob_grade_level[$node->language][0]['tid'])->name . '</span></li>';
        $output .= '<li><strong>Relevant Standards:</strong><span>' . taxonomy_term_load($node->field_cnob_relevant_standards[$node->language][0]['tid'])->name . '</span></li>';
        $output .= '<li><strong>Learning Object Type:</strong><span>' . $material_type . '</span></li>';
        if ($material_type == 'Link') {
            $output .= '<li><strong>Learning Object Link:</strong><span><a href="' . $node->field_cnob_learn_obj_res_link[$node->language][0]['value'] . '" target="_blank">' . $node->field_cnob_learn_obj_res_link[$node->language][0]['value'] . '</a></span></li>';
        } else {
            if ($material_type == 'Document') {
                $docload = file_load($node->field_cnob_learn_obj_res_doc['und'][0]['fid']);
                $output .= '<li><strong>Learning Object Document:</strong><span><a href="' . file_create_url($docload->uri) . '" target="_blank">' . $docload->filename . '</a></span></li>';
            }
        }
        $output .= '</ul>';
        $output .= '<div class="node-view-body">';
        $output .= !empty($node->body[LANGUAGE_NONE]) ? $node->body[LANGUAGE_NONE][0]['value'] : '';
        $output .= '</div>';
        $output .= '<div class="node-view-tags">';
        $output .= '<strong>Tags:</strong>&nbsp;' . bootstrap_theme_render_html_tags($node->field_cnob_tags);
        $output .= '</div>';
        $output .= '</div>';
        if (user_is_logged_in()) {
            $output .= '<div class="node-view-right">';
            $output .= '<div id="collection_ids_for_contribution">';
            $output .= drupal_render($change_collection_form);
            $output .= '</div>';
            $output .= '<div class="node-view-share">';
            $output .= '<strong>Share</strong>';
            $output .= '<a class="button" href="#share_with_member_modal" role="button" data-toggle="modal">Share with a member</a>';
            $output .= '<div id="share_with_member_modal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="share_with_member_modal_label" aria-hidden="true">';
            $output .= '<div class="modal-header">';
            $output .= '<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>';
            $output .= '<h3 id="share_with_member_modal_label">Share with a member</h3>';
            $output .= '</div>';
            $output .= '<div class="modal-body">';
            $output .= _bootstrap_theme_share_with_member_form(null, null);
            $output .= '</div>';
            $output .= '<div class="modal-footer">';
            $output .= '<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>';
            $output .= '<button class="btn btn-primary">Save changes</button>';
            $output .= '</div>';
            $output .= '</div>';
            $output .= '<!-- AddThis Button BEGIN -->
							<div class="addthis_toolbox addthis_default_style addthis_32x32_style">
							<a href="https://www.facebook.com/" class="addthis_button_facebook"></a>
							<a href="https://twitter.com/" class="addthis_button_twitter"></a>
							<a class="addthis_button_google_plusone_share"></a>
							<a href="https://www.linkedin.com/" class="addthis_button_linkedin"></a>
							</div>
							<script type="text/javascript">var addthis_config = {"data_track_addressbar":true};</script>
							<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-4f0ac6263266f930"></script>
							<!-- AddThis Button END -->';
            $output .= '</div>';
            $output .= '</div>';
        }
        $output .= '</div>';
        $output .= '<div class="clear"></div>';
        $output .= '</div>';
        $output .= '<div class="page-title-bar small">';
        $output .= '<div class="inner">';
        $output .= '<div class="page-title">';
        $output .= '<h3>Comments</h3>';
        $output .= '<a id="comments" href="#" class="element-invisible">Comments</a>';
        $output .= '</div>';
        $output .= '</div>';
        $output .= '</div>';
        $output .= '<div class="page-container">';
        $output .= _bootstrap_theme_comments_view($node);
        //$output .= '</div>';
    } else {
        if ($node->type == NODE_TYPE_CLAS_COLLECTION) {
            $output = bootstrap_theme_collection_page($node->nid);
        } else {
            $output = node_page_view($node);
        }
    }
    return $output;
}
示例#5
0
function bootstrap_theme_profile_aboutme_page($account)
{
    bootstrap_theme_set_page_content_class('profile-about-me-page public-profile-page');
    bootstrap_theme_set_page_title_block('<div class="buttons"><!--<a href="#" class="button">Add to Network</a>--><a href="' . url('messages/new') . '" class="button">Message</a></div>');
    bootstrap_theme_set_page_small_title('<strong>Professor in Bioengineering</strong>');
    bootstrap_theme_set_page_title_class('profile-title');
    drupal_set_title(format_username($account));
    $output = '';
    $output .= '<div class="public-profile-info">';
    $output .= '<div class="profile-picture">';
    $output .= '<img src="' . bootstrap_theme_get_user_picture($account) . '" />';
    $output .= '</div>';
    $output .= '<div class="profile-extra">';
    $output .= '<p class="main">' . bootstrap_theme_display_user_location($account) . '</p>';
    $output .= '<p>(Ranking)</p>';
    $output .= '<p>(Badges)</p>';
    $output .= '<p>Specialization</p>';
    $output .= '</div>';
    //$output .= '<a href="'.url('user/'.$account->uid.'/about-me').'" class="button">Download PDF</a>';
    $output .= '<div class="clear"></div>';
    $output .= '<div class="block biography">';
    $output .= '<div class="title-bar">Biography</div>';
    $output .= '<div class="block-content">';
    $output .= '<p>' . (!empty($account->field_publications[LANGUAGE_NONE]) ? nl2br($account->field_publications[LANGUAGE_NONE][0]['value']) : '') . '</p>';
    $output .= '</div>';
    $output .= '</div>';
    $output .= '<div class="block float-left">';
    $output .= '<div class="title-bar">Experience</div>';
    $output .= '<div class="block-content">';
    $output .= '<p>' . (!empty($account->field_experience[LANGUAGE_NONE]) ? nl2br($account->field_experience[LANGUAGE_NONE][0]['value']) : '') . '</p>';
    /*$output .= '<div class="title">California State University - Chico</div>';
      $output .= '<p>Professsor of Biology</p>';
      $output .= '<div class="date">August 1982 - Present</div>';*/
    $output .= '</div>';
    $output .= '</div>';
    $output .= '<div class="block float-right">';
    $output .= '<div class="title-bar">Education</div>';
    if (!empty($account->field_education[LANGUAGE_NONE])) {
        foreach ($account->field_education[LANGUAGE_NONE] as $val) {
            $field_edus = explode(',', $val['value']);
            $output .= '<div class="block-content">';
            $output .= '<div class="title">' . (!empty($field_edus[0]) ? nl2br($field_edus[0]) : '') . '</div>';
            $output .= '<p>' . (!empty($field_edus[1]) ? nl2br($field_edus[1]) : '') . '</p>';
            $output .= '<div class="date">' . (!empty($field_edus[2]) ? nl2br($field_edus[2]) : '') . '</div>';
            $output .= '</div>';
        }
    }
    $output .= '</div>';
    $output .= '<div class="clear"></div>';
    $output .= '<div class="block float-left">';
    $output .= '<div class="title-bar">Expertise and Interests</div>';
    $output .= '<div class="block-content">';
    $output .= '<p>' . (!empty($account->field_expertise[LANGUAGE_NONE]) ? nl2br($account->field_expertise[LANGUAGE_NONE][0]['value']) : '') . '</p>';
    //$output .= '<p>Genetics</p>';
    $output .= '</div>';
    $output .= '</div>';
    $output .= '<div class="block float-right">';
    $output .= '<div class="title-bar">Associations</div>';
    $output .= '<div class="block-content">';
    $output .= '<p>' . (!empty($account->field_work_address[LANGUAGE_NONE]) ? nl2br($account->field_work_address[LANGUAGE_NONE][0]['value']) : '') . '</p>';
    //$output .= '<div class="title">Southern Cal. American Society for Microbiology (SCASM)</div>';
    //$output .= '<p>Member</p>';
    //$output .= '<div class="date">December 2010 - Present</div>';
    $output .= '</div>';
    $output .= '</div>';
    $output .= '<div class="clear"></div>';
    $output .= '<div class="block activity-feeds">';
    $output .= '<div class="title-bar">Contributors</div>';
    $output .= '<div class="block-content">';
    $output .= bootstrap_theme_profile_aboutme_activity_feeds($account);
    $output .= '</div>';
    $output .= '</div>';
    return $output;
}