public function deploy_ui_plan::view_page in Deploy - Content Staging 7.3
Renders the view deployment plan page.
File
- modules/
deploy_ui/ plugins/ export_ui/ deploy_ui_plan.class.php, line 318 - Deploy UI for managing deployment plans.
Class
- deploy_ui_plan
- CTools Export UI class for deployment plans.
Code
public function view_page($js, $input, $plan) {
drupal_set_title(t('Plan: @plan', array(
'@plan' => $plan->name,
)), PASS_THROUGH);
$status = deploy_plan_get_status($plan->name);
$status_info = deploy_status_info($status);
if ($status_info) {
drupal_set_message(t($status_info['keyed message'], [
'%key' => $plan->name,
]), $status_info['class'], FALSE);
}
// For managed entity plans we use a view to provide additional
// functionality.
if ('DeployAggregatorManaged' == $plan->aggregator_plugin && module_exists('views_bulk_operations') && views_get_view('deploy_managed_entities')) {
return views_embed_view('deploy_managed_entities', 'list_block');
}
$info = [];
// Get the entity keys from the aggregator.
$entity_keys = $plan
->getEntities();
foreach ($entity_keys as $entity_key) {
// Get the entity info and all entities of this type.
$entity_info = entity_get_info($entity_key['type']);
$entity = deploy_plan_entity_load($entity_key['type'], $entity_key['id'], $entity_key['revision_id']);
$label = deploy_plan_entity_label($entity_key['type'], $entity, $entity_key['revision_id']);
// Some entities fail fatally with entity_uri() and
// entity_extract_ids(). So handle this gracefully.
try {
$uri = entity_uri($entity_key['type'], $entity);
if ($uri) {
$label = l($label, $uri['path'], $uri['options']);
}
} catch (Exception $e) {
watchdog_exception('deploy_ui', $e);
}
// Construct a usable array for the theme function.
$info[] = array(
'title' => $label,
'type' => $entity_info['label'],
);
}
$data = [
'content' => theme('deploy_ui_overview_plan_content', array(
'info' => $info,
)),
'plan_description' => check_plain($plan->description),
'label_description' => t('Plan description'),
];
return theme('deploy_ui_plan_view', array(
'vars' => $data,
));
}