<?php
 namespace App; class Loader_Lang extends \Engine\Loader_Lang { public function loadSection($section) { if (substr($section, 0, 8) == 'Modules/') { $realSection = substr($section, 8); return $this->loadAppSection($realSection); } elseif (substr($section, 0, 8) == 'Plugins/' || substr($section, 0, 8) == 'plugins/') { $realSection = lcfirst($section); return $this->loadPluginSection($realSection); } else { $realSection = $section; return $this->loadAppFolder($realSection); } } public function loadAppSection($section) { $sectionArr = explode("/", $section); foreach ($sectionArr as $idx=>$piece) { $sectionArr[$idx] = lcfirst($piece); } $section = implode("/", $sectionArr); return parent::loadAppSection($section); } public function loadPluginSection($section) { return parent::loadPluginSection(lcfirst($section)); } public function loadPluginFile($pluginNamespace, $fileName) { $pluginNamespace = ltrim($pluginNamespace, "\\/"); parent::loadPluginFile(lcfirst($pluginNamespace), $fileName); return $this; } public function loadFileFromAllPlugins($fileName) { $pluginsDir = APP_REAL_PATH.'plugins/'; $dirs = \Engine\Dir::getContents($pluginsDir, 'dir'); foreach ($dirs as $dir) { $this->loadPluginFile("plugins/".$dir, $fileName); } return $this; } public function getSection($section) { if (substr($section, 0, 8) == 'Modules/') { $section = substr($section, 8); } return parent::getSection($section); } } 