<?php

if (! $this->undeployedChanges) {
    return; 
}

if ($this->totalUndeployedChanges === 1) {
    $msg = $this->translate('There has been a single change to this object, nothing else has been modified');
} elseif ($this->totalUndeployedChanges === $this->undeployedChanges) {
    $msg = sprintf(
        $this->translate('There have been %d changes to this object, nothing else has been modified'),
        $this->undeployedChanges
    );
} else {
    $msg = sprintf(
        $this->translate('There are %d pending changes, %d of them applied to this object'),
        $this->totalUndeployedChanges,
        $this->undeployedChanges
    );
}

echo ' ' . $this->qlink(
    $this->translate('Deploy'),
    'director/config/deploy',
    null,
    array(
        'title' => $msg,
        'class' => 'icon-wrench state-critical'
    )
);

