Browse Source

Faature #2712 Previous paint links and some clean

Juan Carlos Raña 14 years ago
parent
commit
874ec9dd0c
3 changed files with 18 additions and 5 deletions
  1. 5 2
      main/document/document.inc.php
  2. 9 1
      main/document/document.php
  3. 4 2
      main/document/edit_document.php

+ 5 - 2
main/document/document.inc.php

@@ -380,7 +380,10 @@ function build_edit_icons($curdirpath, $type, $path, $visibility, $id, $is_templ
             $modify_icons = '<a href="edit_document.php?'.api_get_cidreq().'&curdirpath='.$curdirpath.'&amp;file='.urlencode($path).$req_gid.'&selectcat='.$gradebook_category.'"><img src="../img/edit.gif" border="0" title="'.get_lang('Modify').'" alt="" /></a>';
         }else {
             if($extension=='svg' && api_browser_support('svg') && api_get_setting('enabled_support_svg') == 'true'){
-                $modify_icons = '<a href="edit_drawing.php?'.api_get_cidreq().'&curdirpath='.$curdirpath.'&amp;file='.urlencode($path).$req_gid.'"><img src="../img/edit.gif" border="0" title="'.get_lang('Modify').'" alt="" /></a>';
+                $modify_icons = '<a href="edit_draw.php?'.api_get_cidreq().'&curdirpath='.$curdirpath.'&amp;file='.urlencode($path).$req_gid.'"><img src="../img/edit.gif" border="0" title="'.get_lang('Modify').'" alt="" /></a>';
+			}
+			elseif($extension=='png' || $extension='jpg' || $extension='jpeg' || $extension='bmp' || $extension="pxd" && api_get_setting('enabled_support_pixlr') == 'true'){
+                $modify_icons = '<a href="edit_paint.php?'.api_get_cidreq().'&curdirpath='.$curdirpath.'&amp;file='.urlencode($path).$req_gid.'"><img src="../img/edit.gif" border="0" title="'.get_lang('Modify').'" alt="" /></a>';			
             }else{
                 $modify_icons = '<a href="edit_document.php?'.api_get_cidreq().'&curdirpath='.$curdirpath.'&amp;file='.urlencode($path).$req_gid.'"><img src="../img/edit.gif" border="0" title="'.get_lang('Modify').'" alt="" /></a>';
             }
@@ -684,7 +687,7 @@ function search_keyword($document_name, $keyword) {
 function is_browser_viewable($file_extension) {
     static $allowed_extensions = array(
         'htm', 'html', 'xhtml', 'gif', 'jpg', 'jpeg', 'png', 'pdf', 'swf', 'mp3', 'mp4', 'ogg', 'ogx', 'oga', 'ogv', 'svg',
-        'txt', 'log', 'css', 'js',
+        'txt', 'log',
         'mpg', 'mpeg'
     );
     if (!($result = in_array($file_extension, $allowed_extensions))) { // Assignment + a logical check.

+ 9 - 1
main/document/document.php

@@ -919,7 +919,7 @@ if ($is_allowed_to_edit || $group_member_with_upload_rights || is_my_shared_fold
 
             if (api_browser_support('svg')){
             ?>
-                <a href="create_drawing.php?<?php echo api_get_cidreq(); ?>&dir=<?php echo $curdirpathurl.$req_gid; ?>">
+                <a href="create_draw.php?<?php echo api_get_cidreq(); ?>&dir=<?php echo $curdirpathurl.$req_gid; ?>">
                     <?php Display::display_icon('draw_new.png', get_lang('Draw')); echo get_lang('Draw'); ?></a>&nbsp;
             <?php
             }else{
@@ -927,6 +927,14 @@ if ($is_allowed_to_edit || $group_member_with_upload_rights || is_my_shared_fold
             }
         }
 		
+		// Create new paint
+		if (api_get_setting('enabled_support_pixlr') == 'true'){
+		?>
+			<a href="create_paint.php?<?php echo api_get_cidreq(); ?>&dir=<?php echo $curdirpathurl.$req_gid; ?>">
+		   <?php Display::display_icon('new_paint.png', get_lang('Paint')); echo get_lang('Paint'); ?></a>&nbsp;
+		<?php
+		}
+		
 		// Create new audio
 		if (api_get_setting('enabled_text2audio') == 'true'){
 		?>

+ 4 - 2
main/document/edit_document.php

@@ -598,10 +598,12 @@ function show_return($call_from_tool='', $slide_id=0, $is_certificate_mode=false
 	elseif($call_from_tool=='slideshow'){
 		echo '<a href="'.api_get_path(WEB_PATH).'main/document/slideshow.php?slide_id='.$slide_id.'&curdirpath='.Security::remove_XSS(urlencode($_GET['curdirpath'])).'">'.Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('ViewSlideshow')).get_lang('BackTo').' '.get_lang('ViewSlideshow').'</a>';		
 	}
-	elseif($call_from_tool=='editdrawing'){
+	elseif($call_from_tool=='editdraw'){
 		echo '<a href="document.php?action=exit_slideshow&curdirpath='.$pathurl.'">'.Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('DocumentsOverview')).get_lang('BackTo').' '.get_lang('DocumentsOverview').'</a>';
 		echo '<a href="javascript:history.back(1)">'.Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('Draw')).get_lang('BackTo').' '.get_lang('Draw').'</a>';	
-		
+	elseif($call_from_tool=='editpaint'){
+		echo '<a href="document.php?action=exit_slideshow&curdirpath='.$pathurl.'">'.Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('DocumentsOverview')).get_lang('BackTo').' '.get_lang('DocumentsOverview').'</a>';
+		echo '<a href="javascript:history.back(1)">'.Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('Paint')).get_lang('BackTo').' '.get_lang('Paint').'</a>';		
 	}
 	else{
 		echo '<a href="document.php?action=exit_slideshow&curdirpath='.$pathurl.'">'.Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('DocumentsOverview')).get_lang('BackTo').' '.get_lang('DocumentsOverview').'</a>&nbsp;';