Created
January 8, 2017 19:21
-
-
Save acrosman/67c42ca4aec9306ea0820e9f1bc29977 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function runTask($task_id, $site_name) { | |
$plugin = $this->pluginManagerService->createInstance($task_id); | |
$site = Site::load($site_name); | |
$status = $plugin->run($site); | |
if ($status == 'Success') { | |
$output = $plugin->getTaskOutput(); | |
} else { | |
$output = [ | |
'#type' => 'html_tag', | |
'#tag' => 'span', | |
'#attributes' => [ | |
'class' => ['error'], | |
], | |
'#value' => $this->t('Task failed'), | |
]; | |
} | |
$response = new AjaxResponse(); | |
$response->addCommand(new HtmlCommand( | |
".details-display[site='" . $site->getName() . "']", | |
$output)); | |
return $response; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment