@ -0,0 +1,13 @@ |
||||
<?php |
||||
// HTTP404 page with neat styling |
||||
// 2011, Jean-Karim Bockstael <jeankarim@cblue.be> |
||||
// ErrorDocument 404 /404/ |
||||
|
||||
$language_file = array('document', 'index'); |
||||
require_once('../main/inc/global.inc.php'); |
||||
|
||||
$msg = get_lang('FileNotFound'); |
||||
Display::display_header($msg); |
||||
Display::display_error_message($msg); |
||||
Display::display_footer(); |
||||
?> |
@ -0,0 +1,13 @@ |
||||
CustomPages looks for alternatives in this directory, and displays them if present. The user-provided custom pages must exactly be named as such : |
||||
|
||||
- index-logged.php for the general landing page before login |
||||
- index-unlogged.php for the general landing page when already logged-in |
||||
- registration.php for the registration form |
||||
- registration-feedback.php for the registration success feedback |
||||
- lostpassword.php for the password recovery form |
||||
- lostpassword-feedback.php for the password recovery feedback page |
||||
|
||||
Important note : |
||||
If you pull this feature from a repo, not through an upgrade or install process, you have to exectute the following SQL statements in the main database or this option won't appear in the admin interface : |
||||
INSERT INTO settings_options (variable, value, display_text) VALUES ('use_custom_pages', 'true', 'Yes'), ('use_custom_pages', 'false', 'No'); |
||||
INSERT INTO settings_current (variable, type, category, selected_value, title, comment, scope) VALUES ('use_custom_pages','radio','Platform','false','UseCustomPages','UseCustomPagesComment', 'platform'); |
@ -0,0 +1,91 @@ |
||||
<?php |
||||
require_once('language.php'); |
||||
require_once(dirname(__FILE__).'/../main/inc/global.inc.php'); |
||||
require_once (api_get_path(LIBRARY_PATH).'conditionallogin.lib.php'); |
||||
require_once (api_get_path(LIBRARY_PATH).'usermanager.lib.php'); |
||||
|
||||
if (! isset($_SESSION['conditional_login']['uid'])) |
||||
die("Not Authorised"); |
||||
|
||||
if (isset($_POST['password'])){ |
||||
$u = UserManager::get_user_info_by_id($_SESSION['conditional_login']['uid']); |
||||
if ($_POST['password'] != $_POST['password2']) { |
||||
header('Location: '. api_get_self().'?invalid=2'); |
||||
exit(); |
||||
} |
||||
if (empty($_POST['password'])){ //|| !api_check_password($password)) { //Pass must be at least 5 char long with 2 digits and 3 letters |
||||
header('Location: '. api_get_self().'?invalid=1'); |
||||
exit(); |
||||
} |
||||
$password = $_POST['password']; |
||||
$updated = UserManager::update_user($u['user_id'], $u['firstname'], $u['lastname'], $u['username'], $password, $u['auth_source'], $u['email'], $u['status'], $u['official_code'], $u['phone'], $u['picture_uri'], $u['expiration_date'], $u['active'], $u['creator_id'], $u['hr_dept_id'], null, $u['language'],''); |
||||
|
||||
if ($updated) { |
||||
UserManager::update_extra_field_value($u['user_id'], 'already_logged_in', 'true'); |
||||
ConditionalLogin::login(); |
||||
} |
||||
} |
||||
if ($_GET['invalid'] == 1) { |
||||
$error_message = get_lang('CurrentPasswordEmptyOrIncorrect'); |
||||
} |
||||
if ($_GET['invalid'] == 2) { |
||||
$error_message = get_lang('PassTwo'); |
||||
} |
||||
?> |
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
||||
<html> |
||||
<head> |
||||
<title>Custompage - login</title> |
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
||||
<!--[if !IE 6]><!--> |
||||
<link rel="stylesheet" type="text/css" href="/custompages/style.css" /> |
||||
<!--<![endif]--> |
||||
<!--[if IE 6]> |
||||
<link rel="stylesheet" type="text/css" href="/custompages/style-ie6.css" /> |
||||
<![endif]--> |
||||
|
||||
<script type="text/javascript" src="/custompages/jquery-1.5.1.min.js"></script> |
||||
<script type="text/javascript"> |
||||
$(document).ready(function() { |
||||
if (top.location != location) |
||||
top.location.href = document.location.href ; |
||||
|
||||
// Handler pour la touche retour |
||||
$('input').keyup(function(e) { |
||||
if (e.keyCode == 13) { |
||||
$('#changepassword-form').submit(); |
||||
} |
||||
}); |
||||
}); |
||||
</script> |
||||
</head> |
||||
<body> |
||||
<div id="backgroundimage"> |
||||
<img src="/custompages/images/page-background.png" class="backgroundimage" /> |
||||
</div> |
||||
<div id="wrapper"> |
||||
<div id="header"> |
||||
<img src="/custompages/images/header.png" alt="Logo" /> |
||||
</div> <!-- #header --> |
||||
<div id="changepassword-form-box" class="form-box"> |
||||
<?php if (isset($error_message)) { |
||||
echo '<div id="changepassword-form-error" class="form-error">'.$error_message.'</div>'; |
||||
}?> |
||||
<form id="changepassword-form" class="form" method="post"> |
||||
<div> |
||||
<label for="password">*<?php echo cblue_get_lang('langPass');?></label>
|
||||
<input name="password" type="password" /><br /> |
||||
<label for="password2">*<?php echo cblue_get_lang('langPass');?></label>
|
||||
<input name="password2" type="password" /><br /> |
||||
</div> |
||||
</form> |
||||
<div id="changepassword-form-submit" class="form-submit" onclick="document.forms['changepassword-form'].submit();"> |
||||
<span><?php echo cblue_get_lang('LoginEnter');?></span>
|
||||
</div> <!-- #form-submit --> |
||||
</div> <!-- #form --> |
||||
<div id="footer"> |
||||
<img src="/custompages/images/footer.png" /> |
||||
</div> <!-- #footer --> |
||||
</div> <!-- #wrapper --> |
||||
</body> |
||||
</html> |
After Width: | Height: | Size: 2.5 KiB |
After Width: | Height: | Size: 2.6 KiB |
After Width: | Height: | Size: 862 B |
After Width: | Height: | Size: 4.1 KiB |
@ -0,0 +1,6 @@ |
||||
<?php
|
||||
require_once('main/inc/global.inc.php'); |
||||
//require_once api_get_path(LIBRARY_PATH).'usermanager.lib.php'; |
||||
|
||||
header("Location: /user_portal.php"); |
||||
?> |
@ -0,0 +1,88 @@ |
||||
<?php
|
||||
//require_once('main/inc/global.inc.php'); |
||||
require_once('language.php'); |
||||
if (isset($_GET['loginFailed'])){ |
||||
if (isset($_GET['error'])) { |
||||
switch ($_GET['error']) { |
||||
case 'account_expired': |
||||
$error_message = cblue_get_lang('AccountExpired'); |
||||
break; |
||||
case 'account_inactive': |
||||
$error_message = cblue_get_lang('AccountInactive'); |
||||
break; |
||||
case 'user_password_incorrect': |
||||
$error_message = cblue_get_lang('InvalidId'); |
||||
break; |
||||
case 'access_url_inactive': |
||||
$error_message = cblue_get_lang('AccountURLInactive'); |
||||
break; |
||||
default : |
||||
$error_message = cblue_get_lang('InvalidId'); |
||||
} |
||||
} else { |
||||
$error_message = get_lang('InvalidId'); |
||||
} |
||||
} |
||||
?> |
||||
<html> |
||||
<head> |
||||
<title>Custompage - login</title> |
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
||||
<!--[if !IE 6]><!--> |
||||
<link rel="stylesheet" type="text/css" href="/custompages/style.css" /> |
||||
<!--<![endif]--> |
||||
<!--[if IE 6]> |
||||
<link rel="stylesheet" type="text/css" href="/custompages/style-ie6.css" /> |
||||
<![endif]--> |
||||
|
||||
<script type="text/javascript" src="/custompages/jquery-1.5.1.min.js"></script> |
||||
<script type="text/javascript"> |
||||
$(document).ready(function() { |
||||
if (top.location != location) |
||||
top.location.href = document.location.href ; |
||||
|
||||
// Handler pour la touche retour |
||||
$('input').keyup(function(e) { |
||||
if (e.keyCode == 13) { |
||||
$('#login-form').submit(); |
||||
} |
||||
}); |
||||
}); |
||||
</script> |
||||
</head> |
||||
<body> |
||||
<div id="backgroundimage"> |
||||
<img src="/custompages/images/page-background.png" class="backgroundimage" /> |
||||
</div> |
||||
<div id="wrapper"> |
||||
<div id="header"> |
||||
<img src="/custompages/images/header.png" alt="Logo" /> |
||||
</div> <!-- #header --> |
||||
<div id="login-form-box" class="form-box"> |
||||
<?php if ($values['reset_password']) { |
||||
echo '<div id="login-form-info" class="form-info">'.cblue_get_lang('your_password_has_been_reset').'</div>'; |
||||
}?> |
||||
<?php if (isset($error_message)) { |
||||
echo '<div id="login-form-info" class="form-error">'.$error_message.'</div>'; |
||||
}?> |
||||
<form id="login-form" class="form" action="/index.php" method="post"> |
||||
<div> |
||||
<label for="login">*<?php echo cblue_get_lang('Username');?></label>
|
||||
<input name="login" type="text" /><br /> |
||||
<label for="password">*<?php echo cblue_get_lang('langPass');?></label>
|
||||
<input name="password" type="password" /><br /> |
||||
</div> |
||||
</form> |
||||
<div id="login-form-submit" class="form-submit" onclick="document.forms['login-form'].submit();"> |
||||
<span><?php echo cblue_get_lang('LoginEnter');?></span>
|
||||
</div> <!-- #form-submit --> |
||||
<div id="links"> |
||||
<a href="main/auth/lostPassword.php"><?php echo cblue_get_lang('langLostPassword')?></a>
|
||||
</div> |
||||
</div> <!-- #form --> |
||||
<div id="footer"> |
||||
<img src="/custompages/images/footer.png" /> |
||||
</div> <!-- #footer --> |
||||
</div> <!-- #wrapper --> |
||||
</body> |
||||
</html> |
@ -0,0 +1,73 @@ |
||||
<?php |
||||
// CustomPages : Browser language detection |
||||
// Include this file in your custom page if you want to set the language variable of the Chamilo session to the best pick according to the visitor's browser's options. |
||||
// 2011, Jean-Karim Bockstael, CBlue <jeankarim@cblue.be> |
||||
|
||||
// This requires the Chamilo system to be initialized |
||||
// (note that it's easier to do the following include in the parent page) |
||||
// require_once('path/to/main/inc/global.inc.php'); |
||||
|
||||
// Returns the best match between available languages and visitor preferences |
||||
// return the best match as 2-chars code, null when none match |
||||
function get_preferred_language($available_langs) { |
||||
// Parsing the Accept-languages HTTP header |
||||
$langs = array(); |
||||
foreach (explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']) as $httplang) { |
||||
$rawlang = explode(';q=', $httplang); |
||||
if (strpos($rawlang[0], '-') !== FALSE) { |
||||
// We ignore the locale part, as in en-GB vs en-US |
||||
$rawlang[0] = substr($rawlang[0], 0, strpos($rawlang[0], '-')); |
||||
} |
||||
if (count($rawlang) == 1) { |
||||
$rawlang[1] = 1.0; // The absence of weighting means a weight of 1 (max) |
||||
} |
||||
$langs[$rawlang[1]][] = $rawlang[0]; |
||||
} |
||||
krsort($langs, SORT_NUMERIC); |
||||
// Choosing the best match |
||||
foreach($langs as $weight => $codes) { |
||||
foreach ($codes as $code) { |
||||
if (in_array($code, $available_langs)) { |
||||
return $code; |
||||
} |
||||
} |
||||
} |
||||
// No match |
||||
return null; |
||||
} |
||||
|
||||
// Wrapper function for the get_lang function |
||||
// use this if you want to avoid translation caching issues |
||||
function cp_get_lang($variable) { |
||||
return get_lang($variable, null, $_SESSION['user_language_choice']); |
||||
} |
||||
|
||||
// Note that Chamilo languages are expressed as full english names, not 2-characters codes |
||||
// e.g. 'english' instead of 'en', 'french' instead of 'fr', ... |
||||
// We need a matching array. Note the value for the null key, which is the default language. |
||||
// Also note that this is an example matchin array, not all languages are present. |
||||
$chamilo_langs = array(null => 'english', 'en' => 'english', 'fr' => 'french', 'es' => 'spanish'); |
||||
|
||||
// Which of these can we actually pick from ? |
||||
$available_langs = array('en','fr'); |
||||
|
||||
// Which language files will we need ? |
||||
$language_file = array('courses', 'index', 'registration', 'admin','userInfo'); |
||||
|
||||
// Let's find out which language to serve to this particular browser |
||||
$lang_match = $chamilo_langs[get_preferred_language($available_langs)]; |
||||
|
||||
// Chamilo overrides this parameters at some places, e.g. in the logout link |
||||
if (isset($_REQUEST['language']) && !empty($_REQUEST['language']) && in_array($_REQUEST['language'], $chamilo_langs)) { |
||||
$lang_match = $_REQUEST['language']; |
||||
} |
||||
|
||||
// Maybe a language had already been selected, we should honor this |
||||
if (isset($_SESSION['user_language_choice']) && in_array($_SESSION['user_language_choice'], $chamilo_langs)) { |
||||
$lang_match = $_SESSION['user_language_choice']; |
||||
} |
||||
|
||||
// We need to set the relevant session variables to the best match, to use Chamilo's i18n lib. |
||||
$_user['language'] = $lang_match; |
||||
$_SESSION['user_language_choice'] = $lang_match; |
||||
?> |
@ -0,0 +1,45 @@ |
||||
<?php |
||||
function get_preferred_language($available_langs) { |
||||
$langs = array(); |
||||
foreach (explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']) as $httplang) { |
||||
$rawlang = explode(';q=', $httplang); |
||||
if (strpos($rawlang[0], '-') !== FALSE) { |
||||
$rawlang[0] = substr($rawlang[0], 0, strpos($rawlang[0], '-')); |
||||
} |
||||
if (count($rawlang) == 1) { |
||||
$rawlang[1] = 1.0; |
||||
} |
||||
$langs[$rawlang[1]] = $rawlang[0]; |
||||
} |
||||
krsort($langs, SORT_NUMERIC); |
||||
foreach($langs as $weight => $code) { |
||||
if (in_array($code, $available_langs)) { |
||||
return $code; |
||||
} |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
function cblue_get_lang($variable) { |
||||
return get_lang($variable, null, $_SESSION['user_language_choice']); |
||||
} |
||||
|
||||
$language_file = array('courses', 'index', 'registration', 'admin','userInfo'); |
||||
$available_langs = array('en','fr'); |
||||
$chamilo_langs = array(null => 'english', 'en' => 'english', 'fr' => 'french', 'nl' => 'dutch', 'de' => 'german', 'es' => 'spanish'); |
||||
$lang_match = $chamilo_langs[get_preferred_language($available_langs)]; |
||||
// recover previous value ... |
||||
if (isset($_SESSION['user_language_choice'])) |
||||
$lang_match = $_SESSION['user_language_choice']; |
||||
|
||||
// Chamilo parameter, on logout |
||||
if (isset($_REQUEST['language']) && !empty($_REQUEST['language']) && in_array($_REQUEST['language'], $chamilo_langs)) { |
||||
$lang_match = $_REQUEST['language']; |
||||
} |
||||
// Incoming link parameter |
||||
if (isset($_REQUEST['lang']) && !empty($_REQUEST['lang']) && in_array($_REQUEST['lang'], $available_langs)) { |
||||
$lang_match = $chamilo_langs[$_REQUEST['lang']]; |
||||
} |
||||
$_user['language'] = $lang_match; |
||||
$_SESSION['user_language_choice'] = $lang_match; |
||||
?> |
@ -0,0 +1,57 @@ |
||||
<?php |
||||
require_once('../../main/inc/global.inc.php'); |
||||
require_once('language.php'); |
||||
?> |
||||
<html> |
||||
<head> |
||||
<title>Password recovery</title> |
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
||||
<!--[if !IE 6]><!--> |
||||
<link rel="stylesheet" type="text/css" href="../../custompages/style.css" /> |
||||
<!--<![endif]--> |
||||
<!--[if IE 6]> |
||||
<link rel="stylesheet" type="text/css" href="../../custompages/style-ie6.css" /> |
||||
<![endif]--> |
||||
<script type="text/javascript" src="../../custompages/jquery-1.5.1.min.js"></script> |
||||
<script type="text/javascript"> |
||||
$(document).ready(function() { |
||||
// Handler pour la touche retour |
||||
$('input').keyup(function(e) { |
||||
if (e.keyCode == 13) { |
||||
$('#lostpassword-form').submit(); |
||||
} |
||||
}); |
||||
}); |
||||
</script> |
||||
</head> |
||||
<body> |
||||
<div id="backgroundimage"> |
||||
<img src="/custompages/images/page-background.png" class="backgroundimage" /> |
||||
</div> |
||||
<div id="wrapper"> |
||||
<div id="header"> |
||||
<img src="../../custompages/images/header.png" alt="Ambassador logo" /> |
||||
</div> <!-- #header --> |
||||
<?php echo '<div id="registration-form-info" class="form-info">'.cblue_get_lang('lang_enter_email_and_well_send_you_password').'</div>'; ?> |
||||
<div id="lostpassword-form-box" class="form-box"> |
||||
<?php if (isset($form_error) && !empty($form_error)) { |
||||
echo '<div id="registration-form-error" class="form-error"><ul>'.$form_error.'</ul></div>'; |
||||
}?> |
||||
<form id="lostpassword-form" class="form" action="lostPassword.php" method="post"> |
||||
<div> |
||||
<label for="user">*<?php echo cblue_get_lang('UserName');?></label>
|
||||
<input name="user" type="text" /><br /> |
||||
<label for="email">*<?php echo cblue_get_lang('Email');?></label>
|
||||
<input name="email" type="text" /><br /> |
||||
</div> |
||||
</form> |
||||
<div id="lostpassword-form-submit" class="form-submit" onclick="document.forms['lostpassword-form'].submit();"> |
||||
<span><?php echo cblue_get_lang('langSend'); ?> </span>
|
||||
</div> <!-- #form-submit --> |
||||
</div> <!-- #form --> |
||||
<div id="footer"> |
||||
<img src="../../custompages/images/footer.png" /> |
||||
</div> <!-- #footer --> |
||||
</div> <!-- #wrapper --> |
||||
</body> |
||||
</html> |
@ -0,0 +1,3 @@ |
||||
<?php require_once('../inc/global.inc.php'); |
||||
header("Location: /user_portal.php"); |
||||
exit(); |
@ -0,0 +1,61 @@ |
||||
<?php
|
||||
require_once('../inc/global.inc.php'); |
||||
require_once('../inc/lib/group_portal_manager.lib.php'); |
||||
require_once('language.php'); |
||||
?> |
||||
<html> |
||||
<head> |
||||
<title>Registration</title> |
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
||||
<!--[if !IE 6]><!--> |
||||
<link rel="stylesheet" type="text/css" href="../../custompages/style.css" /> |
||||
<!--<![endif]--> |
||||
<!--[if IE 6]> |
||||
<link rel="stylesheet" type="text/css" href="../../custompages/style-ie6.css" /> |
||||
<![endif]--> |
||||
<script type="text/javascript" src="../../custompages/jquery-1.5.1.min.js"></script> |
||||
</head> |
||||
<body> |
||||
<div id="backgroundimage"> |
||||
<img src="/custompages/images/page-background.png" class="backgroundimage" /> |
||||
</div> |
||||
<div id="wrapper"> |
||||
<div id="header"> |
||||
<img src="../../custompages/images/header.png" alt="Ambassador logo" /> |
||||
</div> <!-- #header --> |
||||
<div id="registration-form-box" class="form-box"> |
||||
<?php if (isset($form_error) && !empty($form_error)) { |
||||
echo '<div id="registration-form-error" class="form-error"><ul>'.$form_error.'</ul></div>'; |
||||
}?> |
||||
<form id="registration-form" class="form" action="inscription.php" method="post"> |
||||
<div> |
||||
<label for="email"><?php echo cblue_get_lang('langEmail');?>*</label>
|
||||
<input name="email" type="text" value="<?php echo $values['email']?>" /><br />
|
||||
<label for="username"><?php echo cblue_get_lang('Username');?>*</label>
|
||||
<input name="username" type="text" value="<?php echo $values['username']?>" /><br />
|
||||
<p class="forminfo"><?php echo cblue_get_lang('UsernameWrong')?></p>
|
||||
<label for="pass1"><?php echo cblue_get_lang('Pass');?>*</label>
|
||||
<input name="pass1" type="password" value="<?php echo $values['pass1']?>" /><br />
|
||||
<label for="pass2"><?php echo cblue_get_lang('Confirmation');?>*</label>
|
||||
<input name="pass2" type="password" value="<?php echo $values['pass2']?>" /><br />
|
||||
<!-- |
||||
<label for="phone">*Phone number</label> |
||||
<input name="phone" type="text" /><br /> |
||||
--> |
||||
<input name="language" type="hidden" value="<?php echo $_SESSION['user_language_choice']?>" />
|
||||
<input name="status" type="hidden" value="5" /> <!-- learner --> |
||||
</div> |
||||
</form> |
||||
<div id="registration-form-submit" class="form-submit" onclick="document.forms['registration-form'].submit();"> |
||||
<span><?php echo cblue_get_lang('Subscribe');?></span>
|
||||
</div> <!-- #form-submit --> |
||||
<div id="links"> |
||||
<!--<a href="mailto: support@cblue.be"><?php echo cblue_get_lang('NeedContactAdmin')?></a><br />-->
|
||||
</div> |
||||
</div> <!-- #form --> |
||||
<div id="footer"> |
||||
<img src="../../custompages/images/footer.png" /> |
||||
</div> <!-- #footer --> |
||||
</div> <!-- #wrapper --> |
||||
</body> |
||||
</html> |
@ -0,0 +1,168 @@ |
||||
html, body { |
||||
margin: 0; |
||||
padding: 0; |
||||
} |
||||
|
||||
body { |
||||
font-family: "Arial Black",sans-serif; |
||||
font-size: 10pt; |
||||
width: 100%; |
||||
text-align: center; |
||||
/* |
||||
background-image: url(images/page-background.png); |
||||
background-repeat: no-repeat; |
||||
background-size: 100%; |
||||
*/ |
||||
} |
||||
|
||||
#backgroundimage { |
||||
background-attachment:fixed; |
||||
width: 100% |
||||
height: 100% |
||||
position: absolute; |
||||
left: 0; |
||||
top: 30px; |
||||
z-index:-1; |
||||
} |
||||
|
||||
.backgroundimage { |
||||
width: 100%; |
||||
height: auto; |
||||
} |
||||
|
||||
#wrapper { |
||||
position: absolute; |
||||
top: 0; |
||||
left: 0; |
||||
width: 100%; |
||||
z-index: 1; |
||||
text-align: center; |
||||
} |
||||
|
||||
#header { |
||||
width: 520px; |
||||
margin-left: auto; |
||||
margin-right: auto; |
||||
margin-top: 30px; |
||||
} |
||||
|
||||
#footer { |
||||
position: relative; |
||||
/*margin-top: 50px;*/ |
||||
text-align: center; |
||||
} |
||||
|
||||
.form-box { |
||||
width: 310px; |
||||
margin-left: auto; |
||||
margin-right: auto; |
||||
margin-top: 50px; |
||||
border: solid 1px #CCCCCC; |
||||
text-align: left; |
||||
/*background-color: white;*/ |
||||
} |
||||
|
||||
.form { |
||||
margin-left: 15px; |
||||
margin-right: 15px; |
||||
margin-top: 30px; |
||||
color: #1F3660; |
||||
/*position: relative;*/ |
||||
text-align: left; |
||||
} |
||||
|
||||
.form-submit { |
||||
margin: 0; |
||||
padding: 0; |
||||
width: 310px; |
||||
height: 27px; |
||||
background-color: #1F3660; |
||||
background-image: url(/custompages/images/login-form-submit-bg.jpg); |
||||
color: white; |
||||
cursor: pointer; |
||||
cursor: hand; |
||||
} |
||||
|
||||
label { |
||||
width: 100px; |
||||
float: left; |
||||
margin-right: 1em; |
||||
display: block; |
||||
text-align: right; |
||||
line-height: 2ex; |
||||
} |
||||
|
||||
input { |
||||
text-align: left; |
||||
vertical-align: baseline; |
||||
margin-bottom: 2em; |
||||
width: 150px; |
||||
color: white; |
||||
background-color: #1F3660; |
||||
border: none; |
||||
} |
||||
|
||||
.radiobutton { |
||||
width: 20px; |
||||
background-color: white; |
||||
margin: 0; |
||||
} |
||||
|
||||
.radiogroup { |
||||
margin-bottom: 2em; |
||||
} |
||||
|
||||
select { |
||||
margin-bottom: 2em; |
||||
width: 150px; |
||||
} |
||||
|
||||
label { |
||||
clear: both; |
||||
} |
||||
|
||||
input, select, .radiogroup { |
||||
float: right; |
||||
clear: both; |
||||
} |
||||
|
||||
.radiogroup input, .radiogroup label { |
||||
float: none; |
||||
} |
||||
|
||||
|
||||
#links { |
||||
margin-left: 15px; |
||||
margin-right: 15px; |
||||
margin-top: 10px; |
||||
margin-bottom: 50px; |
||||
color: #1F3660; |
||||
} |
||||
|
||||
#links a, #links a:hover, #links a:active, #links a:visited { |
||||
color: #1F3660; |
||||
} |
||||
|
||||
#links a { |
||||
text-decoration: none; |
||||
} |
||||
|
||||
#links a:hover { |
||||
text-decoration: underline; |
||||
} |
||||
|
||||
span { |
||||
margin-right: 30px; |
||||
margin-top: 3px; |
||||
float: right; |
||||
} |
||||
|
||||
.form-info { |
||||
color: #1F3660; |
||||
font-size: 9pt; |
||||
} |
||||
|
||||
.form-error { |
||||
color: red; |
||||
font-size: 9pt; |
||||
} |
@ -0,0 +1,143 @@ |
||||
html, body { |
||||
margin: 0; |
||||
padding: 0; |
||||
} |
||||
|
||||
body { |
||||
font-family: "Arial Black",sans-serif; |
||||
font-size: 10pt; |
||||
width: 100%; |
||||
text-align: center; |
||||
/*background-image: url(images/page-background.png); |
||||
background-repeat: no-repeat; |
||||
background-size: 100%; |
||||
*/ |
||||
} |
||||
|
||||
#backgroundimage { |
||||
background-attachment:fixed; |
||||
width: 100% |
||||
height: 100% |
||||
position: absolute; |
||||
left: 0; |
||||
top: 30px; |
||||
z-index:-1; |
||||
} |
||||
|
||||
.backgroundimage { |
||||
width: 100%; |
||||
height: auto; |
||||
} |
||||
|
||||
#wrapper { |
||||
position: absolute; |
||||
top: 0; |
||||
left: 0; |
||||
width: 100%; |
||||
z-index: 1; |
||||
} |
||||
|
||||
#header { |
||||
width: 520px; |
||||
margin-left: auto; |
||||
margin-right: auto; |
||||
margin-top: 30px; |
||||
} |
||||
|
||||
#footer { |
||||
position: relative; |
||||
margin-top: 50px; |
||||
text-align: center; |
||||
} |
||||
|
||||
.form-box { |
||||
width: 310px; |
||||
margin-left: auto; |
||||
margin-right: auto; |
||||
margin-top: 50px; |
||||
border: solid 1px #CCCCCC; |
||||
text-align: left; |
||||
background-color: white; |
||||
} |
||||
|
||||
.form { |
||||
margin-left: 15px; |
||||
margin-right: 15px; |
||||
margin-top: 30px; |
||||
color: #1F3660; |
||||
position: relative; |
||||
text-align: left; |
||||
} |
||||
|
||||
.form-submit { |
||||
margin: 0; |
||||
padding: 0; |
||||
width: 310px; |
||||
height: 27px; |
||||
background-color: #1F3660; |
||||
background-image: url(/custompages/images/login-form-submit-bg.jpg); |
||||
color: white; |
||||
cursor: pointer; |
||||
cursor: hand; |
||||
} |
||||
|
||||
label { |
||||
width: 100px; |
||||
float: left; |
||||
margin-right: 1em; |
||||
display: block; |
||||
text-align: right; |
||||
line-height: 2ex; |
||||
} |
||||
|
||||
input { |
||||
text-align: left; |
||||
vertical-align: baseline; |
||||
margin-bottom: 2em; |
||||
width: 150px; |
||||
color: white; |
||||
background-color: #1F3660; |
||||
border: none; |
||||
} |
||||
|
||||
select { |
||||
width: 150px; |
||||
color: white; |
||||
background-color: #1F3660; |
||||
border: none; |
||||
margin-bottom: 2em; |
||||
} |
||||
#links { |
||||
margin-left: 15px; |
||||
margin-right: 15px; |
||||
margin-top: 10px; |
||||
margin-bottom: 50px; |
||||
color: #1F3660; |
||||
} |
||||
|
||||
#links a, #links a:hover, #links a:active, #links a:visited { |
||||
color: #1F3660; |
||||
} |
||||
|
||||
#links a { |
||||
text-decoration: none; |
||||
} |
||||
|
||||
#links a:hover { |
||||
text-decoration: underline; |
||||
} |
||||
|
||||
span { |
||||
margin-right: 30px; |
||||
margin-top: 3px; |
||||
float: right; |
||||
} |
||||
|
||||
.form-info { |
||||
color: #1F3660; |
||||
font-size: 9pt; |
||||
} |
||||
.form-error { |
||||
color: red; |
||||
font-size: 9pt; |
||||
} |
@ -0,0 +1,5 @@ |
||||
Custom Pages : URL Images |
||||
|
||||
This features allows each access URL to have a number of images (currently three) specific to this URL. This allows easier customization of landing pages by access URL. |
||||
|
||||
You can access a URL's images by calling the static function CustomPages::getURLImages() in your custom page. |
@ -0,0 +1,246 @@ |
||||
<?php |
||||
|
||||
// name of the language file that needs to be included |
||||
$language_file = array('admin','events'); |
||||
$cidReset = true; |
||||
require_once '../inc/global.inc.php'; |
||||
$this_section = SECTION_PLATFORM_ADMIN; |
||||
api_protect_admin_script(); |
||||
|
||||
$interbreadcrumb[] = array ('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); |
||||
$tool_name = get_lang('events_title'); |
||||
|
||||
$action = isset($_POST['action'])?$_POST['action']:null; |
||||
$eventId = isset($_POST['eventId'])?$_POST['eventId']:null; |
||||
$eventUsers = isset($_POST['eventUsers'])?$_POST['eventUsers']:null; |
||||
$eventMessage = isset($_POST['eventMessage'])?$_POST['eventMessage']:null; |
||||
$eventSubject = isset($_POST['eventSubject'])?$_POST['eventSubject']:null; |
||||
|
||||
if($action == 'modEventType') { |
||||
if($eventUsers) { |
||||
$users = explode(';',$eventUsers); |
||||
} |
||||
else { |
||||
$users = array(); |
||||
} |
||||
|
||||
eventType_mod($eventId,$users,$eventMessage,$eventSubject); |
||||
// echo mysql_error(); |
||||
header('location: event_type.php'); |
||||
exit; |
||||
} |
||||
|
||||
$ets = eventType_getAll(); |
||||
|
||||
|
||||
$ajaxPath = api_get_path(WEB_CODE_PATH).'inc/ajax/events.ajax.php'; |
||||
$htmlHeadXtra[] = '<script src="../inc/lib/javascript/jquery.js" type="text/javascript" language="javascript"></script>'; |
||||
|
||||
Display::display_header($tool_name); |
||||
|
||||
?> |
||||
|
||||
<script language="javascript"> |
||||
var usersList; |
||||
var eventTypes = <?php print json_encode($ets) ?>;
|
||||
|
||||
$(document).ready(function(){ |
||||
ajax({action:"getUsers"},function(data) { |
||||
usersList = data; |
||||
} |
||||
); |
||||
|
||||
// ajax({action:"getEventTypes"},function(data) { |
||||
// eventTypes = data; |
||||
// showEventTypes(data); |
||||
// } |
||||
// ); |
||||
}); |
||||
|
||||
function ajax(params,func) { |
||||
$.ajax({ |
||||
url: "<?php echo $ajaxPath ?>",
|
||||
type: "POST", |
||||
data: params, |
||||
success: func |
||||
} |
||||
); |
||||
} |
||||
|
||||
function refreshUsersList() { |
||||
removeAllOption($('#usersList')); |
||||
$.each(usersList,function(ind,item) { |
||||
addOption($('#usersList'),item.user_id,item.firstname + ' '+item.lastname); |
||||
} |
||||
); |
||||
} |
||||
|
||||
// function showEventTypes(data) { |
||||
// $.each(data,function(ind,item) { |
||||
// addOption($('#eventList'),item.id,item.name); |
||||
// } |
||||
// ); |
||||
// } |
||||
|
||||
function getCurrentEventTypeInd() { |
||||
var ind=false; |
||||
$.each(eventTypes,function(i,item) |
||||
{ |
||||
if(item.id == $('#eventList option:selected').first().attr('value')) { |
||||
ind=i; |
||||
return false; |
||||
} |
||||
} |
||||
) |
||||
|
||||
return ind; |
||||
} |
||||
|
||||
function showEventType() { |
||||
eInd = getCurrentEventTypeInd(); |
||||
|
||||
$('#eventId').attr('value',eventTypes[eInd].id); |
||||
$('#eventName').attr('value',eventTypes[eInd].name); |
||||
$('#eventNameTitle').text(eventTypes[eInd].nameLangVar); |
||||
$('#eventMessage').text(eventTypes[eInd].message); |
||||
$('#eventSubject').attr('value',eventTypes[eInd].subject); |
||||
$('#descLangVar').text(eventTypes[eInd].descLangVar); |
||||
|
||||
ajax({action:"getEventTypeUsers","id":eventTypes[eInd].id},function(data) { |
||||
removeAllOption($('#usersSubList')); |
||||
|
||||
refreshUsersList(); |
||||
|
||||
usersIds = new Array(); |
||||
|
||||
$.each(data,function(ind,item) { |
||||
addOption($('#usersSubList'),item.user_id,item.firstname + ' '+item.lastname); |
||||
usersIds[ind] = item.value; |
||||
removeOption($('#usersList'),item.user_id); |
||||
}); |
||||
|
||||
$('#eventUsers').attr('value',usersIds.join(';')); |
||||
} |
||||
); |
||||
} |
||||
|
||||
function submitForm() { |
||||
if($('#eventId')) { |
||||
usersIds = new Array(); |
||||
|
||||
$('#usersSubList option').each(function(ind,item) |
||||
{ |
||||
usersIds[ind] = item.value; |
||||
} |
||||
); |
||||
|
||||
$('#eventUsers').attr('value',usersIds.join(';')); |
||||
|
||||
return true; |
||||
} |
||||
|
||||
return false; |
||||
} |
||||
|
||||
function addOption(select,value,text) { |
||||
select.append('<option value="'+value+'">'+text+'</option>'); |
||||
} |
||||
|
||||
function removeOption(select,value) { |
||||
select.find('option[value='+value+']').remove(); |
||||
} |
||||
|
||||
function removeAllOption(select) { |
||||
select.find('option').remove(); |
||||
} |
||||
|
||||
function moveUsers(src,dest) { |
||||
src.find('option:selected').each(function(index,opt) { |
||||
text = opt.text; |
||||
val = opt.value; |
||||
|
||||
addOption(dest,val,text); |
||||
removeOption(src,val); |
||||
}); |
||||
} |
||||
</script> |
||||
|
||||
<h3><?php print get_lang('events_title') ?></h3>
|
||||
|
||||
<table id="" width="90%"> |
||||
<tr> |
||||
<td width="5%"> |
||||
<h4><?php print get_lang('events_listTitle'); ?></h4>
|
||||
</td> |
||||
<td width="5%"> |
||||
<h4><?php print get_lang('events_userListTile'); ?></h4>
|
||||
</td> |
||||
<td width="5%"> |
||||
|
||||
</td> |
||||
<td width="5%"> |
||||
<h4><?php print get_lang('events_userSubListTile'); ?></h4>
|
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<td> |
||||
<select multiple="1" id="eventList" onChange="showEventType()"> |
||||
<?php |
||||
|
||||
foreach($ets as $et) { |
||||
print '<option value="'.$et['id'].'">'.$et['nameLangVar'].'</option>'; |
||||
} |
||||
|
||||
?> |
||||
</select> |
||||
</td> |
||||
<td> |
||||
<select multiple="1" id="usersList"></select> |
||||
</td> |
||||
<td valign="middle"> |
||||
<button class="arrowr" onclick='moveUsers($("#usersList"),$("#usersSubList")); return false;'></button> |
||||
<br /> |
||||
<button class="arrowl" onclick='moveUsers($("#usersSubList"),$("#usersList")); return false;'></button> |
||||
</td> |
||||
<td> |
||||
<select multiple="1" id="usersSubList"></select> |
||||
</td> |
||||
</tr> |
||||
</table> |
||||
|
||||
<br /> |
||||
|
||||
<h2 id="eventNameTitle"></h2> |
||||
|
||||
<form method="POST" onSubmit="return submitForm(); "> |
||||
<input type="hidden" name="action" value="modEventType" /> |
||||
<input type="hidden" name="eventId" id="eventId" /> |
||||
<input type="hidden" name="eventUsers" id="eventUsers" /> |
||||
<input type="hidden" id="eventName" /> |
||||
|
||||
<br /> |
||||
|
||||
<div id="descLangVar"> |
||||
</div> |
||||
<br /> |
||||
|
||||
<label for="eventSubject"><h4><?php print get_lang('events_labelSubject'); ?></h4></label>
|
||||
<input type="text" id="eventSubject" name="eventSubject" /> |
||||
<br /><br /> |
||||
<label for="eventMessage"><h4><?php print get_lang('events_labelMessage'); ?></h4></label>
|
||||
<textarea cols="100" rows="10" name="eventMessage" id="eventMessage"> |
||||
|
||||
</textarea> |
||||
|
||||
<br /><br /> |
||||
|
||||
<input type="submit" value="<?php print get_lang('events_btnMod'); ?>" />
|
||||
|
||||
</form> |
||||
|
||||
|
||||
<?php |
||||
|
||||
Display :: display_footer(); |
||||
|
||||
?> |
@ -0,0 +1,105 @@ |
||||
<?php |
||||
/*Written by Noel Dieschburg <noel@cblue.be> for the paris5 university |
||||
|
||||
* Checks if the user is already logged in via the cas system |
||||
* Gets all the info via the ldap module (ldap has to work) |
||||
|
||||
*/ |
||||
require_once(api_get_path(SYS_PATH).'main/auth/cas/cas_var.inc.php'); |
||||
require_once(api_get_path(SYS_PATH).'main/auth/ldap/authldap.php'); |
||||
|
||||
/** |
||||
* checks if the user already get a session |
||||
* @return the user login if the user already has a session ,false otherwise |
||||
**/ |
||||
|
||||
|
||||
function cas_is_authenticated() |
||||
{ |
||||
global $cas_auth_ver, $cas_auth_server, $cas_auth_port, $cas_auth_uri; |
||||
global $PHPCAS_CLIENT; |
||||
global $logout; |
||||
|
||||
|
||||
if (!is_object($PHPCAS_CLIENT) ) |
||||
{ |
||||
phpCAS::client($cas_auth_ver,$cas_auth_server,$cas_auth_port,$cas_auth_uri); |
||||
// die("phpCAS::client($cas_auth_ver,$cas_auth_server,$cas_auth_port,$cas_auth_uri);"); |
||||
phpCAS::setNoCasServerValidation(); |
||||
} |
||||
$auth = phpCAS::checkAuthentication(); |
||||
|
||||
if ($auth) { |
||||
$login= trim(phpCAS::getUser()); |
||||
/* |
||||
Get user attributes. Here are the attributes for crdp platform |
||||
sn => name |
||||
ENTPersonMailInterne => mail |
||||
ENTPersonAlias => login |
||||
ENTPersonProfils => profil |
||||
givenName => first name |
||||
*/ |
||||
/*$user=phpCAS::getAttributes(); |
||||
$firstName = trim($user['givenName']); |
||||
$lastName = trim($user['sn']); |
||||
$login = trim($user['ENTPersonAlias']); |
||||
$profil = trim($user['ENTPersonProfils']); |
||||
$email = trim($user['ENTPersonMailInterne']); |
||||
$satus=5; |
||||
switch ($profil){ |
||||
case 'admin_etab': |
||||
$status=3; //Session admin |
||||
break; |
||||
case 'admin_sie': |
||||
$status=3; //Session admin |
||||
break; |
||||
case 'National_3': |
||||
$status=1; // Teacher |
||||
break; |
||||
case 'National_1': |
||||
$status=5; // Student |
||||
break; |
||||
default: |
||||
$status=5; // Student |
||||
}*/ |
||||
//If the user is in the dokeos database and we are ,not in a logout request, we upgrade his infomration by ldap |
||||
if (! $logout){ |
||||
$user_table = Database::get_main_table(TABLE_MAIN_USER); |
||||
$sql = "SELECT user_id, username, password, auth_source, active, expiration_date ". |
||||
"FROM $user_table ". |
||||
"WHERE username = '$login' "; |
||||
|
||||
$result = api_sql_query($sql,__FILE__,__LINE__); |
||||
if(mysql_num_rows($result) == 0) { |
||||
require_once(api_get_path(SYS_PATH).'main/inc/lib/usermanager.lib.php'); |
||||
$rnumber=rand(0,256000); |
||||
UserManager::create_user($firstName, $lastName, $status, $email, $login, md5('casplaceholder'.$rnumber), $official_code='',$language='',$phone='',$picture_uri='',$auth_source = PLATFORM_AUTH_SOURCE); |
||||
} |
||||
else { |
||||
$user = mysql_fetch_assoc($result); |
||||
$user_id = intval($user['user_id']); |
||||
//echo "deb : $status"; |
||||
UserManager::update_user ($user_id, $firstname, $lastname, $login, null, null, $email, $status, '', '', '', '', 1, null, 0, null,'') ; |
||||
|
||||
} |
||||
} |
||||
return($login); |
||||
} |
||||
else |
||||
{ |
||||
return(false); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* Logs out the user of the cas |
||||
* The user MUST be logged in with cas to use this function |
||||
**/ |
||||
function cas_logout() |
||||
{ |
||||
|
||||
//phpCAS::logoutWithRedirectService("fmc.univ-paris5.fr"); |
||||
phpCAS::logoutWithRedirectService(api_get_path(WEB_PATH)); |
||||
} |
||||
|
||||
?> |
@ -0,0 +1,20 @@ |
||||
<? |
||||
/* This file contains all the configuration variable for the cas module |
||||
* In the future, these will be in the database |
||||
*/ |
||||
require_once('lib/CAS.php'); |
||||
define("CAS_VERSION_2_0",'2.0'); |
||||
define("SAML_VERSION_1_1", 'S1'); |
||||
|
||||
global $cas_auth_ver, $cas_auth_server, $cas_auth_port, $cas_auth_uri; |
||||
|
||||
$cas_auth_server = api_get_setting('cas_server'); |
||||
$cas_auth_uri = api_get_setting('cas_server_uri'); |
||||
$cas_auth_port = intval(api_get_setting('cas_port')); |
||||
|
||||
$cas_auth_uri = api_get_setting('cas_server_uri'); |
||||
if ( ! is_string($cas_auth_uri)) $cas_auth_uri = ''; |
||||
|
||||
$cas_auth_ver = '2.0'; |
||||
//$cas_auth_ver = SAML_VERSION_1_1; |
||||
?> |
@ -0,0 +1,218 @@ |
||||
<?php |
||||
/* |
||||
* Copyright © 2003-2010, The ESUP-Portail consortium & the JA-SIG Collaborative. |
||||
* All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are met: |
||||
* |
||||
* * Redistributions of source code must retain the above copyright notice, |
||||
* this list of conditions and the following disclaimer. |
||||
* * Redistributions in binary form must reproduce the above copyright notice, |
||||
* this list of conditions and the following disclaimer in the documentation |
||||
* and/or other materials provided with the distribution. |
||||
* * Neither the name of the ESUP-Portail consortium & the JA-SIG |
||||
* Collaborative nor the names of its contributors may be used to endorse or |
||||
* promote products derived from this software without specific prior |
||||
* written permission. |
||||
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR |
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON |
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
*/ |
||||
|
||||
/** |
||||
* @file CAS/PGTStorage/pgt-db.php |
||||
* Basic class for PGT database storage |
||||
*/ |
||||
|
||||
/** |
||||
* @class PGTStorageDB |
||||
* The PGTStorageDB class is a class for PGT database storage. An instance of |
||||
* this class is returned by CASClient::SetPGTStorageDB(). |
||||
* |
||||
* @author Pascal Aubry <pascal.aubry at univ-rennes1.fr> |
||||
* |
||||
* @ingroup internalPGTStorageDB |
||||
*/ |
||||
|
||||
class PGTStorageDB extends PGTStorage |
||||
{ |
||||
/** |
||||
* @addtogroup internalPGTStorageDB |
||||
* @{ |
||||
*/ |
||||
|
||||
/** |
||||
* a string representing a PEAR DB URL to connect to the database. Written by |
||||
* PGTStorageDB::PGTStorageDB(), read by getURL(). |
||||
* |
||||
* @hideinitializer |
||||
* @private |
||||
*/ |
||||
var $_url=''; |
||||
|
||||
/** |
||||
* This method returns the PEAR DB URL to use to connect to the database. |
||||
* |
||||
* @return a PEAR DB URL |
||||
* |
||||
* @private |
||||
*/ |
||||
function getURL() |
||||
{ |
||||
return $this->_url; |
||||
} |
||||
|
||||
/** |
||||
* The handle of the connection to the database where PGT's are stored. Written by |
||||
* PGTStorageDB::init(), read by getLink(). |
||||
* |
||||
* @hideinitializer |
||||
* @private |
||||
*/ |
||||
var $_link = null; |
||||
|
||||
/** |
||||
* This method returns the handle of the connection to the database where PGT's are |
||||
* stored. |
||||
* |
||||
* @return a handle of connection. |
||||
* |
||||
* @private |
||||
*/ |
||||
function getLink() |
||||
{ |
||||
return $this->_link; |
||||
} |
||||
|
||||
/** |
||||
* The name of the table where PGT's are stored. Written by |
||||
* PGTStorageDB::PGTStorageDB(), read by getTable(). |
||||
* |
||||
* @hideinitializer |
||||
* @private |
||||
*/ |
||||
var $_table = ''; |
||||
|
||||
/** |
||||
* This method returns the name of the table where PGT's are stored. |
||||
* |
||||
* @return the name of a table. |
||||
* |
||||
* @private |
||||
*/ |
||||
function getTable() |
||||
{ |
||||
return $this->_table; |
||||
} |
||||
|
||||
// ######################################################################## |
||||
// DEBUGGING |
||||
// ######################################################################## |
||||
|
||||
/** |
||||
* This method returns an informational string giving the type of storage |
||||
* used by the object (used for debugging purposes). |
||||
* |
||||
* @return an informational string. |
||||
* @public |
||||
*/ |
||||
function getStorageType() |
||||
{ |
||||
return "database"; |
||||
} |
||||
|
||||
/** |
||||
* This method returns an informational string giving informations on the |
||||
* parameters of the storage.(used for debugging purposes). |
||||
* |
||||
* @public |
||||
*/ |
||||
function getStorageInfo() |
||||
{ |
||||
return 'url=`'.$this->getURL().'\', table=`'.$this->getTable().'\''; |
||||
} |
||||
|
||||
// ######################################################################## |
||||
// CONSTRUCTOR |
||||
// ######################################################################## |
||||
|
||||
/** |
||||
* The class constructor, called by CASClient::SetPGTStorageDB(). |
||||
* |
||||
* @param $cas_parent the CASClient instance that creates the object. |
||||
* @param $user the user to access the data with |
||||
* @param $password the user's password |
||||
* @param $database_type the type of the database hosting the data |
||||
* @param $hostname the server hosting the database |
||||
* @param $port the port the server is listening on |
||||
* @param $database the name of the database |
||||
* @param $table the name of the table storing the data |
||||
* |
||||
* @public |
||||
*/ |
||||
function PGTStorageDB($cas_parent,$user,$password,$database_type,$hostname,$port,$database,$table) |
||||
{ |
||||
phpCAS::traceBegin(); |
||||
|
||||
// call the ancestor's constructor |
||||
$this->PGTStorage($cas_parent); |
||||
|
||||
if ( empty($database_type) ) $database_type = CAS_PGT_STORAGE_DB_DEFAULT_DATABASE_TYPE; |
||||
if ( empty($hostname) ) $hostname = CAS_PGT_STORAGE_DB_DEFAULT_HOSTNAME; |
||||
if ( $port==0 ) $port = CAS_PGT_STORAGE_DB_DEFAULT_PORT; |
||||
if ( empty($database) ) $database = CAS_PGT_STORAGE_DB_DEFAULT_DATABASE; |
||||
if ( empty($table) ) $table = CAS_PGT_STORAGE_DB_DEFAULT_TABLE; |
||||
|
||||
// build and store the PEAR DB URL |
||||
$this->_url = $database_type.':'.'//'.$user.':'.$password.'@'.$hostname.':'.$port.'/'.$database; |
||||
|
||||
// XXX should use setURL and setTable |
||||
phpCAS::traceEnd(); |
||||
} |
||||
|
||||
// ######################################################################## |
||||
// INITIALIZATION |
||||
// ######################################################################## |
||||
|
||||
/** |
||||
* This method is used to initialize the storage. Halts on error. |
||||
* |
||||
* @public |
||||
*/ |
||||
function init() |
||||
{ |
||||
phpCAS::traceBegin(); |
||||
// if the storage has already been initialized, return immediatly |
||||
if ( $this->isInitialized() ) |
||||
return; |
||||
// call the ancestor's method (mark as initialized) |
||||
parent::init(); |
||||
|
||||
//include phpDB library (the test was introduced in release 0.4.8 for |
||||
//the integration into Tikiwiki). |
||||
if (!class_exists('DB')) { |
||||
include_once('DB.php'); |
||||
} |
||||
|
||||
// try to connect to the database |
||||
$this->_link = DB::connect($this->getURL()); |
||||
if ( DB::isError($this->_link) ) { |
||||
phpCAS::error('could not connect to database ('.DB::errorMessage($this->_link).')'); |
||||
} |
||||
var_dump($this->_link); |
||||
phpCAS::traceBEnd(); |
||||
} |
||||
|
||||
/** @} */ |
||||
} |
||||
|
||||
?> |
@ -0,0 +1,276 @@ |
||||
<?php |
||||
/* |
||||
* Copyright © 2003-2010, The ESUP-Portail consortium & the JA-SIG Collaborative. |
||||
* All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are met: |
||||
* |
||||
* * Redistributions of source code must retain the above copyright notice, |
||||
* this list of conditions and the following disclaimer. |
||||
* * Redistributions in binary form must reproduce the above copyright notice, |
||||
* this list of conditions and the following disclaimer in the documentation |
||||
* and/or other materials provided with the distribution. |
||||
* * Neither the name of the ESUP-Portail consortium & the JA-SIG |
||||
* Collaborative nor the names of its contributors may be used to endorse or |
||||
* promote products derived from this software without specific prior |
||||
* written permission. |
||||
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR |
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON |
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
*/ |
||||
/** |
||||
* @file CAS/PGTStorage/pgt-file.php |
||||
* Basic class for PGT file storage |
||||
*/ |
||||
|
||||
/** |
||||
* @class PGTStorageFile |
||||
* The PGTStorageFile class is a class for PGT file storage. An instance of |
||||
* this class is returned by CASClient::SetPGTStorageFile(). |
||||
* |
||||
* @author Pascal Aubry <pascal.aubry at univ-rennes1.fr> |
||||
* |
||||
* @ingroup internalPGTStorageFile |
||||
*/ |
||||
|
||||
class PGTStorageFile extends PGTStorage |
||||
{ |
||||
/** |
||||
* @addtogroup internalPGTStorageFile |
||||
* @{ |
||||
*/ |
||||
|
||||
/** |
||||
* a string telling where PGT's should be stored on the filesystem. Written by |
||||
* PGTStorageFile::PGTStorageFile(), read by getPath(). |
||||
* |
||||
* @private |
||||
*/ |
||||
var $_path; |
||||
|
||||
/** |
||||
* This method returns the name of the directory where PGT's should be stored |
||||
* on the filesystem. |
||||
* |
||||
* @return the name of a directory (with leading and trailing '/') |
||||
* |
||||
* @private |
||||
*/ |
||||
function getPath() |
||||
{ |
||||
return $this->_path; |
||||
} |
||||
|
||||
/** |
||||
* a string telling the format to use to store PGT's (plain or xml). Written by |
||||
* PGTStorageFile::PGTStorageFile(), read by getFormat(). |
||||
* |
||||
* @private |
||||
*/ |
||||
var $_format; |
||||
|
||||
/** |
||||
* This method returns the format to use when storing PGT's on the filesystem. |
||||
* |
||||
* @return a string corresponding to the format used (plain or xml). |
||||
* |
||||
* @private |
||||
*/ |
||||
function getFormat() |
||||
{ |
||||
return $this->_format; |
||||
} |
||||
|
||||
// ######################################################################## |
||||
// DEBUGGING |
||||
// ######################################################################## |
||||
|
||||
/** |
||||
* This method returns an informational string giving the type of storage |
||||
* used by the object (used for debugging purposes). |
||||
* |
||||
* @return an informational string. |
||||
* @public |
||||
*/ |
||||
function getStorageType() |
||||
{ |
||||
return "file"; |
||||
} |
||||
|
||||
/** |
||||
* This method returns an informational string giving informations on the |
||||
* parameters of the storage.(used for debugging purposes). |
||||
* |
||||
* @return an informational string. |
||||
* @public |
||||
*/ |
||||
function getStorageInfo() |
||||
{ |
||||
return 'path=`'.$this->getPath().'\', format=`'.$this->getFormat().'\''; |
||||
} |
||||
|
||||
// ######################################################################## |
||||
// CONSTRUCTOR |
||||
// ######################################################################## |
||||
|
||||
/** |
||||
* The class constructor, called by CASClient::SetPGTStorageFile(). |
||||
* |
||||
* @param $cas_parent the CASClient instance that creates the object. |
||||
* @param $format the format used to store the PGT's (`plain' and `xml' allowed). |
||||
* @param $path the path where the PGT's should be stored |
||||
* |
||||
* @public |
||||
*/ |
||||
function PGTStorageFile($cas_parent,$format,$path) |
||||
{ |
||||
phpCAS::traceBegin(); |
||||
// call the ancestor's constructor |
||||
$this->PGTStorage($cas_parent); |
||||
|
||||
if (empty($format) ) $format = CAS_PGT_STORAGE_FILE_DEFAULT_FORMAT; |
||||
if (empty($path) ) $path = CAS_PGT_STORAGE_FILE_DEFAULT_PATH; |
||||
|
||||
// check that the path is an absolute path |
||||
if (getenv("OS")=="Windows_NT"){ |
||||
|
||||
if (!preg_match('`^[a-zA-Z]:`', $path)) { |
||||
phpCAS::error('an absolute path is needed for PGT storage to file'); |
||||
} |
||||
|
||||
} |
||||
else |
||||
{ |
||||
|
||||
if ( $path[0] != '/' ) { |
||||
phpCAS::error('an absolute path is needed for PGT storage to file'); |
||||
} |
||||
|
||||
// store the path (with a leading and trailing '/') |
||||
$path = preg_replace('|[/]*$|','/',$path); |
||||
$path = preg_replace('|^[/]*|','/',$path); |
||||
} |
||||
|
||||
$this->_path = $path; |
||||
// check the format and store it |
||||
switch ($format) { |
||||
case CAS_PGT_STORAGE_FILE_FORMAT_PLAIN: |
||||
case CAS_PGT_STORAGE_FILE_FORMAT_XML: |
||||
$this->_format = $format; |
||||
break; |
||||
default: |
||||
phpCAS::error('unknown PGT file storage format (`'.CAS_PGT_STORAGE_FILE_FORMAT_PLAIN.'\' and `'.CAS_PGT_STORAGE_FILE_FORMAT_XML.'\' allowed)'); |
||||
} |
||||
phpCAS::traceEnd(); |
||||
} |
||||
|
||||
// ######################################################################## |
||||
// INITIALIZATION |
||||
// ######################################################################## |
||||
|
||||
/** |
||||
* This method is used to initialize the storage. Halts on error. |
||||
* |
||||
* @public |
||||
*/ |
||||
function init() |
||||
{ |
||||
phpCAS::traceBegin(); |
||||
// if the storage has already been initialized, return immediatly |
||||
if ( $this->isInitialized() ) |
||||
return; |
||||
// call the ancestor's method (mark as initialized) |
||||
parent::init(); |
||||
phpCAS::traceEnd(); |
||||
} |
||||
|
||||
// ######################################################################## |
||||
// PGT I/O |
||||
// ######################################################################## |
||||
|
||||
/** |
||||
* This method returns the filename corresponding to a PGT Iou. |
||||
* |
||||
* @param $pgt_iou the PGT iou. |
||||
* |
||||
* @return a filename |
||||
* @private |
||||
*/ |
||||
function getPGTIouFilename($pgt_iou) |
||||
{ |
||||
phpCAS::traceBegin(); |
||||
$filename = $this->getPath().$pgt_iou.'.'.$this->getFormat(); |
||||
phpCAS::traceEnd($filename); |
||||
return $filename; |
||||
} |
||||
|
||||
/** |
||||
* This method stores a PGT and its corresponding PGT Iou into a file. Echoes a |
||||
* warning on error. |
||||
* |
||||
* @param $pgt the PGT |
||||
* @param $pgt_iou the PGT iou |
||||
* |
||||
* @public |
||||
*/ |
||||
function write($pgt,$pgt_iou) |
||||
{ |
||||
phpCAS::traceBegin(); |
||||
$fname = $this->getPGTIouFilename($pgt_iou); |
||||
if ( $f=fopen($fname,"w") ) { |
||||
if ( fputs($f,$pgt) === FALSE ) { |
||||
phpCAS::error('could not write PGT to `'.$fname.'\''); |
||||
} |
||||
fclose($f); |
||||
} else { |
||||
phpCAS::error('could not open `'.$fname.'\''); |
||||
} |
||||
phpCAS::traceEnd(); |
||||
} |
||||
|
||||
/** |
||||
* This method reads a PGT corresponding to a PGT Iou and deletes the |
||||
* corresponding file. |
||||
* |
||||
* @param $pgt_iou the PGT iou |
||||
* |
||||
* @return the corresponding PGT, or FALSE on error |
||||
* |
||||
* @public |
||||
*/ |
||||
function read($pgt_iou) |
||||
{ |
||||
phpCAS::traceBegin(); |
||||
$pgt = FALSE; |
||||
$fname = $this->getPGTIouFilename($pgt_iou); |
||||
if ( !($f=fopen($fname,"r")) ) { |
||||
phpCAS::trace('could not open `'.$fname.'\''); |
||||
} else { |
||||
if ( ($pgt=fgets($f)) === FALSE ) { |
||||
phpCAS::trace('could not read PGT from `'.$fname.'\''); |
||||
} |
||||
fclose($f); |
||||
} |
||||
|
||||
// delete the PGT file |
||||
@unlink($fname); |
||||
|
||||
phpCAS::traceEnd($pgt); |
||||
return $pgt; |
||||
} |
||||
|
||||
/** @} */ |
||||
|
||||
} |
||||
|
||||
|
||||
?> |
@ -0,0 +1,215 @@ |
||||
<?php |
||||
/* |
||||
* Copyright © 2003-2010, The ESUP-Portail consortium & the JA-SIG Collaborative. |
||||
* All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are met: |
||||
* |
||||
* * Redistributions of source code must retain the above copyright notice, |
||||
* this list of conditions and the following disclaimer. |
||||
* * Redistributions in binary form must reproduce the above copyright notice, |
||||
* this list of conditions and the following disclaimer in the documentation |
||||
* and/or other materials provided with the distribution. |
||||
* * Neither the name of the ESUP-Portail consortium & the JA-SIG |
||||
* Collaborative nor the names of its contributors may be used to endorse or |
||||
* promote products derived from this software without specific prior |
||||
* written permission. |
||||
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR |
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON |
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
*/ |
||||
/** |
||||
* @file CAS/PGTStorage/pgt-main.php |
||||
* Basic class for PGT storage |
||||
*/ |
||||
|
||||
/** |
||||
* @class PGTStorage |
||||
* The PGTStorage class is a generic class for PGT storage. This class should |
||||
* not be instanciated itself but inherited by specific PGT storage classes. |
||||
* |
||||
* @author Pascal Aubry <pascal.aubry at univ-rennes1.fr> |
||||
* |
||||
* @ingroup internalPGTStorage |
||||
*/ |
||||
|
||||
class PGTStorage |
||||
{ |
||||
/** |
||||
* @addtogroup internalPGTStorage |
||||
* @{ |
||||
*/ |
||||
|
||||
// ######################################################################## |
||||
// CONSTRUCTOR |
||||
// ######################################################################## |
||||
|
||||
/** |
||||
* The constructor of the class, should be called only by inherited classes. |
||||
* |
||||
* @param $cas_parent the CASclient instance that creates the current object. |
||||
* |
||||
* @protected |
||||
*/ |
||||
function PGTStorage($cas_parent) |
||||
{ |
||||
phpCAS::traceBegin(); |
||||
if ( !$cas_parent->isProxy() ) { |
||||
phpCAS::error('defining PGT storage makes no sense when not using a CAS proxy'); |
||||
} |
||||
phpCAS::traceEnd(); |
||||
} |
||||
|
||||
// ######################################################################## |
||||
// DEBUGGING |
||||
// ######################################################################## |
||||
|
||||
/** |
||||
* This virtual method returns an informational string giving the type of storage |
||||
* used by the object (used for debugging purposes). |
||||
* |
||||
* @public |
||||
*/ |
||||
function getStorageType() |
||||
{ |
||||
phpCAS::error(__CLASS__.'::'.__FUNCTION__.'() should never be called'); |
||||
} |
||||
|
||||
/** |
||||
* This virtual method returns an informational string giving informations on the |
||||
* parameters of the storage.(used for debugging purposes). |
||||
* |
||||
* @public |
||||
*/ |
||||
function getStorageInfo() |
||||
{ |
||||
phpCAS::error(__CLASS__.'::'.__FUNCTION__.'() should never be called'); |
||||
} |
||||
|
||||
// ######################################################################## |
||||
// ERROR HANDLING |
||||
// ######################################################################## |
||||
|
||||
/** |
||||
* string used to store an error message. Written by PGTStorage::setErrorMessage(), |
||||
* read by PGTStorage::getErrorMessage(). |
||||
* |
||||
* @hideinitializer |
||||
* @private |
||||
* @deprecated not used. |
||||
*/ |
||||
var $_error_message=FALSE; |
||||
|
||||
/** |
||||
* This method sets en error message, which can be read later by |
||||
* PGTStorage::getErrorMessage(). |
||||
* |
||||
* @param $error_message an error message |
||||
* |
||||
* @protected |
||||
* @deprecated not used. |
||||
*/ |
||||
function setErrorMessage($error_message) |
||||
{ |
||||
$this->_error_message = $error_message; |
||||
} |
||||
|
||||
/** |
||||
* This method returns an error message set by PGTStorage::setErrorMessage(). |
||||
* |
||||
* @return an error message when set by PGTStorage::setErrorMessage(), FALSE |
||||
* otherwise. |
||||
* |
||||
* @public |
||||
* @deprecated not used. |
||||
*/ |
||||
function getErrorMessage() |
||||
{ |
||||
return $this->_error_message; |
||||
} |
||||
|
||||
// ######################################################################## |
||||
// INITIALIZATION |
||||
// ######################################################################## |
||||
|
||||
/** |
||||
* a boolean telling if the storage has already been initialized. Written by |
||||
* PGTStorage::init(), read by PGTStorage::isInitialized(). |
||||
* |
||||
* @hideinitializer |
||||
* @private |
||||
*/ |
||||
var $_initialized = FALSE; |
||||
|
||||
/** |
||||
* This method tells if the storage has already been intialized. |
||||
* |
||||
* @return a boolean |
||||
* |
||||
* @protected |
||||
*/ |
||||
function isInitialized() |
||||
{ |
||||
return $this->_initialized; |
||||
} |
||||
|
||||
/** |
||||
* This virtual method initializes the object. |
||||
* |
||||
* @protected |
||||
*/ |
||||
function init() |
||||
{ |
||||
$this->_initialized = TRUE; |
||||
} |
||||
|
||||
// ######################################################################## |
||||
// PGT I/O |
||||
// ######################################################################## |
||||
|
||||
/** |
||||
* This virtual method stores a PGT and its corresponding PGT Iuo. |
||||
* @note Should never be called. |
||||
* |
||||
* @param $pgt the PGT |
||||
* @param $pgt_iou the PGT iou |
||||
* |
||||
* @protected |
||||
*/ |
||||
function write($pgt,$pgt_iou) |
||||
{ |
||||
phpCAS::error(__CLASS__.'::'.__FUNCTION__.'() should never be called'); |
||||
} |
||||
|
||||
/** |
||||
* This virtual method reads a PGT corresponding to a PGT Iou and deletes |
||||
* the corresponding storage entry. |
||||
* @note Should never be called. |
||||
* |
||||
* @param $pgt_iou the PGT iou |
||||
* |
||||
* @protected |
||||
*/ |
||||
function read($pgt_iou) |
||||
{ |
||||
phpCAS::error(__CLASS__.'::'.__FUNCTION__.'() should never be called'); |
||||
} |
||||
|
||||
/** @} */ |
||||
|
||||
} |
||||
|
||||
// include specific PGT storage classes |
||||
include_once(dirname(__FILE__).'/pgt-file.php'); |
||||
include_once(dirname(__FILE__).'/pgt-db.php'); |
||||
|
||||
?> |
@ -0,0 +1,499 @@ |
||||
<?php |
||||
/* |
||||
Requires PHP5, uses built-in DOM extension. |
||||
To be used in PHP4 scripts using DOMXML extension: allows PHP4/DOMXML scripts to run on PHP5/DOM. |
||||
(Optional: requires PHP5/XSL extension for domxml_xslt functions, PHP>=5.1 for XPath evaluation functions, and PHP>=5.1/libxml for DOMXML error reports) |
||||
|
||||
Typical use: |
||||
{ |
||||
if (PHP_VERSION>='5') |
||||
require_once('domxml-php4-to-php5.php'); |
||||
} |
||||
|
||||
Version 1.21, 2008-12-05, http://alexandre.alapetite.net/doc-alex/domxml-php4-php5/ |
||||
|
||||
------------------------------------------------------------------ |
||||
Written by Alexandre Alapetite, http://alexandre.alapetite.net/cv/ |
||||
|
||||
Copyright 2004-2008, GNU Lesser General Public License, |
||||
http://www.gnu.org/licenses/lgpl.html |
||||
|
||||
This program is free software: you can redistribute it and/or modify |
||||
it under the terms of the GNU Lesser General Public License as published by |
||||
the Free Software Foundation, either version 3 of the License, or |
||||
(at your option) any later version. |
||||
This program is distributed in the hope that it will be useful, |
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
GNU Lesser General Public License for more details. |
||||
You should have received a copy of the GNU Lesser General Public License |
||||
along with this program. If not, see <http://www.gnu.org/licenses/lgpl.html> |
||||
|
||||
== Rights and obligations == |
||||
- Attribution: You must give the original author credit. |
||||
- Share Alike: If you alter or transform this library, |
||||
you may distribute the resulting library only under the same license GNU/LGPL. |
||||
- In case of jurisdiction dispute, the French law is authoritative. |
||||
- Any of these conditions can be waived if you get permission from Alexandre Alapetite. |
||||
- Not required, but please send to Alexandre Alapetite the modifications you make, |
||||
in order to improve this file for the benefit of everybody. |
||||
|
||||
If you want to distribute this code, please do it as a link to: |
||||
http://alexandre.alapetite.net/doc-alex/domxml-php4-php5/ |
||||
*/ |
||||
|
||||
define('DOMXML_LOAD_PARSING',0); |
||||
define('DOMXML_LOAD_VALIDATING',1); |
||||
define('DOMXML_LOAD_RECOVERING',2); |
||||
define('DOMXML_LOAD_SUBSTITUTE_ENTITIES',4); |
||||
//define('DOMXML_LOAD_COMPLETE_ATTRS',8); |
||||
define('DOMXML_LOAD_DONT_KEEP_BLANKS',16); |
||||
|
||||
function domxml_new_doc($version) {return new php4DOMDocument();} |
||||
function domxml_new_xmldoc($version) {return new php4DOMDocument();} |
||||
function domxml_open_file($filename,$mode=DOMXML_LOAD_PARSING,&$error=null) |
||||
{ |
||||
$dom=new php4DOMDocument($mode); |
||||
$errorMode=(func_num_args()>2)&&defined('LIBXML_VERSION'); |
||||
if ($errorMode) libxml_use_internal_errors(true); |
||||
if (!$dom->myDOMNode->load($filename)) $dom=null; |
||||
if ($errorMode) |
||||
{ |
||||
$error=array_map('_error_report',libxml_get_errors()); |
||||
libxml_clear_errors(); |
||||
} |
||||
return $dom; |
||||
} |
||||
function domxml_open_mem($str,$mode=DOMXML_LOAD_PARSING,&$error=null) |
||||
{ |
||||
$dom=new php4DOMDocument($mode); |
||||
$errorMode=(func_num_args()>2)&&defined('LIBXML_VERSION'); |
||||
if ($errorMode) libxml_use_internal_errors(true); |
||||
if (!$dom->myDOMNode->loadXML($str)) $dom=null; |
||||
if ($errorMode) |
||||
{ |
||||
$error=array_map('_error_report',libxml_get_errors()); |
||||
libxml_clear_errors(); |
||||
} |
||||
return $dom; |
||||
} |
||||
function html_doc($html_doc,$from_file=false) |
||||
{ |
||||
$dom=new php4DOMDocument(); |
||||
if ($from_file) $result=$dom->myDOMNode->loadHTMLFile($html_doc); |
||||
else $result=$dom->myDOMNode->loadHTML($html_doc); |
||||
return $result ? $dom : null; |
||||
} |
||||
function html_doc_file($filename) {return html_doc($filename,true);} |
||||
function xmldoc($str) {return domxml_open_mem($str);} |
||||
function xmldocfile($filename) {return domxml_open_file($filename);} |
||||
function xpath_eval($xpath_context,$eval_str,$contextnode=null) {return $xpath_context->xpath_eval($eval_str,$contextnode);} |
||||
function xpath_new_context($dom_document) {return new php4DOMXPath($dom_document);} |
||||
function xpath_register_ns($xpath_context,$prefix,$namespaceURI) {return $xpath_context->myDOMXPath->registerNamespace($prefix,$namespaceURI);} |
||||
function _entityDecode($text) {return html_entity_decode(strtr($text,array('''=>'\'')),ENT_QUOTES,'UTF-8');} |
||||
function _error_report($error) {return array('errormessage'=>$error->message,'nodename'=>'','line'=>$error->line,'col'=>$error->column)+($error->file==''?array():array('directory'=>dirname($error->file),'file'=>basename($error->file)));} |
||||
|
||||
class php4DOMAttr extends php4DOMNode |
||||
{ |
||||
function __get($name) |
||||
{ |
||||
if ($name==='name') return $this->myDOMNode->name; |
||||
else return parent::__get($name); |
||||
} |
||||
function name() {return $this->myDOMNode->name;} |
||||
function set_content($text) {} |
||||
//function set_value($content) {return $this->myDOMNode->value=htmlspecialchars($content,ENT_QUOTES);} |
||||
function specified() {return $this->myDOMNode->specified;} |
||||
function value() {return $this->myDOMNode->value;} |
||||
} |
||||
|
||||
class php4DOMDocument extends php4DOMNode |
||||
{ |
||||
function php4DOMDocument($mode=DOMXML_LOAD_PARSING) |
||||
{ |
||||
$this->myDOMNode=new DOMDocument(); |
||||
$this->myOwnerDocument=$this; |
||||
if ($mode & DOMXML_LOAD_VALIDATING) $this->myDOMNode->validateOnParse=true; |
||||
if ($mode & DOMXML_LOAD_RECOVERING) $this->myDOMNode->recover=true; |
||||
if ($mode & DOMXML_LOAD_SUBSTITUTE_ENTITIES) $this->myDOMNode->substituteEntities=true; |
||||
if ($mode & DOMXML_LOAD_DONT_KEEP_BLANKS) $this->myDOMNode->preserveWhiteSpace=false; |
||||
} |
||||
function add_root($name) |
||||
{ |
||||
if ($this->myDOMNode->hasChildNodes()) $this->myDOMNode->removeChild($this->myDOMNode->firstChild); |
||||
return new php4DOMElement($this->myDOMNode->appendChild($this->myDOMNode->createElement($name)),$this->myOwnerDocument); |
||||
} |
||||
function create_attribute($name,$value) |
||||
{ |
||||
$myAttr=$this->myDOMNode->createAttribute($name); |
||||
$myAttr->value=htmlspecialchars($value,ENT_QUOTES); |
||||
return new php4DOMAttr($myAttr,$this); |
||||
} |
||||
function create_cdata_section($content) {return new php4DOMNode($this->myDOMNode->createCDATASection($content),$this);} |
||||
function create_comment($data) {return new php4DOMNode($this->myDOMNode->createComment($data),$this);} |
||||
function create_element($name) {return new php4DOMElement($this->myDOMNode->createElement($name),$this);} |
||||
function create_element_ns($uri,$name,$prefix=null) |
||||
{ |
||||
if ($prefix==null) $prefix=$this->myDOMNode->lookupPrefix($uri); |
||||
if (($prefix==null)&&(($this->myDOMNode->documentElement==null)||(!$this->myDOMNode->documentElement->isDefaultNamespace($uri)))) $prefix='a'.sprintf('%u',crc32($uri)); |
||||
return new php4DOMElement($this->myDOMNode->createElementNS($uri,$prefix==null ? $name : $prefix.':'.$name),$this); |
||||
} |
||||
function create_entity_reference($content) {return new php4DOMNode($this->myDOMNode->createEntityReference($content),$this);} //By Walter Ebert 2007-01-22 |
||||
function create_processing_instruction($target,$data=''){return new php4DomProcessingInstruction($this->myDOMNode->createProcessingInstruction($target,$data),$this);} |
||||
function create_text_node($content) {return new php4DOMText($this->myDOMNode->createTextNode($content),$this);} |
||||
function document_element() {return parent::_newDOMElement($this->myDOMNode->documentElement,$this);} |
||||
function dump_file($filename,$compressionmode=false,$format=false) |
||||
{ |
||||
$format0=$this->myDOMNode->formatOutput; |
||||
$this->myDOMNode->formatOutput=$format; |
||||
$res=$this->myDOMNode->save($filename); |
||||
$this->myDOMNode->formatOutput=$format0; |
||||
return $res; |
||||
} |
||||
function dump_mem($format=false,$encoding=false) |
||||
{ |
||||
$format0=$this->myDOMNode->formatOutput; |
||||
$this->myDOMNode->formatOutput=$format; |
||||
$encoding0=$this->myDOMNode->encoding; |
||||
if ($encoding) $this->myDOMNode->encoding=$encoding; |
||||
$dump=$this->myDOMNode->saveXML(); |
||||
$this->myDOMNode->formatOutput=$format0; |
||||
if ($encoding) $this->myDOMNode->encoding= $encoding0=='' ? 'UTF-8' : $encoding0; //UTF-8 is XML default encoding |
||||
return $dump; |
||||
} |
||||
function free() |
||||
{ |
||||
if ($this->myDOMNode->hasChildNodes()) $this->myDOMNode->removeChild($this->myDOMNode->firstChild); |
||||
$this->myDOMNode=null; |
||||
$this->myOwnerDocument=null; |
||||
} |
||||
function get_element_by_id($id) {return parent::_newDOMElement($this->myDOMNode->getElementById($id),$this);} |
||||
function get_elements_by_tagname($name) |
||||
{ |
||||
$myDOMNodeList=$this->myDOMNode->getElementsByTagName($name); |
||||
$nodeSet=array(); |
||||
$i=0; |
||||
if (isset($myDOMNodeList)) |
||||
while ($node=$myDOMNodeList->item($i++)) $nodeSet[]=new php4DOMElement($node,$this); |
||||
return $nodeSet; |
||||
} |
||||
function html_dump_mem() {return $this->myDOMNode->saveHTML();} |
||||
function root() {return parent::_newDOMElement($this->myDOMNode->documentElement,$this);} |
||||
function xinclude() {return $this->myDOMNode->xinclude();} |
||||
function xpath_new_context() {return new php4DOMXPath($this);} |
||||
} |
||||
|
||||
class php4DOMElement extends php4DOMNode |
||||
{ |
||||
function add_namespace($uri,$prefix) |
||||
{ |
||||
if ($this->myDOMNode->hasAttributeNS('http://www.w3.org/2000/xmlns/',$prefix)) return false; |
||||
else |
||||
{ |
||||
$this->myDOMNode->setAttributeNS('http://www.w3.org/2000/xmlns/','xmlns:'.$prefix,$uri); //By Daniel Walker 2006-09-08 |
||||
return true; |
||||
} |
||||
} |
||||
function get_attribute($name) {return $this->myDOMNode->getAttribute($name);} |
||||
function get_attribute_node($name) {return parent::_newDOMElement($this->myDOMNode->getAttributeNode($name),$this->myOwnerDocument);} |
||||
function get_elements_by_tagname($name) |
||||
{ |
||||
$myDOMNodeList=$this->myDOMNode->getElementsByTagName($name); |
||||
$nodeSet=array(); |
||||
$i=0; |
||||
if (isset($myDOMNodeList)) |
||||
while ($node=$myDOMNodeList->item($i++)) $nodeSet[]=new php4DOMElement($node,$this->myOwnerDocument); |
||||
return $nodeSet; |
||||
} |
||||
function has_attribute($name) {return $this->myDOMNode->hasAttribute($name);} |
||||
function remove_attribute($name) {return $this->myDOMNode->removeAttribute($name);} |
||||
function set_attribute($name,$value) |
||||
{ |
||||
//return $this->myDOMNode->setAttribute($name,$value); //Does not return a DomAttr |
||||
$myAttr=$this->myDOMNode->ownerDocument->createAttribute($name); |
||||
$myAttr->value=htmlspecialchars($value,ENT_QUOTES); //Entity problem reported by AL-DesignWorks 2007-09-07 |
||||
$this->myDOMNode->setAttributeNode($myAttr); |
||||
return new php4DOMAttr($myAttr,$this->myOwnerDocument); |
||||
} |
||||
/*function set_attribute_node($attr) |
||||
{ |
||||
$this->myDOMNode->setAttributeNode($this->_importNode($attr)); |
||||
return $attr; |
||||
}*/ |
||||
function set_name($name) |
||||
{ |
||||
if ($this->myDOMNode->prefix=='') $newNode=$this->myDOMNode->ownerDocument->createElement($name); |
||||
else $newNode=$this->myDOMNode->ownerDocument->createElementNS($this->myDOMNode->namespaceURI,$this->myDOMNode->prefix.':'.$name); |
||||
$myDOMNodeList=$this->myDOMNode->attributes; |
||||
$i=0; |
||||
if (isset($myDOMNodeList)) |
||||
while ($node=$myDOMNodeList->item($i++)) |
||||
if ($node->namespaceURI=='') $newNode->setAttribute($node->name,$node->value); |
||||
else $newNode->setAttributeNS($node->namespaceURI,$node->nodeName,$node->value); |
||||
$myDOMNodeList=$this->myDOMNode->childNodes; |
||||
if (isset($myDOMNodeList)) |
||||
while ($node=$myDOMNodeList->item(0)) $newNode->appendChild($node); |
||||
$this->myDOMNode->parentNode->replaceChild($newNode,$this->myDOMNode); |
||||
$this->myDOMNode=$newNode; |
||||
return true; |
||||
} |
||||
function tagname() {return $this->tagname;} |
||||
} |
||||
|
||||
class php4DOMNode |
||||
{ |
||||
public $myDOMNode; |
||||
public $myOwnerDocument; |
||||
function php4DOMNode($aDomNode,$aOwnerDocument) |
||||
{ |
||||
$this->myDOMNode=$aDomNode; |
||||
$this->myOwnerDocument=$aOwnerDocument; |
||||
} |
||||
function __get($name) |
||||
{ |
||||
switch ($name) |
||||
{ |
||||
case 'type': return $this->myDOMNode->nodeType; |
||||
case 'tagname': return ($this->myDOMNode->nodeType===XML_ELEMENT_NODE) ? $this->myDOMNode->localName : $this->myDOMNode->tagName; //Avoid namespace prefix for DOMElement |
||||
case 'content': return $this->myDOMNode->textContent; |
||||
case 'value': return $this->myDOMNode->value; |
||||
default: |
||||
$myErrors=debug_backtrace(); |
||||
trigger_error('Undefined property: '.get_class($this).'::$'.$name.' ['.$myErrors[0]['file'].':'.$myErrors[0]['line'].']',E_USER_NOTICE); |
||||
return false; |
||||
} |
||||
} |
||||
function add_child($newnode) {return append_child($newnode);} |
||||
function add_namespace($uri,$prefix) {return false;} |
||||
function append_child($newnode) {return self::_newDOMElement($this->myDOMNode->appendChild($this->_importNode($newnode)),$this->myOwnerDocument);} |
||||
function append_sibling($newnode) {return self::_newDOMElement($this->myDOMNode->parentNode->appendChild($this->_importNode($newnode)),$this->myOwnerDocument);} |
||||
function attributes() |
||||
{ |
||||
$myDOMNodeList=$this->myDOMNode->attributes; |
||||
if (!(isset($myDOMNodeList)&&$this->myDOMNode->hasAttributes())) return null; |
||||
$nodeSet=array(); |
||||
$i=0; |
||||
while ($node=$myDOMNodeList->item($i++)) $nodeSet[]=new php4DOMAttr($node,$this->myOwnerDocument); |
||||
return $nodeSet; |
||||
} |
||||
function child_nodes() |
||||
{ |
||||
$myDOMNodeList=$this->myDOMNode->childNodes; |
||||
$nodeSet=array(); |
||||
$i=0; |
||||
if (isset($myDOMNodeList)) |
||||
while ($node=$myDOMNodeList->item($i++)) $nodeSet[]=self::_newDOMElement($node,$this->myOwnerDocument); |
||||
return $nodeSet; |
||||
} |
||||
function children() {return $this->child_nodes();} |
||||
function clone_node($deep=false) {return self::_newDOMElement($this->myDOMNode->cloneNode($deep),$this->myOwnerDocument);} |
||||
//dump_node($node) should only be called on php4DOMDocument |
||||
function dump_node($node=null) {return $node==null ? $this->myOwnerDocument->myDOMNode->saveXML($this->myDOMNode) : $this->myOwnerDocument->myDOMNode->saveXML($node->myDOMNode);} |
||||
function first_child() {return self::_newDOMElement($this->myDOMNode->firstChild,$this->myOwnerDocument);} |
||||
function get_content() {return $this->myDOMNode->textContent;} |
||||
function has_attributes() {return $this->myDOMNode->hasAttributes();} |
||||
function has_child_nodes() {return $this->myDOMNode->hasChildNodes();} |
||||
function insert_before($newnode,$refnode) {return self::_newDOMElement($this->myDOMNode->insertBefore($this->_importNode($newnode),$refnode==null?null:$refnode->myDOMNode),$this->myOwnerDocument);} |
||||
function is_blank_node() {return ($this->myDOMNode->nodeType===XML_TEXT_NODE)&&preg_match('%^\s*$%',$this->myDOMNode->nodeValue);} |
||||
function last_child() {return self::_newDOMElement($this->myDOMNode->lastChild,$this->myOwnerDocument);} |
||||
function new_child($name,$content) |
||||
{ |
||||
$mySubNode=$this->myDOMNode->ownerDocument->createElement($name); |
||||
$mySubNode->appendChild($this->myDOMNode->ownerDocument->createTextNode(_entityDecode($content))); |
||||
$this->myDOMNode->appendChild($mySubNode); |
||||
return new php4DOMElement($mySubNode,$this->myOwnerDocument); |
||||
} |
||||
function next_sibling() {return self::_newDOMElement($this->myDOMNode->nextSibling,$this->myOwnerDocument);} |
||||
function node_name() {return ($this->myDOMNode->nodeType===XML_ELEMENT_NODE) ? $this->myDOMNode->localName : $this->myDOMNode->nodeName;} //Avoid namespace prefix for DOMElement |
||||
function node_type() {return $this->myDOMNode->nodeType;} |
||||
function node_value() {return $this->myDOMNode->nodeValue;} |
||||
function owner_document() {return $this->myOwnerDocument;} |
||||
function parent_node() {return self::_newDOMElement($this->myDOMNode->parentNode,$this->myOwnerDocument);} |
||||
function prefix() {return $this->myDOMNode->prefix;} |
||||
function previous_sibling() {return self::_newDOMElement($this->myDOMNode->previousSibling,$this->myOwnerDocument);} |
||||
function remove_child($oldchild) {return self::_newDOMElement($this->myDOMNode->removeChild($oldchild->myDOMNode),$this->myOwnerDocument);} |
||||
function replace_child($newnode,$oldnode) {return self::_newDOMElement($this->myDOMNode->replaceChild($this->_importNode($newnode),$oldnode->myDOMNode),$this->myOwnerDocument);} |
||||
function replace_node($newnode) {return self::_newDOMElement($this->myDOMNode->parentNode->replaceChild($this->_importNode($newnode),$this->myDOMNode),$this->myOwnerDocument);} |
||||
function set_content($text) {return $this->myDOMNode->appendChild($this->myDOMNode->ownerDocument->createTextNode(_entityDecode($text)));} //Entity problem reported by AL-DesignWorks 2007-09-07 |
||||
//function set_name($name) {return $this->myOwnerDocument->renameNode($this->myDOMNode,$this->myDOMNode->namespaceURI,$name);} |
||||
function set_namespace($uri,$prefix=null) |
||||
{//Contributions by Daniel Walker 2006-09-08 |
||||
$nsprefix=$this->myDOMNode->lookupPrefix($uri); |
||||
if ($nsprefix==null) |
||||
{ |
||||
$nsprefix= $prefix==null ? $nsprefix='a'.sprintf('%u',crc32($uri)) : $prefix; |
||||
if ($this->myDOMNode->nodeType===XML_ATTRIBUTE_NODE) |
||||
{ |
||||
if (($prefix!=null)&&$this->myDOMNode->ownerElement->hasAttributeNS('http://www.w3.org/2000/xmlns/',$nsprefix)&& |
||||
($this->myDOMNode->ownerElement->getAttributeNS('http://www.w3.org/2000/xmlns/',$nsprefix)!=$uri)) |
||||
{//Remove namespace |
||||
$parent=$this->myDOMNode->ownerElement; |
||||
$parent->removeAttributeNode($this->myDOMNode); |
||||
$parent->setAttribute($this->myDOMNode->localName,$this->myDOMNode->nodeValue); |
||||
$this->myDOMNode=$parent->getAttributeNode($this->myDOMNode->localName); |
||||
return; |
||||
} |
||||
$this->myDOMNode->ownerElement->setAttributeNS('http://www.w3.org/2000/xmlns/','xmlns:'.$nsprefix,$uri); |
||||
} |
||||
} |
||||
if ($this->myDOMNode->nodeType===XML_ATTRIBUTE_NODE) |
||||
{ |
||||
$parent=$this->myDOMNode->ownerElement; |
||||
$parent->removeAttributeNode($this->myDOMNode); |
||||
$parent->setAttributeNS($uri,$nsprefix.':'.$this->myDOMNode->localName,$this->myDOMNode->nodeValue); |
||||
$this->myDOMNode=$parent->getAttributeNodeNS($uri,$this->myDOMNode->localName); |
||||
} |
||||
elseif ($this->myDOMNode->nodeType===XML_ELEMENT_NODE) |
||||
{ |
||||
$NewNode=$this->myDOMNode->ownerDocument->createElementNS($uri,$nsprefix.':'.$this->myDOMNode->localName); |
||||
foreach ($this->myDOMNode->attributes as $n) $NewNode->appendChild($n->cloneNode(true)); |
||||
foreach ($this->myDOMNode->childNodes as $n) $NewNode->appendChild($n->cloneNode(true)); |
||||
$xpath=new DOMXPath($this->myDOMNode->ownerDocument); |
||||
$myDOMNodeList=$xpath->query('namespace::*[name()!="xml"]',$this->myDOMNode); //Add old namespaces |
||||
foreach ($myDOMNodeList as $n) $NewNode->setAttributeNS('http://www.w3.org/2000/xmlns/',$n->nodeName,$n->nodeValue); |
||||
$this->myDOMNode->parentNode->replaceChild($NewNode,$this->myDOMNode); |
||||
$this->myDOMNode=$NewNode; |
||||
} |
||||
} |
||||
function unlink_node() |
||||
{ |
||||
if ($this->myDOMNode->parentNode!=null) |
||||
{ |
||||
if ($this->myDOMNode->nodeType===XML_ATTRIBUTE_NODE) $this->myDOMNode->parentNode->removeAttributeNode($this->myDOMNode); |
||||
else $this->myDOMNode->parentNode->removeChild($this->myDOMNode); |
||||
} |
||||
} |
||||
protected function _importNode($newnode) {return $this->myOwnerDocument===$newnode->myOwnerDocument ? $newnode->myDOMNode : $this->myOwnerDocument->myDOMNode->importNode($newnode->myDOMNode,true);} //To import DOMNode from another DOMDocument |
||||
static function _newDOMElement($aDOMNode,$aOwnerDocument) |
||||
{//Check the PHP5 DOMNode before creating a new associated PHP4 DOMNode wrapper |
||||
if ($aDOMNode==null) return null; |
||||
switch ($aDOMNode->nodeType) |
||||
{ |
||||
case XML_ELEMENT_NODE: return new php4DOMElement($aDOMNode,$aOwnerDocument); |
||||
case XML_TEXT_NODE: return new php4DOMText($aDOMNode,$aOwnerDocument); |
||||
case XML_ATTRIBUTE_NODE: return new php4DOMAttr($aDOMNode,$aOwnerDocument); |
||||
case XML_PI_NODE: return new php4DomProcessingInstruction($aDOMNode,$aOwnerDocument); |
||||
default: return new php4DOMNode($aDOMNode,$aOwnerDocument); |
||||
} |
||||
} |
||||
} |
||||
|
||||
class php4DomProcessingInstruction extends php4DOMNode |
||||
{ |
||||
function data() {return $this->myDOMNode->data;} |
||||
function target() {return $this->myDOMNode->target;} |
||||
} |
||||
|
||||
class php4DOMText extends php4DOMNode |
||||
{ |
||||
function __get($name) |
||||
{ |
||||
if ($name==='tagname') return '#text'; |
||||
else return parent::__get($name); |
||||
} |
||||
function tagname() {return '#text';} |
||||
function set_content($text) {$this->myDOMNode->nodeValue=$text; return true;} |
||||
} |
||||
|
||||
if (!defined('XPATH_NODESET')) |
||||
{ |
||||
define('XPATH_UNDEFINED',0); |
||||
define('XPATH_NODESET',1); |
||||
define('XPATH_BOOLEAN',2); |
||||
define('XPATH_NUMBER',3); |
||||
define('XPATH_STRING',4); |
||||
/*define('XPATH_POINT',5); |
||||
define('XPATH_RANGE',6); |
||||
define('XPATH_LOCATIONSET',7); |
||||
define('XPATH_USERS',8); |
||||
define('XPATH_XSLT_TREE',9);*/ |
||||
} |
||||
|
||||
class php4DOMNodelist |
||||
{ |
||||
private $myDOMNodelist; |
||||
public $nodeset; |
||||
public $type=XPATH_UNDEFINED; |
||||
public $value; |
||||
function php4DOMNodelist($aDOMNodelist,$aOwnerDocument) |
||||
{ |
||||
if (!isset($aDOMNodelist)) return; |
||||
elseif (is_object($aDOMNodelist)||is_array($aDOMNodelist)) |
||||
{ |
||||
if ($aDOMNodelist->length>0) |
||||
{ |
||||
$this->myDOMNodelist=$aDOMNodelist; |
||||
$this->nodeset=array(); |
||||
$this->type=XPATH_NODESET; |
||||
$i=0; |
||||
while ($node=$this->myDOMNodelist->item($i++)) $this->nodeset[]=php4DOMNode::_newDOMElement($node,$aOwnerDocument); |
||||
} |
||||
} |
||||
elseif (is_int($aDOMNodelist)||is_float($aDOMNodelist)) |
||||
{ |
||||
$this->type=XPATH_NUMBER; |
||||
$this->value=$aDOMNodelist; |
||||
} |
||||
elseif (is_bool($aDOMNodelist)) |
||||
{ |
||||
$this->type=XPATH_BOOLEAN; |
||||
$this->value=$aDOMNodelist; |
||||
} |
||||
elseif (is_string($aDOMNodelist)) |
||||
{ |
||||
$this->type=XPATH_STRING; |
||||
$this->value=$aDOMNodelist; |
||||
} |
||||
} |
||||
} |
||||
|
||||
class php4DOMXPath |
||||
{ |
||||
public $myDOMXPath; |
||||
private $myOwnerDocument; |
||||
function php4DOMXPath($dom_document) |
||||
{ |
||||
//TODO: If $dom_document is a DomElement, make that default $contextnode and modify XPath. Ex: '/test' |
||||
$this->myOwnerDocument=$dom_document->myOwnerDocument; |
||||
$this->myDOMXPath=new DOMXPath($this->myOwnerDocument->myDOMNode); |
||||
} |
||||
function xpath_eval($eval_str,$contextnode=null) |
||||
{ |
||||
if (method_exists($this->myDOMXPath,'evaluate')) $xp=isset($contextnode) ? $this->myDOMXPath->evaluate($eval_str,$contextnode->myDOMNode) : $this->myDOMXPath->evaluate($eval_str); |
||||
else $xp=isset($contextnode) ? $this->myDOMXPath->query($eval_str,$contextnode->myDOMNode) : $this->myDOMXPath->query($eval_str); |
||||
$xp=new php4DOMNodelist($xp,$this->myOwnerDocument); |
||||
return ($xp->type===XPATH_UNDEFINED) ? false : $xp; |
||||
} |
||||
function xpath_register_ns($prefix,$namespaceURI) {return $this->myDOMXPath->registerNamespace($prefix,$namespaceURI);} |
||||
} |
||||
|
||||
if (extension_loaded('xsl')) |
||||
{//See also: http://alexandre.alapetite.net/doc-alex/xslt-php4-php5/ |
||||
function domxml_xslt_stylesheet($xslstring) {return new php4DomXsltStylesheet(DOMDocument::loadXML($xslstring));} |
||||
function domxml_xslt_stylesheet_doc($dom_document) {return new php4DomXsltStylesheet($dom_document);} |
||||
function domxml_xslt_stylesheet_file($xslfile) {return new php4DomXsltStylesheet(DOMDocument::load($xslfile));} |
||||
class php4DomXsltStylesheet |
||||
{ |
||||
private $myxsltProcessor; |
||||
function php4DomXsltStylesheet($dom_document) |
||||
{ |
||||
$this->myxsltProcessor=new xsltProcessor(); |
||||
$this->myxsltProcessor->importStyleSheet($dom_document); |
||||
} |
||||
function process($dom_document,$xslt_parameters=array(),$param_is_xpath=false) |
||||
{ |
||||
foreach ($xslt_parameters as $param=>$value) $this->myxsltProcessor->setParameter('',$param,$value); |
||||
$myphp4DOMDocument=new php4DOMDocument(); |
||||
$myphp4DOMDocument->myDOMNode=$this->myxsltProcessor->transformToDoc($dom_document->myDOMNode); |
||||
return $myphp4DOMDocument; |
||||
} |
||||
function result_dump_file($dom_document,$filename) |
||||
{ |
||||
$html=$dom_document->myDOMNode->saveHTML(); |
||||
file_put_contents($filename,$html); |
||||
return $html; |
||||
} |
||||
function result_dump_mem($dom_document) {return $dom_document->myDOMNode->saveHTML();} |
||||
} |
||||
} |
||||
?> |
@ -0,0 +1,27 @@ |
||||
<?php |
||||
|
||||
/** |
||||
* @file languages/spanish.php |
||||
* @author Iván-Benjamín García Torà <ivaniclixx AT gmail DOT com> |
||||
* @sa @link internalLang Internationalization @endlink |
||||
* @ingroup internalLang |
||||
*/ |
||||
|
||||
$this->_strings = array( |
||||
CAS_STR_USING_SERVER |
||||
=> 'usant servidor', |
||||
CAS_STR_AUTHENTICATION_WANTED |
||||
=> 'Autentificació CAS necessària!', |
||||
CAS_STR_LOGOUT |
||||
=> 'Sortida de CAS necessària!', |
||||
CAS_STR_SHOULD_HAVE_BEEN_REDIRECTED |
||||
=> 'Ja hauria d\ haver estat redireccionat al servidor CAS. Feu click <a href="%s">aquí</a> per a continuar.', |
||||
CAS_STR_AUTHENTICATION_FAILED |
||||
=> 'Autentificació CAS fallida!', |
||||
CAS_STR_YOU_WERE_NOT_AUTHENTICATED |
||||
=> '<p>No estàs autentificat.</p><p>Pots tornar a intentar-ho fent click <a href="%s">aquí</a>.</p><p>Si el problema persisteix hauría de contactar amb l\'<a href="mailto:%s">administrador d\'aquest llocc</a>.</p>', |
||||
CAS_STR_SERVICE_UNAVAILABLE |
||||
=> 'El servei `<b>%s</b>\' no està disponible (<b>%s</b>).' |
||||
); |
||||
|
||||
?> |
@ -0,0 +1,27 @@ |
||||
<?php |
||||
|
||||
/** |
||||
* @file languages/english.php |
||||
* @author Pascal Aubry <pascal.aubry at univ-rennes1.fr> |
||||
* @sa @link internalLang Internationalization @endlink |
||||
* @ingroup internalLang |
||||
*/ |
||||
|
||||
$this->_strings = array( |
||||
CAS_STR_USING_SERVER |
||||
=> 'using server', |
||||
CAS_STR_AUTHENTICATION_WANTED |
||||
=> 'CAS Authentication wanted!', |
||||
CAS_STR_LOGOUT |
||||
=> 'CAS logout wanted!', |
||||
CAS_STR_SHOULD_HAVE_BEEN_REDIRECTED |
||||
=> 'You should already have been redirected to the CAS server. Click <a href="%s">here</a> to continue.', |
||||
CAS_STR_AUTHENTICATION_FAILED |
||||
=> 'CAS Authentication failed!', |
||||
CAS_STR_YOU_WERE_NOT_AUTHENTICATED |
||||
=> '<p>You were not authenticated.</p><p>You may submit your request again by clicking <a href="%s">here</a>.</p><p>If the problem persists, you may contact <a href="mailto:%s">the administrator of this site</a>.</p>', |
||||
CAS_STR_SERVICE_UNAVAILABLE |
||||
=> 'The service `<b>%s</b>\' is not available (<b>%s</b>).' |
||||
); |
||||
|
||||
?> |
@ -0,0 +1,27 @@ |
||||
<?php |
||||
|
||||
/** |
||||
* @file languages/german.php |
||||
* @author Henrik Genssen <hg at mediafactory.de> |
||||
* @sa @link internalLang Internationalization @endlink |
||||
* @ingroup internalLang |
||||
*/ |
||||
|
||||
$this->_strings = array( |
||||
CAS_STR_USING_SERVER |
||||
=> 'via Server', |
||||
CAS_STR_AUTHENTICATION_WANTED |
||||
=> 'CAS Authentifizierung erforderlich!', |
||||
CAS_STR_LOGOUT |
||||
=> 'CAS Abmeldung!', |
||||
CAS_STR_SHOULD_HAVE_BEEN_REDIRECTED |
||||
=> 'eigentlich häten Sie zum CAS Server weitergeleitet werden sollen. Drücken Sie <a href="%s">hier</a> um fortzufahren.', |
||||
CAS_STR_AUTHENTICATION_FAILED |
||||
=> 'CAS Anmeldung fehlgeschlagen!', |
||||
CAS_STR_YOU_WERE_NOT_AUTHENTICATED |
||||
=> '<p>Sie wurden nicht angemeldet.</p><p>Um es erneut zu versuchen klicken Sie <a href="%s">hier</a>.</p><p>Wenn das Problem bestehen bleibt, kontkatieren Sie den <a href="mailto:%s">Administrator</a> dieser Seite.</p>', |
||||
CAS_STR_SERVICE_UNAVAILABLE |
||||
=> 'Der Dienst `<b>%s</b>\' ist nicht verfügbar (<b>%s</b>).' |
||||
); |
||||
|
||||
?> |
@ -0,0 +1,24 @@ |
||||
<?php |
||||
|
||||
/** |
||||
* @file languages/languages.php |
||||
* Internationalization constants |
||||
* @author Pascal Aubry <pascal.aubry at univ-rennes1.fr> |
||||
* @sa @link internalLang Internationalization @endlink |
||||
* @ingroup internalLang |
||||
*/ |
||||
|
||||
//@{ |
||||
/** |
||||
* a phpCAS string index |
||||
*/ |
||||
define("CAS_STR_USING_SERVER", 1); |
||||
define("CAS_STR_AUTHENTICATION_WANTED", 2); |
||||
define("CAS_STR_LOGOUT", 3); |
||||
define("CAS_STR_SHOULD_HAVE_BEEN_REDIRECTED", 4); |
||||
define("CAS_STR_AUTHENTICATION_FAILED", 5); |
||||
define("CAS_STR_YOU_WERE_NOT_AUTHENTICATED", 6); |
||||
define("CAS_STR_SERVICE_UNAVAILABLE", 7); |
||||
//@} |
||||
|
||||
?> |
@ -0,0 +1,27 @@ |
||||
<?php |
||||
|
||||
/** |
||||
* @file languages/spanish.php |
||||
* @author Iván-Benjamín García Torà <ivaniclixx AT gmail DOT com> |
||||
* @sa @link internalLang Internationalization @endlink |
||||
* @ingroup internalLang |
||||
*/ |
||||
|
||||
$this->_strings = array( |
||||
CAS_STR_USING_SERVER |
||||
=> 'usando servidor', |
||||
CAS_STR_AUTHENTICATION_WANTED |
||||
=> '¡Autentificación CAS necesaria!', |
||||
CAS_STR_LOGOUT |
||||
=> '¡Salida CAS necesaria!', |
||||
CAS_STR_SHOULD_HAVE_BEEN_REDIRECTED |
||||
=> 'Ya debería haber sido redireccionado al servidor CAS. Haga click <a href="%s">aquí</a> para continuar.', |
||||
CAS_STR_AUTHENTICATION_FAILED |
||||
=> '¡Autentificación CAS fallida!', |
||||
CAS_STR_YOU_WERE_NOT_AUTHENTICATED |
||||
=> '<p>No estás autentificado.</p><p>Puedes volver a intentarlo haciendo click <a href="%s">aquí</a>.</p><p>Si el problema persiste debería contactar con el <a href="mailto:%s">administrador de este sitio</a>.</p>', |
||||
CAS_STR_SERVICE_UNAVAILABLE |
||||
=> 'El servicio `<b>%s</b>\' no está disponible (<b>%s</b>).' |
||||
); |
||||
|
||||
?> |
@ -0,0 +1,25 @@ |
||||
<?php |
||||
//---------------------------------------------------------------------- |
||||
// CAS PLUGIN |
||||
//---------------------------------------------------------------------- |
||||
// Copyright (c) 2006-2007 University Marc Bloch (UMB) |
||||
//---------------------------------------------------------------------- |
||||
// This program is under the terms of the GENERAL PUBLIC LICENSE (GPL) |
||||
// as published by the FREE SOFTWARE FOUNDATION. The GPL is available |
||||
// through the world-wide-web at http://www.gnu.org/copyleft/gpl.html |
||||
//---------------------------------------------------------------------- |
||||
// Authors: Pierre Cahard |
||||
//---------------------------------------------------------------------- |
||||
// Load required |
||||
require('../..//inc/global.inc.php'); |
||||
require_once (api_get_path(LIBRARY_PATH).'events.lib.inc.php'); |
||||
require_once('authcas.php'); |
||||
global $cas_auth_ver, $cas_auth_server, $cas_auth_port, $cas_auth_uri; |
||||
// phpCAS |
||||
if (!is_object($PHPCAS_CLIENT) ) { |
||||
phpCAS::client($cas_auth_ver,$cas_auth_server,$cas_auth_port,$cas_auth_uri); |
||||
phpCAS::setNoCasServerValidation(); |
||||
} |
||||
phpCAS::forceAuthentication(); |
||||
//echo 'ici'; |
||||
header('Location: '.api_get_path(WEB_PATH).api_get_setting('page_after_login')); |
@ -0,0 +1,32 @@ |
||||
<?php |
||||
require_once(dirname(__FILE__).'/../../inc/global.inc.php'); |
||||
require_once (api_get_path(LIBRARY_PATH).'conditionallogin.lib.php'); |
||||
require_once (api_get_path(LIBRARY_PATH).'usermanager.lib.php'); |
||||
$url = api_get_path(WEB_PATH).'main/auth/conditional_login/complete_phone_number.php'; |
||||
|
||||
if (! isset($_SESSION['conditional_login']['uid'])) |
||||
die("Not Authorised"); |
||||
?> |
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
||||
<html lang="fr" xml:lang="fr" xmlns="http://www.w3.org/1999/xhtml"> |
||||
<head> |
||||
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"> |
||||
</head> |
||||
<body> |
||||
<form id="data_completion" name="data_completion" method="post" action="<?php echo $url?>">
|
||||
Téléphone : <input type="text" name="phone_number" /> |
||||
<input type="submit" name="submit" value="Submit" /> |
||||
</form> |
||||
</body> |
||||
</html> |
||||
<?php |
||||
if (isset($_POST['submit'])){ |
||||
$u = UserManager::get_user_info_by_id($_SESSION['conditional_login']['uid']); |
||||
$u['phone'] = $_POST['phone_number']; |
||||
$password = null; // we don't want to change the password |
||||
$updated = UserManager::update_user($u['user_id'], $u['firstname'], $u['lastname'], $u['username'], $password, $u['auth_source'], $u['email'], $u['status'], $u['official_code'], $u['phone'], $u['picture_uri'], $u['expiration_date'], $u['active'], $u['creator_id'], $u['hr_dept_id'], $u['extra'], $u['language'],''); |
||||
if ($updated) { |
||||
ConditionalLogin::login(); |
||||
} |
||||
} |
||||
?> |
@ -0,0 +1,32 @@ |
||||
<?php |
||||
/* |
||||
This scrip is included by local.inc.php to redirect users to some url if some conditions are satisfied. Please populate the $dc_conditions array with a conditional function and an url. If the conditional function returns true the user will be redirected to URL at login |
||||
|
||||
This array must be filled for this module to work. This is an example asking the user to enter his phone number if it is empty. Note you can enter more than one condition in the array. They will be checked in the array order. |
||||
*/ |
||||
$dc_conditions = array(); |
||||
//array_push($dc_conditions, array( |
||||
// 'conditional_function' => 'dc_check_phone_number', |
||||
// 'url' => api_get_path(WEB_PATH).'main/auth/conditional_login/complete_phone_number.php' |
||||
//)); |
||||
//array_push($dc_conditions, array( |
||||
// 'conditional_function' => 'dc_check_first_login', |
||||
// 'url' => api_get_path(WEB_PATH).'main/auth/conditional_login/first_login.php' |
||||
//)); |
||||
require_once api_get_path(LIBRARY_PATH).'usermanager.lib.php'; |
||||
/* |
||||
Please implements the functions of the $dc_conditions array. Each of these fucntion will take a user array (user_id, username, password (crypted), auth_sourcen, active, expiration_date) |
||||
*/ |
||||
function dc_check_phone_number($user){ |
||||
$uInfo = UserManager::get_user_info_by_id($user['user_id']); |
||||
if ( empty($uInfo['phone'])) { |
||||
return true; |
||||
} |
||||
return false; |
||||
} |
||||
|
||||
function dc_check_first_login($user){ |
||||
$uInfo = UserManager::get_user_info_by_id($user['user_id']); |
||||
return(($uInfo['extra']['already_logged_in'] === 'false')); |
||||
} |
||||
?> |
@ -0,0 +1,165 @@ |
||||
<?php |
||||
/* |
||||
Template to automatically create a new user with information from anywhere. |
||||
This file is loaded by main/inc/local.inc.php |
||||
To use it please add this line to main/inc/conf/configuration.php : |
||||
$extAuthSource["external_logininfo"]["newUser"] = $_configuration['root_sys'].$_configuration['code_append']."auth/external_logininfo/newUser.php"; |
||||
|
||||
You also have to implements the external_get_user_info function in this file. |
||||
*/ |
||||
require_once(api_get_path(LIBRARY_PATH).'usermanager.lib.php'); |
||||
require_once(api_get_path(LIBRARY_PATH).'course.lib.php'); |
||||
define('USERINFO_TABLE', 'userinfo'); |
||||
define('DEFAULT_PASSWORD', 'boumbalah'); |
||||
|
||||
//TODO : Please implements this function for this module to work. |
||||
/** |
||||
* Gets user info from external source |
||||
* @param string login |
||||
* @param string password |
||||
* @return user array with at least the following fields: |
||||
* firstname |
||||
* lastname |
||||
* status |
||||
* email |
||||
* login |
||||
* password |
||||
* or false if no data |
||||
**/ |
||||
function external_get_user_info($login, $password){ |
||||
//Those are the mandatory fields for user creation. |
||||
//See external_add_user function for all the fields you can have. |
||||
if ($password != DEFAULT_PASSWORD) { |
||||
return false; |
||||
} |
||||
$table = USERINFO_TABLE; |
||||
$sql = "SELECT * from $table where username='".Database::escape_string($login)."'"; |
||||
$result = Database::query($sql); |
||||
|
||||
if (Database::num_rows($result) == 0 ) { //false password |
||||
return false; |
||||
} |
||||
$user_info = Database::fetch_assoc($result); |
||||
// User status |
||||
$admin = false; |
||||
switch($user_info['status']){ |
||||
case 'admin': |
||||
$status = COURSEMANAGER; |
||||
$admin = true; |
||||
break; |
||||
case 'teacher': |
||||
$status = COURSEMANAGER; |
||||
break; |
||||
case 'user': |
||||
$status = STUDENT; |
||||
break; |
||||
default: |
||||
$status = STUDENT; |
||||
} |
||||
// Language |
||||
switch($user_info['language']){ |
||||
case 'FR' : |
||||
$language = 'french'; |
||||
break; |
||||
case 'EN' : |
||||
$language = 'english'; |
||||
break; |
||||
default : |
||||
$language = 'english'; |
||||
break; |
||||
} |
||||
|
||||
$u = array( |
||||
'firstname' => $user_info['firstname'], |
||||
'lastname' => $user_info['lastname'], |
||||
'status' => $status, |
||||
'admin' => $admin, |
||||
'email' => $user_info['email'], |
||||
'login' => $user_info['username'], |
||||
'language' => $language, |
||||
'password' => DEFAULT_PASSWORD, |
||||
'courses' => $user_info['courses'], |
||||
'profile_link' => $user_info['profile_link'], |
||||
'worldwide_bu' => $user_info['worlwide_bu'], |
||||
'manager' => $user_info['manager'], |
||||
'country_bu' => $user_info['country_bu'], |
||||
'extra' => array( |
||||
'position_title' => $user_info['position_title'], |
||||
'country' => $user_info['country'], |
||||
'job_family' => $user_info['job_family'], |
||||
'update_type' => 'external_logininfo') |
||||
); |
||||
|
||||
return $u; //Please return false if user does not exist |
||||
//return false; |
||||
} |
||||
|
||||
/** |
||||
* Return an array with all user info |
||||
* @param associative array with at least thes fields setted : |
||||
firstname, lastname, status, email, login, password |
||||
* @return mixed new user id - if the new user creation succeeds, false otherwise |
||||
**/ |
||||
function external_add_user($u){ |
||||
//Setting default |
||||
if (! isset($u['official_code']) ) |
||||
$u['official_code'] = ''; |
||||
if (! isset($u['language']) ) |
||||
$u['language'] = ''; |
||||
if (! isset($u['phone']) ) |
||||
$u['phone'] = ''; |
||||
if (! isset($u['picture_uri']) ) |
||||
$u['picture_uri'] = ''; |
||||
if (! isset($u['auth_source']) ) |
||||
$u['auth_source'] = PLATFORM_AUTH_SOURCE; |
||||
if (! isset($u['expiration_date']) ) |
||||
$u['expiration_date'] = '0000-00-00 00:00:00'; |
||||
if (! isset($u['active']) ) |
||||
$u['active'] = 1; |
||||
if (! isset($u['hr_dept_id']) ) |
||||
$u['hr_dept_id'] = 0; //id of responsible HR |
||||
if (! isset($u['extra']) ) |
||||
$u['extra'] = null; |
||||
if (! isset($u['encrypt_method']) ) |
||||
$u['encrypt_method'] = ''; |
||||
|
||||
$chamilo_uid = UserManager::create_user($u['firstname'], $u['lastname'],$u['status'], $u['email'], $u['login'], $u['password'], $u['official_code'], $u['language'], $u['phone'],$u['picture_uri'], $u['auth_source'], $u['expiration_date'], $u['active'], $u['hr_dept_id'], $u['extra'], $u['encrypt_method']); |
||||
return $chamilo_uid; |
||||
} |
||||
|
||||
|
||||
//MAIN CODE |
||||
|
||||
//$login and $password variables are setted in main/inc/local.inc.php |
||||
|
||||
$user = external_get_user_info($login, $password); |
||||
|
||||
if ($user !== false && ($chamilo_uid = external_add_user($user)) !== false) { |
||||
//log in the user |
||||
$loginFailed = false; |
||||
$_user['user_id'] = $chamilo_uid; |
||||
api_session_register('_user'); |
||||
//Autosubscribe to courses |
||||
if(!empty($user['courses'])){ |
||||
$autoSubscribe = explode('|', $user['courses']); |
||||
foreach ($autoSubscribe as $code) { |
||||
if (CourseManager::course_exists($code)) { |
||||
CourseManager::subscribe_user($_user['user_id'], $code); |
||||
} |
||||
} |
||||
} |
||||
// Is User Admin ? |
||||
if ($user['admin']){ |
||||
$is_platformAdmin = true; |
||||
Database::query("INSERT INTO admin values ('$chamilo_uid')"); |
||||
} |
||||
// Can user create course |
||||
$is_allowedCreateCourse = (bool) (($user['status'] == COURSEMANAGER) or (api_get_setting('drhCourseManagerRights') and $user['status'] == SESSIONADMIN)); |
||||
|
||||
event_login(); |
||||
} else { |
||||
$loginFailed = true; |
||||
unset($_user['user_id']); |
||||
$uidReset = false; |
||||
} |
||||
?> |
@ -0,0 +1,127 @@ |
||||
<?php //Script loaded by local.inc.php providing update user information of type external_logininfo.
|
||||
/* |
||||
This script must not exit. |
||||
*/ |
||||
require_once(api_get_path(LIBRARY_PATH).'usermanager.lib.php'); |
||||
require_once(api_get_path(LIBRARY_PATH).'course.lib.php'); |
||||
define('USERINFO_TABLE', 'userinfo'); |
||||
//TODO : Please implements this function for this module to work. |
||||
/** |
||||
* Gets user info from external source |
||||
* @param string login |
||||
* @param string password |
||||
* @return user array with at least the following fields: |
||||
* firstname |
||||
* lastname |
||||
* status |
||||
* email |
||||
* login |
||||
* password |
||||
* or false if no data |
||||
**/ |
||||
function external_get_user_info($login, $password){ |
||||
//Those are the mandatory fields for user creation. |
||||
//See external_add_user function for all the fields you can have. |
||||
$table = USERINFO_TABLE; |
||||
$sql = "SELECT * from $table where username='".Database::escape_string($login)."'"; |
||||
$result = Database::query($sql); |
||||
|
||||
if (Database::num_rows($result) == 0 ) { //false password |
||||
return false; |
||||
} |
||||
$user_info = Database::fetch_assoc($result); |
||||
// User status |
||||
$admin = false; |
||||
switch($user_info['status']){ |
||||
case 'admin': |
||||
$status = COURSEMANAGER; |
||||
$admin = true; |
||||
break; |
||||
case 'teacher': |
||||
$status = COURSEMANAGER; |
||||
break; |
||||
case 'user': |
||||
$status = STUDENT; |
||||
break; |
||||
default: |
||||
$status = STUDENT; |
||||
} |
||||
// Language |
||||
switch($user_info['language']){ |
||||
case 'FR' : |
||||
$language = 'french'; |
||||
break; |
||||
case 'EN' : |
||||
$language = 'english'; |
||||
break; |
||||
default : |
||||
$language = 'english'; |
||||
break; |
||||
} |
||||
|
||||
$u = array( |
||||
'firstname' => $user_info['firstname'], |
||||
'lastname' => $user_info['lastname'], |
||||
'status' => $status, |
||||
'admin' => $admin, |
||||
'email' => $user_info['email'], |
||||
'login' => $user_info['username'], |
||||
'language' => $language, |
||||
'password' => DEFAULT_PASSWORD, |
||||
'courses' => $user_info['courses'], |
||||
'profile_link' => $user_info['profile_link'], |
||||
'worldwide_bu' => $user_info['worlwide_bu'], |
||||
'manager' => $user_info['manager'], |
||||
'country_bu' => $user_info['country_bu'], |
||||
'extra' => array( |
||||
'position_title' => $user_info['position_title'], |
||||
'country' => $user_info['country'], |
||||
'job_family' => $user_info['job_family'], |
||||
'update_type' => 'external_logininfo') |
||||
); |
||||
|
||||
return $u; //Please return false if user does not exist |
||||
} |
||||
|
||||
/** |
||||
* update user info in database |
||||
**/ |
||||
function external_update_user($u){ |
||||
$updated = UserManager::update_user($u['user_id'], $u['firstname'], $u['lastname'], $u['login'], null, $u['auth_source'], $u['email'], $u['status'], $u['official_code'], $u['phone'], $u['picture_uri'], $u['expiration_date'], $u['active'], $u['creator_id'], $u['hr_dept_id'], $u['extra'], $u['language'],''); |
||||
if(!empty($user['courses'])){ |
||||
$autoSubscribe = explode('|', $u['courses']); |
||||
foreach ($autoSubscribe as $code) { |
||||
if (CourseManager::course_exists($code)) { |
||||
CourseManager::subscribe_user($_user['user_id'], $code); |
||||
} |
||||
} |
||||
} |
||||
// Is User Admin ? |
||||
if ($user['admin']){ |
||||
$is_platformAdmin = true; |
||||
Database::query("INSERT INTO admin values ('$chamilo_uid')"); |
||||
} |
||||
|
||||
} |
||||
//MAIN CODE |
||||
|
||||
//$uData variable is set in local.inc.php |
||||
$user = UserManager::get_user_info_by_id($uData['user_id']); |
||||
$new_user = external_get_user_info($login); |
||||
$user['firstname'] = $new_user['firstname']; |
||||
$user['lastname'] = $new_user['lastname']; |
||||
$user['status'] = $new_user['status']; |
||||
$user['admin'] = $new_user['admin']; |
||||
$user['email'] = $new_user['email']; |
||||
$user['username'] = $new_user['login']; |
||||
$user['profile_link'] = $new_user['profile_link']; |
||||
$user['worldwide_bu'] = $new_user['worldwide_bu']; |
||||
$user['manager'] = $new_user['manager']; |
||||
$user['country_bu'] = $new_user['country_bu']; |
||||
$user['extra'] = $new_user['extra']; |
||||
|
||||
if ($new_user !== false) { |
||||
$new_user['user_id'] = $uData['user_id']; |
||||
external_update_user($new_user); |
||||
} |
||||
?> |
@ -0,0 +1,538 @@ |
||||
/* |
||||
* File: demo_table.css |
||||
* CVS: $Id$ |
||||
* Description: CSS descriptions for DataTables demo pages |
||||
* Author: Allan Jardine |
||||
* Created: Tue May 12 06:47:22 BST 2009 |
||||
* Modified: $Date$ by $Author$ |
||||
* Language: CSS |
||||
* Project: DataTables |
||||
* |
||||
* Copyright 2009 Allan Jardine. All Rights Reserved. |
||||
* |
||||
* *************************************************************************** |
||||
* DESCRIPTION |
||||
* |
||||
* The styles given here are suitable for the demos that are used with the standard DataTables |
||||
* distribution (see www.datatables.net). You will most likely wish to modify these styles to |
||||
* meet the layout requirements of your site. |
||||
* |
||||
* Common issues: |
||||
* 'full_numbers' pagination - I use an extra selector on the body tag to ensure that there is |
||||
* no conflict between the two pagination types. If you want to use full_numbers pagination |
||||
* ensure that you either have "example_alt_pagination" as a body class name, or better yet, |
||||
* modify that selector. |
||||
* Note that the path used for Images is relative. All images are by default located in |
||||
* images/dataTable/ - relative to this CSS file. |
||||
*/ |
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
||||
* DataTables features |
||||
*/ |
||||
|
||||
.dataTables_wrapper { |
||||
position: relative; |
||||
min-height: 302px; |
||||
clear: both; |
||||
_height: 302px; |
||||
zoom: 1; /* Feeling sorry for IE */ |
||||
} |
||||
|
||||
.dataTables_processing { |
||||
position: absolute; |
||||
top: 50%; |
||||
left: 50%; |
||||
width: 250px; |
||||
height: 30px; |
||||
margin-left: -125px; |
||||
margin-top: -15px; |
||||
padding: 14px 0 2px 0; |
||||
border: 1px solid #ddd; |
||||
text-align: center; |
||||
color: #999; |
||||
font-size: 14px; |
||||
background-color: white; |
||||
} |
||||
|
||||
.dataTables_length { |
||||
width: 40%; |
||||
float: left; |
||||
} |
||||
|
||||
.dataTables_filter { |
||||
width: 50%; |
||||
float: right; |
||||
text-align: right; |
||||
} |
||||
|
||||
.dataTables_info { |
||||
width: 60%; |
||||
float: left; |
||||
} |
||||
|
||||
.dataTables_paginate { |
||||
width: 44px; |
||||
* width: 50px; |
||||
float: right; |
||||
text-align: right; |
||||
} |
||||
|
||||
/* Pagination nested */ |
||||
.paginate_disabled_previous, .paginate_enabled_previous, .paginate_disabled_next, .paginate_enabled_next { |
||||
height: 19px; |
||||
width: 19px; |
||||
margin-left: 3px; |
||||
float: left; |
||||
} |
||||
|
||||
.paginate_disabled_previous { |
||||
background-image: url('images/dataTale/back_disabled.jpg'); |
||||
} |
||||
|
||||
.paginate_enabled_previous { |
||||
background-image: url('images/dataTable/back_enabled.jpg'); |
||||
} |
||||
|
||||
.paginate_disabled_next { |
||||
background-image: url('images/dataTable/forward_disabled.jpg'); |
||||
} |
||||
|
||||
.paginate_enabled_next { |
||||
background-image: url('images/dataTable/forward_enabled.jpg'); |
||||
} |
||||
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
||||
* DataTables display |
||||
*/ |
||||
table.display { |
||||
margin: 0 auto; |
||||
clear: both; |
||||
width: 100%; |
||||
|
||||
/* Note Firefox 3.5 and before have a bug with border-collapse |
||||
* ( https://bugzilla.mozilla.org/show%5Fbug.cgi?id=155955 ) |
||||
* border-spacing: 0; is one possible option. Conditional-css.com is |
||||
* useful for this kind of thing |
||||
* |
||||
* Further note IE 6/7 has problems when calculating widths with border width. |
||||
* It subtracts one px relative to the other browsers from the first column, and |
||||
* adds one to the end... |
||||
* |
||||
* If you want that effect I'd suggest setting a border-top/left on th/td's and |
||||
* then filling in the gaps with other borders. |
||||
*/ |
||||
} |
||||
|
||||
table.display thead th { |
||||
padding: 3px 18px 3px 10px; |
||||
border-bottom: 1px solid black; |
||||
font-weight: bold; |
||||
cursor: pointer; |
||||
* cursor: hand; |
||||
} |
||||
|
||||
table.display tfoot th { |
||||
padding: 3px 18px 3px 10px; |
||||
border-top: 1px solid black; |
||||
font-weight: bold; |
||||
} |
||||
|
||||
table.display tr.heading2 td { |
||||
border-bottom: 1px solid #aaa; |
||||
} |
||||
|
||||
table.display td { |
||||
padding: 3px 10px; |
||||
} |
||||
|
||||
table.display td.center { |
||||
text-align: center; |
||||
} |
||||
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
||||
* DataTables sorting |
||||
*/ |
||||
|
||||
.sorting_asc { |
||||
background: url('images/dataTable/sort_asc.png') no-repeat center right; |
||||
} |
||||
|
||||
.sorting_desc { |
||||
background: url('images/dataTable/sort_desc.png') no-repeat center right; |
||||
} |
||||
|
||||
.sorting { |
||||
background: url('images/dataTable/sort_both.png') no-repeat center right; |
||||
} |
||||
|
||||
.sorting_asc_disabled { |
||||
background: url('images/dataTable/sort_asc_disabled.png') no-repeat center right; |
||||
} |
||||
|
||||
.sorting_desc_disabled { |
||||
background: url('images/dataTable/sort_desc_disabled.png') no-repeat center right; |
||||
} |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
||||
* DataTables row classes |
||||
*/ |
||||
table.display tr.odd.gradeA { |
||||
background-color: #ddffdd; |
||||
} |
||||
|
||||
table.display tr.even.gradeA { |
||||
background-color: #eeffee; |
||||
} |
||||
|
||||
table.display tr.odd.gradeC { |
||||
background-color: #ddddff; |
||||
} |
||||
|
||||
table.display tr.even.gradeC { |
||||
background-color: #eeeeff; |
||||
} |
||||
|
||||
table.display tr.odd.gradeX { |
||||
background-color: #ffdddd; |
||||
} |
||||
|
||||
table.display tr.even.gradeX { |
||||
background-color: #ffeeee; |
||||
} |
||||
|
||||
table.display tr.odd.gradeU { |
||||
background-color: #ddd; |
||||
} |
||||
|
||||
table.display tr.even.gradeU { |
||||
background-color: #eee; |
||||
} |
||||
|
||||
|
||||
tr.odd { |
||||
background-color: #E2E4FF; |
||||
} |
||||
|
||||
tr.even { |
||||
background-color: white; |
||||
} |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
||||
* Misc |
||||
*/ |
||||
.dataTables_scroll { |
||||
clear: both; |
||||
} |
||||
|
||||
.dataTables_scrollBody { |
||||
*margin-top: -1px; |
||||
} |
||||
|
||||
.top, .bottom { |
||||
padding: 15px; |
||||
background-color: #F5F5F5; |
||||
border: 1px solid #CCCCCC; |
||||
} |
||||
|
||||
.top .dataTables_info { |
||||
float: none; |
||||
} |
||||
|
||||
.clear { |
||||
clear: both; |
||||
} |
||||
|
||||
.dataTables_empty { |
||||
text-align: center; |
||||
} |
||||
|
||||
tfoot input { |
||||
margin: 0.5em 0; |
||||
width: 100%; |
||||
color: #444; |
||||
} |
||||
|
||||
tfoot input.search_init { |
||||
color: #999; |
||||
} |
||||
|
||||
td.group { |
||||
background-color: #d1cfd0; |
||||
border-bottom: 2px solid #A19B9E; |
||||
border-top: 2px solid #A19B9E; |
||||
} |
||||
|
||||
td.details { |
||||
background-color: #d1cfd0; |
||||
border: 2px solid #A19B9E; |
||||
} |
||||
|
||||
|
||||
.example_alt_pagination div.dataTables_info { |
||||
width: 40%; |
||||
} |
||||
|
||||
.paging_full_numbers { |
||||
width: 400px; |
||||
height: 22px; |
||||
line-height: 22px; |
||||
} |
||||
|
||||
.paging_full_numbers span.paginate_button, |
||||
.paging_full_numbers span.paginate_active { |
||||
border: 1px solid #aaa; |
||||
-webkit-border-radius: 5px; |
||||
-moz-border-radius: 5px; |
||||
padding: 2px 5px; |
||||
margin: 0 3px; |
||||
cursor: pointer; |
||||
*cursor: hand; |
||||
} |
||||
|
||||
.paging_full_numbers span.paginate_button { |
||||
background-color: #ddd; |
||||
} |
||||
|
||||
.paging_full_numbers span.paginate_button:hover { |
||||
background-color: #ccc; |
||||
} |
||||
|
||||
.paging_full_numbers span.paginate_active { |
||||
background-color: #99B3FF; |
||||
} |
||||
|
||||
table.display tr.even.row_selected td { |
||||
background-color: #B0BED9; |
||||
} |
||||
|
||||
table.display tr.odd.row_selected td { |
||||
background-color: #9FAFD1; |
||||
} |
||||
|
||||
|
||||
/* |
||||
* Sorting classes for columns |
||||
*/ |
||||
/* For the standard odd/even */ |
||||
tr.odd td.sorting_1 { |
||||
background-color: #D3D6FF; |
||||
} |
||||
|
||||
tr.odd td.sorting_2 { |
||||
background-color: #DADCFF; |
||||
} |
||||
|
||||
tr.odd td.sorting_3 { |
||||
background-color: #E0E2FF; |
||||
} |
||||
|
||||
tr.even td.sorting_1 { |
||||
background-color: #EAEBFF; |
||||
} |
||||
|
||||
tr.even td.sorting_2 { |
||||
background-color: #F2F3FF; |
||||
} |
||||
|
||||
tr.even td.sorting_3 { |
||||
background-color: #F9F9FF; |
||||
} |
||||
|
||||
|
||||
/* For the Conditional-CSS grading rows */ |
||||
/* |
||||
Colour calculations (based off the main row colours) |
||||
Level 1: |
||||
dd > c4 |
||||
ee > d5 |
||||
Level 2: |
||||
dd > d1 |
||||
ee > e2 |
||||
*/ |
||||
tr.odd.gradeA td.sorting_1 { |
||||
background-color: #c4ffc4; |
||||
} |
||||
|
||||
tr.odd.gradeA td.sorting_2 { |
||||
background-color: #d1ffd1; |
||||
} |
||||
|
||||
tr.odd.gradeA td.sorting_3 { |
||||
background-color: #d1ffd1; |
||||
} |
||||
|
||||
tr.even.gradeA td.sorting_1 { |
||||
background-color: #d5ffd5; |
||||
} |
||||
|
||||
tr.even.gradeA td.sorting_2 { |
||||
background-color: #e2ffe2; |
||||
} |
||||
|
||||
tr.even.gradeA td.sorting_3 { |
||||
background-color: #e2ffe2; |
||||
} |
||||
|
||||
tr.odd.gradeC td.sorting_1 { |
||||
background-color: #c4c4ff; |
||||
} |
||||
|
||||
tr.odd.gradeC td.sorting_2 { |
||||
background-color: #d1d1ff; |
||||
} |
||||
|
||||
tr.odd.gradeC td.sorting_3 { |
||||
background-color: #d1d1ff; |
||||
} |
||||
|
||||
tr.even.gradeC td.sorting_1 { |
||||
background-color: #d5d5ff; |
||||
} |
||||
|
||||
tr.even.gradeC td.sorting_2 { |
||||
background-color: #e2e2ff; |
||||
} |
||||
|
||||
tr.even.gradeC td.sorting_3 { |
||||
background-color: #e2e2ff; |
||||
} |
||||
|
||||
tr.odd.gradeX td.sorting_1 { |
||||
background-color: #ffc4c4; |
||||
} |
||||
|
||||
tr.odd.gradeX td.sorting_2 { |
||||
background-color: #ffd1d1; |
||||
} |
||||
|
||||
tr.odd.gradeX td.sorting_3 { |
||||
background-color: #ffd1d1; |
||||
} |
||||
|
||||
tr.even.gradeX td.sorting_1 { |
||||
background-color: #ffd5d5; |
||||
} |
||||
|
||||
tr.even.gradeX td.sorting_2 { |
||||
background-color: #ffe2e2; |
||||
} |
||||
|
||||
tr.even.gradeX td.sorting_3 { |
||||
background-color: #ffe2e2; |
||||
} |
||||
|
||||
tr.odd.gradeU td.sorting_1 { |
||||
background-color: #c4c4c4; |
||||
} |
||||
|
||||
tr.odd.gradeU td.sorting_2 { |
||||
background-color: #d1d1d1; |
||||
} |
||||
|
||||
tr.odd.gradeU td.sorting_3 { |
||||
background-color: #d1d1d1; |
||||
} |
||||
|
||||
tr.even.gradeU td.sorting_1 { |
||||
background-color: #d5d5d5; |
||||
} |
||||
|
||||
tr.even.gradeU td.sorting_2 { |
||||
background-color: #e2e2e2; |
||||
} |
||||
|
||||
tr.even.gradeU td.sorting_3 { |
||||
background-color: #e2e2e2; |
||||
} |
||||
|
||||
|
||||
/* |
||||
* Row highlighting example |
||||
*/ |
||||
.ex_highlight #example tbody tr.even:hover, #example tbody tr.even td.highlighted { |
||||
background-color: #ECFFB3; |
||||
} |
||||
|
||||
.ex_highlight #example tbody tr.odd:hover, #example tbody tr.odd td.highlighted { |
||||
background-color: #E6FF99; |
||||
} |
||||
|
||||
.ex_highlight_row #example tr.even:hover { |
||||
background-color: #ECFFB3; |
||||
} |
||||
|
||||
.ex_highlight_row #example tr.even:hover td.sorting_1 { |
||||
background-color: #DDFF75; |
||||
} |
||||
|
||||
.ex_highlight_row #example tr.even:hover td.sorting_2 { |
||||
background-color: #E7FF9E; |
||||
} |
||||
|
||||
.ex_highlight_row #example tr.even:hover td.sorting_3 { |
||||
background-color: #E2FF89; |
||||
} |
||||
|
||||
.ex_highlight_row #example tr.odd:hover { |
||||
background-color: #E6FF99; |
||||
} |
||||
|
||||
.ex_highlight_row #example tr.odd:hover td.sorting_1 { |
||||
background-color: #D6FF5C; |
||||
} |
||||
|
||||
.ex_highlight_row #example tr.odd:hover td.sorting_2 { |
||||
background-color: #E0FF84; |
||||
} |
||||
|
||||
.ex_highlight_row #example tr.odd:hover td.sorting_3 { |
||||
background-color: #DBFF70; |
||||
} |
||||
|
||||
|
||||
/* |
||||
* KeyTable |
||||
*/ |
||||
table.KeyTable td { |
||||
border: 3px solid transparent; |
||||
} |
||||
|
||||
table.KeyTable td.focus { |
||||
border: 3px solid #3366FF; |
||||
} |
||||
|
||||
table.display tr.gradeA { |
||||
background-color: #eeffee; |
||||
} |
||||
|
||||
table.display tr.gradeC { |
||||
background-color: #ddddff; |
||||
} |
||||
|
||||
table.display tr.gradeX { |
||||
background-color: #ffdddd; |
||||
} |
||||
|
||||
table.display tr.gradeU { |
||||
background-color: #ddd; |
||||
} |
||||
|
||||
div.box { |
||||
height: 100px; |
||||
padding: 10px; |
||||
overflow: auto; |
||||
border: 1px solid #8080FF; |
||||
background-color: #E5E5FF; |
||||
} |
After Width: | Height: | Size: 612 B |
After Width: | Height: | Size: 807 B |
After Width: | Height: | Size: 894 B |
After Width: | Height: | Size: 635 B |
After Width: | Height: | Size: 852 B |
After Width: | Height: | Size: 263 B |
After Width: | Height: | Size: 252 B |
After Width: | Height: | Size: 282 B |
After Width: | Height: | Size: 260 B |
After Width: | Height: | Size: 251 B |
@ -0,0 +1,538 @@ |
||||
/* |
||||
* File: demo_table.css |
||||
* CVS: $Id$ |
||||
* Description: CSS descriptions for DataTables demo pages |
||||
* Author: Allan Jardine |
||||
* Created: Tue May 12 06:47:22 BST 2009 |
||||
* Modified: $Date$ by $Author$ |
||||
* Language: CSS |
||||
* Project: DataTables |
||||
* |
||||
* Copyright 2009 Allan Jardine. All Rights Reserved. |
||||
* |
||||
* *************************************************************************** |
||||
* DESCRIPTION |
||||
* |
||||
* The styles given here are suitable for the demos that are used with the standard DataTables |
||||
* distribution (see www.datatables.net). You will most likely wish to modify these styles to |
||||
* meet the layout requirements of your site. |
||||
* |
||||
* Common issues: |
||||
* 'full_numbers' pagination - I use an extra selector on the body tag to ensure that there is |
||||
* no conflict between the two pagination types. If you want to use full_numbers pagination |
||||
* ensure that you either have "example_alt_pagination" as a body class name, or better yet, |
||||
* modify that selector. |
||||
* Note that the path used for Images is relative. All images are by default located in |
||||
* images/dataTable/ - relative to this CSS file. |
||||
*/ |
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
||||
* DataTables features |
||||
*/ |
||||
|
||||
.dataTables_wrapper { |
||||
position: relative; |
||||
min-height: 302px; |
||||
clear: both; |
||||
_height: 302px; |
||||
zoom: 1; /* Feeling sorry for IE */ |
||||
} |
||||
|
||||
.dataTables_processing { |
||||
position: absolute; |
||||
top: 50%; |
||||
left: 50%; |
||||
width: 250px; |
||||
height: 30px; |
||||
margin-left: -125px; |
||||
margin-top: -15px; |
||||
padding: 14px 0 2px 0; |
||||
border: 1px solid #ddd; |
||||
text-align: center; |
||||
color: #999; |
||||
font-size: 14px; |
||||
background-color: white; |
||||
} |
||||
|
||||
.dataTables_length { |
||||
width: 40%; |
||||
float: left; |
||||
} |
||||
|
||||
.dataTables_filter { |
||||
width: 50%; |
||||
float: right; |
||||
text-align: right; |
||||
} |
||||
|
||||
.dataTables_info { |
||||
width: 60%; |
||||
float: left; |
||||
} |
||||
|
||||
.dataTables_paginate { |
||||
width: 44px; |
||||
* width: 50px; |
||||
float: right; |
||||
text-align: right; |
||||
} |
||||
|
||||
/* Pagination nested */ |
||||
.paginate_disabled_previous, .paginate_enabled_previous, .paginate_disabled_next, .paginate_enabled_next { |
||||
height: 19px; |
||||
width: 19px; |
||||
margin-left: 3px; |
||||
float: left; |
||||
} |
||||
|
||||
.paginate_disabled_previous { |
||||
background-image: url('images/dataTale/back_disabled.jpg'); |
||||
} |
||||
|
||||
.paginate_enabled_previous { |
||||
background-image: url('images/dataTable/back_enabled.jpg'); |
||||
} |
||||
|
||||
.paginate_disabled_next { |
||||
background-image: url('images/dataTable/forward_disabled.jpg'); |
||||
} |
||||
|
||||
.paginate_enabled_next { |
||||
background-image: url('images/dataTable/forward_enabled.jpg'); |
||||
} |
||||
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
||||
* DataTables display |
||||
*/ |
||||
table.display { |
||||
margin: 0 auto; |
||||
clear: both; |
||||
width: 100%; |
||||
|
||||
/* Note Firefox 3.5 and before have a bug with border-collapse |
||||
* ( https://bugzilla.mozilla.org/show%5Fbug.cgi?id=155955 ) |
||||
* border-spacing: 0; is one possible option. Conditional-css.com is |
||||
* useful for this kind of thing |
||||
* |
||||
* Further note IE 6/7 has problems when calculating widths with border width. |
||||
* It subtracts one px relative to the other browsers from the first column, and |
||||
* adds one to the end... |
||||
* |
||||
* If you want that effect I'd suggest setting a border-top/left on th/td's and |
||||
* then filling in the gaps with other borders. |
||||
*/ |
||||
} |
||||
|
||||
table.display thead th { |
||||
padding: 3px 18px 3px 10px; |
||||
border-bottom: 1px solid black; |
||||
font-weight: bold; |
||||
cursor: pointer; |
||||
* cursor: hand; |
||||
} |
||||
|
||||
table.display tfoot th { |
||||
padding: 3px 18px 3px 10px; |
||||
border-top: 1px solid black; |
||||
font-weight: bold; |
||||
} |
||||
|
||||
table.display tr.heading2 td { |
||||
border-bottom: 1px solid #aaa; |
||||
} |
||||
|
||||
table.display td { |
||||
padding: 3px 10px; |
||||
} |
||||
|
||||
table.display td.center { |
||||
text-align: center; |
||||
} |
||||
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
||||
* DataTables sorting |
||||
*/ |
||||
|
||||
.sorting_asc { |
||||
background: url('images/dataTable/sort_asc.png') no-repeat center right; |
||||
} |
||||
|
||||
.sorting_desc { |
||||
background: url('images/dataTable/sort_desc.png') no-repeat center right; |
||||
} |
||||
|
||||
.sorting { |
||||
background: url('images/dataTable/sort_both.png') no-repeat center right; |
||||
} |
||||
|
||||
.sorting_asc_disabled { |
||||
background: url('images/dataTable/sort_asc_disabled.png') no-repeat center right; |
||||
} |
||||
|
||||
.sorting_desc_disabled { |
||||
background: url('images/dataTable/sort_desc_disabled.png') no-repeat center right; |
||||
} |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
||||
* DataTables row classes |
||||
*/ |
||||
table.display tr.odd.gradeA { |
||||
background-color: #ddffdd; |
||||
} |
||||
|
||||
table.display tr.even.gradeA { |
||||
background-color: #eeffee; |
||||
} |
||||
|
||||
table.display tr.odd.gradeC { |
||||
background-color: #ddddff; |
||||
} |
||||
|
||||
table.display tr.even.gradeC { |
||||
background-color: #eeeeff; |
||||
} |
||||
|
||||
table.display tr.odd.gradeX { |
||||
background-color: #ffdddd; |
||||
} |
||||
|
||||
table.display tr.even.gradeX { |
||||
background-color: #ffeeee; |
||||
} |
||||
|
||||
table.display tr.odd.gradeU { |
||||
background-color: #ddd; |
||||
} |
||||
|
||||
table.display tr.even.gradeU { |
||||
background-color: #eee; |
||||
} |
||||
|
||||
|
||||
tr.odd { |
||||
background-color: #E2E4FF; |
||||
} |
||||
|
||||
tr.even { |
||||
background-color: white; |
||||
} |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
||||
* Misc |
||||
*/ |
||||
.dataTables_scroll { |
||||
clear: both; |
||||
} |
||||
|
||||
.dataTables_scrollBody { |
||||
*margin-top: -1px; |
||||
} |
||||
|
||||
.top, .bottom { |
||||
padding: 15px; |
||||
background-color: #F5F5F5; |
||||
border: 1px solid #CCCCCC; |
||||
} |
||||
|
||||
.top .dataTables_info { |
||||
float: none; |
||||
} |
||||
|
||||
.clear { |
||||
clear: both; |
||||
} |
||||
|
||||
.dataTables_empty { |
||||
text-align: center; |
||||
} |
||||
|
||||
tfoot input { |
||||
margin: 0.5em 0; |
||||
width: 100%; |
||||
color: #444; |
||||
} |
||||
|
||||
tfoot input.search_init { |
||||
color: #999; |
||||
} |
||||
|
||||
td.group { |
||||
background-color: #d1cfd0; |
||||
border-bottom: 2px solid #A19B9E; |
||||
border-top: 2px solid #A19B9E; |
||||
} |
||||
|
||||
td.details { |
||||
background-color: #d1cfd0; |
||||
border: 2px solid #A19B9E; |
||||
} |
||||
|
||||
|
||||
.example_alt_pagination div.dataTables_info { |
||||
width: 40%; |
||||
} |
||||
|
||||
.paging_full_numbers { |
||||
width: 400px; |
||||
height: 22px; |
||||
line-height: 22px; |
||||
} |
||||
|
||||
.paging_full_numbers span.paginate_button, |
||||
.paging_full_numbers span.paginate_active { |
||||
border: 1px solid #aaa; |
||||
-webkit-border-radius: 5px; |
||||
-moz-border-radius: 5px; |
||||
padding: 2px 5px; |
||||
margin: 0 3px; |
||||
cursor: pointer; |
||||
*cursor: hand; |
||||
} |
||||
|
||||
.paging_full_numbers span.paginate_button { |
||||
background-color: #ddd; |
||||
} |
||||
|
||||
.paging_full_numbers span.paginate_button:hover { |
||||
background-color: #ccc; |
||||
} |
||||
|
||||
.paging_full_numbers span.paginate_active { |
||||
background-color: #99B3FF; |
||||
} |
||||
|
||||
table.display tr.even.row_selected td { |
||||
background-color: #B0BED9; |
||||
} |
||||
|
||||
table.display tr.odd.row_selected td { |
||||
background-color: #9FAFD1; |
||||
} |
||||
|
||||
|
||||
/* |
||||
* Sorting classes for columns |
||||
*/ |
||||
/* For the standard odd/even */ |
||||
tr.odd td.sorting_1 { |
||||
background-color: #D3D6FF; |
||||
} |
||||
|
||||
tr.odd td.sorting_2 { |
||||
background-color: #DADCFF; |
||||
} |
||||
|
||||
tr.odd td.sorting_3 { |
||||
background-color: #E0E2FF; |
||||
} |
||||
|
||||
tr.even td.sorting_1 { |
||||
background-color: #EAEBFF; |
||||
} |
||||
|
||||
tr.even td.sorting_2 { |
||||
background-color: #F2F3FF; |
||||
} |
||||
|
||||
tr.even td.sorting_3 { |
||||
background-color: #F9F9FF; |
||||
} |
||||
|
||||
|
||||
/* For the Conditional-CSS grading rows */ |
||||
/* |
||||
Colour calculations (based off the main row colours) |
||||
Level 1: |
||||
dd > c4 |
||||
ee > d5 |
||||
Level 2: |
||||
dd > d1 |
||||
ee > e2 |
||||
*/ |
||||
tr.odd.gradeA td.sorting_1 { |
||||
background-color: #c4ffc4; |
||||
} |
||||
|
||||
tr.odd.gradeA td.sorting_2 { |
||||
background-color: #d1ffd1; |
||||
} |
||||
|
||||
tr.odd.gradeA td.sorting_3 { |
||||
background-color: #d1ffd1; |
||||
} |
||||
|
||||
tr.even.gradeA td.sorting_1 { |
||||
background-color: #d5ffd5; |
||||
} |
||||
|
||||
tr.even.gradeA td.sorting_2 { |
||||
background-color: #e2ffe2; |
||||
} |
||||
|
||||
tr.even.gradeA td.sorting_3 { |
||||
background-color: #e2ffe2; |
||||
} |
||||
|
||||
tr.odd.gradeC td.sorting_1 { |
||||
background-color: #c4c4ff; |
||||
} |
||||
|
||||
tr.odd.gradeC td.sorting_2 { |
||||
background-color: #d1d1ff; |
||||
} |
||||
|
||||
tr.odd.gradeC td.sorting_3 { |
||||
background-color: #d1d1ff; |
||||
} |
||||
|
||||
tr.even.gradeC td.sorting_1 { |
||||
background-color: #d5d5ff; |
||||
} |
||||
|
||||
tr.even.gradeC td.sorting_2 { |
||||
background-color: #e2e2ff; |
||||
} |
||||
|
||||
tr.even.gradeC td.sorting_3 { |
||||
background-color: #e2e2ff; |
||||
} |
||||
|
||||
tr.odd.gradeX td.sorting_1 { |
||||
background-color: #ffc4c4; |
||||
} |
||||
|
||||
tr.odd.gradeX td.sorting_2 { |
||||
background-color: #ffd1d1; |
||||
} |
||||
|
||||
tr.odd.gradeX td.sorting_3 { |
||||
background-color: #ffd1d1; |
||||
} |
||||
|
||||
tr.even.gradeX td.sorting_1 { |
||||
background-color: #ffd5d5; |
||||
} |
||||
|
||||
tr.even.gradeX td.sorting_2 { |
||||
background-color: #ffe2e2; |
||||
} |
||||
|
||||
tr.even.gradeX td.sorting_3 { |
||||
background-color: #ffe2e2; |
||||
} |
||||
|
||||
tr.odd.gradeU td.sorting_1 { |
||||
background-color: #c4c4c4; |
||||
} |
||||
|
||||
tr.odd.gradeU td.sorting_2 { |
||||
background-color: #d1d1d1; |
||||
} |
||||
|
||||
tr.odd.gradeU td.sorting_3 { |
||||
background-color: #d1d1d1; |
||||
} |
||||
|
||||
tr.even.gradeU td.sorting_1 { |
||||
background-color: #d5d5d5; |
||||
} |
||||
|
||||
tr.even.gradeU td.sorting_2 { |
||||
background-color: #e2e2e2; |
||||
} |
||||
|
||||
tr.even.gradeU td.sorting_3 { |
||||
background-color: #e2e2e2; |
||||
} |
||||
|
||||
|
||||
/* |
||||
* Row highlighting example |
||||
*/ |
||||
.ex_highlight #example tbody tr.even:hover, #example tbody tr.even td.highlighted { |
||||
background-color: #ECFFB3; |
||||
} |
||||
|
||||
.ex_highlight #example tbody tr.odd:hover, #example tbody tr.odd td.highlighted { |
||||
background-color: #E6FF99; |
||||
} |
||||
|
||||
.ex_highlight_row #example tr.even:hover { |
||||
background-color: #ECFFB3; |
||||
} |
||||
|
||||
.ex_highlight_row #example tr.even:hover td.sorting_1 { |
||||
background-color: #DDFF75; |
||||
} |
||||
|
||||
.ex_highlight_row #example tr.even:hover td.sorting_2 { |
||||
background-color: #E7FF9E; |
||||
} |
||||
|
||||
.ex_highlight_row #example tr.even:hover td.sorting_3 { |
||||
background-color: #E2FF89; |
||||
} |
||||
|
||||
.ex_highlight_row #example tr.odd:hover { |
||||
background-color: #E6FF99; |
||||
} |
||||
|
||||
.ex_highlight_row #example tr.odd:hover td.sorting_1 { |
||||
background-color: #D6FF5C; |
||||
} |
||||
|
||||
.ex_highlight_row #example tr.odd:hover td.sorting_2 { |
||||
background-color: #E0FF84; |
||||
} |
||||
|
||||
.ex_highlight_row #example tr.odd:hover td.sorting_3 { |
||||
background-color: #DBFF70; |
||||
} |
||||
|
||||
|
||||
/* |
||||
* KeyTable |
||||
*/ |
||||
table.KeyTable td { |
||||
border: 3px solid transparent; |
||||
} |
||||
|
||||
table.KeyTable td.focus { |
||||
border: 3px solid #3366FF; |
||||
} |
||||
|
||||
table.display tr.gradeA { |
||||
background-color: #eeffee; |
||||
} |
||||
|
||||
table.display tr.gradeC { |
||||
background-color: #ddddff; |
||||
} |
||||
|
||||
table.display tr.gradeX { |
||||
background-color: #ffdddd; |
||||
} |
||||
|
||||
table.display tr.gradeU { |
||||
background-color: #ddd; |
||||
} |
||||
|
||||
div.box { |
||||
height: 100px; |
||||
padding: 10px; |
||||
overflow: auto; |
||||
border: 1px solid #8080FF; |
||||
background-color: #E5E5FF; |
||||
} |
After Width: | Height: | Size: 612 B |
After Width: | Height: | Size: 807 B |
After Width: | Height: | Size: 894 B |
After Width: | Height: | Size: 635 B |
After Width: | Height: | Size: 852 B |
After Width: | Height: | Size: 263 B |
After Width: | Height: | Size: 252 B |
After Width: | Height: | Size: 282 B |
After Width: | Height: | Size: 260 B |
After Width: | Height: | Size: 251 B |
@ -0,0 +1,538 @@ |
||||
/* |
||||
* File: demo_table.css |
||||
* CVS: $Id$ |
||||
* Description: CSS descriptions for DataTables demo pages |
||||
* Author: Allan Jardine |
||||
* Created: Tue May 12 06:47:22 BST 2009 |
||||
* Modified: $Date$ by $Author$ |
||||
* Language: CSS |
||||
* Project: DataTables |
||||
* |
||||
* Copyright 2009 Allan Jardine. All Rights Reserved. |
||||
* |
||||
* *************************************************************************** |
||||
* DESCRIPTION |
||||
* |
||||
* The styles given here are suitable for the demos that are used with the standard DataTables |
||||
* distribution (see www.datatables.net). You will most likely wish to modify these styles to |
||||
* meet the layout requirements of your site. |
||||
* |
||||
* Common issues: |
||||
* 'full_numbers' pagination - I use an extra selector on the body tag to ensure that there is |
||||
* no conflict between the two pagination types. If you want to use full_numbers pagination |
||||
* ensure that you either have "example_alt_pagination" as a body class name, or better yet, |
||||
* modify that selector. |
||||
* Note that the path used for Images is relative. All images are by default located in |
||||
* images/dataTable/ - relative to this CSS file. |
||||
*/ |
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
||||
* DataTables features |
||||
*/ |
||||
|
||||
.dataTables_wrapper { |
||||
position: relative; |
||||
min-height: 302px; |
||||
clear: both; |
||||
_height: 302px; |
||||
zoom: 1; /* Feeling sorry for IE */ |
||||
} |
||||
|
||||
.dataTables_processing { |
||||
position: absolute; |
||||
top: 50%; |
||||
left: 50%; |
||||
width: 250px; |
||||
height: 30px; |
||||
margin-left: -125px; |
||||
margin-top: -15px; |
||||
padding: 14px 0 2px 0; |
||||
border: 1px solid #ddd; |
||||
text-align: center; |
||||
color: #999; |
||||
font-size: 14px; |
||||
background-color: white; |
||||
} |
||||
|
||||
.dataTables_length { |
||||
width: 40%; |
||||
float: left; |
||||
} |
||||
|
||||
.dataTables_filter { |
||||
width: 50%; |
||||
float: right; |
||||
text-align: right; |
||||
} |
||||
|
||||
.dataTables_info { |
||||
width: 60%; |
||||
float: left; |
||||
} |
||||
|
||||
.dataTables_paginate { |
||||
width: 44px; |
||||
* width: 50px; |
||||
float: right; |
||||
text-align: right; |
||||
} |
||||
|
||||
/* Pagination nested */ |
||||
.paginate_disabled_previous, .paginate_enabled_previous, .paginate_disabled_next, .paginate_enabled_next { |
||||
height: 19px; |
||||
width: 19px; |
||||
margin-left: 3px; |
||||
float: left; |
||||
} |
||||
|
||||
.paginate_disabled_previous { |
||||
background-image: url('images/dataTale/back_disabled.jpg'); |
||||
} |
||||
|
||||
.paginate_enabled_previous { |
||||
background-image: url('images/dataTable/back_enabled.jpg'); |
||||
} |
||||
|
||||
.paginate_disabled_next { |
||||
background-image: url('images/dataTable/forward_disabled.jpg'); |
||||
} |
||||
|
||||
.paginate_enabled_next { |
||||
background-image: url('images/dataTable/forward_enabled.jpg'); |
||||
} |
||||
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
||||
* DataTables display |
||||
*/ |
||||
table.display { |
||||
margin: 0 auto; |
||||
clear: both; |
||||
width: 100%; |
||||
|
||||
/* Note Firefox 3.5 and before have a bug with border-collapse |
||||
* ( https://bugzilla.mozilla.org/show%5Fbug.cgi?id=155955 ) |
||||
* border-spacing: 0; is one possible option. Conditional-css.com is |
||||
* useful for this kind of thing |
||||
* |
||||
* Further note IE 6/7 has problems when calculating widths with border width. |
||||
* It subtracts one px relative to the other browsers from the first column, and |
||||
* adds one to the end... |
||||
* |
||||
* If you want that effect I'd suggest setting a border-top/left on th/td's and |
||||
* then filling in the gaps with other borders. |
||||
*/ |
||||
} |
||||
|
||||
table.display thead th { |
||||
padding: 3px 18px 3px 10px; |
||||
border-bottom: 1px solid black; |
||||
font-weight: bold; |
||||
cursor: pointer; |
||||
* cursor: hand; |
||||
} |
||||
|
||||
table.display tfoot th { |
||||
padding: 3px 18px 3px 10px; |
||||
border-top: 1px solid black; |
||||
font-weight: bold; |
||||
} |
||||
|
||||
table.display tr.heading2 td { |
||||
border-bottom: 1px solid #aaa; |
||||
} |
||||
|
||||
table.display td { |
||||
padding: 3px 10px; |
||||
} |
||||
|
||||
table.display td.center { |
||||
text-align: center; |
||||
} |
||||
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
||||
* DataTables sorting |
||||
*/ |
||||
|
||||
.sorting_asc { |
||||
background: url('images/dataTable/sort_asc.png') no-repeat center right; |
||||
} |
||||
|
||||
.sorting_desc { |
||||
background: url('images/dataTable/sort_desc.png') no-repeat center right; |
||||
} |
||||
|
||||
.sorting { |
||||
background: url('images/dataTable/sort_both.png') no-repeat center right; |
||||
} |
||||
|
||||
.sorting_asc_disabled { |
||||
background: url('images/dataTable/sort_asc_disabled.png') no-repeat center right; |
||||
} |
||||
|
||||
.sorting_desc_disabled { |
||||
background: url('images/dataTable/sort_desc_disabled.png') no-repeat center right; |
||||
} |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
||||
* DataTables row classes |
||||
*/ |
||||
table.display tr.odd.gradeA { |
||||
background-color: #ddffdd; |
||||
} |
||||
|
||||
table.display tr.even.gradeA { |
||||
background-color: #eeffee; |
||||
} |
||||
|
||||
table.display tr.odd.gradeC { |
||||
background-color: #ddddff; |
||||
} |
||||
|
||||
table.display tr.even.gradeC { |
||||
background-color: #eeeeff; |
||||
} |
||||
|
||||
table.display tr.odd.gradeX { |
||||
background-color: #ffdddd; |
||||
} |
||||
|
||||
table.display tr.even.gradeX { |
||||
background-color: #ffeeee; |
||||
} |
||||
|
||||
table.display tr.odd.gradeU { |
||||
background-color: #ddd; |
||||
} |
||||
|
||||
table.display tr.even.gradeU { |
||||
background-color: #eee; |
||||
} |
||||
|
||||
|
||||
tr.odd { |
||||
background-color: #E2E4FF; |
||||
} |
||||
|
||||
tr.even { |
||||
background-color: white; |
||||
} |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
||||
* Misc |
||||
*/ |
||||
.dataTables_scroll { |
||||
clear: both; |
||||
} |
||||
|
||||
.dataTables_scrollBody { |
||||
*margin-top: -1px; |
||||
} |
||||
|
||||
.top, .bottom { |
||||
padding: 15px; |
||||
background-color: #F5F5F5; |
||||
border: 1px solid #CCCCCC; |
||||
} |
||||
|
||||
.top .dataTables_info { |
||||
float: none; |
||||
} |
||||
|
||||
.clear { |
||||
clear: both; |
||||
} |
||||
|
||||
.dataTables_empty { |
||||
text-align: center; |
||||
} |
||||
|
||||
tfoot input { |
||||
margin: 0.5em 0; |
||||
width: 100%; |
||||
color: #444; |
||||
} |
||||
|
||||
tfoot input.search_init { |
||||
color: #999; |
||||
} |
||||
|
||||
td.group { |
||||
background-color: #d1cfd0; |
||||
border-bottom: 2px solid #A19B9E; |
||||
border-top: 2px solid #A19B9E; |
||||
} |
||||
|
||||
td.details { |
||||
background-color: #d1cfd0; |
||||
border: 2px solid #A19B9E; |
||||
} |
||||
|
||||
|
||||
.example_alt_pagination div.dataTables_info { |
||||
width: 40%; |
||||
} |
||||
|
||||
.paging_full_numbers { |
||||
width: 400px; |
||||
height: 22px; |
||||
line-height: 22px; |
||||
} |
||||
|
||||
.paging_full_numbers span.paginate_button, |
||||
.paging_full_numbers span.paginate_active { |
||||
border: 1px solid #aaa; |
||||
-webkit-border-radius: 5px; |
||||
-moz-border-radius: 5px; |
||||
padding: 2px 5px; |
||||
margin: 0 3px; |
||||
cursor: pointer; |
||||
*cursor: hand; |
||||
} |
||||
|
||||
.paging_full_numbers span.paginate_button { |
||||
background-color: #ddd; |
||||
} |
||||
|
||||
.paging_full_numbers span.paginate_button:hover { |
||||
background-color: #ccc; |
||||
} |
||||
|
||||
.paging_full_numbers span.paginate_active { |
||||
background-color: #99B3FF; |
||||
} |
||||
|
||||
table.display tr.even.row_selected td { |
||||
background-color: #B0BED9; |
||||
} |
||||
|
||||
table.display tr.odd.row_selected td { |
||||
background-color: #9FAFD1; |
||||
} |
||||
|
||||
|
||||
/* |
||||
* Sorting classes for columns |
||||
*/ |
||||
/* For the standard odd/even */ |
||||
tr.odd td.sorting_1 { |
||||
background-color: #D3D6FF; |
||||
} |
||||
|
||||
tr.odd td.sorting_2 { |
||||
background-color: #DADCFF; |
||||
} |
||||
|
||||
tr.odd td.sorting_3 { |
||||
background-color: #E0E2FF; |
||||
} |
||||
|
||||
tr.even td.sorting_1 { |
||||
background-color: #EAEBFF; |
||||
} |
||||
|
||||
tr.even td.sorting_2 { |
||||
background-color: #F2F3FF; |
||||
} |
||||
|
||||
tr.even td.sorting_3 { |
||||
background-color: #F9F9FF; |
||||
} |
||||
|
||||
|
||||
/* For the Conditional-CSS grading rows */ |
||||
/* |
||||
Colour calculations (based off the main row colours) |
||||
Level 1: |
||||
dd > c4 |
||||
ee > d5 |
||||
Level 2: |
||||
dd > d1 |
||||
ee > e2 |
||||
*/ |
||||
tr.odd.gradeA td.sorting_1 { |
||||
background-color: #c4ffc4; |
||||
} |
||||
|
||||
tr.odd.gradeA td.sorting_2 { |
||||
background-color: #d1ffd1; |
||||
} |
||||
|
||||
tr.odd.gradeA td.sorting_3 { |
||||
background-color: #d1ffd1; |
||||
} |
||||
|
||||
tr.even.gradeA td.sorting_1 { |
||||
background-color: #d5ffd5; |
||||
} |
||||
|
||||
tr.even.gradeA td.sorting_2 { |
||||
background-color: #e2ffe2; |
||||
} |
||||
|
||||
tr.even.gradeA td.sorting_3 { |
||||
background-color: #e2ffe2; |
||||
} |
||||
|
||||
tr.odd.gradeC td.sorting_1 { |
||||
background-color: #c4c4ff; |
||||
} |
||||
|
||||
tr.odd.gradeC td.sorting_2 { |
||||
background-color: #d1d1ff; |
||||
} |
||||
|
||||
tr.odd.gradeC td.sorting_3 { |
||||
background-color: #d1d1ff; |
||||
} |
||||
|
||||
tr.even.gradeC td.sorting_1 { |
||||
background-color: #d5d5ff; |
||||
} |
||||
|
||||
tr.even.gradeC td.sorting_2 { |
||||
background-color: #e2e2ff; |
||||
} |
||||
|
||||
tr.even.gradeC td.sorting_3 { |
||||
background-color: #e2e2ff; |
||||
} |
||||
|
||||
tr.odd.gradeX td.sorting_1 { |
||||
background-color: #ffc4c4; |
||||
} |
||||
|
||||
tr.odd.gradeX td.sorting_2 { |
||||
background-color: #ffd1d1; |
||||
} |
||||
|
||||
tr.odd.gradeX td.sorting_3 { |
||||
background-color: #ffd1d1; |
||||
} |
||||
|
||||
tr.even.gradeX td.sorting_1 { |
||||
background-color: #ffd5d5; |
||||
} |
||||
|
||||
tr.even.gradeX td.sorting_2 { |
||||
background-color: #ffe2e2; |
||||
} |
||||
|
||||
tr.even.gradeX td.sorting_3 { |
||||
background-color: #ffe2e2; |
||||
} |
||||
|
||||
tr.odd.gradeU td.sorting_1 { |
||||
background-color: #c4c4c4; |
||||
} |
||||
|
||||
tr.odd.gradeU td.sorting_2 { |
||||
background-color: #d1d1d1; |
||||
} |
||||
|
||||
tr.odd.gradeU td.sorting_3 { |
||||
background-color: #d1d1d1; |
||||
} |
||||
|
||||
tr.even.gradeU td.sorting_1 { |
||||
background-color: #d5d5d5; |
||||
} |
||||
|
||||
tr.even.gradeU td.sorting_2 { |
||||
background-color: #e2e2e2; |
||||
} |
||||
|
||||
tr.even.gradeU td.sorting_3 { |
||||
background-color: #e2e2e2; |
||||
} |
||||
|
||||
|
||||
/* |
||||
* Row highlighting example |
||||
*/ |
||||
.ex_highlight #example tbody tr.even:hover, #example tbody tr.even td.highlighted { |
||||
background-color: #ECFFB3; |
||||
} |
||||
|
||||
.ex_highlight #example tbody tr.odd:hover, #example tbody tr.odd td.highlighted { |
||||
background-color: #E6FF99; |
||||
} |
||||
|
||||
.ex_highlight_row #example tr.even:hover { |
||||
background-color: #ECFFB3; |
||||
} |
||||
|
||||
.ex_highlight_row #example tr.even:hover td.sorting_1 { |
||||
background-color: #DDFF75; |
||||
} |
||||
|
||||
.ex_highlight_row #example tr.even:hover td.sorting_2 { |
||||
background-color: #E7FF9E; |
||||
} |
||||
|
||||
.ex_highlight_row #example tr.even:hover td.sorting_3 { |
||||
background-color: #E2FF89; |
||||
} |
||||
|
||||
.ex_highlight_row #example tr.odd:hover { |
||||
background-color: #E6FF99; |
||||
} |
||||
|
||||
.ex_highlight_row #example tr.odd:hover td.sorting_1 { |
||||
background-color: #D6FF5C; |
||||
} |
||||
|
||||
.ex_highlight_row #example tr.odd:hover td.sorting_2 { |
||||
background-color: #E0FF84; |
||||
} |
||||
|
||||
.ex_highlight_row #example tr.odd:hover td.sorting_3 { |
||||
background-color: #DBFF70; |
||||
} |
||||
|
||||
|
||||
/* |
||||
* KeyTable |
||||
*/ |
||||
table.KeyTable td { |
||||
border: 3px solid transparent; |
||||
} |
||||
|
||||
table.KeyTable td.focus { |
||||
border: 3px solid #3366FF; |
||||
} |
||||
|
||||
table.display tr.gradeA { |
||||
background-color: #eeffee; |
||||
} |
||||
|
||||
table.display tr.gradeC { |
||||
background-color: #ddddff; |
||||
} |
||||
|
||||
table.display tr.gradeX { |
||||
background-color: #ffdddd; |
||||
} |
||||
|
||||
table.display tr.gradeU { |
||||
background-color: #ddd; |
||||
} |
||||
|
||||
div.box { |
||||
height: 100px; |
||||
padding: 10px; |
||||
overflow: auto; |
||||
border: 1px solid #8080FF; |
||||
background-color: #E5E5FF; |
||||
} |