public function itBehavesLikeMustacheRenderer() { $mustache_renderer = new MustacheRenderer($this->templates_dir); $mustache_output = $mustache_renderer->renderToString('valid-template', $this->presenter); $debug_output = $this->renderer->renderToString('valid-template', $this->presenter); $this->assertEqual($debug_output, $mustache_output); }
public function display($artifact_link_id, $render_with_javascript) { $artifact_to_link = null; $submitted_values = array(); if ($artifact_link_id) { $artifact_to_link = $this->tracker_artifact_factory->getArtifactByid($artifact_link_id); } if ($artifact_to_link) { if ($this->isArtifactInParentTracker($artifact_to_link)) { $submitted_values['disable_artifact_link_field'] = true; } else { $submitted_values['disable_artifact_link_field'] = false; } } $submitted_values['render_with_javascript'] = $render_with_javascript; $form_elements = $this->tracker->fetchSubmitNoColumns($artifact_to_link, $submitted_values); $presenter = new Tracker_Artifact_Presenter_CreateArtifactInPlacePresenter($this->tracker, $artifact_to_link, $form_elements, $render_with_javascript); $this->renderer->renderToPage('create-artifact-modal', $presenter); }
private function fetchFollowUps() { $changesets = $this->getFollowupsContent($this->artifact); $presenter = new Tracker_Artifact_Presenter_FollowUpCommentsPresenter($changesets); return $this->renderer->renderToString('follow-ups', $presenter); }
// include the <Plugin> API (only if plugin is available) $event_manager->processEvent('soap', array()); } catch (Exception $e) { echo $e; } // if POST was used to send this request, we handle it // else, we display a list of available methods if ($_SERVER['REQUEST_METHOD'] == 'POST') { if (LOG_SOAP_REQUESTS) { error_log('SOAP Request :'); error_log($HTTP_RAW_POST_DATA); } $server->handle(); } else { $presenter = array('end_points' => array(array('title' => 'Core', 'wsdl' => '/soap/?wsdl', 'wsdl_viewer' => '/soap/wsdl', 'changelog' => '/soap/ChangeLog', 'version' => CODENDI_WS_API_VERSION, 'description' => <<<EOT Historically the sole end point, therefore it groups multiple different functions: <ul> <li>Session management: login, logout, projects, ...</li> <li>File Release System access (FRS): addPackage, addRelease, addFile, ...</li> <li>Tracker v3 (for historical deployments): get/updateTracker, get/updateArtifact, ...</li> <li>Documentation: get/updateDocman, ...</li> </ul> EOT ), array('title' => 'Subversion', 'wsdl' => '/soap/svn/?wsdl', 'wsdl_viewer' => '/soap/svn/wsdl-viewer', 'changelog' => '/soap/svn/ChangeLog', 'version' => file_get_contents(dirname(__FILE__) . '/svn/VERSION'), 'description' => 'Get informations about Subversion usage in project.'), array('title' => 'Project', 'wsdl' => '/soap/project/?wsdl', 'wsdl_viewer' => '/soap/project/wsdl-viewer', 'changelog' => '/soap/project/ChangeLog', 'version' => file_get_contents(dirname(__FILE__) . '/project/VERSION'), 'description' => 'Create and administrate projects.'))); $event_manager->processEvent(Event::SOAP_DESCRIPTION, array('end_points' => &$presenter['end_points'])); require_once 'common/templating/mustache/MustacheRenderer.class.php'; site_header(array('title' => "SOAP API")); $renderer = new MustacheRenderer('templates'); $renderer->renderToPage('soap_index', $presenter); site_footer(array()); }