$content .= '<div class="row">'; $content .= DialogInputsYesNo('edit', $_REQUEST['type'], $dir_id, Language::Word('save'), Language::Word('cancel')); $content .= '</div>'; $content .= '</form>'; $title = Language::Word('direction editing'); $header = $title; } else { if (isset($_REQUEST['add_lang'])) { $direction = Direction::FetchByID($_REQUEST['id']); $dir_langs = $direction->FetchLanguages(); $free_languages = array_diff($languages, $dir_langs); if (count($free_languages) === 0) { $content = AlertMessage('alert-danger', Language::Word('all languages of this direction is implemented')); } else { $id = User::GetIDByLogin($_SESSION['user_login']); clear_tmp_images_dir(Direction::$type, $id); global $link_to_utility_sql_worker; global $link_to_img_upload; global $link_to_img_browse; global $languages; $content .= '<form method="post" action="' . $link_to_utility_sql_worker . '" enctype="multipart/form-data">'; $content .= PairLabelAndInput(4, 5, Language::Word('header'), 'name', Language::Word('insert header')) . '<br>'; $content .= PairLabelAndInputFile(4, 5, Language::Word('cover'), 'cover'); $content .= PairLabelAndSelect(4, 5, Language::Word('language'), 'language', $free_languages, array(key($free_languages), current($free_languages))); $content .= WrapToHiddenInputs(array('type' => Direction::$type, 'yes' => '', 'id' => $id, 'glob_id' => $direction->id)); $content .= '<div class="row"><h3>' . Language::Word('text') . '</h3></div>'; $content .= '<div class="row">'; $content .= '<div class="' . ColAllTypes(8) . ' ' . ColOffsetAllTypes(2) . '" align="center">'; $content .= '<textarea id="text_block" name="text_block"></textarea>'; $content .= '</div>'; $content .= '</div>';
$content .= 'contentsCss: [CKEDITOR.basePath + "contents.css", "css/styles.css", "css/bootstrap.min.css"],'; $content .= 'allowedContent: true, });'; $content .= 'CKEDITOR.config.height = 400;'; $content .= '</script>'; $content .= '<div class="row">'; $content .= '<input type="submit" class="btn btn-primary btn-lg" name="add" value="' . Language::Word('save') . '">'; $content .= '</div>'; $content .= '</form>'; $title = Language::Word('report sending'); $header = $title; } else { if (isset($_REQUEST['edit'])) { global $link_to_utility_sql_worker; global $link_to_img_upload; global $link_to_img_browse; clear_tmp_images_dir(Report::$type, $id); clear_tmp_files_dir(Report::$type, $id); $head_addition .= '<script type="text/javascript" src="js/files_upload.js"></script>'; $ob_id = $_POST['id']; $ob = Report::FetchBy(['eq_conds' => ['id' => $ob_id], 'is_unique' => true]); $receivers = User::FetchBy(['select_list' => 'id, name, surname', 'where_addition' => '(received_reports LIKE ("%\\"' . $ob_id . '\\"%"))']); $users = ''; foreach ($receivers as $key => $user) { $users .= '<div class="row">'; $users .= '<div class="' . ColAllTypes(12) . '">'; $users .= $user->LinkToThis(); $users .= '</div>'; $users .= '</div>'; } if (Error::IsError($ob)) { $content = AlertMessage('alert-danger', 'Error occured during fetching: ' . Error::ToString($ob));
$content .= '<div class="row">'; $content .= DialogInputsYesNo('edit', $_REQUEST['type'], $proj_id, Language::Word('save'), Language::Word('cancel')); $content .= '</div>'; $content .= '</form>'; $title = Language::Word('project editing'); $header = $title; } else { if (isset($_REQUEST['add_lang'])) { $project = Project::FetchByID($_REQUEST['id']); $proj_langs = $project->FetchLanguages(); $free_languages = array_diff($languages, $proj_langs); if (count($free_languages) === 0) { $content = AlertMessage('alert-danger', Language::Word('all languages of this project is implemented')); } else { $id = User::GetIDByLogin($_SESSION['user_login']); clear_tmp_images_dir(Project::$type, $id); global $link_to_utility_sql_worker; global $link_to_img_upload; global $languages; $dirs = Direction::FetchAll(); $select_fields = array(); for ($i = 0, $size = count($dirs); $i < $size; ++$i) { $select_fields[$dirs[$i]->id] = $dirs[$i]->name; } $content .= '<form method="post" action="' . $link_to_utility_sql_worker . '">'; $content .= PairLabelAndInput(4, 5, Language::Word('header'), 'name', Language::Word('insert header')) . '<br>'; $content .= PairLabelAndSelect(4, 5, Language::Word('language'), 'language', $free_languages, array(key($free_languages), current($free_languages))); $content .= WrapToHiddenInputs(array('type' => Project::$type, 'yes' => '', 'id' => $id, 'glob_id' => $project->id, 'direction_id' => $project->direction_id)); $content .= '<div class="row"><h3>' . Language::Word('text') . '</h3></div>'; $content .= '<div class="row">'; $content .= '<div class="' . ColAllTypes(8) . ' ' . ColOffsetAllTypes(2) . '" align="center">';
$content .= '</script>'; $content .= '<div class="row">'; $content .= DialogInputsYesNo('edit', $_REQUEST['type'], $block_id, Language::Word('save'), Language::Word('cancel'), true); $content .= '</div>'; $content .= '</form>'; $title = Language::Word('user block editing'); $header = $title; } else { if (isset($_REQUEST['add_lang'])) { $user_block = UserBlock::FetchByID($_REQUEST['id']); $blk_langs = $user_block->FetchLanguages(); $free_languages = array_diff($languages, $blk_langs); if (count($free_languages) === 0) { $content = AlertMessage('alert-danger', Language::Word('all languages of this user block is implemented')); } else { clear_tmp_images_dir(UserBlock::$type, $_REQUEST['id']); $title = Language::Word('language adding'); $header = $title; $assoc = $_REQUEST; $assoc['edit'] = 'edit'; $assoc['author_id'] = $user_block->author_id; $assoc['id'] = $user_block->GetID(); global $link_to_utility_sql_worker; global $link_to_img_upload; $content .= '<form method="post" action="' . $link_to_utility_sql_worker . '">'; $content .= PairLabelAndInput(4, 5, Language::Word('header'), 'name', Language::Word('insert header')); $content .= PairLabelAndInput(4, 5, Language::Word('priority'), 'priority', Language::Word('number')); $content .= PairLabelAndSelect(4, 5, Language::Word('language'), 'language', $free_languages, array(key($free_languages), current($free_languages))); $content .= WrapToHiddenInputs(array('type' => UserBlock::$type, 'yes' => '', 'id' => $_REQUEST['id'], 'glob_id' => $user_block->GetID(), 'author_id' => $user_block->author_id)); $content .= '<div class="row"><h3>Текст</h3></div>'; $content .= '<div class="row">';
$content .= '<div class="row">'; $content .= DialogInputsYesNo('edit', $_REQUEST['type'], $txt_id, Language::Word('save'), Language::Word('cancel')); $content .= '</div>'; $content .= '</form>'; $title = Language::Word('text editing'); $header = $title; } else { if (isset($_REQUEST['add_lang'])) { $text_part = TextPart::FetchByID($_REQUEST['id']); $txt_langs = $text_part->FetchLanguages(); $free_languages = array_diff($languages, $txt_langs); if (count($free_languages) === 0) { $content = AlertMessage('alert-danger', Language::Word('all languages of this text block is implemented')); } else { $id = User::GetIDByLogin($_SESSION['user_login']); clear_tmp_images_dir(TextPart::$type, $id); global $link_to_utility_sql_worker; global $link_to_img_upload; global $languages; $content .= '<form method="post" action="' . $link_to_utility_sql_worker . '" enctype="multipart/form-data">'; $content .= PairLabelAndInput(4, 5, Language::Word('header'), 'name', Language::Word('insert header')) . '<br>'; $content .= PairLabelAndInput(4, 5, Language::Word('priority'), 'priority', Language::Word('number')); $content .= PairLabelAndSelect(4, 5, Language::Word('choose role'), 'role', $content_types_full); $content .= PairLabelAndSelect(4, 5, Language::Word('language'), 'language', $free_languages, array(key($free_languages), current($free_languages))); $content .= WrapToHiddenInputs(array('type' => TextPart::$type, 'yes' => '', 'id' => $id, 'glob_id' => $text_part->GetID())); $content .= '<div class="row"><h3>Текст</h3></div>'; $content .= '<div class="row">'; $content .= '<div class="' . ColAllTypes(8) . ' ' . ColOffsetAllTypes(2) . '" align="center">'; $content .= '<textarea id="text_block" name="text_block"></textarea>'; $content .= '</div>'; $content .= '</div>';
$content .= '</div>'; $content .= '</form>'; $title = Language::Word('article editing'); $header = $title; } } else { if (isset($_REQUEST['add_lang'])) { $ob_id = $_REQUEST['id']; $ob = Article::FetchBy(['eq_conds' => array('id' => $ob_id), 'is_unique' => true]); $ob_langs = $ob->FetchLanguages(); $free_languages = array_diff($languages, $ob_langs); if (count($free_languages) === 0) { $content = AlertMessage('alert-danger', Language::Word('all languages of this article is implemented')); } else { $author_id = GetUserID(); clear_tmp_images_dir(Article::$type, $author_id); global $link_to_utility_sql_worker; global $link_to_img_upload; global $link_to_img_browse; global $languages; $content .= '<form method="post" action="' . $link_to_utility_sql_worker . '" enctype="multipart/form-data">'; $content .= PairLabelAndInput(4, 5, Language::Word('header'), 'name', Language::Word('insert header')) . '<br>'; $content .= PairLabelAndTextarea(4, 5, Language::Word('annotation'), 'annotation', Language::Word('insert annotation text')); $content .= PairLabelAndInputFile(4, 5, Language::Word('cover'), 'cover'); $content .= PairLabelAndSelect(4, 5, Language::Word('cover'), 'language', $free_languages, array(key($free_languages), current($free_languages))); $content .= WrapToHiddenInputs(array('type' => Article::$type, 'yes' => '', 'id' => $author_id, 'glob_id' => $ob->GetID())); $content .= '<div class="row"><h3>' . Language::Word('text') . '</h3></div>'; $content .= '<div class="row">'; $content .= '<div class="' . ColAllTypes(8) . ' ' . ColOffsetAllTypes(2) . '" align="center">'; $content .= '<textarea id="text_block" name="text_block"></textarea>'; $content .= '</div>';