Minor - Fix code spacing

1.10.x
Yannick Warnier 11 years ago
parent b27d2f7b73
commit f01eec6cae
  1. 6
      main/inc/lib/formvalidator/Element/HtmlEditor.php
  2. 2
      main/inc/lib/formvalidator/FormValidator.class.php
  3. 41
      main/inc/lib/userportal.lib.php
  4. 84
      main/install/install.lib.php
  5. 3
      main/newscorm/learnpath.class.php
  6. 13
      main/template/default/auth/courses_categories.php

@ -72,7 +72,7 @@ class HtmlEditor extends HTML_QuickForm_textarea
} else {
$styleCss = $this->editor->getConfigAttribute('style');
if ($styleCss){
if ($styleCss) {
$style = true;
} else {
$style = false;
@ -93,13 +93,13 @@ class HtmlEditor extends HTML_QuickForm_textarea
/**
* @return string
*/
public function buildEditor($style=false)
public function buildEditor($style = false)
{
$result = '';
if ($this->editor) {
$this->editor->value = $this->getValue();
$this->editor->setName($this->getName());
if($style==true){
if ($style == true) {
$result = $this->editor->createHtmlStyle();
} else {
$result = $this->editor->createHtml();

@ -761,7 +761,7 @@ EOT;
/** @var HtmlEditor $element */
$element = $this->getElement($name);
if ($style){
if ($style) {
$config['style'] = true;
}
if ($fullPage) {

@ -681,29 +681,29 @@ class IndexManager
* @todo use the template system
*/
function show_right_block($title, $content, $id = null, $params = null, $idAccordion = null, $idCollpase = null) {
if (!empty($idAccordion)){
if (!empty($idAccordion)) {
$html = null;
$html .= '<div class="panel-group" id="'.$idAccordion.'" role="tablist" aria-multiselectable="true">';
$html .= '<div class="panel panel-default" id="'.$id.'">';
$html .= '<div class="panel-heading" role="tab"><h4 class="panel-title">';
$html .= '<a role="button" data-toggle="collapse" data-parent="#'.$idAccordion.'" href="#'.$idCollpase.'" aria-expanded="true" aria-controls="'.$idCollpase.'">';
$html .= $title.'</a></h4></div>';
$html .= '<div id="'.$idCollpase.'" class="panel-collapse collapse in" role="tabpanel">';
$html .= '<div class="panel-body">'.$content.'</div>';
$html .= '</div></div></div>';
$html .= '<div class="panel-group" id="'.$idAccordion.'" role="tablist" aria-multiselectable="true">' . PHP_EOL;
$html .= '<div class="panel panel-default" id="'.$id.'">' . PHP_EOL;
$html .= '<div class="panel-heading" role="tab"><h4 class="panel-title">' . PHP_EOL;
$html .= '<a role="button" data-toggle="collapse" data-parent="#'.$idAccordion.'" href="#'.$idCollpase.'" aria-expanded="true" aria-controls="'.$idCollpase.'">'.$title.'</a>' . PHP_EOL;
$html .= '</h4></div>' . PHP_EOL;
$html .= '<div id="'.$idCollpase.'" class="panel-collapse collapse in" role="tabpanel">' . PHP_EOL;
$html .= '<div class="panel-body">'.$content.'</div>' . PHP_EOL;
$html .= '</div></div></div>' . PHP_EOL;
}else{
} else {
if (!empty($id)) {
$params['id'] = $id;
}
$params['class'] = 'panel panel-default';
$html = null;
if (!empty($title)) {
$html.= '<div class="panel-heading">'.$title.'</div>';
$html .= '<div class="panel-heading">'.$title.'</div>' . PHP_EOL;
}
$html.= '<div class="panel-body">'.$content.'</div>';
$html.= '<div class="panel-body">'.$content.'</div>' . PHP_EOL;
$html = Display::div($html, $params);
}
}
return $html;
}
@ -851,13 +851,14 @@ class IndexManager
$profile_content .= '<li class="profile-social"><a href="' . $editProfileUrl . '">'.Display::return_icon('edit-profile.png',get_lang('EditProfile'),null,ICON_SIZE_SMALL).get_lang('EditProfile').'</a></li>';
$profile_content .= '</ul>';
$html = self::show_right_block(get_lang('Profile'),
$profile_content,
'profile_block',
null,
'profile',
'profileCollapse'
);
$html = self::show_right_block(
get_lang('Profile'),
$profile_content,
'profile_block',
null,
'profile',
'profileCollapse'
);
return $html;
}

@ -1451,12 +1451,12 @@ function display_database_settings_form(
<?php
}
function panel($content=null, $title=null, $id=null, $style=null){
function panel($content = null, $title = null, $id = null, $style = null) {
$html = '';
if(empty($style)){
if (empty($style)) {
$style = 'default';
}
if (!empty($title)){
if (!empty($title)) {
$panelTitle = Display::div($title, array('class' => 'panel-heading'));
$panelBody = Display::div($content, array('class' => 'panel-body'));
$panelParent = Display::div($panelTitle . $panelBody, array('id' => $id, 'class' => 'panel panel-'.$style));
@ -1484,13 +1484,13 @@ function display_configuration_parameter(
$displayWhenUpdate = 'true'
) {
$html = '<div class="form-group">';
$html.= '<label class="col-sm-6 control-label">' . $parameterName . '</label>';
$html .= '<label class="col-sm-6 control-label">' . $parameterName . '</label>';
if ($installType == INSTALL_TYPE_UPDATE && $displayWhenUpdate) {
$html.= '<input type="hidden" name="' . $formFieldName . '" value="'. api_htmlentities($parameterValue, ENT_QUOTES). '" />' . $parameterValue;
$html .= '<input type="hidden" name="' . $formFieldName . '" value="'. api_htmlentities($parameterValue, ENT_QUOTES). '" />' . $parameterValue;
} else {
$html.= '<div class="col-sm-6"><input class="form-control" type="text" size="'.FORM_FIELD_DISPLAY_LENGTH.'" maxlength="'.MAX_FORM_FIELD_LENGTH.'" name="'.$formFieldName.'" value="'.api_htmlentities($parameterValue, ENT_QUOTES).'" />'."</div>";
$html .= '<div class="col-sm-6"><input class="form-control" type="text" size="'.FORM_FIELD_DISPLAY_LENGTH.'" maxlength="'.MAX_FORM_FIELD_LENGTH.'" name="'.$formFieldName.'" value="'.api_htmlentities($parameterValue, ENT_QUOTES).'" />'."</div>";
}
$html.= "</div>";
$html .= "</div>";
return $html;
}
@ -1606,72 +1606,72 @@ function display_configuration_settings_form(
$html .= '<div class="form-group">
<label class="col-sm-6 control-label">'. get_lang("EncryptMethodUserPass").'</label>
<div class="col-sm-6">';
if ($installType == 'update') {
$html .= '<input type="hidden" name="encryptPassForm" value="'. $encryptPassForm .'" />'. $encryptPassForm;
} else {
<label class="col-sm-6 control-label">' . get_lang("EncryptMethodUserPass") . '</label>
<div class="col-sm-6">';
if ($installType == 'update') {
$html .= '<input type="hidden" name="encryptPassForm" value="'. $encryptPassForm .'" />'. $encryptPassForm;
} else {
$html .= '<div class="checkbox">
$html .= '<div class="checkbox">
<label>
<input type="radio" name="encryptPassForm" value="bcrypt" id="encryptPass1" '. ($encryptPassForm == 'bcrypt' ? 'checked="checked" ':'') .'/> bcrypt
</label>';
$html .= '<label>
$html .= '<label>
<input type="radio" name="encryptPassForm" value="sha1" id="encryptPass1" '. ($encryptPassForm == 'sha1' ? 'checked="checked" ':'') .'/> sha1
</label>';
$html .= '<label>
$html .= '<label>
<input type="radio" name="encryptPassForm" value="md5" id="encryptPass0" '. ($encryptPassForm == 'md5' ? 'checked="checked" ':'') .'/> md5
</label>';
$html .= '<label>
$html .= '<label>
<input type="radio" name="encryptPassForm" value="none" id="encryptPass2" '. ($encryptPassForm == 'none' ? 'checked="checked" ':'') .'/>'. get_lang('None').'
</label>';
$html .= '</div>';
}
$html .= '</div></div>';
$html .= '</div>';
}
$html .= '</div></div>';
$html .= '<div class="form-group">
<label class="col-sm-6 control-label">'. get_lang('AllowSelfReg') .'</label>
<label class="col-sm-6 control-label">' . get_lang('AllowSelfReg') . '</label>
<div class="col-sm-6">';
if ($installType == 'update'){
$html .= '<input type="hidden" name="allowSelfReg" value="'. $allowSelfReg .'" />'. $allowSelfReg ? get_lang('Yes') : get_lang('No');
} else {
$html .= '<div class="control-group">';
$html .= '<label class="checkbox-inline">
<input type="radio" name="allowSelfReg" value="1" id="allowSelfReg1" '. ($allowSelfReg ? 'checked="checked" ' : '') . ' /> '. get_lang('Yes') .'
</label>';
$html .= '<label class="checkbox-inline">
<input type="radio" name="allowSelfReg" value="0" id="allowSelfReg0" '. ($allowSelfReg ? '' : 'checked="checked" ') .' /> '. get_lang('No') .'
</label>';
$html .= '</div>';
}
if ($installType == 'update') {
$html .= '<input type="hidden" name="allowSelfReg" value="'. $allowSelfReg .'" />'. $allowSelfReg ? get_lang('Yes') : get_lang('No');
} else {
$html .= '<div class="control-group">';
$html .= '<label class="checkbox-inline">
<input type="radio" name="allowSelfReg" value="1" id="allowSelfReg1" '. ($allowSelfReg ? 'checked="checked" ' : '') . ' /> '. get_lang('Yes') .'
</label>';
$html .= '<label class="checkbox-inline">
<input type="radio" name="allowSelfReg" value="0" id="allowSelfReg0" '. ($allowSelfReg ? '' : 'checked="checked" ') .' /> '. get_lang('No') .'
</label>';
$html .= '</div>';
$html .= '</div>';
}
$html .= '</div>';
$html .= '</div>';
$html .= '<div class="form-group">';
$html .= '<label class="col-sm-6 control-label">'. get_lang('AllowSelfRegProf') .'</label>
<div class="col-sm-6">';
if ($installType == 'update'){
$html .= '<input type="hidden" name="allowSelfRegProf" value="'. $allowSelfRegProf.'" />'. $allowSelfRegProf? get_lang('Yes') : get_lang('No');
} else {
$html .= '<div class="control-group">
if ($installType == 'update'){
$html .= '<input type="hidden" name="allowSelfRegProf" value="'. $allowSelfRegProf.'" />'. $allowSelfRegProf? get_lang('Yes') : get_lang('No');
} else {
$html .= '<div class="control-group">
<label class="checkbox-inline">
<input type="radio" name="allowSelfRegProf" value="1" id="allowSelfRegProf1" '. ($allowSelfRegProf ? 'checked="checked" ' : '') .'/>
' . get_lang('Yes') .'
</label>';
$html .= '<label class="checkbox-inline">
$html .= '<label class="checkbox-inline">
<input type="radio" name="allowSelfRegProf" value="0" id="allowSelfRegProf0" '. ($allowSelfRegProf ? '' : 'checked="checked" ') .' />
'. get_lang('No') .'
</label>';
$html .= '</div>';
}
$html .= '</div>
$html .= '</div>';
}
$html .= '</div>
</div>';
echo panel($html, get_lang('Platform'), 'platform');
echo panel($html, get_lang('Platform'), 'platform');
?>
<div class='form-group'>
<div class="col-sm-6">

@ -7601,8 +7601,7 @@ class learnpath
$renderer = $form->defaultRenderer();
$renderer->setElementTemplate('&nbsp;{label}{element}', 'content_lp');
$form->addElement('html', '<div class="editor-lp">');
$form->addHtmlEditor('content_lp', null, null, true, $editor_config, $style=true);
//$form->addElement('html_editor', 'content_lp', '', null, $editor_config);
$form->addHtmlEditor('content_lp', null, null, true, $editor_config, true);
$form->addElement('html', '</div>');
$defaults['content_lp'] = $content;
}

@ -109,7 +109,7 @@ $code = isset($code) ? $code : null;
<div class="col-md-6">
<h2><?php echo get_lang('Search'); ?></h2>
<?php if ($showCourses) { ?>
<?php if (!isset($_GET['hidden_links']) || intval($_GET['hidden_links']) != 1) { ?>
<?php if (!isset($_GET['hidden_links']) || intval($_GET['hidden_links']) != 1) { ?>
<form class="form-search" method="post" action="<?php echo getCourseCategoryUrl(1, $pageLength, 'ALL', 0, 'subscribe'); ?>">
<input type="hidden" name="sec_token" value="<?php echo $stok; ?>">
<input type="hidden" name="search_course" value="1" />
@ -122,7 +122,7 @@ $code = isset($code) ? $code : null;
<i class="fa fa-search"></i> <?php echo get_lang('Search'); ?>
</button>
<?php
$hidden_links = 0;
$hidden_links = 0;
} else {
$hidden_links = 1;
}
@ -132,7 +132,7 @@ $code = isset($code) ? $code : null;
* it, as this can considerably slow down your system
*/
if (!empty($browse_course_categories)) {
echo '<a class="btn btn-default btn-sm" href="'.api_get_self().'?action=display_random_courses">'.get_lang('RandomPick').'</a>';
echo '<a class="btn btn-default btn-sm" href="'.api_get_self().'?action=display_random_courses">'.get_lang('RandomPick').'</a>';
?>
</div>
</div>
@ -423,13 +423,14 @@ function return_thumbnail($course, $icon_title)
* @param $course
*/
function return_title($course)
{ $html = '';
{
$html = '';
$linkCourse = api_get_course_url($course['code']);
$title = cut($course['title'], 70);
$ajax_url = api_get_path(WEB_AJAX_PATH).'course.ajax.php?a=add_course_vote';
$teachers = CourseManager::get_teacher_list_from_course_code_to_string($course['code']);
$rating = Display::return_rating_system('star_'.$course['real_id'], $ajax_url.'&amp;course_id='.$course['real_id'], $course['point_info']);
$html .= '<h4 class="title"><a href="' . $linkCourse . '">' . cut($title, 60) . '</a></h4>';
$html .= ' <h4 class="title"><a href="' . $linkCourse . '">' . cut($title, 60) . '</a></h4>';
$html .= '<div class="teachers">'.$teachers.'</div>';
$html .= '<div class="ranking">'. $rating . '</div>';
return $html;
@ -499,4 +500,4 @@ function return_unregister_button($course, $stok, $search_term, $code)
$html = ' <a class="btn btn-primary" href="'. api_get_self().'?action=unsubscribe&amp;sec_token='.$stok.'&amp;unsubscribe='.$course['code'].'&amp;search_term='.$search_term.'&amp;category_code='.$code.'">'.get_lang('Unsubscribe').'</a>';
return $html;
}
}

Loading…
Cancel
Save