--- pjirc.module	2007-03-23 14:42:30.000000000 -0700
+++ pjircnew.module	2007-05-26 23:53:43.000000000 -0700
@@ -1,165 +1,166 @@
-<?php
-
-/**
- * Implementation of hook_help().
- */
-function pjirc_help($section = 'admin/help#pjirc') {
-  switch ($section) {
-    case 'admin/help#pjirc':
-      $output = t("
-          <p>This module will display an <a href=\"%pjirc\">IRC chatroom</a> to users with the correct <a href=\"%permissions\">permissions</a>.</p>
-          <p>To enable its use, a user needs the \"access pjirc\" permission.</p>
-          <p>You can set the server, room and guest name from the <a href=\"%settings\">pjirc settings page</a>.</p>
-          <p>To enable its use, a user needs the \"access irc\" permission.</p>",
-         array("%permissions" => url("admin/user/permission"), "%settings" => url("admin/settings/pjirc"), "%pjirc" => url("pjirc")));
-      break;
-    case 'admin/modules#description':
-      $output = t("Allows you to have an IRC page using PJIRC.");
-      break;
-  }
-  return $output;
-}
-
-/**
- * Implementation of hook_perm().
- */
-function pjirc_perm()
-{
-  return array ("access irc");
-}
-
-/**
- * Implementation of hook_settings().
- */
-function pjirc_admin() {
-
-  $form['pjirc_nav_link'] = array(
-    '#type' => 'textfield',
-    '#title' => t('Navigation link text'),
-    '#default_value' => variable_get('pjirc_nav_link','chatroom'),
-    '#size' => 80,
-    '#maxlength' => 300,
-    '#description' => t('The text that will be shown in the navigation link'),
-  );
-
-  $form['pjirc_nick'] = array(
-    '#type' => 'textfield',
-    '#title' => t('Guest Nick Name'),
-    '#default_value' => variable_get('pjirc_nick','Guest'),
-    '#size' => 20,
-    '#maxlength' => 255,
-    '#description' => t('The username assigned to guests who have not logged into Drupal'),
-  );
-
-  $form['pjirc_server'] = array(
-    '#type' => 'textfield',
-    '#title' => t('IRC Server'),
-    '#default_value' => variable_get('pjirc_server','irc.freenode.net'),
-    '#size' => 20,
-    '#maxlength' => 255,
-    '#description' => t('The IP address or hostname of the IRC server you are connecting to.'),
-  );
-
-  $form['pjirc_room'] = array(
-    '#type' => 'textfield',
-    '#title' => t('IRC Room'),
-    '#default_value' => variable_get('pjirc_room', ''),
-    '#size' => 20,
-    '#maxlength' => 255,
-    '#description' => t('The IRC room you want to join initially.  Should start with a # (eg: #myroom).'),
-  );
-
-  return system_settings_form($form);
-
-}
-
-/**
- * Implementation of hook_menu().
- */
-function pjirc_menu($may_cache) {
-  global $user;
-  $items = array();
-  if ($may_cache) {
-
-    $items[] = array(
-      'path' => 'admin/settings/pjirc',
-      'title' => t("PJIRC Settings"),
-      'callback' => 'drupal_get_form',
-      'callback arguments' => array('pjirc_admin'),
-      'access' => user_access('access administration pages'),
-      'type' => MENU_NORMAL_ITEM,
-      'weight'   => 0);
-
-    $items[] = array(
-      'path' => 'pjirc',
-      'title' => t(variable_get("pjirc_nav_link", "chatroom")),
-      'callback' => 'pjirc_page',
-      'access' => user_access('access irc'),
-      'weight'   => 0);
-  }
-  return $items;
-}
-
-/**
- * Menu callback; displays a Drupal page PJIRC chatroom.
- */
-function pjirc_page() {
-  $pjirc_nick = $user->uid ? $user->name : variable_get('pjirc_nick','Guest');
-  $pjirc_server = variable_get('pjirc_server','');
-  $pjirc_room = variable_get('pjirc_room','');
-  $output  = "<div align=\"center\">\n";
-  $output .= "<applet codebase=modules/pjirc/pjirc/ code=IRCApplet.class archive=\"irc.jar,pixx.jar\" width=500 height=400>\n";
-  $output .= "<param name=\"CABINETS\" value=\"irc.cab,securedirc.cab,pixx.cab\">\n";
-  $output .= "<param name=\"nick\" value=\"".$pjirc_nick."\">\n";
-  $output .= "<param name=\"alternatenick\" value=\"".$pjirc_nick."???\">\n";
-  $output .= "<param name=\"name\" value=\"Java User\">\n";
-  $output .= "<param name=\"gui\" value=\"pixx\">\n";
-  $output .= "<param name=\"host\" value=\"".$pjirc_server."\">\n";
-  $output .= "<param name=\"command1\" value=\"/join ".$pjirc_room."\">\n";
-  $output .= "<param name=\"pixx:language\" value=\"pixx-english\">\n";
-  $output .= "<param name=\"language\" value=\"english\">\n";
-  $output .= "<param name=\"style:bitmapsmileys\" value=\"true\">\n";
-  $output .= "<param name=\"style:smiley1\" value=\":) img/sourire.gif\">\n";
-  $output .= "<param name=\"style:smiley2\" value=\":-) img/sourire.gif\">\n";
-  $output .= "<param name=\"style:smiley3\" value=\":-D img/content.gif\">\n";
-  $output .= "<param name=\"style:smiley4\" value=\":d img/content.gif\">\n";
-  $output .= "<param name=\"style:smiley5\" value=\":-O img/OH-2.gif\">\n";
-  $output .= "<param name=\"style:smiley6\" value=\":o img/OH-1.gif\">\n";
-  $output .= "<param name=\"style:smiley7\" value=\":-P img/langue.gif\">\n";
-  $output .= "<param name=\"style:smiley8\" value=\":p img/langue.gif\">\n";
-  $output .= "<param name=\"style:smiley9\" value=\";-) img/clin-oeuil.gif\">\n";
-  $output .= "<param name=\"style:smiley10\" value=\";) img/clin-oeuil.gif\">\n";
-  $output .= "<param name=\"style:smiley11\" value=\":-( img/triste.gif\">\n";
-  $output .= "<param name=\"style:smiley12\" value=\":( img/triste.gif\">\n";
-  $output .= "<param name=\"style:smiley13\" value=\":-| img/OH-3.gif\">\n";
-  $output .= "<param name=\"style:smiley14\" value=\":| img/OH-3.gif\">\n";
-  $output .= "<param name=\"style:smiley15\" value=\":'( img/pleure.gif\">\n";
-  $output .= "<param name=\"style:smiley16\" value=\":$ img/rouge.gif\">\n";
-  $output .= "<param name=\"style:smiley17\" value=\":-$ img/rouge.gif\">\n";
-  $output .= "<param name=\"style:smiley18\" value=\"(H) img/cool.gif\">\n";
-  $output .= "<param name=\"style:smiley19\" value=\"(h) img/cool.gif\">\n";
-  $output .= "<param name=\"style:smiley20\" value=\":-@ img/enerve1.gif\">\n";
-  $output .= "<param name=\"style:smiley21\" value=\":@ img/enerve2.gif\">\n";
-  $output .= "<param name=\"style:smiley22\" value=\":-S img/roll-eyes.gif\">\n";
-  $output .= "<param name=\"style:smiley23\" value=\":s img/roll-eyes.gif\">\n";
-  $output .= "<param name=\"style:backgroundimage\" value=\"true\">\n";
-  $output .= "<param name=\"style:backgroundimage1\" value=\"all all 0 background.gif\">\n";
-  $output .= "<param name=\"style:sourcefontrule1\" value=\"all all Serif 12\">\n";
-  $output .= "<param name=\"style:floatingasl\" value=\"true\">\n";
-  $output .= "<param name=\"pixx:timestamp\" value=\"true\">\n";
-  $output .= "<param name=\"pixx:highlight\" value=\"true\">\n";
-  $output .= "<param name=\"pixx:highlightnick\" value=\"true\">\n";
-  $output .= "<param name=\"pixx:nickfield\" value=\"true\">\n";
-  $output .= "<param name=\"pixx:styleselector\" value=\"true\">\n";
-  $output .= "<param name=\"pixx:setfontonstyle\" value=\"true\">\n";
-  $output .= "</applet>\n";
-  $output .= "<br /><br /><a href=\"http://www.java.com/en/download/\" target=\"_blank\">If the applet does not display then click here to download a Java client.</a>\n";
-  $output .= "<br /><br />You can also connect using any IRC client (such as <a href=\"http://www.mirc.com/\">MIRC</a>) using the following:<br />\n";
-  $output .= "HOST: ".$pjirc_server."\n";
-  $output .= "CHANNEL: ".$pjirc_room."\n";
-  $output .= "</div>\n";
-
-  print theme('page', $output);
-}
-
-?>
+<?php
+
+/**
+ * Implementation of hook_help().
+ */
+function pjirc_help($section = 'admin/help#pjirc') {
+  switch ($section) {
+    case 'admin/help#pjirc':
+      $output = t("
+          <p>This module will display an <a href=\"%pjirc\">IRC chatroom</a> to users with the correct <a href=\"%permissions\">permissions</a>.</p>
+          <p>To enable its use, a user needs the \"access pjirc\" permission.</p>
+          <p>You can set the server, room and guest name from the <a href=\"%settings\">pjirc settings page</a>.</p>
+          <p>To enable its use, a user needs the \"access irc\" permission.</p>",
+         array("%permissions" => url("admin/user/permission"), "%settings" => url("admin/settings/pjirc"), "%pjirc" => url("pjirc")));
+      break;
+    case 'admin/modules#description':
+      $output = t("Allows you to have an IRC page using PJIRC.");
+      break;
+  }
+  return $output;
+}
+
+/**
+ * Implementation of hook_perm().
+ */
+function pjirc_perm()
+{
+  return array ("access irc");
+}
+
+/**
+ * Implementation of hook_settings().
+ */
+function pjirc_admin() {
+
+  $form['pjirc_nav_link'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Navigation link text'),
+    '#default_value' => variable_get('pjirc_nav_link','chatroom'),
+    '#size' => 80,
+    '#maxlength' => 300,
+    '#description' => t('The text that will be shown in the navigation link'),
+  );
+
+  $form['pjirc_nick'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Guest Nick Name'),
+    '#default_value' => variable_get('pjirc_nick','Guest'),
+    '#size' => 20,
+    '#maxlength' => 255,
+    '#description' => t('The username assigned to guests who have not logged into Drupal'),
+  );
+
+  $form['pjirc_server'] = array(
+    '#type' => 'textfield',
+    '#title' => t('IRC Server'),
+    '#default_value' => variable_get('pjirc_server','irc.freenode.net'),
+    '#size' => 20,
+    '#maxlength' => 255,
+    '#description' => t('The IP address or hostname of the IRC server you are connecting to.'),
+  );
+
+  $form['pjirc_room'] = array(
+    '#type' => 'textfield',
+    '#title' => t('IRC Room'),
+    '#default_value' => variable_get('pjirc_room', ''),
+    '#size' => 20,
+    '#maxlength' => 255,
+    '#description' => t('The IRC room you want to join initially.  Should start with a # (eg: #myroom).'),
+  );
+
+  return system_settings_form($form);
+
+}
+
+/**
+ * Implementation of hook_menu().
+ */
+function pjirc_menu($may_cache) {
+  global $user;
+  $items = array();
+  if ($may_cache) {
+
+    $items[] = array(
+      'path' => 'admin/settings/pjirc',
+      'title' => t("PJIRC Settings"),
+      'callback' => 'drupal_get_form',
+      'callback arguments' => array('pjirc_admin'),
+      'access' => user_access('access administration pages'),
+      'type' => MENU_NORMAL_ITEM,
+      'weight'   => 0);
+
+    $items[] = array(
+      'path' => 'pjirc',
+      'title' => t(variable_get("pjirc_nav_link", "chatroom")),
+      'callback' => 'pjirc_page',
+      'access' => user_access('access irc'),
+      'weight'   => 0);
+  }
+  return $items;
+}
+
+/**
+ * Menu callback; displays a Drupal page PJIRC chatroom.
+ */
+function pjirc_page() {
+  $pjirc_nick = $user->uid ? $user->name : variable_get('pjirc_nick','Guest');
+  $pjirc_server = variable_get('pjirc_server','');
+  $pjirc_room = variable_get('pjirc_room','');
+  $pjirc_mod_path = drupal_get_path('module', 'pjirc');
+  $output  = "<div align=\"center\">\n"; 
+  $output .= "<applet codebase=".$pjirc_mod_path."/pjirc/ code=IRCApplet.class archive=\"irc.jar,pixx.jar\" width=500 height=400>\n";
+  $output .= "<param name=\"CABINETS\" value=\"irc.cab,securedirc.cab,pixx.cab\">\n";
+  $output .= "<param name=\"nick\" value=\"".$pjirc_nick."\">\n";
+  $output .= "<param name=\"alternatenick\" value=\"".$pjirc_nick."???\">\n";
+  $output .= "<param name=\"name\" value=\"Java User\">\n";
+  $output .= "<param name=\"gui\" value=\"pixx\">\n";
+  $output .= "<param name=\"host\" value=\"".$pjirc_server."\">\n";
+  $output .= "<param name=\"command1\" value=\"/join ".$pjirc_room."\">\n";
+  $output .= "<param name=\"pixx:language\" value=\"pixx-english\">\n";
+  $output .= "<param name=\"language\" value=\"english\">\n";
+  $output .= "<param name=\"style:bitmapsmileys\" value=\"true\">\n";
+  $output .= "<param name=\"style:smiley1\" value=\":) img/sourire.gif\">\n";
+  $output .= "<param name=\"style:smiley2\" value=\":-) img/sourire.gif\">\n";
+  $output .= "<param name=\"style:smiley3\" value=\":-D img/content.gif\">\n";
+  $output .= "<param name=\"style:smiley4\" value=\":d img/content.gif\">\n";
+  $output .= "<param name=\"style:smiley5\" value=\":-O img/OH-2.gif\">\n";
+  $output .= "<param name=\"style:smiley6\" value=\":o img/OH-1.gif\">\n";
+  $output .= "<param name=\"style:smiley7\" value=\":-P img/langue.gif\">\n";
+  $output .= "<param name=\"style:smiley8\" value=\":p img/langue.gif\">\n";
+  $output .= "<param name=\"style:smiley9\" value=\";-) img/clin-oeuil.gif\">\n";
+  $output .= "<param name=\"style:smiley10\" value=\";) img/clin-oeuil.gif\">\n";
+  $output .= "<param name=\"style:smiley11\" value=\":-( img/triste.gif\">\n";
+  $output .= "<param name=\"style:smiley12\" value=\":( img/triste.gif\">\n";
+  $output .= "<param name=\"style:smiley13\" value=\":-| img/OH-3.gif\">\n";
+  $output .= "<param name=\"style:smiley14\" value=\":| img/OH-3.gif\">\n";
+  $output .= "<param name=\"style:smiley15\" value=\":'( img/pleure.gif\">\n";
+  $output .= "<param name=\"style:smiley16\" value=\":$ img/rouge.gif\">\n";
+  $output .= "<param name=\"style:smiley17\" value=\":-$ img/rouge.gif\">\n";
+  $output .= "<param name=\"style:smiley18\" value=\"(H) img/cool.gif\">\n";
+  $output .= "<param name=\"style:smiley19\" value=\"(h) img/cool.gif\">\n";
+  $output .= "<param name=\"style:smiley20\" value=\":-@ img/enerve1.gif\">\n";
+  $output .= "<param name=\"style:smiley21\" value=\":@ img/enerve2.gif\">\n";
+  $output .= "<param name=\"style:smiley22\" value=\":-S img/roll-eyes.gif\">\n";
+  $output .= "<param name=\"style:smiley23\" value=\":s img/roll-eyes.gif\">\n";
+  $output .= "<param name=\"style:backgroundimage\" value=\"true\">\n";
+  $output .= "<param name=\"style:backgroundimage1\" value=\"all all 0 background.gif\">\n";
+  $output .= "<param name=\"style:sourcefontrule1\" value=\"all all Serif 12\">\n";
+  $output .= "<param name=\"style:floatingasl\" value=\"true\">\n";
+  $output .= "<param name=\"pixx:timestamp\" value=\"true\">\n";
+  $output .= "<param name=\"pixx:highlight\" value=\"true\">\n";
+  $output .= "<param name=\"pixx:highlightnick\" value=\"true\">\n";
+  $output .= "<param name=\"pixx:nickfield\" value=\"true\">\n";
+  $output .= "<param name=\"pixx:styleselector\" value=\"true\">\n";
+  $output .= "<param name=\"pixx:setfontonstyle\" value=\"true\">\n";
+  $output .= "</applet>\n";
+  $output .= "<br /><br /><a href=\"http://www.java.com/en/download/\" target=\"_blank\">If the applet does not display then click here to download a Java client.</a>\n";
+  $output .= "<br /><br />You can also connect using any IRC client (such as <a href=\"http://www.mirc.com/\">MIRC</a>) using the following:<br />\n";
+  $output .= "HOST: ".$pjirc_server."\n";
+  $output .= "CHANNEL: ".$pjirc_room."\n";
+  $output .= "</div>\n";
+
+  print theme('page', $output);
+}
+
+?>
