| 1 |
<?php |
<?php |
| 2 |
/** |
/** |
| 3 |
* @package Mambo Open Source |
* @package Mambo |
| 4 |
* @copyright (C) 2005 - 2006 Mambo Foundation Inc. |
* @author Mambo Foundation Inc see README.php |
| 5 |
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL |
* @copyright Mambo Foundation Inc. |
| 6 |
* |
* See COPYRIGHT.php for copyright notices and details. |
| 7 |
* Mambo was originally developed by Miro (www.miro.com.au) in 2000. Miro assigned the copyright in Mambo to The Mambo Foundation in 2005 to ensure |
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see |
| 8 |
* that Mambo remained free Open Source software owned and managed by the community. |
* LICENSE.php |
| 9 |
* Mambo is Free Software |
* Mambo is free software; you can redistribute it and/or |
| 10 |
|
* modify it under the terms of the GNU General Public License |
| 11 |
|
* as published by the Free Software Foundation; version 2 of the |
| 12 |
|
* License. |
| 13 |
*/ |
*/ |
| 14 |
|
|
| 15 |
/** |
/** |
| 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 |
} |
} |
| 339 |
eval($code); |
eval($code); |
| 340 |
|
|
| 341 |
|
|
| 342 |
if (isset($_SERVER['DOCUMENT_ROOT']) AND strlen($_SERVER['DOCUMENT_ROOT'])) { |
/*if (isset($_SERVER['DOCUMENT_ROOT']) AND strlen($_SERVER['DOCUMENT_ROOT'])) { |
| 343 |
$docroot = str_replace('\\', '/', str_replace('\\\\', '\\', $_SERVER['DOCUMENT_ROOT'])); |
$docroot = str_replace('\\', '/', str_replace('\\\\', '\\', $_SERVER['DOCUMENT_ROOT'])); |
| 344 |
} |
} |
| 345 |
else { |
else {*/ |
| 346 |
// Find information about where execution started |
// Find information about where execution started |
| 347 |
$origin = array_pop(debug_backtrace()); |
$origin = array_pop(debug_backtrace()); |
| 348 |
// Find the PHP script at the start, with a fix for Windows slashes |
// Find the PHP script at the start, with a fix for Windows slashes |
| 349 |
$absolutepath = str_replace('\\', '/', $origin['file']); |
$absolutepath = str_replace('\\', '/', $origin['file']); |
| 350 |
$localpath = $_SERVER['PHP_SELF']; |
$localpath = $_SERVER['PHP_SELF']; |
| 351 |
$docroot = substr($absolutepath,0,strpos($absolutepath,$localpath)); |
$docroot = substr($absolutepath,0,strpos($absolutepath,$localpath)); |
| 352 |
} |
/*}*/ |
| 353 |
$mamboroot = str_replace('\\', '/', rtrim($this->rootPath, '\/')); |
$mamboroot = str_replace('\\', '/', rtrim($this->rootPath, '\/')); |
| 354 |
$this->subdirectory = substr($mamboroot, strlen($docroot)); |
$this->subdirectory = substr($mamboroot, strlen($docroot)); |
| 355 |
|
|
| 398 |
* @param unknown_type $database |
* @param unknown_type $database |
| 399 |
*/ |
*/ |
| 400 |
function offlineCheck (&$user, &$database) { |
function offlineCheck (&$user, &$database) { |
| 401 |
if ($this->mosConfig_offline OR file_exists($this->rootPath.'/installation/index.php')) { |
global $adminside; |
| 402 |
|
if (($this->mosConfig_offline && !$adminside) OR file_exists($this->rootPath.'/installation/index.php')) { |
| 403 |
require_once($this->rootPath().'/administrator/includes/admin.php'); |
require_once($this->rootPath().'/administrator/includes/admin.php'); |
| 404 |
session_name(md5($this->mosConfig_live_site)); |
session_name(md5($this->mosConfig_live_site)); |
| 405 |
session_start(); |
session_start(); |
| 421 |
require_once($this->mosConfig_absolute_path.'/includes/phpgettext/error.php'); |
require_once($this->mosConfig_absolute_path.'/includes/phpgettext/error.php'); |
| 422 |
require_once($this->mosConfig_absolute_path.'/includes/mambofunc.php'); |
require_once($this->mosConfig_absolute_path.'/includes/mambofunc.php'); |
| 423 |
require_once($this->mosConfig_absolute_path.'/includes/mambolanguage.class.php'); |
require_once($this->mosConfig_absolute_path.'/includes/mambolanguage.class.php'); |
| 424 |
$this->mosConfig_locale = mosGetParam($_POST, 'lang', $this->mosConfig_locale); |
if (!mosGetParam($_REQUEST, 'lang')); |
| 425 |
|
else $this->mosConfig_locale = mosGetParam($_REQUEST, 'lang', $this->mosConfig_locale); |
| 426 |
$language =& new mamboLanguage($this->mosConfig_locale, $this->rootPath.'/language/'); |
$language =& new mamboLanguage($this->mosConfig_locale, $this->rootPath.'/language/'); |
| 427 |
$languages = $language->getLanguages(); |
$languages = $language->getLanguages(); |
| 428 |
$charset = $language->get('charset'); |
$charset = $language->get('charset'); |
| 430 |
$this->mosConfig_lang = $language->get('lang'); |
$this->mosConfig_lang = $language->get('lang'); |
| 431 |
$this->current_language = $language; |
$this->current_language = $language; |
| 432 |
if (!defined('_ISO')) DEFINE('_ISO','charset='.$charset); |
if (!defined('_ISO')) DEFINE('_ISO','charset='.$charset); |
| 433 |
|
header('Content-type: text/html; '._ISO); |
| 434 |
if (!defined('_DATE_FORMAT_LC')) DEFINE('_DATE_FORMAT_LC', $dateformat); //Uses PHP's strftime Command Format |
if (!defined('_DATE_FORMAT_LC')) DEFINE('_DATE_FORMAT_LC', $dateformat); //Uses PHP's strftime Command Format |
| 435 |
if (!defined('_DATE_FORMAT_LC2')) DEFINE('_DATE_FORMAT_LC2', $dateformat); |
if (!defined('_DATE_FORMAT_LC2')) DEFINE('_DATE_FORMAT_LC2', $dateformat); |
| 436 |
|
|
| 578 |
require_once($this->rootPath().'/includes/authenticator.php'); |
require_once($this->rootPath().'/includes/authenticator.php'); |
| 579 |
$authenticator =& mamboAuthenticator::getInstance(); |
$authenticator =& mamboAuthenticator::getInstance(); |
| 580 |
$loggedin = $authenticator->loginUser(); |
$loggedin = $authenticator->loginUser(); |
| 581 |
if ($loggedin) $this->logMessage('_LOGIN_SUCCESS'); |
if ($loggedin) $this->logMessage(T_('You have Logged In succesfully')); |
| 582 |
else mamboCore::redirect('index.php'); |
else mamboCore::redirect('index.php'); |
| 583 |
} |
} |
| 584 |
|
|
| 590 |
require_once($this->rootPath().'/includes/authenticator.php'); |
require_once($this->rootPath().'/includes/authenticator.php'); |
| 591 |
$authenticator =& mamboAuthenticator::getInstance(); |
$authenticator =& mamboAuthenticator::getInstance(); |
| 592 |
$authenticator->logoutUser(); |
$authenticator->logoutUser(); |
| 593 |
$this->logMessage('_LOGOUT_SUCCESS'); |
$this->logMessage(T_('You have Logged Out successfully')); |
| 594 |
} |
} |
| 595 |
|
|
| 596 |
/** |
/** |
| 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) { |
| 1211 |
} |
} |
| 1212 |
closedir($dir); |
closedir($dir); |
| 1213 |
} |
} |
| 1214 |
|
asort($results); |
| 1215 |
return $results; |
return $results; |
| 1216 |
} |
} |
| 1217 |
|
|
| 1223 |
function soleDir () { |
function soleDir () { |
| 1224 |
$found = ''; |
$found = ''; |
| 1225 |
if ($dir = @opendir($this->path)) { |
if ($dir = @opendir($this->path)) { |
| 1226 |
while ($file = readdir($dir)) { |
while (false !== ($file = readdir($dir))) { |
| 1227 |
if ($file == '.' OR $file == '..') continue; |
if ($file == '.' OR $file == '..') continue; |
| 1228 |
if (is_dir($this->path.$file)) { |
if (is_dir($this->path.$file)) { |
| 1229 |
if ($found) return ''; |
if ($found) return ''; |
| 1560 |
} |
} |
| 1561 |
} |
} |
| 1562 |
} |
} |
| 1563 |
|
if ($Itemid == 0 && !count($result)){ |
| 1564 |
|
$result[0] = new stdclass; |
| 1565 |
|
$result[0]->id = 1; |
| 1566 |
|
$result[0]->link = 'index.php?option=com_frontpage'; |
| 1567 |
|
$result[0]->parent = 0; |
| 1568 |
|
$result[0]->type = 'components'; |
| 1569 |
|
$result[0]->browserNav = 0; |
| 1570 |
|
$result[0]->name = 'Home'; |
| 1571 |
|
} |
| 1572 |
return $result; |
return $result; |
| 1573 |
} |
} |
| 1574 |
|
|
| 1981 |
if (isset($result[0])) return $result[0]; |
if (isset($result[0])) return $result[0]; |
| 1982 |
return null; |
return null; |
| 1983 |
} |
} |
| 1984 |
|
|
| 1985 |
|
function getBot($element, $folder) { |
| 1986 |
|
$returnBot = ''; |
| 1987 |
|
foreach ($this->_bots as $i=>$bot) { |
| 1988 |
|
if ($bot->folder == $folder && $bot->element == $element){ |
| 1989 |
|
$returnBot = $bot; |
| 1990 |
|
break; |
| 1991 |
|
} |
| 1992 |
|
} |
| 1993 |
|
return $returnBot; |
| 1994 |
|
} |
| 1995 |
} |
} |
| 1996 |
|
|
| 1997 |
/** |
/** |
| 2069 |
*/ |
*/ |
| 2070 |
function check() { |
function check() { |
| 2071 |
Global $mosConfig_absolute_path; |
Global $mosConfig_absolute_path; |
| 2072 |
include $mosConfig_absolute_path . ('/language/english.php'); |
//include $mosConfig_absolute_path . ('/language/english.php'); |
| 2073 |
$this->_error = ''; |
$this->_error = ''; |
| 2074 |
if ($this->name == '') $this->_error = _REGWARN_NAME; |
if ($this->name == '') $this->_error = _REGWARN_NAME; |
| 2075 |
elseif ($this->username == '') $this->_error = _REGWARN_UNAME; |
elseif ($this->username == '') $this->_error = _REGWARN_UNAME; |
| 2543 |
$sql['os'] = "INSERT INTO #__stats_agents (agent,type) VALUES ('$os',1)"; |
$sql['os'] = "INSERT INTO #__stats_agents (agent,type) VALUES ('$os',1)"; |
| 2544 |
$sql['domain'] = "INSERT INTO #__stats_agents (agent,type) VALUES ('$tldomain',2)"; |
$sql['domain'] = "INSERT INTO #__stats_agents (agent,type) VALUES ('$tldomain',2)"; |
| 2545 |
if ($stats) foreach ($stats as $stat) { |
if ($stats) foreach ($stats as $stat) { |
| 2546 |
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"; |
| 2547 |
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"; |
| 2548 |
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"; |
| 2549 |
} |
} |
| 2592 |
<?php |
<?php |
| 2593 |
} |
} |
| 2594 |
} |
} |
| 2595 |
|
/** |
| 2596 |
|
* Render head tags |
| 2597 |
|
* tags are assembled into an associative array with the following elements: |
| 2598 |
|
* - title |
| 2599 |
|
* - meta |
| 2600 |
|
* - mambojavascript |
| 2601 |
|
* - custom (custom head tags) |
| 2602 |
|
* - livebookmark |
| 2603 |
|
* - favicon |
| 2604 |
|
* @param unknown keys - array elements to output (null = output all) |
| 2605 |
|
* @param unknown exclude - array elements to exclude in output |
| 2606 |
|
* |
| 2607 |
|
* Usage: mosShowHead() - to render all tags |
| 2608 |
|
* mosShowHead('title') - to render a single tag |
| 2609 |
|
* mosShowHead(array('title', 'meta')) - to selectively render tags (in order) |
| 2610 |
|
* mosShowHead(null, 'custom') - to exclude a single tag |
| 2611 |
|
* mosShowHead(null, array('custom','favicon')) - to exclude multiple tags |
| 2612 |
|
*/ |
| 2613 |
|
function mosShowHead($keys='', $exclude='') { |
| 2614 |
|
if (!is_array($keys)) |
| 2615 |
|
if ($keys !== '' && !is_null($keys)) |
| 2616 |
|
$keys = array($keys); |
| 2617 |
|
else $keys = array(); |
| 2618 |
|
if (!is_array($exclude)) |
| 2619 |
|
if ($exclude !== '') |
| 2620 |
|
$exclude = array($exclude); |
| 2621 |
|
else $exclude = array(); |
| 2622 |
|
|
| 2623 |
|
$this->_head['output'] = array(); |
| 2624 |
|
|
| 2625 |
|
$head = array();; |
| 2626 |
|
$head['title'] = '<title>'.$this->_head['title'].'</title>'; |
| 2627 |
|
|
|
function mosShowHead () { |
|
|
global $_VERSION; |
|
|
$mosConfig_live_site = mamboCore::get('mosConfig_live_site'); |
|
| 2628 |
$this->appendMetaTag( 'description', mamboCore::get('mosConfig_MetaDesc'), true ); |
$this->appendMetaTag( 'description', mamboCore::get('mosConfig_MetaDesc'), true ); |
| 2629 |
$this->appendMetaTag( 'keywords', mamboCore::get('mosConfig_MetaKeys'), true ); |
$this->appendMetaTag( 'keywords', mamboCore::get('mosConfig_MetaKeys'), true ); |
| 2630 |
echo $this->getHead(); |
$head['meta'] = array(); |
| 2631 |
if (mamboCore::get('mosConfig_sef')) { |
foreach ($this->_head['meta'] as $name=>$meta) { |
| 2632 |
echo "<base href=\"$mosConfig_live_site/\" />\r\n"; |
if ($meta[1]) $head['meta'][] = $meta[1]; |
| 2633 |
|
$head['meta'][] = '<meta name="' . $name . '" content="' . $meta[0] . '" />'; |
| 2634 |
|
if ($meta[2]) $head['meta'][] = $meta[2]; |
| 2635 |
} |
} |
| 2636 |
|
$head['meta'] = implode( "\n", $head['meta'] ); |
| 2637 |
|
|
| 2638 |
$my = mamboCore::get('currentUser'); |
$my = mamboCore::get('currentUser'); |
| 2639 |
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>" : ''; |
| 2640 |
?> |
|
| 2641 |
<script language="JavaScript1.2" src="<?php echo $mosConfig_live_site;?>/includes/js/mambojavascript.js" type="text/javascript"></script> |
$head['custom'] = array(); |
| 2642 |
<?php |
foreach ($this->_head['custom'] as $html) |
| 2643 |
} |
if (trim($html) !== '') |
| 2644 |
|
$head['custom'][] = $html; |
| 2645 |
|
if (count($head['custom']) !== 0) |
| 2646 |
|
$head['custom'] = implode( "\n", $head['custom'] ); |
| 2647 |
|
else |
| 2648 |
|
$head['custom'] = ''; |
| 2649 |
|
|
| 2650 |
|
ob_start(); |
| 2651 |
$this->liveBookMark(); |
$this->liveBookMark(); |
| 2652 |
// outputs link tag for page |
$head['livebookmark'] = ob_get_contents(); |
| 2653 |
|
ob_end_clean(); |
| 2654 |
|
|
| 2655 |
$configuration =& mamboCore::getMamboCore(); |
$configuration =& mamboCore::getMamboCore(); |
| 2656 |
?> |
$head['favicon'] = "<link rel=\"shortcut icon\" href=\"".$configuration->getFavIcon()."\" />"; |
|
<link rel="shortcut icon" href="<?php echo $configuration->getFavIcon();?>" /> |
|
|
<?php |
|
|
} |
|
| 2657 |
|
|
| 2658 |
|
foreach($head as $key=>$value) |
| 2659 |
|
$this->_head['output'][$key] = "$value"; |
| 2660 |
|
|
| 2661 |
|
$tags = $this->_head['output']; |
| 2662 |
|
if (count($keys) == 0) { |
| 2663 |
|
foreach($tags as $key=>$value) |
| 2664 |
|
if (!in_array($key, $exclude)) |
| 2665 |
|
if ($value !== '') |
| 2666 |
|
echo trim($value)."\n"; |
| 2667 |
|
} else { |
| 2668 |
|
foreach($keys as $key) |
| 2669 |
|
if (isset($tags[$key])) |
| 2670 |
|
if(trim($tags[$key]) !== '') |
| 2671 |
|
echo trim($tags[$key])."\n"; |
| 2672 |
|
} |
| 2673 |
|
} |
| 2674 |
|
|
| 2675 |
/** |
/** |
| 2676 |
* retained for backward compatability |
* retained for backward compatability |
| 3041 |
* |
* |
| 3042 |
**/ |
**/ |
| 3043 |
$PATH_TO_CLASS = dirname(ereg_replace("\\\\","/",__FILE__)) . "/" . "ConvertTables" . "/"; |
$PATH_TO_CLASS = dirname(ereg_replace("\\\\","/",__FILE__)) . "/" . "ConvertTables" . "/"; |
| 3044 |
|
@require_once($PATH_TO_CLASS."/charsetmapping.php"); |
| 3045 |
define ("CONVERT_TABLES_DIR", $PATH_TO_CLASS); |
define ("CONVERT_TABLES_DIR", $PATH_TO_CLASS); |
| 3046 |
define ("DEBUG_MODE", 1); |
define ("DEBUG_MODE", 1); |
| 3047 |
|
|
| 3428 |
/** |
/** |
| 3429 |
* Check are there all variables |
* Check are there all variables |
| 3430 |
**/ |
**/ |
| 3431 |
if ($StringToChange == "") |
/*if ($StringToChange == "") |
| 3432 |
{ |
{ |
| 3433 |
print $this->DebugOutput(0, 3, "\$StringToChange"); |
print $this->DebugOutput(0, 3, "\$StringToChange"); |
| 3434 |
} |
} |
| 3435 |
else if ($FromCharset == "") |
else*/ |
| 3436 |
|
if ($FromCharset == "") |
| 3437 |
{ |
{ |
| 3438 |
print $this->DebugOutput(0, 3, "\$FromCharset"); |
print $this->DebugOutput(0, 3, "\$FromCharset"); |
| 3439 |
} |
} |
| 3619 |
//$Debug [$Group][$Number] = "Message, can by with $Value"; |
//$Debug [$Group][$Number] = "Message, can by with $Value"; |
| 3620 |
//$Group[0] - Errors |
//$Group[0] - Errors |
| 3621 |
//$Group[1] - Notice |
//$Group[1] - Notice |
| 3622 |
$Debug[0][0] = "Error, can NOT read file: " . $Value . "<br>"; |
$Debug[0][0] = "Error, can NOT read file: " . $Value . "<br />"; |
| 3623 |
$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 />"; |
| 3624 |
$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 />"; |
| 3625 |
$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 />"; |
| 3626 |
$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 />"; |
| 3627 |
$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 />"; |
| 3628 |
$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 />"; |
| 3629 |
$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 />"; |
| 3630 |
|
|
| 3631 |
if (DEBUG_MODE >= $Group) |
if (DEBUG_MODE >= $Group) |
| 3632 |
{ |
{ |
| 3635 |
} // function DebugOutput |
} // function DebugOutput |
| 3636 |
|
|
| 3637 |
} //class ends here |
} //class ends here |
| 3638 |
|
|
| 3639 |
|
class mosHtmlHelper { |
| 3640 |
|
var $_docTypes = array( |
| 3641 |
|
'xhtml-strict' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">', |
| 3642 |
|
'xhtml-trans' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">', |
| 3643 |
|
'xhtml-frame' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">', |
| 3644 |
|
'xhtml11' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">' |
| 3645 |
|
); |
| 3646 |
|
var $_docTypesText = array( |
| 3647 |
|
'xhtml-strict' => 'XHTML 1.0 Strict', |
| 3648 |
|
'xhtml-trans' => 'XHTML 1.0 Transitional', |
| 3649 |
|
'xhtml-frame' => 'XHTML 1.0 Frameset', |
| 3650 |
|
'xhtml11' => 'XHTML 1.1' |
| 3651 |
|
); |
| 3652 |
|
var $doctype = 'xhtml-trans'; |
| 3653 |
|
|
| 3654 |
|
/** |
| 3655 |
|
* Singleton accessor |
| 3656 |
|
*/ |
| 3657 |
|
function &getInstance () { |
| 3658 |
|
static $instance; |
| 3659 |
|
if (!is_object($instance)) $instance = new mosHtmlHelper(); |
| 3660 |
|
return $instance; |
| 3661 |
|
} |
| 3662 |
|
function __docType($type=null) { |
| 3663 |
|
static $obj; |
| 3664 |
|
if (!is_object($obj)) $obj =& mosHtmlHelper::getInstance(); |
| 3665 |
|
|
| 3666 |
|
if (array_key_exists($type, $obj->_docTypes)) return $obj->_docTypes[$type]; |
| 3667 |
|
return $obj->_docTypes[$obj->doctype]; |
| 3668 |
|
} |
| 3669 |
|
function renderDocType($type=null) { |
| 3670 |
|
static $obj; |
| 3671 |
|
if (!is_object($obj)) $obj =& mosHtmlHelper::getInstance(); |
| 3672 |
|
|
| 3673 |
|
echo $obj->__docType($type)."\n"; |
| 3674 |
|
} |
| 3675 |
|
function get($var) { |
| 3676 |
|
static $obj; |
| 3677 |
|
if (!is_object($obj)) $obj =& mosHtmlHelper::getInstance(); |
| 3678 |
|
|
| 3679 |
|
if(isset($obj->$var)) return $obj->$var; |
| 3680 |
|
return null; |
| 3681 |
|
} |
| 3682 |
|
function set($property, $value) { |
| 3683 |
|
static $obj; |
| 3684 |
|
if (!is_object($obj)) $obj =& mosHtmlHelper::getInstance(); |
| 3685 |
|
|
| 3686 |
|
if($property{0} == '_') return; // dont set private properties |
| 3687 |
|
if (isset($obj->$property)) $obj->$property = $value; |
| 3688 |
|
} |
| 3689 |
|
} // end class mosHtmlHelper |
| 3690 |
?> |
?> |