Minor - format code.

1.9.x
Julio Montoya 11 years ago
parent c352fba06a
commit 65a0a9dd0b
  1. 5
      main/document/create_audio.php
  2. 38
      main/document/create_document.php
  3. 16
      main/document/create_draw.php
  4. 14
      main/document/create_paint.php
  5. 10
      main/document/document_quota.php
  6. 5
      main/document/edit_draw.php
  7. 4
      main/document/edit_odf.php
  8. 5
      main/document/edit_paint.php
  9. 6
      main/document/exit_pixlr.php
  10. 4
      main/document/footerpage.php
  11. 3
      main/document/headerpage.php
  12. 5
      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. 5
      main/document/webcam_clip.php

@ -126,12 +126,8 @@ Display :: display_header($nameTools, 'Doc');
echo '<div class="actions">'; 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 '<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=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="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>'; echo '</div>';
?> ?>
@ -281,7 +277,6 @@ $(document).ready(function(){
<!--French --> <!--French -->
voices[3]=["<?php echo get_lang('Female').' (fr8 HQ)'; ?>|fr8"] voices[3]=["<?php echo get_lang('Female').' (fr8 HQ)'; ?>|fr8"]
function update_voices(selectedvoicegroup){ function update_voices(selectedvoicegroup){
voiceslist.options.length=0 voiceslist.options.length=0
for (i=0; i<voices[selectedvoicegroup].length; i++) for (i=0; i<voices[selectedvoicegroup].length; i++)

@ -5,10 +5,6 @@
* *
* @package chamilo.document * @package chamilo.document
*/ */
/**
* Code
*/
/* INIT SECTION */
// Name of the language file that needs to be included // Name of the language file that needs to be included
$language_file = array('document', 'gradebook'); $language_file = array('document', 'gradebook');
@ -162,6 +158,7 @@ if ($is_certificate_mode) {
$doc_table = Database::get_course_table(TABLE_DOCUMENT); $doc_table = Database::get_course_table(TABLE_DOCUMENT);
$course_id = api_get_course_int_id(); $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); $document_data = DocumentManager::get_document_data_by_id($_REQUEST['id'], api_get_course_id(), true);
if (empty($document_data)) { if (empty($document_data)) {
@ -169,7 +166,6 @@ if (empty($document_data)) {
$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_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()); $document_data = DocumentManager::get_document_data_by_id($document_id, api_get_course_id());
$dir = $document_data['path']; $dir = $document_data['path'];
$folder_id = $document_data['id']; $folder_id = $document_data['id'];
} else { } else {
@ -225,7 +221,9 @@ for ($i = 0; $i < ($count_dir); $i++) {
$relative_url .= '../'; $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== '') { if ($relative_url== '') {
$relative_url = '/'; $relative_url = '/';
} }
@ -283,7 +281,7 @@ if (!$is_allowed_in_course) {
if (!($is_allowed_to_edit || if (!($is_allowed_to_edit ||
$_SESSION['group_member_with_upload_rights'] || $_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); 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 // If we are not in the certificates creation, display a folder chooser for the
// new document created // 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); $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'))); $parent_select = $form->addElement('select', 'curdirpath', array(null, get_lang('DestinationDirectory')));
@ -472,10 +470,6 @@ if ($form->validate()) {
$readonly = isset($values['readonly']) ? 1 : 0; $readonly = isset($values['readonly']) ? 1 : 0;
$values['title'] = trim($values['title']); $values['title'] = trim($values['title']);
/*if (!empty($values['curdirpath'])) {
$dir = $values['curdirpath'];
}*/
if ($dir[strlen($dir) - 1] != '/') { if ($dir[strlen($dir) - 1] != '/') {
$dir .= '/'; $dir .= '/';
} }
@ -511,19 +505,20 @@ if ($form->validate()) {
fputs($fp, $content); fputs($fp, $content);
fclose($fp); fclose($fp);
chmod($filepath.$filename.'.'.$extension, api_get_permissions_for_new_files()); chmod($filepath.$filename.'.'.$extension, api_get_permissions_for_new_files());
if (!is_dir($filepath.'css')) { if (!is_dir($filepath.'css')) {
mkdir($filepath.'css', api_get_permissions_for_new_directories()); mkdir($filepath.'css', api_get_permissions_for_new_directories());
$doc_id = add_document($_course, $dir.'css', 'folder', 0, 'css'); $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, 'FolderCreated', $userId, 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, 'invisible', $userId, null, null, null, null, $current_session_id);
} }
if (!is_file($filepath.'css/frames.css')) { if (!is_file($filepath.'css/frames.css')) {
// Make a copy of the current css for the new document // 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'); 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'); $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, 'DocumentAdded', $userId, 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, 'invisible', $userId, null, null, null, null, $current_session_id);
} }
$file_size = filesize($filepath.$filename.'.'.$extension); $file_size = filesize($filepath.$filename.'.'.$extension);
@ -537,7 +532,7 @@ if ($form->validate()) {
TOOL_DOCUMENT, TOOL_DOCUMENT,
$document_id, $document_id,
'DocumentAdded', 'DocumentAdded',
$_user['user_id'], $userId,
$to_group_id, $to_group_id,
null, null,
null, null,
@ -545,7 +540,7 @@ if ($form->validate()) {
$current_session_id $current_session_id
); );
// Update parent folders // 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 = isset($_POST['comment']) ? trim($_POST['comment']) : '';
$new_comment = Database::escape_string($new_comment); $new_comment = Database::escape_string($new_comment);
$new_title = isset($_POST['title']) ? trim($_POST['title']) : ''; $new_title = isset($_POST['title']) ? trim($_POST['title']) : '';
@ -600,15 +595,16 @@ if ($form->validate()) {
} }
Display :: display_header($nameTools, "Doc"); Display :: display_header($nameTools, "Doc");
//api_display_tool_title($nameTools);
// actions // actions
echo '<div class="actions">'; echo '<div class="actions">';
// link back to the documents overview // link back to the documents overview
if ($is_certificate_mode) 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 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>'; echo '</div>';
if ($is_certificate_mode) { if ($is_certificate_mode) {

@ -9,11 +9,6 @@
* @author Juan Carlos Raña Trabado * @author Juan Carlos Raña Trabado
* @since 25/september/2010 * @since 25/september/2010
*/ */
/**
* Code
*/
/* INIT SECTION */
// Name of the language file that needs to be included // Name of the language file that needs to be included
$language_file = array('document'); $language_file = array('document');
@ -118,17 +113,6 @@ if (isset ($group)) {
$dir_array = explode('/', $dir); $dir_array = explode('/', $dir);
$array_len = count($dir_array); $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 // Interbreadcrumb for the current directory root path
if (empty($document_data['parents'])) { if (empty($document_data['parents'])) {
$interbreadcrumb[] = array('url' => '#', 'name' => $document_data['title']); $interbreadcrumb[] = array('url' => '#', 'name' => $document_data['title']);

@ -9,9 +9,6 @@
* @since 30/January/2011 * @since 30/January/2011
* @todo clean all file * @todo clean all file
*/ */
/**
* Code
*/
/* INIT SECTION */ /* INIT SECTION */
$language_file = array('document'); $language_file = array('document');
@ -100,7 +97,6 @@ if (!($is_allowed_to_edit || $_SESSION['group_member_with_upload_rights'] || is_
api_not_allowed(true); api_not_allowed(true);
} }
/* Header */ /* Header */
event_access_tool(TOOL_DOCUMENT); event_access_tool(TOOL_DOCUMENT);
$display_dir = $dir; $display_dir = $dir;
@ -122,7 +118,8 @@ if (empty($document_data['parents'])) {
Display :: display_header($nameTools, 'Doc'); Display :: display_header($nameTools, 'Doc');
echo '<div class="actions">'; 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>'; echo '</div>';
///pixlr ///pixlr
@ -157,16 +154,11 @@ if ($_SERVER['HTTP_HOST']=="localhost") {
@file_put_contents($path_and_file, $crossdomain); @file_put_contents($path_and_file, $crossdomain);
} }
$credentials="true"; $credentials="true";
} } else {
else {
$credentials="false"; $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; $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"> <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>'); 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>');

@ -4,9 +4,6 @@
* Document quota management script * Document quota management script
* @package chamilo.document * @package chamilo.document
*/ */
/**
* Init
*/
$language_file = array('document'); $language_file = array('document');
@ -60,7 +57,10 @@ if (!empty($session_list)) {
$session_data['name'] = $session_data['name'] . ' * '; $session_data['name'] = $session_data['name'] . ' * ';
} }
$used_quota_bytes += $quota_bytes; $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(); $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; $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); $session[] = array(addslashes(get_lang('ShowCourseQuotaUse')).' ('.format_file_size($total_quota_bytes - $used_quota_bytes).') ', $quota_percentage);
$quota_data = json_encode($session); $quota_data = json_encode($session);
$htmlHeadXtra[] = " $htmlHeadXtra[] = "

@ -9,11 +9,6 @@
* @author Juan Carlos Ra<EFBFBD>a Trabado * @author Juan Carlos Ra<EFBFBD>a Trabado
* @since 25/september/2010 * @since 25/september/2010
*/ */
/**
* Code
*/
/* INIT SECTION */
$language_file = array('document'); $language_file = array('document');

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

@ -9,11 +9,6 @@
* @author Juan Carlos Raña Trabado * @author Juan Carlos Raña Trabado
* @since 30/january/2011 * @since 30/january/2011
*/ */
/**
* Code
*/
/* INIT SECTION */
$language_file = array('document'); $language_file = array('document');

@ -9,9 +9,6 @@
* @author Juan Carlos Ra<EFBFBD>a Trabado * @author Juan Carlos Ra<EFBFBD>a Trabado
* @since 30/january/2011 * @since 30/january/2011
*/ */
/**
* Code
*/
require_once '../inc/global.inc.php'; require_once '../inc/global.inc.php';
api_protect_course_script(); api_protect_course_script();
@ -30,8 +27,7 @@ if (!isset($_SESSION['exit_pixlr'])){
$location=api_get_path(WEB_CODE_PATH).'document/document.php'; $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); 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>'; 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']); $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>'; echo '<script>window.parent.location.href="'.$location.'"</script>';

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

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

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

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

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

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

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

Loading…
Cancel
Save