diff --git a/View/Elements/status_label.ctp b/View/Elements/status_label.ctp index ad29c9f5..0bc96f7a 100644 --- a/View/Elements/status_label.ctp +++ b/View/Elements/status_label.ctp @@ -9,20 +9,22 @@ * @copyright Copyright 2014, NetCommons Project */ -$labels = [ - NetCommonsBlockComponent::STATUS_IN_DRAFT => [ - 'class' => 'label-info', - 'message' => __d('net_commons', 'Temporary'), - ], - NetCommonsBlockComponent::STATUS_APPROVED => [ - 'class' => 'label-warning', - 'message' => __d('net_commons', 'Approving'), - ], - NetCommonsBlockComponent::STATUS_DISAPPROVED => [ - 'class' => 'label-warning', - 'message' => __d('net_commons', 'Disapproving'), - ], -]; +if (!isset($labels)) { + $labels = [ + NetCommonsBlockComponent::STATUS_IN_DRAFT => [ + 'class' => 'label-info', + 'message' => __d('net_commons', 'Temporary'), + ], + NetCommonsBlockComponent::STATUS_APPROVED => [ + 'class' => 'label-warning', + 'message' => __d('net_commons', 'Approving'), + ], + NetCommonsBlockComponent::STATUS_DISAPPROVED => [ + 'class' => 'label-warning', + 'message' => __d('net_commons', 'Disapproving'), + ], + ]; +} $label = isset($labels[$status]) ? $labels[$status] : null; ?>