source: trunk/prototype/modules/calendar/assetic_css.php @ 7664

Revision 7664, 2.5 KB checked in by angelo, 11 years ago (diff)

Ticket #3241 - Remover warning de tipo de arquivo na requisicao do assetic

Line 
1<?php
2header("Content-Type: text/css");
3use Assetic\Asset\AssetCache;
4use Assetic\Cache\FilesystemCache;
5use Assetic\Asset\AssetCollection;
6use Assetic\Asset\FileAsset;
7use Assetic\Asset\GlobAsset;
8use Assetic\Filter\Yui;
9use Assetic\FilterManager;
10use Assetic\Filter;
11
12spl_autoload_register(
13    function($className)
14    {
15        $className = str_replace("_", "\\", $className);
16        $className = ltrim($className, '\\');
17        $fileName = '';
18        $namespace = '';
19        if ($lastNsPos = strripos($className, '\\'))
20        {
21            $namespace = substr($className, 0, $lastNsPos);
22            $className = substr($className, $lastNsPos + 1);
23            $fileName = '../../library/' . str_replace('\\', DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR;
24        }
25        $fileName .= str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php';
26
27        require $fileName;
28    }
29);
30
31define( 'MODULESURL' , '../../modules/calendar' );
32define( 'PLUGINSURL' , '../../plugins' );
33$javaVersion = shell_exec("java -version 2>&1");
34$filterManager = new FilterManager();
35$compressor = new Yui\CssCompressorFilter('../../library/yuicompressor/yuicompressor.jar');
36$compressor->setCharset("ISO-8859-1");
37
38$css = new AssetCollection(array(
39        //new FileAsset(MODULESURL.'/css/reset.css'),
40        //new FileAsset(PLUGINSURL.'/fullcalendar/fullcalendar.css'),
41        new FileAsset(PLUGINSURL.'/fullcalendar/fullcalendar.print.css'),
42        //new FileAsset(PLUGINSURL.'/jquery/jquery-ui.css'),
43        new FileAsset(PLUGINSURL.'/icalendar/jquery.icalendar.css'),
44        //new FileAsset(PLUGINSURL.'/fgmenu/fg.menu.css'),
45        new FileAsset(PLUGINSURL.'/fileupload/jquery.fileupload-ui.css'),
46        new FileAsset(PLUGINSURL.'/jquery.pagination/pagination.css'),
47        new FileAsset(PLUGINSURL.'/jpicker/css/jPicker-1.1.6.min.css'),
48        new FileAsset(PLUGINSURL.'/jpicker/jPicker.css'),
49        new FileAsset(PLUGINSURL.'/farbtastic/farbtastic.css'),
50        new FileAsset(PLUGINSURL.'/timepicker/jquery-ui-timepicker-addon.css'),
51        //new FileAsset(PLUGINSURL.'/zebradialog/css/zebra_dialog.css'),
52        new FileAsset(PLUGINSURL.'/jquery.spinner/jquery.spinner.css')
53        //new FileAsset(MODULESURL.'/css/layout.css'),
54        //new FileAsset(MODULESURL.'/css/style.css')
55    )
56);
57
58if (strpos($javaVersion,"java version") !== false){
59    $filterManager->set('yui_css', $compressor);   
60    $css->ensureFilter($filterManager->get('yui_css'));   
61}
62
63$cssCache = new AssetCache($css,new FilesystemCache('/tmp'));
64echo $cssCache->dump();
65
66?>
Note: See TracBrowser for help on using the repository browser.