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

Diff of /contributions/modules/statistics_advanced/statistics_advanced.module

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

revision 1.1.2.21, Wed Jan 14 02:29:35 2009 UTC revision 1.1.2.22, Mon Mar 2 22:33:27 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: statistics_advanced.module,v 1.1.2.20 2009/01/14 02:07:33 davereid Exp $  // $Id: statistics_advanced.module,v 1.1.2.21 2009/01/14 02:29:35 davereid Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 194  function _statistics_advanced_ignore($ty Line 194  function _statistics_advanced_ignore($ty
194  }  }
195    
196  /**  /**
197   * Internal default variables for statistics_advanced_variable_get().   * Internal default variables for statistics_advanced_var().
198   */   */
199  function statistics_advanced_variables() {  function statistics_advanced_variables() {
200    return array(    return array(
# Line 211  function statistics_advanced_variables() Line 211  function statistics_advanced_variables()
211  /**  /**
212   * Internal implementation of variable_get().   * Internal implementation of variable_get().
213   */   */
214  function statistics_advanced_var($name) {  function statistics_advanced_var($name, $default = NULL) {
215    static $defaults = NULL;    static $defaults = NULL;
216    if (!isset($defaults)) {    if (!isset($defaults)) {
217      $defaults = statistics_advanced_variables();      $defaults = statistics_advanced_variables();
# Line 221  function statistics_advanced_var($name) Line 221  function statistics_advanced_var($name)
221    
222    // @todo Remove when I stop making spelling errors in variable names.    // @todo Remove when I stop making spelling errors in variable names.
223    if (!isset($defaults[$name])) {    if (!isset($defaults[$name])) {
224      watchdog('statistics_adv', 'Default variable for %variable not found.', array('%variable' => $name));      watchdog('statistics_adv', 'Default variable for %variable not found.', array('%variable' => $name), WATCHDOG_WARNING);
225    }    }
226    
227    return variable_get($name, isset($defaults[$name]) ? $defaults[$name] : NULL);    return variable_get($name, isset($default) || !isset($defaults[$name]) ? $default : $defaults[$name]);
228  }  }

Legend:
Removed from v.1.1.2.21  
changed lines
  Added in v.1.1.2.22

  ViewVC Help
Powered by ViewVC 1.1.2