From f0cd9fbc24465c97da6bce3d5959b6b7cb1311a7 Mon Sep 17 00:00:00 2001 From: Mitsuru Mutaguchi Date: Fri, 26 Jun 2015 17:06:34 +0900 Subject: [PATCH] Update status_label --- View/Elements/status_label.ctp | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) 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; ?>