Author: jablko
Date: Sat Oct 10 17:26:35 2009
New Revision: 3719

Log:
Use sfCultureInfo singleton like symfony revision 11700

Modified:
   trunk/apps/qubit/lib/SearchIndex.class.php
   trunk/apps/qubit/lib/helper/QubitHelper.php
   trunk/apps/qubit/modules/informationobject/actions/editAction.class.php

Modified: trunk/apps/qubit/lib/SearchIndex.class.php
==============================================================================
--- trunk/apps/qubit/lib/SearchIndex.class.php  Sat Oct 10 16:34:46 2009        
(r3718)
+++ trunk/apps/qubit/lib/SearchIndex.class.php  Sat Oct 10 17:26:35 2009        
(r3719)
@@ -315,7 +315,7 @@
     $nameField->boost = 3;
     $doc->addField($nameField);
 
-    $cultureInfo = new sfCultureInfo($language);
+    $cultureInfo = sfCultureInfo::getInstance($language);
 
     // LANGUAGES
     if (count($languageCodes = $informationObject->getProperties($name = 
'information_object_language')) > 0)

Modified: trunk/apps/qubit/lib/helper/QubitHelper.php
==============================================================================
--- trunk/apps/qubit/lib/helper/QubitHelper.php Sat Oct 10 16:34:46 2009        
(r3718)
+++ trunk/apps/qubit/lib/helper/QubitHelper.php Sat Oct 10 17:26:35 2009        
(r3719)
@@ -19,7 +19,7 @@
 
 function select_script_tag($name, $selected = null, $options = array())
 {
-  $c = new sfCultureInfo(sfContext::getInstance()->getUser()->getCulture());
+  $c = 
sfCultureInfo::getInstance(sfContext::getInstance()->getUser()->getCulture());
   $scripts = $c->getScripts();
 
   if ($script_option = _get_option($options, 'scripts'))
@@ -42,12 +42,12 @@
 
 function format_script($script_iso, $culture = null)
 {
-  $c = new sfCultureInfo($culture === null ? 
sfContext::getInstance()->getUser()->getCulture() : $culture);
+  $c = sfCultureInfo::getInstance($culture === null ? 
sfContext::getInstance()->getUser()->getCulture() : $culture);
   $scripts = $c->getScripts();
 
   if (!isset($scripts[$script_iso]))
   {
-    $c = new sfCultureInfo(sfConfig::get('sf_default_culture'));
+    $c = sfCultureInfo::getInstance(sfConfig::get('sf_default_culture'));
     $scripts = $c->getScripts();
   }
 

Modified: 
trunk/apps/qubit/modules/informationobject/actions/editAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/informationobject/actions/editAction.class.php     
Sat Oct 10 16:34:46 2009        (r3718)
+++ trunk/apps/qubit/modules/informationobject/actions/editAction.class.php     
Sat Oct 10 17:26:35 2009        (r3719)
@@ -152,7 +152,7 @@
         $this->form->setDefault($name, $this->informationObject[$name]);
         $this->form->setValidator($name, new sfValidatorPass);
 
-        $c = new sfCultureInfo($this->context->user->getCulture());
+        $c = sfCultureInfo::getInstance($this->context->user->getCulture());
         $this->form->setWidget($name, new sfWidgetFormSelect(array('choices' 
=> $c->getScripts(), 'multiple' => true)));
 
         break;

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.ca/group/qubit-commits?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to