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

Diff of /contributions/modules/addressbook/addressbook.module

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

revision 1.29 by wplaat, Wed Sep 16 18:41:09 2009 UTC revision 1.30 by wplaat, Wed Sep 16 19:03:47 2009 UTC
# Line 34  define('THUMBNAILS_DIR', file_director Line 34  define('THUMBNAILS_DIR', file_director
34   * help hook()   * help hook()
35   * @return help texts   * @return help texts
36   */   */
37  function addressbook_help($section) {  function addressbook_help($path, $arg) {
38    
39    $output = '';    $output = '';
40    switch ($section) {    switch ($path) {
41      case 'admin/modules#description':      case 'admin/modules#description':
42        $output .= t('Addressbook module');        $output .= t('Addressbook module');
43        break;        break;
# Line 49  function addressbook_help($section) { Line 49  function addressbook_help($section) {
49   * menu hook()   * menu hook()
50   * @return array of menu items   * @return array of menu items
51   */   */
52  function addressbook_menu() {  function addressbook_menu()
53    {
   $items = array();  
54    
55    $items[] = array('path' => URL_FAMILY_LIST,    $items[URL_FAMILY_LIST] = array(
56                     'title' => t('Addressbook family list'),                     'title' => 'Addressbook family list',
57                     'callback' => 'family_list',                     'page callback' => 'family_list',
58                     'access' => user_access('view addressbook'),                     'access arguments' => array('view addressbook'),
59                     'type' => MENU_CALLBACK);                     'type' => MENU_CALLBACK,
60                    );
61    $items[] = array('path' => URL_FAMILY_VIEW,  
62                     'title' => t('Addressbook view family'),    $items[URL_FAMILY_VIEW] = array(
63                     'callback' => 'family_view2',                     'title' => 'Addressbook view family',
64                     'access' => user_access('view addressbook'),                     'page callback' => 'family_view2',
65                     'type' => MENU_CALLBACK);                     'access arguments' => array('view addressbook'),
66                       'type' => MENU_CALLBACK,
67    $items[] = array('path' => URL_FAMILY_EDIT,                  );
68                     'title' => t('Addressbook edit family'),  
69                     'callback' => 'family_edit',    $items[URL_FAMILY_EDIT] = array(
70                     'access' => user_access('add address'),                     'title' => 'Addressbook edit family',
71                     'type' => MENU_CALLBACK);                     'page callback' => 'family_edit',
72                       'access arguments' => array('add address'),
73    $items[] = array('path' => URL_MEMBER_LIST,                     'type' => MENU_CALLBACK,
74                     'title' => t('Addressbook family list'),                  );
75                     'callback' => 'member_list',  
76                     'access' => user_access('view addressbook'),    $items[URL_MEMBER_LIST] = array(
77                     'type' => MENU_CALLBACK);                     'title' => 'Addressbook family list',
78                       'page callback' => 'member_list',
79    $items[] = array('path' => URL_MEMBER_VIEW,                     'access arguments' => array('view addressbook'),
80                     'title' => t('Addressbook view family member'),                     'type' => MENU_CALLBACK,
81                     'callback' => 'member_view',                          );
82                     'access' => user_access('view addressbook'),  
83                     'type' => MENU_CALLBACK);    $items[URL_MEMBER_VIEW] = array(
84                       'title' => 'Addressbook view family member',
85    $items[] = array('path' => URL_MEMBER_EDIT,                     'page callback' => 'member_view',
86                     'title' => t('Addressbook edit family member'),                     'access arguments' => array('view addressbook'),
87                     'callback' => 'member_edit',                     'type' => MENU_CALLBACK,
88                     'access' => user_access('add address'),                          );
89                     'type' => MENU_CALLBACK);  
90      $items[URL_MEMBER_EDIT] = array(
91    $items[] = array('path' => URL_PICTURE_VIEW,                     'title' => 'Addressbook edit family member',
92                     'title' => t('Addressbook view picture'),                     'page callback' => 'member_edit',
93                     'callback' => 'picture_view',                     'access arguments' => array('add address'),
94                     'access' => user_access('view addressbook'),                     'type' => MENU_CALLBACK,
95                     'type' => MENU_CALLBACK);                          );
96    
97    $items[] = array('path' => URL_PICTURE_EDIT,    $items[URL_PICTURE_VIEW] = array(
98                     'title' => t('Addressbook edit picture'),                     'title' => 'Addressbook view picture',
99                     'callback' => 'picture_edit',                     'page callback' => 'picture_view',
100                     'access' => user_access('add address'),                     'access arguments' => array('view addressbook'),
101                     'type' => MENU_CALLBACK);                     'type' => MENU_CALLBACK,
102                    );
103    $items[] = array('path' => URL_UPLOAD_CSV,  
104                     'title' => t('Addressbook CSV upload'),    $items[URL_PICTURE_EDIT] = array(
105                     'callback' => 'upload_csv',                     'title' => 'Addressbook edit picture',
106                     'access' => user_access('add address'),                     'page callback' => 'picture_edit',
107                     'type' => MENU_CALLBACK);                     'access arguments' => array('add address'),
108                       'type' => MENU_CALLBACK,
109    $items[] = array('path' => URL_DOWNLOAD_CSV,                          );
110                     'title' => t('Addressbook CSV download'),  
111                     'callback' => 'download_csv',    $items[URL_UPLOAD_CSV] = array(
112                     'access' => user_access('add address'),                     'title' => 'Addressbook CSV upload',
113                     'type' => MENU_CALLBACK);                     'page callback' => 'upload_csv',
114                       'access arguments' => array('add address'),
115     $items[] = array('path' => URL_SEARCH,                     'type' => MENU_CALLBACK,
116                     'title' => t('Addressbook search'),                  );
117                     'callback' => 'general_search',  
118                     'access' => user_access('view addressbook'),    $items[URL_DOWNLOAD_CSV] = array(
119                     'type' => MENU_CALLBACK);                     'title' => 'Addressbook CSV download',
120                       'page callback' => 'download_csv',
121     $items[] = array('path' => URL_MAP_VIEW,                     'access arguments' => array('add address'),
122                     'title' => t('Addressbook map view'),                     'type' => MENU_CALLBACK,
123                     'callback' => 'map_view',                  );
124                     'access' => user_access('view addressbook'),  
125                     'type' => MENU_CALLBACK);     $items[URL_SEARCH] = array(
126                       'title' => 'Addressbook search',
127     $items[] = array('path' => URL_EMAIL,                     'page callback' => 'general_search',
128                     'title' => t('Addressbook email view'),                     'access arguments' => array('view addressbook'),
129                     'callback' => 'email_view',                     'type' => MENU_CALLBACK,
130                     'access' => user_access('add address'),                  );
131                     'type' => MENU_CALLBACK);  
132       $items[URL_MAP_VIEW] = array(
133     $items[] = array('path' => 'admin/settings/addressbook',                     'title' => 'Addressbook map view',
134                     'title' => t('Addressbook'),                     'page callback' => 'map_view',
135                     'description' => t('Settings of addressbook.'),                     'access arguments' => array('view addressbook'),
136                     'callback' => 'drupal_get_form',                     'type' => MENU_CALLBACK,
137                     'callback arguments' => array('addressbook_settings'),                  );
138                     'access' => user_access('administer site configuration'),  
139                     'type' => MENU_NORMAL_ITEM);     $items[URL_EMAIL] = array(
140                       'title' => 'Addressbook email view',
141                       'page callback' => 'email_view',
142                       'access arguments' => array('add address'),
143                       'type' => MENU_CALLBACK,
144                    );
145    
146       $items['admin/settings/addressbook'] = array(
147                       'title' => 'Addressbook',
148                       'description' => 'Settings of addressbook.',
149                       'page callback' => 'drupal_get_form',
150                       'page arguments' => array('addressbook_settings'),
151                       'access arguments' => array('administer site configuration'),
152                       'type' => MENU_NORMAL_ITEM,
153                    );
154    
155    return $items;    return $items;
156  }  }
# Line 308  function addressbook_cron() { Line 321  function addressbook_cron() {
321            $message = str_replace("%user_age", $user_age, $message);            $message = str_replace("%user_age", $user_age, $message);
322            $message = str_replace("%site_name", $site_name, $message);            $message = str_replace("%site_name", $site_name, $message);
323    
324              if ( drupal_mail( "addressbook", $email, $subject, $message, $from))            //if ( drupal_mail('addressbook', 'notice', $account->mail, user_preferred_language($account), $params);
325              {            if ( drupal_mail( "addressbook", $email, $subject, $message, $from))
326               watchdog('cron', t('Sent birthday email to ').$email);            {
327                watchdog('cron', t('Sent birthday email to ').$email);
328            }            }
329            else            else
330            {            {
# Line 2820  function picture_edit( $mid=0 ) { Line 2834  function picture_edit( $mid=0 ) {
2834           {           {
2835              chmod(IMAGE_DIR.'/'.$filename, 0666);              chmod(IMAGE_DIR.'/'.$filename, 0666);
2836           }           }
2837    
2838        }        }
2839        else        else
2840        {        {

Legend:
Removed from v.1.29  
changed lines
  Added in v.1.30

  ViewVC Help
Powered by ViewVC 1.1.3