CoreFiles by mySites.guru
Directory.php60 lines, 1,315 bytes, from Joomla_4.0.0-Stable-Full_Package.zip
Raw History Compare with 3.10.12
md5
74b6d84dd6cbf7c2c8fcc64cd47831da
sha1
6426721b6865fb7eb439d19b64e50a578f908db7
sha256
f7e1b2eed96d7f45cae8ca72908ab762e8aa52a1e2aba860a2748b5470751581
<?php
/**
 * @package     Joomla.Administrator
 * @subpackage  com_admin
 *
 * @copyright   (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

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

\defined('_JEXEC') or die;

use Joomla\CMS\Language\Text;

/**
 * Utility class working with directory
 *
 * @since  1.6
 */
class Directory
{
	/**
	 * Method to generate a (un)writable message for directory
	 *
	 * @param   boolean  $writable  is the directory writable?
	 *
	 * @return  string	html code
	 */
	public function writable($writable)
	{
		if ($writable)
		{
			return '<span class="badge bg-success">' . Text::_('COM_ADMIN_WRITABLE') . '</span>';
		}

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

	/**
	 * Method to generate a message for a directory
	 *
	 * @param   string   $dir      the directory
	 * @param   boolean  $message  the message
	 * @param   boolean  $visible  is the $dir visible?
	 *
	 * @return  string	html code
	 */
	public function message($dir, $message, $visible = true)
	{
		$output = $visible ? $dir : '';

		if (empty($message))
		{
			return $output;
		}

		return $output . ' <strong>' . Text::_($message) . '</strong>';
	}
}

The same content is in 50 releases, Joomla 4.0.0-beta7 to 4.2.0-beta2. See them all, or every version of this file.