Example #1
0
function psp_single_project($atts)
{
    extract(shortcode_atts(array('id' => ''), $atts));
    $project = get_post($id);
    if ($project) {
        $psp_shortcode = '
			
			<div class="psp-single-project">
			
				<h1>' . $project->post_title . '</h1>
			
				' . psp_essentials($id, 'psp-shortcode') . '
			
				' . psp_total_progress($id, 'psp-shortcode') . '
						
			<div class="single-project-phases">
				<h2>Project Phases</h2>
				' . psp_phases($id, 'psp-shortcode') . '
			</div>
			
		</div>';
        return $psp_shortcode;
    } else {
        return '<p>No project with that ID</p>';
    }
}
function psp_single_project($atts)
{
    extract(shortcode_atts(array('id' => '', 'overview' => '', 'progress' => '', 'milestones' => ''), $atts));
    // If attributes are not set, let's use defaults.
    if ($overview == '') {
        $overview = 'yes';
    }
    if ($progress == '') {
        $progress == 'yes';
    }
    if ($milestones == '') {
        $milestones = 'condensed';
    }
    $project = get_post($id);
    if ($project) {
        $psp_shortcode = '

			<div class="psp-single-project">

				<h1>' . $project->post_title . '</h1>';
        // Is the overview to be displayed?
        if ($overview == 'yes') {
            $psp_shortcode .= psp_essentials($id, 'psp-shortcode');
        }
        if ($progress == 'yes') {
            // Display the progress bar
            $psp_shortcode .= psp_total_progress($id, 'psp-shortcode', $milestones);
        }
        $psp_shortcode .= '</div>';
        psp_front_styles(1);
        psp_front_scripts(1);
        return $psp_shortcode;
    } else {
        return '<p>' . __('No project with that ID', 'psp_projects') . '</p>';
    }
}
function psp_single_project($atts)
{
    psp_front_assets(1);
    extract(shortcode_atts(array('id' => '', 'overview' => '', 'progress' => '', 'milestones' => '', 'phases' => '', 'tasks' => ''), $atts));
    // If attributes are not set, let's use defaults.
    if ($overview == '') {
        $overview = 'yes';
    }
    if ($progress == '') {
        $progress == 'yes';
    }
    if ($milestones == '') {
        $milestones = 'condensed';
    }
    if ($phases == '') {
        $phases = 'yes';
    }
    if ($tasks == '') {
        $tasks = 'yes';
    }
    $project = get_post($id);
    $panorama_access = panorama_check_access($id);
    if ($project) {
        ob_start();
        if ($panorama_access == 1) {
            ?>
			
					<div class="psp-single-project">
			
						<h1><?php 
            echo $project->post_title;
            ?>
</h1>
				
						<?php 
            // Is the overview to be displayed?
            if ($overview == 'yes') {
                echo psp_essentials($id, 'psp-shortcode');
            }
            if ($progress == 'yes') {
                echo psp_total_progress($id, 'psp-shortcode', $milestones);
            }
            if ($phases == 'yes') {
                ?>
										
								<div class="single-project-phases">
									<h2><?php 
                _e('Project Phases', 'psp_projects');
                ?>
</h2>
									<?php 
                echo psp_phases($id, 'psp-shortcode', $tasks);
                ?>
								</div>
						<?php 
            }
            ?>
				
						</div>
			
			<?php 
        } else {
            ?>
						
				<div id="psp-login">
					<?php 
            if ($access_granted == 0 && get_field('restrict_access_to_specific_users', $id)) {
                ?>
						<h2><?php 
                _e('This Project Requires a Login', 'psp_projects');
                ?>
</h2>
						<?php 
                if (!is_user_logged_in()) {
                    echo panorama_login_form();
                } else {
                    echo "<p>" . __('You don\'t have permission to access this project', 'psp_projects') . "</p>";
                }
                ?>
					<?php 
            }
            ?>
					<?php 
            if (post_password_required() && !current_user_can('manage_options')) {
                ?>
						<h2><?php 
                _e('This Project is Password Protected', 'psp_projects');
                ?>
</h2>
						<?php 
                echo get_the_password_form();
                ?>
					<?php 
            }
            ?>
				</div>

		<?php 
        }
        return ob_get_clean();
    } else {
        return '<p>' . __('No project with that ID', 'psp_projects') . '</p>';
    }
}
Example #4
0
									</ul>
								</li>
							</ul>
						</div>
					</div>
				</div>
				
				<div id="overview" class="wrapper">
					<?php 
    echo psp_essentials($post->ID);
    ?>
				</div> <!--/#overview-->
			
				<div id="psp-progress" class="cf">
					<?php 
    echo psp_total_progress($post->ID);
    ?>
				</div> <!--/#progress-->
			
			<div id="psp-phases" class="wrapper">
				<?php 
    echo psp_phases($post->ID);
    ?>
			</div>
			
			<!-- Discussion -->
			<div id="psp-discussion">
				<div class="wrapper">
					
					<div class="discussion-content">
						<h2>Project Discussion</h2>
Example #5
0
function psp_echo_total_progress()
{
    global $post;
    echo psp_total_progress($post->ID);
}