CoreFiles by mySites.guru
Privacy.php52 lines, 1,317 bytes, from Joomla_5.4.10-Stable-Full_Package.zip
Raw History Compare with 5.4.9
md5
074cd6a6cd36f7587e20106d07e5bb75
sha1
2f3271c95f7c83c6a7b801ccd5a528341c576107
sha256
2b7896ee0eb2bbcd830abbe63c764fa37c50fc994a33bd96c239d069a15154be
<?php

/**
 * @package     Joomla.Administrator
 * @subpackage  com_privacy
 *
 * @copyright   (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

namespace Joomla\Component\Privacy\Administrator\Service\HTML;

use Joomla\CMS\Language\Text;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects

/**
 * Privacy component HTML helper.
 *
 * @since  3.9.0
 */
class Privacy
{
    /**
     * Render a status badge
     *
     * @param   integer  $status  The item status
     *
     * @return  string
     *
     * @since   3.9.0
     */
    public function statusLabel($status)
    {
        switch ($status) {
            case 2:
                return '<span class="badge bg-success">' . Text::_('COM_PRIVACY_STATUS_COMPLETED') . '</span>';

            case 1:
                return '<span class="badge bg-info">' . Text::_('COM_PRIVACY_STATUS_CONFIRMED') . '</span>';

            case -1:
                return '<span class="badge bg-danger">' . Text::_('COM_PRIVACY_STATUS_INVALID') . '</span>';

            default:
            case 0:
                return '<span class="badge bg-warning">' . Text::_('COM_PRIVACY_STATUS_PENDING') . '</span>';
        }
    }
}

The same content is in 132 releases, Joomla 5.1.0-beta2 to 6.2.1-rc1. See them all, or every version of this file.