This just defines some variables that otherwise would be undefined, causing notices. In one case, there was a missing '$', that would cause and error. Also, adds a "remove" link from the gallery, and a delete application preference which allows users to remove applications entirely from the system, not just their profile. Also fixes case when Config is attempted to be loaded, and puts a newline in the source after an iframe. Sorry for the long, multi-part patch, breaking it into multiple patches was proving difficult. If its a problem, let me know and I try again from a fresh install.

Index: shindig_integrator.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/ShindigIntegrator/shindig_integrator/shindig_integrator.module,v
retrieving revision 1.2.2.1
diff -b -r1.2.2.1 shindig_integrator.module
88a89
>   'delete applications',
128a130,137
>   $items['remove_application/%'] = array(
>     'title'            => t('Remove application'),
>     'description'      => t('Remove application from the system.'), 
>     'page callback'    => 'shindig_integrator_remove_application',
>     'page arguments'   => array(1),
>     'access arguments' => array('delete applications'),
>     'type'             => MENU_CALLBACK);
> 
218a228
> 
230a241
>   drupal_set_message('Please note, the "Remove" link is NOT the opposite of "Add". "Add" will add an application to your account, where as remove will delete the appication from the system completely. To remove an application from your account, please use the links provided in the "My Applications" block.');
249a261,262
>   $apps = array();
>   $headers = array();
260a274
>     $app_id_64 = base64_encode($app_id);
262,263c276,278
<       $app_id = base64_encode($app_id);
<       $app[] = l(t('Add'), "add_application/$app_id");
---
>     $app[] = (l(t('Add'), "add_application/$app_id_64") . ' ' . (user_access('delete application') ? 
>       (l(t('Remove'), "remove_application/$app_id_64")) : 
>       ''));
266c281,283
<       $app[] = "&nbsp;";
---
>     $app[] = ((user_access('delete application') ? 
>       (l(t('Remove'), "remove_application/$app_id_64")) : 
>       ''));
273c290
<   $output       .=  theme('pager', NULL, $limit, 0); 
---
>   $output       .=  theme('pager', NULL, $num_apps_on_page, 0); 
426a444
>       $error = '';
481c499,511
<   if(!res) {
---
>   if(!$res) {
>     return FALSE;
>   }
>   drupal_goto("user");
> }
> 
> function shindig_integrator_remove_application($app_id) {
>   $res = db_query("DELETE FROM {user_applications} WHERE application_id=%d", base64_decode($app_id));
>   if (!$res) {
>     return FALSE;
>   }
>   $res = db_query("DELETE FROM {applications} WHERE id=%d", base64_decode($app_id));
>   if (!$res) {
505a536
>     $apps                     = array();
572a604
>   $attr = '';
603a636
>   module_load_include('php', 'shindig_integrator', '/shindig/php/src/common/Config');
609d641
<   module_load_include('php', 'shindig_integrator', '/shindig/php/src/common/config');
612a645
>   $output      = '';
617,618c650
<   $row_rs_Apps = db_fetch_object($rs_Apps);
<   $gadget      = $row_rs_Apps;
---
>   while ($gadget = db_fetch_object($rs_Apps)) {
668c700,701
<   $output .= '<div class="iframe_div" align="center">'. $iframe_str .'</div>';
---
>     $output .= '<div class="iframe_div" align="center">'. $iframe_str ."</div>\n";
>   }
688a722
>   $attr       = array();
CommentFileSizeAuthor
#2 shindig.patch2.78 KBpletcher

Comments

ramsharma2005’s picture

Hi pletcher,

Thanks for bringing this up and patch. Please attach the patch in .patch file format, so that it can be easily applied and tested.

Thanks again.

pletcher’s picture

StatusFileSize
new2.78 KB

Yep, no problem.

ramsharma2005’s picture

Title: Patch to remove notices, fix a syntax error, and add functionality to remove an app » Thanks for your contribution
Status: Active » Closed (fixed)

Hi pletcher,

Thanks for your contribution. Patch is committed.

Thanks again.