* @package editor * @link https://www.zentao.net */ class editorZen extends editor { protected function buildContentByAction(string $filePath, string $action, string $isExtends = ''): string { if(empty($filePath)) return ''; if($action == 'extendModel') return $this->editor->extendModel($filePath); if($action == 'newPage') return $this->editor->newControl($filePath); if($action == 'extendControl' && !empty($isExtends)) return $this->editor->extendControl($filePath, $isExtends); if(($action == 'edit' or $action == 'override') && file_exists($filePath)) { $fileContent = file_get_contents($filePath); if($action == 'override') { $fileContent = str_replace("'../../", '$this->app->getModuleRoot() . \'', $fileContent); $fileContent = str_replace(array('\'./', '"./'), array('\'../../view/', '"../../view'), $fileContent); } return $fileContent; } if(strrpos(basename($filePath), '.php') !== false) return "