CoreFiles by mySites.guru
Directory.php60 lines, 1,333 bytes, from Joomla_4.0.0-alpha5-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha3
md5
b9a89fce6cacbdaf291237804e0c58eb
sha1
05481dc539cc9854b81bff2b69f1bc3cefafb9fa
sha256
881263b26af087103d47fa75d07e5b9c7ecfb6e75de9f6945f98a1e18a24f5bc
<?php
/**
 * @package     Joomla.Administrator
 * @subpackage  com_admin
 *
 * @copyright   Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
 * @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>';
	}
}

The same content is in 2 releases, Joomla 4.0.0-alpha5 to 4.0.0-alpha6. See them all, or every version of this file.