| 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 |
| 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( |
| 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 |
/* }}} */ |
/* }}} */ |
| 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 |
|
|