CoreFiles by mySites.guru
Directory.php60 lines, 1,321 bytes, from Joomla_4.0.0-beta6-Beta-Full_Package.zip
Raw History Compare with 4.0.0-beta5
md5
7a186ec5dff5995a04e2ef939c7e2c85
sha1
211e5346fe8357e5dfd61ce03ceff963b89d3d64
sha256
44e43e3e16d999f6ab3d290ebdb021ccd6129e4ada667d1e4e8b85d8e52903a7
<?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 badge-success">' . Text::_('COM_ADMIN_WRITABLE') . '</span>';
		}

		return '<span class="badge badge-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>';
	}
}

No other release has this exact content. See every version of this file.