/[drupal]/contributions/modules/storm/stormorganization/stormorganization.module
ViewVC logotype

Diff of /contributions/modules/storm/stormorganization/stormorganization.module

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

revision 1.10, Mon Jun 23 16:46:35 2008 UTC revision 1.11, Tue Jul 1 07:47:42 2008 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: stormorganization.module,v 1.9 2008/06/18 15:25:01 robertogerola Exp $  // $Id: stormorganization.module,v 1.10 2008/06/23 16:46:35 robertogerola Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 33  function stormorganization_perm() { Line 33  function stormorganization_perm() {
33                );                );
34  }  }
35    
 function stormorganization_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {  
   switch ($op) {  
     case 'view':  
       global $user;  
       if (!stormorganization_access('view', $node, $user)) {  
         $node = NULL;  
       }  
       break;  
   }  
 }  
   
36  function stormorganization_access($op, $node, $account) {  function stormorganization_access($op, $node, $account) {
37    if (is_numeric($node)) $node = node_load($node);    if (is_numeric($node)) $node = node_load($node);
38    
# Line 394  function stormorganization_view($node, $ Line 383  function stormorganization_view($node, $
383    
384  function stormorganization_form_alter(&$form, $form_state, $form_id) {  function stormorganization_form_alter(&$form, $form_state, $form_id) {
385    if ($form_id == 'storm_admin_settings') {    if ($form_id == 'storm_admin_settings') {
386      $s = "SELECT n.nid, n.title FROM {stormorganization} so INNER JOIN {node} n ON so.nid=n.nid WHERE n.status=1 AND n.type='stormorganization' ORDER BY n.title";      $s = "SELECT n.nid, n.title FROM  {node} AS n INNER JOIN {stormorganization} AS sor ON sor.nid=n.nid WHERE n.status=1 AND n.type='stormorganization' ORDER BY n.title";
387        $s = db_rewrite_sql($s);
388      $r = db_query(stormorganization_access_sql($s));      $r = db_query(stormorganization_access_sql($s));
389      $organizations = array();      $organizations = array();
390      while ($organization = db_fetch_object($r)) {      while ($organization = db_fetch_object($r)) {

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11

  ViewVC Help
Powered by ViewVC 1.1.2