Minor - Format code

skala
Julio Montoya 12 years ago
parent 51f1fb6788
commit 074b0073d2
  1. 5
      main/admin/access_url_edit.php
  2. 30
      main/admin/access_url_edit_users_to_url.php
  3. 11
      main/template/default/layout/main_header.tpl
  4. 16
      main/template/default/layout/show_header.tpl
  5. 1
      main/template/default/layout/topbar.tpl

@ -119,7 +119,7 @@ $form->addElement('textarea','description',get_lang('Description'));
//the first url with id = 1 will be always active
if (isset($_GET['url_id']) && $_GET['url_id'] != 1) {
$form->addElement('checkbox','active',get_lang('Active'));
$form->addElement('checkbox','active', null, get_lang('Active'));
}
//$form->addRule('checkbox', get_lang('ThisFieldIsRequired'), 'required');
@ -141,8 +141,9 @@ if (isset($_GET['url_id'])) {
$submit_name = get_lang('AddUrl');
}
if (!$_configuration['multiple_access_urls']) {
if (!api_is_multiple_url_enabled()) {
header('Location: index.php');
exit;
}
$tool_name = get_lang('AddUrl');

@ -5,14 +5,6 @@
* @author Julio Montoya <gugli100@gmail.com>
*/
// name of the language file that needs to be included
$language_file='admin';
// resetting the course id
$cidReset = true;
require_once '../inc/global.inc.php';
require_once __DIR__.'/../inc/lib/xajax/xajax.inc.php';
$xajax = new xajax();
@ -29,7 +21,6 @@ if (!api_get_multiple_access_url()) {
exit;
}
// Database Table Definitions
$tbl_user = Database::get_main_table(TABLE_MAIN_USER);
$tbl_access_url_rel_user = Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
@ -41,12 +32,12 @@ $interbreadcrumb[] = array ('url' => 'index.php', 'name' => get_lang('PlatformAd
$interbreadcrumb[] = array ('url' => 'access_urls.php', 'name' => get_lang('MultipleAccessURLs'));
$add_type = 'multiple';
if(isset($_REQUEST['add_type']) && $_REQUEST['add_type']!=''){
if (isset($_REQUEST['add_type']) && $_REQUEST['add_type']!=''){
$add_type = Security::remove_XSS($_REQUEST['add_type']);
}
$access_url_id=1;
if(isset($_REQUEST['access_url_id']) && $_REQUEST['access_url_id']!=''){
if (isset($_REQUEST['access_url_id']) && $_REQUEST['access_url_id']!=''){
$access_url_id = Security::remove_XSS($_REQUEST['access_url_id']);
}
@ -97,9 +88,11 @@ if (isset($_POST['form_sent']) && $_POST['form_sent']) {
if (!is_array($UserList)) {
$UserList=array();
}
if ($form_sent == 1) {
if ($access_url_id==0) {
if ($access_url_id == 0) {
header('Location: access_url_edit_users_to_url.php?action=show_message&message='.get_lang('SelectURL'));
exit;
} elseif (is_array($UserList)) {
$result = UrlManager::update_urls_rel_user($UserList, $access_url_id);
$url_info = UrlManager::get_url_data_from_id($access_url_id);
@ -111,7 +104,7 @@ if (isset($_POST['form_sent']) && $_POST['form_sent']) {
$message .= '<h4>'.get_lang('UsersAdded').':</h4>';
$i = 1;
$user_added_list = array();
foreach($result['users_added'] as $user) {
foreach ($result['users_added'] as $user) {
$user_info = api_get_user_info($user);
if (!empty($user_info)) {
$user_added_list[] = $i.'. '.api_get_person_name($user_info['firstname'], $user_info['lastname']);
@ -186,7 +179,6 @@ if ($ajax_search) {
}
}
if ($add_type == 'multiple') {
$link_add_type_unique = '<a href="'.api_get_self().'?add_type=unique&access_url_id='.$access_url_id.'">'.get_lang('SessionAddTypeUnique').'</a>';
$link_add_type_multiple = get_lang('SessionAddTypeMultiple');
@ -241,8 +233,8 @@ if (!empty($errorMsg)) {
<td>
<h3>
<?php
$total_users = count($nosessionUsersList) + count($sessionUsersList);
echo get_lang('TotalAvailableUsers').' '.$total_users;
$total_users = count($nosessionUsersList) + count($sessionUsersList);
echo get_lang('TotalAvailableUsers').' '.$total_users;
?>
</h3>
</td>
@ -304,7 +296,6 @@ if (!empty($errorMsg)) {
foreach ($sessionUsersList as $enreg) {
?>
<option value="<?php echo $enreg['user_id']; ?>"><?php echo api_get_person_name($enreg['firstname'], $enreg['lastname']).' ('.$enreg['username'].')'; ?></option>
<?php
}
unset($sessionUsersList);
@ -331,11 +322,6 @@ function valide(){
var options = document.getElementById('destination_users').options;
for (i = 0 ; i<options.length ; i++)
options[i].selected = true;
/*
var options = document.getElementById('destination_classes').options;
for (i = 0 ; i<options.length ; i++)
options[i].selected = true;
*/
document.forms.formulaire.submit();
}

@ -43,11 +43,11 @@
{% include app.template_style ~ "/layout/topbar.tpl" %}
{% block main_div_container %}
{% if app.full_width == 1 %}
<div id="main" class="container-fluid">
{% else %}
<div id="main" class="container">
{% endif %}
{% if app.full_width == 1 %}
<div id="main" class="container-fluid">
{% else %}
<div id="main" class="container">
{% endif %}
{% endblock main_div_container %}
<header>
<div class="row">
@ -117,6 +117,7 @@
{% else %}
<div id="top_main_content" class="row">
{% endif %}
{# course navigation links/shortcuts need to be activated by the admin #}
{% include app.template_style ~ "/layout/course_navigation.tpl" %}
{% endif %}

@ -5,12 +5,12 @@
#}
{% if app.template.show_header == true %}
{% if plugin_content_top is not null %}
<div id="plugin_content_top" class="span12">
{{ plugin_content_top }}
</div>
{% endif %}
<div class="span12">
{% include app.template_style ~ "/layout/page_body.tpl" %}
{% block main_content_section_block %}<section id="main_content">{% endblock main_content_section_block %}
{% if plugin_content_top is not null %}
<div id="plugin_content_top" class="span12">
{{ plugin_content_top }}
</div>
{% endif %}
<div class="span12">
{% include app.template_style ~ "/layout/page_body.tpl" %}
{% block main_content_section_block %}<section id="main_content">{% endblock main_content_section_block %}
{% endif %}

@ -7,6 +7,7 @@
{% else %}
<div id="main" class="container">
{% endif %}
<a class="brand" href="{{ _p.web }}">
{{ "siteName" | get_setting }}
</a>

Loading…
Cancel
Save