Minor - format code.

1.9.x
Julio Montoya 11 years ago
parent c352fba06a
commit 65a0a9dd0b
  1. 11
      main/document/create_audio.php
  2. 42
      main/document/create_document.php
  3. 42
      main/document/create_draw.php
  4. 22
      main/document/create_paint.php
  5. 10
      main/document/document_quota.php
  6. 23
      main/document/edit_draw.php
  7. 4
      main/document/edit_odf.php
  8. 27
      main/document/edit_paint.php
  9. 10
      main/document/exit_pixlr.php
  10. 4
      main/document/footerpage.php
  11. 3
      main/document/headerpage.php
  12. 39
      main/document/record_audio.php
  13. 5
      main/document/record_audio_wami.php
  14. 4
      main/document/show_content.php
  15. 5
      main/document/showinframes.php
  16. 49
      main/document/webcam_clip.php

@ -125,13 +125,9 @@ if (isset ($group)) {
Display :: display_header($nameTools, 'Doc');
echo '<div class="actions">';
echo '<a href="document.php?id='.$document_id.'">'.Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('DocumentsOverview'),'',ICON_SIZE_MEDIUM).'</a>';
echo '<a href="create_audio.php?'.api_get_cidreq().'&amp;id='.$document_id.'&amp;dt2a=google">'.Display::return_icon('google.png',get_lang('GoogleAudio'),'',ICON_SIZE_MEDIUM).'</a>';
echo '<a href="create_audio.php?'.api_get_cidreq().'&amp;id='.$document_id.'&amp;dt2a=pediaphon">'.Display::return_icon('pediaphon.png', get_lang('Pediaphon'),'',ICON_SIZE_MEDIUM).'</a>';
echo '<a href="document.php?id='.$document_id.'">'.Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('DocumentsOverview'),'',ICON_SIZE_MEDIUM).'</a>';
echo '<a href="create_audio.php?'.api_get_cidreq().'&amp;id='.$document_id.'&amp;dt2a=google">'.Display::return_icon('google.png',get_lang('GoogleAudio'),'',ICON_SIZE_MEDIUM).'</a>';
echo '<a href="create_audio.php?'.api_get_cidreq().'&amp;id='.$document_id.'&amp;dt2a=pediaphon">'.Display::return_icon('pediaphon.png', get_lang('Pediaphon'),'',ICON_SIZE_MEDIUM).'</a>';
echo '</div>';
?>
@ -281,7 +277,6 @@ $(document).ready(function(){
<!--French -->
voices[3]=["<?php echo get_lang('Female').' (fr8 HQ)'; ?>|fr8"]
function update_voices(selectedvoicegroup){
voiceslist.options.length=0
for (i=0; i<voices[selectedvoicegroup].length; i++)

@ -5,10 +5,6 @@
*
* @package chamilo.document
*/
/**
* Code
*/
/* INIT SECTION */
// Name of the language file that needs to be included
$language_file = array('document', 'gradebook');
@ -162,6 +158,7 @@ if ($is_certificate_mode) {
$doc_table = Database::get_course_table(TABLE_DOCUMENT);
$course_id = api_get_course_int_id();
$userId = api_get_user_id();
$document_data = DocumentManager::get_document_data_by_id($_REQUEST['id'], api_get_course_id(), true);
if (empty($document_data)) {
@ -169,9 +166,8 @@ if (empty($document_data)) {
$group_properties = GroupManager::get_group_properties(api_get_group_id());
$document_id = DocumentManager::get_document_id(api_get_course_info(), $group_properties['directory']);
$document_data = DocumentManager::get_document_data_by_id($document_id, api_get_course_id());
$dir = $document_data['path'];
$folder_id = $document_data['id'];
$dir = $document_data['path'];
$folder_id = $document_data['id'];
} else {
$dir = '/';
$folder_id = 0;
@ -225,7 +221,9 @@ for ($i = 0; $i < ($count_dir); $i++) {
$relative_url .= '../';
}
// We do this in order to avoid the condition in html_editor.php ==> if ($this -> fck_editor->Config['CreateDocumentWebDir']=='' || $this -> fck_editor->Config['CreateDocumentDir']== '')
/* We do this in order to avoid the condition in html_editor.php ==> if
($this -> fck_editor->Config['CreateDocumentWebDir']=='' || $this -> fck_editor->Config['CreateDocumentDir']== '')*
*/
if ($relative_url== '') {
$relative_url = '/';
}
@ -283,7 +281,7 @@ if (!$is_allowed_in_course) {
if (!($is_allowed_to_edit ||
$_SESSION['group_member_with_upload_rights'] ||
is_my_shared_folder($_user['user_id'], $dir, api_get_session_id()))
is_my_shared_folder($userId, $dir, api_get_session_id()))
) {
api_not_allowed(true);
}
@ -364,7 +362,7 @@ $folders = DocumentManager::get_all_document_folders($_course, $to_group_id, $is
// If we are not in the certificates creation, display a folder chooser for the
// new document created
if (!$is_certificate_mode && !is_my_shared_folder($_user['user_id'], $dir, $current_session_id)) {
if (!$is_certificate_mode && !is_my_shared_folder($userId, $dir, $current_session_id)) {
$folders = DocumentManager::get_all_document_folders($_course, $to_group_id, $is_allowed_to_edit);
$parent_select = $form->addElement('select', 'curdirpath', array(null, get_lang('DestinationDirectory')));
@ -472,10 +470,6 @@ if ($form->validate()) {
$readonly = isset($values['readonly']) ? 1 : 0;
$values['title'] = trim($values['title']);
/*if (!empty($values['curdirpath'])) {
$dir = $values['curdirpath'];
}*/
if ($dir[strlen($dir) - 1] != '/') {
$dir .= '/';
}
@ -511,19 +505,20 @@ if ($form->validate()) {
fputs($fp, $content);
fclose($fp);
chmod($filepath.$filename.'.'.$extension, api_get_permissions_for_new_files());
if (!is_dir($filepath.'css')) {
mkdir($filepath.'css', api_get_permissions_for_new_directories());
$doc_id = add_document($_course, $dir.'css', 'folder', 0, 'css');
api_item_property_update($_course, TOOL_DOCUMENT, $doc_id, 'FolderCreated', $_user['user_id'], null, null, null, null, $current_session_id);
api_item_property_update($_course, TOOL_DOCUMENT, $doc_id, 'invisible', $_user['user_id'], null, null, null, null, $current_session_id);
api_item_property_update($_course, TOOL_DOCUMENT, $doc_id, 'FolderCreated', $userId, null, null, null, null, $current_session_id);
api_item_property_update($_course, TOOL_DOCUMENT, $doc_id, 'invisible', $userId, null, null, null, null, $current_session_id);
}
if (!is_file($filepath.'css/frames.css')) {
// Make a copy of the current css for the new document
copy(api_get_path(SYS_CODE_PATH).'css/'.api_get_setting('stylesheets').'/frames.css', $filepath.'css/frames.css');
$doc_id = add_document($_course, $dir.'css/frames.css', 'file', filesize($filepath.'css/frames.css'), 'frames.css');
api_item_property_update($_course, TOOL_DOCUMENT, $doc_id, 'DocumentAdded', $_user['user_id'], null, null, null, null, $current_session_id);
api_item_property_update($_course, TOOL_DOCUMENT, $doc_id, 'invisible', $_user['user_id'], null, null, null, null, $current_session_id);
api_item_property_update($_course, TOOL_DOCUMENT, $doc_id, 'DocumentAdded', $userId, null, null, null, null, $current_session_id);
api_item_property_update($_course, TOOL_DOCUMENT, $doc_id, 'invisible', $userId, null, null, null, null, $current_session_id);
}
$file_size = filesize($filepath.$filename.'.'.$extension);
@ -537,7 +532,7 @@ if ($form->validate()) {
TOOL_DOCUMENT,
$document_id,
'DocumentAdded',
$_user['user_id'],
$userId,
$to_group_id,
null,
null,
@ -545,7 +540,7 @@ if ($form->validate()) {
$current_session_id
);
// Update parent folders
item_property_update_on_folder($_course, $dir, $_user['user_id']);
item_property_update_on_folder($_course, $dir, $userId);
$new_comment = isset($_POST['comment']) ? trim($_POST['comment']) : '';
$new_comment = Database::escape_string($new_comment);
$new_title = isset($_POST['title']) ? trim($_POST['title']) : '';
@ -600,15 +595,16 @@ if ($form->validate()) {
}
Display :: display_header($nameTools, "Doc");
//api_display_tool_title($nameTools);
// actions
echo '<div class="actions">';
// link back to the documents overview
if ($is_certificate_mode)
echo '<a href="document.php?certificate=true&id='.$folder_id.'&selectcat=' . Security::remove_XSS($_GET['selectcat']).'">'.Display::return_icon('back.png',get_lang('Back').' '.get_lang('To').' '.get_lang('CertificateOverview'),'',ICON_SIZE_MEDIUM).'</a>';
echo '<a href="document.php?certificate=true&id='.$folder_id.'&selectcat=' . Security::remove_XSS($_GET['selectcat']).'">'.
Display::return_icon('back.png',get_lang('Back').' '.get_lang('To').' '.get_lang('CertificateOverview'),'',ICON_SIZE_MEDIUM).'</a>';
else
echo '<a href="document.php?curdirpath='.Security::remove_XSS($dir).'">'.Display::return_icon('back.png',get_lang('Back').' '.get_lang('To').' '.get_lang('DocumentsOverview'),'',ICON_SIZE_MEDIUM).'</a>';
echo '<a href="document.php?curdirpath='.Security::remove_XSS($dir).'">'.
Display::return_icon('back.png',get_lang('Back').' '.get_lang('To').' '.get_lang('DocumentsOverview'),'',ICON_SIZE_MEDIUM).'</a>';
echo '</div>';
if ($is_certificate_mode) {

@ -9,11 +9,6 @@
* @author Juan Carlos Raña Trabado
* @since 25/september/2010
*/
/**
* Code
*/
/* INIT SECTION */
// Name of the language file that needs to be included
$language_file = array('document');
@ -114,33 +109,22 @@ if (isset ($group)) {
}
// Interbreadcrumb for the current directory root path
// Copied from document.php
$dir_array = explode('/', $dir);
$array_len = count($dir_array);
/*
TODO:check and delete this code
if (!$is_certificate_mode) {
if ($array_len > 1) {
if (empty($_SESSION['_gid'])) {
$url_dir = 'document.php?&curdirpath=/';
$interbreadcrumb[] = array('url' => $url_dir, 'name' => get_lang('HomeDirectory'));
}
}
}
*/
// Interbreadcrumb for the current directory root path
if (empty($document_data['parents'])) {
$interbreadcrumb[] = array('url' => '#', 'name' => $document_data['title']);
} else {
foreach($document_data['parents'] as $document_sub_data) {
$interbreadcrumb[] = array('url' => $document_sub_data['document_url'], 'name' => $document_sub_data['title']);
}
}
// Copied from document.php
$dir_array = explode('/', $dir);
$array_len = count($dir_array);
// Interbreadcrumb for the current directory root path
if (empty($document_data['parents'])) {
$interbreadcrumb[] = array('url' => '#', 'name' => $document_data['title']);
} else {
foreach($document_data['parents'] as $document_sub_data) {
$interbreadcrumb[] = array('url' => $document_sub_data['document_url'], 'name' => $document_sub_data['title']);
}
}
Display :: display_header($nameTools, 'Doc');
echo '<div class="actions">';
echo '<a href="document.php?id='.$document_id.'">'.Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('DocumentsOverview'),'',ICON_SIZE_MEDIUM).'</a>';
echo '<a href="document.php?id='.$document_id.'">'.Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('DocumentsOverview'),'',ICON_SIZE_MEDIUM).'</a>';
echo '</div>';
if (api_browser_support('svg')) {

@ -9,9 +9,6 @@
* @since 30/January/2011
* @todo clean all file
*/
/**
* Code
*/
/* INIT SECTION */
$language_file = array('document');
@ -33,7 +30,7 @@ if (api_get_setting('enabled_support_paint') == 'false') {
$document_data = DocumentManager::get_document_data_by_id($_GET['id'], api_get_course_id(), true);
if (empty($document_data)) {
if (api_is_in_group()) {
$group_properties = GroupManager::get_group_properties(api_get_group_id());
$group_properties = GroupManager::get_group_properties(api_get_group_id());
$document_id = DocumentManager::get_document_id(api_get_course_info(), $group_properties['directory']);
$document_data = DocumentManager::get_document_data_by_id($document_id, api_get_course_id());
}
@ -100,7 +97,6 @@ if (!($is_allowed_to_edit || $_SESSION['group_member_with_upload_rights'] || is_
api_not_allowed(true);
}
/* Header */
event_access_tool(TOOL_DOCUMENT);
$display_dir = $dir;
@ -122,14 +118,15 @@ if (empty($document_data['parents'])) {
Display :: display_header($nameTools, 'Doc');
echo '<div class="actions">';
echo '<a href="document.php?id='.$document_id.'">'.Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('DocumentsOverview'),'',ICON_SIZE_MEDIUM).'</a>';
echo '<a href="document.php?id='.$document_id.'">'.
Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('DocumentsOverview'),'',ICON_SIZE_MEDIUM).'</a>';
echo '</div>';
///pixlr
// max size 1 Mb ??
$title=urlencode(utf8_encode(get_lang('NewImage')));//TODO:check
$title = urlencode(utf8_encode(get_lang('NewImage')));//TODO:check
//
$image=api_get_path(WEB_IMG_PATH).'canvas1024x768.png';
$image = api_get_path(WEB_IMG_PATH) . 'canvas1024x768.png';
//
$pixlr_code_translation_table = array('' => 'en', 'pt' => 'pt-Pt', 'sr' => 'sr_latn');
$langpixlr = api_get_language_isocode();
@ -157,16 +154,11 @@ if ($_SERVER['HTTP_HOST']=="localhost") {
@file_put_contents($path_and_file, $crossdomain);
}
$credentials="true";
}
else {
} else {
$credentials="false";
}
$pixlr_url = api_get_protocol().'://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;
?>
<script type="text/javascript">
document.write ('<iframe id="frame" frameborder="0" scrolling="no" src="<?php echo $pixlr_url; ?>" width="100%" height="100%"><noframes><p>Sorry, your browser does not handle frames</p></noframes></iframe></div>');
@ -189,4 +181,4 @@ echo '<noscript>';
echo '<iframe style="height: 600px; width: 100%;" scrolling="no" frameborder="0" src="'.$pixlr_url.'"><noframes><p>Sorry, your browser does not handle frames</p></noframes></iframe>';
echo '</noscript>';
Display::display_footer();
Display::display_footer();

@ -4,9 +4,6 @@
* Document quota management script
* @package chamilo.document
*/
/**
* Init
*/
$language_file = array('document');
@ -60,7 +57,10 @@ if (!empty($session_list)) {
$session_data['name'] = $session_data['name'] . ' * ';
}
$used_quota_bytes += $quota_bytes;
$session[] = array(addslashes(get_lang('Session').': '.$session_data['name']).' ('.format_file_size($quota_bytes).')', $quota_percentage);
$session[] = array(
addslashes(get_lang('Session').': '.$session_data['name']).' ('.format_file_size($quota_bytes).')',
$quota_percentage
);
}
}
$group_list = GroupManager::get_groups();
@ -111,9 +111,7 @@ if (is_array($document_list)) {
}
$quota_percentage = round(($total_quota_bytes - $used_quota_bytes)/$total_quota_bytes, 2)*100;
$session[] = array(addslashes(get_lang('ShowCourseQuotaUse')).' ('.format_file_size($total_quota_bytes - $used_quota_bytes).') ', $quota_percentage);
$quota_data = json_encode($session);
$htmlHeadXtra[] = "

@ -9,11 +9,6 @@
* @author Juan Carlos Ra<EFBFBD>a Trabado
* @since 25/september/2010
*/
/**
* Code
*/
/* INIT SECTION */
$language_file = array('document');
@ -31,7 +26,7 @@ $document_data = DocumentManager::get_document_data_by_id($_GET['id'], api_get_c
if (empty($document_data)) {
api_not_allowed();
} else {
} else {
$document_id = $document_data['id'];
$file_path = $document_data['path'];
$dir = dirname($document_data['path']);
@ -106,7 +101,7 @@ else
// Interbreadcrumb for the current directory root path
if (empty($document_data['parents'])) {
$interbreadcrumb[] = array('url' => '#', 'name' => $document_data['title']);
} else {
} else {
foreach($document_data['parents'] as $document_sub_data) {
if ($document_data['title'] == $document_sub_data['title']) {
continue;
@ -125,23 +120,23 @@ event_access_tool(TOOL_DOCUMENT);
Display :: display_header($nameTools, 'Doc');
echo '<div class="actions">';
echo '<a href="document.php?id='.$parent_id.'">'.Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('DocumentsOverview'),'',ICON_SIZE_MEDIUM).'</a>';
echo '<a href="document.php?id='.$parent_id.'">'.Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('DocumentsOverview'),'',ICON_SIZE_MEDIUM).'</a>';
echo '<a href="edit_document.php?'.api_get_cidreq().'&id='.$document_id.$req_gid.'&origin=editdraw">'.Display::return_icon('edit.png',get_lang('Rename').'/'.get_lang('Comments'),'',ICON_SIZE_MEDIUM).'</a>';
echo '</div>';
if (api_browser_support('svg')) {
if (api_browser_support('svg')) {
//automatic loading the course language
$svgedit_code_translation_table = array('' => 'en', 'pt' => 'pt-Pt', 'sr' => 'sr_latn');
$langsvgedit = api_get_language_isocode();
$langsvgedit = isset($svgedit_code_translation_table[$langsvgedit]) ? $svgedit_code_translation_table[$langsvgedit] : $langsvgedit;
$langsvgedit = file_exists(api_get_path(LIBRARY_PATH).'svg-edit/locale/lang.'.$langsvgedit.'.js') ? $langsvgedit : 'en';
$svg_url= api_get_path(WEB_LIBRARY_PATH).'svg-edit/svg-editor.php?url=../../../../courses/'.$courseDir.$dir.$file.'&amp;lang='.$langsvgedit;
?>
<script type="text/javascript">
document.write ('<iframe id="frame" frameborder="0" scrolling="no" src="<?php echo $svg_url; ?>" width="100%" height="100%"><noframes><p>Sorry, your browser does not handle frames</p></noframes></iframe>');
function resizeIframe() {
var height = window.innerHeight -50;
@ -153,14 +148,14 @@ if (api_browser_support('svg')) {
};
document.getElementById('frame').onload = resizeIframe;
window.onresize = resizeIframe;
</script>
<?php
echo '<noscript>';
echo '<iframe style="height: 550px; width: 100%;" scrolling="no" frameborder="0\' src="'.$svg_url.'"<noframes><p>Sorry, your browser does not handle frames</p></noframes></iframe>';
echo '</noscript>';
} else {
} else {
Display::display_error_message(get_lang('BrowserDontSupportsSVG'));
}
Display::display_footer();

@ -4,9 +4,7 @@
* ODF document editor script (maybe unused)
* @package chamilo.document
*/
/**
* Init
*/
require_once '../inc/global.inc.php';
//exit;
$document_id = $_GET['id'];

@ -9,11 +9,6 @@
* @author Juan Carlos Raña Trabado
* @since 30/january/2011
*/
/**
* Code
*/
/* INIT SECTION */
$language_file = array('document');
@ -31,7 +26,7 @@ $document_data = DocumentManager::get_document_data_by_id($_GET['id'], api_get_c
if (empty($document_data)) {
api_not_allowed();
} else {
} else {
$document_id = $document_data['id'];
$file_path = $document_data['path'];
$dir = dirname($document_data['path']);
@ -91,11 +86,11 @@ if (!is_dir($filepath)) {
//groups //TODO:clean
if (isset ($_SESSION['_gid']) && $_SESSION['_gid'] != 0) {
$req_gid = '&amp;gidReq='.$_SESSION['_gid'];
$interbreadcrumb[] = array ('url' => '../group/group_space.php?gidReq='.$_SESSION['_gid'], 'name' => get_lang('GroupSpace'));
$group_document = true;
$noPHP_SELF = true;
$noPHP_SELF = true;
}
@ -109,7 +104,7 @@ else
// Interbreadcrumb for the current directory root path
if (empty($document_data['parents'])) {
$interbreadcrumb[] = array('url' => '#', 'name' => $document_data['title']);
} else {
} else {
foreach($document_data['parents'] as $document_sub_data) {
if ($document_data['title'] == $document_sub_data['title']) {
continue;
@ -127,10 +122,10 @@ if (!$is_allowedToEdit) {
event_access_tool(TOOL_DOCUMENT);
Display :: display_header($nameTools, 'Doc');
echo '<div class="actions">';
echo '<a href="document.php?id='.$parent_id.'">'.Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('DocumentsOverview'),'',ICON_SIZE_MEDIUM).'</a>';
echo '<div class="actions">';
echo '<a href="document.php?id='.$parent_id.'">'.Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('DocumentsOverview'),'',ICON_SIZE_MEDIUM).'</a>';
echo '<a href="edit_document.php?'.api_get_cidreq().'&id='.$document_id.$req_gid.'&origin=editpaint">'.Display::return_icon('edit.png', get_lang('Rename').'/'.get_lang('Comment' ),'',ICON_SIZE_MEDIUM).'</a>';
echo '</div>';
echo '</div>';
///pixlr
$title=$file;//disk name. No sql name because pixlr return this when save
@ -181,7 +176,7 @@ $htaccess=api_get_path(SYS_ARCHIVE_PATH).'temp/images/.htaccess';
if (!file_exists($htaccess)) {
$htaccess_content="order deny,allow\r\nallow from all\r\nOptions -Indexes";
$fp = @ fopen(api_get_path(SYS_ARCHIVE_PATH).'temp/images/.htaccess', 'w');
if ($fp) {
fwrite($fp, $htaccess_content);
@ -190,7 +185,7 @@ if (!file_exists($htaccess)) {
}
$html_index=api_get_path(SYS_ARCHIVE_PATH).'temp/images/index.html';
if (!file_exists($html_index)) {
if (!file_exists($html_index)) {
$html_index_content="<html><head></head><body></body></html>";
$fp = @ fopen(api_get_path(SYS_ARCHIVE_PATH).'temp/images/index.html', 'w');
if ($fp) {
@ -200,7 +195,7 @@ if (!file_exists($html_index)) {
}
//encript temp name file
$name_crip=sha1(uniqid());//encript
$name_crip=sha1(uniqid());//encript
$findext= explode(".", $file);
$extension= $findext[count($findext)-1];
$file_crip=$name_crip.'.'.$extension;
@ -215,7 +210,7 @@ $_SESSION['temp_realpath_image']=$to;
$to_url=api_get_path(WEB_ARCHIVE_PATH).'temp/images/'.$file_crip;
$image=urlencode($to_url);
$pixlr_url = api_get_protocol().'://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
?>

@ -9,14 +9,11 @@
* @author Juan Carlos Ra<EFBFBD>a Trabado
* @since 30/january/2011
*/
/**
* Code
*/
require_once '../inc/global.inc.php';
api_protect_course_script();
api_block_anonymous_users();
//delete temporal file
unlink($_SESSION['temp_realpath_image']);
@ -28,10 +25,9 @@ unset($_SESSION['temp_realpath_image']);
if (!isset($_SESSION['exit_pixlr'])){
$location=api_get_path(WEB_CODE_PATH).'document/document.php';
echo '<script>window.parent.location.href="'.$location.'"</script>';
echo '<script>window.parent.location.href="'.$location.'"</script>';
api_not_allowed(true);
}
else{
} else {
echo '<div align="center" style="padding-top:150; font-family:Arial, Helvetica, Sans-serif;font-size:25px;color:#aaa;font-weight:bold;">'.get_lang('PleaseStandBy').'</div>';
$location=api_get_path(WEB_CODE_PATH).'document/document.php?id='.Security::remove_XSS($_SESSION['exit_pixlr']);
echo '<script>window.parent.location.href="'.$location.'"</script>';

@ -4,9 +4,7 @@
* @package chamilo.document
* TODO: There is no indication that this file us used for something.
*/
/**
* Code
*/
require_once '../inc/global.inc.php';
$my_style = api_get_visual_theme();

@ -4,9 +4,6 @@
/**
* @package chamilo.document
*/
/**
* Code
*/
// Name of the language file that needs to be included
exit;

@ -9,11 +9,6 @@
* @author Juan Carlos Raña Trabado herodoto@telefonica.net
* @since 5/mar/2011
*/
/**
* Code
*/
/* INIT SECTION */
// Name of the language file that needs to be included
$language_file = array('document');
@ -34,7 +29,7 @@ api_block_anonymous_users();
$document_data = DocumentManager::get_document_data_by_id($_GET['id'], api_get_course_id(), true);
if (empty($document_data)) {
if (api_is_in_group()) {
$group_properties = GroupManager::get_group_properties(api_get_group_id());
$group_properties = GroupManager::get_group_properties(api_get_group_id());
$document_id = DocumentManager::get_document_id(api_get_course_info(), $group_properties['directory']);
$document_data = DocumentManager::get_document_data_by_id($document_id, api_get_course_id());
}
@ -106,14 +101,14 @@ if (isset ($group)) {
}
// Interbreadcrumb for the current directory root path
$counter = 0;
$counter = 0;
if (isset($document_data['parents'])) {
foreach($document_data['parents'] as $document_sub_data) {
//fixing double group folder in breadcrumb
if (api_get_group_id()) {
if ($counter == 0) {
$counter++;
continue;
continue;
}
}
$interbreadcrumb[] = array('url' => $document_sub_data['document_url'], 'name' => $document_sub_data['title']);
@ -127,8 +122,8 @@ echo '<div class="actions">';
echo '</div>';
?>
<script type="text/javascript">
function submitVoice() {
<script type="text/javascript">
function submitVoice() {
//lang vars
var lang_no_applet="<?php echo get_lang('NanogongNoApplet'); ?>";
var lang_record_before_save="<?php echo get_lang('NanogongRecordBeforeSave'); ?>";
@ -142,15 +137,15 @@ function submitVoice() {
//path, url and filename
var filename = document.getElementById("audio_title").value+"_chnano_.wav";//adding name file, tag and extension
var filename = filename.replace(/\s/g, "_");//replace spaces by _
var filename = encodeURIComponent(filename);
var filename = encodeURIComponent(filename);
var filepath="<?php echo urlencode($filepath); ?>";
var dir="<?php echo urlencode($dir); ?>";
var course_code="<?php echo urlencode($course_code); ?>";
//
var urlnanogong="../inc/lib/nanogong/receiver.php?filename="+filename+"&filepath="+filepath+"&dir="+dir+"&course_code="+course_code+"&nano_group_id="+nano_group_id+"&nano_session_id="+nano_session_id+"&nano_user_id="+nano_user_id;
var cookie="<?php echo 'ch_sid='.session_id(); ?>";
//check
//check
var recorder
if (!(recorder = document.getElementById("nanogong"))) {
alert(lang_no_applet)
@ -160,17 +155,17 @@ function submitVoice() {
if (duration <= 0) {
alert(lang_record_before_save)
return
}
}
if (!document.getElementById("audio_title").value) {
alert(lang_give_a_title)
return
}
//
var applet = document.getElementById("nanogong");
//
var applet = document.getElementById("nanogong");
var ret = applet.sendGongRequest( "PostToForm", urlnanogong, "voicefile", cookie, "temp");//'PostToForm', postURL, inputname, cookie, filename
if (ret == null) {
alert(lang_failled_to_submit);
if (ret == null) {
alert(lang_failled_to_submit);
} else {
alert(lang_submitted+"\n"+ret);
$("#status").attr('value', '1');
@ -191,14 +186,14 @@ echo '<applet id="nanogong" archive="'.api_get_path(WEB_LIBRARY_PATH).'nanogong/
echo '<param name="ShowTime" value="true" />'; // default false
//echo '<param name="Color" value="#C0E0FF" />'; // default #FFFFFF
//echo '<param name="StartTime" value="10.5" />';
//echo '<param name="EndTime" value="65" />';
//echo '<param name="EndTime" value="65" />';
echo '<param name="AudioFormat" value="ImaADPCM" />';// ImaADPCM (more speed), Speex (more compression)|(default Speex)
//echo '<param name="SamplingRate" value="32000" />';//Quality for ImaADPCM (low 8000, medium 11025, normal 22050, hight 44100) OR Quality for Speex (low 8000, medium 16000, normal 32000, hight 44100) | (default 44100)
//echo '<param name="MaxDuration" value="60" />';
//echo '<param name="SoundFileURL" value="http://somewhere.com/mysoundfile.wav" />';//load a file |(default "")
//echo '<param name="SoundFileURL" value="http://somewhere.com/mysoundfile.wav" />';//load a file |(default "")
echo '</applet>';
echo '<form name="form_nanogong">';
echo '<form name="form_nanogong">';
echo '<input placeholder="'.get_lang('InputNameHere').'" type="text" id="audio_title">';
echo '<input id="status" type="hidden" name="status" value="0">';
echo '<button class="upload" type="submit" value="'.get_lang('Send').'" onClick="submitVoice()" />'.get_lang('Send').'</button>';

@ -9,11 +9,6 @@
* @author Juan Carlos Raña Trabado herodoto@telefonica.net
* @since 5/april/2012
*/
/**
* Code
*/
/* INIT SECTION */
// Name of the language file that needs to be included
$language_file = array('document');

@ -5,10 +5,6 @@
*
* @package chamilo.document
*/
/**
* Code
*/
/* INITIALIZATION */
$language_file[] = 'document';
require_once '../inc/global.inc.php';

@ -1,5 +1,6 @@
<?php
/* For licensing terms, see /license.txt */
/**
* This file will show documents in a separate frame.
* We don't like frames, but it was the best of two bad things.
@ -21,9 +22,7 @@
* @author Roan Embrechts (roan.embrechts@vub.ac.be)
* @package chamilo.document
*/
/**
* INITIALIZATION
*/
$language_file[] = 'document';
require_once '../inc/global.inc.php';

@ -9,11 +9,6 @@
* @author Juan Carlos Raña Trabado herodoto@telefonica.net
* @since 7/jun/2012
*/
/**
* Code
*/
/* INIT SECTION */
// Name of the language file that needs to be included
$language_file = array('document');
@ -34,7 +29,7 @@ api_block_anonymous_users();
$document_data = DocumentManager::get_document_data_by_id($_GET['id'], api_get_course_id(), true);
if (empty($document_data)) {
if (api_is_in_group()) {
$group_properties = GroupManager::get_group_properties(api_get_group_id());
$group_properties = GroupManager::get_group_properties(api_get_group_id());
$document_id = DocumentManager::get_document_id(api_get_course_info(), $group_properties['directory']);
$document_data = DocumentManager::get_document_data_by_id($document_id, api_get_course_id());
}
@ -113,14 +108,14 @@ if (isset ($group)) {
}
// Interbreadcrumb for the current directory root path
$counter = 0;
$counter = 0;
if (isset($document_data['parents'])) {
foreach($document_data['parents'] as $document_sub_data) {
//fixing double group folder in breadcrumb
if (api_get_group_id()) {
if ($counter == 0) {
$counter++;
continue;
continue;
}
}
$interbreadcrumb[] = array('url' => $document_sub_data['document_url'], 'name' => $document_sub_data['title']);
@ -145,7 +140,7 @@ echo '</div>';
<h3><?php echo get_lang('LocalInputImage'); ?></h3>
<!-- First, include the JPEGCam JavaScript Library -->
<script type="text/javascript" src="<?php echo api_get_path(WEB_LIBRARY_PATH); ?>jpegcam/webcam.js"></script>
<!-- Configure a few settings -->
<script language="JavaScript">
var clip_filename='video_clip.jpg';
@ -154,14 +149,14 @@ echo '</div>';
webcam.set_shutter_sound( true,'<?php echo api_get_path(WEB_LIBRARY_PATH); ?>jpegcam/shutter.mp3' ); // true play shutter click sound
webcam.set_quality( 90 ); // JPEG quality (1 - 100)
webcam.set_api_url( '<?php echo api_get_path(WEB_LIBRARY_PATH); ?>jpegcam/webcam_receiver.php?webcamname='+escape(clip_filename)+'&webcamdir=<?php echo $webcamdir; ?>&webcamuserid=<?php echo $webcamuserid; ?>' );
</script>
<!-- Next, write the movie to the page at 320x240 -->
<script language="JavaScript">
document.write( webcam.get_html(320, 240) );
</script>
<!-- Some buttons for controlling things -->
<br/>
<form>
@ -171,16 +166,16 @@ echo '</div>';
<input type=button value="<?php echo get_lang('Send'); ?>" onClick="do_upload()">
&nbsp;&nbsp;||&nbsp;&nbsp;
<input type=button value="<?php echo get_lang('Auto'); ?>" onClick="start_video();">
<input type=button value="<?php echo get_lang('Stop'); ?>" onClick="stop_video()">
<input type=button value="<?php echo get_lang('Stop'); ?>" onClick="stop_video()">
<br/>
<input type=button value="<?php echo get_lang('Configure'); ?>" onClick="webcam.configure()">
</form>
<!-- Code to handle the server response (see webcam_receiver.php) -->
<script language="JavaScript">
webcam.set_hook( 'onComplete', 'my_completion_handler' );
function do_upload() {
// upload to server
if (this.loaded){
@ -188,19 +183,19 @@ echo '</div>';
}
webcam.upload();
}
function my_completion_handler(msg) {
// extract URL out of PHP output
if (msg.match(/(http\:\/\/\S+)/)) {
var image_url = RegExp.$1;
image_url=image_url.replace(/\\/g,'/').replace( /.*\//, '' );// extract basename
image_url='<?php echo api_get_path(WEB_COURSE_PATH).$_course['path'].'/document/'.$dir;?>'+image_url+'<?php echo '?'.api_get_cidreq(); ?>';
// show JPEG image in page
document.getElementById('upload_results').innerHTML =
document.getElementById('upload_results').innerHTML =
'<div style="width: 320px;">' +
'<h3><?php echo get_lang('ClipSent'); ?></h3>' +
'<h3><?php echo get_lang('ClipSent'); ?></h3>' +
'<img src="' + image_url + '">' +
'</div>';
// reset camera for another shot
@ -209,7 +204,7 @@ echo '</div>';
else alert("PHP Error: " + msg);
}
</script>
<script language=javascript>
var internaval=null;
var timeout=null;
@ -217,7 +212,7 @@ echo '</div>';
var fps=1000;//one frame per second
var maxclip=25;//maximum number of clips
var maxtime=60000;//stop after one minute
function stop_video() {
interval=window.clearInterval(interval);
}
@ -226,7 +221,7 @@ echo '</div>';
webcam.set_stealth( true ); // do not freeze image upon capture
interval=window.setInterval("clip_send_video()",fps);
}
function clip_send_video() {
counter++
timeout=setTimeout('stop_video()',maxtime);
@ -238,8 +233,8 @@ echo '</div>';
}
}
</script>
</td><td width=50>&nbsp;</td><td valign=top>
<div id="upload_results" style="background-color:#ffffff;"></div>
</td></tr></table>
@ -247,4 +242,4 @@ echo '</div>';
<?php
Display :: display_footer();
Display :: display_footer();

Loading…
Cancel
Save