? reptag-coder_help_and_notices.20090108.patch
? reptag-help_and_notices.20090108.patch
Index: reptag.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/reptag/reptag.install,v
retrieving revision 1.17.2.2
diff -u -p -r1.17.2.2 reptag.install
--- reptag.install	28 Sep 2008 11:19:35 -0000	1.17.2.2
+++ reptag.install	8 Jan 2009 03:15:08 -0000
@@ -1,6 +1,11 @@
 <?php
 // $Id: reptag.install,v 1.17.2.2 2008/09/28 11:19:35 profix898 Exp $
 
+/**
+ * @file
+ * Install/update routines for reptag.module
+ */
+
 require_once(drupal_get_path('module', 'reptag') .'/reptag_helper.inc');
 require_once(drupal_get_path('module', 'reptag') .'/reptag_module.inc');
 
@@ -262,7 +267,7 @@ function reptag_update_6000() {
   $result = db_query('SELECT * FROM {reptag_vars_tmp}');
   while ($var = db_fetch_object($result)) {
     $ret[] = array(
-      'success' => db_query("INSERT INTO {reptag_vars} (name, value, uid, language) VALUES ('%s', '%s', %d, '%s')",
+      'success' => update_sql("INSERT INTO {reptag_vars} (name, value, uid, language) VALUES ('%s', '%s', %d, '%s')",
                             $var->name, unserialize($var->value), $var->uid, empty($var->language) ? 'en' : $var->language),
       'query' => 'Migrating existing table tags (SELECT -> INSERT): \''. check_plain($var->name) .'\''
     );
Index: reptag.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/reptag/reptag.module,v
retrieving revision 1.39.2.5
diff -u -p -r1.39.2.5 reptag.module
--- reptag.module	29 Nov 2008 17:13:12 -0000	1.39.2.5
+++ reptag.module	8 Jan 2009 03:15:10 -0000
@@ -1,6 +1,14 @@
 <?php
 // $Id: reptag.module,v 1.39.2.5 2008/11/29 17:13:12 profix898 Exp $
 
+/**
+ * @file
+ * Main Drupal module file for Replacement Tags
+ *  
+ * Rep[lacement]Tags allows you to define tags and replace them with user-
+ * defined text.
+ */
+
 define('REPTAG_LOCALE_STRICT',    0);
 define('REPTAG_LOCALE_FALLBACK',  1);
 
@@ -22,6 +30,11 @@ function reptag_theme() {
       'file' => 'reptag_admin_table.inc',
       'arguments' => array('content' => NULL, 'title' => t('Rep[lacement]Tags Dialog')),
     ),
+    // Even tags need to declare their themes
+    'reptag_node_embed' => array(
+      'file' => 'tags/node.tags.inc',
+      'arguments' => array('node' => NULL),
+    ),
   );
   
   // Register theme functions of enabled .tags modules
@@ -352,7 +365,7 @@ function reptag_node_type($op, $info) {
 function reptag_form_alter(&$form, $form_state, $form_id) {
   if (variable_get('reptag_showhelp', 1)) {
     // Add reptag help to node form and comment form
-	if ((isset($form['type']['#value']) && $form['type']['#value'] .'_node_form' == $form_id)
+    if ((isset($form['type']['#value']) && $form['type']['#value'] .'_node_form' == $form_id)
          || ($form_id == 'comment_form' && variable_get('reptag_enable_comments', 0))) {
       $help = _reptag_online_help();
       if (count($help)) {
@@ -448,3 +461,33 @@ function reptag_workspace() {
   
   return drupal_get_form('_reptag_admin_user_form');
 }
+
+/**
+ * Implementation of hook_help()
+ */
+function reptag_help($path, $arg) {
+  switch ($path) {
+    case 'admin/settings/reptag' : 
+      return t("
+        Reptag will replace a variety of tags, tokens and variables in text fields within nodes.
+        The node content types and the fields within these node types that are processed can be defined here.
+        <br/>Different reptag sub-modules provide different groups of available tag replacements. 
+        Enable the reptag modules to use them.
+        <br/>Reptag tags are saved in the database storage in the unexpanded form, 
+        and are only applied when a node is viewed.
+        <br/>Some reptag values are 'static' and can be cached, 
+        others are dynamically calculated on-the-fly.
+      ");
+      break;
+    case 'admin/settings/reptag/site' : 
+    case 'admin/settings/reptag/user' : 
+      return t("
+        Enter token names and their replacement text. 
+        New tokens can be used by surrounding them with '\$' signs in the target text.
+        <br/>Example: <b>Tag:</b> <code>ADDRESS</code> => <b>Replacement:</b> <code>21 Nonesuch st</code>
+        <br/>Embedding <code>\$ADDRESS\$<code> in node body will be replaced with \"21 Nonesuch st\" in all cases.
+      ");
+      break;
+      
+  };
+} 
\ No newline at end of file
Index: reptag_admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/reptag/reptag_admin.inc,v
retrieving revision 1.16.2.4
diff -u -p -r1.16.2.4 reptag_admin.inc
--- reptag_admin.inc	29 Nov 2008 17:13:12 -0000	1.16.2.4
+++ reptag_admin.inc	8 Jan 2009 03:15:18 -0000
@@ -1,6 +1,11 @@
 <?php
 // $Id: reptag_admin.inc,v 1.16.2.4 2008/11/29 17:13:12 profix898 Exp $
 
+/**
+ * @file
+ * FAPI and admin UI routines
+ */
+
 require_once(drupal_get_path('module', 'reptag') .'/reptag_admin_table.inc');
 
 /**
Index: reptag_admin_table.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/reptag/reptag_admin_table.inc,v
retrieving revision 1.1.2.3
diff -u -p -r1.1.2.3 reptag_admin_table.inc
--- reptag_admin_table.inc	13 Aug 2008 18:03:31 -0000	1.1.2.3
+++ reptag_admin_table.inc	8 Jan 2009 03:15:19 -0000
@@ -1,6 +1,11 @@
 <?php
 // $Id: reptag_admin_table.inc,v 1.1.2.3 2008/08/13 18:03:31 profix898 Exp $
 
+/** 
+ * @file
+ * Utility CRUD and rendering functions for the reptag admin UI
+ */
+
 define('RETAG_PAGER_LENGTH',  25);
 
 /**
Index: reptag_callback.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/reptag/reptag_callback.inc,v
retrieving revision 1.1.2.1
diff -u -p -r1.1.2.1 reptag_callback.inc
--- reptag_callback.inc	4 Jun 2008 16:07:58 -0000	1.1.2.1
+++ reptag_callback.inc	8 Jan 2009 03:15:19 -0000
@@ -1,6 +1,11 @@
 <?php
 // $Id: reptag_callback.inc,v 1.1.2.1 2008/06/04 16:07:58 profix898 Exp $
 
+/**
+ * @file
+ * Utility for the Admin UI
+ */
+
 require_once(drupal_get_path('module', 'reptag') .'/reptag_admin.inc');
 require_once(drupal_get_path('module', 'reptag') .'/reptag_admin_table.inc');
 
Index: reptag_helper.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/reptag/reptag_helper.inc,v
retrieving revision 1.2.2.2
diff -u -p -r1.2.2.2 reptag_helper.inc
--- reptag_helper.inc	28 Sep 2008 15:53:09 -0000	1.2.2.2
+++ reptag_helper.inc	8 Jan 2009 03:15:20 -0000
@@ -1,6 +1,11 @@
 <?php
 // $Id: reptag_helper.inc,v 1.2.2.2 2008/09/28 15:53:09 profix898 Exp $
 
+/**
+ * @file
+ * Database routines for managing tag lists
+ */
+
 define('REPTAG_LOADTAG_DEFAULT',  0);
 define('REPTAG_LOADTAG_FORMAT',   1);
 define('REPTAG_LOADTAG_EDIT',     2);
@@ -294,7 +299,7 @@ function _reptag_cache_clear($msg = NULL
 function _reptag_match_tags($string, $tags) {
   $matches = array();
   foreach ($tags as $tag) {
-    if (!(strpos($tag, $string) === false)) {
+    if (!(strpos($tag, $string) === FALSE)) {
       $matches[$tag] = check_plain($tag);
     }
   }
Index: reptag_module.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/reptag/reptag_module.inc,v
retrieving revision 1.2.2.1
diff -u -p -r1.2.2.1 reptag_module.inc
--- reptag_module.inc	29 Nov 2008 17:13:12 -0000	1.2.2.1
+++ reptag_module.inc	8 Jan 2009 03:15:21 -0000
@@ -1,6 +1,11 @@
 <?php
 // $Id: reptag_module.inc,v 1.2.2.1 2008/11/29 17:13:12 profix898 Exp $
 
+/**
+ * @file
+ * Helper functions for the reptag module
+ */
+
 define('REPTAG_PROCALL',      0);
 define('REPTAG_PROCSTATIC',   1);
 define('REPTAG_PROCDYNAMIC',  2);
Index: reptag_process.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/reptag/reptag_process.inc,v
retrieving revision 1.26.2.7
diff -u -p -r1.26.2.7 reptag_process.inc
--- reptag_process.inc	29 Nov 2008 18:56:25 -0000	1.26.2.7
+++ reptag_process.inc	8 Jan 2009 03:15:21 -0000
@@ -1,6 +1,12 @@
 <?php
 // $Id: reptag_process.inc,v 1.26.2.7 2008/11/29 18:56:25 profix898 Exp $
 
+/**
+ * @file
+ * Processing functions for the reptag module. Find, choose, include and execute
+ * the appropriate callbacks.
+ */
+
 require_once(drupal_get_path('module', 'reptag') .'/reptag_helper.inc');
 require_once(drupal_get_path('module', 'reptag') .'/reptag_module.inc');
 
Index: tags/block.tags.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/reptag/tags/block.tags.inc,v
retrieving revision 1.2.2.1
diff -u -p -r1.2.2.1 block.tags.inc
--- tags/block.tags.inc	28 Sep 2008 15:19:17 -0000	1.2.2.1
+++ tags/block.tags.inc	8 Jan 2009 03:15:22 -0000
@@ -1,9 +1,13 @@
 <?php
 // $Id: block.tags.inc,v 1.2.2.1 2008/09/28 15:19:17 profix898 Exp $
 
-// block.tags written by dman (user/33240)
-// Allows inline blocks through a BBcode-like syntax
-// Things will display nicely if you add some CSS to support them such as:
+/**
+ * @file
+ * block.tags written by dman (user/33240)
+ * Allows inline blocks through a BBcode-like syntax
+ * Things will display nicely if you add some CSS to support them such as:
+ */
+
 /*
   <style>
   .node .content .block {
Index: tags/format.tags.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/reptag/tags/format.tags.inc,v
retrieving revision 1.2
diff -u -p -r1.2 format.tags.inc
--- tags/format.tags.inc	4 Jun 2008 12:21:07 -0000	1.2
+++ tags/format.tags.inc	8 Jan 2009 03:15:22 -0000
@@ -1,6 +1,14 @@
 <?php
 // $Id: format.tags.inc,v 1.2 2008/06/04 12:21:07 profix898 Exp $
 
+/**
+ * @file
+ * Markup and formatting tags
+ */
+
+/**
+ * Implimentation of _reptag_HOOK_init()
+ */
 function _reptag_format_init($context) {
   return array(
   
Index: tags/image.tags.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/reptag/tags/image.tags.inc,v
retrieving revision 1.2.2.1
diff -u -p -r1.2.2.1 image.tags.inc
--- tags/image.tags.inc	28 Sep 2008 15:19:17 -0000	1.2.2.1
+++ tags/image.tags.inc	8 Jan 2009 03:15:22 -0000
@@ -1,6 +1,14 @@
 <?php
 // $Id: image.tags.inc,v 1.2.2.1 2008/09/28 15:19:17 profix898 Exp $
 
+/**
+ * @file
+ * Image embedding and layout tags
+ */
+
+/**
+ * Implimentation of _reptag_HOOK_init()
+ */
 function _reptag_image_init($context) {
   return array(
     
Index: tags/links.tags.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/reptag/tags/links.tags.inc,v
retrieving revision 1.2.2.1
diff -u -p -r1.2.2.1 links.tags.inc
--- tags/links.tags.inc	28 Sep 2008 15:19:17 -0000	1.2.2.1
+++ tags/links.tags.inc	8 Jan 2009 03:15:22 -0000
@@ -1,6 +1,14 @@
 <?php
 // $Id: links.tags.inc,v 1.2.2.1 2008/09/28 15:19:17 profix898 Exp $
 
+/**
+ * @file
+ * Link and URL tags
+ */
+
+/**
+ * Implimentation of _reptag_HOOK_init()
+ */
 function _reptag_links_init($context) {
   return array(
     
Index: tags/node.tags.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/reptag/tags/node.tags.inc,v
retrieving revision 1.2.2.2
diff -u -p -r1.2.2.2 node.tags.inc
--- tags/node.tags.inc	29 Nov 2008 17:13:13 -0000	1.2.2.2
+++ tags/node.tags.inc	8 Jan 2009 03:15:22 -0000
@@ -1,8 +1,16 @@
 <?php
 // $Id: node.tags.inc,v 1.2.2.2 2008/11/29 17:13:13 profix898 Exp $
 
+/**
+ * @file
+ * Node content and data display tags
+ */
+
 define('REPTAG_NODE_LEVELS', 10);
 
+/**
+ * Implimentation of _reptag_HOOK_init()
+ */
 function _reptag_node_init($node) {
   return array(
   
Index: tags/system.tags.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/reptag/tags/system.tags.inc,v
retrieving revision 1.2.2.2
diff -u -p -r1.2.2.2 system.tags.inc
--- tags/system.tags.inc	28 Sep 2008 15:53:09 -0000	1.2.2.2
+++ tags/system.tags.inc	8 Jan 2009 03:15:23 -0000
@@ -1,9 +1,17 @@
 <?php
 // $Id: system.tags.inc,v 1.2.2.2 2008/09/28 15:53:09 profix898 Exp $
 
+/**
+ * @file
+ * Tags for global and system values. See also token.module
+ */
+
+/**
+ * Implimentation of _reptag_HOOK_init()
+ */
 function _reptag_system_init($context) {
   global $user;
-  
+
   return array(
   
     "#{DATETIME_LONG}#"                 => format_date(time(), 'large'),
@@ -25,18 +33,18 @@ function _reptag_system_init($context) {
     "#{SITE}#"                          => variable_get('site_name', 'Drupal'),
     "#{PAGE}#"                          => request_uri(),
     
-    "#{USERNAME}#"                      => _reptag_system_user($user->name),
+    // Use @ to quiet PHP notices if the user is anonymous
+    "#{USERNAME}#"                      => @_reptag_system_user($user->name),
     "#{USERID}#"                        => $user->uid,
-    "#{USERMAIL}#"                      => $user->mail,
-    "#{USER_CREATED}#"                  => format_date($user->created, 'small'),
-    "#{USER_ACCESS}#"                   => format_date($user->access, 'small'),
-    "#{USER_LOGIN}#"                    => format_date($user->login, 'small'),
-    "#{USER_SESSION}#"                  => date('H:i', (time() - $user->login)),
-    "#{USERLANG}#"                      => _reptag_language(),
+    "#{USERMAIL}#"                      => @$user->mail,
+    "#{USER_CREATED}#"                  => @format_date($user->created, 'small'),
+    "#{USER_ACCESS}#"                   => @format_date($user->access, 'small'),
+    "#{USER_LOGIN}#"                    => @format_date($user->login, 'small'),
+    "#{USER_SESSION}#"                  => @date('H:i', (time() - $user->login)),
+    "#{USERLANG}#"                      => @_reptag_language(),
     
     //"#{PHP\}(.*?)\{/PHP\}#se"    => "''. _reptag_system_php_exec(stripslashes('\\1')) .''",
     "#{PHP:(.*?)\}#e"                    => "'<?php include(\''. stripslashes('\\1') .'\'); ?>'"
-    
   );
 }
 
Index: tags/token.tags.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/reptag/tags/token.tags.inc,v
retrieving revision 1.1
diff -u -p -r1.1 token.tags.inc
--- tags/token.tags.inc	4 Jun 2008 12:21:07 -0000	1.1
+++ tags/token.tags.inc	8 Jan 2009 03:15:23 -0000
@@ -1,6 +1,14 @@
 <?php
 // $Id: token.tags.inc,v 1.1 2008/06/04 12:21:07 profix898 Exp $
 
+/**
+ * @file
+ * User-defined Token tags
+ */
+
+/**
+ * Implimentation of _reptag_HOOK_init()
+ */
 function _reptag_token_init($context) {
   return array('');
 }
Index: tags/video.tags.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/reptag/tags/video.tags.inc,v
retrieving revision 1.2
diff -u -p -r1.2 video.tags.inc
--- tags/video.tags.inc	4 Jun 2008 12:21:07 -0000	1.2
+++ tags/video.tags.inc	8 Jan 2009 03:15:23 -0000
@@ -1,6 +1,14 @@
 <?php
 // $Id: video.tags.inc,v 1.2 2008/06/04 12:21:07 profix898 Exp $
 
+/**
+ * @file
+ * Tags for embedding offsite videos like Youtube
+ */
+
+/**
+ * Implimentation of _reptag_HOOK_init()
+ */
 function _reptag_video_init($context) {
   return array(
     "#{GOOGLEVIDEO:([\-0-9]*):(.*?):([0-9]*)x([0-9]*)}#e"     => "_reptag_video_googlevideo('\\1', \\3, \\4, '\\2');",
