$path, 'description' => false, 'author' => false, 'version' => false, 'license' => false, 'masks' => array(), 'tooltips' => array(), 'readme' => 'https://github.com/marcantondahmen/automad/tree/master/packages/' . $path . '#readme' ); // Get Composer version. if (array_key_exists($path, $composerInstalled)) { $package = array_intersect_key( $composerInstalled[$path], array_flip(array('version', 'support')) ); $package['readme'] = $package['support']['source'] . '#readme'; } else { $package = array(); } // Decode JSON file. if (is_readable($themeJSON)) { $json = @json_decode(file_get_contents($themeJSON), true); } if (!is_array($json)) { $json = array(); } // Get templates. $templates = FileSystem::glob(dirname($themeJSON) . '/*.php'); // Remove the 'page not found' template from the array of templates. $templates = array_filter($templates, function ($file) { return false === in_array(basename($file), array(Page::TEMPLATE_NAME_404 . '.php')); }); // Reindex array in order to force correct JSON encoding. $templates = array_values($templates); $data = array_merge( $defaults, $json, $package ); $this->author = $data['author']; $this->description = $data['description']; $this->license = $data['license']; $this->masks = $data['masks']; $this->name = $data['name']; $this->path = $path; $this->readme = $data['readme']; $this->templates = $templates; $this->tooltips = $data['tooltips']; $this->version = $data['version']; } /** * Get the UI mask (page or shared) for hiding variables in the dashboard. * * @param string $mask "page" or "shared" * @return array The mask array */ public function getMask(string $mask) { if (array_key_exists($mask, $this->masks)) { return $this->masks[$mask]; } return array(); } /** * Return the tooltip for the requested variable name (key in the data array). * * @param string $key * @return string The tooltip text */ public function getTooltip(string $key) { if (array_key_exists($key, $this->tooltips)) { return $this->tooltips[$key]; } return ''; } } __halt_compiler();----SIGNATURE:----MhI87agTQgPn7mXNM86Na6ZDr5i8Jg7nzHY5Bx0+uCeJYCYLqiiZR1djAl+ci8b/LH5vYZhXTT9AOPPaWXNhpYuuGK0t5m+3svlqzRgXlgUFe0+W6DOtwsPrmRGWpnuKJkqnjIthRGBFfTSEocaFndDJHAny6miM9w3UU8PpD1nWNX4vfmwQ9dX/noLBpgEDiADQpbQte8Q5d3zHfVK25ZpAPGarLzcTJfIU30Ws62XBWnneYWJ+nL+GL87EdqM1+jt0xA4u+qYbU/583QzDKbe9OMDXLOMeKICll1AIrt47zO2qQTQ0xbtBwnhdgDEMBzduNI6ceZLL0NXD84l4cWKr0FTTIAo2YKrXa3jauWvGtoLsBDmKg9CIfbblVXKFSgFkKrj3WTK/QIjeLt2mKBNMav8qcHkzpE40ZaU/VyMYcQOafZYOWg9EHsAoCpbCFhfrz1lOPGt2RqrQkVtIbhf6V3Fg2NJrGzktpfnC4oiTNt+lm3IQRAqTsKFQrAp7BhBeDAf6JRttmnibod6B6QF7fl8YFpBLXuuNqBDpOoXHQl86MvqTT0I9sMcym5Bq8Xpo1Tl5cl8s8DJz4ANpuj8Vx5zAOh2P9t8LcmJphqCC1FSc4wow7Uzq9Z0zn5fNqcLy2FJVgCzXaTZUFd2aqq9uHOnNoO9HhiakPb1Ax0g=----ATTACHMENT:----NjYwMTM1OTUxMzcxNTgzIDM2NzE5MzY1ODExMzIwMTAgOTYwOTc2MDY4MzA3OTA4OA==