55use Illuminate \Auth \Access \AuthorizationException as LaravelAuthException ;
66use Illuminate \Http \Request ;
77use Statamic \Exceptions \AuthorizationException ;
8- use Statamic \Facades \File ;
9- use Statamic \Facades \Folder ;
10- use Statamic \Facades \YAML ;
118use Statamic \Http \Controllers \Controller ;
129use Statamic \Statamic ;
13- use Statamic \Support \Arr ;
14- use Statamic \Support \Str ;
1510
1611/**
1712 * The base control panel controller.
@@ -31,43 +26,6 @@ public function __construct(Request $request)
3126 $ this ->request = $ request ;
3227 }
3328
34- /**
35- * Get all the template names from the current theme.
36- *
37- * @return array
38- */
39- public function templates ()
40- {
41- $ templates = [];
42-
43- foreach (Folder::disk ('resources ' )->getFilesByTypeRecursively ('templates ' , 'html ' ) as $ path ) {
44- $ parts = explode ('/ ' , $ path );
45- array_shift ($ parts );
46- $ templates [] = Str::removeRight (implode ('/ ' , $ parts ), '.html ' );
47- }
48-
49- return $ templates ;
50- }
51-
52- public function themes ()
53- {
54- $ themes = [];
55-
56- foreach (Folder::disk ('themes ' )->getFolders ('/ ' ) as $ folder ) {
57- $ name = $ folder ;
58-
59- // Get the name if one exists in a meta file
60- if (File::disk ('themes ' )->exists ($ folder .'/meta.yaml ' )) {
61- $ meta = YAML ::parse (File::disk ('themes ' )->get ($ folder .'/meta.yaml ' ));
62- $ name = Arr::get ($ meta , 'name ' , $ folder );
63- }
64-
65- $ themes [] = compact ('folder ' , 'name ' );
66- }
67-
68- return $ themes ;
69- }
70-
7129 /**
7230 * 404.
7331 */
0 commit comments