/[drupal]/contributions/modules/sidecontent/sidecontent.module
ViewVC logotype

Diff of /contributions/modules/sidecontent/sidecontent.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.14, Sun Apr 5 01:03:13 2009 UTC revision 1.15, Sun May 24 14:36:12 2009 UTC
# Line 1  Line 1 
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().
# Line 243  function sidecontent_nodeapi(&$node, $op Line 243  function sidecontent_nodeapi(&$node, $op
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;

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15

  ViewVC Help
Powered by ViewVC 1.1.2