| 1 |
<?php |
<?php |
| 2 |
// $Id: forum_access.admin.inc,v 1.22 2009/08/03 18:26:26 salvis Exp $ |
// $Id: forum_access.admin.inc,v 1.23 2009/08/27 22:58:53 salvis Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file forum_access.admin.inc |
* @file forum_access.admin.inc |
| 63 |
$form['forum_access']['permissions'][] = array( |
$form['forum_access']['permissions'][] = array( |
| 64 |
'#type' => 'markup', |
'#type' => 'markup', |
| 65 |
'#value' => '<div>'. t('Note that users need') .'<ul style="margin-top: 0"><li>'. |
'#value' => '<div>'. t('Note that users need') .'<ul style="margin-top: 0"><li>'. |
| 66 |
t('the !access_content and !access_comments permissions <strong>AND <em>View</em></strong> to be able to see content at all,', $variables) .'</li><li>'. |
t('the !access_content and !access_comments permissions <strong>AND <em>View</em></strong> to be able to see this forum and its content at all,', $variables) .'</li><li>'. |
| 67 |
t('the !create_forum_topics (and similar) permissions <strong>AND <em>Post</em></strong> to be able to create forum content, and', $variables) .'</li><li>'. |
t('the !create_forum_topics (and similar) permissions <strong>AND <em>Post</em></strong> to be able to create forum content, and', $variables) .'</li><li>'. |
| 68 |
t('the !post_comments and (probably) !post_comments_without_approval permission <strong>AND <em>Post</em></strong> to be able to post comments/replies;', $variables) .'</li><li>'. |
t('the !post_comments and (probably) !post_comments_without_approval permission <!TAG>AND <em>Post</em></!TAG> to be able to post comments/replies;', $variables + array('!TAG' => (variable_get('forum_access_D5_legacy_mode', FALSE) ? 'del title="'. t('Drupal 5 legacy mode') .'"' : 'strong'))) .'</li><li>'. |
| 69 |
t('the !edit_own_forum_topics or !edit_any_forum_topics (and similar) permissions (<strong>OR <em>Edit</em></strong>) can be added if desired, <strong>plus</strong>', $variables) .'</li><li>'. |
t('the !edit_own_forum_topics or !edit_any_forum_topics (and similar) permissions (<strong>OR <em>Edit</em></strong>) can be added if desired, <strong>plus</strong>', $variables) .'</li><li>'. |
| 70 |
t('the !delete_own_forum_topics or !delete_any_forum_topics (and similar) permissions (<strong>OR <em>Delete</em></strong>) if desired;', $variables) .'</li><li>'. |
t('the !delete_own_forum_topics or !delete_any_forum_topics (and similar) permissions (<strong>OR <em>Delete</em></strong>) if desired;', $variables) .'</li><li>'. |
| 71 |
t('the !administer_comments (global!) permission <strong>OR <em>Edit</em>/<em>Delete</em></strong> to be able to edit/delete comments;', $variables) .'</li><li>'. |
t('the !administer_comments (global!) permission <strong>OR <em>Edit</em>/<em>Delete</em></strong> to be able to edit/delete comments;', $variables) .'</li><li>'. |
| 661 |
} |
} |
| 662 |
|
|
| 663 |
/** |
/** |
| 664 |
|
* Add our settings to the forum administration settings page. |
| 665 |
|
*/ |
| 666 |
|
function _forum_access_forum_admin_settings_form(&$form, &$form_state) { |
| 667 |
|
$variables = array( |
| 668 |
|
'!Forum_Access' => 'Forum Access', |
| 669 |
|
'%View' => 'View', |
| 670 |
|
'%Post' => 'Post', |
| 671 |
|
'%post_comments' => 'post comments', |
| 672 |
|
); |
| 673 |
|
$form['forum_access'] = array( |
| 674 |
|
'#type' => 'fieldset', |
| 675 |
|
'#title' => 'Forum Access', |
| 676 |
|
'#attributes' => array('id' => 'edit-forum-admin-settings-forum-access'), |
| 677 |
|
); |
| 678 |
|
$form['forum_access']['note'] = array( |
| 679 |
|
'#type' => 'item', |
| 680 |
|
'#value' => t('Note: All other !Forum_Access controls are on the administration pages of the individual forums.', $variables), |
| 681 |
|
); |
| 682 |
|
$form['forum_access']['forum_access_D5_legacy_mode'] = array( |
| 683 |
|
'#type' => 'checkbox', |
| 684 |
|
'#title' => t('Drupal 5 legacy mode', $variables), |
| 685 |
|
'#default_value' => variable_get('forum_access_D5_legacy_mode', FALSE), |
| 686 |
|
'#description' => t('In Drupal 5, comment posting was not restricted by !Forum_Access; users with %View access (and the %post_comments permission) were always allowed to post forum comments. Starting with Drupal 6, posting comments is now restricted to users with %Post access. Turn this option on to revert to the old behavior. The default is OFF.', $variables), |
| 687 |
|
); |
| 688 |
|
$buttons = $form['buttons']; |
| 689 |
|
unset($form['buttons']); |
| 690 |
|
$form['buttons'] = $buttons; |
| 691 |
|
} |
| 692 |
|
|
| 693 |
|
/** |
| 694 |
* Helper function to retrieve the settings for a forum. |
* Helper function to retrieve the settings for a forum. |
| 695 |
*/ |
*/ |
| 696 |
function _forum_access_get_settings($tid = NULL) { |
function _forum_access_get_settings($tid = NULL) { |