| Server IP : 180.180.241.3 / Your IP : 216.73.216.216 Web Server : Microsoft-IIS/7.5 System : Windows NT NETWORK-NHRC 6.1 build 7601 (Windows Server 2008 R2 Standard Edition Service Pack 1) i586 User : IUSR ( 0) PHP Version : 5.3.28 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/AppServ/www/news/administrator/components/com_jevents/elements/ |
Upload File : |
<?php
/**
* JEvents Component for Joomla 1.5.x
*
* @version $Id: jevinfo.php 1399 2009-03-30 08:31:52Z geraint $
* @package JEvents
* @copyright Copyright (C) 2008-2009 GWE Systems Ltd
* @license GNU/GPLv2, see http://www.gnu.org/licenses/gpl-2.0.html
* @link http://www.jevents.net
*/
// Check to ensure this file is within the rest of the framework
defined('JPATH_BASE') or die();
class JElementJevinfo extends JElement
{
/**
* Element name
*
* @access protected
* @var string
*/
var $_name = 'Jevinfo';
function fetchTooltip($label, $description, &$node, $control_name, $name) {
return ' ';
}
function fetchElement($name, $value, &$node, $control_name)
{
$help = $node->attributes('help');
if (!is_null($help)){
$parts = explode(",",$value);
$helps = explode(",",$help);
foreach ($parts as $key=>$valuepart) {
$help = $helps[$key];
list($helpfile,$varname,$part) = explode("::",$help);
JEVHelper::loadOverlib();
$lang =& JFactory::getLanguage();
$langtag = $lang->getTag();
if( file_exists( JPATH_COMPONENT_ADMINISTRATOR . '/help/' . $langtag . '/'.$helpfile )){
$jeventHelpPopup = JPATH_COMPONENT_ADMINISTRATOR . '/help/' . $langtag . '/'.$helpfile ;
}
else {
$jeventHelpPopup = JPATH_COMPONENT_ADMINISTRATOR . '/help/en-GB/'.$helpfile ;
}
include($jeventHelpPopup);
$help = $this->help($$varname, $part);
$parts[$key]=JText::_($valuepart).$help;
}
$value = implode(", ",$parts);
}
return "<strong style='color:#993300'>".JText::_($value) ."</strong>";
}
/**
* Creates a help icon with link to help information as onclick event
*
* if $help is url, link opens a new window with target url
* if $help is text, text is shown in a sticky overlib window with close button
*
* @static
* @param $help string help text (html text or url to target)
* @param $caption string caption of overlib window
* @return string html sting
*/
function help ( $help='help text', $caption='') {
global $mainframe;
$compath = JURI::root() . 'administrator/components/'.JEV_COM_COMPONENT;
$imgpath = $compath . '/assets/images';
if (empty($caption)) $caption = ' ';
if (substr($help, 0, 7) == 'http://' || substr($help, 0, 8) == 'https://') {
//help text is url, open new window
$onclick_cmd = "window.open(\"$help\", \"help\", \"height=700,width=800,resizable=yes,scrollbars\");return false";
} else {
// help text is plain text with html tags
// prepare text as overlib parameter
// escape ", replace new line by space
$help = htmlspecialchars($help, ENT_QUOTES);
$help = str_replace('"', '\"', $help);
$help = str_replace("\n", " ", $help);
$ol_cmds = 'RIGHT, ABOVE, VAUTO, WRAP, STICKY, CLOSECLICK, CLOSECOLOR, "white"';
$ol_cmds .= ', CLOSETEXT, "<span style=\"border:solid white 1px;padding:0px;margin:1px;\"><b>X</b></span>"';
$onclick_cmd = 'return overlib("'.$help.'", ' . $ol_cmds . ', CAPTION, "'.$caption.'")';
}
$str = '<img border="0" style="vertical-align:bottom; cursor:help;" alt="'. JText::_('JEV_HELP') . '"'
. ' title="' . JText::_('JEV_HELP') .'"'
. ' src="' . $imgpath . '/help_ques_inact.gif"'
. ' onmouseover=\'this.src="' . $imgpath . '/help_ques.gif"\''
. ' onmouseout=\'this.src="' . $imgpath . '/help_ques_inact.gif"\''
. ' onclick=\'' . $onclick_cmd . '\' />';
return $str;
}
}