paint svg files in svg galleries

skala
Juan Carlos Raña 13 years ago
parent 5c335334af
commit d89771e0f1
  1. 25
      main/inc/lib/svg-edit/extensions/imagelib/groups.php
  2. 15
      main/inc/lib/svg-edit/extensions/imagelib/index.php
  3. 13
      main/inc/lib/svg-edit/extensions/imagelib/users.php

@ -1,6 +1,6 @@
<?php
/* Integrate svg-edit libraries with Chamilo default documents
* @author Juan Carlos Ra<EFBFBD>a Trabado
* @author Juan Carlos Raña Trabado
* @since 25/september/2010
*/
//Chamilo load libraries
@ -67,24 +67,17 @@ if (($group_properties['doc_state'] == 2 && ($is_allowed_to_edit || GroupManager
echo '<ul>';
foreach($png_svg_files as $filename) {
$image = $group_disk_path.$filename;
//$new_sizes = api_resize_image($image, 60, 60); Bug when trying to load svg files
$new_sizes['width'] = 60;
$new_sizes['height'] = 60;
$pos = strpos($filename, "svg");
if ($pos === false) {
//no svg
echo '<li style="display:inline; padding:8px;">';
echo '<a href = "'.$group_web_path.$filename.'" alt="'.$filename.'" title="'.$filename.'">';
echo '<img src = "'.$group_web_path.$filename.'" width = "'.$new_sizes['width'].'" height="'.$new_sizes['height'].'" border="0"></a></li>';
} else {
//svg
if (strpos($filename, "svg")){
$new_sizes['width'] = 60;
$new_sizes['height'] = 60;
}
else {
$new_sizes = api_resize_image($image, 60, 60);
}
echo '<li style="display:inline; padding:8px;">';
echo '<a href = "'.$group_web_path.$filename.'" alt="'.$filename.'" title="'.$filename.'">';
echo '<img src="'.api_get_path(WEB_IMG_PATH).'svg_medium.png" width="'.$new_sizes['width'].'" height="'.$new_sizes['height'].'" border="0">';
echo '</a></li>';
}
echo '<img src = "'.$group_web_path.$filename.'" width = "'.$new_sizes['width'].'" height="'.$new_sizes['height'].'" border="0"></a></li>';
}
echo '</ul>';
}

@ -1,6 +1,6 @@
<?php
/* Integrate svg-edit libraries with Chamilo default documents
* @author Juan Carlos Ra<EFBFBD>a Trabado
* @author Juan Carlos Raña Trabado
* @since 25/september/2010
*/
//Chamilo load libraries
@ -63,15 +63,16 @@ if (!empty($png_svg_files)) {
echo '<ul>';
foreach($png_svg_files as $filename) {
$image=$disk_path.$filename;
//$new_sizes = api_resize_image($image, 60, 60);
$new_sizes['width'] = 60;
$new_sizes['height'] = 60;
if (strpos($filename, "svg")){
echo '<li style="display:inline; padding:8px;"><a href="'.$web_path.$filename.'" alt "'.$filename.'" title="'.$filename.'"><img src="'.api_get_path(WEB_IMG_PATH).'svg_medium.png" width="'.$new_sizes['width'].'" height="'.$new_sizes['height'].'" border="0"></a></li>';
}else{
echo '<li style="display:inline; padding:8px;"><a href="'.$web_path.$filename.'" alt "'.$filename.'" title="'.$filename.'"><img src="'.$web_path.$filename.'" width="'.$new_sizes['width'].'" height="'.$new_sizes['height'].'" border="0"></a></li>';
$new_sizes['width'] = 60;
$new_sizes['height'] = 60;
}
else {
$new_sizes = api_resize_image($image, 60, 60);
}
echo '<li style="display:inline; padding:8px;"><a href="'.$web_path.$filename.'" alt "'.$filename.'" title="'.$filename.'"><img src="'.$web_path.$filename.'" width="'.$new_sizes['width'].'" height="'.$new_sizes['height'].'" border="0"></a></li>';
}
echo '</ul>';
} else {

@ -49,15 +49,16 @@ if (!empty($png_svg_files)) {
echo '<ul>';
foreach($png_svg_files as $filename) {
$image=$user_disk_path.$filename;
//$new_sizes = api_resize_image($image, 60, 60);
$new_sizes['width'] = 60;
$new_sizes['height'] = 60;
if (strpos($filename, "svg")){
echo '<li style="display:inline; padding:8px;"><a href="'.$user_web_path.$filename.'" alt "'.$filename.'" title="'.$filename.'"><img src="'.api_get_path(WEB_IMG_PATH).'svg_medium.png" width="'.$new_sizes['width'].'" height="'.$new_sizes['height'].'" border="0"></a></li>';
} else {
echo '<li style="display:inline; padding:8px;"><a href="'.$user_web_path.$filename.'" alt "'.$filename.'" title="'.$filename.'"><img src="'.$user_web_path.$filename.'" width="'.$new_sizes['width'].'" height="'.$new_sizes['height'].'" border="0"></a></li>';
$new_sizes['width'] = 60;
$new_sizes['height'] = 60;
}
else {
$new_sizes = api_resize_image($image, 60, 60);
}
echo '<li style="display:inline; padding:8px;"><a href="'.$user_web_path.$filename.'" alt "'.$filename.'" title="'.$filename.'"><img src="'.$user_web_path.$filename.'" width="'.$new_sizes['width'].'" height="'.$new_sizes['height'].'" border="0"></a></li>';
}
echo '</ul>';
} else {

Loading…
Cancel
Save