/[drupal]/contributions/modules/signup/theme/node.inc
ViewVC logotype

Contents of /contributions/modules/signup/theme/node.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.3 - (show annotations) (download) (as text)
Thu Jan 22 18:59:29 2009 UTC (10 months ago) by dww
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -79 lines
File MIME type: text/x-php
#51226 by dww: Added the ability to edit existing signups.
- Added an "edit own signups" permission.
- The current signup information is now displayed via a form, not a table.
  The form is disabled at first, but if the user has permission to
  edit their signup, there's an "Edit" button that they can click
  which enables all the form elements and renames itself "Save".
- Added an "User: Edit signup link" views field handler.
API changes resulting from this feature:
- Canceling your own signup is now handled via the "signup_edit_form"
  instead of a separate "signup_cancel_form".
- Removed a bunch of deprecated theme functions since the signup is
  now displayed via a form, not a table: theme_signup_current_signup(),
  theme_signup_custom_data_table(), and theme_signup_custom_data_rows().
- Renamed theme_signup_email_token_anonymous_username() to be
  theme_signup_anonymous_username() since it's now used for other things.
1 <?php
2 // $Id: node.inc,v 1.2 2009/01/07 00:55:00 dww Exp $
3
4
5 /**
6 * @file
7 * Theme functions when viewing a signup-enabled node.
8 */
9
10 /**
11 * Controls the output displayed if this node is closed for signups.
12 *
13 * @param $node
14 * The fully loaded node object.
15 * @param $current_signup
16 * If the user already signed up, an HTML representation of their current
17 * signup information, otherwise an empty string.
18 *
19 * @return
20 * Themed output to display for a node with closed signups.
21 *
22 * @see _signup_node_output()
23 * @see _signup_print_current_signup()
24 */
25 function theme_signup_signups_closed($node, $current_signup = '') {
26 $output = '<h3>'. t('Signups closed for this %node_type', array('%node_type' => node_get_types('name', $node->type))) .'</h3>';
27 $output .= $current_signup;
28 return $output;
29 }
30
31 /**
32 * Controls the output for anonymous users who can't signup.
33 *
34 * @param $anon_login_text
35 * The translated HTML help text telling users to login (and if allowed on
36 * this site, register) so they can signup, including login/register links.
37 *
38 * @return
39 * The themed HTML to display the login (and maybe register) help text.
40 */
41 function theme_signup_anonymous_user_login_text($anon_login_text) {
42 if (!empty($anon_login_text)) {
43 return '<div class="signup_anonymous_login">'. $anon_login_text .'</div>';
44 }
45 }
46
47 /**
48 * Return HTML desired at the top of the signup output for a node.
49 *
50 * @param $node
51 * The fully loaded node object to generate a header for.
52 *
53 * @return
54 * HTML to display at the top of the signup output.
55 *
56 * @see _signup_node_output()
57 */
58 function theme_signup_node_output_header($node) {
59 return '<a name="signup"></a>';
60 }

  ViewVC Help
Powered by ViewVC 1.1.2