Minor - format code.

1.10.x
Julio Montoya 10 years ago
parent a78f194b89
commit 1196819ce1
  1. 20
      main/admin/group_add.php
  2. 34
      main/admin/group_edit.php
  3. 10
      main/glossary/glossary_ajax_request.php
  4. 26
      main/social/group_add.php
  5. 10
      main/social/group_edit.php
  6. 2
      main/template/default/social/add_groups.tpl

@ -1,5 +1,6 @@
<?php
/* For licensing terms, see /license.txt */
/**
* @package chamilo.admin
*/
@ -16,6 +17,8 @@ $this_section = SECTION_PLATFORM_ADMIN;
// User permissions
api_protect_admin_script();
$group_id = 0;
$htmlHeadXtra[] = '<script>
textarea = "";
num_characters_permited = 255;
@ -115,8 +118,19 @@ if( $form->validate()) {
GroupPortalManager::set_parent_group($group_id,$parent_group_id);
if (!empty($picture['name'])) {
$picture_uri = GroupPortalManager::update_group_picture($group_id, $_FILES['picture']['name'], $_FILES['picture']['tmp_name']);
GroupPortalManager::update($group_id, $name, $description, $url,$status, $picture_uri);
$picture_uri = GroupPortalManager::update_group_picture(
$group_id,
$_FILES['picture']['name'],
$_FILES['picture']['tmp_name']
);
GroupPortalManager::update(
$group_id,
$name,
$description,
$url,
$status,
$picture_uri
);
}
//@todo send emails
@ -157,7 +171,7 @@ if( $form->validate()) {
// Display form
Display::display_header($tool_name);
//api_display_tool_title($tool_name);
if (!empty($message)) {
Display::display_normal_message(stripslashes($message));
}

@ -1,5 +1,6 @@
<?php
/* For licensing terms, see /license.txt */
/**
* @package chamilo.admin
*/
@ -52,7 +53,17 @@ $form->applyFilter('name', 'trim');
$form->addRule('name', get_lang('ThisFieldIsRequired'), 'required');
// Description
$form->addElement('textarea', 'description', get_lang('Description'), array('rows'=>3, 'cols'=>58, 'onKeyDown' => "text_longitud()", 'onKeyUp' => "text_longitud()"));
$form->addElement(
'textarea',
'description',
get_lang('Description'),
array(
'rows' => 3,
'cols' => 58,
'onKeyDown' => "text_longitud()",
'onKeyUp' => "text_longitud()",
)
);
$form->applyFilter('description', 'html_filter');
$form->applyFilter('description', 'trim');
@ -68,7 +79,7 @@ if (strlen($group_data['picture_uri']) > 0) {
$form->addElement('checkbox', 'delete_picture', '', get_lang('DelImage'));
}
//Group Parentship
// Group parent
$groups = array();
$groups = GroupPortalManager::get_groups_list($group_id);
$groups[0] = get_lang('NoParentship');
@ -100,7 +111,11 @@ if ( $form->validate()) {
$picture_uri = GroupPortalManager::delete_group_picture($group_id);
}
elseif (!empty($picture['name'])) {
$picture_uri = GroupPortalManager::update_group_picture($group_id, $_FILES['picture']['name'], $_FILES['picture']['tmp_name']);
$picture_uri = GroupPortalManager::update_group_picture(
$group_id,
$_FILES['picture']['name'],
$_FILES['picture']['tmp_name']
);
}
$name = $group['name'];
@ -109,7 +124,14 @@ if ( $form->validate()) {
$status = intval($group['visibility']);
$parent_group_id = intval($group['parent_group']);
GroupPortalManager::update($group_id, $name, $description, $url, $status, $picture_uri);
GroupPortalManager::update(
$group_id,
$name,
$description,
$url,
$status,
$picture_uri
);
GroupPortalManager::set_parent_group($group_id, $parent_group_id);
$tok = Security::get_token();
@ -127,10 +149,10 @@ $image_file = ($image != '' ? $image_dir.$image : api_get_path(WEB_CODE_PATH).'i
$image_size = api_getimagesize($image_file);
$img_attributes = 'src="'.$image_file.'?rand='.time().'" '
.'alt="'.api_get_person_name($user_data['firstname'], $user_data['lastname']).'" '
.'style="float:'.($text_dir == 'rtl' ? 'left' : 'right').'; padding:5px;" ';
if ($image_size['width'] > 300) { //limit display width to 300px
if ($image_size['width'] > 300) {
// limit display width to 300px
$img_attributes .= 'width="300" ';
}

@ -22,8 +22,14 @@ if (isset($_POST['glossary_id']) &&
$_POST['glossary_id'] == strval(intval($_POST['glossary_id']))
) {
$glossary_id= Security::remove_XSS($_POST['glossary_id']);
$glossary_description_by_id = GlossaryManager::get_glossary_term_by_glossary_id($glossary_id);
$glossary_description_by_id = str_replace($path_image_search,$path_image,$glossary_description_by_id);
$glossary_description_by_id = GlossaryManager::get_glossary_term_by_glossary_id(
$glossary_id
);
$glossary_description_by_id = str_replace(
$path_image_search,
$path_image,
$glossary_description_by_id
);
echo api_xml_http_response_encode($glossary_description_by_id);
} elseif (isset($_POST['glossary_data']) && $_POST['glossary_data']=='true') {
//get_glossary_terms

@ -51,11 +51,26 @@ if ($form->validate()) {
$picture = $_FILES['picture'];
$group_id = GroupPortalManager::add($name, $description, $url, $status);
GroupPortalManager::add_user_to_group(api_get_user_id(), $group_id, GROUP_USER_PERMISSION_ADMIN);
GroupPortalManager::add_user_to_group(
api_get_user_id(),
$group_id,
GROUP_USER_PERMISSION_ADMIN
);
if (!empty($picture['name'])) {
$picture_uri = GroupPortalManager::update_group_picture($group_id, $_FILES['picture']['name'], $_FILES['picture']['tmp_name']);
GroupPortalManager::update($group_id, $name, $description, $url, $status, $picture_uri);
$picture_uri = GroupPortalManager::update_group_picture(
$group_id,
$_FILES['picture']['name'],
$_FILES['picture']['tmp_name']
);
GroupPortalManager::update(
$group_id,
$name,
$description,
$url,
$status,
$picture_uri
);
}
header('Location: groups.php?id='.$group_id.'&action=show_message&message='.urlencode(get_lang('GroupAdded')));
exit();
@ -71,14 +86,13 @@ $interbreadcrumb[]= array ('url' =>'#','name' => $nameTools);
$social_avatar_block = SocialManager::show_social_avatar_block('group_add');
$social_menu_block = SocialManager::show_social_menu('group_add');
$social_right_content = $form->return_form();
$social_right_content = $form->returnForm();
$tpl = new Template();
$tpl->set_help('Groups');
$tpl->assign('social_avatar_block', $social_avatar_block);
$tpl->assign('social_menu_block', $social_menu_block);
$tpl->assign('social_right_content', $social_right_content);
//$tpl->assign('actions', $actions);
//$tpl->assign('message', $show_message);
$social_layout = $tpl->get_template('social/add_groups.tpl');
$tpl->display($social_layout);

@ -64,7 +64,11 @@ if ($form->validate()) {
if ($group['delete_picture']) {
$picture_uri = GroupPortalManager::delete_group_picture($group_id);
} elseif (!empty($picture['name'])) {
$picture_uri = GroupPortalManager::update_group_picture($group_id, $_FILES['picture']['name'], $_FILES['picture']['tmp_name']);
$picture_uri = GroupPortalManager::update_group_picture(
$group_id,
$_FILES['picture']['name'],
$_FILES['picture']['tmp_name']
);
}
$name = $group['name'];
@ -98,12 +102,12 @@ $url_big_image = $big_image.'?rnd='.time();
$social_avatar_block = SocialManager::show_social_avatar_block('group_edit', $group_id);
$social_menu_block = SocialManager::show_social_menu('group_edit', $group_id);
$social_right_content = $form->return_form();
$social_right_content = $form->returnForm();
$tpl = new Template($tool_name);
$tpl->set_help('Groups');
$tpl->assign('social_avatar_block', $social_avatar_block);
$tpl->assign('social_menu_block', $social_menu_block);
$tpl->assign('social_right_content', $social_right_content);
$social_layout = $tpl->get_template('social/home.tpl');
$social_layout = $tpl->get_template('social/groups.tpl');
$tpl->display($social_layout);

@ -8,7 +8,7 @@
{{ social_menu_block }}
</div>
</div>
<div id="wallMessages" class="col-md-5" style="min-height:1px">
<div id="wallMessages" class="col-md-9" style="min-height:1px">
<div class="row">
<div class="col-md-12">
<div id="message_ajax_reponse" class=""></div>

Loading…
Cancel
Save