Dotclear

Changeset 2696


Ignore:
Timestamp:
10/02/10 06:17:55 (12 years ago)
Author:
franck
Message:

dc 2.2 compliance

Location:
plugins/dctranslations
Files:
1 added
10 edited

Legend:

Unmodified
Added
Removed
  • plugins/dctranslations/_admin.php

    r1548 r2696  
    11<?php 
    22# -- BEGIN LICENSE BLOCK ---------------------------------- 
    3 # This file is part of dctranslations, a plugin for Dotclear. 
     3# This file is part of dctranslations, a plugin for Dotclear 2. 
    44#  
    5 # Copyright (c) 2009 Jean-Christophe Dubacq 
    6 # jcdubacq1@free.fr 
     5# Copyright (c) 2010 Franck Paul and contributors 
     6# carnet.franck.paul@gmail.com 
    77#  
    88# Licensed under the GPL version 2.0 license. 
     
    1010# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 
    1111# -- END LICENSE BLOCK ------------------------------------ 
     12 
    1213if (!defined('DC_CONTEXT_ADMIN')) { exit; } 
    1314 
     
    185186    { 
    186187        global $core; 
    187         $core->blog->settings->setNameSpace('system'); 
    188         $core->blog->settings->put('lang',''); 
     188        $core->blog->settings->addNameSpace('system'); 
     189        $core->blog->settings->system->put('lang',''); 
    189190    } 
    190191} 
  • plugins/dctranslations/_define.php

    r1668 r2696  
    11<?php 
    22# -- BEGIN LICENSE BLOCK ---------------------------------- 
    3 # This file is part of dctranslations, a plugin for Dotclear. 
     3# This file is part of dctranslations, a plugin for Dotclear 2. 
    44#  
    5 # Copyright (c) 2009 Jean-Christophe Dubacq 
    6 # jcdubacq1@free.fr 
     5# Copyright (c) 2010 Franck Paul and contributors 
     6# carnet.franck.paul@gmail.com 
    77#  
    88# Licensed under the GPL version 2.0 license. 
     
    1010# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 
    1111# -- END LICENSE BLOCK ------------------------------------ 
     12 
    1213if (!defined('DC_RC_PATH')) { return; } 
    1314 
     
    1516                      "Posts Translations",         // Name 
    1617                      "Allows to translate posts",  // Description 
    17                       "Jean-Christophe Dubacq",     // Author 
    18                       '1.10.0',                        // Version 
     18                      "Jean-Christophe Dubacq, Franck Paul",     // Author 
     19                      '1.11',                        // Version 
    1920                      'admin,editor,usage',         // Permissions 
    2021                      500                           // Priority 
  • plugins/dctranslations/_install.php

    r1130 r2696  
    11<?php 
    22# -- BEGIN LICENSE BLOCK ---------------------------------- 
    3 # This file is part of dctranslations, a plugin for Dotclear. 
     3# This file is part of dctranslations, a plugin for Dotclear 2. 
    44#  
    5 # Copyright (c) 2009 Jean-Christophe Dubacq 
    6 # jcdubacq1@free.fr 
     5# Copyright (c) 2010 Franck Paul and contributors 
     6# carnet.franck.paul@gmail.com 
    77#  
    88# Licensed under the GPL version 2.0 license. 
     
    1010# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 
    1111# -- END LICENSE BLOCK ------------------------------------ 
     12 
    1213if (!defined('DC_CONTEXT_ADMIN')) { exit; } 
    1314 
  • plugins/dctranslations/_prepend.php

    r1548 r2696  
    11<?php 
    22# -- BEGIN LICENSE BLOCK ---------------------------------- 
    3 # This file is part of dctranslations, a plugin for Dotclear. 
     3# This file is part of dctranslations, a plugin for Dotclear 2. 
    44#  
    5 # Copyright (c) 2009 Jean-Christophe Dubacq 
    6 # jcdubacq1@free.fr 
     5# Copyright (c) 2010 Franck Paul and contributors 
     6# carnet.franck.paul@gmail.com 
    77#  
    88# Licensed under the GPL version 2.0 license. 
     
    1010# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 
    1111# -- END LICENSE BLOCK ------------------------------------ 
     12 
    1213if (!defined('DC_RC_PATH')) {return;} 
    1314 
  • plugins/dctranslations/_public.php

    r1548 r2696  
    11<?php 
    22# -- BEGIN LICENSE BLOCK ---------------------------------- 
    3 # This file is part of dctranslations, a plugin for Dotclear. 
     3# This file is part of dctranslations, a plugin for Dotclear 2. 
    44#  
    5 # Copyright (c) 2009 Jean-Christophe Dubacq 
    6 # jcdubacq1@free.fr 
     5# Copyright (c) 2010 Franck Paul and contributors 
     6# carnet.franck.paul@gmail.com 
    77#  
    88# Licensed under the GPL version 2.0 license. 
     
    1010# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 
    1111# -- END LICENSE BLOCK ------------------------------------ 
     12 
    1213if (!defined('DC_RC_PATH')) {return;} 
    1314 
     
    8182    // hard-coded preferences in case the preferences are not set 
    8283 
    83     $actla=$core->blog->settings->ptrans_active_languages; 
     84    $actla=$core->blog->settings->ptrans->ptrans_active_languages; 
    8485    if (!$actla) { 
    8586        $actla = 'en,fr'; 
    8687    } 
    87     $fbla=$core->blog->settings->ptrans_fallback_language; 
     88    $fbla=$core->blog->settings->ptrans->ptrans_fallback_language; 
    8889    if (!$fbla) { 
    8990        $fbla = 'en'; 
     
    123124    $_lang=$activelangs[0]; 
    124125    $core->lang_array=$activelangs; 
    125     $core->blog->settings->lang=$_lang; 
    126     $core->blog->settings->lang_nav=$_lang; 
     126    $core->blog->settings->system->lang=$_lang; 
     127    $core->blog->settings->system->lang_nav=$_lang; 
    127128    l10n::set(DC_L10N_ROOT.'/'.$_lang.'/date'); 
    128129    l10n::set(DC_L10N_ROOT.'/'.$_lang.'/public'); 
     
    436437            $_lang=$activelangs[0]; 
    437438            $core->lang_array=$activelangs; 
    438             $core->blog->settings->lang=$_lang; 
    439             $core->blog->settings->lang_nav=$_lang; 
     439            $core->blog->settings->system->lang=$_lang; 
     440            $core->blog->settings->system->lang_nav=$_lang; 
    440441            $newargs=$m[2]; 
    441442        } else { 
     
    454455            $_lang=$activelangs[0]; 
    455456            $core->lang_array=$activelangs; 
    456             $core->blog->settings->lang=$_lang; 
    457             $core->blog->settings->lang_nav=$_lang; 
     457            $core->blog->settings->system->lang=$_lang; 
     458            $core->blog->settings->system->lang_nav=$_lang; 
    458459            $newargs=$m[2]; 
    459460        } else { 
     
    469470                $_ctx->cur_lang = $val; 
    470471                $core->translation_force_lang = $val; 
    471                 $core->blog->settings->lang=$val; 
     472                $core->blog->settings->system->lang=$val; 
    472473            } 
    473474           
  • plugins/dctranslations/_widget.php

    r1130 r2696  
    11<?php 
    22# -- BEGIN LICENSE BLOCK ---------------------------------- 
    3 # This file is part of dctranslations, a plugin for Dotclear. 
     3# This file is part of dctranslations, a plugin for Dotclear 2. 
    44#  
    5 # Copyright (c) 2009 Jean-Christophe Dubacq 
    6 # jcdubacq1@free.fr 
     5# Copyright (c) 2010 Franck Paul and contributors 
     6# carnet.franck.paul@gmail.com 
    77#  
    88# Licensed under the GPL version 2.0 license. 
     
    1010# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 
    1111# -- END LICENSE BLOCK ------------------------------------ 
     12 
    1213if (!defined('DC_RC_PATH')) {return;} 
    1314 
     
    109110        } 
    110111           
    111         $al=$core->blog->settings->ptrans_active_languages; 
     112        $al=$core->blog->settings->ptrans->ptrans_active_languages; 
    112113        if (!$al) { 
    113114            $al="fr,en"; 
  • plugins/dctranslations/_widgets.php

    r1548 r2696  
    11<?php 
    22# -- BEGIN LICENSE BLOCK ---------------------------------- 
    3 # This file is part of dctranslations, a plugin for Dotclear. 
     3# This file is part of dctranslations, a plugin for Dotclear 2. 
    44#  
    5 # Copyright (c) 2009 Jean-Christophe Dubacq 
    6 # jcdubacq1@free.fr 
     5# Copyright (c) 2010 Franck Paul and contributors 
     6# carnet.franck.paul@gmail.com 
    77#  
    88# Licensed under the GPL version 2.0 license. 
     
    1010# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 
    1111# -- END LICENSE BLOCK ------------------------------------ 
     12 
    1213if (!defined('DC_RC_PATH')) {return;} 
    1314 
     
    109110        } 
    110111           
    111         $al=$core->blog->settings->ptrans_active_languages; 
     112        $al=$core->blog->settings->ptrans->ptrans_active_languages; 
    112113        if (!$al) { 
    113114            $al="fr,en"; 
  • plugins/dctranslations/class.translations.php

    r1668 r2696  
    11<?php 
    22# -- BEGIN LICENSE BLOCK ---------------------------------- 
    3 # This file is part of dctranslations, a plugin for Dotclear. 
     3# This file is part of dctranslations, a plugin for Dotclear 2. 
    44#  
    5 # Copyright (c) 2009 Jean-Christophe Dubacq 
    6 # jcdubacq1@free.fr 
     5# Copyright (c) 2010 Franck Paul and contributors 
     6# carnet.franck.paul@gmail.com 
    77#  
    88# Licensed under the GPL version 2.0 license. 
     
    1010# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 
    1111# -- END LICENSE BLOCK ------------------------------------ 
     12 
    1213if (!defined('DC_RC_PATH')) { return; } 
    1314 
     
    188189                                 array_keys($url_patterns), 
    189190                                 array_values($url_patterns), 
    190                                  $this->core->blog->settings->post_url_format 
     191                                 $this->core->blog->settings->system->post_url_format 
    191192                                 ); 
    192193        } else { 
     
    486487            $format = addslashes($attr['format']); 
    487488        } else { 
    488             $format=$GLOBALS['core']->blog->settings->date_format; 
     489            $format=$GLOBALS['core']->blog->settings->system->date_format; 
    489490        } 
    490491        $f = $GLOBALS['core']->tpl->getFilters($attr); 
     
    496497            $format = addslashes($attr['format']); 
    497498        } else { 
    498             $format=$GLOBALS['core']->blog->settings->time_format; 
     499            $format=$GLOBALS['core']->blog->settings->system->time_format; 
    499500        } 
    500501        $f = $GLOBALS['core']->tpl->getFilters($attr); 
  • plugins/dctranslations/index.php

    r1131 r2696  
    11<?php 
    22# -- BEGIN LICENSE BLOCK ---------------------------------- 
    3 # This file is part of dctranslations, a plugin for Dotclear. 
     3# This file is part of dctranslations, a plugin for Dotclear 2. 
    44#  
    5 # Copyright (c) 2009 Jean-Christophe Dubacq 
    6 # jcdubacq1@free.fr 
     5# Copyright (c) 2010 Franck Paul and contributors 
     6# carnet.franck.paul@gmail.com 
    77#  
    88# Licensed under the GPL version 2.0 license. 
     
    1010# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 
    1111# -- END LICENSE BLOCK ------------------------------------ 
     12 
    1213if (!defined('DC_CONTEXT_ADMIN')) { exit; } 
    1314 
     
    8182try { 
    8283    if ($core->blog->settings->lang) { 
    83         $core->blog->settings->setNameSpace('system'); 
    84         $core->blog->settings->put('lang',''); 
     84        $core->blog->settings->addNameSpace('system'); 
     85        $core->blog->settings->system->put('lang',''); 
    8586    } 
    8687    // Create settings if they don't exist 
    87     if ($core->blog->settings->ptrans_fallback_language === null) { 
    88         $core->blog->settings->setNameSpace('ptrans'); 
    89         $core->blog->settings->put('ptrans_active_languages','en,fr','string','Navigation language',true,true); 
    90         $core->blog->settings->put('ptrans_fallback_language','en','string','Fallback language',true,true); 
     88    $core->blog->settings->addNameSpace('ptrans'); 
     89    if ($core->blog->settings->ptrans->ptrans_fallback_language === null) { 
     90        $core->blog->settings->ptrans->put('ptrans_active_languages','en,fr','string','Navigation language',true,true); 
     91        $core->blog->settings->ptrans->put('ptrans_fallback_language','en','string','Fallback language',true,true); 
    9192        http::redirect($p_url); 
    9293    } 
    93     $active_languages = $core->blog->settings->ptrans_active_languages; 
    94     $fallback_language = $core->blog->settings->ptrans_fallback_language; 
     94    $active_languages = $core->blog->settings->ptrans->ptrans_active_languages; 
     95    $fallback_language = $core->blog->settings->ptrans->ptrans_fallback_language; 
    9596    if (!$active_languages) { 
    9697        // FIXME It should probably be join(',',$existent_languages_array) 
     
    121122        } 
    122123        $ptrans_active_languages=implode(',',array_keys($valid_languages)); 
    123         $core->blog->settings->setNameSpace('ptrans'); 
    124         $core->blog->settings->put('ptrans_active_languages',$ptrans_active_languages); 
    125         $core->blog->settings->put('ptrans_fallback_language',$ptrans_fallback_language); 
     124        $core->blog->settings->addNameSpace('ptrans'); 
     125        $core->blog->settings->ptrans->put('ptrans_active_languages',$ptrans_active_languages); 
     126        $core->blog->settings->ptrans->put('ptrans_fallback_language',$ptrans_fallback_language); 
    126127        http::redirect($pgct_url.'&up=1&tab=settings'); 
    127128    } 
  • plugins/dctranslations/post.js

    r1654 r2696  
     1/* -- BEGIN LICENSE BLOCK ---------------------------------- 
     2 * This file is part of dctranslations, a plugin for Dotclear 2. 
     3 *  
     4 * Copyright (c) 2010 Franck Paul and contributors 
     5 * carnet.franck.paul@gmail.com 
     6 *  
     7 * Licensed under the GPL version 2.0 license. 
     8 * A copy of this license is available in LICENSE file or at 
     9 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 
     10 * -- END LICENSE BLOCK ------------------------------------*/ 
     11 
    112$(function() 
    213  { 
Note: See TracChangeset for help on using the changeset viewer.

Sites map