| 1 |
<?php
|
| 2 |
// $Id: pjirc.module,v 1.9.2.8 2009/08/23 13:29:24 ruharen Exp $
|
| 3 |
|
| 4 |
/**
|
| 5 |
* @file
|
| 6 |
* Pjirc integration module
|
| 7 |
*
|
| 8 |
* Allows you to have a PJIRC chat applet in your drupal.
|
| 9 |
*/
|
| 10 |
|
| 11 |
|
| 12 |
/**
|
| 13 |
* Implementation of hook_help().
|
| 14 |
*/
|
| 15 |
function pjirc_help($path, $arg) {
|
| 16 |
switch ($path) {
|
| 17 |
case 'admin/help#pjirc':
|
| 18 |
$output = '<p>'. t('This module will display an <a href="@pjirc">IRC chatroom</a> to users with the correct <a href="@permissions">permissions</a>.', array("@permissions" => url("admin/user/permission"), "@pjirc" => url("pjirc"))) ."</p>\n";
|
| 19 |
$output .='<p>'. t('To enable its use, a user needs the "access pjirc" permission.') ."</p>\n";
|
| 20 |
$output .='<p>'. t('You can set the server, room and guest name from the <a href="@settings">pjirc settings page</a> as long as other settings.', array('@settings' => url('admin/settings/pjirc'))) ."</p>\n";
|
| 21 |
$output .='<p>'. t('To enable its use, a user needs the "access irc" permission.') ."</p>\n";
|
| 22 |
break;
|
| 23 |
case 'admin/modules#description':
|
| 24 |
$output = t('Allows you to have an IRC page using PJIRC.');
|
| 25 |
break;
|
| 26 |
}
|
| 27 |
return $output;
|
| 28 |
}
|
| 29 |
|
| 30 |
/**
|
| 31 |
* Implementation of hook_perm().
|
| 32 |
*/
|
| 33 |
function pjirc_perm() {
|
| 34 |
return array('access irc', 'administer pjirc');
|
| 35 |
}
|
| 36 |
|
| 37 |
/**
|
| 38 |
* Implementation of hook_menu().
|
| 39 |
*/
|
| 40 |
function pjirc_menu() {
|
| 41 |
$items['admin/settings/pjirc'] = array(
|
| 42 |
'title' => 'PJIRC Configuration',
|
| 43 |
'description' => 'Allows you to have an IRC page using PJIRC.',
|
| 44 |
'page callback' => 'drupal_get_form',
|
| 45 |
'page arguments' => array('pjirc_admin'),
|
| 46 |
'access callback' => 'user_access',
|
| 47 |
'access arguments' => array('administer pjirc'),
|
| 48 |
'type' => MENU_NORMAL_ITEM,
|
| 49 |
'weight' => 0,
|
| 50 |
'file' => 'pjirc.admin.inc.php',
|
| 51 |
);
|
| 52 |
$items['pjirc'] = array(
|
| 53 |
'title' => 'Chat Room',
|
| 54 |
'description' => 'PJIRC chatroom',
|
| 55 |
'page callback' => 'pjirc_page',
|
| 56 |
'access callback' => 'user_access',
|
| 57 |
'access arguments' => array('access irc'),
|
| 58 |
'weight' => 0,
|
| 59 |
'file' => 'pjirc.page.inc.php',
|
| 60 |
);
|
| 61 |
|
| 62 |
return $items;
|
| 63 |
}
|
| 64 |
|
| 65 |
/**
|
| 66 |
* Implementation of hook_enable().
|
| 67 |
*/
|
| 68 |
function pjirc_enable() {
|
| 69 |
drupal_set_message(t('Pjirc module enabled. You can now configure Pjirc module at !pjirc_settings.', array('!pjirc_settings' => l('admin/settings/pjirc', 'admin/settings/pjirc'))));
|
| 70 |
}
|
| 71 |
/**
|
| 72 |
* Implementation of hook_disable().
|
| 73 |
*/
|
| 74 |
function pjirc_disable() {
|
| 75 |
drupal_set_message(t('Pjirc module disabled. If you want to delete it, please !uninstall first.', array('!uninstall' => l(t('uninstall'), 'admin/build/modules/uninstall'))));
|
| 76 |
}
|
| 77 |
|