| 1 |
<?php
|
| 2 |
// $Id: editview.module,v 1.6 2007/02/20 23:51:19 nterbogt Exp $
|
| 3 |
|
| 4 |
/**
|
| 5 |
* @file
|
| 6 |
* Plug-in to make an editable node view.
|
| 7 |
*/
|
| 8 |
|
| 9 |
/**
|
| 10 |
* @addtogroup editview
|
| 11 |
* @{
|
| 12 |
*/
|
| 13 |
|
| 14 |
/**
|
| 15 |
* Implementation of hook_views_api().
|
| 16 |
*/
|
| 17 |
function editview_views_api() {
|
| 18 |
return array(
|
| 19 |
'api' => 2.0,
|
| 20 |
'path' => drupal_get_path('module', 'editview') .'/includes',
|
| 21 |
);
|
| 22 |
}
|
| 23 |
|
| 24 |
/**
|
| 25 |
* Implementation of hook_help().
|
| 26 |
*/
|
| 27 |
function editview_help($path, $arg) {
|
| 28 |
switch ($path) {
|
| 29 |
case 'admin/help#editview':
|
| 30 |
return '<p>'. t('Editview is a Views plug-in that allows you to create views in which nodes are editable and new nodes can be created. Editview works with or without JavaScript enabled.') .'</pre>'."\n".
|
| 31 |
'<h3>'. t('Usage') .'</h3>'."\n".
|
| 32 |
'<p>'. t('Editable node views are created just like any other type of view, with a few caveats:') .'</p>'."\n".
|
| 33 |
'<ol>'."\n".
|
| 34 |
' <li>'. t('Add or edit a node view.') .'</li>'."\n".
|
| 35 |
' <li>'. t('If you want to be able to add new nodes in the view, set the style to Editview in Basic settings. Otherwise, you can choose any style that allows you to set a row style and set the row style to Editview.') .'</li>'."\n".
|
| 36 |
' <li>'. t('Include any required fields in the view, or new nodes will fail validation.') .'</li>'."\n".
|
| 37 |
'</ol>'."\n";
|
| 38 |
}
|
| 39 |
}
|
| 40 |
|
| 41 |
/**
|
| 42 |
* Implementation of hook_menu().
|
| 43 |
*/
|
| 44 |
function editview_menu() {
|
| 45 |
$items['editview_js'] = array(
|
| 46 |
'page callback' => 'editview_js',
|
| 47 |
'type' => MENU_CALLBACK,
|
| 48 |
'access callback' => TRUE,
|
| 49 |
'file' => 'includes/editview.views.inc',
|
| 50 |
);
|
| 51 |
return $items;
|
| 52 |
}
|
| 53 |
|
| 54 |
/**
|
| 55 |
* Implementation of hook_theme().
|
| 56 |
*/
|
| 57 |
function editview_theme() {
|
| 58 |
return array(
|
| 59 |
'editview_node_form' => array(
|
| 60 |
'arguments' => array('form' => NULL),
|
| 61 |
'file' => 'editview.theme.inc',
|
| 62 |
'path' => drupal_get_path('module', 'editview') .'/theme',
|
| 63 |
),
|
| 64 |
);
|
| 65 |
}
|
| 66 |
|
| 67 |
/**
|
| 68 |
* @} End of "addtogroup editview".
|
| 69 |
*/
|