CVS edit link for Brian294

I am submitting a series of supplementing modules to extend the functionality of an existing module. These modules are consider submodules as they depend on ActivityStream to work.

Existing Module: ActivityStream
http://drupal.org/project/activitystream

The maintainer of ActivityStream has invited others to use his API to tap into other social networks. The purpose of this (and upcoming modules) is to add to the list of social networks that are integrated with ActivityStream.

The first social network that I've completed is LinkedIn. The module I am submitting uses the ActivityStream API to import a user-specific LinkedIn feed and create ActivitySteam nodes. The module accepts two user configurable options:
1. A Private RSS feed url that can be configured for each registered user.
2. A "label" field that can be set by the site manager.

A working demo of this module can be found here:
http://sandbox.brianstevenson.com/stream

A working copy of the source code can be found here:
http://yadadrop.com/sites/default/files/activitystream_linkedin.zip

Basic documentation can be found here:
http://yadadrop.com/drupal-modules/linkedin-activity-stream

I have a question:
Will I need to submit a unique CVS application for each ActivityStream submodules that I want to contribute? I have at least 4 more modules in the works.

Peace,
Brian

Comments

Brian294’s picture

Status: Postponed (maintainer needs more info) » Needs review
avpaderno’s picture

Status: Needs review » Postponed (maintainer needs more info)

You need to upload the code here; keep in mind we review just a module / theme per applicant.

Brian294’s picture

StatusFileSize
new3.34 KB
Brian294’s picture

Last night I clicked "Attach" but didn't click Save. Ooops :-)

Brian294’s picture

Status: Postponed (maintainer needs more info) » Needs review
avpaderno’s picture

Status: Needs review » Needs work
  1.     '#default_value' => empty($edit['activitystream_linkedin_feed']) ? '' : check_plain($edit['activitystream_linkedin_feed']),
        '#description' => t('For more information on how to acquire your Private URL, please visit: <a href="http://yadadrop.com/drupal-modules/linkedin-activity-stream" target="_blank">yadaDROP\'s LinkedIn help page</a>.'));
    

    There is no need to use check_plain() with data passed to functions of form API.

  2. function theme_activitystream_linkedin_item($activity) {
      $node = node_load($activity->nid);
      $date = theme('activitystream_date', $node->created);
    

    The code loads the node data, but does the code check if the user has permission to see those node data?

  3.   if ($label == '') {
        $label = t(check_plain(ACTIVITYSTREAM_LINKEDIN_DEFAULT_LABEL));
      }
    

    The first argument of t() must be a literal string, not a dynamic value.

Brian294’s picture

Status: Needs work » Needs review
StatusFileSize
new3.39 KB

Thank you for your valuable input. File attached.

avpaderno’s picture

Status: Needs review » Needs work
  1. ; Information added by drupal.org packaging script on 2009-03-01
    version = "6.x-1.x-dev"
    core = "6.x"
    project = "activitystream_linkedin"
    datestamp = "1254885917"
    

    That text needs to be removed, as it is added from the packaging script. I don't see any reason to add it; the module works the same without, and the module cannot have it if it has not been submitted in Drupal.org CVS.

  2.   $name = theme('activitystream_username', $user);
      $label = check_plain(variable_get('activitystream_linkedin_label', ACTIVITYSTREAM_LINKEDIN_DEFAULT_LABEL));
    
      return '<span class=\"activitystream-item\">'. theme('activitystream_linkedin_icon')   . " <span>$name$label" . l($node->title, $activity->link) ." <span class=\"activitystream-created\">$date</span></span>". l('#', 'node/'. $node->nid, array('class' => 'permalink')) .'</span>';
    }
    

    Strings presented to the user must be translatable.

  3.   if (!node_access('view', $node)) {
        return; // if current user has no access to node, exit.
      }
    

    A theme function should always return a value, even if it would be an empty string.

Brian294’s picture

Status: Needs work » Needs review
StatusFileSize
new3.33 KB

You are making me a better programmer. Thank you :-) File attached.

avpaderno’s picture

Status: Needs review » Fixed
    $user->feed = $user->feed;

What is the purpose of that code line? In PHP, it doesn't do anything, if not assigning to $user->feed the value it already has.

  return '<span class=\"activitystream-item\">'. theme('activitystream_linkedin_icon')   . " <span>$name" . t($label) . l($node->title, $activity->link) ." <span class=\"activitystream-created\">" . t($date) . "</span></span>". l('#', 'node/'. $node->nid, array('class' => 'permalink')) .'</span>';

The first argument of t() must be a literal string, not a dynamic value; passing a dynamic value to t() is like not calling it at all (that means, nothing is translated). If the alternative is this code, then it is better to remove the call to t().

Brian294’s picture

StatusFileSize
new3.32 KB

thank you for approving my account. :-) I removed the excess from my code as you have indicated. I had originally written the user screen to accept a key that would be appended to the end of a hard-coded feed url. When i changed my methodology, I didn't reflect that change 100% in my code.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

avpaderno’s picture

Component: Miscellaneous » new project application
Assigned: Unassigned » avpaderno
Issue summary: View changes
Status: Closed (fixed) » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.