forked from gburton/CE-Phoenix
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Separate category tree display, data, and structure
The current category tree class mixes several things. It creates a tree structure to hold the category data. It loads and exposes the data. And it has specific displays of the data. This separates into multiple classes. A generic tree structure with tree operations. A category tree implementation of that, which loads and exposes the data. A display class. And a controller class for the display. This also simplifies accesses of the tree structure. Both because some could be simpler and through the addition of a parent_of data structure. This saves iterating to find a category in the tree. We can simply look up the location of any category. And we can find its ancestors through iteration of a simple lookup. The separation of data and display requires modification of uses of the category tree. In particular, the categories box.
- Loading branch information
Showing
6 changed files
with
406 additions
and
370 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,23 @@ | ||
<div class="card mb-2 bm-categories"> | ||
<div class="card-header"> | ||
<?php echo MODULE_BOXES_CATEGORIES_BOX_TITLE; ?> | ||
</div> | ||
<div class="list-group list-group-flush"> | ||
<?php echo $category_tree; ?> | ||
</div> | ||
</div> | ||
|
||
<?php | ||
/* | ||
Copyright (c) 2018, G Burton | ||
All rights reserved. | ||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: | ||
$Id$ | ||
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. | ||
osCommerce, Open Source E-Commerce Solutions | ||
http://www.oscommerce.com | ||
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. | ||
Copyright (c) 2020 osCommerce | ||
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. | ||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
Released under the GNU General Public License | ||
*/ | ||
|
||
$display->setParentGroupString('<div class="list-group list-group-flush">', '</div>', false); | ||
$display->setSpacerString('<i class="fas fa-angle-right ml-2 mr-1 text-muted"></i>', 1); | ||
?> | ||
<div class="card mb-2 bm-categories"> | ||
<div class="card-header"> | ||
<?= MODULE_BOXES_CATEGORIES_BOX_TITLE ?> | ||
</div> | ||
<div class="list-group list-group-flush"> | ||
<?= $display ?> | ||
</div> | ||
</div> |
Oops, something went wrong.