| [ Index ] |
PHP Cross Reference of Quick Form DataBase |
[Summary view] [Print] [Text view]
1 <?php 2 if (!defined('QFDB_SECURITY')) { 3 die("You can't access this file directly..."); 4 } 5 6 7 /** 8 * Struct QFDB Object: print LINK Tags to insert extern .css file in the Document 9 * 10 * @author Everaldo Wanderlei Uavniczak <everaldouav [at] gmail.com> 11 * @since 0.5 12 * @package quickformdb 13 * @see http://www.qfdb.net/ 14 * @link http://www.w3.org/TR/CSS2/media.html 15 * @link http://w3schools.com/tags/tag_link.asp 16 * @license BSD License <http://www.qfdb.net/bsd_license.txt> 17 */ 18 19 20 21 class qfdbobj_headcss { 22 23 public static function obj_struct(&$qfdb) 24 { 25 $qfdb->m['object'] = 'headcss'; // string (fixed) 26 $qfdb->m['status'] = '12345'; // string 27 $qfdb->m['if'] = ''; // string 28 $qfdb->m['alias'] = ''; // string 29 30 $qfdb->m['href'] = ''; // string 31 $qfdb->m['media'] = ''; // string 32 $qfdb->m['others'] = ''; // string 33 $qfdb->m['cache'] = 'true'; // string 34 35 $qfdb->m['object_properties'] = count($qfdb->m) +2; // int 36 } // end obj_struct() 37 38 39 40 public static function obj_html(&$qfdb) 41 { 42 if ($qfdb->m['cache'] === 'false') { 43 // generate key to force reloading css file 44 $key = '?'.substr( md5(microtime()), 0, 7); 45 } else { 46 $key = ''; 47 } 48 49 $object = ''; 50 51 // generate default properties for all files defined in 'hfef' properties 52 $aux = ' <link rel="stylesheet" type="text/css"'; 53 if ($qfdb->m['media']) { 54 $aux .= ' media="'.$qfdb->m['media'].'"'; 55 } 56 if ($qfdb->m['others']) { 57 $aux .= ' '.$qfdb->m['others']; 58 } 59 60 $ar_aux = explode('&&&', $qfdb->m['href']); 61 foreach ($ar_aux as $cssfile) { 62 $object .= $aux.' href="'.trim($cssfile).$key.'" />'."\n"; 63 } 64 65 $qfdb->add_output('html', $object); 66 } // end obj_html() 67 68 69 70 public static function obj_db(&$qfdb) 71 { 72 self::obj_html($qfdb); 73 } // end obj_db() 74 75 76 77 public static function obj_debug(&$qfdb) 78 { 79 } // end obj_debug() 80 81 82 83 public static function obj_fixed(&$qfdb) 84 { 85 if ($qfdb->m['cache'] !== 'false') { 86 $qfdb->m['cache'] = 'true'; 87 } 88 } // end obj_fixed() 89 90 } // end class
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Fri Nov 14 17:48:13 2008 | Cross-referenced by PHPXref 0.7 |