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

Diff of /contributions/modules/rotor/rotor.module

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

revision 1.2.2.18.2.32, Thu Nov 5 10:55:18 2009 UTC revision 1.2.2.18.2.33, Thu Nov 5 11:06:16 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: rotor.module,v 1.2.2.18.2.31 2009/11/05 10:27:29 mrfelton Exp $  // $Id: rotor.module,v 1.2.2.18.2.32 2009/11/05 10:55:18 mrfelton Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 125  function rotor_form($node, &$param) { Line 125  function rotor_form($node, &$param) {
125    
126    
127    if (module_exists('upload')) {    if (module_exists('upload')) {
128      $upload_uploadsize_default = variable_get('upload_uploadsize_default', 1) * 1048576;      $file_limit = variable_get('upload_uploadsize_default', 1);
129      $max_size = variable_get('upload_uploadsize_'. $user->rid, $upload_uploadsize_default);      foreach ($user->roles as $rid => $name) {
130          // A zero value indicates no limit, take the least restrictive limit.
131          $file_size = variable_get("upload_uploadsize_$rid", variable_get('upload_uploadsize_default', 1)) * 1024 * 1024;
132          $file_limit = ($file_limit && $file_size) ? max($file_limit, $file_size) : 0;
133        }
134    }    }
135    
136    $form['image']['rotor_image'] = array(    $form['image']['rotor_image'] = array(
# Line 134  function rotor_form($node, &$param) { Line 138  function rotor_form($node, &$param) {
138      '#title' => t('Rotor image'),      '#title' => t('Rotor image'),
139      '#default_value' => $node->fid,      '#default_value' => $node->fid,
140      '#file_validators' => array(      '#file_validators' => array(
141        'file_validate_size' => !empty($max_size)? array($max_size) : NULL,        'file_validate_size' => !empty($file_limit)? array($file_limit) : NULL,
142      ),      ),
143    );    );
144    $form['image']['alt_text'] = array(    $form['image']['alt_text'] = array(

Legend:
Removed from v.1.2.2.18.2.32  
changed lines
  Added in v.1.2.2.18.2.33

  ViewVC Help
Powered by ViewVC 1.1.2