0
+ − 1
<?php
+ − 2
/*
+ − 3
Plugin Name: CSS Backend
23
+ − 4
Plugin URI: http://enanocms.org/
0
+ − 5
Description: Provides the page Special:CSS, which is used in template files to reference the style sheet. Disabling or deleting this plugin will result in site instability.
+ − 6
Author: Dan Fuhry
317
+ − 7
Version: 1.0.3
23
+ − 8
Author URI: http://enanocms.org/
0
+ − 9
*/
+ − 10
+ − 11
/*
+ − 12
* Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
317
+ − 13
* Version 1.0.3
0
+ − 14
* Copyright (C) 2006-2007 Dan Fuhry
+ − 15
*
+ − 16
* This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
+ − 17
* as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
+ − 18
*
+ − 19
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ − 20
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.
+ − 21
*/
+ − 22
+ − 23
global $db, $session, $paths, $template, $plugins; // Common objects
+ − 24
334
c72b545f1304
More localization work. Resolved major issue with JSON parser not parsing files over ~50KB. Switched JSON parser to the one from the Zend Framework (BSD licensed). Forced to split enano.json into five different files.
Dan
diff
changeset
+ − 25
$plugins->attachHook('session_started', '
0
+ − 26
global $paths;
+ − 27
$paths->add_page(Array(
334
c72b545f1304
More localization work. Resolved major issue with JSON parser not parsing files over ~50KB. Switched JSON parser to the one from the Zend Framework (BSD licensed). Forced to split enano.json into five different files.
Dan
diff
changeset
+ − 28
\'name\'=>\'specialpage_css\',
0
+ − 29
\'urlname\'=>\'CSS\',
+ − 30
\'namespace\'=>\'Special\',
+ − 31
\'special\'=>0,\'visible\'=>0,\'comments_on\'=>0,\'protected\'=>1,\'delvotes\'=>0,\'delvote_ips\'=>\'\',
+ − 32
));
+ − 33
');
+ − 34
+ − 35
// function names are IMPORTANT!!! The name pattern is: page_<namespace ID>_<page URLname, without namespace>
+ − 36
+ − 37
function page_Special_CSS() {
+ − 38
global $db, $session, $paths, $template, $plugins; // Common objects
+ − 39
header('Content-type: text/css');
+ − 40
if(isset($_GET['printable']) || $paths->getParam(0) == 'printable') {
+ − 41
echo $template->get_css('_printable.css');
+ − 42
} else {
+ − 43
echo $template->get_css();
+ − 44
}
+ − 45
}
+ − 46
+ − 47
?>