From 074b0073d22773e61c24506c6ada33e435e63e65 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Wed, 18 Sep 2013 19:18:00 +0200 Subject: [PATCH] Minor - Format code --- main/admin/access_url_edit.php | 5 ++-- main/admin/access_url_edit_users_to_url.php | 30 ++++++-------------- main/template/default/layout/main_header.tpl | 11 +++---- main/template/default/layout/show_header.tpl | 16 +++++------ main/template/default/layout/topbar.tpl | 1 + 5 files changed, 26 insertions(+), 37 deletions(-) diff --git a/main/admin/access_url_edit.php b/main/admin/access_url_edit.php index 746b703431..c3e16bb543 100644 --- a/main/admin/access_url_edit.php +++ b/main/admin/access_url_edit.php @@ -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'); diff --git a/main/admin/access_url_edit_users_to_url.php b/main/admin/access_url_edit_users_to_url.php index 208bd99fd7..fa3b739082 100644 --- a/main/admin/access_url_edit_users_to_url.php +++ b/main/admin/access_url_edit_users_to_url.php @@ -5,14 +5,6 @@ * @author Julio Montoya */ - -// 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 .= '

'.get_lang('UsersAdded').':

'; $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 = ''.get_lang('SessionAddTypeUnique').''; $link_add_type_multiple = get_lang('SessionAddTypeMultiple'); @@ -241,8 +233,8 @@ if (!empty($errorMsg)) {

@@ -304,7 +296,6 @@ if (!empty($errorMsg)) { foreach ($sessionUsersList as $enreg) { ?> - - {% else %} -
- {% endif %} + {% if app.full_width == 1 %} +
+ {% else %} +
+ {% endif %} {% endblock main_div_container %}
@@ -117,6 +117,7 @@ {% else %}
{% endif %} + {# course navigation links/shortcuts need to be activated by the admin #} {% include app.template_style ~ "/layout/course_navigation.tpl" %} {% endif %} diff --git a/main/template/default/layout/show_header.tpl b/main/template/default/layout/show_header.tpl index 28af400b4b..91864b4cc5 100644 --- a/main/template/default/layout/show_header.tpl +++ b/main/template/default/layout/show_header.tpl @@ -5,12 +5,12 @@ #} {% if app.template.show_header == true %} - {% if plugin_content_top is not null %} -
- {{ plugin_content_top }} -
- {% endif %} -
- {% include app.template_style ~ "/layout/page_body.tpl" %} - {% block main_content_section_block %}
{% endblock main_content_section_block %} + {% if plugin_content_top is not null %} +
+ {{ plugin_content_top }} +
+ {% endif %} +
+ {% include app.template_style ~ "/layout/page_body.tpl" %} + {% block main_content_section_block %}
{% endblock main_content_section_block %} {% endif %} diff --git a/main/template/default/layout/topbar.tpl b/main/template/default/layout/topbar.tpl index 2acfa4043a..8b018988a7 100644 --- a/main/template/default/layout/topbar.tpl +++ b/main/template/default/layout/topbar.tpl @@ -7,6 +7,7 @@ {% else %}