/** * * @param mixed $handler_id The ID of the handler. * @param array &$data The local request data. */ public function _show_delete($handler_id, array &$data) { $this->_request_data['wikipage_view'] = $this->_datamanager->get_content_html(); // Replace wikiwords if (array_key_exists('content', $this->_request_data['wikipage_view'])) { $parser = new net_nemein_wiki_parser($this->_page); $this->_request_data['wikipage_view']['content'] = $parser->get_markdown($this->_request_data['wikipage_view']['content']); } midcom_show_style('view-wikipage-delete'); }
/** * * @param mixed $handler_id The ID of the handler. * @param array &$data The local request data. */ public function _show_edit($handler_id, array &$data) { $data['controller'] =& $this->_controller; $data['preview_mode'] = $this->_preview; if ($this->_preview) { // Populate preview page with values from form $data['preview_page'] = $this->_page; foreach ($this->_controller->datamanager->schema->fields as $name => $type_definition) { if (!is_a($this->_controller->datamanager->types[$name], 'midcom_helper_datamanager2_type_text')) { // Skip fields of other types continue; } switch ($type_definition['storage']) { case 'parameter': case 'configuration': case 'metadata': // Skip continue; default: $location = $type_definition['storage']['location']; } $data['preview_page']->{$location} = $this->_controller->datamanager->types[$name]->convert_to_storage(); } // Load DM for rendering the page $datamanager = new midcom_helper_datamanager2_datamanager($this->_schemadb); $datamanager->autoset_storage($data['preview_page']); $data['wikipage_view'] = $datamanager->get_content_html(); $data['wikipage'] =& $data['preview_page']; $data['autogenerate_toc'] = false; $data['display_related_to'] = false; // Replace wikiwords // TODO: We should somehow make DM2 do this so it would also work in AJAX previews $parser = new net_nemein_wiki_parser($data['preview_page']); $data['wikipage_view']['content'] = $parser->get_markdown($data['wikipage_view']['content']); } midcom_show_style('view-wikipage-edit'); }
/** * * @param mixed $handler_id The ID of the handler. * @param array &$data The local request data. */ public function _show_whatlinks($handler_id, array &$data) { if ($this->_controller) { $data['wikipage_view'] = $this->_controller->get_content_html(); } else { $data['wikipage_view'] = $this->_datamanager->get_content_html(); } // Replace wikiwords $parser = new net_nemein_wiki_parser($this->_page); $data['wikipage_view']['content'] = $parser->get_markdown($data['wikipage_view']['content']); midcom_show_style('view-wikipage-whatlinks'); }