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
Added language selector
Added few fixes to the admin header and removed var_dump's from the orm

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


git-svn-id: http://svn.cmsmadesimple.org/svn/cmsmadesimple/trunk@4241 
3d254a34-79dc-0310-9e5f-be208747d8a0
tedkulp (author)
Tue Nov 13 05:30:17 -0800 2007
commit  7db12b65e34fd709849e8d46bd693d2e04e86e2d
tree    b14f8a0f15d920acac071fb2826fea4e3cf412e8
parent  e93c6bb6c7041210948b9a69851d7ab8b171ab0a
...
19
20
21
 
22
23
24
...
19
20
21
22
23
24
25
0
@@ -19,6 +19,7 @@
0
 #$Id$
0
 
0
 $current_user = CmsLogin::get_current_user();
0
+$config = cms_config();
0
 if ($current_user->is_anonymous())
0
 {
0
   $_SESSION["redirect_url"] = $_SERVER["REQUEST_URI"];
...
400
401
402
403
 
404
405
406
...
409
410
411
412
 
413
414
415
416
 
417
418
419
...
422
423
424
425
 
426
427
428
429
 
430
431
432
433
434
 
435
436
437
...
400
401
402
 
403
404
405
406
...
409
410
411
 
412
413
414
415
 
416
417
418
419
...
422
423
424
 
425
426
427
428
 
429
430
431
432
433
 
434
435
436
437
0
@@ -400,7 +400,7 @@ class CmsContentBase extends CmsObjectRelationalMapping
0
     }
0
   }
0
   
0
- function get_url($rewrite = true)
0
+ function get_url($rewrite = true, $lang = '')
0
     {
0
     $config = cms_config();
0
     $url = "";
0
@@ -409,11 +409,11 @@ class CmsContentBase extends CmsObjectRelationalMapping
0
     {
0
      if ($config['use_hierarchy'] == true)
0
      {
0
- $url = $config['root_url']. '/' . $this->HierarchyPath() . (isset($config['page_extension'])?$config['page_extension']:'.html');
0
+ $url = $config['root_url']. '/' . ($lang != '' ? "$lang/" : '') . $this->HierarchyPath() . (isset($config['page_extension'])?$config['page_extension']:'.html');
0
      }
0
      else
0
      {
0
- $url = $config['root_url']. '/' . $alias . (isset($config['page_extension'])?$config['page_extension']:'.html');
0
+ $url = $config['root_url']. '/' . ($lang != '' ? "$lang/" : '') . $alias . (isset($config['page_extension'])?$config['page_extension']:'.html');
0
      }
0
     }
0
     else
0
@@ -422,16 +422,16 @@ class CmsContentBase extends CmsObjectRelationalMapping
0
      {
0
         if ($config['use_hierarchy'] == true)
0
         {
0
- $url = $config['root_url'] . '/index.php/' . $this->HierarchyPath() . (isset($config['page_extension'])?$config['page_extension']:'.html');
0
+ $url = $config['root_url'] . '/index.php/' . ($lang != '' ? "$lang/" : '') . $this->HierarchyPath() . (isset($config['page_extension'])?$config['page_extension']:'.html');
0
         }
0
         else
0
         {
0
- $url = $config['root_url'] . '/index.php/' . $alias . (isset($config['page_extension'])?$config['page_extension']:'.html');
0
+ $url = $config['root_url'] . '/index.php/' . ($lang != '' ? "$lang/" : '') . $alias . (isset($config['page_extension'])?$config['page_extension']:'.html');
0
         }
0
      }
0
      else
0
      {
0
- $url = $config['root_url'] . '/index.php?' . $config['query_var'] . '=' . $alias;
0
+ $url = $config['root_url'] . '/index.php?' . $config['query_var'] . '=' . $alias . ($lang != '' ? '&amp;lang=' . $lang : '');
0
      }
0
     }
0
     return $url;
...
30
31
32
33
 
34
35
36
37
38
39
 
40
41
42
 
 
 
 
 
 
43
44
45
...
30
31
32
 
33
34
35
36
37
38
 
39
40
 
 
41
42
43
44
45
46
47
48
49
0
@@ -30,16 +30,20 @@
0
  **/
0
 class CmsMultiLanguage extends CmsObject
0
 {
0
- private static function get_client_language()
0
+ public static function get_client_language()
0
   {
0
     //TODO: Pull from clients cookies... or something
0
     return 'en_US';
0
   }
0
   
0
- private static function get_default_language()
0
+ public static function get_default_language()
0
   {
0
- //TODO: Pull from CmsConfig
0
- return 'en_US';
0
+ return CmsApplication::get_preference('default_language', 'en_US');
0
+ }
0
+
0
+ public static function get_enabled_languages()
0
+ {
0
+ return explode(',', CmsApplication::get_preference('enabled_languages', 'en_US'));
0
   }
0
   
0
   /**
...
795
796
797
798
 
799
800
801
...
795
796
797
 
798
799
800
801
0
@@ -795,7 +795,7 @@ abstract class CmsObjectRelationalMapping extends CmsObject implements ArrayAcce
0
           {
0
             if ($this->params[$localname] instanceof CmsDateTime)
0
             {
0
- var_dump($this->params[$localname]);
0
+ //var_dump($this->params[$localname]);
0
               $midpart .= "{$onefield} = " . $this->params[$localname]->to_sql_string() . ", ";
0
             }
0
             else

Comments

    No one has commented yet.