plugins/SpecialCSS.php
changeset 590 03a60844c7c5
parent 564 a1c450a911a6
child 593 4f9bec0d65c1
equal deleted inserted replaced
589:88d4ed0a2898 590:03a60844c7c5
    22  * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.
    22  * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.
    23  */
    23  */
    24  
    24  
    25 global $db, $session, $paths, $template, $plugins; // Common objects
    25 global $db, $session, $paths, $template, $plugins; // Common objects
    26 
    26 
    27 $plugins->attachHook('session_started', '
    27 $plugins->attachHook('session_started', 'SpecialCSS_paths_init();');
       
    28 
       
    29 function SpecialCSS_paths_init()
       
    30 {
    28   global $paths;
    31   global $paths;
    29     $paths->add_page(Array(
    32   $paths->add_page(Array(
    30       \'name\'=>\'specialpage_css\',
    33     'name'=>'specialpage_css',
    31       \'urlname\'=>\'CSS\',
    34     'urlname'=>'CSS',
    32       \'namespace\'=>\'Special\',
    35     'namespace'=>'Special',
    33       \'special\'=>0,\'visible\'=>0,\'comments_on\'=>0,\'protected\'=>1,\'delvotes\'=>0,\'delvote_ips\'=>\'\',
    36     'special'=>0,'visible'=>0,'comments_on'=>0,'protected'=>1,'delvotes'=>0,'delvote_ips'=>'',
    34       ));
    37     ));
    35   ');
    38 }
    36 
    39 
    37 // function names are IMPORTANT!!! The name pattern is: page_<namespace ID>_<page URLname, without namespace>
    40 // function names are IMPORTANT!!! The name pattern is: page_<namespace ID>_<page URLname, without namespace>
    38 
    41 
    39 function page_Special_CSS() {
    42 function page_Special_CSS()
       
    43 {
    40   global $db, $session, $paths, $template, $plugins; // Common objects
    44   global $db, $session, $paths, $template, $plugins; // Common objects
    41   header('Content-type: text/css');
    45   header('Content-type: text/css');
    42   if(isset($_GET['printable']) || $paths->getParam(0) == 'printable') {
    46   if ( isset($_GET['printable']) || $paths->getParam(0) == 'printable' )
       
    47   {
    43     echo $template->get_css('_printable.css');
    48     echo $template->get_css('_printable.css');
    44   } else {
    49   }
       
    50   else
       
    51   {
    45     echo $template->get_css();
    52     echo $template->get_css();
    46   }
    53   }
    47 }
    54 }
    48 
    55 
    49 ?>
    56 ?>