* @link http://www.nonumber.nl/modalizer
* @copyright Copyright (C) 2008 NoNumber! All Rights Reserved
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
*/
// Ensure this file is being included by a parent file
defined('_JEXEC') or die( 'Restricted access' );
// Import library dependencies
require_once( dirname( __FILE__ ).DS.'version_check.php' );
/**
* Title Element
*
* @since Class available since Release 1.0.0
*/
class JElementTitle extends JElement
{
/**
* Element name
*
* @access protected
* @var string
*/
var $_name = 'Title';
function fetchTooltip( $label, $description, &$node, $control_name, $name )
{
return;
}
function fetchElement( $name, $value, &$node, $control_name )
{
$_title = ( isset( $node->_attributes['label'] ) ) ? $node->_attributes['label'] : '';
$_description = ( isset( $node->_attributes['description'] ) ) ? $node->_attributes['description'] : '';
$_image = ( isset( $node->_attributes['image'] ) ) ? $node->_attributes['image'] : '';
$_show_apply = ( isset( $node->_attributes['show_apply'] ) ) ? $node->_attributes['show_apply'] : 0;
// the main url
$_url = ( isset( $node->_attributes['url'] ) ) ? $node->_attributes['url'] : '';
// the url of the download location
$_download = ( isset( $node->_attributes['download_url'] ) ) ? $node->_attributes['download_url'] : '';
// the url of the help page
$_help = ( isset( $node->_attributes['help_url'] ) ) ? $node->_attributes['help_url'] : '';
// the url to the new version folder
$_version_url = ( isset( $node->_attributes['version_url'] ) ) ? $node->_attributes['version_url'] : $_url.'/versions/';
// the path to version folder (relative to this file) (end path with a slash, ie 'versions/')
$_version_path = ( isset( $node->_attributes['version_path'] ) ) ? $node->_attributes['version_path'] : '';
// the filename of the current version file
$_version_file = ( isset( $node->_attributes['version_file'] ) ) ? $node->_attributes['version_file'] : '';
$_msg = '';
if ( $_title ) {
$_title = html_entity_decode( JText::_( $_title ) );
}
if ( $_version_file ) {
$_msg = ModalizerVersionCheck::getMessage( $_version_file, $_version_path, $_version_url, $_download );
$_version = ModalizerVersionCheck::check( $_version_file, $_version_path, $_version_url );
$_current_version = $_version[0];
if ( $_current_version ) {
if ( $_title ) {
$_title .= ' v.'.$_current_version;
} else {
$_title = 'Version '.$_current_version;
}
}
}
if ( $_url ) {
$_url = '';
}
if ( $_image ) {
$_image = $_url.'';
if ( $_url ) { $_image .= ''; }
}
if ( $_url ) { $_title = $_url.$_title.''; }
if ( $_description ) { $_description = html_entity_decode( JText::_( $_description ) ); }
if ( $_help ) { $_help = ''.JText::_( 'Help' ).''; }
$_lang = JFactory::getLanguage();
$_lang = str_replace( '_', '-', $_lang->_lang );
$_include_file = '.title.inc.'.$_lang.'.php';
if ( !file_exists( dirname( __FILE__ ).DS.$_include_file ) ) {
$_include_file = 'title.inc.en-GB.php';
}
if ( file_exists( dirname( __FILE__ ).DS.$_include_file ) ) {
include( dirname( __FILE__ ).DS.$_include_file );
}
$html = '