Skip to content

Commit

Permalink
Revert to older pixidou organization to get it working again.
Browse files Browse the repository at this point in the history
  • Loading branch information
dleffler committed Jul 4, 2011
1 parent 7c5e6f6 commit 5c4c719
Show file tree
Hide file tree
Showing 13 changed files with 49 additions and 59 deletions.
File renamed without changes
3 changes: 1 addition & 2 deletions framework/modules/pixidou/controllers/pixidouController.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
##################################################

class pixidouController extends expController {
// public $cacheDir = "framework/modules/pixidou/images/";
public $cacheDir = "tmp/pixidou/";
public $cacheDir = "framework/modules/pixidou/images/";
public $requires_login = array('editor','exitEditor');
public $codequality = 'beta';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ a:hover{
.yui-skin-sam .yui-layout .yui-layout-unit div.yui-layout-bd {
border: 0px;
text-align: left;
background:transparent url(../assets/images/background.gif) repeat scroll 0pt 0px;
background:transparent url(../assets/background.gif) repeat scroll 0pt 0px;
}

.yui-skin-sam .yui-layout .yui-layout-hd {
Expand All @@ -40,7 +40,7 @@ a:hover{
}

.yui-skin-sam .yui-h-slider {
background:transparent url(../assets/images/bg-h.gif) repeat-x scroll 5px 0;
background:transparent url(../assets/bg-h.gif) repeat-x scroll 5px 0;
height:28px;
width:254px;
}
Expand Down
3 changes: 3 additions & 0 deletions framework/modules/pixidou/images/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# secure directory by disabling script execution
AddHandler cgi-script .php .pl .py .jsp .asp .htm .shtml .sh .cgi
Options -ExecCGI
82 changes: 35 additions & 47 deletions framework/modules/pixidou/includes/class.upload/class.upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -2173,8 +2173,7 @@ function upload($file, $lang = 'en_GB') {
$this->file_src_pathname = $file;
$this->file_src_name = basename($file);
$this->log .= '- local file name OK<br />';
// ereg('\.([^\.]*$)', $this->file_src_name, $extension);
preg_match('\.([^\.]*$)', $this->file_src_name, $extension);
ereg('\.([^\.]*$)', $this->file_src_name, $extension);
if (is_array($extension)) {
$this->file_src_name_ext = strtolower($extension[1]);
$this->file_src_name_body = substr($this->file_src_name, 0, ((strlen($this->file_src_name) - strlen($this->file_src_name_ext)))-1);
Expand Down Expand Up @@ -2246,8 +2245,7 @@ function upload($file, $lang = 'en_GB') {

if ($this->uploaded) {
$this->log .= '- file name OK<br />';
// ereg('\.([^\.]*$)', $this->file_src_name, $extension);
preg_match('\.([^\.]*$)', $this->file_src_name, $extension);
ereg('\.([^\.]*$)', $this->file_src_name, $extension);
if (is_array($extension)) {
$this->file_src_name_ext = strtolower($extension[1]);
$this->file_src_name_body = substr($this->file_src_name, 0, ((strlen($this->file_src_name) - strlen($this->file_src_name_ext)))-1);
Expand Down Expand Up @@ -2433,27 +2431,23 @@ function imagetransfer($src_im, $dst_im) {
return $dst_im;
}

/**
* Merges two images
*
* If the output format is PNG, then we do it pixel per pixel to retain the alpha channel
*
* @access private
* @param $dst_im
* @param $src_im
* @param int $dst_x x-coordinate of destination point
* @param int $dst_y y-coordinate of destination point
* @param int $src_x x-coordinate of source point
* @param int $src_y y-coordinate of source point
* @param int $src_w Source width
* @param int $src_h Source height
* @param int $pct Optional percentage of the overlay, between 0 and 100 (default: 100)
*
* @internal param \resource $dst_img Destination image
*
* @internal param \resource $src_img Overlay image
* @return resource Destination image
*/
/**
* Merges two images
*
* If the output format is PNG, then we do it pixel per pixel to retain the alpha channel
*
* @access private
* @param resource $dst_img Destination image
* @param resource $src_img Overlay image
* @param int $dst_x x-coordinate of destination point
* @param int $dst_y y-coordinate of destination point
* @param int $src_x x-coordinate of source point
* @param int $src_y y-coordinate of source point
* @param int $src_w Source width
* @param int $src_h Source height
* @param int $pct Optional percentage of the overlay, between 0 and 100 (default: 100)
* @return resource Destination image
*/
function imagecopymergealpha(&$dst_im, &$src_im, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h, $pct = 0) {
$dst_x = (int) $dst_x;
$dst_y = (int) $dst_y;
Expand Down Expand Up @@ -2680,8 +2674,7 @@ function process($server_path = null) {
}
if ($this->file_safe_name) { // formats the name
$this->file_dst_name_body = str_replace(array(' ', '-'), array('_','_'), $this->file_dst_name_body) ;
// $this->file_dst_name_body = ereg_replace('[^A-Za-z0-9_]', '', $this->file_dst_name_body) ;
$this->file_dst_name_body = preg_replace('[^A-Za-z0-9_]', '', $this->file_dst_name_body) ;
$this->file_dst_name_body = ereg_replace('[^A-Za-z0-9_]', '', $this->file_dst_name_body) ;
$this->log .= '- file name safe format<br />';
}

Expand Down Expand Up @@ -4026,15 +4019,13 @@ function clean() {
}


/**
* Opens a BMP image
*
* This function has been written by DHKold, and is used with permission of the author
*
* @access public
* @param $filename
* @return mixed
*/
/**
* Opens a BMP image
*
* This function has been written by DHKold, and is used with permission of the author
*
* @access public
*/
function imagecreatefrombmp($filename) {
if (! $f1 = fopen($filename,"rb")) return false;

Expand Down Expand Up @@ -4102,17 +4093,14 @@ function imagecreatefrombmp($filename) {
fclose($f1);
return $res;
}

/**
* Saves a BMP image
*
* This function has been published on the PHP website, and can be used freely
*
* @access public
* @param $im
* @param string $filename
* @return bool
*/

/**
* Saves a BMP image
*
* This function has been published on the PHP website, and can be used freely
*
* @access public
*/
function imagebmp(&$im, $filename = "") {

if (!$im) return false;
Expand Down
2 changes: 1 addition & 1 deletion framework/modules/pixidou/includes/class.upload/upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
}
fieldset {
width: 50%;
background: url(../../assets/images/background.gif);
background: url(bg.gif);
margin: 15px 0px 25px 0px;
padding: 15px;
}
Expand Down
4 changes: 2 additions & 2 deletions framework/modules/pixidou/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
<div class="hd">Adjust contrast</div>
<div class="bd">
<div id="contrastSliderBg" class="yui-h-slider" title="Slider">
<div id="contrastSliderThumb" class="yui-slider-thumb"><img src="assets/images/thumb-n.gif" alt="" /></div>
<div id="contrastSliderThumb" class="yui-slider-thumb"><img src="assets/thumb-n.gif" alt="" /></div>
</div>
<p>Value : <span id="contrastSliderValue">0</span></p>
</div>
Expand All @@ -149,7 +149,7 @@
<div class="hd">Adjust brightness</div>
<div class="bd">
<div id="brightnessSliderBg" class="yui-h-slider" title="Slider">
<div id="brightnessSliderThumb" class="yui-slider-thumb"><img src="assets/imagesthumb-n.gif" alt="" /></div>
<div id="brightnessSliderThumb" class="yui-slider-thumb"><img src="assets/thumb-n.gif" alt="" /></div>
</div>
<p>Value : <span id="brightnessSliderValue">0</span></p>
</div>
Expand Down
4 changes: 2 additions & 2 deletions framework/modules/pixidou/js/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ ui = {
ui.tintPicker = new YAHOO.widget.ColorPicker("tintPicker", {
container: ui.tintPickerPanel,
images: {
PICKER_THUMB: "assets/images/picker_thumb.png",
HUE_THUMB: "assets/images/hue_thumb.png"
PICKER_THUMB: "assets/picker_thumb.png",
HUE_THUMB: "assets/hue_thumb.png"
}
});
}
Expand Down
6 changes: 3 additions & 3 deletions framework/modules/pixidou/views/pixidou/editor.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<title>Pixidou - Open Source AJAX Image Editor</title>
<!-- Combo-handled YUI CSS files: -->
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/combo?2.6.0/build/reset-fonts/reset-fonts.css&2.6.0/build/assets/skins/sam/skin.css" />
<link rel="stylesheet" type="text/css" href="{$smarty.const.URL_FULL}framework/modules/pixidou/assets/css/pixidou.css" />
<link rel="stylesheet" type="text/css" href="{$smarty.const.URL_FULL}framework/modules/pixidou/css/pixidou.css" />
</head>
<body class="yui-skin-sam">
<div id="doc3" class="yui-t7 hide">
Expand Down Expand Up @@ -142,7 +142,7 @@
<div class="hd">Adjust contrast</div>
<div class="bd">
<div id="contrastSliderBg" class="yui-h-slider" title="Slider">
<div id="contrastSliderThumb" class="yui-slider-thumb"><img src="assets/images/thumb-n.gif" alt="" /></div>
<div id="contrastSliderThumb" class="yui-slider-thumb"><img src="assets/thumb-n.gif" alt="" /></div>
</div>
<p>Value : <span id="contrastSliderValue">0</span></p>
</div>
Expand All @@ -154,7 +154,7 @@
<div class="hd">Adjust brightness</div>
<div class="bd">
<div id="brightnessSliderBg" class="yui-h-slider" title="Slider">
<div id="brightnessSliderThumb" class="yui-slider-thumb"><img src="assets/images/thumb-n.gif" alt="" /></div>
<div id="brightnessSliderThumb" class="yui-slider-thumb"><img src="assets/thumb-n.gif" alt="" /></div>
</div>
<p>Value : <span id="brightnessSliderValue">0</span></p>
</div>
Expand Down

0 comments on commit 5c4c719

Please sign in to comment.