private function build_form() { $form = new HTMLForm(__CLASS__); $fieldset = new FormFieldsetHTML('configuration', LangLoader::get_message('configuration', 'admin-common')); $form->add_fieldset($fieldset); $fieldset->add_field(new FormFieldTextEditor('title', $this->lang['admin.config.title'], $this->config->get_title(), array('maxlength' => 255, 'required' => true))); $fieldset->add_field(new FormFieldCheckbox('informations_enabled', $this->lang['admin.config.informations_enabled'], $this->config->are_informations_enabled(), array('description' => $this->lang['admin.config.informations.explain'], 'events' => array('click' => ' if (HTMLForms.getField("informations_enabled").getValue()) { HTMLForms.getField("informations_position").enable(); HTMLForms.getField("informations").enable(); } else { HTMLForms.getField("informations_position").disable(); HTMLForms.getField("informations").disable(); }')))); $fieldset->add_field(new FormFieldSimpleSelectChoice('informations_position', $this->lang['admin.config.informations_position'], $this->config->get_informations_position(), array(new FormFieldSelectChoiceOption($this->lang['admin.config.informations.position_left'], ContactConfig::LEFT), new FormFieldSelectChoiceOption($this->lang['admin.config.informations.position_top'], ContactConfig::TOP), new FormFieldSelectChoiceOption($this->lang['admin.config.informations.position_right'], ContactConfig::RIGHT), new FormFieldSelectChoiceOption($this->lang['admin.config.informations.position_bottom'], ContactConfig::BOTTOM)), array('hidden' => !$this->config->are_informations_enabled()))); $fieldset->add_field(new FormFieldRichTextEditor('informations', $this->lang['admin.config.informations_content'], FormatingHelper::unparse($this->config->get_informations()), array('rows' => 8, 'cols' => 47, 'hidden' => !$this->config->are_informations_enabled()))); $fieldset->add_field(new FormFieldCheckbox('tracking_number_enabled', $this->lang['admin.config.tracking_number_enabled'], $this->config->is_tracking_number_enabled(), array('events' => array('click' => ' if (HTMLForms.getField("tracking_number_enabled").getValue()) { HTMLForms.getField("date_in_tracking_number_enabled").enable(); } else { HTMLForms.getField("date_in_tracking_number_enabled").disable(); }')))); $fieldset->add_field(new FormFieldCheckbox('date_in_tracking_number_enabled', $this->lang['admin.config.date_in_date_in_tracking_number_enabled'], $this->config->is_date_in_tracking_number_enabled(), array('description' => $this->lang['admin.config.date_in_date_in_tracking_number_enabled.explain'], 'hidden' => !$this->config->is_tracking_number_enabled()))); $fieldset->add_field(new FormFieldCheckbox('sender_acknowledgment_enabled', $this->lang['admin.config.sender_acknowledgment_enabled'], $this->config->is_sender_acknowledgment_enabled())); $fieldset_authorizations = new FormFieldsetHTML('authorizations', LangLoader::get_message('authorizations', 'common')); $form->add_fieldset($fieldset_authorizations); $auth_settings = new AuthorizationsSettings(array(new ActionAuthorization($this->lang['admin.authorizations.read'], ContactAuthorizationsService::READ_AUTHORIZATIONS))); $auth_settings->build_from_auth_array($this->config->get_authorizations()); $fieldset_authorizations->add_field(new FormFieldAuthorizationsSetter('authorizations', $auth_settings)); $this->submit_button = new FormButtonDefaultSubmit(); $form->add_button($this->submit_button); $form->add_button(new FormButtonReset()); $this->form = $form; }
WHERE user_id = :user_id', array('user_id' => $contribution->get_poster_id()))->fetch(); $contributor_group_color = User::get_group_color($contributor['groups'], $contributor['level']); $template->put_all(array('C_WRITE_AUTH' => AppContext::get_current_user()->check_auth($contribution->get_auth(), Contribution::CONTRIBUTION_AUTH_BIT), 'C_UNPROCESSED_CONTRIBUTION' => $contribution->get_status() != Event::EVENT_STATUS_PROCESSED, 'C_CONTRIBUTOR_GROUP_COLOR' => !empty($contributor_group_color), 'ENTITLED' => $contribution->get_entitled(), 'DESCRIPTION' => FormatingHelper::second_parse($contribution->get_description()), 'STATUS' => $contribution->get_status_name(), 'CONTRIBUTOR' => $contributor['display_name'], 'CONTRIBUTOR_LEVEL_CLASS' => UserService::get_level_class($contributor['level']), 'CONTRIBUTOR_GROUP_COLOR' => $contributor_group_color, 'COMMENTS' => CommentsService::display($comments_topic)->render(), 'CREATION_DATE' => $contribution_creation_date->format(Date::FORMAT_DAY_MONTH_YEAR), 'MODULE' => $contribution->get_module_name(), 'U_CONTRIBUTOR_PROFILE' => UserUrlBuilder::profile($contribution->get_poster_id())->rel(), 'FIXING_URL' => url(PATH_TO_ROOT . $contribution->get_fixing_url()))); //Si la contribution a été traitée if ($contribution->get_status() == Event::EVENT_STATUS_PROCESSED) { $fixer = PersistenceContext::get_querier()->select('SELECT * FROM ' . DB_TABLE_MEMBER . ' member WHERE user_id = :user_id', array('user_id' => $contribution->get_fixer_id()))->fetch(); $fixer_group_color = User::get_group_color($fixer['groups'], $fixer['level']); $template->put_all(array('C_CONTRIBUTION_FIXED' => true, 'C_FIXER_GROUP_COLOR' => !empty($fixer_group_color), 'FIXER' => $fixer['display_name'], 'FIXER_LEVEL_CLASS' => UserService::get_level_class($fixer['level']), 'FIXER_GROUP_COLOR' => $fixer_group_color, 'FIXING_DATE' => $contribution_fixing_date->format(Date::FORMAT_DAY_MONTH_YEAR), 'U_FIXER_PROFILE' => UserUrlBuilder::profile($contribution->get_fixer_id())->rel())); } $template->put_all(array('L_CONTRIBUTION' => $LANG['contribution'], 'L_ENTITLED' => $LANG['contribution_entitled'], 'L_DESCRIPTION' => $LANG['contribution_description'], 'L_STATUS' => $LANG['contribution_status'], 'L_CONTRIBUTOR' => $LANG['contributor'], 'L_CREATION_DATE' => $LANG['contribution_creation_date'], 'L_FIXER' => $LANG['contribution_fixer'], 'L_FIXING_DATE' => $LANG['contribution_fixing_date'], 'L_MODULE' => $LANG['contribution_module'], 'L_PROCESS_CONTRIBUTION' => $LANG['process_contribution'], 'L_CONFIRM_DELETE_CONTRIBUTION' => $LANG['confirm_delete_contribution'], 'L_DELETE' => LangLoader::get_message('delete', 'common'), 'L_UPDATE' => $LANG['update'], 'U_UPDATE' => url('contribution_panel.php?edit=' . $contribution_id), 'U_DELETE' => url('contribution_panel.php?del=' . $contribution_id . '&token=' . AppContext::get_session()->get_token()))); } elseif ($id_update > 0) { $editor = AppContext::get_content_formatting_service()->get_default_editor(); $editor->set_identifier('contents'); $template->put_all(array('C_EDIT_CONTRIBUTION' => true, 'EDITOR' => $editor->display(), 'ENTITLED' => $contribution->get_entitled(), 'DESCRIPTION' => FormatingHelper::unparse($contribution->get_description()), 'CONTRIBUTION_ID' => $contribution->get_id(), 'EVENT_STATUS_UNREAD_SELECTED' => $contribution->get_status() == Event::EVENT_STATUS_UNREAD ? ' selected="selected"' : '', 'EVENT_STATUS_BEING_PROCESSED_SELECTED' => $contribution->get_status() == Event::EVENT_STATUS_BEING_PROCESSED ? ' selected="selected"' : '', 'EVENT_STATUS_PROCESSED_SELECTED' => $contribution->get_status() == Event::EVENT_STATUS_PROCESSED ? ' selected="selected"' : '', 'L_CONTRIBUTION_STATUS_UNREAD' => $LANG['contribution_status_unread'], 'L_CONTRIBUTION_STATUS_BEING_PROCESSED' => $LANG['contribution_status_being_processed'], 'L_CONTRIBUTION_STATUS_PROCESSED' => $LANG['contribution_status_processed'], 'L_CONTRIBUTION' => $LANG['contribution'], 'L_DESCRIPTION' => $LANG['contribution_description'], 'L_STATUS' => $LANG['contribution_status'], 'L_ENTITLED' => $LANG['contribution_entitled'], 'L_SUBMIT' => $LANG['submit'], 'L_PREVIEW' => $LANG['preview'], 'L_RESET' => $LANG['reset'])); } else { $template->put_all(array('C_CONTRIBUTION_LIST' => true)); //Nombre de contributions $num_contributions = 1; define('CONTRIBUTIONS_PER_PAGE', 20); $page = AppContext::get_request()->get_getint('p', 1); //Gestion des critères de tri $criteria = retrieve(GET, 'criteria', 'current_status'); $order = retrieve(GET, 'order', 'asc'); if (!in_array($criteria, array('entitled', 'module', 'status', 'creation_date', 'fixing_date', 'poster_id', 'fixer_id'))) { $criteria = 'current_status'; } $order = $order == 'desc' ? 'desc' : 'asc'; //On liste les contributions foreach (ContributionService::get_all_contributions($criteria, $order) as $this_contribution) {
DispatchManager::redirect($error_controller); } if (!MediaAuthorizationsService::check_authorizations($media['idcat'])->moderation()) { $error_controller = PHPBoostErrors::user_not_authorized(); DispatchManager::redirect($error_controller); } bread_crumb($media['idcat']); $categories_tree = MediaService::get_categories_manager()->get_select_categories_form_field('idcat', '', $media['idcat'], $search_category_children_options); $method = new ReflectionMethod('AbstractFormFieldChoice', 'get_options'); $method->setAccessible(true); $categories_tree_options = $method->invoke($categories_tree); $categories_list = ''; foreach ($categories_tree_options as $option) { $categories_list .= $option->display()->render(); } $tpl->put_all(array('L_PAGE_TITLE' => $MEDIA_LANG['edit_media'], 'C_CONTRIBUTION' => 0, 'IDEDIT' => $media['id'], 'NAME' => $media['name'], 'CATEGORIES' => $categories_list, 'WIDTH' => $media['width'], 'HEIGHT' => $media['height'], 'U_MEDIA' => $media['url'], 'DESCRIPTION' => FormatingHelper::unparse(stripslashes($media['contents'])), 'APPROVED' => ($media['infos'] & MEDIA_STATUS_APROBED) !== 0 ? ' checked="checked"' : '', 'C_APROB' => ($media['infos'] & MEDIA_STATUS_APROBED) === 0, 'JS_ID_MUSIC' => '"' . implode('", "', $js_id_music) . '"', 'C_MUSIC' => in_array($media['mime_type'], $mime_type['audio']))); } elseif (($write = MediaAuthorizationsService::check_authorizations()->write()) || MediaAuthorizationsService::check_authorizations()->contribution()) { bread_crumb($add); $editor = AppContext::get_content_formatting_service()->get_default_editor(); $editor->set_identifier('counterpart'); $categories_tree = MediaService::get_categories_manager()->get_select_categories_form_field('idcat', '', Category::ROOT_CATEGORY, $search_category_children_options); $method = new ReflectionMethod('AbstractFormFieldChoice', 'get_options'); $method->setAccessible(true); $categories_tree_options = $method->invoke($categories_tree); $categories_list = ''; foreach ($categories_tree_options as $option) { $categories_list .= $option->display()->render(); } $tpl->put_all(array('L_PAGE_TITLE' => $write ? $MEDIA_LANG['add_media'] : $MEDIA_LANG['contribute_media'], 'C_CONTRIBUTION' => !$write, 'CONTRIBUTION_COUNTERPART_EDITOR' => $editor->display(), 'IDEDIT' => 0, 'NAME' => '', 'CATEGORIES' => $categories_list, 'WIDTH' => '425', 'HEIGHT' => '344', 'U_MEDIA' => 'http://', 'DESCRIPTION' => '', 'APPROVED' => 'checked="checked"', 'C_APROB' => false, 'JS_ID_MUSIC' => '"' . implode('", "', $js_id_music) . '"', 'C_MUSIC' => $config->is_root_category_content_type_music())); } else { $error_controller = PHPBoostErrors::user_not_authorized();
include 'lateral_menu.php'; lateral_menu(); $tpl = new FileTemplate('admin/menus/content.tpl'); $editor = AppContext::get_content_formatting_service()->get_default_editor(); $editor->set_identifier('contents'); $tpl->put_all(array('KERNEL_EDITOR' => $editor->display(), 'L_REQUIRE' => LangLoader::get_message('form.explain_required_fields', 'status-messages-common'), 'L_REQUIRE_NAME' => TextHelper::to_js_string($LANG['require_name']), 'L_REQUIRE_TEXT' => TextHelper::to_js_string($LANG['require_text']), 'L_NAME' => $LANG['name'], 'L_CONTENT' => $LANG['content'], 'L_STATUS' => $LANG['status'], 'L_HIDDEN_WITH_SMALL_SCREENS' => $LANG['hidden_with_small_screens'], 'L_AUTHS' => $LANG['auths'], 'L_ENABLED' => LangLoader::get_message('enabled', 'common'), 'L_DISABLED' => LangLoader::get_message('disabled', 'common'), 'L_GUEST' => $LANG['guest'], 'L_USER' => $LANG['member'], 'L_MODO' => $LANG['modo'], 'L_ADMIN' => $LANG['admin'], 'L_LOCATION' => $LANG['location'], 'L_ACTION_MENUS' => $edit ? $LANG['menus_edit'] : LangLoader::get_message('add', 'common'), 'L_ACTION' => $edit ? $LANG['update'] : $LANG['submit'], 'L_RESET' => $LANG['reset'], 'L_PREVIEW' => $LANG['preview'], 'ACTION' => 'save', 'L_DISPLAY_TITLE' => $LANG['display_title'])); //Localisation possibles. $block = retrieve(GET, 's', Menu::BLOCK_POSITION__HEADER, TINTEGER); $array_location = array(Menu::BLOCK_POSITION__HEADER => $LANG['menu_header'], Menu::BLOCK_POSITION__SUB_HEADER => $LANG['menu_subheader'], Menu::BLOCK_POSITION__LEFT => $LANG['menu_left'], Menu::BLOCK_POSITION__TOP_CENTRAL => $LANG['menu_top_central'], Menu::BLOCK_POSITION__BOTTOM_CENTRAL => $LANG['menu_bottom_central'], Menu::BLOCK_POSITION__RIGHT => $LANG['menu_right'], Menu::BLOCK_POSITION__TOP_FOOTER => $LANG['menu_top_footer'], Menu::BLOCK_POSITION__FOOTER => $LANG['menu_footer']); if ($edit) { $menu = MenuService::load($id); if (!$menu instanceof ContentMenu) { AppContext::get_response()->redirect('menus.php'); } $block = $menu->get_block(); $content = $menu->get_content(); $tpl->put_all(array('IDMENU' => $id, 'NAME' => $menu->get_title(), 'AUTH_MENUS' => Authorizations::generate_select(Menu::MENU_AUTH_BIT, $menu->get_auth()), 'C_MENU_HIDDEN_WITH_SMALL_SCREENS' => $menu->is_hidden_with_small_screens(), 'C_ENABLED' => $menu->is_enabled(), 'CONTENTS' => !empty($content) ? FormatingHelper::unparse($content) : '', 'DISPLAY_TITLE_CHECKED' => $menu->get_display_title() ? 'checked="checked"' : '')); } else { $tpl->put_all(array('C_ENABLED' => true, 'AUTH_MENUS' => Authorizations::generate_select(Menu::MENU_AUTH_BIT, array(), array(-1 => true, 0 => true, 1 => true, 2 => true)))); // Create a new generic menu $menu = new ContentMenu(''); } $locations = ''; foreach ($array_location as $key => $name) { $locations .= '<option value="' . $key . '" ' . ($block == $key ? 'selected="selected"' : '') . '>' . $name . '</option>'; } //Filtres MenuAdminService::add_filter_fieldset($menu, $tpl); $tpl->put_all(array('LOCATIONS' => $locations)); $tpl->display(); require_once PATH_TO_ROOT . '/admin/admin_footer.php';
$cat_list .= $option->display()->render(); } } } } $editor = AppContext::get_content_formatting_service()->get_default_editor(); $editor->set_identifier('contents'); $vars_tpl = array('C_FORUM_CUT_CAT' => true, 'CATEGORIES' => $cat_list, 'KERNEL_EDITOR' => $editor->display(), 'FORUM_NAME' => $config->get_forum_name() . ' : ' . $LANG['cut_topic'], 'IDTOPIC' => 0, 'U_TITLE_T' => '<a href="topic' . url('.php?id=' . $msg['idtopic'], '-' . $msg['idtopic'] . '.php') . '">' . stripslashes($topic['title']) . '</a>', 'U_FORUM_CAT' => '<a href="forum' . url('.php?id=' . $cat['id'], '-' . $cat['id'] . '.php') . '">' . $cat['name'] . '</a>', 'L_ACTION' => $LANG['forum_cut_subject'] . ' : ' . $topic['title'], 'L_FORUM_INDEX' => $LANG['forum_index'], 'L_CAT' => $LANG['category'], 'L_TITLE' => $LANG['title'], 'L_DESC' => $LANG['description'], 'L_MESSAGE' => $LANG['message'], 'L_SUBMIT' => $LANG['forum_cut_subject'], 'L_PREVIEW' => $LANG['preview'], 'L_RESET' => $LANG['reset'], 'L_POLL' => $LANG['poll'], 'L_OPEN_MENU_POLL' => $LANG['open_menu_poll'], 'L_QUESTION' => $LANG['question'], 'L_ANSWERS' => $LANG['answers'], 'L_POLL_TYPE' => $LANG['poll_type'], 'L_SINGLE' => $LANG['simple_answer'], 'L_MULTIPLE' => $LANG['multiple_answer']); if (empty($post_topic) && empty($preview_topic)) { //Liste des choix des sondages => 20 maxi $nbr_poll_field = 0; for ($i = 0; $i < 5; $i++) { $tpl->assign_block_vars('answers_poll', array('ID' => $i, 'ANSWER' => '')); $nbr_poll_field++; } $tpl->put_all(array('TITLE' => '', 'DESC' => '', 'CONTENTS' => FormatingHelper::unparse($msg['contents']), 'IDM' => $id_get_msg, 'CHECKED_NORMAL' => 'checked="checked"', 'SELECTED_SIMPLE' => 'checked="checked"', 'NO_DISPLAY_POLL' => 'true', 'NBR_POLL_FIELD' => $nbr_poll_field, 'L_TYPE' => '* ' . $LANG['type'], 'L_DEFAULT' => $LANG['default'], 'L_POST_IT' => $LANG['forum_postit'], 'L_ANOUNCE' => $LANG['forum_announce'], 'C_FORUM_POST_TYPE' => true, 'C_ADD_POLL_FIELD' => true)); } elseif (!empty($preview_topic) && !empty($id_post_msg)) { $title = retrieve(POST, 'title', '', TSTRING_UNCHANGE); $subtitle = retrieve(POST, 'desc', '', TSTRING_UNCHANGE); $contents = retrieve(POST, 'contents', '', TSTRING_UNCHANGE); $question = retrieve(POST, 'question', '', TSTRING_UNCHANGE); $type = retrieve(POST, 'type', 0); $checked_normal = $type == 0 ? 'checked="ckecked"' : ''; $checked_postit = $type == 1 ? 'checked="ckecked"' : ''; $checked_annonce = $type == 2 ? 'checked="ckecked"' : ''; //Liste des choix des sondages => 20 maxi $nbr_poll_field = 0; for ($i = 0; $i < 20; $i++) { $answer = retrieve(POST, 'a' . $i, '', TSTRING_UNCHANGE); if (!empty($answer)) { $tpl->assign_block_vars('answers_poll', array('ID' => $i, 'ANSWER' => $answer));
private function build_form(HTTPRequestCustom $request) { $common_lang = LangLoader::get('common'); $bug = $this->get_bug(); $types = $this->config->get_types(); $categories = $this->config->get_categories(); $severities = $this->config->get_severities(); $priorities = $this->config->get_priorities(); $versions_detected_in = array_reverse($this->config->get_versions_detected(), true); $display_types = count($types) > 1; $display_categories = count($categories) > 1; $display_severities = count($severities) > 1; $display_priorities = count($priorities) > 1; $display_versions_detected_in = count($versions_detected_in) > 1; $default_type = $this->config->get_default_type(); $default_category = $this->config->get_default_category(); $default_severity = $this->config->get_default_severity(); $default_priority = $this->config->get_default_priority(); $default_version = $this->config->get_default_version(); $form = new HTMLForm(__CLASS__); $fieldset = new FormFieldsetHTML('bug_infos', $this->lang['titles.bugs_infos']); $form->add_fieldset($fieldset); $fieldset->add_field(new FormFieldTextEditor('title', $common_lang['form.title'], $bug->get_title(), array('required' => true))); $fieldset->add_field(new FormFieldRichTextEditor('contents', $common_lang['form.description'], $bug->get_contents(), array('description' => $this->lang['explain.contents'], 'rows' => 15, 'required' => true))); //Types if ($display_types) { $array_types = array(); if (empty($default_type)) { $array_types[] = new FormFieldSelectChoiceOption(' ', ''); } foreach ($types as $key => $type) { $array_types[] = new FormFieldSelectChoiceOption(stripslashes($type), $key); } $fieldset->add_field(new FormFieldSimpleSelectChoice('type', $this->lang['labels.fields.type'], $bug->get_type(), $array_types, array('required' => $this->config->is_type_mandatory()))); } //Categories if ($display_categories) { $array_categories = array(); if (empty($default_category)) { $array_categories[] = new FormFieldSelectChoiceOption(' ', ''); } foreach ($categories as $key => $category) { $array_categories[] = new FormFieldSelectChoiceOption(stripslashes($category), $key); } $fieldset->add_field(new FormFieldSimpleSelectChoice('category', $this->lang['labels.fields.category'], $bug->get_category(), $array_categories, array('required' => $this->config->is_category_mandatory()))); } if (BugtrackerAuthorizationsService::check_authorizations()->advanced_write()) { //Severities if ($display_severities) { $array_severities = array(); if (empty($default_severity)) { $array_severities[] = new FormFieldSelectChoiceOption(' ', ''); } foreach ($severities as $key => $severity) { $array_severities[] = new FormFieldSelectChoiceOption(stripslashes($severity['name']), $key); } $fieldset->add_field(new FormFieldSimpleSelectChoice('severity', $this->lang['labels.fields.severity'], $bug->get_severity(), $array_severities, array('required' => $this->config->is_severity_mandatory()))); } //Priorities if ($display_priorities) { $array_priorities = array(); if (empty($default_priority)) { $array_priorities[] = new FormFieldSelectChoiceOption(' ', ''); } foreach ($priorities as $key => $priority) { $array_priorities[] = new FormFieldSelectChoiceOption(stripslashes($priority), $key); } $fieldset->add_field(new FormFieldSimpleSelectChoice('priority', $this->lang['labels.fields.priority'], $bug->get_priority(), $array_priorities, array('required' => $this->config->is_priority_mandatory()))); } } //Detected versions if ($display_versions_detected_in) { $array_versions = array(); if (empty($default_version)) { $array_versions[] = new FormFieldSelectChoiceOption(' ', ''); } foreach ($versions_detected_in as $key => $version) { $array_versions[] = new FormFieldSelectChoiceOption(stripslashes($version['name']), $key); } $fieldset->add_field(new FormFieldSimpleSelectChoice('detected_in', $this->lang['labels.fields.detected_in'], $bug->get_detected_in(), $array_versions, array('required' => $this->config->is_detected_in_version_mandatory()))); } $fieldset->add_field(new FormFieldCheckbox('reproductible', $this->lang['labels.fields.reproductible'], $bug->is_reproductible() ? FormFieldCheckbox::CHECKED : FormFieldCheckbox::UNCHECKED, array('events' => array('click' => ' if (HTMLForms.getField("reproductible").getValue()) { HTMLForms.getField("reproduction_method").enable(); } else { HTMLForms.getField("reproduction_method").disable(); }')))); $fieldset->add_field(new FormFieldRichTextEditor('reproduction_method', $this->lang['labels.fields.reproduction_method'], FormatingHelper::unparse($bug->get_reproduction_method()), array('rows' => 15, 'hidden' => !$bug->is_reproductible()))); $fieldset->add_field(new FormFieldHidden('referrer', $request->get_url_referrer())); $this->submit_button = new FormButtonDefaultSubmit(); $form->add_button($this->submit_button); $form->add_button(new FormButtonReset()); $this->form = $form; }
if (!empty($row['track'])) { $track = true; } $j++; } $result->dispose(); //Récupération du message quoté. if (!empty($quote_get)) { try { $quote_msg = PersistenceContext::get_querier()->select_single_row(DB_TABLE_PM_MSG, array('user_id', 'contents'), 'WHERE id = :id', array('id' => $quote_get)); } catch (RowNotFoundException $e) { $error_controller = PHPBoostErrors::unexisting_element(); DispatchManager::redirect($error_controller); } $pseudo = PersistenceContext::get_querier()->get_column_value(DB_TABLE_MEMBER, 'display_name', 'WHERE user_id = :id', array('id' => $quote_msg['user_id'])); $contents = '[quote=' . $pseudo . ']' . FormatingHelper::unparse($quote_msg['contents']) . '[/quote]'; } else { $contents = ''; } if ($convers['user_id'] > 0 && !$is_guest_in_convers) { $tpl->put_all(array('KERNEL_EDITOR' => $editor->display())); $tpl->assign_block_vars('post_pm', array('CONTENTS' => $contents, 'U_PM_ACTION_POST' => url('.php?id=' . $pm_id_get, '-0-' . $pm_id_get . '.php'))); //Gestion des erreurs $get_error = retrieve(GET, 'error', ''); switch ($get_error) { case 'e_incomplete': $errstr = $LANG['e_incomplete']; $type = MessageHelper::NOTICE; break; case 'e_pm_del': $errstr = $LANG['e_pm_del'];
function pages_unparse($contents) { $contents = link_unparse(stripslashes($contents)); return FormatingHelper::unparse($contents); }
$cat_list .= $option->display()->render(); } } } $vars_tpl = array_merge($vars_tpl, array('C_USER_CONNECTED' => AppContext::get_current_user()->check_level(User::MEMBER_LEVEL), 'TOTAL_ONLINE' => $total_online, 'USERS_ONLINE' => $total_online - $total_visit == 0 ? '<em>' . $LANG['no_member_online'] . '</em>' : $users_list, 'ADMIN' => $total_admin, 'MODO' => $total_modo, 'MEMBER' => $total_member, 'GUEST' => $total_visit, 'SELECT_CAT' => $cat_list, 'U_SUSCRIBE' => $track ? url('.php?ut=' . $id_get) : url('.php?t=' . $id_get), 'U_SUSCRIBE_PM' => url('.php?token=' . AppContext::get_session()->get_token() . '&' . ($track_pm ? 'utp' : 'tp') . '=' . $id_get), 'U_SUSCRIBE_MAIL' => url('.php?token=' . AppContext::get_session()->get_token() . '&' . ($track_mail ? 'utm' : 'tm') . '=' . $id_get), 'IS_TRACK' => $track ? 'true' : 'false', 'IS_TRACK_PM' => $track_pm ? 'true' : 'false', 'IS_TRACK_MAIL' => $track_mail ? 'true' : 'false', 'IS_CHANGE' => $topic['display_msg'] ? 'true' : 'false', 'U_ALERT' => url('.php?id=' . $id_get), 'L_TRACK_DEFAULT' => $track ? $LANG['untrack_topic'] : $LANG['track_topic'], 'L_SUSCRIBE_DEFAULT' => $track_mail ? $LANG['untrack_topic_mail'] : $LANG['track_topic_mail'], 'L_SUSCRIBE_PM_DEFAULT' => $track_pm ? $LANG['untrack_topic_pm'] : $LANG['track_topic_pm'], 'L_TRACK' => $LANG['track_topic'], 'L_UNTRACK' => $LANG['untrack_topic'], 'L_SUSCRIBE_PM' => $LANG['track_topic_pm'], 'L_UNSUSCRIBE_PM' => $LANG['untrack_topic_pm'], 'L_SUSCRIBE' => $LANG['track_topic_mail'], 'L_UNSUSCRIBE' => $LANG['untrack_topic_mail'], 'L_ALERT' => $LANG['alert_topic'], 'L_USER' => $total_online > 1 ? $LANG['user_s'] : $LANG['user'], 'L_ADMIN' => $total_admin > 1 ? $LANG['admin_s'] : $LANG['admin'], 'L_MODO' => $total_modo > 1 ? $LANG['modo_s'] : $LANG['modo'], 'L_MEMBER' => $total_member > 1 ? $LANG['member_s'] : $LANG['member'], 'L_GUEST' => $total_visit > 1 ? $LANG['guest_s'] : $LANG['guest'], 'L_AND' => $LANG['and'], 'L_ONLINE' => strtolower($LANG['online']))); //Récupération du message quoté. $contents = ''; if (!empty($quote_get)) { try { $quote_msg = PersistenceContext::get_querier()->select_single_row(PREFIX . 'forum_msg', array('user_id', 'contents'), 'WHERE id=:id', array('id' => $quote_get)); } catch (RowNotFoundException $e) { $error_controller = PHPBoostErrors::unexisting_element(); DispatchManager::redirect($error_controller); } $pseudo = PersistenceContext::get_querier()->get_column_value(DB_TABLE_MEMBER, 'display_name', 'WHERE user_id=:id', array('id' => $quote_msg['user_id'])); $contents = '[quote=' . $pseudo . ']' . stripslashes(FormatingHelper::unparse($quote_msg['contents'])) . '[/quote]'; } //Formulaire de réponse, non présent si verrouillé. if ($topic['status'] == '0' && !$check_group_edit_auth) { $tpl->put_all(array('C_ERROR_AUTH_WRITE' => true, 'L_ERROR_AUTH_WRITE' => $LANG['e_topic_lock_forum'])); } elseif (!ForumAuthorizationsService::check_authorizations($topic['idcat'])->write()) { $tpl->put_all(array('C_ERROR_AUTH_WRITE' => true, 'L_ERROR_AUTH_WRITE' => $LANG['e_cat_write'])); } else { $img_track_display = $track ? 'fa-msg-not-track' : 'fa-msg-track'; $img_track_pm_display = $track_pm ? 'fa-pm-not-track' : 'fa-pm-track'; $img_track_mail_display = $track_mail ? 'fa-mail-not-track' : 'fa-mail-track'; $editor = AppContext::get_content_formatting_service()->get_default_editor(); $editor->set_identifier('contents'); $vars_tpl = array_merge($vars_tpl, array('C_AUTH_POST' => true, 'CONTENTS' => $contents, 'KERNEL_EDITOR' => $editor->display(), 'ICON_TRACK' => '<i class="fa ' . $img_track_display . '"></i>', 'ICON_SUSCRIBE_PM' => '<i class="fa ' . $img_track_pm_display . '"></i>', 'ICON_SUSCRIBE' => '<i class="fa ' . $img_track_mail_display . '"></i>', 'U_FORUM_ACTION_POST' => url('.php?idt=' . $id_get . '&id=' . $topic['idcat'] . '&new=n_msg&token=' . AppContext::get_session()->get_token()))); //Affichage du lien pour changer le display_msg du topic et autorisation d'édition du statut. if ($config->is_message_before_topic_title_displayed() && ($check_group_edit_auth || AppContext::get_current_user()->get_id() == $topic['user_id'])) {