瀏覽代碼

rework path writable settings area

CauseFX 5 年之前
父節點
當前提交
80e4976774
共有 2 個文件被更改,包括 9 次插入4 次删除
  1. 1 0
      api/classes/organizr.class.php
  2. 8 4
      api/functions/organizr-functions.php

+ 1 - 0
api/classes/organizr.class.php

@@ -116,6 +116,7 @@ class Organizr
 		// Set Paths
 		$this->paths = array(
 			'Root Folder' => dirname(__DIR__, 2) . DIRECTORY_SEPARATOR,
+			'Images Folder' => dirname(__DIR__, 2) . DIRECTORY_SEPARATOR . 'plugins' . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR,
 			'API Folder' => dirname(__DIR__, 1) . DIRECTORY_SEPARATOR,
 			'DB Folder' => ($this->hasDB()) ? $this->config['dbLocation'] : false
 		);

+ 8 - 4
api/functions/organizr-functions.php

@@ -403,11 +403,12 @@ trait OrganizrFunctions
 	
 	public function settingsPathChecks()
 	{
+		$paths = $this->pathsWritable($this->paths);
 		$items = '';
-		$type = (array_search(false, $this->pathsWritable($this->paths))) ? 'Not Writable' : 'Writable';
+		$type = (array_search(false, $paths)) ? 'Not Writable' : 'Writable';
 		$result = '<li class="mouse" onclick="toggleWritableFolders();"><div class="bg-info"><i class="mdi mdi-folder mdi-24px text-white"></i></div><span class="text-muted hidden-xs m-t-10" lang="en">Organizr Paths</span> ' . $type . '</li>';
-		foreach ($this->pathsWritable($this->paths) as $k => $v) {
-			$items .= '<li class="folders-writable hidden"><div class="bg-info"><i class="mdi mdi-folder mdi-24px text-white"></i></div><span class="text-muted hidden-xs m-t-10" lang="en">' . $k . '</span> ' . (($v) ? 'Writable' : 'Not Writable') . '</li>';
+		foreach ($paths as $k => $v) {
+			$items .= '<li class="folders-writable hidden"><div class="bg-info"><i class="mdi mdi-folder mdi-24px text-white"></i></div><span class="text-muted hidden-xs m-t-10" lang="en">' . $k . '&nbsp;&nbsp;<strong class="text-primary">' . $v['path'] . '</strong></span> ' . (($v['writable']) ? 'Writable' : 'Not Writable') . '</li>';
 		}
 		return $result . $items;
 	}
@@ -416,7 +417,10 @@ trait OrganizrFunctions
 	{
 		$results = array();
 		foreach ($paths as $k => $v) {
-			$results[$k] = is_writable($v);
+			$results[$k] = [
+				'writable' => is_writable($v),
+				'path' => $v
+			];
 		}
 		return $results;
 	}