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

Diff of /contributions/modules/flag_content/flag_content.module

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

revision 1.6.2.12.2.5, Thu Sep 18 18:14:03 2008 UTC revision 1.6.2.12.2.6, Wed Mar 18 15:37:43 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: flag_content.module,v 1.6.2.12.2.4 2008/06/19 18:38:11 kbahey Exp $  // $Id: flag_content.module,v 1.6.2.12.2.5 2008/09/18 18:14:03 kbahey Exp $
3    
4  // Copyright 2006-2007 Khalid Baheyeldin http://2bits.com  // Copyright 2006-2007 Khalid Baheyeldin http://2bits.com
5    
# Line 14  define('FLAG_CONTENT_TYPE_NODE', 'nod Line 14  define('FLAG_CONTENT_TYPE_NODE', 'nod
14  define('FLAG_CONTENT_TYPE_USER',    'user');  define('FLAG_CONTENT_TYPE_USER',    'user');
15  define('FLAG_CONTENT_TYPE_COMMENT', 'comment');  define('FLAG_CONTENT_TYPE_COMMENT', 'comment');
16  define('FLAG_CONTENT_TRANS_LINK',   'flag_content_trans_link');  define('FLAG_CONTENT_TRANS_LINK',   'flag_content_trans_link');
17    define('FLAG_CONTENT_FORM_REQUIRE_NAME',   'flag_content_form_require_name');
18    define('FLAG_CONTENT_FORM_REQUIRE_EMAIL',   'flag_content_form_require_email');
19    define('FLAG_CONTENT_FORM_REQUIRE_REASON',   'flag_content_form_require_reason');
20    
21  /**  /**
22   * Purpose: Returns an array of common translation placeholders   * Purpose: Returns an array of common translation placeholders
# Line 115  function flag_content_admin_settings() { Line 118  function flag_content_admin_settings() {
118      '#default_value' => variable_get(FLAG_CONTENT_COMMENT, 0),      '#default_value' => variable_get(FLAG_CONTENT_COMMENT, 0),
119    );    );
120    
121      $form['flag_form'] = array(
122        '#type' => 'fieldset',
123        '#title' => t('Required fields when flagging'),
124      );
125      $form['flag_form'][FLAG_CONTENT_FORM_REQUIRE_NAME] = array(
126        '#type' => 'checkbox',
127        '#title' => t('Require name'),
128        '#return_value' => 1,
129        '#default_value' => variable_get(FLAG_CONTENT_FORM_REQUIRE_NAME,0),
130      );
131      $form['flag_form'][FLAG_CONTENT_FORM_REQUIRE_EMAIL] = array(
132        '#type' => 'checkbox',
133        '#title' => t('Require email'),
134        '#return_value' => 1,
135        '#default_value' => variable_get(FLAG_CONTENT_FORM_REQUIRE_EMAIL,0),
136      );
137      $form['flag_form'][FLAG_CONTENT_FORM_REQUIRE_REASON] = array(
138        '#type' => 'checkbox',
139        '#title' => t('Require reason'),
140        '#return_value' => 1,
141        '#default_value' => variable_get(FLAG_CONTENT_FORM_REQUIRE_REASON,0),
142      );
143    
144    $form['link'][FLAG_CONTENT_TRANS_LINK] = array(    $form['link'][FLAG_CONTENT_TRANS_LINK] = array(
145      '#type' => 'textfield',      '#type' => 'textfield',
146      '#title' => t('Link text'),      '#title' => t('Link text'),
# Line 292  function flag_content_add($eid = 0, $typ Line 318  function flag_content_add($eid = 0, $typ
318    $form['name'] = array(    $form['name'] = array(
319          '#type' => 'textfield',          '#type' => 'textfield',
320          '#title' => t('Name'),          '#title' => t('Name'),
321          '#required' => TRUE,          '#required' => variable_get(FLAG_CONTENT_FORM_REQUIRE_NAME,0),
322          '#default_value' => ($user->name) ? $user->name : ''          '#default_value' => ($user->name) ? $user->name : ''
323    );    );
324    
325    $form['mail'] = array(    $form['mail'] = array(
326          '#type' => 'textfield',          '#type' => 'textfield',
327          '#title' => t('Email'),          '#title' => t('Email'),
328          '#required' => TRUE,          '#required' => variable_get(FLAG_CONTENT_FORM_REQUIRE_EMAIL,0),
329          '#default_value' => ($user->mail) ? $user->mail : ''          '#default_value' => ($user->mail) ? $user->mail : ''
330    );    );
331    
332    $form['reason'] = array(    $form['reason'] = array(
333          '#type' => 'textarea',          '#type' => 'textarea',
334          '#title' => t('Reason'),          '#title' => t('Reason'),
335          '#required' => TRUE,          '#required' => variable_get(FLAG_CONTENT_FORM_REQUIRE_REASON,0),
336          '#rows' => 8,          '#rows' => 8,
337          '#description' => t('Why are you flagging this item?')          '#description' => t('Why are you flagging this item?')
338    );    );
# Line 456  function theme_flag_content_view($list = Line 482  function theme_flag_content_view($list =
482        $ops .= ' ' . l(t('unflag'), "flag_content/unflag/$entry->eid/$entry->type");        $ops .= ' ' . l(t('unflag'), "flag_content/unflag/$entry->eid/$entry->type");
483        $ops .= ' ' . l(t('delete'), $delete);        $ops .= ' ' . l(t('delete'), $delete);
484        $rows[] = array($item, $type, $by, $timestamp, $ops);        $rows[] = array($item, $type, $by, $timestamp, $ops);
485        $rows[] = array(array('data' => 'Reason: '.$entry->reason, 'colspan' => 5));        $rows[] = array(array('data' => 'Reason: '. check_markup($entry->reason), 'colspan' => 5));
486      }      }
487    }    }
488    else {    else {
# Line 536  function theme_flag_content_mail($entry Line 562  function theme_flag_content_mail($entry
562      '@manage' => url('admin/content/flag_content', NULL, NULL, 1),      '@manage' => url('admin/content/flag_content', NULL, NULL, 1),
563      ));      ));
564    
565      $body = check_markup($body);
566    
567    $to = check_plain($to);    $to = check_plain($to);
568    $mail = check_plain($mail);    $mail = check_plain($mail);
569    $name = check_plain($name);    $name = check_plain($name);

Legend:
Removed from v.1.6.2.12.2.5  
changed lines
  Added in v.1.6.2.12.2.6

  ViewVC Help
Powered by ViewVC 1.1.2