| 327 |
if ($f) { |
if ($f) { |
| 328 |
while ($f AND !feof($f)) { |
while ($f AND !feof($f)) { |
| 329 |
$line = fgets($f); |
$line = fgets($f); |
| 330 |
$altered = str_replace('$', '$this->', $line); |
$altered = preg_replace('/^\$/', '$this->', $line); |
| 331 |
if ($altered != $line) $code .= $altered; |
if ($altered != $line) $code .= $altered; |
| 332 |
} |
} |
| 333 |
} |
} |
| 1195 |
function &listAll ($type='file', $recurse=false, $fullpath=false) { |
function &listAll ($type='file', $recurse=false, $fullpath=false) { |
| 1196 |
$results = array(); |
$results = array(); |
| 1197 |
if ($dir = @opendir($this->path)) { |
if ($dir = @opendir($this->path)) { |
| 1198 |
while ($file = readdir($dir)) { |
while (false !== ($file = readdir($dir))) { |
| 1199 |
if ($file == '.' OR $file == '..') continue; |
if ($file == '.' OR $file == '..') continue; |
| 1200 |
if (is_dir($this->path.$file)) { |
if (is_dir($this->path.$file)) { |
| 1201 |
if ($recurse) { |
if ($recurse) { |
| 1222 |
function soleDir () { |
function soleDir () { |
| 1223 |
$found = ''; |
$found = ''; |
| 1224 |
if ($dir = @opendir($this->path)) { |
if ($dir = @opendir($this->path)) { |
| 1225 |
while ($file = readdir($dir)) { |
while (false !== ($file = readdir($dir))) { |
| 1226 |
if ($file == '.' OR $file == '..') continue; |
if ($file == '.' OR $file == '..') continue; |
| 1227 |
if (is_dir($this->path.$file)) { |
if (is_dir($this->path.$file)) { |
| 1228 |
if ($found) return ''; |
if ($found) return ''; |
| 1559 |
} |
} |
| 1560 |
} |
} |
| 1561 |
} |
} |
| 1562 |
|
if ($Itemid == 0 && !count($result)){ |
| 1563 |
|
$result[0] = new stdclass; |
| 1564 |
|
$result[0]->id = 1; |
| 1565 |
|
$result[0]->link = 'index.php?option=com_frontpage'; |
| 1566 |
|
$result[0]->parent = 0; |
| 1567 |
|
$result[0]->type = 'components'; |
| 1568 |
|
$result[0]->browserNav = 0; |
| 1569 |
|
$result[0]->name = 'Home'; |
| 1570 |
|
} |
| 1571 |
return $result; |
return $result; |
| 1572 |
} |
} |
| 1573 |
|
|
| 1980 |
if (isset($result[0])) return $result[0]; |
if (isset($result[0])) return $result[0]; |
| 1981 |
return null; |
return null; |
| 1982 |
} |
} |
| 1983 |
|
|
| 1984 |
|
function getBot($element, $folder) { |
| 1985 |
|
$returnBot = ''; |
| 1986 |
|
foreach ($this->_bots as $i=>$bot) { |
| 1987 |
|
if ($bot->folder == $folder && $bot->element == $element){ |
| 1988 |
|
$returnBot = $bot; |
| 1989 |
|
break; |
| 1990 |
|
} |
| 1991 |
|
} |
| 1992 |
|
return $returnBot; |
| 1993 |
|
} |
| 1994 |
} |
} |
| 1995 |
|
|
| 1996 |
/** |
/** |
| 2542 |
$sql['os'] = "INSERT INTO #__stats_agents (agent,type) VALUES ('$os',1)"; |
$sql['os'] = "INSERT INTO #__stats_agents (agent,type) VALUES ('$os',1)"; |
| 2543 |
$sql['domain'] = "INSERT INTO #__stats_agents (agent,type) VALUES ('$tldomain',2)"; |
$sql['domain'] = "INSERT INTO #__stats_agents (agent,type) VALUES ('$tldomain',2)"; |
| 2544 |
if ($stats) foreach ($stats as $stat) { |
if ($stats) foreach ($stats as $stat) { |
| 2545 |
if ($stat->type == 0) $sql['agents'] = "UPDATE #__stats_agents SET hits=(hits+1) WHERE agent='$browser' AND type=0"; |
if ($stat->type == 0) $sql['browser'] = "UPDATE #__stats_agents SET hits=(hits+1) WHERE agent='$browser' AND type=0"; |
| 2546 |
if ($stat->type == 1) $sql['os'] = "UPDATE #__stats_agents SET hits=(hits+1) WHERE agent='$os' AND type=1"; |
if ($stat->type == 1) $sql['os'] = "UPDATE #__stats_agents SET hits=(hits+1) WHERE agent='$os' AND type=1"; |
| 2547 |
if ($stat->type == 2) $sql['domain'] = "UPDATE #__stats_agents SET hits=(hits+1) WHERE agent='$tldomain' AND type=2"; |
if ($stat->type == 2) $sql['domain'] = "UPDATE #__stats_agents SET hits=(hits+1) WHERE agent='$tldomain' AND type=2"; |
| 2548 |
} |
} |
| 2591 |
<?php |
<?php |
| 2592 |
} |
} |
| 2593 |
} |
} |
| 2594 |
|
/** |
| 2595 |
|
* Render head tags |
| 2596 |
|
* tags are assembled into an associative array with the following elements: |
| 2597 |
|
* - title |
| 2598 |
|
* - meta |
| 2599 |
|
* - mambojavascript |
| 2600 |
|
* - custom (custom head tags) |
| 2601 |
|
* - livebookmark |
| 2602 |
|
* - favicon |
| 2603 |
|
* @param unknown keys - array elements to output (null = output all) |
| 2604 |
|
* @param unknown exclude - array elements to exclude in output |
| 2605 |
|
* |
| 2606 |
|
* Usage: mosShowHead() - to render all tags |
| 2607 |
|
* mosShowHead('title') - to render a single tag |
| 2608 |
|
* mosShowHead(array('title', 'meta')) - to selectively render tags (in order) |
| 2609 |
|
* mosShowHead(null, 'custom') - to exclude a single tag |
| 2610 |
|
* mosShowHead(null, array('custom','favicon')) - to exclude multiple tags |
| 2611 |
|
*/ |
| 2612 |
|
function mosShowHead($keys='', $exclude='') { |
| 2613 |
|
if (!is_array($keys)) |
| 2614 |
|
if ($keys !== '' && !is_null($keys)) |
| 2615 |
|
$keys = array($keys); |
| 2616 |
|
else $keys = array(); |
| 2617 |
|
if (!is_array($exclude)) |
| 2618 |
|
if ($exclude !== '') |
| 2619 |
|
$exclude = array($exclude); |
| 2620 |
|
else $exclude = array(); |
| 2621 |
|
|
| 2622 |
|
$this->_head['output'] = array(); |
| 2623 |
|
|
| 2624 |
|
$head = array();; |
| 2625 |
|
$head['title'] = '<title>'.$this->_head['title'].'</title>'; |
| 2626 |
|
|
|
function mosShowHead () { |
|
|
global $_VERSION; |
|
|
$mosConfig_live_site = mamboCore::get('mosConfig_live_site'); |
|
| 2627 |
$this->appendMetaTag( 'description', mamboCore::get('mosConfig_MetaDesc'), true ); |
$this->appendMetaTag( 'description', mamboCore::get('mosConfig_MetaDesc'), true ); |
| 2628 |
$this->appendMetaTag( 'keywords', mamboCore::get('mosConfig_MetaKeys'), true ); |
$this->appendMetaTag( 'keywords', mamboCore::get('mosConfig_MetaKeys'), true ); |
| 2629 |
echo $this->getHead(); |
$head['meta'] = array(); |
| 2630 |
if (mamboCore::get('mosConfig_sef')) { |
foreach ($this->_head['meta'] as $name=>$meta) { |
| 2631 |
echo "<base href=\"$mosConfig_live_site/\" />\r\n"; |
if ($meta[1]) $head['meta'][] = $meta[1]; |
| 2632 |
|
$head['meta'][] = '<meta name="' . $name . '" content="' . $meta[0] . '" />'; |
| 2633 |
|
if ($meta[2]) $head['meta'][] = $meta[2]; |
| 2634 |
} |
} |
| 2635 |
|
$head['meta'] = implode( "\n", $head['meta'] ); |
| 2636 |
|
|
| 2637 |
$my = mamboCore::get('currentUser'); |
$my = mamboCore::get('currentUser'); |
| 2638 |
if ( $my->id ) { |
$head['mambojavascript'] = $my->id ? "<script language=\"JavaScript1.2\" src=".mamboCore::get('mosConfig_live_site')."/includes/js/mambojavascript.js\" type=\"text/javascript\"></script>" : ''; |
| 2639 |
?> |
|
| 2640 |
<script language="JavaScript1.2" src="<?php echo $mosConfig_live_site;?>/includes/js/mambojavascript.js" type="text/javascript"></script> |
$head['custom'] = array(); |
| 2641 |
<?php |
foreach ($this->_head['custom'] as $html) |
| 2642 |
} |
if (trim($html) !== '') |
| 2643 |
|
$head['custom'][] = $html; |
| 2644 |
|
if (count($head['custom']) !== 0) |
| 2645 |
|
$head['custom'] = implode( "\n", $head['custom'] ); |
| 2646 |
|
else |
| 2647 |
|
$head['custom'] = ''; |
| 2648 |
|
|
| 2649 |
|
ob_start(); |
| 2650 |
$this->liveBookMark(); |
$this->liveBookMark(); |
| 2651 |
// outputs link tag for page |
$head['livebookmark'] = ob_get_contents(); |
| 2652 |
|
ob_end_clean(); |
| 2653 |
|
|
| 2654 |
$configuration =& mamboCore::getMamboCore(); |
$configuration =& mamboCore::getMamboCore(); |
| 2655 |
?> |
$head['favicon'] = "<link rel=\"shortcut icon\" href=\"".$configuration->getFavIcon()."\" />"; |
|
<link rel="shortcut icon" href="<?php echo $configuration->getFavIcon();?>" /> |
|
|
<?php |
|
|
} |
|
| 2656 |
|
|
| 2657 |
|
foreach($head as $key=>$value) |
| 2658 |
|
$this->_head['output'][$key] = "$value"; |
| 2659 |
|
|
| 2660 |
|
$tags = $this->_head['output']; |
| 2661 |
|
if (count($keys) == 0) { |
| 2662 |
|
foreach($tags as $key=>$value) |
| 2663 |
|
if (!in_array($key, $exclude)) |
| 2664 |
|
if ($value !== '') |
| 2665 |
|
echo trim($value)."\n"; |
| 2666 |
|
} else { |
| 2667 |
|
foreach($keys as $key) |
| 2668 |
|
if (isset($tags[$key])) |
| 2669 |
|
if(trim($tags[$key]) !== '') |
| 2670 |
|
echo trim($tags[$key])."\n"; |
| 2671 |
|
} |
| 2672 |
|
} |
| 2673 |
|
|
| 2674 |
/** |
/** |
| 2675 |
* retained for backward compatability |
* retained for backward compatability |
| 3618 |
//$Debug [$Group][$Number] = "Message, can by with $Value"; |
//$Debug [$Group][$Number] = "Message, can by with $Value"; |
| 3619 |
//$Group[0] - Errors |
//$Group[0] - Errors |
| 3620 |
//$Group[1] - Notice |
//$Group[1] - Notice |
| 3621 |
$Debug[0][0] = "Error, can NOT read file: " . $Value . "<br>"; |
$Debug[0][0] = "Error, can NOT read file: " . $Value . "<br />"; |
| 3622 |
$Debug[0][1] = "Error, can't find maching char \"". $Value ."\" in destination encoding table!" . "<br>"; |
$Debug[0][1] = "Error, can't find maching char \"". $Value ."\" in destination encoding table!" . "<br />"; |
| 3623 |
$Debug[0][2] = "Error, can't find maching char \"". $Value ."\" in source encoding table!" . "<br>"; |
$Debug[0][2] = "Error, can't find maching char \"". $Value ."\" in source encoding table!" . "<br />"; |
| 3624 |
$Debug[0][3] = "Error, you did NOT set variable " . $Value . " in Convert() function." . "<br>"; |
$Debug[0][3] = "Error, you did NOT set variable " . $Value . " in Convert() function." . "<br />"; |
| 3625 |
$Debug[0][4] = "You can NOT convert string from " . $Value . " to " . $Value . "!" . "<BR>"; |
$Debug[0][4] = "You can NOT convert string from " . $Value . " to " . $Value . "!" . "<br />"; |
| 3626 |
$Debug[1][0] = "Notice, you are trying to convert string from ". $Value ." to ". $Value .", don't you feel it's strange? ;-)" . "<br>"; |
$Debug[1][0] = "Notice, you are trying to convert string from ". $Value ." to ". $Value .", don't you feel it's strange? ;-)" . "<br />"; |
| 3627 |
$Debug[1][1] = "Notice, both charsets " . $Value . " are identical! Check encoding tables files." . "<br>"; |
$Debug[1][1] = "Notice, both charsets " . $Value . " are identical! Check encoding tables files." . "<br />"; |
| 3628 |
$Debug[1][2] = "Notice, there is no unicode char in the string you are trying to convert." . "<br>"; |
$Debug[1][2] = "Notice, there is no unicode char in the string you are trying to convert." . "<br />"; |
| 3629 |
|
|
| 3630 |
if (DEBUG_MODE >= $Group) |
if (DEBUG_MODE >= $Group) |
| 3631 |
{ |
{ |
| 3634 |
} // function DebugOutput |
} // function DebugOutput |
| 3635 |
|
|
| 3636 |
} //class ends here |
} //class ends here |
| 3637 |
|
|
| 3638 |
|
class mosHtmlHelper { |
| 3639 |
|
var $_docTypes = array( |
| 3640 |
|
'html4-strict' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">', |
| 3641 |
|
'html4-trans' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">', |
| 3642 |
|
'html4-frame' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">', |
| 3643 |
|
'xhtml-strict' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">', |
| 3644 |
|
'xhtml-trans' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">', |
| 3645 |
|
'xhtml-frame' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">', |
| 3646 |
|
'xhtml11' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">' |
| 3647 |
|
); |
| 3648 |
|
var $_docTypesText = array( |
| 3649 |
|
'html4-strict' => 'HTML 4.01 Strict', |
| 3650 |
|
'html4-trans' => 'HTML 4.01 Transitional', |
| 3651 |
|
'html4-frame' => 'HTML 4.01 Frameset', |
| 3652 |
|
'xhtml-strict' => 'XHTML 1.0 Strict', |
| 3653 |
|
'xhtml-trans' => 'XHTML 1.0 Transitional', |
| 3654 |
|
'xhtml-frame' => 'XHTML 1.0 Frameset', |
| 3655 |
|
'xhtml11' => 'XHTML 1.1' |
| 3656 |
|
); |
| 3657 |
|
var $doctype = 'xhtml-trans'; |
| 3658 |
|
|
| 3659 |
|
/** |
| 3660 |
|
* Singleton accessor |
| 3661 |
|
*/ |
| 3662 |
|
function &getInstance () { |
| 3663 |
|
static $instance; |
| 3664 |
|
if (!is_object($instance)) $instance = new mosHtmlHelper(); |
| 3665 |
|
return $instance; |
| 3666 |
|
} |
| 3667 |
|
function __docType($type=null) { |
| 3668 |
|
static $obj; |
| 3669 |
|
if (!is_object($obj)) $obj =& mosHtmlHelper::getInstance(); |
| 3670 |
|
|
| 3671 |
|
if (array_key_exists($type, $obj->_docTypes)) return $obj->_docTypes[$type]; |
| 3672 |
|
return $obj->_docTypes[$obj->doctype]; |
| 3673 |
|
} |
| 3674 |
|
function renderDocType($type=null) { |
| 3675 |
|
static $obj; |
| 3676 |
|
if (!is_object($obj)) $obj =& mosHtmlHelper::getInstance(); |
| 3677 |
|
|
| 3678 |
|
echo $obj->__docType($type)."\n"; |
| 3679 |
|
} |
| 3680 |
|
function get($var) { |
| 3681 |
|
static $obj; |
| 3682 |
|
if (!is_object($obj)) $obj =& mosHtmlHelper::getInstance(); |
| 3683 |
|
|
| 3684 |
|
if(isset($obj->$var)) return $obj->$var; |
| 3685 |
|
return null; |
| 3686 |
|
} |
| 3687 |
|
function set($property, $value) { |
| 3688 |
|
static $obj; |
| 3689 |
|
if (!is_object($obj)) $obj =& mosHtmlHelper::getInstance(); |
| 3690 |
|
|
| 3691 |
|
if($property{0} == '_') return; // dont set private properties |
| 3692 |
|
if (isset($obj->$property)) $obj->$property = $value; |
| 3693 |
|
} |
| 3694 |
|
} // end class mosHtmlHelper |
| 3695 |
?> |
?> |