57
57
' cancel' => ' index.php?' . ($id == 0 ? ' a=2' : ' a=3&r=1&id=' . $id . $add_path ),
58
58
' move' => ' index.php?id=' . $_REQUEST [' id' ] . ' &a=51' ,
59
59
' duplicate' => ' index.php?id=' . $_REQUEST [' id' ] . ' &a=94' ,
60
- ' view' => $modx -> getConfig (' friendly_urls' ) ? UrlProcessor:: makeUrl ($id ) : MODX_SITE_URL . ' index.php?id=' . $id ,
60
+ ' view' => evo () -> getConfig (' friendly_urls' ) ? UrlProcessor:: makeUrl ($id ) : MODX_SITE_URL . ' index.php?id=' . $id ,
61
61
];
62
62
63
63
/**
77
77
}
78
78
79
79
// Get Template name
80
- $templatename = \EvolutionCMS \Models \SiteTemplate:: query ()-> where (' id' , ' =' ,
81
- $content [' template' ])-> get ()-> toArray ();
82
- if (! is_null ($templatename )) {
80
+ $templatename = \EvolutionCMS \Models \SiteTemplate:: query ()-> where (' id' , ' =' , $content [' template' ])-> get ()-> toArray ();
81
+ if (count ($templatename )) {
83
82
$templatename = $templatename [0 ][' templatename' ];
84
83
}
85
84
90
89
/**
91
90
* "View Children" tab setup
92
91
*/
93
- $maxpageSize = $modx -> getConfig (' number_of_results' );
92
+ $maxpageSize = evo () -> getConfig (' number_of_results' );
94
93
define (' MAX_DISPLAY_RECORDS_NUM' , $maxpageSize );
95
94
96
95
// predefined constants
114
113
if ($_SESSION [' mgrRole' ] != 1 ) {
115
114
if (is_array ($_SESSION [' mgrDocgroups' ]) && count ($_SESSION [' mgrDocgroups' ]) > 0 ) {
116
115
$childs = $resources -> where (function ($q ) {
117
- $q -> where (' site_content.privatemgr' , 0 )
118
- -> orWhereIn (' document_groups.document_group' , $_SESSION [' mgrDocgroups' ]);
116
+ $q -> where (' site_content.privatemgr' , 0 )-> orWhereIn (' document_groups.document_group' , $_SESSION [' mgrDocgroups' ]);
119
117
});
120
118
} else {
121
119
$childs = $resources -> where (' site_content.privatemgr' , 0 );
131
129
// Get child documents (with paging)
132
130
133
131
if ($numRecords > 0 ) {
134
- $childs = $childs -> orderBy ($sort ,
135
- $dir )-> offset ($pg * MAX_DISPLAY_RECORDS_NUM )-> limit (MAX_DISPLAY_RECORDS_NUM )-> get ();
136
-
132
+ $childs = $childs -> orderBy ($sort , $dir )-> offset ($pg * MAX_DISPLAY_RECORDS_NUM )-> limit (MAX_DISPLAY_RECORDS_NUM )-> get ();
137
133
$resource = $childs -> toArray ();
138
134
139
135
// CSS style for table
153
149
$table = new \EvolutionCMS\Support\ MakeTable ();
154
150
$table -> setTableClass ($tableClass );
155
151
$table -> setColumnHeaderClass ($columnHeaderClass );
156
- // $modx ->getMakeTable()->setRowHeaderClass($rowHeaderClass);
157
- // $modx ->getMakeTable()->setRowRegularClass($rowRegularClass);
158
- // $modx ->getMakeTable()->setRowAlternateClass($rowAlternateClass);
152
+ // evo() ->getMakeTable()->setRowHeaderClass($rowHeaderClass);
153
+ // evo() ->getMakeTable()->setRowRegularClass($rowRegularClass);
154
+ // evo() ->getMakeTable()->setRowAlternateClass($rowAlternateClass);
159
155
160
156
// Table header
161
157
$listTableHeader = array (
195
191
foreach ($resource as $k => $children ) {
196
192
197
193
switch ($children [' id' ]) {
198
- case $modx -> getConfig (' site_start' ) :
194
+ case evo () -> getConfig (' site_start' ) :
199
195
$icon = ' <i class="' . $_style [' icon_home' ] . ' "></i>' ;
200
196
break ;
201
- case $modx -> getConfig (' error_page' ) :
197
+ case evo () -> getConfig (' error_page' ) :
202
198
$icon = ' <i class="' . $_style [' icon_info_triangle' ] . ' "></i>' ;
203
199
break ;
204
- case $modx -> getConfig (' site_unavailable_page' ) :
200
+ case evo () -> getConfig (' site_unavailable_page' ) :
205
201
$icon = ' <i class="' . $_style [' icon_clock' ] . ' "></i>' ;
206
202
break ;
207
- case $modx -> getConfig (' unauthorized_page' ) :
203
+ case evo () -> getConfig (' unauthorized_page' ) :
208
204
$icon = ' <i class="' . $_style [' icon_info' ] . ' "></i>' ;
209
205
break ;
210
206
default :
221
217
222
218
$private = ($children [' privateweb' ] || $children [' privatemgr' ] ? ' private' : ' ' );
223
219
224
- // дописываем в заголовок класс для неопубликованных плюс по всем ссылкам обратный путь
225
- // для сохранения сортировки
220
+ // дописуємо в заголовок клас для неопублікованих плюс по всім посиланням зворотній шлях
221
+ // для збереження сортування
226
222
$class = ($children [' deleted' ] ? ' text-danger text-decoration-through' : (! $children [' published' ] ? ' font-italic text-muted' : ' publish' ));
227
- // $class .= ($children['hidemenu'] ? ' text-muted' : ' text-primary');
228
- // $class .= ($children['isfolder'] ? ' font-weight-bold' : '');
229
- if ($modx -> hasPermission (' edit_document' )) {
223
+ if (evo ()-> hasPermission (' edit_document' )) {
230
224
$title = ' <span class="doc-item' . $private . ' ">' . $icon . ' <a href="index.php?a=27&id=' . $children [' id' ] . $add_path . ' ">' . ' <span class="' . $class . ' ">' . entities ($children [' pagetitle' ],
231
- $modx -> getConfig (' modx_charset' )) . ' </span></a></span>' ;
225
+ evo () -> getConfig (' modx_charset' )) . ' </span></a></span>' ;
232
226
} else {
233
227
$title = ' <span class="doc-item' . $private . ' ">' . $icon . ' <span class="' . $class . ' ">' . entities ($children [' pagetitle' ],
234
- $modx -> getConfig (' modx_charset' )) . ' </span></span>' ;
228
+ evo () -> getConfig (' modx_charset' )) . ' </span></span>' ;
235
229
}
236
230
237
231
$icon_pub_unpub = (! $children [' published' ])
245
239
$listDocs [] = array (
246
240
' docid' => ' <div class="text-right">' . $children [' id' ] . ' </div>' ,
247
241
' title' => $title ,
248
- ' createdon' => ' <div class="text-right">' . ($modx -> toDateFormat ($children [' createdon' ] + $modx -> timestamp (0 ),
242
+ ' createdon' => ' <div class="text-right">' . (evo () -> toDateFormat ($children [' createdon' ] + evo () -> timestamp (0 ),
249
243
' dateOnly' )) . ' </div>' ,
250
- ' pub_date' => ' <div class="text-right">' . ($children [' pub_date' ] ? ($modx -> toDateFormat ($children [' pub_date' ] + $modx -> timestamp (0 ),
244
+ ' pub_date' => ' <div class="text-right">' . ($children [' pub_date' ] ? (evo () -> toDateFormat ($children [' pub_date' ] + evo () -> timestamp (0 ),
251
245
' dateOnly' )) : ' ' ) . ' </div>' ,
252
246
' status' => ' <div class="text-nowrap">' . ($children [' published' ] == 0 ? ' <span class="unpublishedDoc">' . ManagerTheme:: getLexicon (' page_data_unpublished' ) . ' </span>' : ' <span class="publishedDoc">' . ManagerTheme:: getLexicon (' page_data_published' ) . ' </span>' ) . ' </div>' ,
253
- ' edit' => ' <div class="actions text-center text-nowrap">' . ($modx -> hasPermission (' edit_document' ) ? ' <a href="index.php?a=27&id=' . $children [' id' ] . $add_path . ' " title="' . ManagerTheme:: getLexicon (' edit' ) . ' "><i class="' . $_style [' icon_edit' ] . ' "></i></a>
247
+ ' edit' => ' <div class="actions text-center text-nowrap">' . (evo () -> hasPermission (' edit_document' ) ? ' <a href="index.php?a=27&id=' . $children [' id' ] . $add_path . ' " title="' . ManagerTheme:: getLexicon (' edit' ) . ' "><i class="' . $_style [' icon_edit' ] . ' "></i></a>
254
248
<a href="index.php?a=51&id=' . $children [' id' ] . $add_path . ' " title="' . ManagerTheme:: getLexicon (' move' ) . ' "><i
255
- class="' . $_style [' icon_move' ] . ' "></i></a>' . $icon_pub_unpub : ' ' ) . ($modx -> hasPermission (' delete_document' ) ? $icon_del_undel : ' ' ) . ' </div>'
249
+ class="' . $_style [' icon_move' ] . ' "></i></a>' . $icon_pub_unpub : ' ' ) . (evo () -> hasPermission (' delete_document' ) ? $icon_del_undel : ' ' ) . ' </div>'
256
250
);
257
251
}
258
252
@@ -264,7 +258,6 @@ class="' . $_style['icon_move'] . '"></i></a>' . $icon_pub_unpub : '') . ($modx-
264
258
$add_path = ' ' ;
265
259
}
266
260
}
267
-
268
261
? >
269
262
<script type =" text/javascript" >
270
263
var actions = {
@@ -308,8 +301,8 @@ class="' . $_style['icon_move'] . '"></i></a>' . $icon_pub_unpub : '') . ($modx-
308
301
309
302
<h1 >
310
303
<i class =" {{ $_style [' icon_info' ] } }" ></i >
311
- {{ entities (iconv_substr ($content [' pagetitle' ], 0 , 50 , $modx -> getConfig (' modx_charset' )), $modx -> getConfig (' modx_charset' )) } }
312
- @if (iconv_strlen ($content [' pagetitle' ], $modx -> getConfig (' modx_charset' )) > 50 )
304
+ {{ entities (iconv_substr ($content [' pagetitle' ], 0 , 50 , evo () -> getConfig (' modx_charset' )), evo () -> getConfig (' modx_charset' )) } }
305
+ @if (iconv_strlen ($content [' pagetitle' ], evo () -> getConfig (' modx_charset' )) > 50 )
313
306
...
314
307
@endif
315
308
<small >({{ (int )$_REQUEST [' id' ] } } )</small >
@@ -319,7 +312,7 @@ class="' . $_style['icon_move'] . '"></i></a>' . $icon_pub_unpub : '') . ($modx-
319
312
320
313
<div class =" tab-pane" id =" childPane" >
321
314
<script type =" text/javascript" >
322
- docSettings = new WebFXTabPane (document .getElementById (" childPane" ), @if ($modx -> getConfig (' remember_last_tab' ) ) true
315
+ docSettings = new WebFXTabPane (document .getElementById (" childPane" ), @if (evo () -> getConfig (' remember_last_tab' ) ) true
323
316
@else false @endif );
324
317
</script >
325
318
@@ -340,45 +333,51 @@ class="' . $_style['icon_move'] . '"></i></a>' . $icon_pub_unpub : '') . ($modx-
340
333
<td width =" 200" valign =" top" >{{ ManagerTheme:: getLexicon (' long_title' ) } } :</td >
341
334
<td >
342
335
<small ><?= $content [' longtitle' ] != ' ' ? entities ($content [' longtitle' ],
343
- $modx -> getConfig (' modx_charset' )) : " (<i>" . ManagerTheme:: getLexicon (' not_set' ) . " </i>)" ? > </small >
336
+ evo ()-> getConfig (' modx_charset' )) : " (<i>" . ManagerTheme:: getLexicon (' not_set' ) . " </i>)" ? >
337
+ </small >
344
338
</td >
345
339
</tr >
346
340
<tr >
347
341
<td valign =" top" >{{ ManagerTheme:: getLexicon (' resource_description' ) } } :</td >
348
342
<td ><?= $content [' description' ] != ' ' ? entities ($content [' description' ],
349
- $modx -> getConfig (' modx_charset' )) : " (<i>" . ManagerTheme:: getLexicon (' not_set' ) . " </i>)" ? > </td >
343
+ evo ()-> getConfig (' modx_charset' )) : " (<i>" . ManagerTheme:: getLexicon (' not_set' ) . " </i>)" ? >
344
+ </td >
350
345
</tr >
351
346
<tr >
352
347
<td valign =" top" >{{ ManagerTheme:: getLexicon (' resource_summary' ) } } :</td >
353
348
<td ><?= $content [' introtext' ] != ' ' ? entities ($content [' introtext' ],
354
- $modx -> getConfig (' modx_charset' )) : " (<i>" . ManagerTheme:: getLexicon (' not_set' ) . " </i>)" ? > </td >
349
+ evo ()-> getConfig (' modx_charset' )) : " (<i>" . ManagerTheme:: getLexicon (' not_set' ) . " </i>)" ? >
350
+ </td >
355
351
</tr >
356
352
<tr >
357
353
<td valign =" top" >{{ ManagerTheme:: getLexicon (' type' ) } } :</td >
358
354
<td ><?= $content [' type' ] == ' reference' ? ManagerTheme:: getLexicon (' weblink' ) : ManagerTheme:: getLexicon (' resource' ) ? > </td >
359
355
</tr >
360
356
<tr >
361
357
<td valign =" top" >{{ ManagerTheme:: getLexicon (' resource_alias' ) } } :</td >
362
- <td ><?= $content [' alias' ] != ' ' ? entities ($content [' alias' ],
363
- $modx -> getConfig (' modx_charset' )) : " (<i>" . ManagerTheme:: getLexicon (' not_set' ) . " </i>)" ? > </td >
358
+ <td ><?= $content [' alias' ] != ' ' ? entities ($content [' alias' ], evo ()-> getConfig (' modx_charset' )) : " (<i>" . ManagerTheme:: getLexicon (' not_set' ) . " </i>)" ? > </td >
364
359
</tr >
365
360
<tr >
366
361
<td colspan =" 2" >  ; </td >
367
362
</tr >
368
363
<tr >
369
- <td colspan =" 2" ><b >{{ ManagerTheme:: getLexicon (' page_data_changes' ) } } </b ></td >
364
+ <td colspan =" 2" ><b >{{ ManagerTheme:: getLexicon (' page_data_changes' ) } } </b ></td >
370
365
</tr >
371
366
<tr >
372
- <td >{{ ManagerTheme:: getLexicon (' page_data_created' ) } } :</td >
373
- <td ><?= $modx -> toDateFormat ($content [' createdon' ] + $modx -> timestamp (0 )) ? >
374
- (<b ><?= entities ($createdbyname , $modx -> getConfig (' modx_charset' )) ? > </b >)
367
+ <td >{{ ManagerTheme:: getLexicon (' page_data_created' ) } } :</td >
368
+ <td >{{ evo ()-> toDateFormat ($content [' createdon' ] + evo ()-> timestamp (0 ))} }
369
+ @if ($createdbyname )
370
+ (<b >{{ $createdbyname } } </b >)
371
+ @else
372
+ (<i >{{ ManagerTheme:: getLexicon (' not_set' ) } } </i >)
373
+ @endif
375
374
</td >
376
375
</tr >
377
376
<?php if ($editedbyname != ' ' ) { ? >
378
377
<tr >
379
- <td >{{ ManagerTheme:: getLexicon (' page_data_edited' ) } } :</td >
380
- <td ><?= $modx -> toDateFormat ($content [' editedon' ] + $modx -> timestamp (0 )) ? >
381
- (<b ><?= entities ($editedbyname , $modx -> getConfig (' modx_charset' )) ? > </b >)
378
+ <td >{{ ManagerTheme:: getLexicon (' page_data_edited' ) } } :</td >
379
+ <td ><?= evo () -> toDateFormat ($content [' editedon' ] + evo () -> timestamp (0 )) ? >
380
+ (<b ><?= entities ($editedbyname , evo () -> getConfig (' modx_charset' )) ? > </b >)
382
381
</td >
383
382
</tr >
384
383
<?php } ? >
@@ -394,11 +393,11 @@ class="' . $_style['icon_move'] . '"></i></a>' . $icon_pub_unpub : '') . ($modx-
394
393
</tr >
395
394
<tr >
396
395
<td >{{ ManagerTheme:: getLexicon (' page_data_publishdate' ) } } :</td >
397
- <td ><?= $content [' pub_date' ] == 0 ? " (<i>" . ManagerTheme:: getLexicon (' not_set' ) . " </i>)" : $modx -> toDateFormat ($content [' pub_date' ]) ? > </td >
396
+ <td ><?= $content [' pub_date' ] == 0 ? " (<i>" . ManagerTheme:: getLexicon (' not_set' ) . " </i>)" : evo () -> toDateFormat ($content [' pub_date' ]) ? > </td >
398
397
</tr >
399
398
<tr >
400
399
<td >{{ ManagerTheme:: getLexicon (' page_data_unpublishdate' ) } } :</td >
401
- <td ><?= $content [' unpub_date' ] == 0 ? " (<i>" . ManagerTheme:: getLexicon (' not_set' ) . " </i>)" : $modx -> toDateFormat ($content [' unpub_date' ]) ? > </td >
400
+ <td ><?= $content [' unpub_date' ] == 0 ? " (<i>" . ManagerTheme:: getLexicon (' not_set' ) . " </i>)" : evo () -> toDateFormat ($content [' unpub_date' ]) ? > </td >
402
401
</tr >
403
402
<tr >
404
403
<td >{{ ManagerTheme:: getLexicon (' page_data_cacheable' ) } } :</td >
@@ -410,7 +409,7 @@ class="' . $_style['icon_move'] . '"></i></a>' . $icon_pub_unpub : '') . ($modx-
410
409
</tr >
411
410
<tr >
412
411
<td >{{ ManagerTheme:: getLexicon (' resource_opt_menu_index' ) } } :</td >
413
- <td ><?= entities ($content [' menuindex' ], $modx -> getConfig (' modx_charset' )) ? > </td >
412
+ <td ><?= entities ($content [' menuindex' ], evo () -> getConfig (' modx_charset' )) ? > </td >
414
413
</tr >
415
414
<tr >
416
415
<td >{{ ManagerTheme:: getLexicon (' resource_opt_show_menu' ) } } :</td >
@@ -433,7 +432,7 @@ class="' . $_style['icon_move'] . '"></i></a>' . $icon_pub_unpub : '') . ($modx-
433
432
<tr >
434
433
<td >{{ ManagerTheme:: getLexicon (' page_data_template' ) } } :</td >
435
434
<td ><?= $content [' template' ] == 0 ? " (<i>" . ManagerTheme:: getLexicon (' not_set' ) . " </i>)" : entities ($templatename ,
436
- $modx -> getConfig (' modx_charset' )) ? > </td >
435
+ evo () -> getConfig (' modx_charset' )) ? > </td >
437
436
</tr >
438
437
<tr >
439
438
<td >{{ ManagerTheme:: getLexicon (' page_data_editor' ) } } :</td >
@@ -456,7 +455,7 @@ class="' . $_style['icon_move'] . '"></i></a>' . $icon_pub_unpub : '') . ($modx-
456
455
<div class =" form-group clearfix" >
457
456
@if ($numRecords > 0 )
458
457
<div class =" float-xs-left" >
459
- <span class =" publishedDoc" >{{ $numRecords } } {{ ManagerTheme:: getLexicon (' resources_in_container' ) } } (<strong >{{ entities ($content [' pagetitle' ], $modx -> getConfig (' modx_charset' )) } } </strong >)</span >
458
+ <span class =" publishedDoc" >{{ $numRecords } } {{ ManagerTheme:: getLexicon (' resources_in_container' ) } } (<strong >{{ entities ($content [' pagetitle' ], evo () -> getConfig (' modx_charset' )) } } </strong >)</span >
460
459
</div >
461
460
@endif
462
461
<div class =" float-right" >
@@ -483,7 +482,6 @@ class="' . $_style['icon_move'] . '"></i></a>' . $icon_pub_unpub : '') . ($modx-
483
482
</div >
484
483
</div ><!-- end tab-page -->
485
484
@endif
486
-
487
485
</div ><!-- end documentPane -->
488
486
489
487
@if (is_numeric (get_by_key ($_GET , ' tab' )) )
@@ -495,8 +493,7 @@ class="' . $_style['icon_move'] . '"></i></a>' . $icon_pub_unpub : '') . ($modx-
495
493
@if (! empty ($show_preview ) )
496
494
<div class =" sectionHeader" >{{ ManagerTheme:: getLexicon (' preview' ) } } </div >
497
495
<div class =" sectionBody" id =" lyr2" >
498
- <iframe src =" {{ MODX_SITE_URL } } index.php?id={{ $id } } &z=manprev" frameborder =" 0" border =" 0"
499
- id =" previewIframe" ></iframe >
496
+ <iframe src =" {{ MODX_SITE_URL } } index.php?id={{ $id } } &z=manprev" frameborder =" 0" border =" 0" id =" previewIframe" ></iframe >
500
497
</div >
501
498
@endif
502
499
@endsection
0 commit comments