public function renderBookmarks($bookmarks = null) { $xhtml = ''; if (!is_array($bookmarks)) { $mdlBookmark = new Model_Bookmark(); $bookmarks = $mdlBookmark->getUsersBookmarks(); } if (!empty($bookmarks)) { $xhtml = '<ul class="bookmarks">'; foreach ($bookmarks as $bookmark) { $xhtml .= ' <li>' . PHP_EOL; $xhtml .= ' ' . $this->view->link(null, '/admin/index/delete-bookmark/id/' . $bookmark->id, 'link_delete.png', 'clear') . PHP_EOL; $url = $bookmark->url; if (strpos($url, 'mod_') === 0) { $url = str_replace('mod_', '', $url); $url = Digitalus_Toolbox_String::stripUnderscores($url); $url = 'mod_' . $url; } else { $url = Digitalus_Toolbox_String::stripUnderscores($url); } $xhtml .= ' ' . $this->view->link($bookmark->label, '/' . $url); $xhtml .= ' </li>'; } $xhtml .= '</ul>'; } else { $xhtml = $this->view->getTranslation('You do not have any bookmarks.'); } return $xhtml; }
/** * Delete bookmark action * * @return void */ public function deleteBookmarkAction() { $id = $this->_request->getParam('id'); $bookmark = new Model_Bookmark(); $bookmark->deleteBookmark($id); $this->_redirect('admin/index'); }
public function delete_bookmark_by_id($id) { $dao = Model_Bookmark::data_access(); $condition = $dao->find_by_pk($id); return $condition->delete(); }