svn: /web/doc-editor/trunk/php/ ExtJsController.php

[email protected] (Yannick Torres)
Newsgroups php.doc.web
Message-ID <[email protected]>
yannick                                  Wed, 24 Mar 2010 22:32:05 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=296757

Log:
Portlet graph of all langues : sort langs by code & no more display lang who haven't any file witch are uptodate

Changed paths:
    U   web/doc-editor/trunk/php/ExtJsController.php

Modified: web/doc-editor/trunk/php/ExtJsController.php
===================================================================
--- web/doc-editor/trunk/php/ExtJsController.php	2010-03-24 22:29:38 UTC (rev 296756)
+++ web/doc-editor/trunk/php/ExtJsController.php	2010-03-24 22:32:05 UTC (rev 296757)
@@ -1521,16 +1521,23 @@
         $return = array();

         $j=0;
-        foreach (RepositoryManager::getInstance()->availableLang as $lang) {
+
+        $langs = RepositoryManager::getInstance()->availableLang;
+
+        sort($langs);

+        foreach ($langs as $lang) {
+
             $lang = $lang["code"];
             $summary = RepositoryFetcher::getInstance()->getStaticValue('translation_summary', $lang);

-            $return[$j]['id'] = $j;
-            $return[$j]['libel'] = str_replace("_", "", $lang);
-            $return[$j]['total'] = ( !isset($summary[0]) || $summary[0]->nbFiles == NULL ) ? 0 : $summary[0]->nbFiles;
+            if( isset($summary[0]) && !empty($summary[0]->nbFiles) ) {
+                $return[$j]['id'] = $j;
+                $return[$j]['libel'] = $lang; //str_replace("_", "", $lang);
+                $return[$j]['total'] = ( !isset($summary[0]) || $summary[0]->nbFiles == NULL ) ? 0 : $summary[0]->nbFiles;

-            $j ++;
+                $j ++;
+            }
         }

         return JsonResponseBuilder::success(
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.