/** * Simple helper which references all important members to the request data listing * for usage within the style listing. */ private function _prepare_request_data() { $this->_request_data['article'] =& $this->_article; $this->_request_data['datamanager'] =& $this->_datamanager; $this->_request_data['controller'] =& $this->_controller; // Populate the toolbar if ($this->_article->can_do('midgard:update')) { $this->_view_toolbar->add_item(array(MIDCOM_TOOLBAR_URL => "edit/{$this->_article->guid}/", MIDCOM_TOOLBAR_LABEL => $this->_l10n_midcom->get('edit'), MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/edit.png', MIDCOM_TOOLBAR_ACCESSKEY => 'e')); } if ($this->_article->can_do('midgard:delete')) { $this->_view_toolbar->add_item(array(MIDCOM_TOOLBAR_URL => "delete/{$this->_article->guid}/", MIDCOM_TOOLBAR_LABEL => $this->_l10n_midcom->get('delete'), MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/trash.png', MIDCOM_TOOLBAR_ACCESSKEY => 'd')); } }
/** * Simple helper which references all important members to the request data listing * for usage within the style listing. */ private function _prepare_request_data() { $this->_request_data['article'] =& $this->_article; $this->_request_data['datamanager'] =& $this->_datamanager; // Populate the toolbar if ($this->_article->can_do('midgard:update')) { $this->_view_toolbar->add_item(array(MIDCOM_TOOLBAR_URL => "edit/{$this->_article->guid}/", MIDCOM_TOOLBAR_LABEL => $this->_l10n_midcom->get('edit'), MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/edit.png', MIDCOM_TOOLBAR_ACCESSKEY => 'e')); } $article = $this->_article; if ($this->_article->topic !== $this->_content_topic->id) { $qb = net_nehmer_static_link_dba::new_query_builder(); $qb->add_constraint('topic', '=', $this->_content_topic->id); $qb->add_constraint('article', '=', $this->_article->id); if ($qb->count() === 1) { // Get the link $results = $qb->execute_unchecked(); $article = $results[0]; } } if ($article->can_do('midgard:delete')) { $this->_view_toolbar->add_item(array(MIDCOM_TOOLBAR_URL => "delete/{$this->_article->guid}/", MIDCOM_TOOLBAR_LABEL => $this->_l10n_midcom->get('delete'), MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/trash.png', MIDCOM_TOOLBAR_ACCESSKEY => 'd')); } }