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

Diff of /contributions/modules/spaces/spaces.module

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

revision 1.25.4.33.2.29, Sun Sep 6 17:09:18 2009 UTC revision 1.25.4.33.2.30, Thu Sep 10 16:06:57 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: spaces.module,v 1.25.4.33.2.28 2009/09/05 21:56:45 yhahn Exp $  // $Id: spaces.module,v 1.25.4.33.2.29 2009/09/06 17:09:18 yhahn Exp $
3    
4  define('SPACES_FEATURE_DISABLED', 0);  define('SPACES_FEATURE_DISABLED', 0);
5    
# Line 744  function spaces_preset_enforce(&$space, Line 744  function spaces_preset_enforce(&$space,
744      // Weights are a bit trickier      // Weights are a bit trickier
745      // Sorting features in a preset according to their weights      // Sorting features in a preset according to their weights
746      if (isset($preset['weights']) && is_array($preset['weights'])) {      if (isset($preset['weights']) && is_array($preset['weights'])) {
747          // Exclude any weight values that don't correspond to entries in the features array.
748          $preset['weights'] = array_intersect_key($preset['weights'], $space->features);
749    
750          // Fill in excessively high weight entries for any features that don't exist in
751          // the weights array.
752          $i = 0;
753          foreach (array_diff_key($space->features, $preset['weights']) as $feature) {
754            $preset['weights'][$feature] = 1000 + $i;
755            $i++;
756          }
757    
758        // Ensure the keys line up to begin with        // Ensure the keys line up to begin with
759        ksort($preset['weights']);        ksort($preset['weights']);
760        ksort($space->features);        ksort($space->features);

Legend:
Removed from v.1.25.4.33.2.29  
changed lines
  Added in v.1.25.4.33.2.30

  ViewVC Help
Powered by ViewVC 1.1.2