/** * @param $key_type * @param $echo * * @return string|void */ public static function get_license_duration_string($key_type, $echo = FALSE) { $info = new WSKL_Auth_Info($key_type); if ($info->is_available()) { if ($info->is_verified()) { $days_left = $info->get_oir()->get_key()->get_days_left(); $text = '<span class="wskl-info">' . sprintf('%s: %s, %s: %s, %s: %s %s', __('발급일', 'wskl'), static::to_date_string($info->get_oir()->get_key()->get_issue_date()), __('만료일', 'wskl'), static::to_date_string($info->get_oir()->get_key()->get_expire_date()), __('남은 기간', 'wskl'), $info->is_expired() ? __('만료됨', 'wskl') : $days_left, _n('일', '일', $days_left, 'wskl')) . '</span>'; } else { $text = '<span class="wskl-notice">' . __('활성화키가 인증되지 않아 기능이 실행되지 않습니다.', 'wskl') . '</span>'; } } else { if (empty($key_type)) { $text = __('키를 입력하지 않았습니다.', 'wskl'); } else { $text = '<span class="wskl-notice">' . __('활성화키가 인증되지 않아 기능이 실행되지 않습니다.', 'wskl') . '</span>'; } } if (!$echo) { return $text; } echo $text; }