You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
899 B
40 lines
899 B
![]()
14 years ago
|
<?php
|
||
|
/* For licensing terms, see /license.txt */
|
||
![]()
9 years ago
|
|
||
![]()
14 years ago
|
/**
|
||
![]()
8 years ago
|
* Responses to AJAX calls.
|
||
![]()
14 years ago
|
*/
|
||
![]()
9 years ago
|
require_once __DIR__.'/../global.inc.php';
|
||
![]()
14 years ago
|
|
||
![]()
14 years ago
|
api_protect_course_script(true);
|
||
![]()
14 years ago
|
|
||
![]()
14 years ago
|
$action = $_REQUEST['a'];
|
||
![]()
14 years ago
|
|
||
![]()
12 years ago
|
switch ($action) {
|
||
![]()
14 years ago
|
case 'check_url':
|
||
|
if (api_is_allowed_to_edit(null, true)) {
|
||
|
$url = $_REQUEST['url'];
|
||
![]()
8 years ago
|
$result = \Link::checkUrl($url);
|
||
![]()
12 years ago
|
|
||
![]()
14 years ago
|
if ($result) {
|
||
![]()
9 years ago
|
echo Display::return_icon(
|
||
|
'check-circle.png',
|
||
![]()
6 years ago
|
get_lang('Validate'),
|
||
![]()
9 years ago
|
null,
|
||
|
ICON_SIZE_TINY
|
||
|
);
|
||
![]()
14 years ago
|
} else {
|
||
![]()
9 years ago
|
echo Display::return_icon(
|
||
|
'closed-circle.png',
|
||
|
get_lang('Wrong'),
|
||
|
null,
|
||
|
ICON_SIZE_TINY
|
||
|
);
|
||
![]()
14 years ago
|
}
|
||
![]()
14 years ago
|
}
|
||
|
break;
|
||
|
default:
|
||
|
echo '';
|
||
|
}
|
||
![]()
14 years ago
|
exit;
|