Skip to content

Commit

Permalink
blogHelper (#2829)
Browse files Browse the repository at this point in the history
  • Loading branch information
nghiem-mb authored Nov 1, 2023
1 parent b4a8217 commit c413f97
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions plugins/bc-blog/src/View/Helper/BlogHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
use BaserCore\Service\SitesService;
use BaserCore\Service\SitesServiceInterface;
use BaserCore\Utility\BcContainerTrait;
use BaserCore\Utility\BcFolder;
use BaserCore\Utility\BcText;
use BaserCore\Utility\BcUtil;
use BaserCore\View\Helper\BcBaserHelper;
Expand All @@ -42,7 +43,6 @@
use Cake\Datasource\EntityInterface;
use Cake\Datasource\Exception\RecordNotFoundException;
use Cake\Datasource\ResultSetInterface;
use Cake\Filesystem\Folder;
use Cake\ORM\TableRegistry;
use Cake\Utility\Hash;
use Cake\View\Helper;
Expand Down Expand Up @@ -891,13 +891,13 @@ public function getBlogTemplates($siteId = 0)
$_templates = [];
foreach($templatesPaths as $templatePath) {
$templatePath .= 'Blog' . DS;
$folder = new Folder($templatePath);
$files = $folder->read(true, true);
if ($files[0]) {
$folder = new BcFolder($templatePath);
$files = $folder->getFolders();
if ($files) {
if ($_templates) {
$_templates = array_merge($_templates, $files[0]);
$_templates = array_merge($_templates, $files);
} else {
$_templates = $files[0];
$_templates = $files;
}
}
}
Expand Down

0 comments on commit c413f97

Please sign in to comment.