skala
Julio Montoya 13 years ago
commit e21544f021
  1. 4
      main/document/create_paint.php
  2. 3
      main/document/edit_paint.php
  3. 6
      main/exercice/exercice.php
  4. 18
      main/inc/lib/fileManage.lib.php
  5. 3
      main/newscorm/learnpathItem.class.php

@ -143,5 +143,7 @@ $target_path=api_get_path(WEB_CODE_PATH).'document/save_pixlr.php';
$target=$target_path;
$locktarget="true";
$locktitle="false";
echo '<iframe style=\'height: 600px; width: 100%;\' scrolling=\'no\' frameborder=\'0\' src=\'http://pixlr.com/editor/?title='.$title.'&amp;image='.$image.'&amp;loc='.$loc.'&amp;referrer='.$referrer.'&amp;target='.$target.'&amp;exit='.$exit_path.'&amp;locktarget='.$locktarget.'&amp;locktitle='.$locktitle.'\'>';
$credentials="true";
echo '<iframe style=\'height: 600px; width: 100%;\' scrolling=\'no\' frameborder=\'0\' src=\'http://pixlr.com/editor/?title='.$title.'&amp;image='.$image.'&amp;loc='.$loc.'&amp;referrer='.$referrer.'&amp;target='.$target.'&amp;exit='.$exit_path.'&amp;locktarget='.$locktarget.'&amp;locktitle='.$locktitle.'&amp;credentials='.$credentials.'\'>';
echo '</iframe>';

@ -151,6 +151,7 @@ $target=$target_path;
$locktarget="true";
$locktitle="false";
$credentials="true";
//make temp images
$temp_folder=api_get_path(SYS_ARCHIVE_PATH).'temp/images';
@ -194,7 +195,7 @@ $_SESSION['temp_realpath_image']=$to;
//load image to url
$to_url=api_get_path(WEB_ARCHIVE_PATH).'temp/images/'.$file_crip;
$image=urlencode($to_url);
$pixlr_url = 'http://pixlr.com/editor/?title='.$title.'&amp;image='.$image.'&amp;loc='.$loc.'&amp;referrer='.$referrer.'&amp;target='.$target.'&amp;exit='.$exit_path.'&amp;locktarget='.$locktarget.'&amp;locktitle='.$locktitle;
$pixlr_url = 'http://pixlr.com/editor/?title='.$title.'&amp;image='.$image.'&amp;loc='.$loc.'&amp;referrer='.$referrer.'&amp;target='.$target.'&amp;exit='.$exit_path.'&amp;locktarget='.$locktarget.'&amp;locktitle='.$locktitle.'&amp;credentials='.$credentials;
//make frame an send image
echo '<iframe style="height: 600px; width: 100%;" scrolling="no" frameborder="0" src="'.$pixlr_url.'">';

@ -287,8 +287,10 @@ if ($is_allowedToEdit) {
if (my_delete($documentPath . $file)) {
update_db_info("delete", $file);
}
my_delete($documentPath . $uploadPath . "/" . $fld . "/");
break;
// hotpotatoes folder may contains several tests so don't delete folder if not empty : http://support.chamilo.org/issues/2165
if (!(strstr($uploadPath, DIR_HOTPOTATOES) && !folder_is_empty($documentPath . $uploadPath . "/" . $fld . "/"))) {
my_delete($documentPath . $uploadPath . "/" . $fld . "/");
} break;
case 'enable' : // enables an exercise
$newVisibilityStatus = "1"; //"visible"
$query = "SELECT id FROM $TBL_DOCUMENT WHERE c_id = $course_id AND path='" . Database :: escape_string($file) . "'";

@ -157,6 +157,24 @@ function removeDir($dir) {
return true;
}
/**
* Return true if folder is empty
* @author : hubert.borderiou@grenet.fr
* @param string $in_folder : folder path on disk
* @return 1 if folder is empty, 0 otherwise
*/
function folder_is_empty($in_folder) {
$tab_folder_content = scandir($in_folder);
$folder_is_empty = 0;
if ((count($tab_folder_content) == 2 && in_array(".", $tab_folder_content) && in_array("..", $tab_folder_content)) || (count($tab_folder_content) < 2)) {
$folder_is_empty = 1;
}
return $folder_is_empty;
}
/**
* Renames a file or a directory
*

@ -71,8 +71,9 @@ class learnpathItem {
* @param integer User ID
* @return boolean True on success, false on failure
*/
public function __construct($id, $user_id, $course_id = null) {
public function __construct($id, $user_id = null, $course_id = null) {
// Get items table.
if (!isset($user_id)) { $user_id = api_get_user_id(); }
if (self::debug > 0) { error_log('New LP - In learnpathItem constructor: '.$id.','.$user_id, 0); }
if (empty($course_id)) {

Loading…
Cancel
Save