Minor - format code

pull/2487/head
jmontoyaa 7 years ago
parent db00609ad6
commit 6a1afb7653
  1. 30
      main/admin/extra_field_options.php
  2. 4
      main/admin/extra_field_workflow.php
  3. 42
      main/admin/skills_import.php
  4. 1
      main/admin/special_exports.php
  5. 15
      main/admin/specific_fields.php
  6. 4
      main/admin/usergroup_import.php
  7. 2
      main/admin/usergroup_user_import.php
  8. 2
      main/survey/fillsurvey.php

@ -39,14 +39,25 @@ $token = Security::get_token();
if ($action == 'add') {
$interbreadcrumb[] = array('url' => 'extra_fields.php?type='.$extra_field->type, 'name' => $extra_field->pageName);
$interbreadcrumb[] = array('url' => 'extra_fields.php?type='.$extra_field->type.'&action=edit&id='.$extra_field_info['id'], 'name' => $extra_field_info['display_text']);
$interbreadcrumb[] = array('url' => 'extra_field_options.php?type='.$extra_field->type.'&field_id='.$extra_field_info['id'], 'name' => get_lang('EditExtraFieldOptions'));
$interbreadcrumb[] = array(
'url' => 'extra_fields.php?type='.$extra_field->type.'&action=edit&id='.$extra_field_info['id'],
'name' => $extra_field_info['display_text'],
);
$interbreadcrumb[] = array(
'url' => 'extra_field_options.php?type='.$extra_field->type.'&field_id='.$extra_field_info['id'],
'name' => get_lang('EditExtraFieldOptions'),
);
$interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Add'));
} elseif ($action == 'edit') {
$interbreadcrumb[] = array('url' => 'extra_fields.php?type='.$extra_field->type, 'name' => $extra_field->pageName);
$interbreadcrumb[] = array('url' => 'extra_fields.php?type='.$extra_field->type.'&action=edit&id='.$extra_field_info['id'], 'name' => $extra_field_info['display_text']);
$interbreadcrumb[] = array('url' => 'extra_field_options.php?type='.$extra_field->type.'&field_id='.$extra_field_info['id'], 'name' => get_lang('EditExtraFieldOptions'));
$interbreadcrumb[] = array(
'url' => 'extra_fields.php?type='.$extra_field->type.'&action=edit&id='.$extra_field_info['id'],
'name' => $extra_field_info['display_text'],
);
$interbreadcrumb[] = array(
'url' => 'extra_field_options.php?type='.$extra_field->type.'&field_id='.$extra_field_info['id'],
'name' => get_lang('EditExtraFieldOptions'),
);
$interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Edit'));
} else {
$interbreadcrumb[] = array('url' => 'extra_fields.php?type='.$extra_field->type, 'name' => $extra_field->pageName);
@ -100,6 +111,7 @@ $column_model = array(
'sortable' => 'false',
),
);
//Autowidth
$extra_params['autowidth'] = 'true';
//height auto
@ -128,9 +140,7 @@ $(function() {
});
</script>';
// The header.
Display::display_header($tool_name);
echo Display::page_header($extra_field_info['display_text'], $extra_field_info['variable'], 'h1');
$obj = new ExtraFieldOption($extra_field->type);
@ -171,7 +181,11 @@ switch ($action) {
if ($check) {
$values = $form->exportValues();
$res = $obj->update($values);
echo Display::return_message(sprintf(get_lang('ItemUpdated'), $values['display_text']), 'confirmation', false);
echo Display::return_message(
sprintf(get_lang('ItemUpdated'), $values['display_text']),
'confirmation',
false
);
}
$obj->display();
} else {

@ -9,7 +9,6 @@ $cidReset = true;
require_once __DIR__.'/../inc/global.inc.php';
$this_section = SECTION_PLATFORM_ADMIN;
$type = isset($_REQUEST['type']) ? $_REQUEST['type'] : null;
api_protect_admin_script();
@ -86,7 +85,6 @@ $paramsNoRole = 'field_id='.$field_id.'&type='.$extraField->type;
$columns = array(get_lang('Name'), get_lang('Value'), get_lang('Order'), get_lang('Actions'));
$htmlHeadXtra[] = '<script>
function setHidden(obj) {
var name = $(obj).attr("name");
var hiddenName = "hidden_" + name;
@ -117,9 +115,7 @@ $htmlHeadXtra[] = '<script>
});
</script>';
// The header.
Display::display_header($tool_name);
echo Display::page_header($extraFieldInfo['display_text']);
$obj = new ExtraFieldOption($type);

@ -70,7 +70,7 @@ function save_data($skills)
$oskill = new Skill();
$skill_id = $oskill->add($skill);
$parents[$saved_id] = $skill_id;
}
}
}
}
@ -81,12 +81,12 @@ function save_data($skills)
*/
function parse_csv_data($file)
{
$skills = Import :: csvToArray($file);
foreach ($skills as $index => $skill) {
$skills[$index] = $skill;
}
$skills = Import::csvToArray($file);
foreach ($skills as $index => $skill) {
$skills[$index] = $skill;
}
return $skills;
return $skills;
}
/**
@ -94,7 +94,7 @@ function parse_csv_data($file)
*/
function element_start($parser, $data)
{
$data = api_utf8_decode($data);
$data = api_utf8_decode($data);
global $skill;
global $current_tag;
switch ($data) {
@ -111,7 +111,7 @@ function element_start($parser, $data)
*/
function element_end($parser, $data)
{
$data = api_utf8_decode($data);
$data = api_utf8_decode($data);
global $skill;
global $skills;
global $current_value;
@ -130,9 +130,9 @@ function element_end($parser, $data)
*/
function character_data($parser, $data)
{
$data = trim(api_utf8_decode($data));
global $current_value;
$current_value = $data;
$data = trim(api_utf8_decode($data));
global $current_value;
$current_value = $data;
}
/**
@ -154,7 +154,7 @@ function parse_xml_data($file)
xml_parse($parser, api_utf8_encode_xml(file_get_contents($file)));
xml_parser_free($parser);
return $skills;
return $skills;
}
$this_section = SECTION_PLATFORM_ADMIN;
@ -180,7 +180,7 @@ if (!empty($_POST['formSent']) && $_FILES['import_file']['size'] !== 0) {
if (in_array($ext_import_file, $allowed_file_mimetype)) {
if (strcmp($file_type, 'csv') === 0 && $ext_import_file == $allowed_file_mimetype[0]) {
$skills = parse_csv_data($_FILES['import_file']['tmp_name']);
$skills = parse_csv_data($_FILES['import_file']['tmp_name']);
$errors = validate_data($skills);
$error_kind_file = false;
} elseif (strcmp($file_type, 'xml') === 0 && $ext_import_file == $allowed_file_mimetype[1]) {
@ -254,28 +254,30 @@ $toolbar = Display::url(
'list_badges.png',
get_lang('ManageSkills'),
null,
ICON_SIZE_MEDIUM),
ICON_SIZE_MEDIUM
),
api_get_path(WEB_CODE_PATH).'admin/skill_list.php'
);
);
$toolbar .= Display::url(
Display::return_icon(
'wheel_skill.png',
get_lang('SkillsWheel'),
null,
ICON_SIZE_MEDIUM),
ICON_SIZE_MEDIUM
),
api_get_path(WEB_CODE_PATH).'admin/skills_wheel.php'
);
);
$toolbar .= Display::url(
Display::return_icon(
'edit-skill.png',
get_lang('BadgesManagement'),
null,
ICON_SIZE_MEDIUM),
ICON_SIZE_MEDIUM
),
api_get_path(WEB_CODE_PATH).'admin/skill_badge_list.php'
);
);
$actions = '<div class="actions">'.$toolbar.'</div>';

@ -218,7 +218,6 @@ function rename_zip($FileZip)
} else {
return false;
}
}
function fullexportspecial()

@ -26,7 +26,12 @@ include_once $libpath.'specific_fields_manager.lib.php';
$form = new FormValidator('add_field', 'post', '', '', null, false);
$renderer = & $form->defaultRenderer();
$renderer->setCustomElementTemplate('<span>{element}</span> ');
$form->addElement('static', 'search_advanced_link', null, '<a href="specific_fields_add.php">'.Display::return_icon('fieldadd.gif').get_lang('AddSpecificSearchField').'</a>');
$form->addElement(
'static',
'search_advanced_link',
null,
'<a href="specific_fields_add.php">'.Display::return_icon('fieldadd.gif').get_lang('AddSpecificSearchField').'</a>'
);
// Create a sortable table with specific fields data
$column_show = array(1, 1, 1);
@ -51,8 +56,10 @@ $table->set_column_filter(3, 'edit_filter');
function edit_filter($id, $url_params, $row)
{
global $charset;
$return = '<a href="specific_fields_add.php?action=edit&field_id='.$row[0].'">'.Display::return_icon('edit.gif', get_lang('Edit')).'</a>';
$return .= ' <a href="'.api_get_self().'?action=delete&field_id='.$row[0].'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"), ENT_QUOTES, $charset))."'".')) return false;">'.Display::return_icon('delete.gif', get_lang('Delete')).'</a>';
$return = '<a href="specific_fields_add.php?action=edit&field_id='.$row[0].'">'.
Display::return_icon('edit.gif', get_lang('Edit')).'</a>';
$return .= ' <a href="'.api_get_self().'?action=delete&field_id='.$row[0].'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"), ENT_QUOTES, $charset))."'".')) return false;">'.
Display::return_icon('delete.gif', get_lang('Delete')).'</a>';
return $return;
}
@ -62,8 +69,6 @@ if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'delete') {
exit;
}
// Start output
// Displaying the header
Display::display_header(get_lang('SpecificSearchFields'));
echo Display::addFlash(Display::return_message(get_lang('SpecificSearchFieldsIntro')));

@ -3,8 +3,8 @@
/**
* This tool allows platform admins to add classes by uploading a CSV file
* @todo Add some langvars to DLTT
* @package chamilo.admin
* @todo Add some langvars to DLTT
* @package chamilo.admin
*/
/**

@ -1,7 +1,7 @@
<?php
/* For licensing terms, see /license.txt */
/**
* @package chamilo.admin
* @package chamilo.admin
*/
/**
* Code

@ -7,7 +7,7 @@ use ChamiloSession as Session;
* @package chamilo.survey
* @author unknown, the initial survey that did not make it in 1.8 because of bad code
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University: cleanup, refactoring and rewriting large parts of the code
* @author Julio Montoya Armas <gugli100@gmail.com>, Chamilo: Personality Test modification and rewriting large parts of the code as well
* @author Julio Montoya <gugli100@gmail.com>, Chamilo: Personality Test modification and rewriting large parts of the code as well
* @todo check if the user already filled the survey and if this is the case then the answers have to be updated and not stored again.
* @todo performance could be improved if not the survey_id was stored with the invitation but the survey_code
*/

Loading…
Cancel
Save