_getLastId($path); $this->current_folder = $this->_getNode($id); } protected function _getNode($id) { if($id) return new lmbCmsNode($id); return lmbCmsNode :: findByPath('/files'); } protected function _getLastId($path) { $path = rtrim($path, '/'); return (int)end(explode('/', $path)); } function renderFolders() { $result = ''; $folders = lmbActiveRecord :: find('lmbCmsFileFolder', 'parent_id = '. $this->current_folder->id); foreach($folders as $folder) $result .= ""; return $result; } function renderFiles() { $result = ''; $files = lmbCmsFileObject :: findForParentNode($this->current_folder); foreach($files as $file) { $filename = htmlspecialchars($file->getFileName(), ENT_QUOTES); $title = htmlspecialchars($file->getNode()->getTitle(), ENT_QUOTES); $result .= ""; } return $result; } } ?>