Skip to content

Commit

Permalink
update for php 7.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicola1971 committed Sep 14, 2022
1 parent 06d306f commit 7e08dfb
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions install/assets/plugins/DashboardListDoc.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
* Dashboard Documents list/grid widget plugin
*
* @category plugin
* @version 2.0.5.4
* @version 2.0.5.5
* @author Nicola Lambathakis http://www.tattoocms.it/ https://github.com/Nicola1971/
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License (GPL)
* @internal @events OnManagerWelcomeHome,OnManagerWelcomePrerender
* @internal @properties &wdgVisibility=Show widget for:;menu;All,AdminOnly,AdminExcluded,ThisRoleOnly,ThisUserOnly;All &ThisRole=Show only to this role id:;string;;;enter the role id &ThisUser=Show only to this username:;string;;;enter the username &wdgTitle=Widget Title:;string;Documents List &wdgicon=widget icon:;string;fa-pencil &wdgposition=widget position:;list;1,2,3,4,5,6,7,8,9,10;1 &wdgsizex=widget width:;list;12,6,4,3;12 &ParentFolder=Parent folder for List documents:;string;0 &ListItems=Max items in List:;string;50 &dittolevel=Depht:;string;3 &hideFolders=Hide Folders:;list;yes,no;no &showUnpublished=Show Deleted and Unpublished:;list;yes,no;yes;;Show Deleted and Unpublished resources &showAddButtons=Show Create Resource Buttons:;list;yes,no;no;;show header add buttons &showStatusFilter=Show Status Filter:;list;yes,no;yes;;require Show Deleted and Unpublished YES &DisplayTitle=Display Title in title column:;list;pagetitle,longtitle,menutitle;pagetitle;;choose which title display in title column &showParent=Show Parent Column:;list;yes,no;yes &showUser=Show User Column:;list;createdby,publishedby,editedby,no;createdby &showDate=Show Date Column:;list;createdon,publishedon,editedon,no;editedon &dateFormat=Date Column Format:;list;DD MM YYYY,MM DD YYYY,YYYY MM DD;DD MM YYYY &TvColumn=Tv Columns:;string;[+longtitle+],[+menuindex+] &TvSortType=Tv Column Sort type:;string;text,number &ImageTv=Show Image TV:;string;image;;enter tv name &ShowImageIn=Show image Tv in:;list;overview,column;overview &tablefields=Overview Tv Fields:;string;[+longtitle+],[+description+],[+introtext+],[+documentTags+] &tableheading=Overview TV headings:;string;Long Title,Description,Introtext,Tags &editInModal=Edit docs in modal:;list;yes,no;no;;edit and create resources in evo modal window &showMoveButton=Show Move Button:;list;yes,no;yes;;hides the button to everyone, even if the user has permissions &showAddHere=Show Create Resource here Button:;list;yes,no;yes;;hides the button to everyone, even if the user has permissions &showDuplicateButton=Show Duplicate Button:;list;yes,no;yes;;hides the button to everyone, even if the user has permissions &showPublishButton=Show Publish Button:;list;yes,no;yes;;hides the button to everyone, even if the user has permissions &showDeleteButton=Show Delete Button:;list;yes,no;yes;;hides the button to everyone, even if the user has permissions &HeadBG=Widget Title Background color:;string; &HeadColor=Widget title color:;string &confirmTheme=jquery confirm Theme:;list;modern,light,dark,supervan,material,bootstrap;modern;;theme styles for confim alert windows
* @internal @installset base, sample
* @internal @modx_category Dashboard
* @internal @disabled 0
* @lastupdate 31-03-2022
* @lastupdate 14-09-2022
* @documentation Requirements: This plugin requires Evolution 1.4 or later
* @documentation https://github.com/Nicola1971/DashboardListDoc-widget/
* @reportissues https://github.com/Nicola1971/DashboardListDoc-widget/issues
Expand Down Expand Up @@ -79,8 +79,8 @@
<script>
';
if ($showUnpublished == yes) {
if ($showStatusFilter == yes) {
if ($showUnpublished == 'yes') {
if ($showStatusFilter == 'yes') {
$jsOutput .= 'FooTable.MyFiltering = FooTable.Filtering.extend({
construct: function(instance){
this._super(instance);
Expand Down Expand Up @@ -437,7 +437,7 @@
$tableheading = isset($tableheading) ? $tableheading : 'Long Title,Description,Introtext,Tags';
//Header create resource in parent buttons
if ($showAddButtons == yes) {
if ($showAddButtons == 'yes') {
if($modx->hasPermission('edit_document')) {
$Parents = explode(",","$ParentFolder");
foreach ($Parents as $Parent){
Expand All @@ -447,7 +447,7 @@
}
else {
$ParentTitle = "<i class=\"fa fa-sitemap\"></i> Root";}
if ($editInModal == yes) {
if ($editInModal == 'yes') {
$ParentsButtons .= '<a class="btn btn-sm btn-success" title="' . $_lang["create_resource_here"] . '" style="cursor:pointer" href="" onClick="parent.modx.popup({url:\''. MODX_MANAGER_URL.'?a=4&pid='.$Parent.'\',title1:\'' . $_lang["create_resource_here"] . '\',icon:\'fa-file-o\',iframe:\'iframe\',selector2:\'.tab-page>.container\',position:\'center center\',width:\'80%\',height:\'80%\',wrap:\'body\',hide:0,hover:0,overlay:1,overlayclose:1})">+ <i class="fa fa-file-o fa-fw"></i> ' . $ParentTitle . '</a> ';
}
else {
Expand Down Expand Up @@ -490,7 +490,7 @@
//Image column
if ($ImageTv != '') {
if ($ShowImageIn == column) {
if ($ShowImageIn == 'column') {
$rowTpl .= '<td aria-expanded="false" class="footable-toggle" ><img class="footable-toggle img-thumbnail-sm" src="../[[phpthumb? &input=`[+'.$ImageTv.'+]` &options=`w=70,h=70,q=60,zc=C`]]" alt="[+title+]"> </td> ';
$ImageTVHead = '<th width="100" data-type="html" data-breakpoints="xs" data-filterable="false" data-sortable="false" style="text-align:center"><i class="icon-imagetv fa fa-2x fa-camera" aria-hidden="true"></i></th> ';
}
Expand All @@ -499,7 +499,7 @@
$rowTpl .= '<td class="footable-toggle"><a target="main" data-title="edit?" class="dataConfirm [[if? &is=`[+published+]:=:0` &then=`unpublished`]] [[if? &is=`[+deleted+]:=:1` &then=`deleted`]] [[if? &is=`[+hidemenu+]:is:1:and:[+published+]:is:1` &then=`notinmenu`]]" href="index.php?a=27&id=[+id+]" title="' . $_lang["edit_resource"] . '">[[if? &is=`[+'.$DisplayTitle.'+]:!empty` &then=`[+'.$DisplayTitle.'+]` &else=[+title+]`]]</a>[[if? &is=`[+type+]:is:reference` &then=` <i class="weblinkicon fa fa-link"></i>`]]</td> ';
//Parent column and context menu
if ($showParent == yes) {
if ($showParent == 'yes') {
$rowTpl .= '
<td aria-expanded="false" [[if? &is=`[+parent+]:not:0`&then=`oncontextmenu ="event.preventDefault();$(\'#[+id+]context-menu\').show();$(\'#context-menu\').offset({\'top\':mouseY,\'left\':mouseX})"`]]>
[[if? &is=`[+parent+]:not:0`&then=`<a target="main" href="index.php?a=3&id=[+parent+]&tab=1" title="'.$_lang["view_child_resources_in_container"].'">[[DocInfo? &docid=`[+parent+]` &field=`pagetitle`]]</a>`]]
Expand Down Expand Up @@ -557,7 +557,7 @@
$rowTpl .='<td style="text-align: right;" class="actions">';
//Action buttons
if($modx->hasPermission('edit_document')) {
if ($editInModal == yes) {
if ($editInModal == 'yes') {
$rowTpl .= '<a title="' . $_lang["edit_resource"] . '" style="cursor:pointer" href="" onClick="parent.modx.popup({url:\''. MODX_MANAGER_URL.'?a=27&id=[+id+]&tab=1\',title1:\'' . $_lang["edit_resource"] . '\',icon:\'fa-pencil-square-o\',iframe:\'iframe\',selector2:\'.tab-page>.container\',position:\'center center\',width:\'80%\',height:\'80%\',wrap:\'body\',hide:0,hover:0,overlay:1,overlayclose:1})"><i class="fa fa-external-link"></i></a>';
}
else {
Expand All @@ -566,15 +566,15 @@
}
$rowTpl .= '<a href="[(site_url)]index.php?id=[+id+]" target="_blank" title="' . $_lang["preview_resource"] . '"><i class="fa fa-eye"></i></a> ';
if($modx->hasPermission('edit_document')) {
if ($showMoveButton == yes) {
if ($showMoveButton == 'yes') {
$rowTpl .= '<a class="hidden-xs-down" target="main" href="index.php?a=51&id=[+id+]" title="' . $_lang["move_resource"] . '"><i class="fa fa-arrows"></i></a> ';
}
//Duplicate btn
if ($showDuplicateButton == yes) {
if ($showDuplicateButton == 'yes') {
$rowTpl .= '<a target="main" class="btn-duplicate hidden-xs-down" href="index.php?a=94&id=[+id+]" title="' . $_lang["resource_duplicate"] . '"><i class="fa fa-clone"></i></a> ';
}
//Publish btn
if ($showPublishButton == yes) {
if ($showPublishButton == 'yes') {
$rowTpl .= '[[if? &is=`[+deleted+]:=:0` &then=`[[if? &is=`[+published+]:=:1` &then=`
<a class="btn-unpublish hidden-xs-down" target="main" href="index.php?a=62&id=[+id+]" title="' . $_lang["unpublish_resource"] . '"><i class="fa fa-arrow-down"></i></a>
`&else=`
Expand All @@ -587,16 +587,16 @@
}
}
//add resource here btn
if ($showAddHere == yes) {
if ($editInModal == yes) {
if ($showAddHere == 'yes') {
if ($editInModal == 'yes') {
$rowTpl .= '<a class="hidden-xs-down" title="' . $_lang["create_resource_here"] . '" style="cursor:pointer" href="" onClick="parent.modx.popup({url:\''. MODX_MANAGER_URL.'?a=4&pid=[+id+]\',title1:\'' . $_lang["create_resource_here"] . '\',icon:\'fa-file-o\',iframe:\'iframe\',selector2:\'.tab-page>.container\',position:\'center center\',width:\'80%\',height:\'80%\',wrap:\'body\',hide:0,hover:0,overlay:1,overlayclose:1})"><i class="fa fa-file-o"></i></a>';
}
else {
$rowTpl .= '<a class="hidden-xs-down" target="main" href="index.php?a=4&pid=[+id+]" title="' . $_lang["create_resource_here"] . '"><i class="fa fa-file-o"></i></a> ';
}
}
//delete btn
if ($showDeleteButton == yes) {
if ($showDeleteButton == 'yes') {
if($modx->hasPermission('delete_document')) {
$rowTpl .= '[[if? &is=`[+deleted+]:=:0` &then=`
<a class="btn-delete" target="main" href="index.php?a=6&id=[+id+]" title="' . $_lang["delete_resource"] . '"><i class="fa fa-trash"></i></a>
Expand All @@ -611,7 +611,7 @@
<td class="resource-details">';
//image tv
if ($ImageTv != '') {
if ($ShowImageIn == overview) {
if ($ShowImageIn == 'overview') {
$rowTpl .= '<div class="pull-left" style="margin-right:5px"><img class="img-responsive img-thumbnail" src="../[[phpthumb? &input=`[+'.$ImageTv.'+]` &options=`w=90,h=90,q=60,zc=C`]]" alt="[+title+]"> </div> ';
}
}
Expand All @@ -625,7 +625,7 @@
</tr>
';
//headers
if ($showParent == yes) {
if ($showParent == 'yes') {
$parentColumnHeader = '
<th data-type="text">[%resource_parent%]</th> ';
}
Expand Down Expand Up @@ -660,10 +660,10 @@
$params['tvList'] = $TvFields;
$params['display'] = $ListItems;
//filters
if ($showUnpublished == yes) {
if ($showUnpublished == 'yes') {
$params['showNoPublish'] = '1';
}
if ($hideFolders == yes) {
if ($hideFolders == 'yes') {
$wherehideFolders = 'isfolder=0';
$params['addWhereList'] = 'isfolder=0';
}
Expand Down

0 comments on commit 7e08dfb

Please sign in to comment.