[svn r17479] logic changes - improve make the user image clickable see FS#456

skala
Cristian Fasanando 17 years ago
parent b9cf6373c7
commit 85061309e7
  1. 81
      main/admin/user_add.php
  2. 12
      main/admin/user_edit.php
  3. 14
      main/auth/profile.php
  4. 15
      main/mySpace/myStudents.php
  5. 41
      main/user/userInfo.php
  6. 10
      whoisonline.php

@ -1,4 +1,4 @@
<?php // $Id: user_add.php 17362 2008-12-17 23:21:17Z cfasanando $
<?php // $Id: user_add.php 17479 2008-12-29 20:24:11Z cfasanando $
/*
==============================================================================
Dokeos - elearning and course management software
@ -316,14 +316,44 @@ if( $form->validate())
$picture_element = & $form->getElement('picture');
$picture = $picture_element->getValue();
$picture_uri = '';
// get the next id from a user
$sql = "SHOW TABLE STATUS FROM $database LIKE 'user'";
$result = api_sql_query($sql,__FILE__,__LINE__);
$array = Database::fetch_array($result);
$auto_increment = $array['Auto_increment'];
if (strlen($picture['name']) > 0 ) {
$picture_uri = uniqid('').'_'.replace_dangerous_char($picture['name']);
}
$lastname = $user['lastname'];
$firstname = $user['firstname'];
$official_code = $user['official_code'];
$email = $user['email'];
$phone = $user['phone'];
$username = $user['username'];
$status = intval($user['status']);
$picture = $_FILES['picture'];
$platform_admin = intval($user['admin']['platform_admin']);
$send_mail = intval($user['mail']['send_mail']);
$hr_dept_id = intval($user['hr_dept_id']);
if(count($extAuthSource) > 0 && $user['password']['password_auto'] == '2')
{
$auth_source = $user['password']['auth_source'];
$password = 'PLACEHOLDER';
}
else
{
$auth_source = PLATFORM_AUTH_SOURCE;
$password = $user['password']['password_auto'] == '1' ? api_generate_password() : $user['password']['password'];
}
if ($user['radio_expiration_date']=='1' )
{
$expiration_date=$user['expiration_date'];
}
else
{
$expiration_date='0000-00-00 00:00:00';
}
$active = intval($user['active']);
$user_id = UserManager::create_user($firstname,$lastname,$status,$email,$username,$password,$official_code,api_get_setting('platformLanguage'),$phone,$picture_uri,$auth_source,$expiration_date,$active, $hr_dept_id);
// picture path
$picture_path = api_get_path(SYS_CODE_PATH).'upload/users/'.$auto_increment.'/';
$picture_path = api_get_path(SYS_CODE_PATH).'upload/users/'.$user_id.'/';
if (strlen($picture['name']) > 0 ) {
if (!is_dir($picture_path)) {
@ -332,8 +362,7 @@ if( $form->validate())
$perm = octdec(!empty($perm)?$perm:'0770');
chmod($picture_path,$perm);
}
}
$picture_uri = uniqid('').'_'.replace_dangerous_char($picture['name']);
}
$picture_location = $picture_path.$picture_uri;
$big_picture_location = $picture_path.'big_'.$picture_uri;
@ -366,38 +395,6 @@ if( $form->validate())
}
}
$lastname = $user['lastname'];
$firstname = $user['firstname'];
$official_code = $user['official_code'];
$email = $user['email'];
$phone = $user['phone'];
$username = $user['username'];
$status = intval($user['status']);
$picture = $_FILES['picture'];
$platform_admin = intval($user['admin']['platform_admin']);
$send_mail = intval($user['mail']['send_mail']);
$hr_dept_id = intval($user['hr_dept_id']);
if(count($extAuthSource) > 0 && $user['password']['password_auto'] == '2')
{
$auth_source = $user['password']['auth_source'];
$password = 'PLACEHOLDER';
}
else
{
$auth_source = PLATFORM_AUTH_SOURCE;
$password = $user['password']['password_auto'] == '1' ? api_generate_password() : $user['password']['password'];
}
if ($user['radio_expiration_date']=='1' )
{
$expiration_date=$user['expiration_date'];
}
else
{
$expiration_date='0000-00-00 00:00:00';
}
$active = intval($user['active']);
$user_id = UserManager::create_user($firstname,$lastname,$status,$email,$username,$password,$official_code,api_get_setting('platformLanguage'),$phone,$picture_uri,$auth_source,$expiration_date,$active, $hr_dept_id);
$extras = array();
foreach($user as $key => $value)

@ -1,4 +1,4 @@
<?php // $Id: user_edit.php 17362 2008-12-17 23:21:17Z cfasanando $
<?php // $Id: user_edit.php 17479 2008-12-29 20:24:11Z cfasanando $
/*
==============================================================================
Dokeos - elearning and course management software
@ -58,8 +58,7 @@ function display_drh_list(){
function show_image(image,width,height) {
width = parseInt(width) + 20;
height = parseInt(height) + 20;
window_x = window.open(\'\',\'windowX\',\'width=\'+ width + \', height=\'+ height + \'\');
window_x.document.write("<img src=\'"+image+"?rand='.time().'\'/>");
window_x = window.open(image,\'windowX\',\'width=\'+ width + \', height=\'+ height + \'\');
}
//-->
</script>';
@ -468,8 +467,13 @@ $big_image = $image_dir.'big_'.$image;
$big_image_size = @getimagesize($big_image);
$big_image_width= $big_image_size[0];
$big_image_height= $big_image_size[1];
$url_big_image = $big_image.'?rnd='.time();
if ($image=='') {
echo '<img '.$img_attributes.' />';
} else {
echo '<input type="image" '.$img_attributes.' onclick="return show_image(\''.$url_big_image.'\',\''.$big_image_width.'\',\''.$big_image_height.'\');"/>';
}
echo '<input type="image" '.$img_attributes.' onclick="return show_image(\''.$big_image.'\',\''.$big_image_width.'\',\''.$big_image_height.'\');"/>';
// Display form
$form->display();

@ -1,4 +1,4 @@
<?php // $Id: profile.php 17471 2008-12-29 09:54:41Z yannoo $
<?php // $Id: profile.php 17479 2008-12-29 20:24:11Z cfasanando $
/*
==============================================================================
Dokeos - elearning and course management software
@ -60,8 +60,8 @@ function confirmation(name)
function show_image(image,width,height) {
width = parseInt(width) + 20;
height = parseInt(height) + 20;
window_x = window.open(\'\',\'windowX\',\'width=\'+ width + \', height=\'+ height + \'\');
window_x.document.write("<img src=\'"+image+"?rand='.time().'\'/>");
window_x = window.open(image,\'windowX\',\'width=\'+ width + \', height=\'+ height + \'\');
}
</script>';
@ -756,8 +756,14 @@ $big_image = $image_dir.'big_'.$image;
$big_image_size = @getimagesize($big_image);
$big_image_width= $big_image_size[0];
$big_image_height= $big_image_size[1];
$url_big_image = $big_image.'?rnd='.time();
if ($image=='unknown.jpg') {
echo '<img '.$img_attributes.' />';
} else {
echo '<input type="image" '.$img_attributes.' onclick="return show_image(\''.$url_big_image.'\',\''.$big_image_width.'\',\''.$big_image_height.'\');"/>';
}
echo '<input type="image" '.$img_attributes.' onclick="return show_image(\''.$big_image.'\',\''.$big_image_width.'\',\''.$big_image_height.'\');"/>';
$form->display();

@ -1,4 +1,4 @@
<?php //$Id: myStudents.php 17456 2008-12-24 20:34:06Z cfasanando $
<?php //$Id: myStudents.php 17479 2008-12-29 20:24:11Z cfasanando $
/* For licensing terms, see /dokeos_license.txt */
/**
* Implements the tracking of students in the Reporting pages
@ -21,8 +21,7 @@ $htmlHeadXtra[] = '<script type="text/javascript">
function show_image(image,width,height) {
width = parseInt(width) + 20;
height = parseInt(height) + 20;
window_x = window.open(\'\',\'windowX\',\'width=\'+ width + \', height=\'+ height + \'\');
window_x.document.write("<img src=\'"+image+"?rand='.time().'\'/>");
window_x = window.open(image,\'windowX\',\'width=\'+ width + \', height=\'+ height + \'\');
}
</script>';
@ -283,12 +282,16 @@ if(!empty($_GET['student']))
$big_image_size = @getimagesize($big_image);
$big_image_width= $big_image_size[0];
$big_image_height= $big_image_size[1];
$url_big_image = $big_image.'?rnd='.time();
$img_attributes = 'src="'.$image_file.'?rand='.time().'" '
.'alt="'.$a_infosUser['lastname'].' '.$a_infosUser['firstname'].'" '
.'style="float:'.($text_dir == 'rtl' ? 'left' : 'right').'; padding:5px;" ';
echo '<input type="image" '.$img_attributes.' onclick="return show_image(\''.$big_image.'\',\''.$big_image_width.'\',\''.$big_image_height.'\');"/>';
if ($image_array['file']=='unknown.jpg') {
echo '<img '.$img_attributes.' />';
} else {
echo '<input type="image" '.$img_attributes.' onclick="return show_image(\''.$url_big_image.'\',\''.$big_image_width.'\',\''.$big_image_height.'\');"/>';
}
echo '</td>';
?>

@ -1,4 +1,4 @@
<?php // $Id: userInfo.php 16965 2008-11-26 22:06:10Z herodoto $
<?php // $Id: userInfo.php 17479 2008-12-29 20:24:11Z cfasanando $
/*
==============================================================================
Dokeos - elearning and course management software
@ -49,6 +49,16 @@ include ("../inc/global.inc.php");
require_once (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php');
require_once (api_get_path(LIBRARY_PATH).'usermanager.lib.php');
$htmlHeadXtra[] = '<script type="text/javascript">
function show_image(image,width,height) {
width = parseInt(width) + 20;
height = parseInt(height) + 20;
window_x = window.open(image,\'windowX\',\'width=\'+ width + \', height=\'+ height + \'\');
}
</script>';
$editMainUserInfo = Security::remove_XSS($_REQUEST['editMainUserInfo']);
$uInfo = $editMainUserInfo;
$this_section = SECTION_COURSES;
@ -366,8 +376,19 @@ elseif ($displayMode == "viewMainInfoEdit")
($mainUserInfo['status'] == 1) ? $courseAdminChecked = "checked" : $courseAdminChecked = "";
($mainUserInfo['tutor_id'] == 1) ? $tutorChecked = "checked" : $tutorChecked = "";
$image_array=UserManager::get_user_picture_path_by_id($userIdViewed,'web',false,true);
echo '<img src="'.$image_array['dir'].$image_array['file'].'" border="1">';
$image_array=UserManager::get_user_picture_path_by_id($userIdViewed,'web',false,true);
// get the path,width and height from original picture
$big_image = $image_array['dir'].'big_'.$image_array['file'];
$big_image_size = @getimagesize($big_image);
$big_image_width= $big_image_size[0];
$big_image_height= $big_image_size[1];
$url_big_image = $big_image.'?rnd='.time();
if ($image_array['file']=='unknown.jpg') {
echo '<img src="'.$image_array['dir'].$image_array['file'].'" border="1">';
} else {
echo '<input type="image" src="'.$image_array['dir'].$image_array['file'].'" onclick="return show_image(\''.$url_big_image.'\',\''.$big_image_width.'\',\''.$big_image_height.'\');"/>';
}
//"<td>", get_lang('Tutor'), "</td>\n",
echo "<form action=\"".api_get_self()."\" method=\"post\">\n",
@ -429,8 +450,20 @@ elseif ($displayMode == "viewContentList") // default display
if ($mainUserInfo)
{
$image_array=UserManager::get_user_picture_path_by_id($userIdViewed,'web',false,true);
$image_array=UserManager::get_user_picture_path_by_id($userIdViewed,'web',false,true);
// get the path,width and height from original picture
$big_image = $image_array['dir'].'big_'.$image_array['file'];
$big_image_size = @getimagesize($big_image);
$big_image_width= $big_image_size[0];
$big_image_height= $big_image_size[1];
$url_big_image = $big_image.'?rnd='.time();
if ($image_array['file']=='unknown.jpg') {
echo '<img src="'.$image_array['dir'].$image_array['file'].'" border="1">';
} else {
echo '<input type="image" src="'.$image_array['dir'].$image_array['file'].'" onclick="return show_image(\''.$url_big_image.'\',\''.$big_image_width.'\',\''.$big_image_height.'\');"/>';
}
//DISPLAY TABLE HEADING
if ($origin == 'learnpath') { $allowedToEditDef=false; $is_allowedToTrack=false; }

@ -1,4 +1,4 @@
<?php // $Id: whoisonline.php 17362 2008-12-17 23:21:17Z cfasanando $
<?php // $Id: whoisonline.php 17479 2008-12-29 20:24:11Z cfasanando $
/*
==============================================================================
Dokeos - elearning and course management software
@ -45,8 +45,7 @@ $htmlHeadXtra[] = '<script type="text/javascript">
function show_image(image,width,height) {
width = parseInt(width) + 20;
height = parseInt(height) + 20;
window_x = window.open(\'\',\'windowX\',\'width=\'+ width + \', height=\'+ height + \'\');
window_x.document.write("<img src=\'"+image+"?rand='.time().'\'/>");
window_x = window.open(image,\'windowX\',\'width=\'+ width + \', height=\'+ height + \'\');
}
</script>';
@ -160,7 +159,10 @@ function display_individual_user($user_id)
$big_image_size = @getimagesize($big_image);
$big_image_width= $big_image_size[0];
$big_image_height= $big_image_size[1];
echo '<input type="image" src="'.$fullurl.'" alt="'.$alt.'" onclick="return show_image(\''.$big_image.'\',\''.$big_image_width.'\',\''.$big_image_height.'\');"/><br />';
$url_big_image = $big_image.'?rnd='.time();
echo '<input type="image" src="'.$fullurl.'" alt="'.$alt.'" onclick="return show_image(\''.$url_big_image.'\',\''.$big_image_width.'\',\''.$big_image_height.'\');"/><br />';
}
if (api_get_setting("show_email_addresses") == "true")
{

Loading…
Cancel
Save