From: vincent@cubedesigners.com Date: Fri, 7 Jan 2011 17:21:51 +0000 (+0000) Subject: (no commit message) X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=af4549dd3e38db8edcb580c65f946e56fc962f98;p=cubeextranet.git --- diff --git a/inc/config.inc.php b/inc/config.inc.php index 62e26e463..97bee395d 100644 --- a/inc/config.inc.php +++ b/inc/config.inc.php @@ -14,7 +14,7 @@ if (in_array($_SERVER['HTTP_HOST'], array_merge($localrel, $localabs))) { define('DB_PASSWORD', 'valparaiso'); define('DEV', true); define('WINDOWS', true); - define('FONT_PATH', 'C:/Windows/Fonts'); + define('FONT_PATH', ROOT . '/fluidbook/fonts/'); define('AS3_SOURCES', 'C:\Users\Vincent\Documents\Works\as3;C:\Users\Vincent\Documents\Works\cubeExtranet\swf\_src;C:\Users\Vincent\Documents\Works\as3-10'); if (in_array($_SERVER['HTTP_HOST'], $localrel)) { @@ -68,7 +68,7 @@ define('WS_ICONS', WS_FILES . '/icones'); define('WS_THEMES', WS_FILES . '/themes'); define('WS_CACHE', WS_FILES . '/cache'); define('WS_COMPILE_ASSETS', WS_FILES . '/compile'); -define('WS_L10N',WS_FILES.'/l10n'); +define('WS_L10N', WS_FILES . '/l10n'); // define('MINIMIZE_JS', false); define('WORKER_PREFIX', 'worker.'); diff --git a/inc/ws/Controlleur/class.ws.url.php b/inc/ws/Controlleur/class.ws.url.php index b75e79d00..ec732856b 100644 --- a/inc/ws/Controlleur/class.ws.url.php +++ b/inc/ws/Controlleur/class.ws.url.php @@ -94,13 +94,29 @@ class wsUrl { $args[1] = 'fr'; } + $allLangs = cubeLang::getCodes($core->user->lang); + $existingLangs = array(); + + $dao = new wsDAOLang($core->con); + $langs = $dao->selectAll(); + foreach($langs as $lang) { + if (!isset($allLangs[$lang->lang_id])) { + continue; + } + $existingLangs[$lang->lang_id] = $allLangs[$lang->lang_id]; + + unset($allLangs[$lang->lang_id]); + } + + $langs = array(__('Langues configurées') => array_flip($existingLangs), __('Autres langues') => array_flip($allLangs)); + $res = extranetPage::barre(); $res .= extranetPage::tMain(null, false); $res .= extranetPage::bh(); $res .= '
'; $res .= ''; - $res .= ''; + $res .= ''; $res .= ''; $res .= '
' . __('Sélectionnez la langue à configurer') . ' : ' . form::combo('lang', array_flip(cubeLang::getCodes($core->user->lang)), $args[1]) . '
' . __('Sélectionnez la langue à configurer') . ' : ' . form::combo('lang', $langs, $args[1]) . '
' . $core->typo->Ajouter('OK') . '
'; $res .= '
'; @@ -119,7 +135,6 @@ class wsUrl { global $core; $dao = new wsDAOLang($core->con); $lang = $dao->selectById($lang_id); - if(is_null($lang)) $res = '
'; @@ -132,7 +147,7 @@ class wsUrl { $res .= extranetPage::bf(); $res .= extranetPage::bh(); - $res .= cubeLang::translationForm(FLUIDBOOK_SOURCES, $lang_id , null, 'liste', array(), $core->typo->Ajouter(__('Enregistrer')), $lang->traductions); + $res .= cubeLang::translationForm(FLUIDBOOK_SOURCES, $lang_id , null, 'liste', array(), '' . $core->typo->Ajouter(__('Enregistrer')) . '', $lang->traductions); $res .= extranetPage::bf(); $res .= '
'; return $res; @@ -305,14 +320,17 @@ html{height:100%}' . "\n"; return $res; } - public static function testAS() + public static function testAS($args) { global $core; + if (!isset($args[1])) { + $args[1] = 2964; + } // cubePHP::neverStop(); $dao = new wsDAOBook($core->con); header('Content-type: text/plain'); ob_clean(); - echo $dao->compile(2970, 3, false); + echo $dao->compile($args[1], 3, false); exit; } diff --git a/inc/ws/DAO/class.ws.dao.book.php b/inc/ws/DAO/class.ws.dao.book.php index 7e941ae69..d2fda521e 100644 --- a/inc/ws/DAO/class.ws.dao.book.php +++ b/inc/ws/DAO/class.ws.dao.book.php @@ -491,6 +491,9 @@ class wsDAOBook extends extranetDAO { $firstDoc = $daoDoc->selectById($pages[1]['document_id']); $size = $firstDoc->generalInfos['size']; + $daoLang = new wsDAOLang($this->con); + $lang = $daoLang->selectById($book->lang); + $daoTheme = new wsDAOTheme($this->con); $theme = $daoTheme->getThemeOfBook($book_id, true); @@ -570,8 +573,9 @@ class wsDAOBook extends extranetDAO { $flex->addBitmap($iconsRoot . 'nav-' . $file . '.png', 'nav_' . $file); } // Fonts - $flex->addFont(FONT_PATH . '/FFFATLAN_0.TTF', 'CreditsFont', 'ASCII'); - $flexLight->addFont(FONT_PATH . '/DIN Medium_0.ttf', 'GeneralFont', 'Latin'); + $flex->addFont(FONT_PATH . '/' . $lang->font, 'GeneralFont', $lang->charset); + $flex->addFont(FONT_PATH . '/FluidbookCredits.ttf', 'CreditsFont', 'ASCII'); + $flexLight->addFont(FONT_PATH . '/FluidbookLoader.ttf', 'LoaderFont', 'Numerals'); $res .= $flex->compile() . "\n\n-------------------\n\n"; $flexLight->addVariable('datasSize', filesize($compilerDir . '/FluidbookDatas.swf')); $res .= $flexLight->compile(); diff --git a/inc/ws/DAO/class.ws.dao.lang.php b/inc/ws/DAO/class.ws.dao.lang.php index fbda98d31..9ee5b1b4b 100644 --- a/inc/ws/DAO/class.ws.dao.lang.php +++ b/inc/ws/DAO/class.ws.dao.lang.php @@ -30,7 +30,7 @@ class wsDAOLang extends extranetDAO { public function selectAll() { - $r = $this->con->select('SELECT * FROM langues ORDER BY public DESC,(CHAR_LENGTH(lang_id)=2) DESC, nom ASC'); + $r = $this->con->select('SELECT * FROM langues ORDER BY public DESC,(CHAR_LENGTH(lang_id)=2) DESC'); return $this->factory($r); }