Changeset 2726
- Timestamp:
- 11/03/10 15:22:06 (3 years ago)
- Location:
- plugins/externalLinks
- Files:
-
- 16 added
- 4 edited
- 5 copied
-
CHANGELOG (added)
-
COPYING (added)
-
MANIFEST (added)
-
_admin.php (modified) (2 diffs)
-
_define.php (modified) (1 diff)
-
_install.php (copied) (copied from plugins/externalLinks/_define.php) (2 diffs)
-
_prepend.php (copied) (copied from plugins/externalLinks/_define.php) (2 diffs)
-
_public.php (modified) (1 diff)
-
config.php (copied) (copied from plugins/externalLinks/_define.php) (2 diffs)
-
img/external.png (added)
-
inc (added)
-
inc/class.tpl.external.links.php (copied) (copied from plugins/externalLinks/_define.php) (2 diffs)
-
index.php (copied) (copied from plugins/externalLinks/_define.php) (2 diffs)
-
js (added)
-
js/external.js (added)
-
js/external.min.js (added)
-
js/popup.js (added)
-
js/popup.min.js (added)
-
js/post.js (added)
-
js/post.min.js (added)
-
locales/fr/main.po (modified) (2 diffs)
-
popup_link.php (added)
-
tpl (added)
-
tpl/index.tpl (added)
-
tpl/popup.tpl (added)
Legend:
- Unmodified
- Added
- Removed
-
plugins/externalLinks/_admin.php
r2418 r2726 4 4 # Copyright (c) 2008 Olivier Meunier and contributors. All rights 5 5 # reserved. 6 # Copyright(C) 2010 Nicolas Roudaire - http://www.nikrou.net 6 7 # 7 8 # DotClear is free software; you can redistribute it and/or modify … … 17 18 # You should have received a copy of the GNU General Public License 18 19 # along with DotClear; if not, write to the Free Software 19 # Foundation, Inc., 5 9 Temple Place, Suite 330, Boston, MA 02111-1307 USA20 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 20 21 # 21 22 # ***** END LICENSE BLOCK ***** 22 23 23 $core->addBehavior('adminBlogPreferencesForm',array('extLinkBehaviors','adminBlogPreferencesForm')); 24 $core->addBehavior('adminBeforeBlogSettingsUpdate',array('extLinkBehaviors','adminBeforeBlogSettingsUpdate')); 24 if (!defined('DC_CONTEXT_ADMIN')) { return; } 25 25 26 class extLinkBehaviors 26 $_menu['Plugins']->addItem(__('External links'), 27 'plugin.php?p=externalLinks', 28 'index.php?pf=externalLinks/img/external.png', 29 preg_match('/plugin.php\?p=externalLinks(&.*)?$/', $_SERVER['REQUEST_URI']), 30 $core->auth->check('usage,contentadmin', $core->blog->id) 31 ); 32 33 if ($core->blog->settings->externallinks->active) { 34 $core->addBehavior('adminPostHeaders', array('externalLinksBehaviors', 'jsLoad')); 35 $core->addBehavior('adminPageHeaders', array('externalLinksBehaviors', 'jsLoad')); 36 $core->addBehavior('adminRelatedHeaders', array('externalLinksBehaviors', 'jsLoad')); 37 $core->addBehavior('adminDashboardHeaders',array('externalLinksBehaviors','jsLoad')); 38 } 39 40 class externalLinksBehaviors 27 41 { 28 public static function adminBlogPreferencesForm($core,$settings) 29 { 30 echo 31 '<fieldset><legend>'.__('External links').'</legend>'. 32 '<p><label class="classic">'. 33 form::checkbox('extlink_enabled','1',$settings->extlink->extlink_enabled). 34 __('Open external links in a new window').'</label></p>'. 35 '</fieldset>'; 36 } 37 38 public static function adminBeforeBlogSettingsUpdate($settings) 39 { 40 $settings->addNameSpace('extlink'); 41 $settings->extlink->put('extlink_enabled',!empty($_POST['extlink_enabled'])); 42 } 42 public static function jsLoad() { 43 global $core; 44 45 $res = sprintf('<script type="text/javascript" src="%s"></script>', 46 html::stripHostURL($core->blog->getQmarkURL().'pf=externalLinks/js/post.min.js') 47 ); 48 return $res; 49 } 43 50 } 44 51 ?> -
plugins/externalLinks/_define.php
r2418 r2726 25 25 /* Description*/ "Opens external links in a new window", 26 26 /* Author */ "Bruno Hondelatte", 27 /* Version */ '3. 1',27 /* Version */ '3.2', 28 28 /* Permissions */ 'admin' 29 29 ); -
plugins/externalLinks/_install.php
r2418 r2726 4 4 # Copyright (c) 2008 Olivier Meunier and contributors. All rights 5 5 # reserved. 6 # Copyright(C) 2010 Nicolas Roudaire - http://www.nikrou.net 6 7 # 7 8 # DotClear is free software; you can redistribute it and/or modify … … 17 18 # You should have received a copy of the GNU General Public License 18 19 # along with DotClear; if not, write to the Free Software 19 # Foundation, Inc., 5 9 Temple Place, Suite 330, Boston, MA 02111-1307 USA20 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 20 21 # 21 22 # ***** END LICENSE BLOCK ***** 22 23 23 $this->registerModule( 24 /* Name */ "externalLinks", 25 /* Description*/ "Opens external links in a new window", 26 /* Author */ "Bruno Hondelatte", 27 /* Version */ '3.1', 28 /* Permissions */ 'admin' 29 ); 24 $version = $core->plugins->moduleInfo('externalLinks', 'version'); 25 if (version_compare($core->getVersion('externalLinks'), $version,'>=')) { 26 return; 27 } 28 29 $settings = $core->blog->settings; 30 $settings->addNamespace('externallinks'); 31 32 $settings->externallinks->put('active', false, 'boolean', 'external Links plugin activation', false); 33 34 $core->setVersion('externalLinks', $version); 35 return true; 30 36 ?> -
plugins/externalLinks/_prepend.php
r2418 r2726 4 4 # Copyright (c) 2008 Olivier Meunier and contributors. All rights 5 5 # reserved. 6 # Copyright(C) 2010 Nicolas Roudaire - http://www.nikrou.net 6 7 # 7 8 # DotClear is free software; you can redistribute it and/or modify … … 17 18 # You should have received a copy of the GNU General Public License 18 19 # along with DotClear; if not, write to the Free Software 19 # Foundation, Inc., 5 9 Temple Place, Suite 330, Boston, MA 02111-1307 USA20 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 20 21 # 21 22 # ***** END LICENSE BLOCK ***** 22 23 23 $this->registerModule( 24 /* Name */ "externalLinks", 25 /* Description*/ "Opens external links in a new window", 26 /* Author */ "Bruno Hondelatte", 27 /* Version */ '3.1', 28 /* Permissions */ 'admin' 29 ); 24 if (!defined('DC_RC_PATH')) { return; } 25 26 $GLOBALS['__autoload']['tplExternalLinks'] = dirname(__FILE__).'/inc/class.tpl.external.links.php'; 30 27 ?> -
plugins/externalLinks/_public.php
r2418 r2726 21 21 # ***** END LICENSE BLOCK ***** 22 22 23 $core->addBehavior('publicHeadContent',array('extLinkPublic','publicHeadContent')); 23 if (!defined('DC_RC_PATH')) { return; } 24 24 25 class extLinkPublic 26 { 27 public static function publicHeadContent($core) 28 { 29 if (!$core->blog->settings->extlink_enabled) { 30 return; 31 } 32 33 $url = $core->blog->getQmarkURL().'pf='.basename(dirname(__FILE__)); 34 echo 35 '<script type="text/javascript">'."\n". 36 "//<![CDATA[\n". 37 '$(document).ready(function(){'."\n". 38 '$("a[href^=\"http\"]").each(function(i){$(this).not("[href*=\""+document.domain+"\"]").not(":has(img)").after(" <a href=\""+$(this).attr("href")+"\" onclick=\"window.open(this.href); return false;\" style=\"border: none;\"><img src=\"'.$url.'/img/external.gif\" alt=\"\" title=\"'.__('Open this link in a new window').'\" /></a>");});});'."\n". 39 "\n//]]>\n". 40 "</script>\n"; 41 } 42 } 25 $core->addBehavior('publicFooterContent', array('tplExternalLinks', 'publicFooterContent')); 43 26 ?> -
plugins/externalLinks/config.php
r2418 r2726 4 4 # Copyright (c) 2008 Olivier Meunier and contributors. All rights 5 5 # reserved. 6 # Copyright(C) 2010 Nicolas Roudaire - http://www.nikrou.net 6 7 # 7 8 # DotClear is free software; you can redistribute it and/or modify … … 17 18 # You should have received a copy of the GNU General Public License 18 19 # along with DotClear; if not, write to the Free Software 19 # Foundation, Inc., 5 9 Temple Place, Suite 330, Boston, MA 02111-1307 USA20 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 20 21 # 21 22 # ***** END LICENSE BLOCK ***** 22 23 23 $this->registerModule( 24 /* Name */ "externalLinks", 25 /* Description*/ "Opens external links in a new window", 26 /* Author */ "Bruno Hondelatte", 27 /* Version */ '3.1', 28 /* Permissions */ 'admin' 29 ); 24 if (!defined('DC_CONTEXT_ADMIN')) { exit; } 25 26 $active = $core->blog->settings->externallinks->active; 27 28 $default_tab = 'externallinks_settings'; 29 30 if (!empty($_POST['saveconfig'])) { 31 try { 32 $active = (empty($_POST['active']))?false:true; 33 34 $core->blog->settings->externallinks->put('active', $active, 'boolean'); 35 $core->blog->triggerBlog(); 36 37 $message = __('Configuration successfully updated.'); 38 } catch(Exception $e) { 39 $core->error->add($e->getMessage()); 40 } 41 } 42 include(dirname(__FILE__).'/tpl/index.tpl'); 30 43 ?> -
plugins/externalLinks/inc/class.tpl.external.links.php
r2418 r2726 4 4 # Copyright (c) 2008 Olivier Meunier and contributors. All rights 5 5 # reserved. 6 # Copyright(C) 2010 Nicolas Roudaire - http://www.nikrou.net 6 7 # 7 8 # DotClear is free software; you can redistribute it and/or modify … … 17 18 # You should have received a copy of the GNU General Public License 18 19 # along with DotClear; if not, write to the Free Software 19 # Foundation, Inc., 5 9 Temple Place, Suite 330, Boston, MA 02111-1307 USA20 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 20 21 # 21 22 # ***** END LICENSE BLOCK ***** 22 23 23 $this->registerModule( 24 /* Name */ "externalLinks", 25 /* Description*/ "Opens external links in a new window", 26 /* Author */ "Bruno Hondelatte", 27 /* Version */ '3.1', 28 /* Permissions */ 'admin' 29 ); 24 class tplExternalLinks 25 { 26 public static function publicFooterContent($core) { 27 if (!$core->blog->settings->externallinks->active) { 28 return; 29 } 30 31 $url = html::stripHostURL($core->blog->getQmarkURL().'pf=externalLinks'); 32 33 echo 34 '<script type="text/javascript">'."\n". 35 "//<![CDATA[\n". 36 'var external_links_image = "'.$url.'/img/external.gif";'. 37 'var external_links_title = "'.__('Open this link in a new window').'";'. 38 "\n//]]>\n". 39 "</script>\n"; 40 41 echo 42 '<script type="text/javascript" src="'.$url.'/js/external.min.js"/></script>'; 43 } 44 } 30 45 ?> -
plugins/externalLinks/index.php
r2418 r2726 4 4 # Copyright (c) 2008 Olivier Meunier and contributors. All rights 5 5 # reserved. 6 # Copyright(C) 2010 Nicolas Roudaire - http://www.nikrou.net 6 7 # 7 8 # DotClear is free software; you can redistribute it and/or modify … … 17 18 # You should have received a copy of the GNU General Public License 18 19 # along with DotClear; if not, write to the Free Software 19 # Foundation, Inc., 5 9 Temple Place, Suite 330, Boston, MA 02111-1307 USA20 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 20 21 # 21 22 # ***** END LICENSE BLOCK ***** 22 23 23 $this->registerModule( 24 /* Name */ "externalLinks", 25 /* Description*/ "Opens external links in a new window", 26 /* Author */ "Bruno Hondelatte", 27 /* Version */ '3.1', 28 /* Permissions */ 'admin' 29 ); 24 if (!defined('DC_CONTEXT_ADMIN')) { exit; } 25 26 if (!empty($_GET['popup'])) { 27 include(dirname(__FILE__).'/popup_link.php'); 28 } else { 29 include(dirname(__FILE__).'/config.php'); 30 } 30 31 ?> -
plugins/externalLinks/locales/fr/main.po
r1578 r2726 1 # Translation of externalLinks dotclear plugin to French 2 # Copyright(C) 2010 Nicolas Roudaire http://www.nikrou.net 3 # This file is distributed under the same license as the Dotclear package. 4 # Nicolas Roudaire <nikrou77@gmail.com>, 2010 5 # 6 1 7 msgid "" 2 msgstr "Content-Type: text/plain; charset=UTF-8\n" 8 msgstr "" 9 10 "Language: fr\n" 11 "MIME-Version: 1.0\n" 12 "Content-Type: text/plain; charset=utf-8\n" 13 "Content-Transfer-Encoding: 8bit\n" 14 15 msgid "About" 16 msgstr "A propos" 17 18 msgid "Enable External links plugin" 19 msgstr "Activer le plugin Liens externes" 20 21 msgid "If you want more informations on that plugin or have new ideas to develope it, or want to submit a bug or need help (to install or configure it) or for anything else ..." 22 msgstr "Si vous voulez des informations sur ce plugin ou si vous avez des idées pour l'améliorer ou si vous pensez avoir trouvé un bug ou si vous avez besoin d'aide (pour l'installer ou le configurer) ou pour tout autre chose..." 23 24 msgid "Go to %sthe dedicated page%s in" 25 msgstr "Allez sur la %spage dédiée%s du" 26 27 msgid "Made by:" 28 msgstr "Créé par : " 29 30 msgid "Contributor:" 31 msgstr "Contributeur : " 32 33 msgid "external link?" 34 msgstr "lien externe ?" 3 35 4 36 msgid "External links" 5 37 msgstr "Liens externes" 6 7 msgid "Open external links in a new window"8 msgstr "Ouvrir les liens externes dans une nouvelle fenêtre"9 38 10 39 msgid "Open this link in a new window" … … 12 41 13 42 43
Note: See TracChangeset
for help on using the changeset viewer.