Ejemplo n.º 1
0
 /**
  * Checks if the element has settings to configure per element instance
  * 
  * @param FrontendController $fec
  *
  * @return bool True if it has settings else false
  */
 protected function hasConfig(FrontendController $fec)
 {
     $configFilePath = $fec->getCore()->getSiteRoot() . 'settings' . DIRECTORY_SEPARATOR . 'elements' . DIRECTORY_SEPARATOR;
     $configFile = $configFilePath . $this->identifier . '.config.json';
     if (file_exists($configFile) === false) {
         return false;
     }
     try {
         $json = JsonUtils::decodeFile($configFile);
         if (!isset($json->settings)) {
             return false;
         }
     } catch (\Exception $e) {
         var_dump($e, JsonUtils::minify(file_get_contents($configFile)));
         return false;
     }
     return true;
 }