-
Notifications
You must be signed in to change notification settings - Fork 2
/
archive-passport.php
executable file
·106 lines (80 loc) · 3.49 KB
/
archive-passport.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<?php
/**
* The template for displaying Passport Archive page.
*
* Learn more: http://codex.wordpress.org/Template_Hierarchy
*
* @package Listify
*/
global $style;
$blog_style = get_theme_mod( 'content-blog-style', 'default' );
$style = 'grid-standard' == $blog_style ? 'standard' : 'cover';
$sidebar = 'none' != esc_attr( listify_theme_mod( 'content-sidebar-position', 'right' ) ) && is_active_sidebar( 'widget-area-sidebar-1' );
get_header(); ?>
<div id="primary" class="container new-passport-container">
<!-- Toggle button -->
<button onclick="toggle_passport_form()" class="button button-small" id="filter-button">Add new Portfolio</button>
<!-- Add a new passport form -->
<div id="add-passport-form">
<h1>New Portfolio</h1>
<div id="error-content">
</div>
<form action="" id="new-passport-form" method="POST">
<label for="passportTitle">Title : </label>
<input type="text" name="passportTitle" id="passportTitle" class="required" value="<?php if ( isset( $_POST['passportTitle'] ) ) echo $_POST['passportTitle']; ?>" />
<?php
if( is_plugin_active( "open-badges-framework/open-badges-framework.php" ) ) {
// Display the children of the right PARENT
$parents = apply_filters( 'plugin_get_sub', $parents );
?>
<label for="passportLanguage">Language : </label>
<select name="passportLanguage" id="passportLanguage" class="required">
<option selected="true" disabled="disabled">Select</option>
<?php
foreach ((array)$parents['most-important'] as $language) {
echo '<option value="' . $language->term_id . '">' . $language->name . '</option>';
}
?>
</select>
<?php } ?>
<input type="hidden" name="user" id="user" value="<?php echo get_current_user_id(); ?>" />
<button type="submit" class="button button-small passport-button">Save Portfolio</button>
</form>
</div>
</div>
<div <?php echo apply_filters( 'listify_cover', 'page-cover' ); ?>>
<h1 class="page-title cover-wrapper">Portfolios</h1>
</div>
<div id="primary" class="container">
<div class="row content-area">
<?php if ( 'left' == esc_attr( listify_theme_mod( 'content-sidebar-position', 'right' ) ) ) : ?>
<?php get_sidebar(); ?>
<?php endif; ?>
<main id="main" class="site-main col-xs-12 <?php if ( $sidebar ) : ?> col-sm-7 col-md-8<?php endif; ?>" role="main">
<?php if ( 'default' != $blog_style ) : ?>
<div class="blog-archive blog-archive--grid <?php if ( $sidebar ) : ?> blog-archive--has-sidebar<?php endif; ?>" data-columns>
<?php add_filter( 'excerpt_length', 'listify_short_excerpt_length' ); ?>
<?php endif; ?>
<?php
while ( have_posts() ) :
the_post();
//Display the passports of only the logged in user
if( get_current_user_id() == get_post_meta( get_the_ID(),'_student',true ) ){
// Display the custom template archive-passport-content.php
get_template_part( 'templates/archives/archive-passport-content' );
}
endwhile;
// Display the pagination template (if there are more than 5 results)
get_template_part( 'content', 'pagination' ); ?>
<?php if ( 'default' != $blog_style ) : ?>
<?php remove_filter( 'excerpt_length', 'listify_short_excerpt_length' ); ?>
</div>
<?php endif; ?>
<?php
// Display the pagination template
get_template_part( 'content', 'pagination' );
?>
</main>
</div>
</div>
<?php get_footer(); ?>