Because http://drupal.org/node/421304 is applied, the interface for userpoints_nc became actually quite ugly and pretty unusable.
Attached patch solves this by displaying the settings of point for node insertion as a table.

CommentFileSizeAuthor
userpoints_nc_theme.patch1.42 KBRolf van de Krol
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

gilgabar’s picture

Status: Needs review » Reviewed & tested by the community

Thank you. This is a much better way to present the point fields. All point assignment fields should be in tabular format.

Rolf van de Krol’s picture

This issue is RTBTC for quite a long time. Can module maintainer please take a look at it?

Berdir’s picture

Status: Reviewed & tested by the community » Needs work

Well, the thing is that the 6.x version isn't really maintained ;)

I ported the module to 7.x (ported actually means that the module has been pretty much rewritten and redesigned in this case) and I moved the node type specific settings to the node type form and only left the default settings in the userpoints settings form.

I'm not saying that you need to do this, it doesn't make sense for a single setting, the 7.x version actually has a few settings which are content type specific. But I also don't have time to really maintain the 6.x version, apart from commiting a few RTBC patches maybe.

Anyway, I can give you a code review...

+++ userpoints_nc.module	(revision 995)
@@ -127,7 +128,34 @@
+
+function userpoints_nc_theme() {

This needs the standard "Implementation of hook_theme()." doc comment. If you prefer, you can also use the D7 style: "Implements hook_theme()."

+++ userpoints_nc.module	(revision 995)
@@ -127,7 +128,34 @@
+function theme_userpoints_nc_node_settings($form) {

Same here, a short docblock which explains the theme function would be good.

+++ userpoints_nc.module	(revision 995)
@@ -127,7 +128,34 @@
+  foreach (node_get_types() as $type => $name) {

You can use $op 'names' to only receive an array of the names, see http://api.drupal.org/api/drupal/modules--node--node.module/function/nod...

+++ userpoints_nc.module	(revision 995)
@@ -127,7 +128,34 @@
+    $rows[] = $row;

You could save the additional line if you assign the array directly to $rows[]. Doesn't really matter though, if you prefer it like this, leave it.

+++ userpoints_nc.module	(revision 995)
@@ -127,7 +128,34 @@
+  $header = array(t('Type'), t('!Points', userpoints_translation()), t('Category'));

Maybe use Content type instead of just Type to make it clearer?

+++ userpoints_nc.module	(revision 995)
@@ -127,7 +128,34 @@
+  $output = theme('table',$header,$rows);

Missing space after comma.

Powered by Dreditor.