commit
756de7b023
Binary file not shown.
@ -10,12 +10,10 @@ class Oekaki extends Extension {
|
|||||||
global $user, $page;
|
global $user, $page;
|
||||||
|
|
||||||
if($event->page_matches("oekaki")) {
|
if($event->page_matches("oekaki")) {
|
||||||
if(!$user->can("create_image")) {
|
if($event->get_arg(0) == "create" and $user->can("create_image")){
|
||||||
$this->theme->display_permission_denied();
|
|
||||||
}
|
|
||||||
|
|
||||||
if($event->get_arg(0) == "create") {
|
|
||||||
$this->theme->display_page();
|
$this->theme->display_page();
|
||||||
|
}else{
|
||||||
|
$this->theme->display_permission_denied();
|
||||||
}
|
}
|
||||||
if($event->get_arg(0) == "upload") {
|
if($event->get_arg(0) == "upload") {
|
||||||
// FIXME: this allows anyone to upload anything to /data ...
|
// FIXME: this allows anyone to upload anything to /data ...
|
||||||
|
@ -1,6 +1,24 @@
|
|||||||
ChibiPaint
|
ChibiPaint
|
||||||
|
|
||||||
|
Original version of ChibiPaint:
|
||||||
Copyright (c) 2006-2008 Marc Schefer
|
Copyright (c) 2006-2008 Marc Schefer
|
||||||
|
http://www.chibipaint.com/
|
||||||
|
|
||||||
|
Some icons taken from the GNU Image Manipulation Program.
|
||||||
|
Art contributors: http://git.gnome.org/browse/gimp/tree/AUTHORS
|
||||||
|
Lapo Calamandrei
|
||||||
|
Paul Davey
|
||||||
|
Alexia Death
|
||||||
|
Aurore Derriennic
|
||||||
|
Tuomas Kuosmanen
|
||||||
|
Karl La Rocca
|
||||||
|
Andreas Nilsson
|
||||||
|
Ville Pätsi
|
||||||
|
Mike Schaeffer
|
||||||
|
Carol Spears
|
||||||
|
Jakub Steiner
|
||||||
|
William Szilveszter
|
||||||
|
|
||||||
|
|
||||||
This file is part of ChibiPaint.
|
This file is part of ChibiPaint.
|
||||||
|
|
||||||
|
@ -1,35 +1,83 @@
|
|||||||
<?php
|
<?php
|
||||||
|
// FIXME: Move all the stuff that handles size input to main.php
|
||||||
|
// FIXME: Move default canvas size to config file; changeable in board config
|
||||||
|
// While we're here, add maximum and minimum image sizes in config
|
||||||
|
// Maybe allow the resolution limiter extension to have a say in this
|
||||||
|
$defOekW = 400; // Common default for oekaki boards: 300x300
|
||||||
|
$defOekH = 400;
|
||||||
class OekakiTheme extends Themelet {
|
class OekakiTheme extends Themelet {
|
||||||
public function display_page() {
|
public function display_page() {
|
||||||
global $config, $page;
|
global $config, $page, $defOekW, $defOekH;
|
||||||
|
|
||||||
$base_href = get_base_href();
|
$base_href = get_base_href();
|
||||||
$http_base = make_http($base_href);
|
$http_base = make_http($base_href);
|
||||||
|
|
||||||
|
if (isset($_POST['oekW']) and isset($_POST['oekH'])){
|
||||||
|
$oekW = $_POST['oekW'];
|
||||||
|
$oekH = $_POST['oekH'];
|
||||||
|
if(!ctype_digit($oekW) or !ctype_digit($oekH)){
|
||||||
|
$oekW = $defOekW;
|
||||||
|
$oekH = $defOekH;
|
||||||
|
}
|
||||||
|
} else{
|
||||||
|
$oekW = $defOekW;
|
||||||
|
$oekH = $defOekH;
|
||||||
|
}
|
||||||
|
|
||||||
$html = "
|
$html = "
|
||||||
<applet archive='$base_href/ext/oekaki/chibipaint.jar' code='chibipaint.ChibiPaint.class' width='800' height='600'>
|
<applet archive='$base_href/ext/oekaki/chibipaint.jar' code='chibipaint.ChibiPaint.class' width='800' height='600'>
|
||||||
<param name='canvasWidth' value='400' />
|
<param name='canvasWidth' value='".$oekW."' />
|
||||||
<param name='canvasHeight' value='300' />
|
<param name='canvasHeight' value='".$oekH."' />
|
||||||
<param name='postUrl' value='".make_http(make_link("oekaki/upload"))."' />
|
<param name='postUrl' value='".make_http(make_link("oekaki/upload"))."' />
|
||||||
<param name='exitUrl' value='".make_http(make_link("oekaki/claim"))."' />
|
<param name='exitUrl' value='".make_http(make_link("oekaki/claim"))."' />
|
||||||
<param name='exitUrlTarget' value='_self' />
|
<param name='exitUrlTarget' value='_self' />
|
||||||
JAVA NOT SUPPORTED! <!-- alternative content for users who don't have Java installed -->
|
JAVA NOT INSTALLED >:(<!-- alternative content for users who don't have Java installed -->
|
||||||
</applet>
|
</applet>
|
||||||
";
|
";
|
||||||
|
|
||||||
# <param name='loadImage' value='http://yourserver/oekaki/pictures/168.png' />
|
# <param name='loadImage' value='http://yourserver/oekaki/pictures/168.png' />
|
||||||
# <param name='loadChibiFile' value='http://yourserver/oekaki/pictures/168.chi' />
|
# <param name='loadChibiFile' value='http://yourserver/oekaki/pictures/168.chi' />
|
||||||
|
// FIXME: prevent oekaki block from collapsing on click in cerctain themes. This causes canvas reset
|
||||||
$page->set_title("Oekaki");
|
$page->set_title("Oekaki");
|
||||||
$page->set_heading("Oekiaki");
|
$page->set_heading("Oekaki");
|
||||||
$page->add_block(new NavBlock());
|
$page->add_block(new NavBlock());
|
||||||
$page->add_block(new Block("Oekaki", $html, "main", 20));
|
$page->add_block(new Block("Oekaki", $html, "main", 20));
|
||||||
|
$page->add_block(new Block(null,
|
||||||
|
"
|
||||||
|
Change canvas size.
|
||||||
|
<br>
|
||||||
|
<form form enctype='multipart/form-data' action='".make_link("oekaki/create")."' method='POST'>
|
||||||
|
<div style='display: inline; margin: 0; width: auto;'>
|
||||||
|
<input autocomplete='off' style='display: inline; margin: 0; width: auto;font-size: 90%' name='oekW' type='text' size='3' value='".$oekW."'/>
|
||||||
|
x
|
||||||
|
<input autocomplete='off' style='display: inline; margin: 0; width: auto;font-size: 90%' name='oekH' type='text' size='3' value='".$oekH."'/>
|
||||||
|
<input autocomplete='off' style='display: inline; margin: 0; width: auto;font-size: 90%' type='submit' value='Go!' />
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
<br>
|
||||||
|
<b>WARNING: Resets canvas!</b>
|
||||||
|
"
|
||||||
|
, "left", 21)); // upload is 20
|
||||||
}
|
}
|
||||||
|
|
||||||
public function display_block() {
|
public function display_block() {
|
||||||
global $page;
|
global $page, $defOekW, $defOekH;
|
||||||
$page->add_block(new Block(null, "<a href='".make_link("oekaki/create")."'>Open Oekaki</a>", "left", 21)); // upload is 20
|
//FIXME: input field alignment could be done more elegantly, without inline styling
|
||||||
|
//FIXME: autocomplete='off' seems to be an invalid HTML tag
|
||||||
|
$page->add_block(new Block(null,
|
||||||
|
"
|
||||||
|
<b>Oekaki</b>
|
||||||
|
<br>
|
||||||
|
<form form enctype='multipart/form-data' action='".make_link("oekaki/create")."' method='POST'>
|
||||||
|
<div style='display: inline; margin: 0; width: auto;'>
|
||||||
|
<input autocomplete='off' style='display: inline; margin: 0; width: auto; font-size: 90%' name='oekW' type='text' size='3' value='".$defOekW."'/>
|
||||||
|
x
|
||||||
|
<input autocomplete='off' style='display: inline; margin: 0; width: auto; font-size: 90%' name='oekH' type='text' size='3' value='".$defOekH."'/>
|
||||||
|
<input autocomplete='off' style='display: inline; margin: 0; width: auto; font-size: 90%' type='submit' value='Go!' />
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
"
|
||||||
|
, "left", 21)); // upload is 20
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user