-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path_item_block.inc.php
More file actions
212 lines (197 loc) · 7.8 KB
/
_item_block.inc.php
File metadata and controls
212 lines (197 loc) · 7.8 KB
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
<?php
/**
* This is the template that displays the item block
*
* This file is not meant to be called directly.
* It is meant to be called by an include in the main.page.php template (or other templates)
*
* b2evolution - {@link http://b2evolution.net/}
* Released under GNU GPL License - {@link http://b2evolution.net/about/gnu-gpl-license}
* @copyright (c)2003-2015 by Francois Planque - {@link http://fplanque.com/}
*
* @package evoskins
* @subpackage bootstrap_manual
*/
if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
global $Item, $Collection, $Blog, $app_version;
// Default params:
$params = array_merge( array(
'feature_block' => false,
'content_mode' => 'auto', // 'auto' will auto select depending on $disp-detail
'item_class' => 'evo_post',
'item_type_class' => 'evo_post__ptyp_',
'item_status_class' => 'evo_post__',
'image_class' => 'img-responsive',
'image_size' => 'fit-1280x720',
'disp_comment_form' => true,
'item_link_type' => 'post',
), $params );
?>
<div id="<?php $Item->anchor_id() ?>" class="<?php $Item->div_classes( $params ) ?>" lang="<?php $Item->lang() ?>">
<?php
$Item->locale_temp_switch(); // Temporarily switch to post locale (useful for multilingual blogs)
?>
<?php
// Comment out prev/next links display until it is not correctly implemented to get cats and items
// in the same order as they are in the sidebar
// ------------------- PREV/NEXT POST LINKS (SINGLE POST MODE) -------------------
/*item_prevnext_links( array(
'block_start' => '<ul class="pager">',
'block_end' => '</ul>',
'template' => '$prev$$next$',
'prev_start' => '<li class="previous">',
'prev_text' => '<span aria-hidden="true">←</span> $title$',
'prev_end' => '</li>',
'next_start' => '<li class="next">',
'next_text' => '$title$ <span aria-hidden="true">→</span>',
'next_end' => '</li>',
'target_blog' => $Blog->ID, // this forces to stay in the same blog, should the post be cross posted in multiple blogs
'post_navigation' => 'same_category', // force to stay in the same category in this skin
) );*/
// ------------------------- END OF PREV/NEXT POST LINKS -------------------------
// Link for editing:
$action_links = $Item->get_edit_link( array(
'before' => '',
'after' => '',
'text' => $Item->is_intro() ? get_icon( 'edit' ).' '.T_('Edit Intro') : '#',
'class' => button_class( 'text' ),
) );
// Link for duplicating:
$action_links .= $Item->get_copy_link( array(
'before' => '',
'after' => '',
'text' => '#icon#',
'class' => button_class(),
) );
if( $Item->is_intro() && $Item->ityp_ID > 1500 )
{ // Link to edit category
$ItemChapter = & $Item->get_main_Chapter();
if( !empty( $ItemChapter ) )
{
$action_links .= $ItemChapter->get_edit_link( array(
'text' => get_icon( 'edit' ).' '.T_('Edit Cat'),
'class' => button_class( 'text' ),
'redirect_page' => 'front',
) );
}
}
if( ! empty( $action_links ) )
{ // Group all action icons:
$action_links = '<div class="'.button_class( 'group' ).'">'.$action_links.'</div>';
}
if( $Item->status != 'published' )
{
$Item->format_status( array(
'template' => '<div class="evo_status evo_status__$status$ badge pull-right">$status_title$</div>',
) );
}
$Item->title( array(
'link_type' => $params['item_link_type'],
'before' => '<div class="evo_post_title"><h1>',
'after' => '</h1>'.$action_links.'</div>',
'nav_target' => false,
) );
if( $disp == 'single' )
{
?>
<div class="evo_container evo_container__item_single">
<?php
// ------------------------- "Item Single" CONTAINER EMBEDDED HERE --------------------------
// Display container contents:
skin_container( /* TRANS: Widget container name */ NT_('Item Single'), array(
'widget_context' => 'item', // Signal that we are displaying within an Item
// The following (optional) params will be used as defaults for widgets included in this container:
// This will enclose each widget in a block:
'block_start' => '<div class="$wi_class$">',
'block_end' => '</div>',
// This will enclose the title of each widget:
'block_title_start' => '<h3>',
'block_title_end' => '</h3>',
// Template params for "Item Tags" widget
'widget_item_tags_before' => '<nav class="small post_tags text-muted">',
'widget_item_tags_after' => '</nav>',
'widget_item_tags_separator' => ', ',
// Template params for "Small Print" widget
'widget_item_small_print_before' => '<p class="small text-muted">',
'widget_item_small_print_after' => '</p>',
'widget_item_small_print_display_author' => false,
// Params for skin file "_item_content.inc.php"
'widget_item_content_params' => $params,
// Template params for "Item Attachments" widget:
'widget_item_attachments_params' => array(
'limit_attach' => 1000,
'before' => '<div class="evo_post_attachments"><h3>'.T_('Attachments').':</h3><ul class="evo_files">',
'after' => '</ul></div>',
'before_attach' => '<li class="evo_file">',
'after_attach' => '</li>',
'before_attach_size' => ' <span class="evo_file_size">(',
'after_attach_size' => ')</span>',
),
) );
// ----------------------------- END OF "Item Single" CONTAINER -----------------------------
?>
</div>
<?php
}
else
{
// ---------------------- POST CONTENT INCLUDED HERE ----------------------
skin_include( '_item_content.inc.php', $params );
// Note: You can customize the default item content by copying the generic
// /skins/_item_content.inc.php file into the current skin folder.
// -------------------------- END OF POST CONTENT -------------------------
if( ! $Item->is_intro() && ! $Item->is_featured() )
{ // Don't display this additional info for intro posts
// List all tags attached to this post:
$Item->tags( array(
'before' => '<div class="small text-muted">'.T_('Tags').': ',
'after' => '</div>',
'separator' => ', ',
) );
echo '<p class="small text-muted">';
$Item->lastedit_user( array(
'before' => T_('Last edit by '),
'after' => T_(' on ').$Item->get_mod_date( 'F jS, Y' ),
'link_text' => 'name',
) );
'</p>';
echo $Item->get_history_link( array(
'before' => ' • ',
'link_text' => T_('View history')
) );
}
}
?>
<?php
// ------------------ FEEDBACK (COMMENTS/TRACKBACKS) INCLUDED HERE ------------------
skin_include( '_item_feedback.inc.php', array_merge( $params, array(
'before_section_title' => '<h3 class="evo_comment__list_title">',
'after_section_title' => '</h3>',
) ) );
// Note: You can customize the default item feedback by copying the generic
// /skins/_item_feedback.inc.php file into the current skin folder.
// ---------------------- END OF FEEDBACK (COMMENTS/TRACKBACKS) ---------------------
?>
<?php
if( evo_version_compare( $app_version, '6.7' ) >= 0 )
{ // We are running at least b2evo 6.7, so we can include this file:
// ------------------ WORKFLOW PROPERTIES INCLUDED HERE ------------------
skin_include( '_item_workflow.inc.php' );
// ---------------------- END OF WORKFLOW PROPERTIES ---------------------
}
?>
<?php
if( evo_version_compare( $app_version, '6.7' ) >= 0 )
{ // We are running at least b2evo 6.7, so we can include this file:
// ------------------ META COMMENTS INCLUDED HERE ------------------
skin_include( '_item_meta_comments.inc.php', array(
'comment_start' => '<article class="evo_comment evo_comment__meta panel panel-default">',
'comment_end' => '</article>',
) );
// ---------------------- END OF META COMMENTS ---------------------
}
?>
<?php
locale_restore_previous(); // Restore previous locale (Blog locale)
?>
</div>