From e79fcf01569860d60e92f486ef9b321ed5b1fa74 Mon Sep 17 00:00:00 2001 From: Banana Date: Mon, 10 Apr 2023 10:48:36 +0200 Subject: [PATCH] theme does not need the php files, unless there is a realy need to change the logic. Which should be avoided. --- README | 1 + .../view/98/collections/collections.html | 188 +++++++++-------- webclient/view/98/collections/collections.php | 191 ------------------ .../collections/collections_pagination.html | 20 +- webclient/view/98/dashboard/dashboard.php | 35 ---- webclient/view/98/main.php | 1 + webclient/view/98/ui/css/style.css | 11 + 7 files changed, 128 insertions(+), 319 deletions(-) delete mode 100644 webclient/view/98/collections/collections.php delete mode 100644 webclient/view/98/dashboard/dashboard.php diff --git a/README b/README index bdadba2..25ddd3d 100644 --- a/README +++ b/README @@ -17,3 +17,4 @@ This is build and tested on a linux based OS. Windows support not yet, but it co ## third party https://github.com/FabianBeiner/PHP-IMDB-Grabber with some modifications https://getuikit.com/ +https://jdan.github.io/98.css/ diff --git a/webclient/view/98/collections/collections.html b/webclient/view/98/collections/collections.html index 9284efe..31ff180 100644 --- a/webclient/view/98/collections/collections.html +++ b/webclient/view/98/collections/collections.html @@ -1,105 +1,125 @@ 1) { ?> -
-
-
    - -
-
-
- -
- -
-
    - -
  • Default
  • - -
  • Latest
  • - + + + +
    + $cp) { + echo ''; + } + ?> + + + +
    + -
  • -
  • -
  • -
-
-
- -
-
-
- -

Display result for:

+
+
+
Search
+
+ +
+
+
+

Display result for:

+
- -

-
- $entry) { ?> -
-
-
- - - <?php echo $entry['fields']['coverimage']['displayname']; ?> - - -
-
- -

- - - -

- -
- -
-
- +

+
+ + + + + + + + + + + $entry) { ?> + + + + + + + + + +
ImageTitleDescriptionView
+ + + <?php echo $entry['fields']['coverimage']['displayname']; ?> + + + + + + + + View +
-

Collection overview

-
-
-
- $v) { ?> -
-
- -
-
+

Collection overview

+
+ + + + + + + + + $v) { ?> + + + + + + +
NameDescription
1) { ?> -
-
-
    - -
-
-
+ diff --git a/webclient/view/98/collections/collections.php b/webclient/view/98/collections/collections.php deleted file mode 100644 index d4e28e7..0000000 --- a/webclient/view/98/collections/collections.php +++ /dev/null @@ -1,191 +0,0 @@ - 0); - -$_curPage = 1; -if(isset($_GET['page']) && !empty($_GET['page'])) { - $_curPage = trim($_GET['page']); - $_curPage = Summoner::validate($_curPage,'digit') ? $_curPage : 1; -} - -$_sort = ''; -if(isset($_GET['s']) && !empty($_GET['s'])) { - $_sort = trim($_GET['s']); - $_sort = Summoner::validate($_sort,'nospace') ? $_sort : ''; -} - -$_sortDirection = ''; -if(isset($_GET['sd']) && !empty($_GET['sd'])) { - $_sortDirection = trim($_GET['sd']); - $_sortDirection = Summoner::validate($_sortDirection,'nospace') ? $_sortDirection : ''; -} - -$_queryOptions = array( - 'limit' => RESULTS_PER_PAGE, - 'offset' => (RESULTS_PER_PAGE * ($_curPage-1)), - 'sort' => $_sort, - 'sortDirection' => $_sortDirection -); -## pagination end - -$TemplateData['pageTitle'] = "Collection overview"; -$TemplateData['loadedCollection'] = array(); -$TemplateData['storagePath'] = ''; -$TemplateData['entries'] = array(); -$TemplateData['collections'] = array(); -$TemplateData['search'] = ''; -// needed for pagination link building -$TemplateData['pagination']['currentGetParameters']['p'] = 'collections'; -$TemplateData['pagination']['currentGetParameters']['collection'] = $_collection; - -if(!empty($_collection)) { - $TemplateData['loadedCollection'] = $Trite->load($_collection); - if(!empty($TemplateData['loadedCollection'])) { - $Mancubus->setCollection($Trite->param('id')); - - $TemplateData['defaultSortField'] = $Trite->param('defaultSortField'); - $TemplateData['defaultSortOrder'] = $Trite->param('defaultSortOrder'); - $TemplateData['simpleSearchFields'] = $Trite->getSimpleSearchFields(); - if(!empty($_queryOptions['sort'])) { - $TemplateData['simpleSearchFields'][$_queryOptions['sort']]['selected'] = true; - } - if(!empty($TemplateData['defaultSortField'])) { - unset($TemplateData['simpleSearchFields'][$TemplateData['defaultSortField']]); - if(empty($_queryOptions['sort'])) { - $_queryOptions['sort'] = $TemplateData['defaultSortField']; - } - } - if(!empty($TemplateData['defaultSortOrder'])) { - if(empty($_queryOptions['sortDirection'])) { - $_queryOptions['sortDirection'] = $TemplateData['defaultSortOrder']; - } - } - - $Mancubus->setQueryOptions($_queryOptions); - - $TemplateData['storagePath'] = PATH_WEB_STORAGE . '/' . $Trite->param('id'); - $TemplateData['entryLinkPrefix'] = "index.php?p=entry&collection=".$Trite->param('id'); - $TemplateData['navSearchAction'] = array('p' => 'collections', 'collection' => $Trite->param('id')); - - $_fd = $Trite->getCollectionFields(); - - $_sdata = array(); - if (!empty($_fv) && !empty($_fid)) { - $_sdata[0] = array( - 'colName' => $_fd[$_fid]['identifier'], - 'colValue' => $_fv, - 'fieldData' => $_fd[$_fid], - 'exactTagMatch' => true - ); - $_search = $_fv; - $TemplateData['pagination']['currentGetParameters']['fid'] = $_fid; - $TemplateData['pagination']['currentGetParameters']['fv'] = $_fv; - } - elseif(isset($_fd[$Trite->param('defaultSearchField')])) { - $_sdata[0] = array( - 'colName' => $Trite->param('defaultSearchField'), - 'colValue' => $_search, - 'fieldData' =>$_fd[$Trite->param('defaultSearchField')] - ); - if (!empty($_search)) { - $TemplateData['pagination']['hideSort'] = true; - } - } - - $TemplateData['entries'] = $Mancubus->getEntries($_sdata); - if (!empty($_search)) { - $TemplateData['search'] = $_search; - $TemplateData['pagination']['currentGetParameters']['navSearch'] = urlencode($_search); - } - - $TemplateData['pageTitle'] = $Trite->param('name'); - - } - else { - $TemplateData['message']['content'] = "Can not load given collection."; - $TemplateData['message']['status'] = "error"; - } -} -else { - $TemplateData['collections'] = $Trite->getCollections(); -} - -# pagination -if(!empty($TemplateData['entries']['amount'])) { - $TemplateData['pagination']['pages'] = (int)ceil($TemplateData['entries']['amount'] / RESULTS_PER_PAGE); - $TemplateData['pagination']['curPage'] = $_curPage; - - $TemplateData['pagination']['currentGetParameters']['page'] = $_curPage; - $TemplateData['pagination']['currentGetParameters']['s'] = $_sort; - $TemplateData['pagination']['currentGetParameters']['sd'] = $_sortDirection; -} - -if($TemplateData['pagination']['pages'] > 11) { - # first pages - $TemplateData['pagination']['visibleRange'] = range(1,3); - # last pages - foreach(range($TemplateData['pagination']['pages']-2, $TemplateData['pagination']['pages']) as $e) { - $TemplateData['pagination']['visibleRange'][] = $e; - } - # pages before and after current page - $cRange = range($TemplateData['pagination']['curPage']-1, $TemplateData['pagination']['curPage']+1); - foreach($cRange as $e) { - $TemplateData['pagination']['visibleRange'][] = $e; - } - $TemplateData['pagination']['currentRangeStart'] = array_shift($cRange); - $TemplateData['pagination']['currentRangeEnd'] = array_pop($cRange); -} -else { - $TemplateData['pagination']['visibleRange'] = range(1,$TemplateData['pagination']['pages']); -} -# pagination end diff --git a/webclient/view/98/collections/collections_pagination.html b/webclient/view/98/collections/collections_pagination.html index 633990c..321142d 100644 --- a/webclient/view/98/collections/collections_pagination.html +++ b/webclient/view/98/collections/collections_pagination.html @@ -1,32 +1,34 @@ + diff --git a/webclient/view/98/dashboard/dashboard.php b/webclient/view/98/dashboard/dashboard.php deleted file mode 100644 index 71823c9..0000000 --- a/webclient/view/98/dashboard/dashboard.php +++ /dev/null @@ -1,35 +0,0 @@ -getLatest(5,5,$_search); -if (!empty($_search)) { - $TemplateData['search'] = $_search; -} diff --git a/webclient/view/98/main.php b/webclient/view/98/main.php index d579958..eaac217 100644 --- a/webclient/view/98/main.php +++ b/webclient/view/98/main.php @@ -23,6 +23,7 @@
diff --git a/webclient/view/98/ui/css/style.css b/webclient/view/98/ui/css/style.css index fbd4a40..dde325a 100644 --- a/webclient/view/98/ui/css/style.css +++ b/webclient/view/98/ui/css/style.css @@ -48,3 +48,14 @@ h5 { margin-top: 0.5rem; margin-bottom: 0.5rem; } + +.pagination { + padding-bottom: 5px; + padding-top: 5px; +} +.pagination a, .pagination span { + margin-right: 5px; +} +.paginationActive { + font-weight: bold +} -- 2.39.5