| 1 |
<?php |
<?php |
| 2 |
// $Id: sidecontent.module,v 1.13.2.2 2007/07/03 22:55:25 MegaGrunt Exp $ |
// $Id: sidecontent.module,v 1.14 2009/04/05 01:03:13 MegaGrunt Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* Implementation of hook_perm(). |
* Implementation of hook_perm(). |
| 243 |
case 'view': |
case 'view': |
| 244 |
|
|
| 245 |
// add sidecontent into print view pages |
// add sidecontent into print view pages |
| 246 |
if (arg(2) == 'print' && !empty($node->sidecontent)) { |
if (arg(0) == 'print' && !empty($node->sidecontent)) { |
| 247 |
|
|
| 248 |
$print = variable_get('sidecontent_print', false); |
$print = variable_get('sidecontent_print', false); |
| 249 |
if (empty($print)) break; |
if (empty($print)) break; |
| 250 |
|
|
| 251 |
// does user have access to view sidecontent? |
// does user have access to view sidecontent? |
| 252 |
if (!user_access('access side content') && !user_access('create side content' )) break; |
if (!user_access('access side content') && !user_access('create side content' )) break; |
| 253 |
|
|
| 254 |
|
// is the print module enabled |
| 255 |
|
if (!module_exists('print')) break; |
| 256 |
|
|
| 257 |
$sidecontent = check_markup($node->sidecontent, $node->format); |
$sidecontent = check_markup($node->sidecontent, $node->format); |
| 258 |
|
|
| 259 |
// note: print module disregards theme, so we have to include our markup here - yuuk! |
// note: print module disregards theme, so we have to include our markup here - yuuk! |
| 260 |
$node->content['sidecontent'] = array( |
$node->content['sidecontent'] = array('#value' => '<div class="sidecontent-print">' . $sidecontent . '</div>', |
|
'#value' => '<div class="sidecontent-print">' . $sidecontent . '</div>', |
|
| 261 |
'#weight' => -10, |
'#weight' => -10, |
| 262 |
); |
); |
| 263 |
} |
} |
| 264 |
|
|
| 265 |
break; |
break; |