Changeset 2486 for plugins/dcWikipedia
- Timestamp:
- 07/20/10 11:09:04 (13 years ago)
- Location:
- plugins/dcWikipedia/trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/dcWikipedia/trunk/_admin.php
r1634 r2486 3 3 # This file is part of dcWikipedia, a plugin for Dotclear. 4 4 # 5 # Copyright (c) 2009 Tomtom5 # Copyright (c) 2009-2010 Tomtom 6 6 # http://blog.zenstyle.fr/ 7 7 # … … 24 24 { 25 25 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 } 26 31 27 32 return … … 30 35 "//<![CDATA[\n". 31 36 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). 33 38 dcPage::jsVar('dcWikipedia.msg.noselection',__('Please, select a word or an expression')). 34 39 "\n//]]>\n". … … 41 46 '<fieldset><legend>'.__('dcWikipedia').'</legend>'. 42 47 '<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)). 44 49 __('Add lang flag in link').'</label></p>'. 45 50 '</fieldset>'; … … 48 53 public static function adminBeforeBlogSettingsUpdate($settings) 49 54 { 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'); 53 57 } 54 58 } -
plugins/dcWikipedia/trunk/_define.php
r1634 r2486 3 3 # This file is part of dcWikipedia, a plugin for Dotclear. 4 4 # 5 # Copyright (c) 2009 Tomtom5 # Copyright (c) 2009-2010 Tomtom 6 6 # http://blog.zenstyle.fr/ 7 7 # … … 15 15 /* Description*/ "Search, find and link any word or expression on Wikipedia", 16 16 /* Author */ "Tomtom (http://blog.zenstyle.fr)", 17 /* Version */ '0.2. 2',17 /* Version */ '0.2.3', 18 18 /* Permissions */ 'usage' 19 19 ); -
plugins/dcWikipedia/trunk/_prepend.php
r1634 r2486 3 3 # This file is part of dcWikipedia, a plugin for Dotclear. 4 4 # 5 # Copyright (c) 2009 Tomtom5 # Copyright (c) 2009-2010 Tomtom 6 6 # http://blog.zenstyle.fr/ 7 7 # … … 11 11 # -- END LICENSE BLOCK ------------------------------------ 12 12 13 if (!defined('DC_RC_PATH')) { return; } 14 13 15 $__autoload['dcWikipediaReader'] = dirname(__FILE__).'/inc/class.dc.wikipedia.reader.php'; 14 16 $__autoload['dcWikipediaParser'] = dirname(__FILE__).'/inc/class.dc.wikipedia.parser.php'; -
plugins/dcWikipedia/trunk/inc/class.dc.wikipedia.parser.php
r1106 r2486 3 3 # This file is part of dcWikipedia, a plugin for Dotclear. 4 4 # 5 # Copyright (c) 2009 Tomtom5 # Copyright (c) 2009-2010 Tomtom 6 6 # http://blog.zenstyle.fr/ 7 7 # -
plugins/dcWikipedia/trunk/inc/class.dc.wikipedia.reader.php
r1106 r2486 3 3 # This file is part of dcWikipedia, a plugin for Dotclear. 4 4 # 5 # Copyright (c) 2009 Tomtom5 # Copyright (c) 2009-2010 Tomtom 6 6 # http://blog.zenstyle.fr/ 7 7 # … … 15 15 protected $user_agent = 'Dotclear Wikipedia API reader/0.1'; 16 16 protected $timeout = 5; 17 protected $validators = null; 18 protected $cache_dir = null; 17 protected $validators = null; ///< <b>array</b> HTTP Cache validators 18 protected $cache_dir = null; ///< <b>string</b> Cache temporary directory 19 19 protected $cache_file_prefix = 'dcwp'; ///< <b>string</b> Cache file prefix 20 protected $cache_ttl = '-30 minutes'; 20 protected $cache_ttl = '-30 minutes'; ///< <b>string</b> Cache TTL 21 21 22 22 public function __construct() … … 86 86 return false; 87 87 } 88 $this->setTimeout($this->timeout); 88 89 $this->setHost($host,$port); 89 90 $this->useSSL($ssl); -
plugins/dcWikipedia/trunk/index.php
r1634 r2486 3 3 # This file is part of dcWikipedia, a plugin for Dotclear. 4 4 # 5 # Copyright (c) 2009 Tomtom5 # Copyright (c) 2009-2010 Tomtom 6 6 # http://blog.zenstyle.fr/ 7 7 # -
plugins/dcWikipedia/trunk/js/popup.js
r1126 r2486 3 3 # This file is part of dcWikipedia, a plugin for Dotclear. 4 4 # 5 # Copyright (c) 2009 Tomtom5 # Copyright (c) 2009-2010 Tomtom 6 6 # http://blog.zenstyle.fr/ 7 7 # -
plugins/dcWikipedia/trunk/js/post.js
r1126 r2486 3 3 # This file is part of dcWikipedia, a plugin for Dotclear. 4 4 # 5 # Copyright (c) 2009 Tomtom5 # Copyright (c) 2009-2010 Tomtom 6 6 # http://blog.zenstyle.fr/ 7 7 # -
plugins/dcWikipedia/trunk/popup.php
r1634 r2486 3 3 # This file is part of dcWikipedia, a plugin for Dotclear. 4 4 # 5 # Copyright (c) 2009 Tomtom5 # Copyright (c) 2009-2010 Tomtom 6 6 # http://blog.zenstyle.fr/ 7 7 # … … 11 11 # -- END LICENSE BLOCK ------------------------------------ 12 12 13 if (!defined('DC_CONTEXT_ADMIN')) { return; } 14 13 15 $value = isset($_GET['value']) ? rawurldecode($_GET['value']) : ''; 14 16 $lang = isset($_GET['lang']) ? rawurldecode($_GET['lang']) : ''; … … 16 18 $parser = dcWikipediaReader::quickParse('http://'.$lang.'.wikipedia.org/w/api.php?action=opensearch&format=xml&search='.rawurlencode($value),DC_TPL_CACHE); 17 19 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 20 echo 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.' › '.__('Add a Wikipedia link').'</h2>'; 31 29 32 30 $rs = $core->blog->getLangs(array('order'=>'asc')); … … 82 80 } 83 81 82 echo 83 '</body>'. 84 '</html>'; 85 84 86 ?> 85 86 </body>87 </html> -
plugins/dcWikipedia/trunk/style.css
r1634 r2486 3 3 # This file is part of dcWikipedia, a plugin for Dotclear. 4 4 # 5 # Copyright (c) 2009 Tomtom5 # Copyright (c) 2009-2010 Tomtom 6 6 # http://blog.zenstyle.fr/ 7 7 #
Note: See TracChangeset
for help on using the changeset viewer.