public
Description: Git mirror of the CMS Made Simple 2.0 rewrite
Homepage: http://cmsmadesimple.org
Clone URL: git://github.com/tedkulp/cmsmadesimple-2-0.git
Search Repo:
Add $force parameter to load_parameters.  Allows us to not reload 
properties everytime a default language fallback is used.

Signed-off-by: Ted Kulp <ted@cmsmadesimple.org>


git-svn-id: http://svn.cmsmadesimple.org/svn/cmsmadesimple/trunk@4250 
3d254a34-79dc-0310-9e5f-be208747d8a0
tedkulp (author)
Thu Nov 15 13:00:50 -0800 2007
commit  ae8c45928232f690aa8713853d66df8b74759bf0
tree    c91a99db46b69c5f24b65c436ab5e80566104419
parent  15f5f25f04a53414848baf051beda1c723f76460
...
224
225
226
227
228
 
229
230
231
232
233
234
...
279
280
281
282
 
283
284
285
286
 
287
288
289
 
 
290
291
 
 
 
 
 
292
293
294
...
312
313
314
315
 
316
317
318
...
224
225
226
 
 
227
228
229
230
231
232
233
...
278
279
280
 
281
282
 
 
 
283
284
 
 
285
286
287
 
288
289
290
291
292
293
294
295
...
313
314
315
 
316
317
318
319
0
@@ -224,8 +224,7 @@
0
   
0
   function set_property_value($name, $value, $lang = 'en_US')
0
   {
0
- if ($this->prop_names != '' && count($this->mProperties) == 0)
0
- $this->load_properties();
0
+ $this->load_properties(false);
0
 
0
     foreach ($this->mProperties as &$prop)
0
     {
0
0
0
0
@@ -279,16 +278,18 @@
0
     return in_array($name, explode(',', $this->prop_names));
0
   }
0
   
0
- function load_properties()
0
+ function load_properties($force = true)
0
   {
0
- //No go. Ok, load all of them...
0
- $props = cmsms()->content_property->find_all_by_content_id($this->id);
0
- foreach ($props as &$prop)
0
+ if ($force || $this->prop_names != '' && count($this->mProperties) == 0)
0
     {
0
- //Make sure we don't overwrite any newly set properties
0
- if (!in_array($prop->name, $this->get_loaded_property_names()))
0
+ $props = cmsms()->content_property->find_all_by_content_id($this->id);
0
+ foreach ($props as &$prop)
0
       {
0
- $this->mProperties[] = $prop;
0
+ //Make sure we don't overwrite any newly set properties
0
+ if (!in_array($prop->name, $this->get_loaded_property_names()))
0
+ {
0
+ $this->mProperties[] = $prop;
0
+ }
0
       }
0
     }
0
   }
0
@@ -312,7 +313,7 @@
0
         }
0
       }
0
       
0
- $this->load_properties();
0
+ $this->load_properties(false);
0
       
0
       //Loop through and see if it's loaded now
0
       foreach ($this->mProperties as &$prop)

Comments

    No one has commented yet.