-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_item_block.inc.php
308 lines (283 loc) · 11.5 KB
/
_item_block.inc.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
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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
<?php
/**
* This is the template that displays the item block: title, author, content (sub-template), tags, comments (sub-template)
*
* 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-2016 by Francois Planque - {@link http://fplanque.com/}
*
* @package evoskins
*/
if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
global $Item, $Skin, $app_version;
// Default params:
$params = array_merge( array(
'feature_block' => false, // fp>yura: what is this for??
// Classes for the <article> tag:
'item_class' => 'evo_post evo_content_block',
'item_type_class' => 'evo_post__ptyp_',
'item_status_class' => 'evo_post__',
'item_style' => '',
// Controlling the title:
'disp_title' => true,
'item_title_line_before' => '<div class="evo_post_title">', // Note: we use an extra class because it facilitates styling
'item_title_before' => '<h2>',
'item_title_after' => '</h2>',
'item_title_single_before' => '<h1>', // This replaces the above in case of disp=single or disp=page
'item_title_single_after' => '</h1>',
'item_title_line_after' => '</div>',
// Controlling the content:
'content_mode' => 'auto', // excerpt|full|normal|auto -- auto will auto select depending on $disp-detail
'image_class' => 'img-responsive',
'image_size' => 'fit-1280x720',
'author_link_text' => 'auto',
), $params );
echo '<div class="evo_content_block">'; // Beginning of post display
?>
<article id="<?php $Item->anchor_id() ?>" class="<?php $Item->div_classes( $params ) ?>" lang="<?php $Item->lang() ?>"<?php
echo empty( $params['item_style'] ) ? '' : ' style="'.format_to_output( $params['item_style'], 'htmlattr' ).'"' ?>>
<header>
<?php
$Item->locale_temp_switch(); // Temporarily switch to post locale (useful for multilingual blogs)
// ------- Title -------
if( $params['disp_title'] && $disp != 'page' )
{
echo $params['item_title_line_before'];
if( $disp == 'single' )
{
$title_before = $params['item_title_single_before'];
$title_after = $params['item_title_single_after'];
}
else
{
$title_before = $params['item_title_before'];
$title_after = $params['item_title_after'];
}
// POST TITLE:
$Item->title( array(
'before' => $title_before,
'after' => $title_after,
'link_type' => '#'
) );
// EDIT LINK:
if( $Item->is_intro() )
{ // Display edit link only for intro posts, because for all other posts the link is displayed on the info line.
$Item->edit_link( array(
'before' => '<div class="'.button_class( 'group' ).'">',
'after' => '</div>',
'text' => $Item->is_intro() ? get_icon( 'edit' ).' '.T_('Edit Intro') : '#',
'class' => button_class( 'text' ),
) );
}
echo $params['item_title_line_after'];
}
?>
<?php
if( ! $Item->is_intro() )
{ // Don't display the following for intro posts
?>
<div class="small text-muted">
<?php
if( $Item->status != 'published' )
{
$Item->format_status( array(
'template' => '<div class="evo_status evo_status__$status$ badge pull-right" data-toggle="tooltip" data-placement="top" title="$tooltip_title$">$status_title$</div>',
) );
}
if( $disp != 'page' )
{
// ------------------------- "Item Single - Header" CONTAINER EMBEDDED HERE --------------------------
// Display container contents:
skin_container( /* TRANS: Widget container name */ NT_('Item Single Header'), 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>',
'author_link_text' => $params['author_link_text'],
// Widget 'Search form':
'search_input_before' => '<div class="input-group">',
'search_input_after' => '',
'search_submit_before' => '<span class="input-group-btn">',
'search_submit_after' => '</span></div>',
) );
// ----------------------------- END OF "Item Single - Header" CONTAINER -----------------------------
}
?>
</div>
<?php
}
?>
</header>
<?php
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">'.T_('Tags').': ',
'widget_item_tags_after' => '</nav>',
// 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
}
elseif( $disp == 'page' )
{
?>
<div class="evo_container evo_container__item_page">
<?php
// ------------------------- "Item Page" CONTAINER EMBEDDED HERE --------------------------
// Display container contents:
skin_container( /* TRANS: Widget container name */ NT_('Item Page'), 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">'.T_('Tags').': ',
'widget_item_tags_after' => '</nav>',
// 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 Page" CONTAINER -----------------------------
?>
</div>
<?php
}
else
{
// this will create a <section>
// ---------------------- 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 -------------------------
// this will end a </section>
}
?>
<footer>
<?php
if( ! $Item->is_intro() ) // Do NOT apply tags, comments and feedback on intro posts
{
?>
<nav class="post_comments_link">
<?php
// Link to comments, trackbacks, etc.:
$Item->feedback_link( array(
'type' => 'comments',
'link_before' => '',
'link_after' => '',
'link_text_zero' => '#',
'link_text_one' => '#',
'link_text_more' => '#',
'link_title' => '#',
// fp> WARNING: creates problem on home page: 'link_class' => 'btn btn-default btn-sm',
// But why do we even have a comment link on the home page ? (only when logged in)
) );
// Link to comments, trackbacks, etc.:
$Item->feedback_link( array(
'type' => 'trackbacks',
'link_before' => ' • ',
'link_after' => '',
'link_text_zero' => '#',
'link_text_one' => '#',
'link_text_more' => '#',
'link_title' => '#',
) );
?>
</nav>
<?php } ?>
</footer>
<?php
// ------------------ FEEDBACK (COMMENTS/TRACKBACKS) INCLUDED HERE ------------------
skin_include( '_item_feedback.inc.php', array_merge( array(
'before_section_title' => '<div class="clearfix"></div><h3 class="evo_comment__list_title">',
'after_section_title' => '</h3>',
), $params ) );
// 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>',
'comment_post_display' => false, // Do we want ot display the title of the post we're referring to?
'comment_post_before' => '<h3 class="evo_comment_post_title">',
'comment_post_after' => '</h3>',
'comment_title_before' => '<div class="panel-heading"><h4 class="evo_comment_title panel-title">',
'comment_title_after' => '</h4></div><div class="panel-body">',
'comment_avatar_before' => '<span class="evo_comment_avatar">',
'comment_avatar_after' => '</span>',
'comment_rating_before' => '<div class="evo_comment_rating">',
'comment_rating_after' => '</div>',
'comment_text_before' => '<div class="evo_comment_text">',
'comment_text_after' => '</div>',
'comment_info_before' => '<footer class="evo_comment_footer clear text-muted"><small>',
'comment_info_after' => '</small></footer></div>',
) );
// ---------------------- END OF META COMMENTS ---------------------
}
?>
<?php
locale_restore_previous(); // Restore previous locale (Blog locale)
?>
</article>
<?php echo '</div>'; // End of post display ?>