Skip to content

Commit ff35e68

Browse files
committed
Minor - format code + fix php warning
1 parent 4b8848b commit ff35e68

File tree

2 files changed

+20
-14
lines changed

2 files changed

+20
-14
lines changed

main/document/create_audio.php

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,14 @@
141141
Display:: display_header($nameTools, 'Doc');
142142

143143
echo '<div class="actions">';
144-
echo '<a href="document.php?id='.$document_id.'">'.
145-
Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('DocumentsOverview'), '',
146-
ICON_SIZE_MEDIUM).'</a>';
144+
echo '<a href="document.php?id='.$document_id.'">';
145+
echo Display::return_icon(
146+
'back.png',
147+
get_lang('BackTo').' '.get_lang('DocumentsOverview'),
148+
'',
149+
ICON_SIZE_MEDIUM
150+
);
151+
echo '</a>';
147152

148153
echo '<a href="create_audio.php?'.api_get_cidreq().'&id='.$document_id.'&service=pediaphon">'.
149154
Display::return_icon('pediaphon.png', get_lang('Pediaphon'), '', ICON_SIZE_MEDIUM).'</a>';
@@ -201,9 +206,9 @@
201206
<?php
202207

203208
if (isset($_POST['text2voice_mode']) && $_POST['text2voice_mode'] == 'google') {
204-
downloadMP3_google($filepath, $dir);
209+
downloadAudioGoogle($filepath, $dir);
205210
} elseif (isset($_POST['text2voice_mode']) && $_POST['text2voice_mode'] == 'pediaphon') {
206-
downloadMP3_pediaphon($filepath, $dir);
211+
downloadAudioPediaphon($filepath, $dir);
207212
}
208213

209214
$tbl_admin_languages = Database::get_main_table(TABLE_MAIN_LANGUAGE);
@@ -301,7 +306,7 @@
301306
<?php
302307
}//end pediaphon
303308

304-
Display:: display_footer();
309+
Display::display_footer();
305310

306311
/**
307312
* This function save a post into a file mp3 from google services
@@ -311,7 +316,7 @@
311316
* @author Juan Carlos Raña Trabado <herodoto@telefonica.net>
312317
* @version january 2011, chamilo 1.8.8
313318
*/
314-
function downloadMP3_google($filepath, $dir)
319+
function downloadAudioGoogle($filepath, $dir)
315320
{
316321
$location = 'create_audio.php?'.api_get_cidreq().'&id='.intval($_POST['id']).'&service=google';
317322

@@ -404,7 +409,6 @@ function downloadMP3_google($filepath, $dir)
404409
$current_session_id
405410
);
406411
echo Display::return_message(get_lang('DocumentCreated'), 'confirm');
407-
//return to location
408412
echo '<script>window.location.href="'.$location.'"</script>';
409413
}
410414

@@ -416,7 +420,7 @@ function downloadMP3_google($filepath, $dir)
416420
* @author Juan Carlos Raña Trabado <herodoto@telefonica.net>
417421
* @version january 2011, chamilo 1.8.8
418422
*/
419-
function downloadMP3_pediaphon($filepath, $dir)
423+
function downloadAudioPediaphon($filepath, $dir)
420424
{
421425
$location = 'create_audio.php?'.api_get_cidreq().'&id='.intval($_POST['id']).'&service=pediaphon';
422426
//security
@@ -460,8 +464,7 @@ function downloadMP3_pediaphon($filepath, $dir)
460464
$documentPath = $filepath.'/'.$audio_filename;
461465
$clean_text = api_replace_dangerous_char($clean_text);
462466

463-
//adding the file
464-
467+
// Adding the file
465468
if ($clean_lang == 'de') {
466469
$url_pediaphon = 'http://www.pediaphon.org/~bischoff/radiopedia/sprich_multivoice.cgi';
467470
$find_t2v = '/http\:\/\/www\.pediaphon\.org\/\~bischoff\/radiopedia\/mp3\/(.*)\.mp3\"/';

news_list.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@
22
/* For licensing terms, see /license.txt */
33

44
require_once 'main/inc/global.inc.php';
5+
56
$tool_name = get_lang('SystemAnnouncements');
67
$visibility = SystemAnnouncementManager::getCurrentUserVisibility();
7-
if (!isset($_GET['id']) || empty($_GET['id'])) {
8-
$content = SystemAnnouncementManager::displayAnnouncementsSlider($visibility, $_GET['id']);
8+
$id = isset($_GET['id']) ? $_GET['id'] : 0;
9+
10+
if (empty($id)) {
11+
$content = SystemAnnouncementManager::displayAnnouncementsSlider($visibility);
912
} else {
10-
$content = SystemAnnouncementManager::displayAnnouncement($_GET['id'], $visibility);
13+
$content = SystemAnnouncementManager::displayAnnouncement($id, $visibility);
1114
}
1215

1316
$tpl = new Template($tool_name);

0 commit comments

Comments
 (0)