CoreFiles by mySites.guru
Privacy.php52 lines, 1,327 bytes, from Joomla_4.4.14-Stable-Full_Package.zip
Raw History Compare with 4.4.13
md5
116864f336b817594de89c8aa989389e
sha1
8a056ed50fa9d3aeea81ccc59a655007fc06dce2
sha256
34937b06cdd75395fe879a31e3d187de7230ba52de6206fa8ef6322ce2538a6f
<?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-dark">' . Text::_('COM_PRIVACY_STATUS_PENDING') . '</span>';
        }
    }
}

The same content is in 93 releases, Joomla 4.2.1 to 5.1.0-beta1. See them all, or every version of this file.