11<?php
22$ enable_filter = evo ()->getConfig ('enable_filter ' );
33evo ()->setConfig ('enable_filter ' , true );
4- $ _style = ManagerTheme::getStyle ();
4+ $ _style = ManagerTheme::getStyle ();
5+ $ wrapActionIcon = function (string $ svg , string $ class = 'action-icon ' ): string {
6+ return '<span class=" ' . $ class . '"> ' . $ svg . '</span> ' ;
7+ };
8+ $ _style ['icon_edit ' ] = $ wrapActionIcon (svg ('tabler-file-pencil ' )->toHtml ());
9+ $ _style ['icon_eye ' ] = $ wrapActionIcon (svg ('tabler-eye ' )->toHtml ());
10+ $ _style ['icon_trash ' ] = $ wrapActionIcon (svg ('tabler-trash ' )->toHtml (), 'action-icon action-icon-trash ' );
11+ $ _style ['icon_undo ' ] = $ wrapActionIcon (svg ('tabler-arrow-back-up ' )->toHtml ());
12+ $ _style ['icon_check ' ] = $ wrapActionIcon (svg ('tabler-check ' )->toHtml ());
13+ $ _style ['icon_close ' ] = $ wrapActionIcon (svg ('tabler-x ' )->toHtml ());
14+ $ _style ['icon_info ' ] = $ wrapActionIcon (svg ('tabler-info-square-rounded ' )->toHtml ());
515$ contents = \EvolutionCMS \Models \SiteContent::query ()->orderBy ('editedon ' ,'DESC ' )->limit (10 );
616
717if ($ contents ->count () < 1 ) {
3242 </td>
3343</tr> ' ;
3444
35- $ btntpl ['edit ' ] = '<a title="[%edit_resource%]" href="index.php?a=27&id=[+id+]" target="main"><i class=" ' . $ _style ['icon_edit ' ] . $ _style [ ' icon_size_fix ' ] . ' "></i> </a> ' ;
36- $ btntpl ['preview_btn ' ] = '<a [+preview_disabled+]" title="[%preview_resource%]" target="_blank" href="../index.php?&id=[+id+]"><i class=" ' . $ _style ['icon_eye ' ] . $ _style [ ' icon_size_fix ' ] . ' "></i> </a> ' ;
45+ $ btntpl ['edit ' ] = '<a title="[%edit_resource%]" href="index.php?a=27&id=[+id+]" target="main"> ' . $ _style ['icon_edit ' ] . ' </a> ' ;
46+ $ btntpl ['preview_btn ' ] = '<a [+preview_disabled+]" title="[%preview_resource%]" target="_blank" href="../index.php?&id=[+id+]"> ' . $ _style ['icon_eye ' ] . ' </a> ' ;
3747
3848$ output = array ();
3949foreach ($ contents ->get ()->toArray () as $ ph ) {
6777 ), $ btntpl ['preview_btn ' ]);
6878
6979 if (evo ()->hasPermission ('delete_document ' )) {
70- if ($ ph ['deleted ' ] == 0 ) {
71- $ delete_btn = '<a onclick="return confirm( \'[%confirm_delete_record%] \')" title="[%delete_resource%]" href="index.php?a=6&id=[+id+]" target="main"><i class=" ' . $ _style ['icon_trash ' ] . $ _style [ ' icon_size_fix ' ] . ' "></i> </a> ' ;
72- } else {
73- $ delete_btn = '<a onclick="return confirm( \'[%confirm_undelete%] \')" title="[%undelete_resource%]" href="index.php?a=63&id=[+id+]" target="main"><i class=" ' . $ _style ['icon_undo ' ] . $ _style [ ' icon_size_fix ' ] . ' "></i> </a> ' ;
74- }
80+ if ($ ph ['deleted ' ] == 0 ) {
81+ $ delete_btn = '<a onclick="return confirm( \'[%confirm_delete_record%] \')" title="[%delete_resource%]" href="index.php?a=6&id=[+id+]" target="main"> ' . $ _style ['icon_trash ' ] . ' </a> ' ;
82+ } else {
83+ $ delete_btn = '<a onclick="return confirm( \'[%confirm_undelete%] \')" title="[%undelete_resource%]" href="index.php?a=63&id=[+id+]" target="main"> ' . $ _style ['icon_undo ' ] . ' </a> ' ;
84+ }
7585 $ ph ['delete_btn ' ] = str_replace ('[+id+] ' , $ docid , $ delete_btn );
7686 } else {
7787 $ ph ['delete_btn ' ] = '' ;
7888 }
7989
80- if ($ ph ['deleted ' ] == 1 && $ ph ['published ' ] == 0 ) {
81- $ publish_btn = '<a class="disabled" title="[%publish_resource%]" href="index.php?a=61&id=[+id+]" target="main"><i class=" ' . $ _style ['icon_check ' ] . $ _style [ ' icon_size_fix ' ] . ' "></i></i> </a> ' ;
82- } elseif ($ ph ['deleted ' ] == 1 && $ ph ['published ' ] == 1 ) {
83- $ publish_btn = '<a class="disabled" title="[%publish_resource%]" href="index.php?a=61&id=[+id+]" target="main"><i class=" ' . $ _style ['icon_close ' ] . $ _style [ ' icon_size_fix ' ] . ' "></i> </a> ' ;
84- } elseif ($ ph ['deleted ' ] == 0 && $ ph ['published ' ] == 0 ) {
85- $ publish_btn = '<a title="[%publish_resource%]" href="index.php?a=61&id=[+id+]" target="main"><i class=" ' . $ _style ['icon_check ' ] . $ _style [ ' icon_size_fix ' ] . ' "></i> </a> ' ;
86- } else {
87- $ publish_btn = '<a title="[%unpublish_resource%]" href="index.php?a=62&id=[+id+]" target="main"><i class=" ' . $ _style ['icon_close ' ] . $ _style [ ' icon_size_fix ' ] . ' "></i> </a> ' ;
88- }
90+ if ($ ph ['deleted ' ] == 1 && $ ph ['published ' ] == 0 ) {
91+ $ publish_btn = '<a class="disabled" title="[%publish_resource%]" href="index.php?a=61&id=[+id+]" target="main"> ' . $ _style ['icon_check ' ] . ' </a> ' ;
92+ } elseif ($ ph ['deleted ' ] == 1 && $ ph ['published ' ] == 1 ) {
93+ $ publish_btn = '<a class="disabled" title="[%publish_resource%]" href="index.php?a=61&id=[+id+]" target="main"> ' . $ _style ['icon_close ' ] . ' </a> ' ;
94+ } elseif ($ ph ['deleted ' ] == 0 && $ ph ['published ' ] == 0 ) {
95+ $ publish_btn = '<a title="[%publish_resource%]" href="index.php?a=61&id=[+id+]" target="main"> ' . $ _style ['icon_check ' ] . ' </a> ' ;
96+ } else {
97+ $ publish_btn = '<a title="[%unpublish_resource%]" href="index.php?a=62&id=[+id+]" target="main"> ' . $ _style ['icon_close ' ] . ' </a> ' ;
98+ }
8999
90100 $ ph ['publish_btn ' ] = str_replace ('[+id+] ' , $ docid , $ publish_btn );
91- $ ph ['info_btn ' ] = str_replace ('[+id+] ' , $ docid , '<a title="[%resource_overview%]" data-toggle="collapse" data-target=".collapse[+id+]"><i class=" ' . $ _style ['icon_info ' ] . $ _style [ ' icon_size_fix ' ] . ' "></i> </a> ' );
101+ $ ph ['info_btn ' ] = str_replace ('[+id+] ' , $ docid , '<a title="[%resource_overview%]" data-toggle="collapse" data-target=".collapse[+id+]"> ' . $ _style ['icon_info ' ] . ' </a> ' );
92102 $ ph ['longtitle ' ] = $ ph ['longtitle ' ] == '' ? '(<i>[%not_set%]</i>) ' : entities ($ ph ['longtitle ' ]);
93103 $ ph ['description ' ] = $ ph ['description ' ] == '' ? '(<i>[%not_set%]</i>) ' : entities ($ ph ['description ' ]);
94104 $ ph ['introtext ' ] = $ ph ['introtext ' ] == '' ? '(<i>[%not_set%]</i>) ' : entities ($ ph ['introtext ' ]);
102112}
103113
104114evo ()->setConfig ('enable_filter ' , $ enable_filter );
105- return implode ("\n" , $ output );
115+ return implode ("\n" , $ output );
0 commit comments