Dotclear


Ignore:
Timestamp:
11/17/13 20:25:53 (12 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
2.6
Children:
2567:6c11245cbf04, 2568:61c67a7d17fa
Message:

Add some people in CREDITS, remove trailing spaces and tabs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • inc/core/class.dc.settings.php

    r1179 r2566  
    2525     protected $table;        ///< <b>string</b> Settings table name 
    2626     protected $blog_id;      ///< <b>string</b> Blog ID 
    27       
     27 
    2828     protected $namespaces = array();        ///< <b>array</b> Associative namespaces array 
    29       
     29 
    3030     protected $ns;           ///< <b>string</b> Current namespace 
    31       
     31 
    3232     /** 
    3333     Object constructor. Retrieves blog settings and puts them in $namespaces 
    3434     array. Local (blog) settings have a highest priority than global settings. 
    35       
     35 
    3636     @param    core      <b>dcCore</b>       dcCore object 
    3737     @param    blog_id   <b>string</b>       Blog ID 
     
    4444          $this->loadSettings(); 
    4545     } 
    46       
    47      /** 
    48      Retrieves all namespaces (and their settings) from database, with one query.  
     46 
     47     /** 
     48     Retrieves all namespaces (and their settings) from database, with one query. 
    4949     */ 
    5050     private function loadSettings() 
     
    6161               trigger_error(__('Unable to retrieve namespaces:').' '.$this->con->error(), E_USER_ERROR); 
    6262          } 
    63            
     63 
    6464          /* Prevent empty tables (install phase, for instance) */ 
    6565          if ($rs->isEmpty()) { 
    6666               return; 
    6767          } 
    68            
     68 
    6969          do { 
    7070               $ns = trim($rs->f('setting_ns')); 
     
    7777          } while(!$rs->isStart()); 
    7878     } 
    79            
    80       
     79 
     80 
    8181     /** 
    8282     Create a new namespace. If the namespace already exists, return it without modification. 
    83       
     83 
    8484     @param    ns   <b>string</b>       Namespace name 
    8585     @return   <b>dcNamespace</b>  The namespace created 
     
    139139          return true; 
    140140     } 
    141       
     141 
    142142     /** 
    143143     Returns full namespace with all settings pertaining to it. 
    144       
     144 
    145145     @param    ns   <b>string</b>       Namespace name 
    146146     @return   <b>dcNamespace</b> 
     
    150150          return $this->namespaces[$ns]; 
    151151     } 
    152       
     152 
    153153     /** 
    154154     Magic __get method. 
     
    165165          return $this->get($n); 
    166166     } 
    167       
     167 
    168168     /** 
    169169     Magic __set method. 
     
    174174          $this->set($n,$v); 
    175175     } 
    176       
     176 
    177177     /** 
    178178     Returns $namespaces property content. 
    179       
     179 
    180180     @return   <b>array</b> 
    181181     */ 
     
    184184          return $this->namespaces; 
    185185     } 
    186       
    187      /** 
    188      Raises a E_USER_NOTICE errror for deprecated functions.  
     186 
     187     /** 
     188     Raises a E_USER_NOTICE errror for deprecated functions. 
    189189     This allows the developer to know he's been using deprecated functions. 
    190       
     190 
    191191     @param    name <b>string</b>  Name of the deprecated function that was called. 
    192192     */ 
     
    202202          } 
    203203     } 
    204       
     204 
    205205     /** 
    206206     @deprecated Please set your settings via $core->blog->settings->{namespace}->{setting} 
    207       
     207 
    208208     Sets a setting in $settings property. This sets the setting for script 
    209209     execution time only and if setting exists. 
    210       
     210 
    211211     @param    n         <b>string</b>       Setting name 
    212212     @param    v         <b>mixed</b>        Setting value 
     
    217217          // a setting directly, without passing via a namespace. 
    218218          $this->raiseDeprecated('old_style_set'); 
    219            
     219 
    220220          if (!$this->ns) { 
    221221               throw new Exception(__('No namespace specified')); 
    222222          } 
    223            
     223 
    224224          if (isset($this->namespaces[$this->ns]->$n)) { 
    225225               $this->namespaces[$this->ns]->$n['value'] = $v; 
     
    234234          } 
    235235     } 
    236       
     236 
    237237     /** 
    238238     @deprecated Please access your settings via $core->blog->settings->{namespace}->... 
    239       
     239 
    240240     Sets a working namespace. You should do this before accessing any setting. 
    241       
     241 
    242242     @param    ns        <b>string</b>       Namespace name 
    243243     */ 
     
    251251          } 
    252252     } 
    253       
     253 
    254254     /** 
    255255     @deprecated Please set your settings via $core->blog->settings->{namespace}->put() 
    256       
     256 
    257257     Creates or updates a setting. 
    258       
     258 
    259259     $type could be 'string', 'integer', 'float', 'boolean' or null. If $type is 
    260260     null and setting exists, it will keep current setting type. 
    261       
     261 
    262262     $value_change allow you to not change setting. Useful if you need to change 
    263263     a setting label or type and don't want to change its value. 
    264       
     264 
    265265     Don't forget to set namespace before calling this method. 
    266       
     266 
    267267     @param    id             <b>string</b>       Setting ID 
    268268     @param    value          <b>mixed</b>        Setting value 
     
    284284          $this->namespaces[$this->ns]->put($id, $value, $type, $label, $value_change, $global); 
    285285     } 
    286       
     286 
    287287     /** 
    288288     @deprecated Please get your settings via $core->blog->settings->{namespace}->{setting} 
    289       
     289 
    290290     Returns setting value if exists. 
    291       
     291 
    292292     @param    n         <b>string</b>       Setting name 
    293293     @return   <b>mixed</b> 
     
    307307               } 
    308308          } 
    309            
     309 
    310310          return null; 
    311311     } 
    312       
     312 
    313313     /** 
    314314     @deprecated Please get your settings via $core->blog->settings->{namespace}->dumpSettings 
    315       
     315 
    316316     Returns all settings content. 
    317       
     317 
    318318     @return   <b>array</b> 
    319319     */ 
     
    323323          // the settings directly, without passing via a namespace. 
    324324          $this->raiseDeprecated('dumpSettings'); 
    325            
     325 
    326326          $settings = array(); 
    327327          // Parse all the namespaces 
     
    329329               $settings = array_merge($settings, $this->namespaces[$ns]->dumpSettings()); 
    330330          } 
    331            
     331 
    332332          return $settings; 
    333333     } 
    334       
     334 
    335335     /** 
    336336     @deprecated Please get your settings via $core->blog->settings->{namespace}->dumpGlobalSettings 
    337       
     337 
    338338     Returns all global settings content. 
    339       
     339 
    340340     @return   <b>array</b> 
    341341     */ 
     
    345345          // the settings directly, without passing via a namespace. 
    346346          $this->raiseDeprecated('dumpGlobalSettings'); 
    347            
     347 
    348348          $settings = array(); 
    349349          // Parse all the namespaces 
     
    351351               $settings = array_merge($settings, $this->namespaces[$ns]->dumpGlobalSettings()); 
    352352          } 
    353            
     353 
    354354          return $settings; 
    355355     } 
     
    359359     <b>$params</b> is an array taking the following 
    360360     optionnal parameters: 
    361       
     361 
    362362     - ns : retrieve setting from given namespace 
    363363     - id : retrieve only settings corresponding to the given id 
    364       
     364 
    365365     @param    params         <b>array</b>        Parameters 
    366      @return   <b>record</b>  A record  
     366     @return   <b>record</b>  A record 
    367367     */ 
    368368     public function getGlobalSettings($params=array()) 
     
    392392     /** 
    393393     Updates a setting from a given record 
    394       
     394 
    395395     @param    rs        <b>record</b>       the setting to update 
    396396     */ 
    397      public function updateSetting($rs)  
     397     public function updateSetting($rs) 
    398398     { 
    399399          $cur = $this->con->openCursor($this->table); 
     
    411411          $cur->update($where."AND setting_id = '".$this->con->escape($cur->setting_id)."' AND setting_ns = '".$this->con->escape($cur->setting_ns)."' "); 
    412412     } 
    413       
     413 
    414414     /** 
    415415     Drops a setting from a given record 
    416       
     416 
    417417     @param    rs        <b>record</b>       the setting to drop 
    418418     @return   int       number of deleted records (0 if setting does not exist) 
     
    429429     } 
    430430} 
    431 ?> 
Note: See TracChangeset for help on using the changeset viewer.

Sites map