~sylar-developers/sylar/dev

« back to all changes in this revision

Viewing changes to sylar/classes/presentation/html/HtmlHead.php

  • Committer: g.giusti at giano-solutions
  • Date: 2008-06-03 16:46:51 UTC
  • Revision ID: g.giusti@giano-solutions.com-20080603164651-7mvk9ofws27cmuhx
Some bugs fixed

Show diffs side-by-side

added added

removed removed

Lines of Context:
65
65
        // Url root for application javascript
66
66
        private $sAppJsUrlRoot;
67
67
        
68
 
        
 
68
        // Eventually custom tag
 
69
        private $aCustomTag;    
69
70
        
70
71
        function __construct($sTitle=null){
71
72
                
78
79
                $this->aFloatingJsScript= array();              
79
80
                $this->aStyleLink = array();                    
80
81
                $this->aFloatingStyle = array();        
81
 
                $this->aMetaTag = array();                              
 
82
                $this->aMetaTag = array();              
 
83
                $this->aCustomTag = array();            
82
84
        }
83
85
        function __destruct(){
84
86
                // nothing to do at the moment
162
164
         * @param string $sCharset
163
165
         */
164
166
        public function addSylarJavascript($sScriptFile, $sCharset=null){
165
 
                if($sCharset == null){
 
167
                if(is_null($sCharset)){
166
168
                        $sCharset = Sylar_ConfigBox::getDefaultCharset();
167
169
                }
168
170
                
189
191
         * @param string $sCharset
190
192
         */
191
193
        public function addApplicationJavascript($sScriptFile, $sCharset=null){
192
 
                if($sCharset == null){
 
194
                if(is_null($sCharset)){
193
195
                        $sCharset = Sylar_ConfigBox::getDefaultCharset();
194
196
                }
195
197
                
216
218
         * @param string $sCharset
217
219
         */     
218
220
        public function addFloatingJsScript($sScript, $sCharset=null){
219
 
                if($sCharset == null){
 
221
                if(is_null($sCharset)){
220
222
                        $sCharset = Sylar_ConfigBox::getDefaultCharset();
221
223
                }
222
224
                
239
241
         * @param string $sCharset
240
242
         */
241
243
        public function addSylarStyle($sStyleFile, $sCharset=null){
242
 
                if($sCharset == null){
 
244
                if(is_null($sCharset)){
243
245
                        $sCharset = Sylar_ConfigBox::getDefaultCharset();
244
246
                }
245
247
                
266
268
         * @param string $sCharset
267
269
         */     
268
270
        public function addApplicationStyle($sStyleFile, $sCharset=null){
269
 
                if($sCharset == null){
 
271
                if(is_null($sCharset)){
270
272
                        $sCharset = Sylar_ConfigBox::getDefaultCharset();
271
273
                }
272
274
                
293
295
         * @param string $sMedia
294
296
         */
295
297
        public function addFloatingStyle($sStyle, $sMedia=null){                
296
 
                if($sStyle!=null){
 
298
                if(!is_null($sStyle)){
297
299
                        $this->aFloatingStyle[] = "<style type=\"text/css\" media=\"all\"> ".$sStyle."</style>";
298
300
                }
299
301
        }
300
302
        
301
303
        
302
304
        /**
 
305
         * Insert custom tag in the <Head> tag of the page
 
306
         *
 
307
         * @return void
 
308
         * @param string $sCode html code to add in <head>
 
309
         */
 
310
        public function addCustomTag($sCode){           
 
311
                if(!is_null($sCode)){
 
312
                        $this->aCustomTag[] = $sCode;
 
313
                }
 
314
        }       
 
315
        
 
316
        
 
317
        /**
303
318
         * return the Html source
304
319
         * it return html code of entire object
305
320
         * 
367
382
                        foreach ($this->aFloatingJsScript as $val) {
368
383
                                $sTagHead .= "\n\t".str_replace("\n", "\n\t",$val);
369
384
                        }
 
385
                        
 
386
                        // Eventually custom tags
 
387
                        foreach ($this->aCustomTag as $val) {
 
388
                                $sTagHead .= "\n\t".str_replace("\n", "\n\t",$val);
 
389
                        }
370
390
                
371
391
                $sTagHead .= "\n</head>";
372
392