@@ -1,32 +1,32 @@ |
||
| 1 | 1 | <?php |
| 2 | - /** |
|
| 3 | - * delete selected files |
|
| 4 | - * @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn) |
|
| 5 | - * @link www.phpletter.com |
|
| 6 | - * @since 22/April/2007 |
|
| 7 | - * |
|
| 8 | - */ |
|
| 2 | + /** |
|
| 3 | + * delete selected files |
|
| 4 | + * @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn) |
|
| 5 | + * @link www.phpletter.com |
|
| 6 | + * @since 22/April/2007 |
|
| 7 | + * |
|
| 8 | + */ |
|
| 9 | 9 | |
| 10 | - require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php"); |
|
| 11 | - if(!empty($_GET['path']) && file_exists($_GET['path']) && is_file($_GET['path']) && isUnderRoot($_GET['path'])) |
|
| 12 | - { |
|
| 10 | + require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php"); |
|
| 11 | + if(!empty($_GET['path']) && file_exists($_GET['path']) && is_file($_GET['path']) && isUnderRoot($_GET['path'])) |
|
| 12 | + { |
|
| 13 | 13 | |
| 14 | - $path = $_GET['path']; |
|
| 15 | - //check if the file size |
|
| 16 | - $fileSize = @filesize($path); |
|
| 14 | + $path = $_GET['path']; |
|
| 15 | + //check if the file size |
|
| 16 | + $fileSize = @filesize($path); |
|
| 17 | 17 | |
| 18 | - if($fileSize > getMemoryLimit()) |
|
| 19 | - {//larger then the php memory limit, redirect to the file |
|
| 18 | + if($fileSize > getMemoryLimit()) |
|
| 19 | + {//larger then the php memory limit, redirect to the file |
|
| 20 | 20 | |
| 21 | - header('Location: ' . $path); |
|
| 22 | - exit; |
|
| 23 | - }else |
|
| 24 | - {//open it up and send out with php |
|
| 25 | - downloadFile($path); |
|
| 21 | + header('Location: ' . $path); |
|
| 22 | + exit; |
|
| 23 | + }else |
|
| 24 | + {//open it up and send out with php |
|
| 25 | + downloadFile($path); |
|
| 26 | 26 | |
| 27 | - } |
|
| 28 | - }else |
|
| 29 | - { |
|
| 30 | - die(ERR_DOWNLOAD_FILE_NOT_FOUND); |
|
| 31 | - } |
|
| 27 | + } |
|
| 28 | + }else |
|
| 29 | + { |
|
| 30 | + die(ERR_DOWNLOAD_FILE_NOT_FOUND); |
|
| 31 | + } |
|
| 32 | 32 | ?> |
| 33 | 33 | \ No newline at end of file |
@@ -7,25 +7,25 @@ |
||
| 7 | 7 | * |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | - require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php"); |
|
| 11 | - if(!empty($_GET['path']) && file_exists($_GET['path']) && is_file($_GET['path']) && isUnderRoot($_GET['path'])) |
|
| 10 | + require_once(dirname(__FILE__).DIRECTORY_SEPARATOR."inc".DIRECTORY_SEPARATOR."config.php"); |
|
| 11 | + if (!empty($_GET['path']) && file_exists($_GET['path']) && is_file($_GET['path']) && isUnderRoot($_GET['path'])) |
|
| 12 | 12 | { |
| 13 | 13 | |
| 14 | 14 | $path = $_GET['path']; |
| 15 | 15 | //check if the file size |
| 16 | 16 | $fileSize = @filesize($path); |
| 17 | 17 | |
| 18 | - if($fileSize > getMemoryLimit()) |
|
| 18 | + if ($fileSize > getMemoryLimit()) |
|
| 19 | 19 | {//larger then the php memory limit, redirect to the file |
| 20 | 20 | |
| 21 | - header('Location: ' . $path); |
|
| 21 | + header('Location: '.$path); |
|
| 22 | 22 | exit; |
| 23 | - }else |
|
| 23 | + } else |
|
| 24 | 24 | {//open it up and send out with php |
| 25 | 25 | downloadFile($path); |
| 26 | 26 | |
| 27 | 27 | } |
| 28 | - }else |
|
| 28 | + } else |
|
| 29 | 29 | { |
| 30 | 30 | die(ERR_DOWNLOAD_FILE_NOT_FOUND); |
| 31 | 31 | } |
@@ -20,12 +20,12 @@ |
||
| 20 | 20 | |
| 21 | 21 | header('Location: ' . $path); |
| 22 | 22 | exit; |
| 23 | - }else |
|
| 23 | + } else |
|
| 24 | 24 | {//open it up and send out with php |
| 25 | 25 | downloadFile($path); |
| 26 | 26 | |
| 27 | 27 | } |
| 28 | - }else |
|
| 28 | + } else |
|
| 29 | 29 | { |
| 30 | 30 | die(ERR_DOWNLOAD_FILE_NOT_FOUND); |
| 31 | 31 | } |
@@ -1,42 +1,42 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | - /** |
|
| 3 | - * Ajax image editor platform |
|
| 4 | - * @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn) |
|
| 5 | - * @link www.phpletter.com |
|
| 6 | - * @since 22/May/2007 |
|
| 7 | - * |
|
| 8 | - */ |
|
| 9 | - require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php"); |
|
| 10 | - if(CONFIG_SYS_VIEW_ONLY || !CONFIG_OPTIONS_EDITABLE) |
|
| 11 | - { |
|
| 12 | - die(SYS_DISABLED); |
|
| 13 | - } |
|
| 14 | - $session->gc(); |
|
| 15 | - $_GET['path'] = empty($_GET['path'])?CONFIG_SYS_ROOT_PATH . "ajax_image_editor_demo.jpg":$_GET['path']; |
|
| 16 | - if(!empty($_GET['path']) && file_exists($_GET['path']) && is_file($_GET['path']) && isUnderRoot($_GET['path'])) |
|
| 17 | - { |
|
| 18 | - $path = $_GET['path']; |
|
| 19 | - }else |
|
| 20 | - { |
|
| 21 | - die(IMG_GEN_IMG_NOT_EXISTS); |
|
| 22 | - } |
|
| 23 | - require_once(CLASS_HISTORY); |
|
| 24 | - $history = new History($path, $session); |
|
| 25 | - if(CONFIG_SYS_DEMO_ENABLE) |
|
| 26 | - { |
|
| 27 | - $sessionImageInfo = $history->getLastestRestorable(); |
|
| 28 | - $originalSessionImageInfo = $history->getOriginalImage(); |
|
| 29 | - if(sizeof($originalSessionImageInfo)) |
|
| 30 | - { |
|
| 31 | - $path = backslashToSlash($session->getSessionDir() . $originalSessionImageInfo['info']['name']); |
|
| 32 | - } |
|
| 33 | - } |
|
| 34 | - require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "class.image.php"); |
|
| 35 | - $image = new Image(); |
|
| 2 | + /** |
|
| 3 | + * Ajax image editor platform |
|
| 4 | + * @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn) |
|
| 5 | + * @link www.phpletter.com |
|
| 6 | + * @since 22/May/2007 |
|
| 7 | + * |
|
| 8 | + */ |
|
| 9 | + require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php"); |
|
| 10 | + if(CONFIG_SYS_VIEW_ONLY || !CONFIG_OPTIONS_EDITABLE) |
|
| 11 | + { |
|
| 12 | + die(SYS_DISABLED); |
|
| 13 | + } |
|
| 14 | + $session->gc(); |
|
| 15 | + $_GET['path'] = empty($_GET['path'])?CONFIG_SYS_ROOT_PATH . "ajax_image_editor_demo.jpg":$_GET['path']; |
|
| 16 | + if(!empty($_GET['path']) && file_exists($_GET['path']) && is_file($_GET['path']) && isUnderRoot($_GET['path'])) |
|
| 17 | + { |
|
| 18 | + $path = $_GET['path']; |
|
| 19 | + }else |
|
| 20 | + { |
|
| 21 | + die(IMG_GEN_IMG_NOT_EXISTS); |
|
| 22 | + } |
|
| 23 | + require_once(CLASS_HISTORY); |
|
| 24 | + $history = new History($path, $session); |
|
| 25 | + if(CONFIG_SYS_DEMO_ENABLE) |
|
| 26 | + { |
|
| 27 | + $sessionImageInfo = $history->getLastestRestorable(); |
|
| 28 | + $originalSessionImageInfo = $history->getOriginalImage(); |
|
| 29 | + if(sizeof($originalSessionImageInfo)) |
|
| 30 | + { |
|
| 31 | + $path = backslashToSlash($session->getSessionDir() . $originalSessionImageInfo['info']['name']); |
|
| 32 | + } |
|
| 33 | + } |
|
| 34 | + require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "class.image.php"); |
|
| 35 | + $image = new Image(); |
|
| 36 | 36 | |
| 37 | - $imageInfo = $image->getImageInfo($path); |
|
| 37 | + $imageInfo = $image->getImageInfo($path); |
|
| 38 | 38 | |
| 39 | - ?> |
|
| 39 | + ?> |
|
| 40 | 40 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
| 41 | 41 | <html xmlns="http://www.w3.org/1999/xhtml"> |
| 42 | 42 | <head> |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | </head> |
| 103 | 103 | <body> |
| 104 | 104 | <?php |
| 105 | - //displayArray($_SESSION); |
|
| 105 | + //displayArray($_SESSION); |
|
| 106 | 106 | |
| 107 | 107 | ?> |
| 108 | 108 | <div id="controls"> |
@@ -6,32 +6,32 @@ |
||
| 6 | 6 | * @since 22/May/2007 |
| 7 | 7 | * |
| 8 | 8 | */ |
| 9 | - require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php"); |
|
| 10 | - if(CONFIG_SYS_VIEW_ONLY || !CONFIG_OPTIONS_EDITABLE) |
|
| 9 | + require_once(dirname(__FILE__).DIRECTORY_SEPARATOR."inc".DIRECTORY_SEPARATOR."config.php"); |
|
| 10 | + if (CONFIG_SYS_VIEW_ONLY || !CONFIG_OPTIONS_EDITABLE) |
|
| 11 | 11 | { |
| 12 | 12 | die(SYS_DISABLED); |
| 13 | 13 | } |
| 14 | 14 | $session->gc(); |
| 15 | - $_GET['path'] = empty($_GET['path'])?CONFIG_SYS_ROOT_PATH . "ajax_image_editor_demo.jpg":$_GET['path']; |
|
| 16 | - if(!empty($_GET['path']) && file_exists($_GET['path']) && is_file($_GET['path']) && isUnderRoot($_GET['path'])) |
|
| 15 | + $_GET['path'] = empty($_GET['path']) ? CONFIG_SYS_ROOT_PATH."ajax_image_editor_demo.jpg" : $_GET['path']; |
|
| 16 | + if (!empty($_GET['path']) && file_exists($_GET['path']) && is_file($_GET['path']) && isUnderRoot($_GET['path'])) |
|
| 17 | 17 | { |
| 18 | 18 | $path = $_GET['path']; |
| 19 | - }else |
|
| 19 | + } else |
|
| 20 | 20 | { |
| 21 | 21 | die(IMG_GEN_IMG_NOT_EXISTS); |
| 22 | 22 | } |
| 23 | 23 | require_once(CLASS_HISTORY); |
| 24 | 24 | $history = new History($path, $session); |
| 25 | - if(CONFIG_SYS_DEMO_ENABLE) |
|
| 25 | + if (CONFIG_SYS_DEMO_ENABLE) |
|
| 26 | 26 | { |
| 27 | 27 | $sessionImageInfo = $history->getLastestRestorable(); |
| 28 | 28 | $originalSessionImageInfo = $history->getOriginalImage(); |
| 29 | - if(sizeof($originalSessionImageInfo)) |
|
| 29 | + if (sizeof($originalSessionImageInfo)) |
|
| 30 | 30 | { |
| 31 | - $path = backslashToSlash($session->getSessionDir() . $originalSessionImageInfo['info']['name']); |
|
| 31 | + $path = backslashToSlash($session->getSessionDir().$originalSessionImageInfo['info']['name']); |
|
| 32 | 32 | } |
| 33 | 33 | } |
| 34 | - require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "class.image.php"); |
|
| 34 | + require_once(dirname(__FILE__).DIRECTORY_SEPARATOR."inc".DIRECTORY_SEPARATOR."class.image.php"); |
|
| 35 | 35 | $image = new Image(); |
| 36 | 36 | |
| 37 | 37 | $imageInfo = $image->getImageInfo($path); |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | if(!empty($_GET['path']) && file_exists($_GET['path']) && is_file($_GET['path']) && isUnderRoot($_GET['path'])) |
| 17 | 17 | { |
| 18 | 18 | $path = $_GET['path']; |
| 19 | - }else |
|
| 19 | + } else |
|
| 20 | 20 | { |
| 21 | 21 | die(IMG_GEN_IMG_NOT_EXISTS); |
| 22 | 22 | } |
@@ -6,10 +6,10 @@ discard block |
||
| 6 | 6 | * @since 22/April/2007 |
| 7 | 7 | * |
| 8 | 8 | */ |
| 9 | -require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php"); |
|
| 9 | +require_once(dirname(__FILE__).DIRECTORY_SEPARATOR."inc".DIRECTORY_SEPARATOR."config.php"); |
|
| 10 | 10 | |
| 11 | 11 | $user = PMF_User_CurrentUser::getFromCookie($faqConfig); |
| 12 | -if (! $user instanceof PMF_User_CurrentUser) { |
|
| 12 | +if (!$user instanceof PMF_User_CurrentUser) { |
|
| 13 | 13 | $user = PMF_User_CurrentUser::getFromSession($faqConfig); |
| 14 | 14 | } |
| 15 | 15 | |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | |
| 32 | 32 | if ($permission['addattachment']) { |
| 33 | 33 | $_SESSION['ajax_user'] = true; |
| 34 | - header('Location: ' . appendQueryString(CONFIG_URL_HOME, makeQueryString())); |
|
| 34 | + header('Location: '.appendQueryString(CONFIG_URL_HOME, makeQueryString())); |
|
| 35 | 35 | exit; |
| 36 | 36 | } |
| 37 | 37 | } |
@@ -75,8 +75,9 @@ |
||
| 75 | 75 | // check user rights, set them TRUE |
| 76 | 76 | $allUserRights = $user->perm->getAllUserRights($user->getUserId()); |
| 77 | 77 | foreach ($allRights as $right) { |
| 78 | - if (in_array($right['right_id'], $allUserRights)) |
|
| 79 | - $permission[$right['name']] = true; |
|
| 78 | + if (in_array($right['right_id'], $allUserRights)) { |
|
| 79 | + $permission[$right['name']] = true; |
|
| 80 | + } |
|
| 80 | 81 | } |
| 81 | 82 | } |
| 82 | 83 | |
@@ -1,34 +1,34 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | - if(!defined('AJAX_INIT_DONE')) |
|
| 3 | - { |
|
| 4 | - die('Permission denied'); |
|
| 5 | - } |
|
| 2 | + if(!defined('AJAX_INIT_DONE')) |
|
| 3 | + { |
|
| 4 | + die('Permission denied'); |
|
| 5 | + } |
|
| 6 | 6 | ?><div id="content"> |
| 7 | 7 | <?php |
| 8 | 8 | |
| 9 | - $count = 1; |
|
| 10 | - $thumbnailBaseUrl = appendQueryString(CONFIG_URL_IMG_THUMBNAIL, makeQueryString(array('path'))); |
|
| 11 | - foreach($fileList as $file) |
|
| 9 | + $count = 1; |
|
| 10 | + $thumbnailBaseUrl = appendQueryString(CONFIG_URL_IMG_THUMBNAIL, makeQueryString(array('path'))); |
|
| 11 | + foreach($fileList as $file) |
|
| 12 | 12 | |
| 13 | - { |
|
| 14 | - ?> |
|
| 13 | + { |
|
| 14 | + ?> |
|
| 15 | 15 | <dl class="thumbnailListing" id="dl<?php echo $count; ?>"> |
| 16 | 16 | <dt id="dt<?php echo $count; ?>" class="<?php echo ($file['type'] == 'folder' && empty($file['file']) && empty($file['subdir'])?'folderEmpty':$file['cssClass']); ?>" class="<?php echo $file['cssClass']; ?>"> |
| 17 | 17 | <?php |
| 18 | - switch($file['cssClass']) |
|
| 19 | - { |
|
| 20 | - case 'filePicture': |
|
| 21 | - echo '<a id="thumbUrl' . $count . '" rel="thumbPhotos" href="' . $file['path'] . '">'; |
|
| 22 | - echo '<img src="' . appendQueryString($thumbnailBaseUrl, 'path=' . $file['path']) . '" id="thumbImg' . $count . '"></a>' . "\n"; |
|
| 23 | - break; |
|
| 24 | - case 'fileFlash': |
|
| 25 | - case 'fileVideo': |
|
| 26 | - case 'fileMusic': |
|
| 27 | - break; |
|
| 28 | - default: |
|
| 29 | - echo ' '; |
|
| 30 | - } |
|
| 31 | - ?> |
|
| 18 | + switch($file['cssClass']) |
|
| 19 | + { |
|
| 20 | + case 'filePicture': |
|
| 21 | + echo '<a id="thumbUrl' . $count . '" rel="thumbPhotos" href="' . $file['path'] . '">'; |
|
| 22 | + echo '<img src="' . appendQueryString($thumbnailBaseUrl, 'path=' . $file['path']) . '" id="thumbImg' . $count . '"></a>' . "\n"; |
|
| 23 | + break; |
|
| 24 | + case 'fileFlash': |
|
| 25 | + case 'fileVideo': |
|
| 26 | + case 'fileMusic': |
|
| 27 | + break; |
|
| 28 | + default: |
|
| 29 | + echo ' '; |
|
| 30 | + } |
|
| 31 | + ?> |
|
| 32 | 32 | |
| 33 | 33 | </dt> |
| 34 | 34 | <dd id="dd<?php echo $count; ?>" class="thumbnailListing_info"><span id="flag<?php echo $count; ?>" class="<?php echo $file['flag']; ?>"> </span><input id="cb<?php echo $count; ?>" type="checkbox" name="check[]" <?php echo ($file['is_writable']?'':'disabled'); ?> class="radio" value="<?php echo $file['path']; ?>" /> |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | |
| 37 | 37 | </dl> |
| 38 | 38 | <?php |
| 39 | - $count++; |
|
| 40 | - } |
|
| 39 | + $count++; |
|
| 40 | + } |
|
| 41 | 41 | ?> |
| 42 | 42 | </div> |
| 43 | 43 | \ No newline at end of file |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | - if(!defined('AJAX_INIT_DONE')) |
|
| 2 | + if (!defined('AJAX_INIT_DONE')) |
|
| 3 | 3 | { |
| 4 | 4 | die('Permission denied'); |
| 5 | 5 | } |
@@ -8,18 +8,18 @@ discard block |
||
| 8 | 8 | |
| 9 | 9 | $count = 1; |
| 10 | 10 | $thumbnailBaseUrl = appendQueryString(CONFIG_URL_IMG_THUMBNAIL, makeQueryString(array('path'))); |
| 11 | - foreach($fileList as $file) |
|
| 11 | + foreach ($fileList as $file) |
|
| 12 | 12 | |
| 13 | 13 | { |
| 14 | 14 | ?> |
| 15 | 15 | <dl class="thumbnailListing" id="dl<?php echo $count; ?>"> |
| 16 | - <dt id="dt<?php echo $count; ?>" class="<?php echo ($file['type'] == 'folder' && empty($file['file']) && empty($file['subdir'])?'folderEmpty':$file['cssClass']); ?>" class="<?php echo $file['cssClass']; ?>"> |
|
| 16 | + <dt id="dt<?php echo $count; ?>" class="<?php echo ($file['type'] == 'folder' && empty($file['file']) && empty($file['subdir']) ? 'folderEmpty' : $file['cssClass']); ?>" class="<?php echo $file['cssClass']; ?>"> |
|
| 17 | 17 | <?php |
| 18 | - switch($file['cssClass']) |
|
| 18 | + switch ($file['cssClass']) |
|
| 19 | 19 | { |
| 20 | 20 | case 'filePicture': |
| 21 | - echo '<a id="thumbUrl' . $count . '" rel="thumbPhotos" href="' . $file['path'] . '">'; |
|
| 22 | - echo '<img src="' . appendQueryString($thumbnailBaseUrl, 'path=' . $file['path']) . '" id="thumbImg' . $count . '"></a>' . "\n"; |
|
| 21 | + echo '<a id="thumbUrl'.$count.'" rel="thumbPhotos" href="'.$file['path'].'">'; |
|
| 22 | + echo '<img src="'.appendQueryString($thumbnailBaseUrl, 'path='.$file['path']).'" id="thumbImg'.$count.'"></a>'."\n"; |
|
| 23 | 23 | break; |
| 24 | 24 | case 'fileFlash': |
| 25 | 25 | case 'fileVideo': |
@@ -31,8 +31,8 @@ discard block |
||
| 31 | 31 | ?> |
| 32 | 32 | |
| 33 | 33 | </dt> |
| 34 | - <dd id="dd<?php echo $count; ?>" class="thumbnailListing_info"><span id="flag<?php echo $count; ?>" class="<?php echo $file['flag']; ?>"> </span><input id="cb<?php echo $count; ?>" type="checkbox" name="check[]" <?php echo ($file['is_writable']?'':'disabled'); ?> class="radio" value="<?php echo $file['path']; ?>" /> |
|
| 35 | - <a <?php echo ($file['cssClass']== 'filePicture'?'rel="orgImg"':''); ?> href="<?php echo $file['path']; ?>" title="<?php echo $file['name']; ?>" id="a<?php echo $count; ?>"><?php echo shortenFileName($file['name']); ?></a></dd> |
|
| 34 | + <dd id="dd<?php echo $count; ?>" class="thumbnailListing_info"><span id="flag<?php echo $count; ?>" class="<?php echo $file['flag']; ?>"> </span><input id="cb<?php echo $count; ?>" type="checkbox" name="check[]" <?php echo ($file['is_writable'] ? '' : 'disabled'); ?> class="radio" value="<?php echo $file['path']; ?>" /> |
|
| 35 | + <a <?php echo ($file['cssClass'] == 'filePicture' ? 'rel="orgImg"' : ''); ?> href="<?php echo $file['path']; ?>" title="<?php echo $file['name']; ?>" id="a<?php echo $count; ?>"><?php echo shortenFileName($file['name']); ?></a></dd> |
|
| 36 | 36 | |
| 37 | 37 | </dl> |
| 38 | 38 | <?php |
@@ -1,44 +1,44 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | - /** |
|
| 3 | - * Ajax image editor platform |
|
| 4 | - * @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn) |
|
| 5 | - * @link www.phpletter.com |
|
| 6 | - * @since 22/May/2007 |
|
| 7 | - * |
|
| 8 | - */ |
|
| 9 | - require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php"); |
|
| 10 | - if(CONFIG_SYS_VIEW_ONLY || !CONFIG_OPTIONS_EDITABLE) |
|
| 11 | - { |
|
| 12 | - die(SYS_DISABLED); |
|
| 13 | - } |
|
| 14 | - $session->gc(); |
|
| 15 | - $_GET['path'] = empty($_GET['path'])?CONFIG_SYS_ROOT_PATH . "ajax_image_editor_demo.jpg":$_GET['path']; |
|
| 16 | - if(!empty($_GET['path']) && file_exists($_GET['path']) && is_file($_GET['path']) && isUnderRoot($_GET['path'])) |
|
| 17 | - { |
|
| 18 | - $path = $_GET['path']; |
|
| 19 | - }else |
|
| 20 | - { |
|
| 21 | - die(TXT_FILE_NOT_FOUND); |
|
| 22 | - } |
|
| 23 | - if(file_exists(DIR_AJAX_EDIT_AREA . "reg_syntax" . DIRECTORY_SEPARATOR . getFileExt($path) . ".js")) |
|
| 24 | - { |
|
| 25 | - $syntax = getFileExt($path); |
|
| 26 | - }else |
|
| 27 | - { |
|
| 28 | - switch (getFileExt($path)) |
|
| 29 | - { |
|
| 30 | - case 'htm': |
|
| 31 | - $syntax = 'html'; |
|
| 32 | - break; |
|
| 33 | - default: |
|
| 34 | - $syntax = 'basic'; |
|
| 35 | - } |
|
| 36 | - } |
|
| 37 | - if(array_search(getFileExt($path), getValidTextEditorExts())=== false) |
|
| 38 | - { |
|
| 39 | - die(TXT_DISALLOWED_EXT); |
|
| 40 | - } |
|
| 41 | - ?> |
|
| 2 | + /** |
|
| 3 | + * Ajax image editor platform |
|
| 4 | + * @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn) |
|
| 5 | + * @link www.phpletter.com |
|
| 6 | + * @since 22/May/2007 |
|
| 7 | + * |
|
| 8 | + */ |
|
| 9 | + require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php"); |
|
| 10 | + if(CONFIG_SYS_VIEW_ONLY || !CONFIG_OPTIONS_EDITABLE) |
|
| 11 | + { |
|
| 12 | + die(SYS_DISABLED); |
|
| 13 | + } |
|
| 14 | + $session->gc(); |
|
| 15 | + $_GET['path'] = empty($_GET['path'])?CONFIG_SYS_ROOT_PATH . "ajax_image_editor_demo.jpg":$_GET['path']; |
|
| 16 | + if(!empty($_GET['path']) && file_exists($_GET['path']) && is_file($_GET['path']) && isUnderRoot($_GET['path'])) |
|
| 17 | + { |
|
| 18 | + $path = $_GET['path']; |
|
| 19 | + }else |
|
| 20 | + { |
|
| 21 | + die(TXT_FILE_NOT_FOUND); |
|
| 22 | + } |
|
| 23 | + if(file_exists(DIR_AJAX_EDIT_AREA . "reg_syntax" . DIRECTORY_SEPARATOR . getFileExt($path) . ".js")) |
|
| 24 | + { |
|
| 25 | + $syntax = getFileExt($path); |
|
| 26 | + }else |
|
| 27 | + { |
|
| 28 | + switch (getFileExt($path)) |
|
| 29 | + { |
|
| 30 | + case 'htm': |
|
| 31 | + $syntax = 'html'; |
|
| 32 | + break; |
|
| 33 | + default: |
|
| 34 | + $syntax = 'basic'; |
|
| 35 | + } |
|
| 36 | + } |
|
| 37 | + if(array_search(getFileExt($path), getValidTextEditorExts())=== false) |
|
| 38 | + { |
|
| 39 | + die(TXT_DISALLOWED_EXT); |
|
| 40 | + } |
|
| 41 | + ?> |
|
| 42 | 42 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
| 43 | 43 | <html xmlns="http://www.w3.org/1999/xhtml"> |
| 44 | 44 | <head> |
@@ -123,13 +123,13 @@ discard block |
||
| 123 | 123 | <input type="text" id="new_name" class="input" name="new_name" value="" /> |
| 124 | 124 | . <select id="ext" name="ext"> |
| 125 | 125 | <?php |
| 126 | - foreach(getValidTextEditorExts() as $v) |
|
| 127 | - { |
|
| 128 | - ?> |
|
| 126 | + foreach(getValidTextEditorExts() as $v) |
|
| 127 | + { |
|
| 128 | + ?> |
|
| 129 | 129 | <option value="<?php echo $v; ?>" <?php echo (strtolower($v) == strtolower(getFileExt($path))?'selected':''); ?>><?php echo $v; ?></option> |
| 130 | 130 | <?php |
| 131 | - } |
|
| 132 | - ?> |
|
| 131 | + } |
|
| 132 | + ?> |
|
| 133 | 133 | </select> |
| 134 | 134 | </td> |
| 135 | 135 | </tr> |
@@ -6,24 +6,24 @@ discard block |
||
| 6 | 6 | * @since 22/May/2007 |
| 7 | 7 | * |
| 8 | 8 | */ |
| 9 | - require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php"); |
|
| 10 | - if(CONFIG_SYS_VIEW_ONLY || !CONFIG_OPTIONS_EDITABLE) |
|
| 9 | + require_once(dirname(__FILE__).DIRECTORY_SEPARATOR."inc".DIRECTORY_SEPARATOR."config.php"); |
|
| 10 | + if (CONFIG_SYS_VIEW_ONLY || !CONFIG_OPTIONS_EDITABLE) |
|
| 11 | 11 | { |
| 12 | 12 | die(SYS_DISABLED); |
| 13 | 13 | } |
| 14 | 14 | $session->gc(); |
| 15 | - $_GET['path'] = empty($_GET['path'])?CONFIG_SYS_ROOT_PATH . "ajax_image_editor_demo.jpg":$_GET['path']; |
|
| 16 | - if(!empty($_GET['path']) && file_exists($_GET['path']) && is_file($_GET['path']) && isUnderRoot($_GET['path'])) |
|
| 15 | + $_GET['path'] = empty($_GET['path']) ? CONFIG_SYS_ROOT_PATH."ajax_image_editor_demo.jpg" : $_GET['path']; |
|
| 16 | + if (!empty($_GET['path']) && file_exists($_GET['path']) && is_file($_GET['path']) && isUnderRoot($_GET['path'])) |
|
| 17 | 17 | { |
| 18 | 18 | $path = $_GET['path']; |
| 19 | - }else |
|
| 19 | + } else |
|
| 20 | 20 | { |
| 21 | 21 | die(TXT_FILE_NOT_FOUND); |
| 22 | 22 | } |
| 23 | - if(file_exists(DIR_AJAX_EDIT_AREA . "reg_syntax" . DIRECTORY_SEPARATOR . getFileExt($path) . ".js")) |
|
| 23 | + if (file_exists(DIR_AJAX_EDIT_AREA."reg_syntax".DIRECTORY_SEPARATOR.getFileExt($path).".js")) |
|
| 24 | 24 | { |
| 25 | 25 | $syntax = getFileExt($path); |
| 26 | - }else |
|
| 26 | + } else |
|
| 27 | 27 | { |
| 28 | 28 | switch (getFileExt($path)) |
| 29 | 29 | { |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | $syntax = 'basic'; |
| 35 | 35 | } |
| 36 | 36 | } |
| 37 | - if(array_search(getFileExt($path), getValidTextEditorExts())=== false) |
|
| 37 | + if (array_search(getFileExt($path), getValidTextEditorExts()) === false) |
|
| 38 | 38 | { |
| 39 | 39 | die(TXT_DISALLOWED_EXT); |
| 40 | 40 | } |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | ,toolbar:"search, go_to_line, fullscreen, |, undo, redo, |, select_font,|, highlight, reset_highlight, |, save, save_as" |
| 74 | 74 | ,save_callback:"save" |
| 75 | 75 | ,save_as_callback:"save_as" |
| 76 | - ,language: "<?php echo (file_exists(DIR_AJAX_EDIT_AREA . 'langs' . DIRECTORY_SEPARATOR .CONFIG_LANG_INDEX . ".js")?CONFIG_LANG_INDEX:'en'); ?>" |
|
| 76 | + ,language: "<?php echo (file_exists(DIR_AJAX_EDIT_AREA.'langs'.DIRECTORY_SEPARATOR.CONFIG_LANG_INDEX.".js") ? CONFIG_LANG_INDEX : 'en'); ?>" |
|
| 77 | 77 | ,syntax: "<?php echo $syntax; ?>" |
| 78 | 78 | }); |
| 79 | 79 | jQuery('#windowSaveAs').jqm(); |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | <textarea name="content" id="content" style="height:500px; width: 97%;"><?php echo getFileContent($path); ?></textarea> |
| 97 | 97 | </div> |
| 98 | 98 | <div id="windowProcessing" class="jqmWindow" style="display:none"> |
| 99 | - <form name="frmProcessing" id="frmProcessing" method="POST" action="<?php echo appendQueryString(CONFIG_URL_SAVE_TEXT, makeQueryString(array('path')));?>"> |
|
| 99 | + <form name="frmProcessing" id="frmProcessing" method="POST" action="<?php echo appendQueryString(CONFIG_URL_SAVE_TEXT, makeQueryString(array('path'))); ?>"> |
|
| 100 | 100 | <input type="hidden" name="folder" id="folder" value="<?php echo dirname($path); ?>" /> |
| 101 | 101 | <input type="hidden" name="name" id="name" value="<?php echo basename($path); ?>" /> |
| 102 | 102 | <input type="hidden" name="save_as_request" id="save_as_request" value="0" /> |
@@ -123,10 +123,10 @@ discard block |
||
| 123 | 123 | <input type="text" id="new_name" class="input" name="new_name" value="" /> |
| 124 | 124 | . <select id="ext" name="ext"> |
| 125 | 125 | <?php |
| 126 | - foreach(getValidTextEditorExts() as $v) |
|
| 126 | + foreach (getValidTextEditorExts() as $v) |
|
| 127 | 127 | { |
| 128 | 128 | ?> |
| 129 | - <option value="<?php echo $v; ?>" <?php echo (strtolower($v) == strtolower(getFileExt($path))?'selected':''); ?>><?php echo $v; ?></option> |
|
| 129 | + <option value="<?php echo $v; ?>" <?php echo (strtolower($v) == strtolower(getFileExt($path)) ? 'selected' : ''); ?>><?php echo $v; ?></option> |
|
| 130 | 130 | <?php |
| 131 | 131 | } |
| 132 | 132 | ?> |
@@ -16,14 +16,14 @@ |
||
| 16 | 16 | if(!empty($_GET['path']) && file_exists($_GET['path']) && is_file($_GET['path']) && isUnderRoot($_GET['path'])) |
| 17 | 17 | { |
| 18 | 18 | $path = $_GET['path']; |
| 19 | - }else |
|
| 19 | + } else |
|
| 20 | 20 | { |
| 21 | 21 | die(TXT_FILE_NOT_FOUND); |
| 22 | 22 | } |
| 23 | 23 | if(file_exists(DIR_AJAX_EDIT_AREA . "reg_syntax" . DIRECTORY_SEPARATOR . getFileExt($path) . ".js")) |
| 24 | 24 | { |
| 25 | 25 | $syntax = getFileExt($path); |
| 26 | - }else |
|
| 26 | + } else |
|
| 27 | 27 | { |
| 28 | 28 | switch (getFileExt($path)) |
| 29 | 29 | { |
@@ -1,116 +1,116 @@ |
||
| 1 | 1 | <?php |
| 2 | - /** |
|
| 3 | - * reset the image |
|
| 4 | - * @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn) |
|
| 5 | - * @link www.phpletter.com |
|
| 6 | - * @since 22/May/2007 |
|
| 7 | - * |
|
| 8 | - */ |
|
| 9 | - require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php"); |
|
| 10 | - if(!isset($_POST['path'])) |
|
| 11 | - { |
|
| 12 | - $_POST['path'] = "uploaded/Winter.jpg" . "?" . makeQueryString(array('path')); |
|
| 13 | - //for crop |
|
| 14 | - $_POST['mode'] = "crop"; |
|
| 15 | - $_POST['x'] = 100; |
|
| 16 | - $_POST['y'] = 100; |
|
| 17 | - $imageInfo = @GetImageSize($_POST['path']); |
|
| 18 | - $_POST['width'] = $imageInfo[0]; |
|
| 19 | - $_POST['height'] = $imageInfo[1]; |
|
| 2 | + /** |
|
| 3 | + * reset the image |
|
| 4 | + * @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn) |
|
| 5 | + * @link www.phpletter.com |
|
| 6 | + * @since 22/May/2007 |
|
| 7 | + * |
|
| 8 | + */ |
|
| 9 | + require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php"); |
|
| 10 | + if(!isset($_POST['path'])) |
|
| 11 | + { |
|
| 12 | + $_POST['path'] = "uploaded/Winter.jpg" . "?" . makeQueryString(array('path')); |
|
| 13 | + //for crop |
|
| 14 | + $_POST['mode'] = "crop"; |
|
| 15 | + $_POST['x'] = 100; |
|
| 16 | + $_POST['y'] = 100; |
|
| 17 | + $imageInfo = @GetImageSize($_POST['path']); |
|
| 18 | + $_POST['width'] = $imageInfo[0]; |
|
| 19 | + $_POST['height'] = $imageInfo[1]; |
|
| 20 | 20 | |
| 21 | - } |
|
| 22 | - initSessionHistory($_POST['path']); |
|
| 21 | + } |
|
| 22 | + initSessionHistory($_POST['path']); |
|
| 23 | 23 | |
| 24 | - echo "{"; |
|
| 25 | - $error = ""; |
|
| 26 | - $info = ""; |
|
| 24 | + echo "{"; |
|
| 25 | + $error = ""; |
|
| 26 | + $info = ""; |
|
| 27 | 27 | |
| 28 | - if(empty($_POST['path'])) |
|
| 29 | - { |
|
| 30 | - $error = IMG_SAVE_EMPTY_PATH; |
|
| 31 | - }elseif(!file_exists($_POST['path'])) |
|
| 32 | - { |
|
| 33 | - $error = IMG_SAVE_NOT_EXISTS; |
|
| 34 | - }else if(!isUnderRoot($_POST['path'])) |
|
| 35 | - { |
|
| 36 | - $error = IMG_SAVE_PATH_DISALLOWED; |
|
| 37 | - } |
|
| 38 | - else |
|
| 39 | - { |
|
| 40 | - if(!empty($_POST['mode'])) |
|
| 41 | - { |
|
| 28 | + if(empty($_POST['path'])) |
|
| 29 | + { |
|
| 30 | + $error = IMG_SAVE_EMPTY_PATH; |
|
| 31 | + }elseif(!file_exists($_POST['path'])) |
|
| 32 | + { |
|
| 33 | + $error = IMG_SAVE_NOT_EXISTS; |
|
| 34 | + }else if(!isUnderRoot($_POST['path'])) |
|
| 35 | + { |
|
| 36 | + $error = IMG_SAVE_PATH_DISALLOWED; |
|
| 37 | + } |
|
| 38 | + else |
|
| 39 | + { |
|
| 40 | + if(!empty($_POST['mode'])) |
|
| 41 | + { |
|
| 42 | 42 | |
| 43 | - include_once(CLASS_IMAGE); |
|
| 44 | - $image = new Image(); |
|
| 45 | - $image->loadImage($_POST['path']); |
|
| 43 | + include_once(CLASS_IMAGE); |
|
| 44 | + $image = new Image(); |
|
| 45 | + $image->loadImage($_POST['path']); |
|
| 46 | 46 | |
| 47 | - switch($_POST['mode']) |
|
| 48 | - { |
|
| 49 | - case "resize": |
|
| 50 | - if(!$image->resize($_POST['width'], $_POST['height'], (!empty($_POST['constraint'])?true:false))) |
|
| 51 | - { |
|
| 52 | - $error = IMG_SAVE_RESIZE_FAILED; |
|
| 53 | - } |
|
| 54 | - break; |
|
| 55 | - case "crop": |
|
| 56 | - if(!$image->cropToDimensions($_POST['x'], $_POST['y'], intval($_POST['x']) + intval($_POST['width']), intval($_POST['y']) + intval($_POST['height']))) |
|
| 57 | - { |
|
| 58 | - $error = IMG_SAVE_CROP_FAILED; |
|
| 59 | - } |
|
| 47 | + switch($_POST['mode']) |
|
| 48 | + { |
|
| 49 | + case "resize": |
|
| 50 | + if(!$image->resize($_POST['width'], $_POST['height'], (!empty($_POST['constraint'])?true:false))) |
|
| 51 | + { |
|
| 52 | + $error = IMG_SAVE_RESIZE_FAILED; |
|
| 53 | + } |
|
| 54 | + break; |
|
| 55 | + case "crop": |
|
| 56 | + if(!$image->cropToDimensions($_POST['x'], $_POST['y'], intval($_POST['x']) + intval($_POST['width']), intval($_POST['y']) + intval($_POST['height']))) |
|
| 57 | + { |
|
| 58 | + $error = IMG_SAVE_CROP_FAILED; |
|
| 59 | + } |
|
| 60 | 60 | |
| 61 | - break; |
|
| 62 | - case "flip": |
|
| 63 | - if(!$image->flip($_POST['flip_angle'])) |
|
| 64 | - { |
|
| 65 | - $error = IMG_SAVE_FLIP_FAILED; |
|
| 66 | - } |
|
| 67 | - break; |
|
| 68 | - case "rotate": |
|
| 69 | - if(!$image->rotate(intval($_POST['angle']))) |
|
| 70 | - { |
|
| 71 | - $error = IMG_SAVE_ROTATE_FAILED; |
|
| 72 | - } |
|
| 73 | - break; |
|
| 74 | - default: |
|
| 75 | - $error = IMG_SAVE_UNKNOWN_MODE; |
|
| 76 | - } |
|
| 77 | - if(empty($error)) |
|
| 78 | - { |
|
| 61 | + break; |
|
| 62 | + case "flip": |
|
| 63 | + if(!$image->flip($_POST['flip_angle'])) |
|
| 64 | + { |
|
| 65 | + $error = IMG_SAVE_FLIP_FAILED; |
|
| 66 | + } |
|
| 67 | + break; |
|
| 68 | + case "rotate": |
|
| 69 | + if(!$image->rotate(intval($_POST['angle']))) |
|
| 70 | + { |
|
| 71 | + $error = IMG_SAVE_ROTATE_FAILED; |
|
| 72 | + } |
|
| 73 | + break; |
|
| 74 | + default: |
|
| 75 | + $error = IMG_SAVE_UNKNOWN_MODE; |
|
| 76 | + } |
|
| 77 | + if(empty($error)) |
|
| 78 | + { |
|
| 79 | 79 | |
| 80 | - $sessionNewPath = $session->getSessionDir() . uniqid(md5(time())) . "." . getFileExt($_POST['path']); |
|
| 81 | - if(!@copy($_POST['path'], $sessionNewPath)) |
|
| 82 | - { |
|
| 83 | - $error = IMG_SAVE_BACKUP_FAILED; |
|
| 84 | - }else |
|
| 85 | - { |
|
| 86 | - addSessionHistory($_POST['path'], $sessionNewPath); |
|
| 87 | - if($image->saveImage($_POST['path'])) |
|
| 88 | - { |
|
| 89 | - $imageInfo = $image->getFinalImageInfo(); |
|
| 90 | - $info .= ",width:" . $imageInfo['width'] . "\n"; |
|
| 91 | - $info .= ",height:" . $imageInfo['height'] . "\n"; |
|
| 92 | - $info .= ",size:'" . transformFileSize($imageInfo['size']) . "'\n"; |
|
| 93 | - }else |
|
| 94 | - { |
|
| 95 | - $error = IMG_SAVE_FAILED; |
|
| 96 | - } |
|
| 97 | - } |
|
| 98 | - }else |
|
| 99 | - { |
|
| 100 | - //$image->DestroyImages(); |
|
| 101 | - } |
|
| 102 | - }else |
|
| 103 | - { |
|
| 104 | - $error = IMG_SAVE_UNKNOWN_MODE; |
|
| 105 | - } |
|
| 106 | - } |
|
| 80 | + $sessionNewPath = $session->getSessionDir() . uniqid(md5(time())) . "." . getFileExt($_POST['path']); |
|
| 81 | + if(!@copy($_POST['path'], $sessionNewPath)) |
|
| 82 | + { |
|
| 83 | + $error = IMG_SAVE_BACKUP_FAILED; |
|
| 84 | + }else |
|
| 85 | + { |
|
| 86 | + addSessionHistory($_POST['path'], $sessionNewPath); |
|
| 87 | + if($image->saveImage($_POST['path'])) |
|
| 88 | + { |
|
| 89 | + $imageInfo = $image->getFinalImageInfo(); |
|
| 90 | + $info .= ",width:" . $imageInfo['width'] . "\n"; |
|
| 91 | + $info .= ",height:" . $imageInfo['height'] . "\n"; |
|
| 92 | + $info .= ",size:'" . transformFileSize($imageInfo['size']) . "'\n"; |
|
| 93 | + }else |
|
| 94 | + { |
|
| 95 | + $error = IMG_SAVE_FAILED; |
|
| 96 | + } |
|
| 97 | + } |
|
| 98 | + }else |
|
| 99 | + { |
|
| 100 | + //$image->DestroyImages(); |
|
| 101 | + } |
|
| 102 | + }else |
|
| 103 | + { |
|
| 104 | + $error = IMG_SAVE_UNKNOWN_MODE; |
|
| 105 | + } |
|
| 106 | + } |
|
| 107 | 107 | |
| 108 | - echo "error:'" . $error . "'\n"; |
|
| 109 | - if(isset($image) && is_object($image)) |
|
| 110 | - { |
|
| 111 | - $image->DestroyImages(); |
|
| 112 | - } |
|
| 113 | - echo $info; |
|
| 114 | - echo ",history:" . sizeof($_SESSION[$_POST['path']]) . "\n"; |
|
| 115 | - echo "}"; |
|
| 108 | + echo "error:'" . $error . "'\n"; |
|
| 109 | + if(isset($image) && is_object($image)) |
|
| 110 | + { |
|
| 111 | + $image->DestroyImages(); |
|
| 112 | + } |
|
| 113 | + echo $info; |
|
| 114 | + echo ",history:" . sizeof($_SESSION[$_POST['path']]) . "\n"; |
|
| 115 | + echo "}"; |
|
| 116 | 116 | ?> |
| 117 | 117 | \ No newline at end of file |
@@ -6,10 +6,10 @@ discard block |
||
| 6 | 6 | * @since 22/May/2007 |
| 7 | 7 | * |
| 8 | 8 | */ |
| 9 | - require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php"); |
|
| 10 | - if(!isset($_POST['path'])) |
|
| 9 | + require_once(dirname(__FILE__).DIRECTORY_SEPARATOR."inc".DIRECTORY_SEPARATOR."config.php"); |
|
| 10 | + if (!isset($_POST['path'])) |
|
| 11 | 11 | { |
| 12 | - $_POST['path'] = "uploaded/Winter.jpg" . "?" . makeQueryString(array('path')); |
|
| 12 | + $_POST['path'] = "uploaded/Winter.jpg"."?".makeQueryString(array('path')); |
|
| 13 | 13 | //for crop |
| 14 | 14 | $_POST['mode'] = "crop"; |
| 15 | 15 | $_POST['x'] = 100; |
@@ -25,48 +25,48 @@ discard block |
||
| 25 | 25 | $error = ""; |
| 26 | 26 | $info = ""; |
| 27 | 27 | |
| 28 | - if(empty($_POST['path'])) |
|
| 28 | + if (empty($_POST['path'])) |
|
| 29 | 29 | { |
| 30 | - $error = IMG_SAVE_EMPTY_PATH; |
|
| 31 | - }elseif(!file_exists($_POST['path'])) |
|
| 30 | + $error = IMG_SAVE_EMPTY_PATH; |
|
| 31 | + }elseif (!file_exists($_POST['path'])) |
|
| 32 | 32 | { |
| 33 | - $error = IMG_SAVE_NOT_EXISTS; |
|
| 34 | - }else if(!isUnderRoot($_POST['path'])) |
|
| 33 | + $error = IMG_SAVE_NOT_EXISTS; |
|
| 34 | + } else if (!isUnderRoot($_POST['path'])) |
|
| 35 | 35 | { |
| 36 | 36 | $error = IMG_SAVE_PATH_DISALLOWED; |
| 37 | 37 | } |
| 38 | 38 | else |
| 39 | 39 | { |
| 40 | - if(!empty($_POST['mode'])) |
|
| 40 | + if (!empty($_POST['mode'])) |
|
| 41 | 41 | { |
| 42 | 42 | |
| 43 | 43 | include_once(CLASS_IMAGE); |
| 44 | 44 | $image = new Image(); |
| 45 | 45 | $image->loadImage($_POST['path']); |
| 46 | 46 | |
| 47 | - switch($_POST['mode']) |
|
| 47 | + switch ($_POST['mode']) |
|
| 48 | 48 | { |
| 49 | 49 | case "resize": |
| 50 | - if(!$image->resize($_POST['width'], $_POST['height'], (!empty($_POST['constraint'])?true:false))) |
|
| 50 | + if (!$image->resize($_POST['width'], $_POST['height'], (!empty($_POST['constraint']) ? true : false))) |
|
| 51 | 51 | { |
| 52 | 52 | $error = IMG_SAVE_RESIZE_FAILED; |
| 53 | 53 | } |
| 54 | 54 | break; |
| 55 | 55 | case "crop": |
| 56 | - if(!$image->cropToDimensions($_POST['x'], $_POST['y'], intval($_POST['x']) + intval($_POST['width']), intval($_POST['y']) + intval($_POST['height']))) |
|
| 56 | + if (!$image->cropToDimensions($_POST['x'], $_POST['y'], intval($_POST['x']) + intval($_POST['width']), intval($_POST['y']) + intval($_POST['height']))) |
|
| 57 | 57 | { |
| 58 | 58 | $error = IMG_SAVE_CROP_FAILED; |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | break; |
| 62 | 62 | case "flip": |
| 63 | - if(!$image->flip($_POST['flip_angle'])) |
|
| 63 | + if (!$image->flip($_POST['flip_angle'])) |
|
| 64 | 64 | { |
| 65 | 65 | $error = IMG_SAVE_FLIP_FAILED; |
| 66 | 66 | } |
| 67 | 67 | break; |
| 68 | 68 | case "rotate": |
| 69 | - if(!$image->rotate(intval($_POST['angle']))) |
|
| 69 | + if (!$image->rotate(intval($_POST['angle']))) |
|
| 70 | 70 | { |
| 71 | 71 | $error = IMG_SAVE_ROTATE_FAILED; |
| 72 | 72 | } |
@@ -74,43 +74,43 @@ discard block |
||
| 74 | 74 | default: |
| 75 | 75 | $error = IMG_SAVE_UNKNOWN_MODE; |
| 76 | 76 | } |
| 77 | - if(empty($error)) |
|
| 77 | + if (empty($error)) |
|
| 78 | 78 | { |
| 79 | 79 | |
| 80 | - $sessionNewPath = $session->getSessionDir() . uniqid(md5(time())) . "." . getFileExt($_POST['path']); |
|
| 81 | - if(!@copy($_POST['path'], $sessionNewPath)) |
|
| 80 | + $sessionNewPath = $session->getSessionDir().uniqid(md5(time())).".".getFileExt($_POST['path']); |
|
| 81 | + if (!@copy($_POST['path'], $sessionNewPath)) |
|
| 82 | 82 | { |
| 83 | 83 | $error = IMG_SAVE_BACKUP_FAILED; |
| 84 | - }else |
|
| 84 | + } else |
|
| 85 | 85 | { |
| 86 | 86 | addSessionHistory($_POST['path'], $sessionNewPath); |
| 87 | - if($image->saveImage($_POST['path'])) |
|
| 87 | + if ($image->saveImage($_POST['path'])) |
|
| 88 | 88 | { |
| 89 | 89 | $imageInfo = $image->getFinalImageInfo(); |
| 90 | - $info .= ",width:" . $imageInfo['width'] . "\n"; |
|
| 91 | - $info .= ",height:" . $imageInfo['height'] . "\n"; |
|
| 92 | - $info .= ",size:'" . transformFileSize($imageInfo['size']) . "'\n"; |
|
| 93 | - }else |
|
| 90 | + $info .= ",width:".$imageInfo['width']."\n"; |
|
| 91 | + $info .= ",height:".$imageInfo['height']."\n"; |
|
| 92 | + $info .= ",size:'".transformFileSize($imageInfo['size'])."'\n"; |
|
| 93 | + } else |
|
| 94 | 94 | { |
| 95 | 95 | $error = IMG_SAVE_FAILED; |
| 96 | 96 | } |
| 97 | 97 | } |
| 98 | - }else |
|
| 98 | + } else |
|
| 99 | 99 | { |
| 100 | 100 | //$image->DestroyImages(); |
| 101 | 101 | } |
| 102 | - }else |
|
| 102 | + } else |
|
| 103 | 103 | { |
| 104 | 104 | $error = IMG_SAVE_UNKNOWN_MODE; |
| 105 | 105 | } |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | - echo "error:'" . $error . "'\n"; |
|
| 109 | - if(isset($image) && is_object($image)) |
|
| 108 | + echo "error:'".$error."'\n"; |
|
| 109 | + if (isset($image) && is_object($image)) |
|
| 110 | 110 | { |
| 111 | 111 | $image->DestroyImages(); |
| 112 | 112 | } |
| 113 | 113 | echo $info; |
| 114 | - echo ",history:" . sizeof($_SESSION[$_POST['path']]) . "\n"; |
|
| 114 | + echo ",history:".sizeof($_SESSION[$_POST['path']])."\n"; |
|
| 115 | 115 | echo "}"; |
| 116 | 116 | ?> |
| 117 | 117 | \ No newline at end of file |
@@ -28,14 +28,13 @@ discard block |
||
| 28 | 28 | if(empty($_POST['path'])) |
| 29 | 29 | { |
| 30 | 30 | $error = IMG_SAVE_EMPTY_PATH; |
| 31 | - }elseif(!file_exists($_POST['path'])) |
|
| 31 | + } elseif(!file_exists($_POST['path'])) |
|
| 32 | 32 | { |
| 33 | 33 | $error = IMG_SAVE_NOT_EXISTS; |
| 34 | - }else if(!isUnderRoot($_POST['path'])) |
|
| 34 | + } else if(!isUnderRoot($_POST['path'])) |
|
| 35 | 35 | { |
| 36 | 36 | $error = IMG_SAVE_PATH_DISALLOWED; |
| 37 | - } |
|
| 38 | - else |
|
| 37 | + } else |
|
| 39 | 38 | { |
| 40 | 39 | if(!empty($_POST['mode'])) |
| 41 | 40 | { |
@@ -81,7 +80,7 @@ discard block |
||
| 81 | 80 | if(!@copy($_POST['path'], $sessionNewPath)) |
| 82 | 81 | { |
| 83 | 82 | $error = IMG_SAVE_BACKUP_FAILED; |
| 84 | - }else |
|
| 83 | + } else |
|
| 85 | 84 | { |
| 86 | 85 | addSessionHistory($_POST['path'], $sessionNewPath); |
| 87 | 86 | if($image->saveImage($_POST['path'])) |
@@ -90,16 +89,16 @@ discard block |
||
| 90 | 89 | $info .= ",width:" . $imageInfo['width'] . "\n"; |
| 91 | 90 | $info .= ",height:" . $imageInfo['height'] . "\n"; |
| 92 | 91 | $info .= ",size:'" . transformFileSize($imageInfo['size']) . "'\n"; |
| 93 | - }else |
|
| 92 | + } else |
|
| 94 | 93 | { |
| 95 | 94 | $error = IMG_SAVE_FAILED; |
| 96 | 95 | } |
| 97 | 96 | } |
| 98 | - }else |
|
| 97 | + } else |
|
| 99 | 98 | { |
| 100 | 99 | //$image->DestroyImages(); |
| 101 | 100 | } |
| 102 | - }else |
|
| 101 | + } else |
|
| 103 | 102 | { |
| 104 | 103 | $error = IMG_SAVE_UNKNOWN_MODE; |
| 105 | 104 | } |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | - require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php"); |
|
| 2 | + require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php"); |
|
| 3 | 3 | |
| 4 | 4 | ?> |
| 5 | 5 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | - require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php"); |
|
| 2 | + require_once(dirname(__FILE__).DIRECTORY_SEPARATOR."inc".DIRECTORY_SEPARATOR."config.php"); |
|
| 3 | 3 | |
| 4 | 4 | ?> |
| 5 | 5 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
@@ -1,8 +1,8 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | - if(!defined('AJAX_INIT_DONE')) |
|
| 3 | - { |
|
| 4 | - die('Permission denied'); |
|
| 5 | - } |
|
| 2 | + if(!defined('AJAX_INIT_DONE')) |
|
| 3 | + { |
|
| 4 | + die('Permission denied'); |
|
| 5 | + } |
|
| 6 | 6 | ?> |
| 7 | 7 | <div id="content"> |
| 8 | 8 | <table class="tableList" id="tableList" cellpadding="0" cellspacing="0" border="0"> |
@@ -17,19 +17,19 @@ discard block |
||
| 17 | 17 | </thead> |
| 18 | 18 | <tbody id="fileList"> |
| 19 | 19 | <?php |
| 20 | - $count = 1; |
|
| 21 | - $css = ""; |
|
| 22 | - //list all documents (files and folders) under this current folder, |
|
| 23 | - //<?php echo appendQueryString(appendQueryString(CONFIG_URL_FILEnIMAGE_MANAGER, "path=" . $file['path']), makeQueryString(array('path'))); |
|
| 24 | - foreach($fileList as $file) |
|
| 25 | - { |
|
| 26 | - $css = ($css == "" || $css == "even"?"odd":"even"); |
|
| 27 | - $strDisabled = ($file['is_writable']?"":" disabled"); |
|
| 28 | - $strClass = ($file['is_writable']?"left":" leftDisabled"); |
|
| 29 | - if($file['type'] == 'file') |
|
| 30 | - { |
|
| 20 | + $count = 1; |
|
| 21 | + $css = ""; |
|
| 22 | + //list all documents (files and folders) under this current folder, |
|
| 23 | + //<?php echo appendQueryString(appendQueryString(CONFIG_URL_FILEnIMAGE_MANAGER, "path=" . $file['path']), makeQueryString(array('path'))); |
|
| 24 | + foreach($fileList as $file) |
|
| 25 | + { |
|
| 26 | + $css = ($css == "" || $css == "even"?"odd":"even"); |
|
| 27 | + $strDisabled = ($file['is_writable']?"":" disabled"); |
|
| 28 | + $strClass = ($file['is_writable']?"left":" leftDisabled"); |
|
| 29 | + if($file['type'] == 'file') |
|
| 30 | + { |
|
| 31 | 31 | |
| 32 | - ?> |
|
| 32 | + ?> |
|
| 33 | 33 | <tr class="<?php echo $css; ?>" id="row<?php echo $count; ?>" > |
| 34 | 34 | <td align="center" id="tdz<?php echo $count; ?>"><span id="flag<?php echo $count; ?>" class="<?php echo $file['flag']; ?>"> </span><input type="checkbox" name="check[]" id="cb<?php echo $count; ?>" value="<?php echo $file['path']; ?>" <?php echo $strDisabled; ?> /> |
| 35 | 35 | </td> |
@@ -39,9 +39,9 @@ discard block |
||
| 39 | 39 | <td class="docInfo" id="tdth<?php echo $count; ?>"><?php echo @date(DATE_TIME_FORMAT,$file['mtime']); ?></td> |
| 40 | 40 | </tr> |
| 41 | 41 | <?php |
| 42 | - }else |
|
| 43 | - { |
|
| 44 | - ?> |
|
| 42 | + }else |
|
| 43 | + { |
|
| 44 | + ?> |
|
| 45 | 45 | <tr class="<?php echo $css; ?>" id="row<?php echo $count; ?>" > |
| 46 | 46 | <td align="center" id="tdz<?php echo $count; ?>"><span id="flag<?php echo $count; ?>" class="<?php echo $file['flag']; ?>"> </span><input type="checkbox" name="check[]" id="cb<?php echo $count; ?>" value="<?php echo $file['path']; ?>" <?php echo $strDisabled; ?>/> |
| 47 | 47 | </td> |
@@ -51,10 +51,10 @@ discard block |
||
| 51 | 51 | <td class="docInfo" id="tdth<?php echo $count; ?>"><?php echo @date(DATE_TIME_FORMAT,$file['mtime']); ?></td> |
| 52 | 52 | </tr> |
| 53 | 53 | <?php |
| 54 | - } |
|
| 55 | - $count++; |
|
| 56 | - } |
|
| 57 | - ?> |
|
| 54 | + } |
|
| 55 | + $count++; |
|
| 56 | + } |
|
| 57 | + ?> |
|
| 58 | 58 | </tbody> |
| 59 | 59 | </table> |
| 60 | 60 | </div> |
| 61 | 61 | \ No newline at end of file |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | - if(!defined('AJAX_INIT_DONE')) |
|
| 2 | + if (!defined('AJAX_INIT_DONE')) |
|
| 3 | 3 | { |
| 4 | 4 | die('Permission denied'); |
| 5 | 5 | } |
@@ -21,12 +21,12 @@ discard block |
||
| 21 | 21 | $css = ""; |
| 22 | 22 | //list all documents (files and folders) under this current folder, |
| 23 | 23 | //<?php echo appendQueryString(appendQueryString(CONFIG_URL_FILEnIMAGE_MANAGER, "path=" . $file['path']), makeQueryString(array('path'))); |
| 24 | - foreach($fileList as $file) |
|
| 24 | + foreach ($fileList as $file) |
|
| 25 | 25 | { |
| 26 | - $css = ($css == "" || $css == "even"?"odd":"even"); |
|
| 27 | - $strDisabled = ($file['is_writable']?"":" disabled"); |
|
| 28 | - $strClass = ($file['is_writable']?"left":" leftDisabled"); |
|
| 29 | - if($file['type'] == 'file') |
|
| 26 | + $css = ($css == "" || $css == "even" ? "odd" : "even"); |
|
| 27 | + $strDisabled = ($file['is_writable'] ? "" : " disabled"); |
|
| 28 | + $strClass = ($file['is_writable'] ? "left" : " leftDisabled"); |
|
| 29 | + if ($file['type'] == 'file') |
|
| 30 | 30 | { |
| 31 | 31 | |
| 32 | 32 | ?> |
@@ -36,19 +36,19 @@ discard block |
||
| 36 | 36 | <td align="center" class="fileColumns" id="tdst<?php echo $count; ?>"> <a id="a<?php echo $count; ?>" href="<?php echo $file['path']; ?>" target="_blank"><span class="<?php echo $file['cssClass']; ?>"> </span></a></td> |
| 37 | 37 | <td class="<?php echo $strClass; ?> docName" id="tdnd<?php echo $count; ?>"><a id="a<?php echo $count; ?>" href="<?php echo $file['path']; ?>"><?php echo $file['name']; ?></a></td> |
| 38 | 38 | <td class="docInfo" id="tdrd<?php echo $count; ?>"><?php echo transformFileSize($file['size']); ?></td> |
| 39 | - <td class="docInfo" id="tdth<?php echo $count; ?>"><?php echo @date(DATE_TIME_FORMAT,$file['mtime']); ?></td> |
|
| 39 | + <td class="docInfo" id="tdth<?php echo $count; ?>"><?php echo @date(DATE_TIME_FORMAT, $file['mtime']); ?></td> |
|
| 40 | 40 | </tr> |
| 41 | 41 | <?php |
| 42 | - }else |
|
| 42 | + } else |
|
| 43 | 43 | { |
| 44 | 44 | ?> |
| 45 | 45 | <tr class="<?php echo $css; ?>" id="row<?php echo $count; ?>" > |
| 46 | 46 | <td align="center" id="tdz<?php echo $count; ?>"><span id="flag<?php echo $count; ?>" class="<?php echo $file['flag']; ?>"> </span><input type="checkbox" name="check[]" id="cb<?php echo $count; ?>" value="<?php echo $file['path']; ?>" <?php echo $strDisabled; ?>/> |
| 47 | 47 | </td> |
| 48 | - <td align="center" class="fileColumns" id="tdst<?php echo $count; ?>"> <a id="a<?php echo $count; ?>" href="<?php echo $file['path']; ?>" <?php echo $file['cssClass'] == 'filePicture'?'rel="ajaxPhotos"':''; ?> ><span class="<?php echo ($file['file']||$file['subdir']?$file['cssClass']:"folderEmpty"); ?>"> </span></a></td> |
|
| 48 | + <td align="center" class="fileColumns" id="tdst<?php echo $count; ?>"> <a id="a<?php echo $count; ?>" href="<?php echo $file['path']; ?>" <?php echo $file['cssClass'] == 'filePicture' ? 'rel="ajaxPhotos"' : ''; ?> ><span class="<?php echo ($file['file'] || $file['subdir'] ? $file['cssClass'] : "folderEmpty"); ?>"> </span></a></td> |
|
| 49 | 49 | <td class="<?php echo $strClass; ?> docName" id="tdnd<?php echo $count; ?>"><?php echo $file['name']; ?></td> |
| 50 | 50 | <td class="docInfo" id="tdrd<?php echo $count; ?>"> </td> |
| 51 | - <td class="docInfo" id="tdth<?php echo $count; ?>"><?php echo @date(DATE_TIME_FORMAT,$file['mtime']); ?></td> |
|
| 51 | + <td class="docInfo" id="tdth<?php echo $count; ?>"><?php echo @date(DATE_TIME_FORMAT, $file['mtime']); ?></td> |
|
| 52 | 52 | </tr> |
| 53 | 53 | <?php |
| 54 | 54 | } |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | <td class="docInfo" id="tdth<?php echo $count; ?>"><?php echo @date(DATE_TIME_FORMAT,$file['mtime']); ?></td> |
| 40 | 40 | </tr> |
| 41 | 41 | <?php |
| 42 | - }else |
|
| 42 | + } else |
|
| 43 | 43 | { |
| 44 | 44 | ?> |
| 45 | 45 | <tr class="<?php echo $css; ?>" id="row<?php echo $count; ?>" > |
@@ -1,16 +1,16 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | - if(!defined('AJAX_INIT_DONE')) |
|
| 3 | - { |
|
| 4 | - die('Permission denied'); |
|
| 5 | - } |
|
| 2 | + if(!defined('AJAX_INIT_DONE')) |
|
| 3 | + { |
|
| 4 | + die('Permission denied'); |
|
| 5 | + } |
|
| 6 | 6 | ?><?php |
| 7 | - /** |
|
| 8 | - * sysem base config setting |
|
| 9 | - * @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn) |
|
| 10 | - * @link www.phpletter.com |
|
| 11 | - * @since 1/August/2007 |
|
| 12 | - * |
|
| 13 | - */ |
|
| 7 | + /** |
|
| 8 | + * sysem base config setting |
|
| 9 | + * @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn) |
|
| 10 | + * @link www.phpletter.com |
|
| 11 | + * @since 1/August/2007 |
|
| 12 | + * |
|
| 13 | + */ |
|
| 14 | 14 | |
| 15 | 15 | |
| 16 | 16 | error_reporting(E_ALL); |
@@ -18,119 +18,117 @@ discard block |
||
| 18 | 18 | |
| 19 | 19 | |
| 20 | 20 | |
| 21 | - //Access Control Setting |
|
| 22 | - /** |
|
| 23 | - * turn off => false |
|
| 24 | - * by session => true |
|
| 25 | - */ |
|
| 26 | - define('CONFIG_ACCESS_CONTROL_MODE', true); |
|
| 27 | - define("CONFIG_LOGIN_USERNAME", 'ajax'); |
|
| 28 | - define('CONFIG_LOGIN_PASSWORD', '123456'); |
|
| 29 | - define('CONFIG_LOGIN_PAGE', 'ajax_login.php'); //the url to the login page |
|
| 21 | + //Access Control Setting |
|
| 22 | + /** |
|
| 23 | + * turn off => false |
|
| 24 | + * by session => true |
|
| 25 | + */ |
|
| 26 | + define('CONFIG_ACCESS_CONTROL_MODE', true); |
|
| 27 | + define("CONFIG_LOGIN_USERNAME", 'ajax'); |
|
| 28 | + define('CONFIG_LOGIN_PASSWORD', '123456'); |
|
| 29 | + define('CONFIG_LOGIN_PAGE', 'ajax_login.php'); //the url to the login page |
|
| 30 | 30 | |
| 31 | - //SYSTEM MODE CONFIG |
|
| 32 | - /** |
|
| 33 | - * turn it on when you have this system for demo purpose |
|
| 34 | - * that means changes made to each image is not physically applied to it |
|
| 35 | - * and all uploaded files/created folders will be removed automatically |
|
| 36 | - */ |
|
| 37 | - define('CONFIG_SYS_DEMO_ENABLE', false); |
|
| 38 | - define('CONFIG_SYS_VIEW_ONLY', false); //diabled the system, view only |
|
| 39 | - define('CONFIG_SYS_THUMBNAIL_VIEW_ENABLE', true);//REMOVE THE thumbnail view if false |
|
| 31 | + //SYSTEM MODE CONFIG |
|
| 32 | + /** |
|
| 33 | + * turn it on when you have this system for demo purpose |
|
| 34 | + * that means changes made to each image is not physically applied to it |
|
| 35 | + * and all uploaded files/created folders will be removed automatically |
|
| 36 | + */ |
|
| 37 | + define('CONFIG_SYS_DEMO_ENABLE', false); |
|
| 38 | + define('CONFIG_SYS_VIEW_ONLY', false); //diabled the system, view only |
|
| 39 | + define('CONFIG_SYS_THUMBNAIL_VIEW_ENABLE', true);//REMOVE THE thumbnail view if false |
|
| 40 | 40 | |
| 41 | - //User Permissions |
|
| 42 | - define('CONFIG_OPTIONS_DELETE', true); |
|
| 43 | - define('CONFIG_OPTIONS_CUT', true); |
|
| 44 | - define('CONFIG_OPTIONS_COPY', true); |
|
| 45 | - define('CONFIG_OPTIONS_NEWFOLDER', true); |
|
| 46 | - define('CONFIG_OPTIONS_RENAME', true); |
|
| 47 | - define('CONFIG_OPTIONS_UPLOAD', true); // |
|
| 48 | - define('CONFIG_OPTIONS_EDITABLE', true); //disable image editor and text editor |
|
| 49 | - //FILESYSTEM CONFIG |
|
| 50 | - /* |
|
| 41 | + //User Permissions |
|
| 42 | + define('CONFIG_OPTIONS_DELETE', true); |
|
| 43 | + define('CONFIG_OPTIONS_CUT', true); |
|
| 44 | + define('CONFIG_OPTIONS_COPY', true); |
|
| 45 | + define('CONFIG_OPTIONS_NEWFOLDER', true); |
|
| 46 | + define('CONFIG_OPTIONS_RENAME', true); |
|
| 47 | + define('CONFIG_OPTIONS_UPLOAD', true); // |
|
| 48 | + define('CONFIG_OPTIONS_EDITABLE', true); //disable image editor and text editor |
|
| 49 | + //FILESYSTEM CONFIG |
|
| 50 | + /* |
|
| 51 | 51 | * CONFIG_SYS_DEFAULT_PATH is the default folder where the files would be uploaded to |
| 52 | 52 | and it must be a folder under the CONFIG_SYS_ROOT_PATH or the same folder |
| 53 | 53 | these two paths accept relative path only, don't use absolute path |
| 54 | 54 | */ |
| 55 | 55 | |
| 56 | - define('CONFIG_SYS_DEFAULT_PATH', '../../../../images/'); //accept relative path only |
|
| 57 | - define('CONFIG_SYS_ROOT_PATH', '../../../../images/'); //accept relative path only |
|
| 58 | - define('CONFIG_SYS_FOLDER_SHOWN_ON_TOP', true); //show your folders on the top of list if true or order by name |
|
| 59 | - define("CONFIG_SYS_DIR_SESSION_PATH", '/tmp'); |
|
| 60 | - define("CONFIG_SYS_PATTERN_FORMAT", 'list'); //three options: reg ,csv, list, this option define the parttern format for the following patterns |
|
| 61 | - /** |
|
| 62 | - * reg => regulare expression |
|
| 63 | - * csv => a list of comma separated file/folder name, (exactly match the specified file/folders) |
|
| 64 | - * list => a list of comma spearated vague file/folder name (partially match the specified file/folders) |
|
| 65 | - * |
|
| 66 | - */ |
|
| 67 | - //more details about regular expression please visit http://nz.php.net/manual/en/function.eregi.php |
|
| 68 | - define('CONFIG_SYS_INC_DIR_PATTERN', ''); //force listing of folders with such pattern(s). separated by , if multiple |
|
| 69 | - define('CONFIG_SYS_EXC_DIR_PATTERN', ''); //will prevent listing of folders with such pattern(s). separated by , if multiple |
|
| 70 | - define('CONFIG_SYS_INC_FILE_PATTERN', ''); //force listing of fiels with such pattern(s). separated by , if multiple |
|
| 71 | - define('CONFIG_SYS_EXC_FILE_PATTERN', ''); //will prevent listing of files with such pattern(s). separated by , if multiple |
|
| 72 | - define('CONFIG_SYS_DELETE_RECURSIVE', 1); //delete all contents within a specific folder if set to be 1 |
|
| 56 | + define('CONFIG_SYS_DEFAULT_PATH', '../../../../images/'); //accept relative path only |
|
| 57 | + define('CONFIG_SYS_ROOT_PATH', '../../../../images/'); //accept relative path only |
|
| 58 | + define('CONFIG_SYS_FOLDER_SHOWN_ON_TOP', true); //show your folders on the top of list if true or order by name |
|
| 59 | + define("CONFIG_SYS_DIR_SESSION_PATH", '/tmp'); |
|
| 60 | + define("CONFIG_SYS_PATTERN_FORMAT", 'list'); //three options: reg ,csv, list, this option define the parttern format for the following patterns |
|
| 61 | + /** |
|
| 62 | + * reg => regulare expression |
|
| 63 | + * csv => a list of comma separated file/folder name, (exactly match the specified file/folders) |
|
| 64 | + * list => a list of comma spearated vague file/folder name (partially match the specified file/folders) |
|
| 65 | + * |
|
| 66 | + */ |
|
| 67 | + //more details about regular expression please visit http://nz.php.net/manual/en/function.eregi.php |
|
| 68 | + define('CONFIG_SYS_INC_DIR_PATTERN', ''); //force listing of folders with such pattern(s). separated by , if multiple |
|
| 69 | + define('CONFIG_SYS_EXC_DIR_PATTERN', ''); //will prevent listing of folders with such pattern(s). separated by , if multiple |
|
| 70 | + define('CONFIG_SYS_INC_FILE_PATTERN', ''); //force listing of fiels with such pattern(s). separated by , if multiple |
|
| 71 | + define('CONFIG_SYS_EXC_FILE_PATTERN', ''); //will prevent listing of files with such pattern(s). separated by , if multiple |
|
| 72 | + define('CONFIG_SYS_DELETE_RECURSIVE', 1); //delete all contents within a specific folder if set to be 1 |
|
| 73 | 73 | |
| 74 | - //UPLOAD OPTIONS CONFIG |
|
| 75 | - define('CONFIG_UPLOAD_MAXSIZE', 50 * 1024 ); //by bytes |
|
| 76 | - //define('CONFIG_UPLOAD_MAXSIZE', 2048); //by bytes |
|
| 77 | - //define('CONFIG_UPLOAD_VALID_EXTS', 'txt');// |
|
| 74 | + //UPLOAD OPTIONS CONFIG |
|
| 75 | + define('CONFIG_UPLOAD_MAXSIZE', 50 * 1024 ); //by bytes |
|
| 76 | + //define('CONFIG_UPLOAD_MAXSIZE', 2048); //by bytes |
|
| 77 | + //define('CONFIG_UPLOAD_VALID_EXTS', 'txt');// |
|
| 78 | 78 | |
| 79 | - define('CONFIG_EDITABLE_VALID_EXTS', 'txt,htm,html,xml,js,css'); //make you include all these extension in CONFIG_UPLOAD_VALID_EXTS if you want all valid |
|
| 79 | + define('CONFIG_EDITABLE_VALID_EXTS', 'txt,htm,html,xml,js,css'); //make you include all these extension in CONFIG_UPLOAD_VALID_EXTS if you want all valid |
|
| 80 | 80 | |
| 81 | - define('CONFIG_OVERWRITTEN', false); //overwirte when processing paste |
|
| 82 | - define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,txt'); // |
|
| 83 | - //define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,bmp,tif,zip,sit,rar,gz,tar,htm,html,mov,mpg,avi,asf,mpeg,wmv,aif,aiff,wav,mp3,swf,ppt,rtf,doc,pdf,xls,txt,xml,xsl,dtd');// |
|
| 84 | - define("CONFIG_VIEWABLE_VALID_EXTS", 'gif,bmp,txt,jpg,png,tif,html,htm,js,css,xml,xsl,dtd,mp3,wav,wmv,wma,rm,rmvb,mov,swf'); |
|
| 85 | - //define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,txt'); // |
|
| 86 | - define('CONFIG_UPLOAD_INVALID_EXTS', ''); |
|
| 81 | + define('CONFIG_OVERWRITTEN', false); //overwirte when processing paste |
|
| 82 | + define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,txt'); // |
|
| 83 | + //define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,bmp,tif,zip,sit,rar,gz,tar,htm,html,mov,mpg,avi,asf,mpeg,wmv,aif,aiff,wav,mp3,swf,ppt,rtf,doc,pdf,xls,txt,xml,xsl,dtd');// |
|
| 84 | + define("CONFIG_VIEWABLE_VALID_EXTS", 'gif,bmp,txt,jpg,png,tif,html,htm,js,css,xml,xsl,dtd,mp3,wav,wmv,wma,rm,rmvb,mov,swf'); |
|
| 85 | + //define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,txt'); // |
|
| 86 | + define('CONFIG_UPLOAD_INVALID_EXTS', ''); |
|
| 87 | 87 | |
| 88 | - //Preview |
|
| 89 | - define('CONFIG_IMG_THUMBNAIL_MAX_X', 100); |
|
| 90 | - define('CONFIG_IMG_THUMBNAIL_MAX_Y', 100); |
|
| 91 | - define('CONFIG_THICKBOX_MAX_WIDTH', 700); |
|
| 92 | - define('CONFIG_THICKBOX_MAX_HEIGHT', 430); |
|
| 88 | + //Preview |
|
| 89 | + define('CONFIG_IMG_THUMBNAIL_MAX_X', 100); |
|
| 90 | + define('CONFIG_IMG_THUMBNAIL_MAX_Y', 100); |
|
| 91 | + define('CONFIG_THICKBOX_MAX_WIDTH', 700); |
|
| 92 | + define('CONFIG_THICKBOX_MAX_HEIGHT', 430); |
|
| 93 | 93 | |
| 94 | 94 | |
| 95 | - /** |
|
| 96 | - * CONFIG_URL_PREVIEW_ROOT was replaced by CONFIG_WEBSITE_DOCUMENT_ROOT since v0.8 |
|
| 97 | - * Normally, you don't need to bother with CONFIG_WEBSITE_DOCUMENT_ROOT |
|
| 98 | - * Howerver, some Web Hosts do not have standard php.ini setting |
|
| 99 | - * which you will find the file manager can not locate your files correctly |
|
| 100 | - * if you do have such issue, please change it to fit your system. |
|
| 101 | - * so what should you to do get it |
|
| 102 | - * 1. create a php script file (let's call it document_root.php) |
|
| 103 | - * 2. add the following codes in in |
|
| 104 | - * <?php |
|
| 105 | - * echo dirname(__FILE__); |
|
| 106 | - * ?> |
|
| 107 | - * 3. upload document_root.php to you website root folder which will only be reached when you visit http://www.domain-name.com or http://localhost/ at localhost computer |
|
| 108 | - * 4. run it via http://www.domain-name.com/document_root.php or http://localhost/docuent_root.php if localhost computer, the url has to be exactly like that |
|
| 109 | - * 5. the value shown on the screen is CONFIG_WEBSITE_DOCUMENT_ROOT should be |
|
| 110 | - * 6. enjoy it |
|
| 111 | - |
|
| 112 | - |
|
| 113 | - * |
|
| 114 | - */ |
|
| 95 | + /** |
|
| 96 | + * CONFIG_URL_PREVIEW_ROOT was replaced by CONFIG_WEBSITE_DOCUMENT_ROOT since v0.8 |
|
| 97 | + * Normally, you don't need to bother with CONFIG_WEBSITE_DOCUMENT_ROOT |
|
| 98 | + * Howerver, some Web Hosts do not have standard php.ini setting |
|
| 99 | + * which you will find the file manager can not locate your files correctly |
|
| 100 | + * if you do have such issue, please change it to fit your system. |
|
| 101 | + * so what should you to do get it |
|
| 102 | + * 1. create a php script file (let's call it document_root.php) |
|
| 103 | + * 2. add the following codes in in |
|
| 104 | + * <?php |
|
| 105 | + * echo dirname(__FILE__); |
|
| 106 | + * ?> |
|
| 107 | + * 3. upload document_root.php to you website root folder which will only be reached when you visit http://www.domain-name.com or http://localhost/ at localhost computer |
|
| 108 | + * 4. run it via http://www.domain-name.com/document_root.php or http://localhost/docuent_root.php if localhost computer, the url has to be exactly like that |
|
| 109 | + * 5. the value shown on the screen is CONFIG_WEBSITE_DOCUMENT_ROOT should be |
|
| 110 | + * 6. enjoy it |
|
| 111 | + * |
|
| 112 | + */ |
|
| 115 | 113 | |
| 116 | 114 | |
| 117 | - define('CONFIG_WEBSITE_DOCUMENT_ROOT', ''); |
|
| 118 | - //theme related setting |
|
| 119 | - /* |
|
| 115 | + define('CONFIG_WEBSITE_DOCUMENT_ROOT', ''); |
|
| 116 | + //theme related setting |
|
| 117 | + /* |
|
| 120 | 118 | * options avaialbe for CONFIG_EDITOR_NAME are: |
| 121 | 119 | stand_alone |
| 122 | 120 | tinymce |
| 123 | 121 | fckeditor |
| 124 | 122 | */ |
| 125 | - //CONFIG_EDITOR_NAME replaced CONFIG_THEME_MODE since @version 0.8 |
|
| 126 | - define('CONFIG_EDITOR_NAME', (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['editor'])?secureFileName($_GET['editor']):'stand_alone')); |
|
| 127 | - define('CONFIG_THEME_NAME', (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['theme'])?secureFileName($_GET['theme']):'default')); //change the theme to your custom theme rather than default |
|
| 128 | - define('CONFIG_DEFAULT_VIEW', (CONFIG_SYS_THUMBNAIL_VIEW_ENABLE?'detail':'detail')); //thumnail or detail |
|
| 129 | - define('CONFIG_DEFAULT_PAGINATION_LIMIT', 10); |
|
| 130 | - define('CONFIG_LOAD_DOC_LATTER', false); //all documents will be loaded up after the template has been loaded to the client |
|
| 123 | + //CONFIG_EDITOR_NAME replaced CONFIG_THEME_MODE since @version 0.8 |
|
| 124 | + define('CONFIG_EDITOR_NAME', (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['editor'])?secureFileName($_GET['editor']):'stand_alone')); |
|
| 125 | + define('CONFIG_THEME_NAME', (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['theme'])?secureFileName($_GET['theme']):'default')); //change the theme to your custom theme rather than default |
|
| 126 | + define('CONFIG_DEFAULT_VIEW', (CONFIG_SYS_THUMBNAIL_VIEW_ENABLE?'detail':'detail')); //thumnail or detail |
|
| 127 | + define('CONFIG_DEFAULT_PAGINATION_LIMIT', 10); |
|
| 128 | + define('CONFIG_LOAD_DOC_LATTER', false); //all documents will be loaded up after the template has been loaded to the client |
|
| 131 | 129 | |
| 132 | - //General Option Declarations |
|
| 133 | - //LANGAUGAE DECLARATIONNS |
|
| 134 | - define('CONFIG_LANG_INDEX', 'language'); //the index in the session |
|
| 135 | - define('CONFIG_LANG_DEFAULT', (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['language']) && file_exists(DIR_LANG . secureFileName($_GET['language'] . '.php'))?secureFileName($_GET['language']):'en')); //change it to be your language file base name, such en |
|
| 130 | + //General Option Declarations |
|
| 131 | + //LANGAUGAE DECLARATIONNS |
|
| 132 | + define('CONFIG_LANG_INDEX', 'language'); //the index in the session |
|
| 133 | + define('CONFIG_LANG_DEFAULT', (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['language']) && file_exists(DIR_LANG . secureFileName($_GET['language'] . '.php'))?secureFileName($_GET['language']):'en')); //change it to be your language file base name, such en |
|
| 136 | 134 | ?> |
| 137 | 135 | \ No newline at end of file |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | - if(!defined('AJAX_INIT_DONE')) |
|
| 2 | + if (!defined('AJAX_INIT_DONE')) |
|
| 3 | 3 | { |
| 4 | 4 | die('Permission denied'); |
| 5 | 5 | } |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | */ |
| 37 | 37 | define('CONFIG_SYS_DEMO_ENABLE', false); |
| 38 | 38 | define('CONFIG_SYS_VIEW_ONLY', false); //diabled the system, view only |
| 39 | - define('CONFIG_SYS_THUMBNAIL_VIEW_ENABLE', true);//REMOVE THE thumbnail view if false |
|
| 39 | + define('CONFIG_SYS_THUMBNAIL_VIEW_ENABLE', true); //REMOVE THE thumbnail view if false |
|
| 40 | 40 | |
| 41 | 41 | //User Permissions |
| 42 | 42 | define('CONFIG_OPTIONS_DELETE', true); |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | */ |
| 55 | 55 | |
| 56 | 56 | define('CONFIG_SYS_DEFAULT_PATH', '../../../../images/'); //accept relative path only |
| 57 | - define('CONFIG_SYS_ROOT_PATH', '../../../../images/'); //accept relative path only |
|
| 57 | + define('CONFIG_SYS_ROOT_PATH', '../../../../images/'); //accept relative path only |
|
| 58 | 58 | define('CONFIG_SYS_FOLDER_SHOWN_ON_TOP', true); //show your folders on the top of list if true or order by name |
| 59 | 59 | define("CONFIG_SYS_DIR_SESSION_PATH", '/tmp'); |
| 60 | 60 | define("CONFIG_SYS_PATTERN_FORMAT", 'list'); //three options: reg ,csv, list, this option define the parttern format for the following patterns |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | define('CONFIG_SYS_DELETE_RECURSIVE', 1); //delete all contents within a specific folder if set to be 1 |
| 73 | 73 | |
| 74 | 74 | //UPLOAD OPTIONS CONFIG |
| 75 | - define('CONFIG_UPLOAD_MAXSIZE', 50 * 1024 ); //by bytes |
|
| 75 | + define('CONFIG_UPLOAD_MAXSIZE', 50*1024); //by bytes |
|
| 76 | 76 | //define('CONFIG_UPLOAD_MAXSIZE', 2048); //by bytes |
| 77 | 77 | //define('CONFIG_UPLOAD_VALID_EXTS', 'txt');// |
| 78 | 78 | |
@@ -123,14 +123,14 @@ discard block |
||
| 123 | 123 | fckeditor |
| 124 | 124 | */ |
| 125 | 125 | //CONFIG_EDITOR_NAME replaced CONFIG_THEME_MODE since @version 0.8 |
| 126 | - define('CONFIG_EDITOR_NAME', (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['editor'])?secureFileName($_GET['editor']):'stand_alone')); |
|
| 127 | - define('CONFIG_THEME_NAME', (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['theme'])?secureFileName($_GET['theme']):'default')); //change the theme to your custom theme rather than default |
|
| 128 | - define('CONFIG_DEFAULT_VIEW', (CONFIG_SYS_THUMBNAIL_VIEW_ENABLE?'detail':'detail')); //thumnail or detail |
|
| 126 | + define('CONFIG_EDITOR_NAME', (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['editor']) ? secureFileName($_GET['editor']) : 'stand_alone')); |
|
| 127 | + define('CONFIG_THEME_NAME', (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['theme']) ? secureFileName($_GET['theme']) : 'default')); //change the theme to your custom theme rather than default |
|
| 128 | + define('CONFIG_DEFAULT_VIEW', (CONFIG_SYS_THUMBNAIL_VIEW_ENABLE ? 'detail' : 'detail')); //thumnail or detail |
|
| 129 | 129 | define('CONFIG_DEFAULT_PAGINATION_LIMIT', 10); |
| 130 | 130 | define('CONFIG_LOAD_DOC_LATTER', false); //all documents will be loaded up after the template has been loaded to the client |
| 131 | 131 | |
| 132 | 132 | //General Option Declarations |
| 133 | 133 | //LANGAUGAE DECLARATIONNS |
| 134 | 134 | define('CONFIG_LANG_INDEX', 'language'); //the index in the session |
| 135 | - define('CONFIG_LANG_DEFAULT', (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['language']) && file_exists(DIR_LANG . secureFileName($_GET['language'] . '.php'))?secureFileName($_GET['language']):'en')); //change it to be your language file base name, such en |
|
| 135 | + define('CONFIG_LANG_DEFAULT', (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['language']) && file_exists(DIR_LANG.secureFileName($_GET['language'].'.php')) ? secureFileName($_GET['language']) : 'en')); //change it to be your language file base name, such en |
|
| 136 | 136 | ?> |
| 137 | 137 | \ No newline at end of file |