diff options
-rwxr-xr-x | _admin.php | 32 | ||||
-rwxr-xr-x | _define.php | 22 | ||||
-rwxr-xr-x | photos.paulk.fr.png | bin | 0 -> 1179 bytes | |||
-rwxr-xr-x | post.js | 27 |
4 files changed, 81 insertions, 0 deletions
diff --git a/_admin.php b/_admin.php new file mode 100755 index 0000000..b238668 --- /dev/null +++ b/_admin.php @@ -0,0 +1,32 @@ +<?php +# -- BEGIN LICENSE BLOCK --------------------------------------- +# +# This file is part of Dotclear 2. +# +# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear +# Licensed under the GPL version 2.0 license. +# See LICENSE file or +# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html +# +# -- END LICENSE BLOCK ----------------------------------------- +if (!defined('DC_CONTEXT_ADMIN')) { return; } + +$core->addBehavior('adminPostHeaders',array('photospaulkfrBehaviors','jsLoad')); +$core->addBehavior('adminPageHeaders',array('photospaulkfrBehaviors','jsLoad')); +$core->addBehavior('adminRelatedHeaders',array('photospaulkfrBehaviors','jsLoad')); +$core->addBehavior('adminDashboardHeaders',array('photospaulkfrBehaviors','jsLoad')); + +class photospaulkfrBehaviors +{ + public static function jsLoad() + { + return + '<script type="text/javascript" src="index.php?pf=photos.paulk.fr/post.js"></script>'. + '<script type="text/javascript">'."\n". + "//<![CDATA[\n". + dcPage::jsVar('jsToolBar.prototype.elements.photospaulkfr.title',__('photos.paulk.fr')). + "\n//]]>\n". + "</script>\n"; + } +} +?> diff --git a/_define.php b/_define.php new file mode 100755 index 0000000..a44996e --- /dev/null +++ b/_define.php @@ -0,0 +1,22 @@ +<?php +# -- BEGIN LICENSE BLOCK --------------------------------------- +# +# This file is part of Dotclear 2. +# +# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear +# Licensed under the GPL version 2.0 license. +# See LICENSE file or +# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html +# +# -- END LICENSE BLOCK ----------------------------------------- +if (!defined('DC_RC_PATH')) { return; } + +$this->registerModule( + /* Name */ "photos.paulk.fr", + /* Description*/ "Insert photos from photos.paulk.fr", + /* Author */ "Paul Kocialkowski, Olivier Meunier", + /* Version */ '0.1', + /* Permissions */ 'usage,contentadmin', + /* Priority */ 50 +); +?> diff --git a/photos.paulk.fr.png b/photos.paulk.fr.png Binary files differnew file mode 100755 index 0000000..77f616d --- /dev/null +++ b/photos.paulk.fr.png @@ -0,0 +1,27 @@ +jsToolBar.prototype.elements.photospaulkfr={ +type:'button',title:'photos.paulk.fr',icon:'index.php?pf=photos.paulk.fr/photos.paulk.fr.png',album_prompt:'Album :',image_prompt:'Image :',fn:{},prompt:function(){ +album=this.stripBaseURL(window.prompt(this.elements.photospaulkfr.album_prompt)); +image=this.stripBaseURL(window.prompt(this.elements.photospaulkfr.image_prompt)); +if(image.indexOf(".jpg", 0) == -1) + image=image+".jpg"; +return Array(album, image); +} +}; + +jsToolBar.prototype.elements.photospaulkfr.fn.xhtml=function(){ +var src=this.elements.photospaulkfr.prompt.call(this); +if(src){ +this.encloseSelection('','',function(str){ +return '<a href="http://photos.paulk.fr/index.php?photos_album_id='+src[0]+'&photo_file='+src[1]+'"><img src="http://photos.paulk.fr/thumbnails/'+src[0]+'/'+src[1]+'" alt="" /></a>'; +}); +} +}; + +jsToolBar.prototype.elements.photospaulkfr.fn.wiki=function(){ +var src=this.elements.photospaulkfr.prompt.call(this); +if(src){ +this.encloseSelection('','',function(str){ +return '[((http://photos.paulk.fr/thumbnails/'+src[0]+'/'+src[1]+'))|http://photos.paulk.fr/index.php?photos_album_id='+src[0]+'&photo_file='+src[1]+']'; +}); +} +}; |