Skip to content

Commit

Permalink
fix #1156
Browse files Browse the repository at this point in the history
  • Loading branch information
joyqi committed Sep 8, 2021
1 parent 57106d8 commit 519e84e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions var/Widget/Backup.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ private function import()
{
$path = null;

if (!empty($FILES)) {
$file = array_pop($FILES);
if (!empty($_FILES)) {
$file = array_pop($_FILES);

if (0 == $file['error'] && is_uploaded_file($file['tmp_name'])) {
$path = $file['tmp_name'];
Expand Down
16 changes: 8 additions & 8 deletions var/Widget/Metas/Category/Rows.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class Rows extends Metas
* @var array
* @access private
*/
private $children = [];
private $childNodes = [];

/**
* 所有父节点列表
Expand Down Expand Up @@ -116,11 +116,11 @@ protected function initParameter(Config $parameter)
private function levelWalkCallback(array $categories, array $parents = [])
{
foreach ($parents as $parent) {
if (!isset($this->children[$parent])) {
$this->children[$parent] = [];
if (!isset($this->childNodes[$parent])) {
$this->childNodes[$parent] = [];
}

$this->children[$parent] = array_merge($this->children[$parent], $categories);
$this->childNodes[$parent] = array_merge($this->childNodes[$parent], $categories);
}

foreach ($categories as $mid) {
Expand Down Expand Up @@ -223,7 +223,7 @@ private function treeViewCategoriesCallback(): void
if ($this->mid == $this->parameter->current) {
echo ' category-active';
} elseif (
isset($this->children[$this->mid]) && in_array($this->parameter->current, $this->children[$this->mid])
isset($this->childNodes[$this->mid]) && in_array($this->parameter->current, $this->childNodes[$this->mid])
) {
echo ' category-parent-active';
}
Expand Down Expand Up @@ -269,7 +269,7 @@ public function treeViewCategories()
if ($children) {
//缓存变量便于还原
$tmp = $this->row;
$this->sequence ++;
$this->sequence++;

//在子评论之前输出
echo '<' . $this->categoryOptions->wrapTag . (empty($this->categoryOptions->wrapClass)
Expand All @@ -284,7 +284,7 @@ public function treeViewCategories()
//在子评论之后输出
echo '</' . $this->categoryOptions->wrapTag . '>';

$this->sequence --;
$this->sequence--;
}
}

Expand Down Expand Up @@ -338,7 +338,7 @@ public function getAllParentsSlug($mid): array
*/
public function getAllChildren($mid): array
{
return $this->children[$mid] ?? [];
return $this->childNodes[$mid] ?? [];
}

/**
Expand Down

0 comments on commit 519e84e

Please sign in to comment.