Skip to content

Commit

Permalink
Fix icons
Browse files Browse the repository at this point in the history
  • Loading branch information
jmontoyaa committed Mar 11, 2016
1 parent 23173d5 commit b65d66a
Show file tree
Hide file tree
Showing 10 changed files with 111 additions and 97 deletions.
4 changes: 3 additions & 1 deletion main/admin/course_intro_pdf_import.php
Expand Up @@ -127,7 +127,9 @@ function import_pdfs($file, $subDir = '/')
api_set_default_visibility($docId, TOOL_DOCUMENT);
$errors[] = array('Line' => 0, 'Code' => $course['code'], 'Title' => $course['title']);
// Now add a link to the file from the Course description tool
$link = '<p>Sílabo de la asignatura <a href="'.api_get_path(WEB_CODE_PATH).'document/document.php?cidReq='.$course['code'].'&id_session=0&gidReq=0&action=download&id='.$docId.'" target="_blank"><img src="'.api_get_path(WEB_IMG_PATH).'icons/32/pdf.png"></a></p>';
$link = '<p>Sílabo de la asignatura <a href="'.api_get_path(WEB_CODE_PATH).'document/document.php?cidReq='.$course['code'].'&id_session=0&gidReq=0&action=download&id='.$docId.'" target="_blank">
'.Display::return_icon('pdf.png').'
</a></p>';
$course_description = new CourseDescription();
$session_id = api_get_session_id();
$course_description->set_course_id($course['real_id']);
Expand Down
51 changes: 28 additions & 23 deletions main/attendance/attendance_sheet.php
Expand Up @@ -107,14 +107,12 @@
if (!$is_locked_attendance || api_is_platform_admin()) {

$actionsLeft = '<a style="float:left;" href="index.php?'.api_get_cidreq().'&action=calendar_list&attendance_id='.$attendance_id.'">'.
Display::return_icon('attendance_calendar.png',get_lang('AttendanceCalendar'),'',ICON_SIZE_MEDIUM).'</a>';
Display::return_icon('attendance_calendar.png', get_lang('AttendanceCalendar'), '', ICON_SIZE_MEDIUM).'</a>';
$actionsLeft .= '<a id="pdf_export" style="float:left;" href="index.php?'.api_get_cidreq().'&action=attendance_sheet_export_to_pdf&attendance_id='.$attendance_id.'&filter='.$default_filter.'&group_id='.$groupId.'">'.
Display::return_icon('pdf.png',get_lang('ExportToPDF'),'',ICON_SIZE_MEDIUM).'</a>';
//if (count($users_in_course) > 0) {
$actionsRight = $form->returnForm();
//}
Display::return_icon('pdf.png', get_lang('ExportToPDF'), '', ICON_SIZE_MEDIUM).'</a>';

$toolbar = Display::toolbarAction('toolbar-attendance', array(0 => $actionsLeft, 1 => $actionsRight), 2 , false);
$actionsRight = $form->returnForm();
$toolbar = Display::toolbarAction('toolbar-attendance', array($actionsLeft, $actionsRight), 2, false);
echo $toolbar;
}

Expand Down Expand Up @@ -207,7 +205,6 @@ function UpdateTableHeaders() {
</script>

<form method="post" action="index.php?action=attendance_sheet_add&<?php echo api_get_cidreq().$param_filter ?>&attendance_id=<?php echo $attendance_id?>" >

<div class="attendance-sheet-content" style="width:100%;background-color:#E1E1E1;margin-top:20px;">
<div class="divTableWithFloatingHeader attendance-users-table" style="width:45%;float:left;margin:0px;padding:0px;">
<table class="tableWithFloatingHeader data_table" width="100%">
Expand Down Expand Up @@ -264,15 +261,19 @@ function UpdateTableHeaders() {
echo '<table class="tableWithFloatingHeader data_table" width="100%">';
echo '<thead>';
$result = null;
if (count($attendant_calendar) > 0 ) {
if (count($attendant_calendar) > 0) {
foreach ($attendant_calendar as $calendar) {
$date = $calendar['date'];
$time = $calendar['time'];
$datetime = '<div class="grey">'. $date . ' - ' . $time . '</div>';

$img_lock = Display::return_icon('lock-closed.png',get_lang('DateUnLock'),array('class'=>'img_lock','id'=>'datetime_column_'.$calendar['id']));
$img_lock = Display::return_icon(
'lock-closed.png',
get_lang('DateUnLock'),
array('class' => 'img_lock', 'id' => 'datetime_column_'.$calendar['id'])
);

if (!empty($calendar['done_attendance'])){
if (!empty($calendar['done_attendance'])) {
$datetime = '<div class="blue">' . $date . ' - ' . $time . '</div>';
}
$disabled_check = 'disabled = "true"';
Expand Down Expand Up @@ -319,7 +320,7 @@ function UpdateTableHeaders() {
}
echo '<tr class="'.$class.'">';

if (count($attendant_calendar) > 0 ) {
if (count($attendant_calendar) > 0) {
foreach ($attendant_calendar as $calendar) {
$checked = 'checked';
$presence = -1;
Expand All @@ -343,10 +344,11 @@ function UpdateTableHeaders() {
$style_td = '';

if ($next_attendance_calendar_id == $calendar['id']) {
if ($i%2==0)
if ($i % 2 == 0) {
$style_td = 'background-color:#eee;';
else
} else {
$style_td = 'background-color:#dcdcdc;';
}
$disabled = '';
}

Expand All @@ -363,10 +365,10 @@ function UpdateTableHeaders() {
} else {
switch ($presence) {
case 1:
echo Display::return_icon('accept.png',get_lang('Attended'));
echo Display::return_icon('accept.png', get_lang('Attended'));
break;
case 0:
echo Display::return_icon('exclamation.png',get_lang('NotAttended'));
echo Display::return_icon('exclamation.png', get_lang('NotAttended'));
break;
case -1:
//echo Display::return_icon('warning.png',get_lang('NotAttended'));
Expand Down Expand Up @@ -397,18 +399,21 @@ function UpdateTableHeaders() {

<div class="row">
<div class="col-md-12">
<?php if (!$is_locked_attendance || api_is_platform_admin()) {
if (api_is_allowed_to_edit(null, true)) {
?>
<button type="submit" class="btn btn-primary"><?php echo get_lang('Save') ?></button>
<?php }
}
?> </div>
<?php if (!$is_locked_attendance || api_is_platform_admin()) {
if (api_is_allowed_to_edit(null, true)) { ?>
<button type="submit" class="btn btn-primary"><?php echo get_lang('Save') ?></button>
<?php }
} ?>
</div>
</div>
</form>
<?php
} else {
echo Display::display_warning_message('<a href="'.api_get_path(WEB_CODE_PATH).'user/user.php?'.api_get_cidreq().'">'.get_lang('ThereAreNoRegisteredLearnersInsidetheCourse').'</a>', false);
echo Display::display_warning_message(
'<a href="'.api_get_path(WEB_CODE_PATH).'user/user.php?'.api_get_cidreq().'">'.
get_lang('ThereAreNoRegisteredLearnersInsidetheCourse').'</a>',
false
);
}
} else {
echo Display::page_header(get_lang('AttendanceSheetReport'));
Expand Down
2 changes: 1 addition & 1 deletion main/course_home/3column.php
Expand Up @@ -60,7 +60,7 @@
if ($tool['img'] != 'external.gif') {
$tool['link'] = api_get_path(WEB_CODE_PATH).$tool['link'];
}
$tool['image'] = api_get_path(WEB_IMG_PATH).$tool['image'];
$tool['image'] = Display::returnIconPath($tool['image']);

echo "<br /><br /><br />\n";
echo "<table class=\"message\" width=\"70%\" align=\"center\">\n",
Expand Down
79 changes: 43 additions & 36 deletions main/document/create_paint.php
@@ -1,5 +1,6 @@
<?php
/* For licensing terms, see /license.txt */

/**
* This file allows creating audio files from a text.
*
Expand All @@ -10,7 +11,6 @@
* @todo clean all file
*/

/* INIT SECTION */
require_once '../inc/global.inc.php';
$_SESSION['whereami'] = 'document/createpaint';
$this_section = SECTION_COURSES;
Expand All @@ -19,31 +19,33 @@

api_protect_course_script();
api_block_anonymous_users();
$_course = api_get_course_info();

if (api_get_setting('enabled_support_paint') == 'false') {
api_not_allowed(true);
api_not_allowed(true);
}

$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());
$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());
$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());
}
}

$document_id = $document_data['id'];
$dir = $document_data['path'];
$dir = $document_data['path'];

//$dir = isset($_GET['dir']) ? Security::remove_XSS($_GET['dir']) : Security::remove_XSS($_POST['dir']);
$is_allowed_to_edit = api_is_allowed_to_edit(null, true);

//path for pixlr save
$_SESSION['paint_dir']=Security::remove_XSS($dir);
if ($_SESSION['paint_dir']=='/'){
$_SESSION['paint_dir']='';
$_SESSION['paint_dir'] = Security::remove_XSS($dir);
if ($_SESSION['paint_dir'] == '/') {
$_SESSION['paint_dir'] = '';
}
$_SESSION['paint_file']=get_lang('NewImage');
$_SESSION['paint_file'] = get_lang('NewImage');

// Please, do not modify this dirname formatting

Expand Down Expand Up @@ -73,56 +75,63 @@
$groupId = api_get_group_id();

if (!empty($groupId)) {
$interbreadcrumb[] = array ("url" => "../group/group_space.php?".api_get_cidreq(), "name" => get_lang('GroupSpace'));
$noPHP_SELF = true;
$group = GroupManager::get_group_properties($groupId);
$path = explode('/', $dir);
if ('/'.$path[1] != $group['directory']) {
api_not_allowed(true);
}
$interbreadcrumb[] = array(
"url" => api_get_path(WEB_CODE_PATH)."group/group_space.php?".api_get_cidreq(),
"name" => get_lang('GroupSpace'),
);
$noPHP_SELF = true;
$group = GroupManager::get_group_properties($groupId);
$path = explode('/', $dir);
if ('/'.$path[1] != $group['directory']) {
api_not_allowed(true);
}
}

$interbreadcrumb[] = array ("url" => "./document.php?curdirpath=".urlencode($dir)."&".api_get_cidreq(), "name" => get_lang('Documents'));
$interbreadcrumb[] = array(
"url" => "./document.php?curdirpath=".urlencode($dir)."&".api_get_cidreq(),
"name" => get_lang('Documents'),
);

if (!$is_allowed_in_course) {
api_not_allowed(true);
api_not_allowed(true);
}

if (!($is_allowed_to_edit || $_SESSION['group_member_with_upload_rights'] ||
DocumentManager::is_my_shared_folder($_user['user_id'], Security::remove_XSS($dir),api_get_session_id()))) {
api_not_allowed(true);
DocumentManager::is_my_shared_folder($_user['user_id'], Security::remove_XSS($dir), api_get_session_id()))
) {
api_not_allowed(true);
}

/* Header */
Event::event_access_tool(TOOL_DOCUMENT);
$display_dir = $dir;
if (isset ($group)) {
$display_dir = explode('/', $dir);
unset ($display_dir[0]);
unset ($display_dir[1]);
$display_dir = implode('/', $display_dir);
$display_dir = explode('/', $dir);
unset ($display_dir[0]);
unset ($display_dir[1]);
$display_dir = implode('/', $display_dir);
}

// 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']);
}
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>';
Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('DocumentsOverview'), '', ICON_SIZE_MEDIUM).'</a>';
echo '</div>';

///pixlr
// pixlr
// max size 1 Mb ??
$title = urlencode(utf8_encode(get_lang('NewImage')));//TODO:check
//
$image = api_get_path(WEB_IMG_PATH) . 'canvas1024x768.png';
$image = Display::returnIconPath('canvas1024x768.png');
//
$pixlr_code_translation_table = array('' => 'en', 'pt' => 'pt-Pt', 'sr' => 'sr_latn');
$langpixlr = api_get_language_isocode();
Expand All @@ -149,13 +158,13 @@
</cross-domain-policy>';//more open domain="*"
@file_put_contents($path_and_file, $crossdomain);
}
$credentials="true";
$credentials = "true";
} else {
$credentials="false";
$credentials = "false";
}
$pixlr_url = api_get_protocol().'://pixlr.com/editor/?title='.$title.'&image='.$image.'&loc='.$loc.'&referrer='.$referrer.'&target='.$target.'&exit='.$exit_path.'&locktarget='.$locktarget.'&locktitle='.$locktitle.'&credentials='.$credentials;
?>
<script type="text/javascript">
<script>

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>');
function resizeIframe() {
Expand All @@ -168,9 +177,7 @@ function resizeIframe() {
};
document.getElementById('frame').onload = resizeIframe;
window.onresize = resizeIframe;

</script>

<?php

echo '<noscript>';
Expand Down
18 changes: 9 additions & 9 deletions main/document/slideshow.php
Expand Up @@ -87,7 +87,8 @@ function MM_openBrWindow(theURL,winName,features) { //v2.0
if ($slide > 0) {
echo '<a href="slideshow.php?slide_id='.$previous_slide.'&curdirpath='.$pathurl.'">';
}
echo '<img src="'.api_get_path(WEB_IMG_PATH).$imgp.'" title="'.get_lang('Previous').'" alt="'.get_lang('Previous').'">';

echo Display::return_icon($imgp, get_lang('Previous'));
if ($slide > 0) {
echo '</a>';
}
Expand All @@ -101,12 +102,14 @@ function MM_openBrWindow(theURL,winName,features) { //v2.0
}
if ($slide == $total_slides - 1) {
$imgn = 'action_next_na.png';
$last = '<img src="'.api_get_path(WEB_IMG_PATH).'action_last_na.png" title="'.get_lang('LastSlide').'" alt="'.get_lang('LastSlide').'">';
$last = Display::return_icon('action_last_na.png', get_lang('LastSlide'));
} else {
$imgn = 'action_next.png';
$last = '<a href="slideshow.php?slide_id='.($total_slides-1).'&curdirpath='.$pathurl.'"><img src="'.api_get_path(WEB_IMG_PATH).'action_last.png" title="'.get_lang('LastSlide').'" alt="'.get_lang('LastSlide').'"></a>';
$last = '<a href="slideshow.php?slide_id='.($total_slides-1).'&curdirpath='.$pathurl.'">
'.Display::return_icon('action_last.png', get_lang('LastSlide')).'
</a>';
}
echo '<img src="'.api_get_path(WEB_IMG_PATH).$imgn.'" title="'.get_lang('Next').'" alt="'.get_lang('Next').'">';
echo Display::return_icon($imgn, get_lang('Next'));
if ($slide > 0) {
echo '</a>';
}
Expand All @@ -130,12 +133,9 @@ function MM_openBrWindow(theURL,winName,features) { //v2.0
}
// Slideshow options
echo '<a href="slideshowoptions.php?curdirpath='.$pathurl.'&'.api_get_cidreq().'">'.
Display::return_icon('settings.png',get_lang('SetSlideshowOptions'),'',ICON_SIZE_MEDIUM).'</a>';

?>
</div>
Display::return_icon('settings.png', get_lang('SetSlideshowOptions'),'',ICON_SIZE_MEDIUM).'</a>';

<?php
echo '</div>';
echo '<br />';

/* TREATING THE POST DATA FROM SLIDESHOW OPTIONS */
Expand Down
11 changes: 8 additions & 3 deletions main/inc/lib/course_home.lib.php
Expand Up @@ -119,7 +119,9 @@ public static function show_tool_3column($cat, $userId = null)
}
}

if (api_get_session_id() != 0 && in_array($tool['name'], array('course_maintenance', 'course_setting'))) {
if (api_get_session_id() != 0 &&
in_array($tool['name'], array('course_maintenance', 'course_setting'))
) {
continue;
}

Expand All @@ -143,10 +145,13 @@ public static function show_tool_3column($cat, $userId = null)
}

// Setting the actual image url
$tool['img'] = api_get_path(WEB_IMG_PATH).$tool['img'];
$tool['img'] = Display::returnIconPath($tool['img']);

// VISIBLE
if (($tool['visibility'] || ((api_is_coach() || api_is_course_tutor()) && $tool['name'] == TOOL_TRACKING)) || $cat == 'courseAdmin' || $cat == 'platformAdmin') {
if (($tool['visibility'] ||
((api_is_coach() || api_is_course_tutor()) && $tool['name'] == TOOL_TRACKING)) ||
$cat == 'courseAdmin' || $cat == 'platformAdmin'
) {
if (strpos($tool['name'], 'visio_') !== false) {
$cell_content .= '<a href="javascript: void(0);" onclick="javascript: window.open(\''.$tool['link'].$link_annex.'\',\'window_visio'.$_SESSION['_cid'].'\',config=\'height=\'+730+\', width=\'+1020+\', left=2, top=2, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no\')" target="'.$tool['target'].'"><img src="'.$tool['img'].'" title="'.$tool_name.'" alt="'.$tool_name.'" align="absmiddle" border="0">'.$tool_name.'</a>';
} elseif (strpos($tool['name'], 'chat') !== false && api_get_course_setting('allow_open_chat_window')) {
Expand Down
4 changes: 2 additions & 2 deletions main/inc/lib/display.lib.php
Expand Up @@ -698,7 +698,7 @@ public static function display_icon(

/**
* Gets the path of an icon
*
*
* @param string $icon
* @return string
*/
Expand Down Expand Up @@ -2203,7 +2203,7 @@ public static function toolbarAction($id, $content = array(), $col = 2, $right =
if ( $col == 2 && $i == 1 ) {
if ($right === true) {
$html .= '<div class="pull-right">';
$html .= (isset($content[$i])?$content[$i]:'');
$html .= (isset($content[$i]) ? $content[$i] : '');
$html .= '</div>';
} else {
$html .= $content[$i];
Expand Down

0 comments on commit b65d66a

Please sign in to comment.