summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Kocialkowski2014-01-17 20:25:41 +0100
committerPaul Kocialkowski2014-01-17 20:25:41 +0100
commitdc1fbc29226b64168e8ae01bf42cf81e690d87dd (patch)
treedab6fac19a0f316f80095321a560b5de216d469f
Initial commit
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
-rwxr-xr-x_admin.php32
-rwxr-xr-x_define.php22
-rwxr-xr-xphotos.paulk.fr.pngbin0 -> 1179 bytes
-rwxr-xr-xpost.js27
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
new file mode 100755
index 0000000..77f616d
--- /dev/null
+++ b/photos.paulk.fr.png
Binary files differ
diff --git a/post.js b/post.js
new file mode 100755
index 0000000..f151bc0
--- /dev/null
+++ b/post.js
@@ -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]+']';
+});
+}
+};