/[drupal]/contributions/modules/notify_by_views/notify_by_views.module
ViewVC logotype

Diff of /contributions/modules/notify_by_views/notify_by_views.module

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

revision 1.4, Thu Aug 28 16:46:38 2008 UTC revision 1.5, Thu Oct 2 21:45:40 2008 UTC
# Line 1  Line 1 
1  <?php  <?php
2  /* $Id: notify_by_views.module,v 1.3 2008/08/28 16:24:43 matt2000 Exp $ */  /* $Id: notify_by_views.module,v 1.4 2008/08/28 16:46:38 matt2000 Exp $ */
3  /**  /**
4   * Display help and module information   * Display help and module information
5   * @param section which section of the site we're displaying help   * @param section which section of the site we're displaying help
# Line 69  echo ""; Line 69  echo "";
69  function notify_by_views_form_alter($form_id, &$form) {  function notify_by_views_form_alter($form_id, &$form) {
70    
71    // Changing the users notify settings forms    // Changing the users notify settings forms
72    if($form_id == 'notify_user_settings_form'){    if($form_id == 'notify_user_settings_form' && count(variable_get('notify_by_views_select_views', array() ))>0 ){
73    
74      // Get the information user information for the form being generated.      // Get the information user information for the form being generated.
75      $account = user_load(array('uid' => $form['uid']['#value']));      $account = user_load(array('uid' => $form['uid']['#value']));
# Line 89  function notify_by_views_form_alter($for Line 89  function notify_by_views_form_alter($for
89      $form['notify_page_detailed']['node']['#title'] = t('Notify of ALL new content');      $form['notify_page_detailed']['node']['#title'] = t('Notify of ALL new content');
90      $period = variable_get('notify_send', 86400);      $period = variable_get('notify_send', 86400);
91      $period = $period==1000000000 ? 'never' : 'every '. format_interval($period);      $period = $period==1000000000 ? 'never' : 'every '. format_interval($period);
92      $form['notify_page_detailed']['node']['#description'] = t('Send me periodic notifications of ALL new website content, not just the content identified above. The site administrator has chose to send these notifications: '. $period .'. These may include duplicate content from your selected notifications.');      $form['notify_page_detailed']['node']['#description'] = t('Send me
93    periodic notifications of ALL new website content, not just the content
94    identified above. The site administrator has chose to send these
95    notifications: '. $period .'. These may include duplicate content from other selected notifications, if any have been designated above.');
96    
97      //Call validation funciton to make sure Notifications are enabled for the user.      //Call validation funciton to make sure Notifications are enabled for the user.
98      $form['#validate']['notify_by_views_user_settings_form_validate'] = array();      $form['#validate']['notify_by_views_user_settings_form_validate'] = array();
# Line 154  function notify_by_views_form_alter($for Line 157  function notify_by_views_form_alter($for
157  }  }
158    
159  function _notify_by_views_form_elements($form, $uid = NULL) {  function _notify_by_views_form_elements($form, $uid = NULL) {
160      foreach (variable_get('notify_by_views_select_views', '') AS $view_name) {      $view_desc = array();
161        foreach (variable_get('notify_by_views_select_views', array()) AS $view_name) {
162        $view = views_get_view($view_name);        $view = views_get_view($view_name);
163        $view_desc[] = $view->description;        if($view->description) {
164           $view_desc[] = $view->description;
165          }
166      }      }
167        if (count($view_desc)==0) {
168          return $form;
169        }
170    
171      $description = t('This website offers selectable notifications of the following content: ') . implode(", ", $view_desc);      $description = t('This website offers selectable notifications of the following content: ') . implode(", ", $view_desc);
172    
173        // Add a fieldset        // Add a fieldset

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

  ViewVC Help
Powered by ViewVC 1.1.2