[ Index ] |
|
Code source de eGroupWare 1.2.106-2 |
1 <?php 2 /**************************************************************************\ 3 * eGroupWare SiteMgr - SiteMgr support for Mambo Open Source templates * 4 * http://www.egroupware.org * 5 * Written and copyright by RalfBecker@outdoor-training.de * 6 * -------------------------------------------- * 7 * This program is free software; you can redistribute it and/or modify it * 8 * under the terms of the GNU General Public License as published by the * 9 * Free Software Foundation; either version 2 of the License, or (at your * 10 * option) any later version. * 11 \**************************************************************************/ 12 13 /* $Id: class.mos_ui.inc.php 20295 2006-02-15 12:31:25Z $ */ 14 15 function mosCountModules($contentarea) 16 { 17 global $objui,$mos_content_cache; 18 19 if (!isset($mos_content_cache[$contentarea])) 20 { 21 $mos_content_cache[$contentarea] = $objui->t->process_blocks($contentarea); 22 } 23 return (int)!empty($mos_content_cache[$contentarea]); 24 } 25 26 function mosLoadModules($contentarea) 27 { 28 global $objui,$mos_content_cache; 29 30 if (!isset($mos_content_cache[$contentarea])) 31 { 32 $mos_content_cache[$contentarea] = $objui->t->process_blocks($contentarea); 33 } 34 echo $mos_content_cache[$contentarea]; 35 } 36 37 function mosLoadComponent($component) 38 { 39 return ''; 40 } 41 42 function initEditor() 43 { 44 } 45 46 function sefreltoabs($url) 47 { 48 echo $url; 49 } 50 51 function mosShowHead() 52 { 53 global $objui,$mosConfig_sitename; 54 echo "\t\t<title>$mosConfig_sitename</title>\n"; 55 $objui->t->loadfile(realpath(dirname(__FILE__).'/../mos-compat/metadata.tpl')); 56 echo $objui->t->parse(); 57 } 58 59 // this is just to make some templates work, it does nothing actually atm. 60 class mos_database 61 { 62 function setQuery($query) 63 { 64 } 65 66 function loadObjectList() 67 { 68 return array(); 69 } 70 } 71 72 class ui 73 { 74 var $t; 75 76 function ui() 77 { 78 $themesel = $GLOBALS['sitemgr_info']['themesel']; 79 $this->templateroot = $GLOBALS['sitemgr_info']['site_dir'] . SEP . 'templates' . SEP . $themesel; 80 $this->t =& new Template3($this->templateroot); 81 $this->t->transformer_root = $this->mos_compat_dir = realpath(dirname(__FILE__).'/../mos-compat'); 82 } 83 84 function displayPageByName($page_name) 85 { 86 global $objbo; 87 global $page; 88 $objbo->loadPage($GLOBALS['Common_BO']->pages->so->PageToID($page_name)); 89 $this->generatePage(); 90 } 91 92 function displayPage($page_id) 93 { 94 global $objbo; 95 $objbo->loadPage($page_id); 96 $this->generatePage(); 97 } 98 99 function displayIndex() 100 { 101 global $objbo; 102 $objbo->loadIndex(); 103 $this->generatePage(); 104 } 105 106 function displayTOC($categoryid=false) 107 { 108 global $objbo; 109 $objbo->loadTOC($categoryid); 110 $this->generatePage(); 111 } 112 113 function generatePage() 114 { 115 global $database; 116 $database =& new mos_database; 117 118 // add a content-type header to overwrite an existing default charset in apache (AddDefaultCharset directiv) 119 header('Content-type: text/html; charset='.$GLOBALS['egw']->translation->charset()); 120 121 // define global $mosConfig vars 122 global $mosConfig_sitename,$mosConfig_live_site,$mosConfig_absolute_path,$mosConfig_offset,$cur_template; 123 $mosConfig_sitename = $this->t->get_meta('sitename').': '.$this->t->get_meta('title'); 124 $mosConfig_live_site = substr($GLOBALS['sitemgr_info']['site_url'],0,-1); 125 $mosConfig_offset = (int) $GLOBALS['egw_info']['user']['preferences']['common']['tz_offset']; 126 $mosConfig_absolute_path = $GLOBALS['sitemgr_info']['site_dir']; 127 $cur_template = $GLOBALS['sitemgr_info']['themesel']; 128 define('_DATE_FORMAT_LC',str_replace(array('d','m','M','Y'),array('%d','%m','%b','%Y'), 129 $GLOBALS['egw_info']['user']['preferences']['common']['dateformat']). 130 ($GLOBALS['egw_info']['user']['preferences']['common']['timeformat']=='12'?' %I:%M %p' : ' %H:%M')); 131 define('_DATE_FORMAT',$GLOBALS['egw_info']['user']['preferences']['common']['dateformat']. 132 ($GLOBALS['egw_info']['user']['preferences']['common']['timeformat']=='12'?' h:i a' : ' H:i')); 133 define('_SEARCH_BOX',lang('Search').' ...'); 134 define( '_ISO','charset='.$GLOBALS['egw']->translation->charset()); 135 define( '_VALID_MOS',True ); 136 define( '_VALID_MYCSSMENU',True ); 137 ini_set('include_path',$this->mos_compat_dir.(strtoupper(substr(PHP_OS, 0, 3)) == 'WIN' ? ';' : ':').ini_get('include_path')); 138 139 ob_start(); // else some modules like the redirect wont work 140 include($this->templateroot.'/index.php'); 141 ob_end_flush(); 142 } 143 } 144 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Feb 25 17:20:01 2007 | par Balluche grâce à PHPXref 0.7 |