? filedepot-url-functions.patch
Index: ajaxserver.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/filedepot/ajaxserver.php,v
retrieving revision 1.11
diff -u -p -r1.11 ajaxserver.php
--- ajaxserver.php	20 Jun 2010 06:05:19 -0000	1.11
+++ ajaxserver.php	23 Oct 2010 09:39:31 -0000
@@ -7,7 +7,7 @@
  * Implementation of filedepot_ajax() - main ajax handler for the module
  */
 function filedepot_dispatcher($action) {
-  global $base_url, $base_path, $user, $filedepot, $nexcloud;
+  global $user, $filedepot, $nexcloud;
   include_once './' . drupal_get_path('module', 'filedepot') . '/lib-theme.php';
   include_once './' . drupal_get_path('module', 'filedepot') . '/lib-ajaxserver.php';
   include_once './' . drupal_get_path('module', 'filedepot') . '/lib-common.php';
Index: filedepot.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/filedepot/filedepot.module,v
retrieving revision 1.15
diff -u -p -r1.15 filedepot.module
--- filedepot.module	23 Jun 2010 16:22:15 -0000	1.15
+++ filedepot.module	23 Oct 2010 09:39:32 -0000
@@ -407,7 +407,6 @@ function filedepot_access($op, $node) {
  * Implementation of hook_main().
  */
 function filedepot_main() {
-  global $base_url, $base_path, $user;
 
   $modulepath = drupal_get_path('module', 'filedepot');
   drupal_add_css($modulepath . '/css/filedepot.css');
@@ -1054,7 +1053,7 @@ function template_preprocess_filedepot_m
  */
 
 function theme_filedepot_files($node) {
-  global $filedepot, $base_url;
+  global $filedepot;
 
   $layout_url = base_path() . drupal_get_path('module', 'filedepot');
   $retval = '';
Index: lib-ajaxserver.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/filedepot/lib-ajaxserver.php,v
retrieving revision 1.11
diff -u -p -r1.11 lib-ajaxserver.php
--- lib-ajaxserver.php	21 Oct 2010 02:50:45 -0000	1.11
+++ lib-ajaxserver.php	23 Oct 2010 09:39:32 -0000
@@ -1121,7 +1121,7 @@ function filedepotAjaxServer_updateFileS
 
 
 function filedepotAjaxServer_broadcastAlert($fid, $comment) {
-  global $user, $filedepot, $base_url;
+  global $user, $filedepot;
 
   $retval = '';
   $target_users = array();
@@ -1184,10 +1184,11 @@ function filedepotAjaxServer_broadcastAl
     if (count($distribution) > 0) {
       $message['subject'] = variable_get('site_name', '') . ' - ' . t('Broadcast Notification');
       $message['body'] = $comment . "\n\n";
+      $link = url('filedepot', array('query' => drupal_query_string_encode(array('cid' => $frec->cid)), 'absolute' => true));
       $message['body'] .= t('The file: !filename can be accessed at !link',
-      array('!filename' => $frec->title, '!link' => "{$base_url}?q=filedepot&cid={$frec->cid}")) . "\n\n";
+        array('!filename' => $frec->title, '!link' => $link)) . "\n\n";
       $message['body'] .= t('You are receiving this broadcast alert, because your notification setting is enabled.');
-      $message['to'] = 'Fildepot Distribution';
+      $message['to'] = 'Filedepot Distribution';
       $message['headers']['Bcc'] = implode(',', $distribution);
       drupal_mail_send($message);
       $retval['retcode'] = 200;
Index: lib-common.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/filedepot/lib-common.php,v
retrieving revision 1.10
diff -u -p -r1.10 lib-common.php
--- lib-common.php	19 Jul 2010 01:48:58 -0000	1.10
+++ lib-common.php	23 Oct 2010 09:39:32 -0000
@@ -316,7 +316,7 @@ function filedepot_getGroupOptions() {
  * @return       Boolean     Returns TRUE if atleast 1 message was sent out
  */
 function filedepot_sendNotification($id, $type=1) {
-  global $user, $filedepot, $base_url, $REMOTE_ADDR;
+  global $user, $filedepot;
 
   /* If notifications have been disabled via the module admin settings - return TRUE */
   if (variable_get('filedepot_notifications_enabled', 1) == 0) { 
@@ -335,7 +335,7 @@ function filedepot_sendNotification($id,
       . "WHERE file.cid=category.cid and file.fid=%d";
       $query = DB_query($sql, $id);
       list($fid, $fname, $cid, $submitter, $catname) = array_values(db_fetch_array($query));
-      $link = "{$base_url}/index.php?q=filedepot&cid={$cid}&fid={$fid}";        
+      $link = url('filedepot', array('query' => drupal_query_string_encode(array('cid' => $cid, 'fid' => $fid)), 'absolute' => true));
       $message['subject'] = variable_get('site_name', '') . ' - ' . t('New Document Management Update');
       $messagetext2ary = array('!file' => $fname,
                              '!bp' => '<p>',
@@ -351,7 +351,7 @@ function filedepot_sendNotification($id,
       list($fid, $fname, $cid, $submitter, $catname) = array_values(db_fetch_array($query));
       // Just need to create this SQL record for this user - to fake out logic below
       $target_users[] = $submitter;
-      $link = "{$base_url}/index.php?q=filedepot&cid={$cid}&fid={$fid}";     
+      $link = url('filedepot', array('query' => drupal_query_string_encode(array('cid' => $cid, 'fid' => $fid)), 'absolute' => true));
       $message['subject'] = variable_get('site_name', '') . ' - ' . t('New File Submission Approved');       
       $messagetext = t('Site member %@name: your file in folder: !folder', 
       array('!folder' => $catname)) . '<p>';
Index: lib-theme.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/filedepot/lib-theme.php,v
retrieving revision 1.12
diff -u -p -r1.12 lib-theme.php
--- lib-theme.php	13 Sep 2010 14:54:46 -0000	1.12
+++ lib-theme.php	23 Oct 2010 09:39:32 -0000
@@ -144,7 +144,7 @@ function template_preprocess_filedepot_a
 
 
 function template_preprocess_filedepot_activefolder(&$variables) {
-  global $base_url, $filedepot;
+  global $filedepot;
 
   $variables['show_activefolder'] = 'none';
   $variables['show_reportmodeheader'] = 'none';
@@ -191,7 +191,7 @@ function template_preprocess_filedepot_a
 
 
 function template_preprocess_filedepot_folderlisting(&$variables) {
-  global $filedepot, $base_url;
+  global $filedepot;
 
   $rec = $variables['folderrec'];      // cid,pid,name,description,folderorder,last_modified_date
   $level = $variables['level'];
@@ -249,7 +249,7 @@ function template_preprocess_filedepot_f
 
 
 function template_preprocess_filedepot_filelisting(&$variables) {
-  global $user, $filedepot, $nexcloud, $base_url;
+  global $user, $filedepot, $nexcloud;
 
   /* listing rec format
   file.fid as fid,file.cid,file.title,file.fname,file.date,file.version,file.submitter,file.status,
@@ -280,7 +280,7 @@ function template_preprocess_filedepot_f
     $variables['modified_date'] = '';
   }
 
-  $variables['folder_link'] = "{$base_url}/filedepot/index.php?cid={$rec['cid']}";
+  $variables['folder_link'] = url('filedepot', array('query' => drupal_query_string_encode(array('cid' => $rec['cid'])), 'absolute' => true));
   $variables['folder_name'] = filter_xss($rec['foldername']);
   $filenum = $variables['id'] + $filedepot->folder_filenumoffset;
   $variables['file_number'] = "{$variables['foldernumber']}.{$filenum}";
Index: theme/filedetail.tpl.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/filedepot/theme/filedetail.tpl.php,v
retrieving revision 1.1
diff -u -p -r1.1 filedetail.tpl.php
--- theme/filedetail.tpl.php	13 Apr 2010 22:28:59 -0000	1.1
+++ theme/filedetail.tpl.php	23 Oct 2010 09:39:32 -0000
@@ -11,7 +11,7 @@
 <table class="plugin" width="100%" border="0" cellspacing="0" cellpadding="2" style="padding-bottom:10px;">
     <tr>
         <td class="aligntop" style="padding:15px 10px 5px 10px;">
-            <div style="padding-bottom:10px;"><img src="<?php print $fileicon ?>">&nbsp;<a href="<?php print $site_url ?>index.php?q=filedepot&cid=<?php print $cid ?>&fid=<?php print $fid ?>" TITLE="<?php print $LANG_link_message ?>" <?php print $disable_download ?>><strong><?php print $fname ?></strong></a>&nbsp;<span style="font-size:8pt;"><?php print $current_version ?></span></div>
+            <div style="padding-bottom:10px;"><img src="<?php print $fileicon; ?>">&nbsp;<a href="<?php print url('filedepot', array('query' => drupal_query_string_encode(array('cid' => $cid, 'fid' => $fid)), 'absolute' => true)); ?>" title="<?php print $LANG_link_message ?>" <?php print $disable_download ?>><strong><?php print $fname ?></strong></a>&nbsp;<span style="font-size:8pt;"><?php print $current_version ?></span></div>
             <div class="floatleft" style="width:100px;"><strong><?php print $LANG_folder ?>:</strong></div>
             <div class="floatleft"><?php print $foldername ?></div>
             <div class="clearboth"></div>
Index: theme/filedetail_version.tpl.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/filedepot/theme/filedetail_version.tpl.php,v
retrieving revision 1.2
diff -u -p -r1.2 filedetail_version.tpl.php
--- theme/filedetail_version.tpl.php	27 May 2010 02:39:39 -0000	1.2
+++ theme/filedetail_version.tpl.php	23 Oct 2010 09:39:32 -0000
@@ -8,7 +8,7 @@
 
 <table width="100%" border="0" cellspacing="2" cellpadding="0">
     <tr class="pluginRow<?php print $cssid ?>">
-        <td class="aligntop" style="padding-left:10px;padding-top:10px;"><img src="<?php print $fileicon ?>">&nbsp;<a href="<?php print $site_url?>index.php?q=filedepot_download/<?php print $nid ?>/<?php print $fid ?>/<?php print $file_version ?>" TITLE="<?php print $LANG_download ?>"><strong><?php print $vname ?></strong></a>&nbsp;<span style="font-size:9pt;"><?php print $file_versionnum ?></span></td>
+        <td class="aligntop" style="padding-left:10px;padding-top:10px;"><img src="<?php print $fileicon ?>">&nbsp;<a href="<?php print url('filedepot_download/' . $nid . '/' . $fid . '/' . $file_version, array('absolute' => true)); ?>" title="<?php print $LANG_download ?>"><strong><?php print $vname ?></strong></a>&nbsp;<span style="font-size:9pt;"><?php print $file_versionnum ?></span></td>
         <td width="15%" class="alignright" style="padding-top:10px;" nowrap><span style="font-size:8pt;"><?php print $ver_shortdate ?><br /><strong><?php print $LANG_size ?>:</strong>&nbsp;<?php print $ver_size ?></span></td>
     </tr>
     <tr class="pluginRow<?php print $cssid ?>">
@@ -32,6 +32,6 @@
         </td>
     </tr>
     <tr class="pluginRow<?php print $cssid ?>">
-        <td colspan="2" style="padding-left:10px;"><?php print $LANG_author ?>:&nbsp;<?php print $ver_author ?>&nbsp;&nbsp;<a href="<?php print $site_url?>index.php?q=filedepot_download/<?php print $nid ?>/<?php print $fid ?>/<?php print $file_version ?>"><?php print $LANG_download ?></a><span style="padding-left:10px;"><a href="#" onClick="toggleElements('detaildisp<?php print $fid ?>v<?php print $file_version ?>','detailedit<?php print $fid ?>v<?php print $file_version ?>');return false;"><?php print $LANG_edit ?></a></span><span style="padding-left:10px;"><a href="#" onclick="doAJAXDeleteVersion(<?php print $fid ?>,<?php print $file_version ?>)"><?php print $LANG_delete ?></a></span></td>
+        <td colspan="2" style="padding-left:10px;"><?php print $LANG_author ?>:&nbsp;<?php print $ver_author ?>&nbsp;&nbsp;<a href="<?php print url('filedepot_download/' . $nid . '/' . $fid . '/' . $file_version, array('absolute' => true)); ?>"><?php print $LANG_download ?></a><span style="padding-left:10px;"><a href="#" onClick="toggleElements('detaildisp<?php print $fid ?>v<?php print $file_version ?>','detailedit<?php print $fid ?>v<?php print $file_version ?>');return false;"><?php print $LANG_edit ?></a></span><span style="padding-left:10px;"><a href="#" onclick="doAJAXDeleteVersion(<?php print $fid ?>,<?php print $file_version ?>)"><?php print $LANG_delete ?></a></span></td>
     </tr>
 </table>
\ No newline at end of file
