Dotclear

Changeset 2486 for plugins/dcWikipedia


Ignore:
Timestamp:
07/20/10 11:09:04 (13 years ago)
Author:
Tomtom33
Message:

dcWikipedia 0.2.3 :

  • Dotclear 2.2 compliance
  • Updated licence blocks
Location:
plugins/dcWikipedia/trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • plugins/dcWikipedia/trunk/_admin.php

    r1634 r2486  
    33# This file is part of dcWikipedia, a plugin for Dotclear. 
    44#  
    5 # Copyright (c) 2009 Tomtom 
     5# Copyright (c) 2009-2010 Tomtom 
    66# http://blog.zenstyle.fr/ 
    77#  
     
    2424     { 
    2525          global $core; 
     26           
     27          $flag = 'no'; 
     28          if (!is_null($core->blog->settings->getSetting('dcwp_add_lang_flag'))) { 
     29               $flag = $core->blog->settings->dcwikipedia->dcwp_add_lang_flag ? 'yes' : 'no'; 
     30          } 
    2631 
    2732          return 
     
    3035          "//<![CDATA[\n". 
    3136          dcPage::jsVar('jsToolBar.prototype.elements.dcWikipedia.title',__('Wikipedia')). 
    32           dcPage::jsVar('dcWikipedia.option.langFlag',($core->blog->settings->dcwp_add_lang_flag ? 'yes' : 'no')). 
     37          dcPage::jsVar('dcWikipedia.option.langFlag',$flag). 
    3338          dcPage::jsVar('dcWikipedia.msg.noselection',__('Please, select a word or an expression')). 
    3439          "\n//]]>\n". 
     
    4146          '<fieldset><legend>'.__('dcWikipedia').'</legend>'. 
    4247          '<p><label class="classic">'. 
    43           form::checkbox('dcwp_add_lang_flag','1',$settings->dcwp_add_lang_flag). 
     48          form::checkbox('dcwp_add_lang_flag','1',(!is_null($settings->getSetting('dcwp_add_lang_flag')) ? $settings->dcwikipedia->dcwp_add_lang_flag : false)). 
    4449          __('Add lang flag in link').'</label></p>'. 
    4550          '</fieldset>'; 
     
    4853     public static function adminBeforeBlogSettingsUpdate($settings) 
    4954     { 
    50           $settings->setNameSpace('dcwikipedia'); 
    51           $settings->put('dcwp_add_lang_flag',!empty($_POST['dcwp_add_lang_flag']),'boolean'); 
    52           $settings->setNameSpace('system'); 
     55          $settings->addNameSpace('dcwikipedia'); 
     56          $settings->dcwikipedia->put('dcwp_add_lang_flag',!empty($_POST['dcwp_add_lang_flag']),'boolean'); 
    5357     } 
    5458} 
  • plugins/dcWikipedia/trunk/_define.php

    r1634 r2486  
    33# This file is part of dcWikipedia, a plugin for Dotclear. 
    44#  
    5 # Copyright (c) 2009 Tomtom 
     5# Copyright (c) 2009-2010 Tomtom 
    66# http://blog.zenstyle.fr/ 
    77#  
     
    1515          /* Description*/         "Search, find and link any word or expression on Wikipedia", 
    1616          /* Author */             "Tomtom (http://blog.zenstyle.fr)", 
    17           /* Version */            '0.2.2', 
     17          /* Version */            '0.2.3', 
    1818          /* Permissions */        'usage' 
    1919); 
  • plugins/dcWikipedia/trunk/_prepend.php

    r1634 r2486  
    33# This file is part of dcWikipedia, a plugin for Dotclear. 
    44#  
    5 # Copyright (c) 2009 Tomtom 
     5# Copyright (c) 2009-2010 Tomtom 
    66# http://blog.zenstyle.fr/ 
    77#  
     
    1111# -- END LICENSE BLOCK ------------------------------------ 
    1212 
     13if (!defined('DC_RC_PATH')) { return; } 
     14 
    1315$__autoload['dcWikipediaReader'] = dirname(__FILE__).'/inc/class.dc.wikipedia.reader.php'; 
    1416$__autoload['dcWikipediaParser'] = dirname(__FILE__).'/inc/class.dc.wikipedia.parser.php'; 
  • plugins/dcWikipedia/trunk/inc/class.dc.wikipedia.parser.php

    r1106 r2486  
    33# This file is part of dcWikipedia, a plugin for Dotclear. 
    44#  
    5 # Copyright (c) 2009 Tomtom 
     5# Copyright (c) 2009-2010 Tomtom 
    66# http://blog.zenstyle.fr/ 
    77#  
  • plugins/dcWikipedia/trunk/inc/class.dc.wikipedia.reader.php

    r1106 r2486  
    33# This file is part of dcWikipedia, a plugin for Dotclear. 
    44#  
    5 # Copyright (c) 2009 Tomtom 
     5# Copyright (c) 2009-2010 Tomtom 
    66# http://blog.zenstyle.fr/ 
    77#  
     
    1515     protected $user_agent         = 'Dotclear Wikipedia API reader/0.1'; 
    1616     protected $timeout            = 5; 
    17      protected $validators         = null;                  ///< <b>array</b>   HTTP Cache validators 
    18      protected $cache_dir          = null;                  ///< <b>string</b>  Cache temporary directory 
     17     protected $validators         = null;             ///< <b>array</b>   HTTP Cache validators 
     18     protected $cache_dir          = null;             ///< <b>string</b>  Cache temporary directory 
    1919     protected $cache_file_prefix  = 'dcwp';           ///< <b>string</b>  Cache file prefix 
    20      protected $cache_ttl          = '-30 minutes';         ///< <b>string</b>  Cache TTL 
     20     protected $cache_ttl          = '-30 minutes';    ///< <b>string</b>  Cache TTL 
    2121 
    2222     public function __construct() 
     
    8686               return false; 
    8787          } 
     88          $this->setTimeout($this->timeout); 
    8889          $this->setHost($host,$port); 
    8990          $this->useSSL($ssl); 
  • plugins/dcWikipedia/trunk/index.php

    r1634 r2486  
    33# This file is part of dcWikipedia, a plugin for Dotclear. 
    44#  
    5 # Copyright (c) 2009 Tomtom 
     5# Copyright (c) 2009-2010 Tomtom 
    66# http://blog.zenstyle.fr/ 
    77#  
  • plugins/dcWikipedia/trunk/js/popup.js

    r1126 r2486  
    33# This file is part of dcWikipedia, a plugin for Dotclear. 
    44#  
    5 # Copyright (c) 2009 Tomtom 
     5# Copyright (c) 2009-2010 Tomtom 
    66# http://blog.zenstyle.fr/ 
    77#  
  • plugins/dcWikipedia/trunk/js/post.js

    r1126 r2486  
    33# This file is part of dcWikipedia, a plugin for Dotclear. 
    44#  
    5 # Copyright (c) 2009 Tomtom 
     5# Copyright (c) 2009-2010 Tomtom 
    66# http://blog.zenstyle.fr/ 
    77#  
  • plugins/dcWikipedia/trunk/popup.php

    r1634 r2486  
    33# This file is part of dcWikipedia, a plugin for Dotclear. 
    44#  
    5 # Copyright (c) 2009 Tomtom 
     5# Copyright (c) 2009-2010 Tomtom 
    66# http://blog.zenstyle.fr/ 
    77#  
     
    1111# -- END LICENSE BLOCK ------------------------------------ 
    1212 
     13if (!defined('DC_CONTEXT_ADMIN')) { return; } 
     14 
    1315$value = isset($_GET['value']) ? rawurldecode($_GET['value']) : ''; 
    1416$lang = isset($_GET['lang']) ? rawurldecode($_GET['lang']) : ''; 
     
    1618$parser = dcWikipediaReader::quickParse('http://'.$lang.'.wikipedia.org/w/api.php?action=opensearch&format=xml&search='.rawurlencode($value),DC_TPL_CACHE); 
    1719 
    18 ?> 
    19  
    20 <html> 
    21 <head> 
    22      <title><?php echo __('dcWikipedia'); ?></title> 
    23      <?php echo dcPage::jsLoad(DC_ADMIN_URL.'?pf=dcWikipedia/js/popup.min.js'); ?> 
    24      <style type="text/css">@import '<?php echo DC_ADMIN_URL; ?>?pf=dcWikipedia/style.min.css';</style> 
    25 </head> 
    26  
    27 <body> 
    28 <h2><?php echo __('Add a Wikipedia link'); ?></h2> 
    29  
    30 <?php 
     20echo 
     21'<html>'. 
     22'<head>'. 
     23     '<title>'.__('dcWikipedia').'</title>'. 
     24     dcPage::jsLoad('index.php?pf=dcWikipedia/js/popup.min.js'). 
     25     '<link rel="stylesheet" href="index.php?pf=dcWikipedia/style.min.css" type="text/css" />'. 
     26'</head>'. 
     27'<body>'. 
     28'<h2>'.$core->blog->name.' &rsaquo; '.__('Add a Wikipedia link').'</h2>'; 
    3129 
    3230$rs = $core->blog->getLangs(array('order'=>'asc')); 
     
    8280} 
    8381 
     82echo 
     83'</body>'. 
     84'</html>'; 
     85 
    8486?> 
    85  
    86 </body> 
    87 </html> 
  • plugins/dcWikipedia/trunk/style.css

    r1634 r2486  
    33# This file is part of dcWikipedia, a plugin for Dotclear. 
    44#  
    5 # Copyright (c) 2009 Tomtom 
     5# Copyright (c) 2009-2010 Tomtom 
    66# http://blog.zenstyle.fr/ 
    77#  
Note: See TracChangeset for help on using the changeset viewer.

Sites map