Minor code style fixes

skala
Julio Montoya 14 years ago
parent cf1fc3f778
commit 85b278225e
  1. 103
      main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/_ajax_get_thumbnail_listing.php
  2. 3
      main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/ajaxfilemanager.php
  3. 13
      main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/inc/config.base.php
  4. 11
      main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/inc/config.php

@ -1,7 +1,6 @@
<div id="content">
<?php
$count = 1;
$thumbnailBaseUrl = CONFIG_URL_IMG_THUMBNAIL;
foreach ($fileList as $file) {
@ -10,23 +9,20 @@ foreach ($fileList as $file) {
//Juan Carlos Ra<EFBFBD>a
//hidden files and folders deleted by Chamilo. Hidde folders css, hotpotatoes, chat, certificates
$deleted_by_chamilo_file=' DELETED '; // ' DELETED ' not '_DELETED_' because in $file['name'] _ is replaced with blank see class.manager.php
$deleted_by_chamilo_folder='_DELETED_';
$css_folder_chamilo='css';
$hotpotatoes_folder_chamilo='HotPotatoes_files';
$chat_files_chamilo='chat_files';
$certificates_chamilo='certificates';
$deleted_by_chamilo_file = ' DELETED '; // ' DELETED ' not '_DELETED_' because in $file['name'] _ is replaced with blank see class.manager.php
$deleted_by_chamilo_folder = '_DELETED_';
$css_folder_chamilo = 'css';
$hotpotatoes_folder_chamilo = 'HotPotatoes_files';
$chat_files_chamilo = 'chat_files';
$certificates_chamilo = 'certificates';
//hidden directory of the group if the user is not a member of the group
$group_folder='_groupdocs';
$group_folder = '_groupdocs';
//show group's directory only if I'm member. Or I'm a teacher
$show_doc_group=true;
if(ereg($group_folder, $file['path']))
{
if(ereg($group_folder, $file['path'])) {
$show_doc_group=false;
if($is_user_in_group ||( $to_group_id!=0 && api_is_allowed_to_edit()))
{
if($is_user_in_group ||( $to_group_id!=0 && api_is_allowed_to_edit())) {
$show_doc_group=true;
}
}
@ -41,50 +37,51 @@ foreach ($fileList as $file) {
!ereg($css_folder_chamilo, $file['path']) &&
!ereg($hotpotatoes_folder_chamilo, $file['path']) &&
!ereg($chat_files_chamilo, $file['path']) &&
!ereg($certificates_chamilo, $file['path']) && $show_doc_group && $file['name'][0]!='.') {
!ereg($certificates_chamilo, $file['path']) && $show_doc_group && $file['name'][0]!='.') {
?>
<dl class="thumbnailListing" id="dl<?php echo $count; ?>">
<?php
if(preg_match('/shared_folder/', basename($file['path']))) {
//add icon into ajaxfilemanager if sharedfolder is in Chamilo
?>
<dt id="dt<?php echo $count; ?>" class="<?php echo ($file['type'] == 'folder' || empty($file['file']) || empty($file['subdir'])?'folderShared':$file['cssClass']); ?>" class="<?php echo $file['cssClass']; ?>">
<?php
} elseif(preg_match('/sf_user_/', basename($file['path']))) {
?>
<dt id="dt<?php echo $count; ?>" class="<?php echo ($file['type'] == 'folder' || empty($file['file']) || empty($file['subdir'])?'unknownUser':$file['cssClass']); ?>" class="<?php echo $file['cssClass']; ?>">
<?php
} else {
?>
<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']; ?>">
<?php
}
switch($file['cssClass']) {
case 'filePicture':
echo '<a id="thumbUrl' . $count . '" rel="thumbPhotos" href="' . $file['public_path'] . '">';
echo '<img src="' . appendQueryString($thumbnailBaseUrl, 'path=' . base64_encode($file['path'])) . '" id="thumbImg' . $count . '"></a>' . "\n";
<?php
if(preg_match('/shared_folder/', basename($file['path']))) {
//add icon into ajaxfilemanager if sharedfolder is in Chamilo
?>
<dt id="dt<?php echo $count; ?>" class="<?php echo ($file['type'] == 'folder' || empty($file['file']) || empty($file['subdir'])?'folderShared':$file['cssClass']); ?>" class="<?php echo $file['cssClass']; ?>">
<?php
} elseif(preg_match('/sf_user_/', basename($file['path']))) {
?>
<dt id="dt<?php echo $count; ?>" class="<?php echo ($file['type'] == 'folder' || empty($file['file']) || empty($file['subdir'])?'unknownUser':$file['cssClass']); ?>" class="<?php echo $file['cssClass']; ?>">
<?php
} else {
?>
<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']; ?>">
<?php
}
switch($file['cssClass']) {
case 'filePicture':
echo '<a id="thumbUrl' . $count . '" rel="thumbPhotos" href="' . $file['public_path'] . '">';
echo '<img src="' . appendQueryString($thumbnailBaseUrl, ' path=' . base64_encode($file['path'])) . '" id="thumbImg' . $count . '"></a>' . "\n";
break;
case 'fileFlash':
case 'fileVideo':
case 'fileMusic':
break;
case 'fileFlash':
case 'fileVideo':
case 'fileMusic':
break;
default:
echo '&nbsp;';
}
if(Security::remove_XSS($_GET['editor'])!='stand_alone'){
$path_chamilo_file='../'.$file['path'];// fix for makes a good show when pressed next on window preview, don't only one image
}
else{
$path_chamilo_file=$file['path'];
}
?>
default:
echo '&nbsp;';
}
if ($_GET['editor'] != 'stand_alone') {
$path_chamilo_file ='../'.$file['path'];// fix for makes a good show when pressed next on window preview, don't only one image
} else{
$path_chamilo_file = $file['path'];
}
?>
</dt>
<dd id="dd<?php echo $count; ?>" class="thumbnailListing_info"><span id="flag<?php echo $count; ?>" class="<?php echo $file['flag']; ?>">&nbsp;</span><input id="cb<?php echo $count; ?>" type="checkbox" name="check[]" <?php echo ($file['is_writable']?'':'disabled'); ?> class="radio" value="<?php echo $file['path']; ?>" />
<a <?php echo ($file['cssClass']== 'filePicture'?'rel="orgImg"':''); ?> href="<?php echo $path_chamilo_file;// fix for Chamilo ?>" title="<?php echo $file['name']; ?>" id="a<?php echo $count; ?>"><?php echo shortenFileName($file['name']); ?></a></dd>
</dl>
<?php
<dd id="dd<?php echo $count; ?>" class="thumbnailListing_info">
<span id="flag<?php echo $count; ?>" class="<?php echo $file['flag']; ?>">&nbsp;</span>
<input id="cb<?php echo $count; ?>" type="checkbox" name="check[]" <?php echo ($file['is_writable']?'':'disabled'); ?> class="radio" value="<?php echo $file['path']; ?>" />
<a <?php echo ($file['cssClass']== 'filePicture'?'rel="orgImg"':''); ?> href="<?php echo $path_chamilo_file;// fix for Chamilo ?>" title="<?php echo $file['name']; ?>" id="a<?php echo $count; ?>"><?php echo shortenFileName($file['name']); ?></a>
</dd>
</dl>
<?php
}//end if hidden files and folders deleted by Chamilo
$count++;
}

@ -15,6 +15,7 @@ api_block_anonymous_users();// from Chamilo
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php";
//$session->gc(); // Disabled for integration with Chamilo
require_once CLASS_SESSION_ACTION;
$sessionAction = new SessionAction();
@ -89,7 +90,7 @@ if(!empty($_GET['view'])) {
<!-- Chamilo hack for breadcrumb into shared folders -->
var shared_folder = '<?php echo get_lang('UserFolders');?>';
<?php
<?php
$course_session = explode('_', basename($currentPath));
$course_session = strtolower($course_session[sizeof($course_session) - 1]);
?>

@ -76,7 +76,7 @@ these two paths accept relative path only, don't use absolute path
//define('CONFIG_SYS_DEFAULT_PATH', '../uploaded/'); //accept relative path only
//define('CONFIG_SYS_ROOT_PATH', '../uploaded/'); //accept relative path only
/////////////// Integration for Chamilo
// Integration for Chamilo
if(!empty($_course['path'])) {
if(!empty($group_properties['directory'])) {
@ -99,16 +99,15 @@ if(!empty($_course['path'])) {
$PathChamiloAjaxFileManager='../../../../../../../home/default_platform_document/';
} else {
//my profile
$my_path = UserManager::get_user_picture_path_by_id(api_get_user_id(),'none');
$PathChamiloAjaxFileManager='../../../../../../../main/'.$my_path['dir'].'my_files/';
$my_path = UserManager::get_user_picture_path_by_id(api_get_user_id(),'none');
$PathChamiloAjaxFileManager = '../../../../../../../main/'.$my_path['dir'].'my_files/';
}
}
define('CONFIG_SYS_DEFAULT_PATH', $PathChamiloAjaxFileManager);
define('CONFIG_SYS_ROOT_PATH', $PathChamiloAjaxFileManager);
define('CONFIG_SYS_DEFAULT_PATH', $PathChamiloAjaxFileManager);
define('CONFIG_SYS_ROOT_PATH', $PathChamiloAjaxFileManager);
////////////// end chamilo
// end chamilo

@ -17,9 +17,10 @@
require_once '../../../../../../inc/global.inc.php';
// Loading document repositories settings.
require_once api_get_path(LIBRARY_PATH).'fckeditor/repository.php' ;
//FILESYSTEM CONFIG <br>
//FILESYSTEM CONFIG
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "class.auth.php");
define('CONFIG_QUERY_STRING_ENABLE', true); //Enable passed query string to setting the system configuration
@ -66,7 +67,9 @@ if(CONFIG_QUERY_STRING_ENABLE && !empty($_GET['config']) && file_exists(dirname(
{
$configBaseFileName = 'config.' . secureFileName($_GET['config']) . ".php";
}
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . $configBaseFileName);
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . $configBaseFileName;
// Loading the selected language file.
require_once(DIR_AJAX_LANGS . CONFIG_LANG_DEFAULT . ".php");
@ -77,9 +80,9 @@ if (CONFIG_LANG_DEFAULT != "en")
require_once(DIR_AJAX_LANGS . "en.php");
}
require_once(DIR_AJAX_INC . "function.base.php");
require_once DIR_AJAX_INC . "function.base.php";
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "class.session.php");
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . "class.session.php";
$auth = new Auth();

Loading…
Cancel
Save