[ Index ] |
|
Code source de Serendipity 1.2 |
1 <?php # $Id: serendipity_event_browsercompatibility.php 1528 2006-12-01 08:58:47Z garvinhicking $ 2 3 4 if (IN_serendipity !== true) { 5 die ("Don't hack!"); 6 } 7 8 // Probe for a language include with constants. Still include defines later on, if some constants were missing 9 $probelang = dirname(__FILE__) . '/' . $serendipity['charset'] . 'lang_' . $serendipity['lang'] . '.inc.php'; 10 if (file_exists($probelang)) { 11 include $probelang; 12 } 13 14 include dirname(__FILE__) . '/lang_en.inc.php'; 15 16 class serendipity_event_browsercompatibility extends serendipity_event 17 { 18 var $title = PLUGIN_EVENT_BROWSERCOMPATIBILITY_TITLE; 19 20 function introspect(&$propbag) 21 { 22 global $serendipity; 23 24 $propbag->add('name', PLUGIN_EVENT_BROWSERCOMPATIBILITY_TITLE); 25 $propbag->add('description', PLUGIN_EVENT_BROWSERCOMPATIBILITY_DESC); 26 $propbag->add('stackable', false); 27 $propbag->add('author', 'Garvin Hicking'); 28 $propbag->add('requirements', array( 29 'serendipity' => '0.8', 30 'smarty' => '2.6.7', 31 'php' => '4.1.0' 32 )); 33 $propbag->add('version', '1.1'); 34 $propbag->add('event_hooks', array( 35 'css' => true, 36 'css_backend' => true, 37 'external_plugin' => true, 38 )); 39 $propbag->add('groups', array('BACKEND_TEMPLATES')); 40 } 41 42 function generate_content(&$title) { 43 $title = PLUGIN_EVENT_BROWSERCOMPATIBILITY_TITLE; 44 } 45 46 function event_hook($event, &$bag, &$eventData) { 47 global $serendipity; 48 49 $hooks = &$bag->get('event_hooks'); 50 if (isset($hooks[$event])) { 51 switch($event) { 52 case 'css_backend': 53 case 'css': 54 ?> 55 img { 56 behavior: url("<?php echo $serendipity['baseURL'] . ($serendipity['rewrite'] == 'none' ? $serendipity['indexFile'] . '?/' : ''); ?>plugin/pngbehavior.htc"); 57 } 58 <?php 59 return true; 60 break; 61 62 case 'external_plugin': 63 switch($eventData) { 64 case 'pngbehavior.htc': 65 header('Content-Type: text/x-component'); 66 echo str_replace('{blanksrc}', serendipity_getTemplateFile('img/blank.gif'), file_get_contents(dirname(__FILE__) . '/pngbehavior.htc')); 67 return true; 68 } 69 return true; 70 break; 71 72 default: 73 return false; 74 break; 75 } 76 } else { 77 return false; 78 } 79 } 80 } 81 82 /* vim: set sts=4 ts=4 expandtab : */ 83 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sat Nov 24 09:00:37 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |