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

Diff of /contributions/modules/authorship/authorship.module

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

revision 1.6, Thu Apr 12 05:39:52 2007 UTC revision 1.7, Thu Jul 12 22:21:22 2007 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: authorship.module,v 1.5 2007/04/11 01:10:29 lafo Exp $  // $Id: authorship.module,v 1.4.2.5 2007/07/12 22:09:08 karpuz Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 47  function authorship_form_alter($form_id, Line 47  function authorship_form_alter($form_id,
47    global $user;    global $user;
48    
49    _authorship_debug("authorship_form_alter(" . $form['#node']->nid . ")");    _authorship_debug("authorship_form_alter(" . $form['#node']->nid . ")");
   /*ajk($form);  
   ajk($form_id);*/  
50    
51    if ($form_id == 'node_type_form' && isset($form['#node_type'])) {    if ($form_id == 'node_type_form' && isset($form['#node_type'])) {
52      $form['workflow']['authorship']['authorship_markup_'. $form['#node_type']->type] = array(      $form['workflow']['authorship']['authorship_markup_'. $form['#node_type']->type] = array(
# Line 164  function authorship_nodeapi(&$node, $op, Line 162  function authorship_nodeapi(&$node, $op,
162          }          }
163        }        }
164        break; // end 'view'        break; // end 'view'
165        case 'update index':
166          return db_result(db_query("SELECT authorship FROM {node_authorship} WHERE nid = %d", $node->nid));
167          break;
168    
169    } // end switch    } // end switch
170  }  }
171  /* }}} */  /* }}} */
# Line 252  function _authorship_debug($s) { Line 254  function _authorship_debug($s) {
254  }  }
255  /* }}} */  /* }}} */
256    
257  ?>  /**
258     * Implementation of hook_views_tables()
259     * (see Views module)
260     */
261    function authorship_views_tables() {
262      $tables['node_authorship'] = array(
263        'join' => array(
264          'left' => array(
265            'table' => 'node',
266            'field' => 'nid',
267          ),
268          'right' => array(
269            'field' => 'nid',
270          ),
271        ),
272        'fields' => array(
273          'authorship' => array(
274            'name' => t('Node: Authorship'),
275            'sortable' => true,
276            'help' => t('Display the authorship display setting for the node.'),
277          ),
278        ),
279        'sorts' => array(
280          'authorship' => array(
281            'name' => t('Node: Authorship'),
282            'help' => t('Sort by the node authorship, alphabetically'),
283          ),
284        ),
285        'filters' => array(
286          'authorship' => array(
287            'name' => t('Node: Authorship'),
288            'operator' => 'views_handler_operator_like',
289            'handler' => 'views_handler_filter_like',
290            'help' => t('Sort by the node authorship, alphabetically'),
291          ),
292        ),
293      );
294      return $tables;
295    }
296    

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

  ViewVC Help
Powered by ViewVC 1.1.2