/[drupal]/contributions/modules/views/includes/view.inc
ViewVC logotype

Diff of /contributions/modules/views/includes/view.inc

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

revision 1.151.2.21 by merlinofchaos, Wed Nov 18 02:33:19 2009 UTC revision 1.151.2.22 by merlinofchaos, Thu Nov 26 00:35:16 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: view.inc,v 1.151.2.20 2009/11/16 20:05:39 merlinofchaos Exp $  // $Id: view.inc,v 1.151.2.21 2009/11/18 02:33:19 merlinofchaos Exp $
3  /**  /**
4   * @file view.inc   * @file view.inc
5   * Provides the view object type and associated methods.   * Provides the view object type and associated methods.
# Line 557  class view extends views_db_object { Line 557  class view extends views_db_object {
557      $this->_pre_query();      $this->_pre_query();
558    
559      if ($this->display_handler->uses_exposed()) {      if ($this->display_handler->uses_exposed()) {
560        $exposed_form = $this->display_handler->get_exposed_form_plugin();        $exposed_form = $this->display_handler->get_plugin('exposed_form');
561        $this->exposed_widgets = $exposed_form->render_exposed_form();        $this->exposed_widgets = $exposed_form->render_exposed_form();
562        if (form_set_error() || !empty($this->build_info['abort'])) {        if (form_set_error() || !empty($this->build_info['abort'])) {
563          $this->built = TRUE;          $this->built = TRUE;
# Line 687  class view extends views_db_object { Line 687  class view extends views_db_object {
687        $cache = FALSE;        $cache = FALSE;
688      }      }
689      else {      else {
690        $cache = $this->display_handler->get_cache_plugin();        $cache = $this->display_handler->get_plugin('cache');
691      }      }
692      if ($cache && $cache->cache_get('results')) {      if ($cache && $cache->cache_get('results')) {
693        vpr('Used cached results');        vpr('Used cached results');
# Line 720  class view extends views_db_object { Line 720  class view extends views_db_object {
720        $this->start_query_capture();        $this->start_query_capture();
721      }      }
722    
723      $exposed_form = $this->display_handler->get_exposed_form_plugin();      $exposed_form = $this->display_handler->get_plugin('exposed_form');
724      $exposed_form->pre_render();      $exposed_form->pre_render();
725    
726      // Check for already-cached output.      // Check for already-cached output.
# Line 728  class view extends views_db_object { Line 728  class view extends views_db_object {
728        $cache = FALSE;        $cache = FALSE;
729      }      }
730      else {      else {
731        $cache = $this->display_handler->get_cache_plugin();        $cache = $this->display_handler->get_plugin('cache');
732      }      }
733      if ($cache && $cache->cache_get('output')) {      if ($cache && $cache->cache_get('output')) {
734        vpr('Used cached output');        vpr('Used cached output');
# Line 1365  class view extends views_db_object { Line 1365  class view extends views_db_object {
1365      $output .= $indent . '$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */' . "\n";      $output .= $indent . '$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */' . "\n";
1366    
1367      foreach ($this->display as $id => $display) {      foreach ($this->display as $id => $display) {
1368          $output .= $indent . "\n/* Display: $display->display_title */\n";
1369        $output .= $indent . '$handler = $view->new_display(' . views_var_export($display->display_plugin, $indent) . ', ' . views_var_export($display->display_title, $indent) . ', \'' . $id . "');\n";        $output .= $indent . '$handler = $view->new_display(' . views_var_export($display->display_plugin, $indent) . ', ' . views_var_export($display->display_title, $indent) . ', \'' . $id . "');\n";
1370        if (empty($display->handler)) {        if (empty($display->handler)) {
1371          // @todo -- probably need a method of exporting broken displays as          // @todo -- probably need a method of exporting broken displays as
# Line 1373  class view extends views_db_object { Line 1374  class view extends views_db_object {
1374          continue;          continue;
1375        }        }
1376    
1377        foreach ($display->handler->option_definition() as $option => $definition) {        $output .= $display->handler->export_options($indent, '$handler->options');
         // Special handling for some items  
         switch ($option) {  
           case 'defaults':  
             // skip these  
             break;  
           default:  
             if (!$display->handler->is_defaulted($option)) {  
               $value = $display->handler->get_option($option);  
               if ($id == 'default') {  
                 $default = isset($definition['default']) ? $definition['default'] : NULL;  
               }  
               else {  
                 $default = $this->display['default']->handler->get_option($option);  
               }  
   
               if ($value !== $default) {  
                 $output .= $indent . '$handler->override_option(\'' . $option . '\', ' . views_var_export($value, $indent) . ");\n";  
               }  
             }  
         }  
       }  
1378      }      }
1379    
1380      return $output;      return $output;

Legend:
Removed from v.1.151.2.21  
changed lines
  Added in v.1.151.2.22

  ViewVC Help
Powered by ViewVC 1.1.3