diff --git a/htdocs/editors/CKeditor/ceditfinder/_auth.php b/htdocs/editors/CKeditor/ceditfinder/_auth.php new file mode 100755 index 000000000000..2e5d3506bf7c --- /dev/null +++ b/htdocs/editors/CKeditor/ceditfinder/_auth.php @@ -0,0 +1,25 @@ +disableLogger(); + +$groups = is_object(icms::$user) ? icms::$user->getGroups() : ICMS_GROUP_ANONYMOUS; +$gperm = icms::handler('icms_member_groupperm'); + +$agroups = $gperm->getItemIds('use_wysiwygeditor', $groups); + +if (count($agroups) == 0) {die(_NOPERM);} \ No newline at end of file diff --git a/htdocs/editors/CKeditor/ceditfinder/_browse.php b/htdocs/editors/CKeditor/ceditfinder/_browse.php new file mode 100755 index 000000000000..b7e874d9bd96 --- /dev/null +++ b/htdocs/editors/CKeditor/ceditfinder/_browse.php @@ -0,0 +1,367 @@ +' . $folder . ' -> ' . $file . ''; + $thumb = $folder . $file; + if ( $folder == '' ) $thumb = '/' . $thumb; + $thumbfilepath = $cfconfig['fileroot'] . $cfconfig['imagecache'] . $thumb; + $origfile = $cfconfig['fileroot'] . $cfconfig['imagefolder'] . $folder . $file; + if ( file_exists( $thumbfilepath ) ) { + // Thumbnail exists... check it's creation date is newer than the + // original file (otherwise it may be out of date) + if ( filemtime( $origfile ) < filemtime( $thumbfilepath ) ) { + // Thumbnail is up-to-date + return $cfconfig['imagecache'] . $thumb; + } + } + + // Check thumbs folder exists + if ( !file_exists( dirname($thumbfilepath) ) ) { + // Create thumbs folder + if (!mkdir( dirname($thumbfilepath), 0775, true )) { + echo '
' . dirname($thumbfilepath) . ''; + return false; + } + } + + // Load image and resize to thumbnail size + $image = new simpleimage(); + $image->load( $origfile ); + if ( $image->isImage() === FALSE ) return FALSE; // This is not an image! + if ( $image->getWidth() <= $cfconfig['thumbwidth'] && $image->getHeight() <= $cfconfig['thumbheight'] ) { + // Doesn't need resizing, so return link to original file + return $cfconfig['imagefolder'] . $folder . $file; + } + $image->resize( $cfconfig['thumbwidth'], $cfconfig['thumbheight'], true ); + $image->save( $thumbfilepath ); + return $cfconfig['imagecache'] . $thumb; +} + +function showSubfolders( $folder ) { +} + +function showParentFolder( $folders ) { + global $browseURL; + if ( count($folders) > 0 ) { + // Show folder to move up a level + $parentfolder = ''; + //echo '
'; print_r( $folders ); echo ''; + for ( $i=1; $i < ( count($folders) - 1 ) ; $i++ ) { + $parentfolder .= '/' . $folders[$i]; + } + if ( $parentfolder == '' ) $parentfolder = '/'; + echo '
Parent folder
'; + } +} +function showFolder( $folder ) { + // Displays the pictures within the given folder + global $cfconfig, $browseURL; + + if ( $folder == '/' ) $folder = ''; + if ( $folder != '' ) { + $folders = explode( '/', $folder ); + echo '' . $imagefolder . $folder . ''; + $filelist = dirList($cfconfig['fileroot'] . $cfconfig['imagefolder'] . $folder); + if ( count( $filelist ) < 1 ) { + echo '
No images found.
'; + showCreateFolderForm( $folder ); + showUploadImageForm( $folder ); + } else { + //echo ''; print_r( $filelist ); echo ''; + $pichtml = ''; + $subfolders = array(); + foreach ( $filelist as $file ) { + if (is_dir($cfconfig['fileroot'] . $cfconfig['imagefolder'] . $folder . $file)) { + $subfolders[] = $file; + } else { + $thumb = getThumb( $folder, $file ); + // echo '
' . $thumb . ''; + if ( $thumb !== FALSE ) { + // Create image view + $imagediv = '
'; + echo $subfolder . '
'; + echo 'Image not found.
'; + return; + } + $image = new simpleimage(); + $image->load($cfconfig['fileroot'] . $folder . $filename); + if ( $folder != '' ) { + $folders = explode( '/', $folder ); + echo '