| 1 |
<?php |
<?php |
| 2 |
// $Id: publishcontent.module,v 1.5.2.3 2009/03/19 05:49:49 malaussene Exp $ |
// $Id: publishcontent.module,v 1.5.2.4 2009/03/19 05:54:26 malaussene Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 162 |
function publishcontent_views_handler_node_publish_destination($fieldinfo, $fielddata, $value, $data) { |
function publishcontent_views_handler_node_publish_destination($fieldinfo, $fielddata, $value, $data) { |
| 163 |
return publishcontent_views_handler_node_publish($fieldinfo, $fielddata, $value, $data, drupal_get_destination()); |
return publishcontent_views_handler_node_publish($fieldinfo, $fielddata, $value, $data, drupal_get_destination()); |
| 164 |
} |
} |
| 165 |
|
|
| 166 |
|
/** |
| 167 |
|
* Implementation of hook_form_alter() |
| 168 |
|
* |
| 169 |
|
* allow to use the 'Publishing options' on the edit/add page |
| 170 |
|
*/ |
| 171 |
|
function publishcontent_form_alter($form_id, &$form) { |
| 172 |
|
if (!user_access('administer nodes') |
| 173 |
|
&& $form['type']['#value'] .'_node_form' == $form_id |
| 174 |
|
&& (_publishcontent_unpublish_access($form['#node']) || |
| 175 |
|
_publishcontent_publish_access($form['#node']))) { |
| 176 |
|
$form['options']['#access'] = TRUE; |
| 177 |
|
unset($form['options']['promote']); |
| 178 |
|
unset($form['options']['sticky']); |
| 179 |
|
unset($form['options']['revision']); |
| 180 |
|
} |
| 181 |
|
} |