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