Skip to content

Commit

Permalink
Small PSF update
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex300 committed Apr 3, 2024
1 parent 23ea3db commit 8cb092d
Show file tree
Hide file tree
Showing 5 changed files with 128 additions and 92 deletions.
40 changes: 25 additions & 15 deletions modules/pfs/inc/pfs.main.php
Expand Up @@ -36,7 +36,7 @@
$more = 'userid=' . $userid;
}

$standalone = FALSE;
$standalone = false;

$user_info = cot_user_data($userid);
if (!$user_info && !Cot::$usr['isadmin']) {
Expand Down Expand Up @@ -72,7 +72,7 @@
if (!empty($parser)) {
$more .= (($more != '') ? '&' : '') . 'parser=' . $parser;
}
$standalone = TRUE;
$standalone = true;
}

foreach ($cot_extensions as $k => $line) {
Expand Down Expand Up @@ -548,17 +548,23 @@
'PFS_FILESCOUNT' => $filesCount,
'PFS_INTHISFOLDER' => ($f > 0) ? Cot::$L['pfs_filesinthisfolder'] : Cot::$L['pfs_filesintheroot'],
'PFS_ONPAGE_FILES' => $filesOnPageCount,
'PFS_IS_STANDALONE' => $standalone,
]);

if ($filesCount > 0 || $foldersCount > 0) {
if ($foldersCount > 0) {
$pagenav = cot_pagenav('pfs', $more, $df, $foldersCount, Cot::$cfg['pfs']['maxpfsperpage'], 'df');

$t->assign(array(
'PFF_PAGING_PREV' => $pagenav['prev'],
'PFF_PAGING_CURRENT' => $pagenav['main'],
'PFF_PAGING_NEXT' => $pagenav['next']
));
$t->assign(cot_generatePaginationTags($pagenav, 'PFF_'));

if (isset(Cot::$cfg['legacyMode']) && Cot::$cfg['legacyMode']) {
// @deprecated in 0.9.25
$t->assign([
'PFF_PAGING_PREV' => $pagenav['prev'],
'PFF_PAGING_CURRENT' => $pagenav['main'],
'PFF_PAGING_NEXT' => $pagenav['next'],
]);
}
}

if ($filesCount > 0) {
Expand All @@ -571,11 +577,15 @@
$pagnavParams .= $thumbspagination;
$pagenav = cot_pagenav('pfs', $pagnavParams, $d, $filesCount, Cot::$cfg['pfs']['maxpfsperpage']);

$t->assign(array(
'PFS_PAGING_PREV' => $pagenav['prev'],
'PFS_PAGING_CURRENT' => $pagenav['main'],
'PFS_PAGING_NEXT' => $pagenav['next'],
));
$t->assign(cot_generatePaginationTags($pagenav));
if (isset(Cot::$cfg['legacyMode']) && Cot::$cfg['legacyMode']) {
// @deprecated in 0.9.25
$t->assign([
'PFS_PAGING_PREV' => $pagenav['prev'],
'PFS_PAGING_CURRENT' => $pagenav['main'],
'PFS_PAGING_NEXT' => $pagenav['next'],
]);
}
}
}

Expand Down Expand Up @@ -609,7 +619,7 @@
for ($ii = 0; $ii < Cot::$cfg['pfs']['pfsmaxuploads']; $ii++) {
$t->assign([
'PFS_UPLOAD_FORM_ROW_ID' => $ii,
'PFS_UPLOAD_FORM_ROW_NUM' => $ii + 1
'PFS_UPLOAD_FORM_ROW_NUM' => $ii + 1,
]);
$t->parse('MAIN.PFS_UPLOAD_FORM.PFS_UPLOAD_FORM_ROW');
}
Expand Down Expand Up @@ -645,7 +655,7 @@

/* ============= */

$t->assign('PFS_TITLE', cot_breadcrumbs($title, $cfg['homebreadcrumb']));
$t->assign('PFS_TITLE', cot_breadcrumbs($title, Cot::$cfg['homebreadcrumb']));

if ($standalone) {
if ($c1 == 'pageform' && $c2 == 'rpageurl') {
Expand Down Expand Up @@ -731,5 +741,5 @@
$t->out('MAIN');

if (!$standalone) {
require_once $cfg['system_dir'] . '/footer.php';
require_once Cot::$cfg['system_dir'] . '/footer.php';
}
14 changes: 10 additions & 4 deletions modules/pfs/pfs.page.tags.php
Expand Up @@ -12,6 +12,8 @@
* @package PFS
* @copyright (c) Cotonti Team
* @license https://github.com/Cotonti/Cotonti/blob/master/License.txt
*
* @var XTemplate $t
*/

defined('COT_CODE') or die('Wrong URL.');
Expand All @@ -25,8 +27,12 @@
}

$t->assign([
$pfs_tag . '_FORM_PFS' => cot_build_pfs($usr['id'], 'pageform', 'rpagetext',$L['Mypfs'], $sys['parser']),
$pfs_tag . '_FORM_SFS' => (cot_auth('pfs', 'a', 'A')) ? ' &nbsp; '.cot_build_pfs(0, 'pageform', 'rpagetext', $L['SFS'], $sys['parser']) : '',
$pfs_tag . '_FORM_URL_PFS' => cot_build_pfs($usr['id'], 'pageform', 'rpageurl', $L['Mypfs']),
$pfs_tag . '_FORM_URL_SFS' => (cot_auth('pfs', 'a', 'A')) ? ' '.cot_build_pfs(0, 'pageform', 'rpageurl', $L['SFS']) : ''
$pfs_tag . '_FORM_PFS' => cot_build_pfs(Cot::$usr['id'], 'pageform', 'rpagetext', Cot::$L['Mypfs'], Cot::$sys['parser']),
$pfs_tag . '_FORM_SFS' => cot_auth('pfs', 'a', 'A')
? cot_build_pfs(0, 'pageform', 'rpagetext', Cot::$L['SFS'], Cot::$sys['parser'])
: '',
$pfs_tag . '_FORM_URL_PFS' => cot_build_pfs(Cot::$usr['id'], 'pageform', 'rpageurl', Cot::$L['Mypfs']),
$pfs_tag . '_FORM_URL_SFS' => cot_auth('pfs', 'a', 'A')
? cot_build_pfs(0, 'pageform', 'rpageurl', Cot::$L['SFS'])
: ''
]);
4 changes: 2 additions & 2 deletions modules/pfs/pfs.setup.php
Expand Up @@ -4,9 +4,9 @@
Name=PFS
Description=Personal File Space
Version=1.0.13
Date=2023-03-11
Date=2024-04-03
Author=Neocrome & Cotonti Team
Copyright=(c) Cotonti Team 2008-2023
Copyright=(c) Cotonti Team 2008-2024
Notes=BSD License
Auth_guests=R
Lock_guests=W12345A
Expand Down
82 changes: 46 additions & 36 deletions modules/pfs/tpl/pfs.tpl
Expand Up @@ -29,43 +29,50 @@
<!-- END: PFS_ERRORS_ROW -->
</ul>
<!-- END: PFS_ERRORS -->
<!-- IF {PFS_FOLDER_ID} == 0 -->
<h3>
{PFF_FOLDERCOUNT_TITLE} / {PFF_FILESCOUNT_TITLE}
({PHP.L.pfs_onpage}: {PFF_ONPAGE_FOLDERS_TITLE} / {PFF_ONPAGE_FILES_TITLE})
</h3>
<table class="cells">
<tr>
<td class="coltop width10">&nbsp;</td>
<td class="coltop width30">{PHP.L.Folder} / {PHP.L.Gallery}</td>
<td class="coltop width10">{PHP.L.Public}</td>
<td class="coltop width10">{PHP.L.Files}</td>
<td class="coltop width10">{PHP.L.Size}</td>
<td class="coltop width15">{PHP.L.Updated}</td>
<td class="coltop width15">{PHP.L.Action}</td>
</tr>
<!-- BEGIN: PFF_ROW -->
<tr>
<td class="centerall"><a href="{PFF_ROW_URL}">{PFF_ROW_ICON}</a></td>
<td>
<p class="strong"><a href="{PFF_ROW_URL}">{PFF_ROW_TITLE}</a></p>
<p class="small">{PFF_ROW_DESC}</p>
</td>
<td class="centerall">{PFF_ROW_ISPUBLIC}</td>
<td class="centerall">{PFF_ROW_FCOUNT}</td>
<td class="centerall">{PFF_ROW_FSIZE}</td>
<td class="centerall">{PFF_ROW_UPDATED}</td>
<td class="centerall">
<a href="{PFF_ROW_EDIT_URL}">{PHP.L.Edit}</a>
<a href="{PFF_ROW_DELETE_URL}" class="confirmLink">x</a>
</td>
</tr>
<!-- END: PFF_ROW -->
</table>
<p class="paging">{PFF_PAGING_PREV}{PFF_PAGING_CURRENT}{PFF_PAGING_NEXT}</p>

<!-- IF {PFS_FOLDER_ID} == 0 AND {PFF_FOLDERCOUNT} > 0 -->
<h3>
{PFF_FOLDERCOUNT_TITLE} / {PFF_FILESCOUNT_TITLE}
({PHP.L.pfs_onpage}: {PFF_ONPAGE_FOLDERS_TITLE} / {PFF_ONPAGE_FILES_TITLE})
</h3>
<table class="cells">
<tr>
<td class="coltop width10">&nbsp;</td>
<td class="coltop width30">{PHP.L.Folder} / {PHP.L.Gallery}</td>
<td class="coltop width10">{PHP.L.Public}</td>
<td class="coltop width10">{PHP.L.Files}</td>
<td class="coltop width10">{PHP.L.Size}</td>
<td class="coltop width15">{PHP.L.Updated}</td>
<td class="coltop width15">{PHP.L.Action}</td>
</tr>
<!-- BEGIN: PFF_ROW -->
<tr>
<td class="centerall"><a href="{PFF_ROW_URL}">{PFF_ROW_ICON}</a></td>
<td>
<p class="strong"><a href="{PFF_ROW_URL}">{PFF_ROW_TITLE}</a></p>
<p class="small">{PFF_ROW_DESC}</p>
</td>
<td class="centerall">{PFF_ROW_ISPUBLIC}</td>
<td class="centerall">{PFF_ROW_FCOUNT}</td>
<td class="centerall">{PFF_ROW_FSIZE}</td>
<td class="centerall">{PFF_ROW_UPDATED}</td>
<td class="centerall">
<a href="{PFF_ROW_EDIT_URL}">{PHP.L.Edit}</a>
<a href="{PFF_ROW_DELETE_URL}" class="confirmLink">x</a>
</td>
</tr>
<!-- END: PFF_ROW -->
</table>
<!-- IF {PFF_PAGINATION} -->
<p class="paging">{PFF_PREVIOUS_PAGE}{PFF_PAGINATION}{PFF_NEXT_PAGE}</p>
<!-- ENDIF -->
<!-- ENDIF -->

<h3>{PFS_INTHISFOLDER}: {PFS_FILESCOUNT_TITLE} ({PHP.L.pfs_onpage}: {PFS_ONPAGE_FILES_TITLE}) {PFS_SHOWTHUMBS}</h3>
<!-- IF {PFS_FILESCOUNT} > 0 -->
<h3>
{PFS_INTHISFOLDER}: {PFS_FILESCOUNT_TITLE}
({PHP.L.pfs_onpage}: {PFS_ONPAGE_FILES_TITLE}) {PFS_SHOWTHUMBS}
</h3>
<table class="cells">
<tr>
<td class="coltop width10">&nbsp;</td>
Expand Down Expand Up @@ -93,7 +100,10 @@
</tr>
<!-- END: PFS_ROW -->
</table>
<p class="paging">{PFS_PAGING_PREV}{PFS_PAGING_CURRENT}{PFS_PAGING_NEXT}</p>
<!-- IF {PAGINATION} -->
<p class="paging">{PREVIOUS_PAGE}{PAGINATION}{NEXT_PAGE}</p>
<!-- ENDIF -->
<!-- ENDIF -->

<div style="padding:10px 20px; border:2px dashed red">
<p>{PHP.L.pfs_totalsize}: {PFS_TOTALSIZE} {PHP.L.Of} {PFS_MAXTOTAL} ({PFS_PERCENTAGE}%)</p>
Expand Down
80 changes: 45 additions & 35 deletions themes/symisun-03/pfs.tpl
Expand Up @@ -43,42 +43,49 @@
<!-- END: PFS_ERRORS_ROW -->
<!-- END: PFS_ERRORS -->


<!-- IF {PFS_FOLDER_ID} == 0 AND {PFF_FOLDERCOUNT} > 0 -->
<fieldset>
<legend>{PFF_FOLDERCOUNT_TITLE} / {PFF_FILESCOUNT_TITLE} ({PHP.L.pfs_onpage}: {PFF_ONPAGE_FOLDERS_TITLE} / {PFF_ONPAGE_FILES_TITLE})</legend>
<table class="cells">
<tr>
<td class="coltop width10">&nbsp;</td>
<td class="coltop width30">{PHP.L.Folder} / {PHP.L.Gallery}</td>
<td class="coltop width10">{PHP.L.Public}</td>
<td class="coltop width10">{PHP.L.Files}</td>
<td class="coltop width10">{PHP.L.Size}</td>
<td class="coltop width15">{PHP.L.Updated}</td>
<td class="coltop width15">{PHP.L.Action}</td>
</tr>
<!-- BEGIN: PFF_ROW -->
<tr>
<td class="centerall"><a href="{PFF_ROW_URL}">{PFF_ROW_ICON}</a></td>
<td>
<p class="strong"><a href="{PFF_ROW_URL}">{PFF_ROW_TITLE}</a></p>
<p class="small">{PFF_ROW_DESC}</p>
</td>
<td class="centerall">{PFF_ROW_ISPUBLIC}</td>
<td class="centerall">{PFF_ROW_FCOUNT}</td>
<td class="centerall">{PFF_ROW_FSIZE}</td>
<td class="centerall">{PFF_ROW_UPDATED}</td>
<td class="centerall">
<a href="{PFF_ROW_EDIT_URL}">{PHP.L.Edit}</a>
<a href="{PFF_ROW_DELETE_URL}" class="confirmLink">x</a>
</td>
</tr>
<!-- END: PFF_ROW -->
</table>
<p class="paging">{PFF_PAGING_PREV}{PFF_PAGING_CURRENT}{PFF_PAGING_NEXT}</p>
<legend>{PFF_FOLDERCOUNT_TITLE} / {PFF_FILESCOUNT_TITLE} ({PHP.L.pfs_onpage}: {PFF_ONPAGE_FOLDERS_TITLE} / {PFF_ONPAGE_FILES_TITLE})</legend>
<table class="cells">
<tr>
<td class="coltop width10">&nbsp;</td>
<td class="coltop width30">{PHP.L.Folder} / {PHP.L.Gallery}</td>
<td class="coltop width10">{PHP.L.Public}</td>
<td class="coltop width10">{PHP.L.Files}</td>
<td class="coltop width10">{PHP.L.Size}</td>
<td class="coltop width15">{PHP.L.Updated}</td>
<td class="coltop width15">{PHP.L.Action}</td>
</tr>
<!-- BEGIN: PFF_ROW -->
<tr>
<td class="centerall"><a href="{PFF_ROW_URL}">{PFF_ROW_ICON}</a></td>
<td>
<p class="strong"><a href="{PFF_ROW_URL}">{PFF_ROW_TITLE}</a></p>
<p class="small">{PFF_ROW_DESC}</p>
</td>
<td class="centerall">{PFF_ROW_ISPUBLIC}</td>
<td class="centerall">{PFF_ROW_FCOUNT}</td>
<td class="centerall">{PFF_ROW_FSIZE}</td>
<td class="centerall">{PFF_ROW_UPDATED}</td>
<td class="centerall">
<a href="{PFF_ROW_EDIT_URL}">{PHP.L.Edit}</a>
<a href="{PFF_ROW_DELETE_URL}" class="confirmLink">x</a>
</td>
</tr>
<!-- END: PFF_ROW -->
</table>
<!-- IF {PFF_PAGINATION} -->
<p class="paging">{PFF_PREVIOUS_PAGE}{PFF_PAGINATION}{PFF_NEXT_PAGE}</p>
<!-- ENDIF -->
</fieldset>
<!-- ENDIF -->

<!-- IF {PFS_FILESCOUNT} > 0 -->
<fieldset>
<legend>{PFS_INTHISFOLDER}: {PFS_FILESCOUNT_TITLE} ({PHP.L.pfs_onpage}: {PFS_ONPAGE_FILES_TITLE}) {PFS_SHOWTHUMBS}</legend>
<legend>
{PFS_INTHISFOLDER}: {PFS_FILESCOUNT_TITLE}
({PHP.L.pfs_onpage}: {PFS_ONPAGE_FILES_TITLE}) {PFS_SHOWTHUMBS}
</legend>
<table class="cells">
<tr>
<td class="coltop width10">&nbsp;</td>
Expand All @@ -88,7 +95,7 @@
<td class="coltop width15">{PHP.L.Date}</td>
<td class="coltop width15">{PHP.L.Action}</td>
</tr>
<!-- BEGIN: PFS_ROW -->
<!-- BEGIN: PFS_ROW -->
<tr>
<td class="centerall">{PFS_ROW_ICON}</td>
<td>
Expand All @@ -105,10 +112,13 @@
<br />{PFS_ROW_INSERT}
</td>
</tr>
<!-- END: PFS_ROW -->
<!-- END: PFS_ROW -->
</table>
<p class="paging">{PFS_PAGING_PREV}{PFS_PAGING_CURRENT}{PFS_PAGING_NEXT}</p>
<!-- IF {PAGINATION} -->
<p class="paging">{PREVIOUS_PAGE}{PAGINATION}{NEXT_PAGE}</p>
<!-- ENDIF -->
</fieldset>
<!-- ENDIF -->

<fieldset>
<legend>{PHP.L.pfs_newfile}</legend>
Expand Down

0 comments on commit 8cb092d

Please sign in to comment.