/** * ISC_ADMIN_DESIGNMODE::EditFile() * * @return */ protected function EditFile() { if (isset($_REQUEST['File'])) { // set the filename $this->Set('FileName', $_REQUEST['File']); // Open the actual file to edit if (strpos(realpath($this->BasePath . $this->FileName), ISC_BASE_PATH) !== 0 && strpos(realpath($this->MasterBasePath . $this->FileName), ISC_BASE_PATH) !== 0) { exit; } //if template file is found in template folder, then open it as it overwrites master template files if (file_exists($this->BasePath . $this->FileName)) { $FilePath = $this->BasePath . $this->FileName; } else { if (!file_exists($this->BasePath . $this->FileName) && file_exists($this->MasterBasePath . $this->FileName)) { $FilePath = $this->MasterBasePath . $this->FileName; } else { if (!file_exists($this->MasterBasePath . $this->FileName)) { exit; } } } $this->Set('FileContent', file_get_contents($FilePath)); // do all the hard-yakka in the parent class parent::EditFile(); // Log this action $GLOBALS['ISC_CLASS_LOG']->LogAdminAction($_REQUEST['File']); if (!array_key_exists('Ajax', $_REQUEST)) { $GLOBALS["ISC_CLASS_TEMPLATE"]->SetTemplate("../../lib/designmode/designmode.edit"); echo $GLOBALS["ISC_CLASS_TEMPLATE"]->ParseTemplate(true); } } }
/** * ISC_ADMIN_DESIGNMODE::EditFile() * * @return */ protected function EditFile() { if (isset($_REQUEST['File'])) { // set the filename $this->Set('FileName', $_REQUEST['File']); $filePath = ''; foreach(array_reverse($this->templateDirectories) as $directory) { if(strpos(realpath($directory.$this->FileName), ISC_BASE_PATH) === 0 && file_exists($directory.$this->FileName)) { $filePath = realpath($directory.$this->FileName); break; } } if(!$filePath) { exit; } $this->Set('FileContent', file_get_contents($filePath)); $this->FilePath = $filePath; // do all the hard-yakka in the parent class parent::EditFile(); // Log this action $GLOBALS['ISC_CLASS_LOG']->LogAdminAction($_REQUEST['File']); if(!array_key_exists('Ajax', $_REQUEST)) { echo $this->template->render('designmode.edit.tpl'); } } }