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 #2
0
function psp_single_template_header()
{
    global $post;
    $panorama_access = panorama_check_access($post->ID);
    ?>

    <header id="psp-title" class="cf">
        <div class="wrapper">
            <h1><?php 
    the_title();
    ?>
 <span><?php 
    the_field('client', $post->ID);
    ?>
</span></h1>
            <?php 
    if ($panorama_access == 1) {
        ?>
                <?php 
        do_action('psp_the_navigation');
        ?>
            <?php 
    }
    ?>
        </div>
    </header>

<?php 
}
		<!--[if IE]>
			<link rel="stylesheet" type="text/css" src="<?php 
echo plugins_url();
?>
/project-panorama-lite/assets/css/ie.css">
		<![endif]-->
			
		<?php 
do_action('psp_head');
?>
				
	</head>
	<body class="psp-standalone-page">
		
		<?php 
$panorama_access = panorama_check_access($post->ID);
?>
		
		<div id="psp-project">
			<?php 
while (have_posts()) {
    the_post();
    ?>
				<div id="psp-title" class="cf">
					<div class="wrapper">
						<h1><?php 
    the_title();
    ?>
 <span><?php 
    echo $client;
    ?>
function psp_add_upload_field()
{
    global $post;
    $project_access = get_field('restrict_access_to_specific_users');
    $panorama_access = panorama_check_access($post->ID);
    if ($panorama_access == 1 && $project_access) {
        ?>

    <p class="pano-add-file-btn"><a href="#pano-modal-upload" class="pano-modal-btn pano-btn pano-btn-primary"><?php 
        _e('Add Document', 'psp_projects');
        ?>
</a></p>

    <div class="pano-modal" id="pano-modal-upload">

        <h2><?php 
        _e('Add Document', 'psp_projects');
        ?>
</h2>

        <form id="pano-upload-form" action="?" method="post" class="form" enctype="multipart/form-data">
            <input type="hidden" name="post_id" value="<?php 
        echo $post->ID;
        ?>
">
            <?php 
        wp_nonce_field('upload_attachment', 'my_image_upload_nonce');
        ?>
            <ol class="psp-upload-form">
                <li><label for="file-name"><?php 
        _e('Title', 'psp_projects');
        ?>
</label> <input type="text" name="file-name" value="" id="file-name" required></li>
                <li><label for="file-name"><?php 
        _e('Description', 'psp_projects');
        ?>
</label> <input type="text" name="file-description" value="" id="file-description"></li>
                <li><label for="file-type"><?php 
        _e('File Type', 'psp_projects');
        ?>
</label> <input type="radio" value="upload" name="file-type" id="file-type-upload" checked> <?php 
        _e('Upload', 'psp_projects');
        ?>
 &nbsp;&nbsp; <input type="radio" name="file-type" id="file-type-web" value="web"> <?php 
        _e('Web Address', 'psp_projects');
        ?>
</li>
                <li class="psp-web-address-field"><label for="file_url"><?php 
        _e('Web Address', 'psp_projects');
        ?>
</label> <input type="text" name="file_url" value="http://"></li>
                <li class="psp-upload-file-field"><label for="upload_attachment"><?php 
        _e('Upload File', 'psp_projects');
        ?>
</label> <input type="file" name="upload_attachment" class="files" size="50"  /></li>
            </ol>
            <p class="pano-modal-add-btn"><input type="submit" value="<?php 
        _e('Add Document', 'psp_projects');
        ?>
" class="pano-btn pano-btn-primary"> <a href="#" class="modal_close"><?php 
        _e('Cancel', 'psp_projects');
        ?>
</a></p>
        </form>
    </div>

    <?php 
    }
}