コード例 #1
0
ファイル: phrasea.php プロジェクト: luisbrito/Phraseanet
 public static function sbas_labels($sbas_id, Application $app)
 {
     if (!self::$_sbas_labels) {
         try {
             self::$_sbas_labels = $app->getApplicationBox()->get_data_from_cache(self::CACHE_SBAS_LABELS);
         } catch (\Exception $e) {
             foreach ($app->getDataboxes() as $databox) {
                 self::$_sbas_labels[$databox->get_sbas_id()] = ['fr' => $databox->get_label('fr'), 'en' => $databox->get_label('en'), 'de' => $databox->get_label('de'), 'nl' => $databox->get_label('nl')];
             }
             $app->getApplicationBox()->set_data_to_cache(self::$_sbas_labels, self::CACHE_SBAS_LABELS);
         }
     }
     if (isset(self::$_sbas_labels[$sbas_id]) && isset(self::$_sbas_labels[$sbas_id][$app['locale']])) {
         return self::$_sbas_labels[$sbas_id][$app['locale']];
     }
     return 'Unknown database';
 }