public static function used_diskspace() { global $user; $user_data = new DataUserData($user->get_user_id()); $user_filesize = $user_data->get_filesize(); $user_quota = $user_data->get_quota(); if ($user_quota != 0) { $diskspace_per = $user_filesize / $user_quota * 100; if ($diskspace_per == 0) { $diskspace_per_display = "(0%)"; } else { $diskspace_per = floor($diskspace_per); if ($diskspace_per == 0) { $diskspace_per_display = "(> 1%)"; } else { $diskspace_per_display = "(" . $diskspace_per . "%)"; } } if (round($user_filesize / $user_quota * 100, 0) >= (int) Registry::get_value("data_quota_warning")) { $quotaWarn = " <img src='images/icons/notice.png' alt='W' />"; } else { $quotaWarn = ""; } } else { $quotaWarn = ""; $diskspace_per_display = ""; } $act_filesize = Convert::convert_byte_1024($user_filesize); $template = new HTMLTemplate("data/home/summary/used_diskspace.html"); $template->set_var("used_diskspace", $act_filesize . " " . $diskspace_per_display . "" . $quotaWarn); return $template->get_string(); }
public static function finished_projects() { global $user; $sum_projects = Project_Wrapper::count_user_projects($user->get_user_id()); $sum_finished_projects = Project_Wrapper::count_user_finished_projects($user->get_user_id()); $template = new HTMLTemplate("project/home/summary/my_finished_projects.html"); $template->set_var("finished_projects", $sum_finished_projects . "/" . $sum_projects); return $template->get_string(); }
/** * @param string $action * @return string */ public static function get_data_browser_link_html_and_button_handler($action) { global $regional; $html; $html_caption; $button_handler; $button_handler_caption; $template; $paramquery = $_GET; unset($paramquery['run']); switch ($action) { case "parameter_delete": if (isset($_POST['sure'])) { self::delete($_POST['parameter_id']); } else { $template = new HTMLTemplate("data/parameter_delete_window.html"); $button_handler_template = new JSTemplate("data/js/parameter_delete_window.js"); $button_handler_template->set_var("session_id", $_GET['session_id']); $button_handler_template->set_var("parameter_id", $_POST['parameter_id']); $button_handler = $button_handler_template->get_string(); $button_handler_caption = "Delete"; $html_caption = "Delete Parameter"; $html = $template->get_string(); } break; case "permission": require_once "data.ajax.php"; if (isset($_POST['permissions'])) { $success = DataAjax::change_permission(json_decode($_POST['permissions']), "Parameter"); return $success; } else { $permission = DataAjax::permission_window(); $button_handler_template = new JSTemplate("data/js/parameter_permission_window.js"); $button_handler_template->set_var("session_id", $_GET['session_id']); $button_handler_template->set_var("parameter_id", $_POST['parameter_id']); $button_handler = $button_handler_template->get_string(); $button_handler_caption = "Change"; $html_caption = "Change permission"; $html = $permission; } break; } $array = array("content" => $html, "content_caption" => $html_caption, "handler" => $button_handler, "handler_caption" => $button_handler_caption); return json_encode($array); }
public static function home_dialog() { $template = new HTMLTemplate("data/admin/home_dialog.html"); $template->set_var("base_dir", System::get_base_directory()); $template->set_var("system_space", Convert::convert_byte_1024(System::get_system_space())); $template->set_var("user_used_space", Convert::convert_byte_1024(DataUserData::get_used_space())); $additional_quota_dialog_array = ModuleDialog::list_dialogs_by_type("additional_quota"); if (is_array($additional_quota_dialog_array) and count($additional_quota_dialog_array) >= 1) { $additional_quota_array = array(); $additional_quota_counter = 0; foreach ($additional_quota_dialog_array as $key => $value) { if (file_exists($value['class_path'])) { require_once $value['class_path']; $additional_quota_array[$additional_quota_counter]['title'] = Language::get_message($value['language_address'], "dialog"); $additional_quota_array[$additional_quota_counter]['value'] = $value['class']::$value['method'](); $additional_quota_counter++; } } $template->set_var("additional_quota_array", $additional_quota_array); } $template->set_var("db_used_space", Convert::convert_byte_1024(System::get_used_database_space())); $template->set_var("free_space", Convert::convert_byte_1024(System::get_free_space())); return $template->get_string(); }
if (is_array($module_link_array) and count($module_link_array) >= 1) { $content_array = array(); $counter = 0; foreach ($module_link_array as $key => $value) { $button_template = new HTMLTemplate($value['file']); $button_paramquery = array(); $button_paramquery['username'] = $_GET['username']; $button_paramquery['session_id'] = $_GET['session_id']; if (is_array($value['array']) and count($value['array']) >= 1) { foreach ($value['array'] as $array_key => $array_value) { $button_paramquery[$array_key] = $array_value; } } $button_params = http_build_query($button_paramquery, '', '&'); $button_template->set_var("params", $button_params); $content_array[$counter]['content'] = $button_template->get_string(); $counter++; } $template->set_var("I_WANT_TO_ARRAY", $content_array); } $paramquery = $_GET; $paramquery['nav'] = "help"; unset($paramquery['nextpage']); unset($paramquery['sure']); unset($paramquery['id']); unset($paramquery['aspect']); unset($paramquery['sortvalue']); unset($paramquery['sortby']); unset($paramquery['page']); unset($paramquery['pageref']); unset($paramquery['action']);
/** * @throws OrganisationUnitIDMissingException */ public static function detail() { global $user; if ($_GET['ou_id']) { $organisation_unit = new OrganisationUnit($_GET['ou_id']); $template = new HTMLTemplate("organisation_unit/organisation_unit_detail.html"); $template->set_var("title", $organisation_unit->get_name()); if ($user->is_admin() == true) { $paramquery = $_GET; $paramquery['nav'] = "administration"; $paramquery['run'] = "organisation_unit"; $paramquery['action'] = "detail"; $paramquery['id'] = $_GET['ou_id']; unset($paramquery['ou_id']); $params = http_build_query($paramquery, '', '&'); $template->set_var("admin_params", $params); $template->set_var("is_owner", true); } else { $template->set_var("is_owner", false); } // OWNERS $organisation_unit_owner_array = $organisation_unit->list_owners(12); if (is_array($organisation_unit_owner_array) and count($organisation_unit_owner_array) >= 1) { $ou_owners = null; foreach ($organisation_unit_owner_array as $key => $value) { if ($value == $user->get_user_id()) { $paramquery = $_GET; $paramquery['nav'] = "administration"; $paramquery['run'] = "organisation_unit"; $paramquery['action'] = "detail"; $paramquery['id'] = $_GET['ou_id']; unset($paramquery['ou_id']); $params = http_build_query($paramquery, '', '&'); $template->set_var("admin_params", $params); $template->set_var("is_owner", true); } $owner = new User($value); $owner_paramquery = $_GET; $owner_paramquery['run'] = "common_dialog"; $owner_paramquery['dialog'] = "user_detail"; $owner_paramquery['id'] = $value; $owner_params = http_build_query($owner_paramquery, '', '&'); if ($ou_owners) { $ou_owners .= ", <a href='index.php?" . $owner_params . "'>" . $owner->get_full_name(true) . "</a>"; } else { $ou_owners .= "<a href='index.php?" . $owner_params . "'>" . $owner->get_full_name(true) . "</a>"; } } } else { $ou_owners = "<span class='italic'>none</span>"; } $number_of_owners = $organisation_unit->get_number_of_owners(); $owner_list_paramquery = $_GET; $owner_list_paramquery['run'] = "common_dialog"; $owner_list_paramquery['dialog'] = "ou_detail"; $owner_list_paramquery['action'] = "list_owners"; $owner_list_paramquery['ou_id'] = $_GET['ou_id']; $owner_list_params = http_build_query($owner_list_paramquery, '', '&'); if ($number_of_owners > 12) { $number_of_owners = $number_of_owners - 12; $ou_owners .= " (+ <a href='index.php?" . $owner_list_params . "'>" . $number_of_owners . " more</a>)"; } else { $ou_owners .= " (<a href='index.php?" . $owner_list_params . "'>list</a>)"; } $template->set_var("owners", $ou_owners); // LEADERS $organisation_unit_leader_array = $organisation_unit->list_leaders(12); if (is_array($organisation_unit_leader_array) and count($organisation_unit_leader_array) >= 1) { $ou_leaders = null; foreach ($organisation_unit_leader_array as $key => $value) { $leader = new User($value); $leader_paramquery = $_GET; $leader_paramquery['run'] = "common_dialog"; $leader_paramquery['dialog'] = "user_detail"; $leader_paramquery['id'] = $value; $leader_params = http_build_query($leader_paramquery, '', '&'); if ($ou_leaders) { $ou_leaders .= ", <a href='index.php?" . $leader_params . "'>" . $leader->get_full_name(true) . "</a>"; } else { $ou_leaders .= "<a href='index.php?" . $leader_params . "'>" . $leader->get_full_name(true) . "</a>"; } } } else { $ou_leaders = "<span class='italic'>none</span>"; } $number_of_leaders = $organisation_unit->get_number_of_leaders(); $leader_list_paramquery = $_GET; $leader_list_paramquery['run'] = "common_dialog"; $leader_list_paramquery['dialog'] = "ou_detail"; $leader_list_paramquery['action'] = "list_leaders"; $leader_list_paramquery['ou_id'] = $_GET['ou_id']; $leader_list_params = http_build_query($leader_list_paramquery, '', '&'); if ($number_of_leaders > 12) { $number_of_leaders = $number_of_leaders - 12; $ou_leaders .= " (+ <a href='index.php?" . $leader_list_params . "'>" . $number_of_leaders . " more</a>)"; } else { $ou_leaders .= " (<a href='index.php?" . $leader_list_params . "'>list</a>)"; } $template->set_var("leaders", $ou_leaders); // MEMBERS $organisation_unit_member_array = $organisation_unit->list_members(12); if (is_array($organisation_unit_member_array) and count($organisation_unit_member_array) >= 1) { $ou_members = null; foreach ($organisation_unit_member_array as $key => $value) { $member = new User($value); $member_paramquery = $_GET; $member_paramquery['run'] = "common_dialog"; $member_paramquery['dialog'] = "user_detail"; $member_paramquery['id'] = $value; $member_params = http_build_query($member_paramquery, '', '&'); if ($ou_members) { $ou_members .= ", <a href='index.php?" . $member_params . "'>" . $member->get_full_name(true) . "</a>"; } else { $ou_members .= "<a href='index.php?" . $member_params . "'>" . $member->get_full_name(true) . "</a>"; } } } else { $ou_members = "<span class='italic'>none</span>"; } $number_of_users = $organisation_unit->get_number_of_users(); $member_list_paramquery = $_GET; $member_list_paramquery['run'] = "common_dialog"; $member_list_paramquery['dialog'] = "ou_detail"; $member_list_paramquery['action'] = "list_members"; $member_list_paramquery['ou_id'] = $_GET['ou_id']; $member_list_params = http_build_query($member_list_paramquery, '', '&'); if ($number_of_users > 12) { $number_of_users = $number_of_users - 12; $ou_members .= " (+ <a href='index.php?" . $member_list_params . "'>" . $number_of_users . " more</a>)"; } else { $ou_members .= " (<a href='index.php?" . $member_list_params . "'>list</a>)"; } $template->set_var("members", $ou_members); // QUALITY MANAGERS $organisation_unit_quality_manager_array = $organisation_unit->list_quality_managers(12); if (is_array($organisation_unit_quality_manager_array) and count($organisation_unit_quality_manager_array) >= 1) { $ou_quality_managers = null; foreach ($organisation_unit_quality_manager_array as $key => $value) { $quality_manager = new User($value); $quality_manager_paramquery = $_GET; $quality_manager_paramquery['run'] = "common_dialog"; $quality_manager_paramquery['dialog'] = "user_detail"; $quality_manager_paramquery['id'] = $value; $quality_manager_params = http_build_query($quality_manager_paramquery, '', '&'); if ($ou_quality_managers) { $ou_quality_managers .= ", <a href='index.php?" . $quality_manager_params . "'>" . $quality_manager->get_full_name(true) . "</a>"; } else { $ou_quality_managers .= "<a href='index.php?" . $quality_manager_params . "'>" . $quality_manager->get_full_name(true) . "</a>"; } } } else { $ou_quality_managers = "<span class='italic'>none</span>"; } $number_of_quality_managers = $organisation_unit->get_number_of_quality_managers(); $quality_manager_list_paramquery = $_GET; $quality_manager_list_paramquery['run'] = "common_dialog"; $quality_manager_list_paramquery['dialog'] = "ou_detail"; $quality_manager_list_paramquery['action'] = "list_quality_managers"; $quality_manager_list_paramquery['ou_id'] = $_GET['ou_id']; $quality_manager_list_params = http_build_query($quality_manager_list_paramquery, '', '&'); if ($number_of_quality_managers > 12) { $number_of_quality_managers = $number_of_quality_managers - 12; $ou_quality_managers .= " (+ <a href='index.php?" . $quality_manager_list_params . "'>" . $number_of_quality_managers . " more</a>)"; } else { $ou_quality_managers .= " (<a href='index.php?" . $quality_manager_list_params . "'>list</a>)"; } $template->set_var("quality_managers", $ou_quality_managers); // GROUPS $organisation_unit_group_array = $organisation_unit->list_groups(12); if (is_array($organisation_unit_group_array) and count($organisation_unit_group_array) >= 1) { $ou_groups = null; foreach ($organisation_unit_group_array as $key => $value) { $group = new Group($value); $group_paramquery = $_GET; $group_paramquery['run'] = "common_dialog"; $group_paramquery['dialog'] = "group_detail"; $group_paramquery['id'] = $value; $group_params = http_build_query($group_paramquery, '', '&'); if ($ou_groups) { $ou_groups .= ", <a href='index.php?" . $group_params . "'>" . $group->get_name() . "</a>"; } else { $ou_groups .= "<a href='index.php?" . $group_params . "'>" . $group->get_name() . "</a>"; } } } else { $ou_groups = "<span class='italic'>none</span>"; } $number_of_groups = $organisation_unit->get_number_of_groups(); $group_list_paramquery = $_GET; $group_list_paramquery['run'] = "common_dialog"; $group_list_paramquery['dialog'] = "ou_detail"; $group_list_paramquery['action'] = "list_groups"; $group_list_paramquery['ou_id'] = $_GET['ou_id']; $group_list_params = http_build_query($group_list_paramquery, '', '&'); if ($number_of_groups > 12) { $number_of_groups = $number_of_groups - 12; $ou_groups .= " (+ <a href='index.php?" . $group_list_params . "'>" . $number_of_groups . " more</a>)"; } else { $ou_groups .= " (<a href='index.php?" . $group_list_params . "'>list</a>)"; } $template->set_var("groups", $ou_groups); $module_link_array = ModuleLink::list_links_by_type("ou_detail_buttons"); if (is_array($module_link_array) and count($module_link_array) >= 1) { $content_array = array(); $counter = 0; foreach ($module_link_array as $key => $value) { $button_template = new HTMLTemplate($value['file']); $button_paramquery = array(); $button_paramquery['username'] = $_GET['username']; $button_paramquery['session_id'] = $_GET['session_id']; if (is_array($value['array']) and count($value['array']) >= 1) { foreach ($value['array'] as $array_key => $array_value) { if (strpos($array_value, "%") === 0 and strpos($array_value, "%", 1) !== false) { $array_value_key = strtolower(str_replace("%", "", $array_value)); if ($_GET[$array_value_key]) { $button_paramquery[$array_key] = $_GET[$array_value_key]; } } else { $button_paramquery[$array_key] = $array_value; } } } $button_params = http_build_query($button_paramquery, '', '&'); $button_template->set_var("params", $button_params); $content_array[$counter]['content'] = $button_template->get_string(); $counter++; } $template->set_var("OU_FOOTER_ARRAY", $content_array); } $template->output(); } else { throw new OrganisationUnitIDMissingException(); } }
public static function home_dialog() { $template = new HTMLTemplate("base/user/admin/group/home_dialog.html"); $paramquery = array(); $paramquery['username'] = $_GET['username']; $paramquery['session_id'] = $_GET['session_id']; $paramquery['nav'] = $_GET['nav']; $paramquery['run'] = "organisation"; $paramquery['dialog'] = "groups"; $paramquery['action'] = "add"; $params = http_build_query($paramquery, '', '&'); $template->set_var("group_add_params", $params); $template->set_var("group_amount", Group::count_groups()); return $template->get_string(); }
/** * @param string $get_array * @return string * @throws SampleIDMissingException */ public static function delete($get_array) { global $user; if ($get_array) { $_GET = unserialize($get_array); } if ($_GET['sample_id']) { $project = new Sample($_GET['sample_id']); $template = new HTMLTemplate("sample/int_admin/delete_window.html"); $array['continue_caption'] = "Yes"; $array['cancel_caption'] = "No"; $array['content_caption'] = "Delete Sample"; $array['height'] = 200; $array['width'] = 400; $array['content'] = $template->get_string(); $array['container'] = "#SampleDeleteWindow"; $continue_handler_template = new JSTemplate("sample/int_admin/js/delete_continue_handler.js"); $continue_handler_template->set_var("username", $_GET['username']); $continue_handler_template->set_var("session_id", $_GET['session_id']); $continue_handler_template->set_var("get_array", $get_array); $array['continue_handler'] = $continue_handler_template->get_string(); return json_encode($array); } else { throw new SampleIDMissingException(); } }
/** * @param string $item_holder_type * @param integer $item_holder_id * @param bool $as_page * @param bool $in_assistant * @param string $form_field_name * @throws ItemHolderTypeMissingException * @throws ItemHolderIDMissingException */ public static function list_file_items($item_holder_type, $item_holder_id, $as_page = true, $in_assistant = false, $form_field_name = null) { global $session, $user; if (!$item_holder_type) { throw new ItemHolderTypeMissingException(); } if (!is_numeric($item_holder_id)) { throw new ItemHolderIDMissingException(); } $argument_array = array(); $argument_array[0][0] = "item_holder_type"; $argument_array[0][1] = $item_holder_type; $argument_array[1][0] = "item_holder_id"; $argument_array[1][1] = $item_holder_id; $argument_array[2][0] = "as_page"; $argument_array[2][1] = $as_page; $argument_array[3][0] = "in_assistant"; $argument_array[3][1] = $in_assistant; if ($in_assistant == false) { $list = new List_IO("DataFileItem", "/core/modules/data/ajax/file.ajax.php", "list_file_items", "count_file_items", $argument_array, "DataAjaxFiles", 20, true, true); $list->add_column("", "symbol", false, 16); $list->add_column(Language::get_message("DataGeneralListColumnName", "general"), "name", true, null); $list->add_column(Language::get_message("DataGeneralListColumnSize", "general"), "size", true, null); $list->add_column(Language::get_message("DataGeneralListColumnDateTime", "general"), "datetime", true, null); } else { $list = new List_IO("DataFileItem", "/core/modules/data/ajax/file.ajax.php", "list_file_items", "count_file_items", $argument_array, "DataAjaxFiles", 20, false, false); $list->add_column("", "checkbox", false, 16, $form_field_name); $list->add_column("", "symbol", false, 16); $list->add_column(Language::get_message("DataGeneralListColumnName", "general"), "name", false, null); $list->add_column(Language::get_message("DataGeneralListColumnSize", "general"), "size", false, null); $list->add_column(Language::get_message("DataGeneralListColumnDateTime", "general"), "datetime", false, null); } $template = new HTMLTemplate("data/file_list.html"); $template->set_var("list", $list->get_list()); return $template->get_string(); }
public static function group_select_dialog() { $template = new HTMLTemplate("base/user/group_select_dialog.html"); return $template->get_string(); }
/** * @return string */ public function get_content() { $return = ""; $template = new HTMLTemplate("base/assistant/header.html"); $return .= $template->get_string(); $element_width = floor(730 / count($this->screen_array)); foreach ($this->screen_array as $key => $value) { $template = new HTMLTemplate("base/assistant/element.html"); $template->set_var("id", $key + 1); $template->set_var("width", $element_width); $template->set_var("image", $key + 1 . "_lgrey.png"); $template->set_var("text", $value); $return .= $template->get_string(); } $template = new HTMLTemplate("base/assistant/footer.html"); $return .= $template->get_string(); $template = new HTMLTemplate("base/assistant/content.html"); $template->set_var("ajax_handler", $this->ajax_handler); $template->set_var("ajax_page", $this->init_page); $template->set_var("max_page", count($this->screen_array)); $template->set_var("form_field_name", $this->form_field_name); $return .= $template->get_string(); return $return; }
public static function get_table_row($module) { global $db; self::get_version(); $template = new HTMLTemplate("table_row.html", "install/template"); if (file_exists("update/update.php")) { include "update/update.php"; } if (file_exists("information/" . $module . ".php")) { include "information/" . $module . ".php"; } else { $version = "not available"; } if (file_exists("install/postgres/structure/" . $module . ".php")) { include "install/postgres/structure/" . $module . ".php"; try { $sql = $check_statement; $res = @$db->db_query($sql); $iv = self::$installed_module_array[$module]; // Überprüfen ob größer // Überprüfen ob Update-Routine vorhanden if (self::$installed_module_array[$module] == $version) { $status = "up to date"; $status_image = "<img src='images/ok.png' alt='' />"; } else { $version_found = false; foreach ($update as $key => $value) { if ($value['from'] == self::$installed_module_array[$module]) { $version_found = true; break; } } if ($version_found == true) { $status = "update required"; $status_image = ""; } else { $status = "update not available"; $status_image = ""; } } } catch (DatabaseQueryFailedException $e) { $iv = "none"; $status = "not installed"; $install = true; $status_image = ""; } $av = $version; } else { $av = "none"; $iv = "none"; $status = "OK"; $status_image = ""; } $template->set_var("av", $av); $template->set_var("iv", $iv); $template->set_var("fv", constant("PRODUCT_VERSION")); $template->set_var("status", $status); $template->set_var("status_image", $status_image); $template->set_var("name", $module); return $template->get_string(); }
public static function list_upcoming_tasks() { $template = new HTMLTemplate("organiser/list_upcoming_tasks.html"); $template->set_var("exist_todo_task", false); return $template->get_string(); }
/** * @param string $get_array * @return string */ public static function create($get_array) { if ($get_array) { $_GET = unserialize($get_array); } if ($_GET['project_id']) { $project = new Project($_GET['project_id']); $template = new HTMLTemplate("project/log_create_window.html"); $array['content_caption'] = "Create New Log Entry"; $array['height'] = 430; $array['width'] = 400; $array['continue_caption'] = "Create"; $array['cancel_caption'] = "Cancel"; $array['content'] = $template->get_string(); $array['container'] = "#ProjectLogCreateWindow"; $continue_handler_template = new JSTemplate("project/js/log_create.js"); $continue_handler_template->set_var("session_id", $_GET['session_id']); $continue_handler_template->set_var("get_array", $get_array); $array['continue_handler'] = $continue_handler_template->get_string(); return json_encode($array); } }
public static function list_upcoming_tasks() { $template = new HTMLTemplate("project/tasks/list_upcoming_tasks.html"); $project_task = new ProjectTask(null); $project_task_array = $project_task->list_upcoming_tasks(); if (is_array($project_task_array) and count($project_task_array) >= 1) { $template->set_var("exist_project_task", true); $content_array = array(); $counter = 0; foreach ($project_task_array as $key => $value) { $paramquery = $_GET; $paramquery['nav'] = "project"; $paramquery['run'] = "detail"; $paramquery['project_id'] = $value['project_id']; $params = http_build_query($paramquery, '', '&'); if ($value['status'] == 1) { $content_array[$counter]['name'] = "<span class='HomeTodayOverdueEntry'><a href='index.php?" . $params . "'>" . $value['project_name'] . "</a> - " . $value['task_name'] . " - " . $value['end_date'] . "</span>"; } else { $content_array[$counter]['name'] = "<a href='index.php?" . $params . "'>" . $value['project_name'] . "</a> - " . $value['task_name'] . " - " . $value['end_date']; } $counter++; } $template->set_var("project_task_array", $content_array); } else { $template->set_var("exist_project_task", false); } return $template->get_string(); }
public static function add() { $template = new HTMLTemplate("manufacturer/add.html"); return $template->get_string(); }
public static function main() { global $user; // Tabs $template_header = new HTMLTemplate("base/navigation/main/main_navigation_header.html"); $module_navigation_array = ModuleNavigation::list_module_navigations_entries(); if (is_array($module_navigation_array) and count($module_navigation_array) >= 1) { $module_tab_string = ""; $module_tab_active = false; foreach ($module_navigation_array as $key => $value) { $module_name = SystemHandler::get_module_name_by_module_id($value['module_id']); if ($module_name == "base" and $value['alias'] == "admin" and $user->is_admin() or $module_name != "base" or $module_name == "base" and $value['alias'] != "admin") { $paramquery['username'] = $_GET['username']; $paramquery['session_id'] = $_GET['session_id']; if ($value['alias']) { $active_alias = $module_name . "." . $value['alias']; $paramquery['nav'] = $module_name . "." . $value['alias']; } else { $active_alias = $module_name; $paramquery['nav'] = $module_name; } $params = http_build_query($paramquery, '', '&'); if (!$_GET['nav'] and $active_alias == "base") { $_GET['nav'] = "base"; } switch ($value['colour']) { case "blue": if ($_GET['nav'] == $active_alias) { $background_color_class = "NavigationBackgroundBlue"; $template = new HTMLTemplate("base/navigation/main/tabs/blue_tab_active.html"); $current_module = $active_alias; $current_color = $value['colour']; $module_tab_active = true; } else { $template = new HTMLTemplate("base/navigation/main/tabs/blue_tab.html"); } break; case "green": if ($_GET['nav'] == $active_alias) { $background_color_class = "NavigationBackgroundGreen"; $template = new HTMLTemplate("base/navigation/main/tabs/green_tab_active.html"); $current_module = $active_alias; $current_color = $value['colour']; $module_tab_active = true; } else { $template = new HTMLTemplate("base/navigation/main/tabs/green_tab.html"); } break; case "orange": if ($_GET['nav'] == $active_alias) { $background_color_class = "NavigationBackgroundOrange"; $template = new HTMLTemplate("base/navigation/main/tabs/orange_tab_active.html"); $current_module = $active_alias; $current_color = $value['colour']; $module_tab_active = true; } else { $template = new HTMLTemplate("base/navigation/main/tabs/orange_tab.html"); } break; default: if ($_GET['nav'] == $active_alias) { $background_color_class = "NavigationBackgroundGrey"; $template = new HTMLTemplate("base/navigation/main/tabs/grey_tab_active.html"); $current_module = $active_alias; $current_color = $value['colour']; $module_tab_active = true; } else { $template = new HTMLTemplate("base/navigation/main/tabs/grey_tab.html"); } break; } $template->set_var("params", $params); $template->set_var("title", Language::get_message($value['language_address'], "navigation")); $config_folder = "core/modules/" . SystemHandler::get_module_folder_by_module_name($module_name) . "/config"; if (is_dir($config_folder)) { $subnavigation_file = $config_folder . "/module_subnavigation.php"; if (is_file($subnavigation_file)) { require_once $subnavigation_file; if (is_array($sub_menu) and count($sub_menu) >= 1) { $template->set_var("down", true); $template->set_var("link", $sub_menu); } else { $template->set_var("down", false); } unset($sub_menu); } else { $template->set_var("down", false); } } else { $template->set_var("down", false); } $module_tab_string .= $template->get_string(); } } } $template_header->set_var("background_class", $background_color_class); $template_header->output(); echo $module_tab_string; $template = new HTMLTemplate("base/navigation/main/main_navigation_footer.html"); $template->output(); }
/** * @param string $get_array * @param string $type_array * @param string $category_array * @return string */ public static function add_as_item_window($get_array, $type_array, $category_array) { if ($get_array) { $_GET = unserialize($get_array); } if ($type_array) { $type_array = unserialize($type_array); } if ($category_array) { $category_array = unserialize($category_array); } $template = new HTMLTemplate("equipment/add_item_window.html"); $equipment_array = EquipmentType::list_entries(); $result = array(); $hit_array = array(); $counter = 0; if (is_array($type_array) and count($type_array) >= 1) { if (is_array($equipment_array) and count($equipment_array) >= 1) { foreach ($equipment_array as $key => $value) { if (in_array($value, $type_array) or $value <= 3) { $equipment_type = new EquipmentType($value); $result[$counter]['value'] = $value; $result[$counter]['disabled'] = ""; $result[$counter]['content'] = $equipment_type->get_name() . " (" . $equipment_type->get_cat_name() . ")"; $counter++; array_push($hit_array, $value); } } } if (is_array($category_array) and count($category_array) >= 1) { foreach ($category_array as $key => $value) { $equipment_cat_array = EquipmentType::list_entries_by_cat_id($value); if (is_array($equipment_cat_array) and count($equipment_cat_array) >= 1) { foreach ($equipment_cat_array as $key => $value) { if (!in_array($value, $hit_array)) { $equipment_type = new EquipmentType($value); $result[$counter]['value'] = $value; $result[$counter]['disabled'] = ""; $result[$counter]['content'] = $equipment_type->get_name() . " (" . $equipment_type->get_cat_name() . ")"; $counter++; array_push($hit_array, $value); } } } } } } else { if (is_array($category_array) and count($category_array) >= 1) { foreach ($category_array as $key => $value) { $equipment_cat_array = EquipmentType::list_entries_by_cat_id($value); if (is_array($equipment_cat_array) and count($equipment_cat_array) >= 1) { if (!in_array(1, $equipment_cat_array)) { $equipment_cat_array[] = 1; } if (!in_array(2, $equipment_cat_array)) { $equipment_cat_array[] = 2; } if (!in_array(3, $equipment_cat_array)) { $equipment_cat_array[] = 3; } foreach ($equipment_cat_array as $key => $value) { if (!in_array($value, $hit_array)) { $equipment_type = new EquipmentType($value); $result[$counter]['value'] = $value; $result[$counter]['disabled'] = ""; $result[$counter]['content'] = $equipment_type->get_name() . " (" . $equipment_type->get_cat_name() . ")"; $counter++; array_push($hit_array, $value); } } } } } else { if (is_array($equipment_array) and count($equipment_array) >= 1) { foreach ($equipment_array as $key => $value) { $equipment_type = new EquipmentType($value); $result[$counter]['value'] = $value; $result[$counter]['disabled'] = ""; $result[$counter]['content'] = $equipment_type->get_name() . " (" . $equipment_type->get_cat_name() . ")"; $counter++; } } } } if ($counter == 0) { $result[0]['value'] = "0"; $result[0]['disabled'] = "disabled='disabled'"; $result[0]['content'] = "NO EQUIPMENT FOUND!"; } $template->set_var("select", $result); if ($_GET['parent'] and is_numeric($_GET['parent_id'])) { $array['container'] = "#EquipmentItemAddWindow" . $_GET['parent_key'] . "-" . $_GET['parent_id'] . "-" . $_GET['key']; $container_value_select = "EquipmentItemAddValueField" . $_GET['parent_key'] . "-" . $_GET['parent_id'] . "-" . $_GET['key']; } else { $array['container'] = "#EquipmentItemAddWindow" . $_GET['key']; $container_value_select = "EquipmentItemAddValueField" . $_GET['key']; } $template->set_var("container_value_select_id", $container_value_select); $array['continue_caption'] = "Add"; $array['cancel_caption'] = "Cancel"; $array['content_caption'] = "Add Equipment"; $array['height'] = 350; $array['width'] = 400; $array['content'] = $template->get_string(); $continue_handler_template = new JSTemplate("equipment/js/add_item_window.js"); $continue_handler_template->set_var("session_id", $_GET['session_id']); $continue_handler_template->set_var("get_array", $get_array); $continue_handler_template->set_var("container_id", $array['container']); $continue_handler_template->set_var("container_value_select_id", $container_value_select); $array['continue_handler'] = $continue_handler_template->get_string(); return json_encode($array); }
/** * @param string $action * @return string */ public static function get_data_browser_link_html_and_button_handler($action) { $html; $html_caption; $button_handler; $button_handler_caption; $template; $paramquery = $_GET; unset($paramquery['run']); switch ($action) { case "folder_add": if (isset($_POST['folder_name'])) { return self::add_folder($_POST['folder_id'], $_POST['folder_name']); } else { $button_handler_template = new JSTemplate("data/js/folder_add_window.js"); $button_handler_template->set_var("session_id", $_GET['session_id']); $button_handler_template->set_var("folder_id", $_POST['folder_id']); $button_handler = $button_handler_template->get_string(); $button_handler_caption = "Add"; $html_caption = "Add Folder"; $template = new HTMLTemplate("data/folder_add_window.html"); $html = $template->get_string(); } break; case "folder_delete": if (isset($_POST['sure'])) { return self::delete_folder($_POST['folder_id']); } else { $paramquery['sure'] = "true"; $paramquery['nextpage'] = "1"; $params = http_build_query($paramquery); $template = new HTMLTemplate("data/folder_delete_window.html"); $template->set_var("params", $params); $button_handler_template = new JSTemplate("data/js/folder_delete_window.js"); $button_handler_template->set_var("session_id", $_GET['session_id']); $button_handler_template->set_var("folder_id", $_POST['folder_id']); $button_handler = $button_handler_template->get_string(); $button_handler_caption = "Delete"; $html_caption = "Delete Folder"; $html = $template->get_string(); } break; case "folder_rename": if (isset($_POST['folder_name'])) { return self::rename_folder($_POST['folder_id'], $_POST['folder_name']); } else { $template = new HTMLTemplate("data/folder_rename_window.html"); $button_handler_template = new JSTemplate("data/js/folder_rename_window.js"); $button_handler_template->set_var("session_id", $_GET['session_id']); $button_handler_template->set_var("folder_id", $_POST['folder_id']); $button_handler = $button_handler_template->get_string(); $button_handler_caption = "Rename"; $html_caption = "Rename Folder"; $html = $template->get_string(); } break; case "permission": require_once "data.ajax.php"; if (isset($_POST['permissions'])) { $success = DataAjax::change_permission(json_decode($_POST['permissions']), "Folder"); return $success; } else { $permission = DataAjax::permission_window(); $button_handler_template = new JSTemplate("data/js/folder_permission_window.js"); $button_handler_template->set_var("session_id", $_GET['session_id']); $button_handler_template->set_var("folder_id", $_POST['folder_id']); $button_handler = $button_handler_template->get_string(); $button_handler_caption = "Change"; $html_caption = "Change permission"; $html = $permission; } break; } $array = array("content" => $html, "content_caption" => $html_caption, "handler" => $button_handler, "handler_caption" => $button_handler_caption); return json_encode($array); }
/** * @param string $id * @return string * @throws BaseRegistyIDMissingException */ public static function edit($id) { if (is_numeric($id)) { $registry = new Registry($id); $template = new HTMLTemplate("base/admin/base_registry/edit_window.html"); $template->set_var("value", $registry->get_registry_value()); $template->set_var("id", $id); $array['content_caption'] = "Edit Entry"; $array['height'] = 170; $array['width'] = 400; $array['continue_caption'] = "Save"; $array['cancel_caption'] = "Cancel"; $array['content'] = $template->get_string(); $array['container'] = "#BaseAdminRegistryEditWindow"; $continue_handler_template = new JSTemplate("base/admin/base_registry/js/edit.js"); $continue_handler_template->set_var("session_id", $_GET['session_id']); $array['continue_handler'] = $continue_handler_template->get_string(); return json_encode($array); } else { throw new BaseRegistryIDMissingException(); } }
/** * @return string */ public function get_string() { $return = ""; $template = new HTMLTemplate("base/tabs/small_tab_header.html"); $return .= $template->get_string(); if (is_array($this->tab_array) and count($this->tab_array) >= 1) { foreach ($this->tab_array as $key => $value) { if ($value['disabled']) { $template = new HTMLTemplate("base/tabs/generic_inactive.html"); $template->set_var("title", $value['name']); $return .= $template->get_string(); } else { if ($value['active'] == true) { $template = new HTMLTemplate("base/tabs/generic_active.html"); $template->set_var("title", $value['name']); $template->set_var("params", $value['target']); $return .= $template->get_string(); } else { $template = new HTMLTemplate("base/tabs/generic.html"); $template->set_var("title", $value['name']); $template->set_var("params", $value['target']); $return .= $template->get_string(); } } } } $template = new HTMLTemplate("base/tabs/small_tab_footer.html"); $return .= $template->get_string(); return $return; }
public function get_content() { $template = new HTMLTemplate("organiser/abstract_header.html"); if ($this->year == true) { $template->set_var("year", true); } else { $template->set_var("year", false); } if ($this->month == true) { $template->set_var("month", true); } else { $template->set_var("month", false); } if ($this->week == true) { $template->set_var("week", true); } else { $template->set_var("week", false); } if ($this->work_week == true) { $template->set_var("workweek", true); } else { $template->set_var("workweek", false); } if ($this->day == true) { $template->set_var("day", true); } else { $template->set_var("day", false); } if ($this->todo == true) { $template->set_var("todo", true); } else { $template->set_var("todo", false); } $paramquery = $_GET; unset($paramquery['page']); unset($paramquery['view']); $params = http_build_query($paramquery, '', '&'); $template->set_var("params", $params); $return = $template->get_string(); switch ($_GET['view']) { case "year": $return .= $this->year_view(); break; case "week": $return .= $this->week_view(); break; case "workweek": $return .= $this->work_week_view(); break; case "day": $return .= $this->day_view(); break; case "todo": $return .= $this->todo_view(); break; case "month": default: $return .= $this->month_view(); break; } return $return; }
/** * @todo remove code; merge with IO permission function (GET <-> POST) * @return string * @throws FolderIDMissingException */ public static function permission_window() { global $user; if ($_POST['file_id'] or $_POST['value_id'] or $_POST['parameter_id'] or $_POST['folder_id']) { if ($_POST['file_id']) { $id = $_POST['file_id']; $object = File::get_instance($id); $type = "file"; $title = $object->get_name(); } if ($_POST['value_id']) { $id = $_POST['value_id']; $object = Value::get_instance($id); $type = "value"; $title = $object->get_type_name(); } if ($_POST['parameter_id']) { $id = $_POST['parameter_id']; $object = Parameter::get_instance($id); $type = "parameter"; $title = $object->get_name(); } if ($_POST['folder_id']) { $id = $_POST['folder_id']; $object = Folder::get_instance($id); $type = "folder"; $title = $object->get_name(); } } else { throw new FolderIDMissingException(); } $data_permission = new DataPermission($type, $id); $template = new HTMLTemplate("data/data_permission_window.html"); $template->set_var("title", $title); $user = new User($data_permission->get_owner_id()); $group = new Group($data_permission->get_owner_group_id()); $template->set_var("owner", $user->get_full_name(false)); $template->set_var("owner_group", $group->get_name()); if ($object->can_set_automatic()) { $disable_automatic = false; } else { $disable_automatic = true; } if ($object->can_set_data_entity()) { $disable_project = false; } else { $disable_project = true; } if ($object->can_set_control()) { $disable_control = false; } else { $disable_control = true; } if ($object->can_set_remain()) { $disable_remain = false; } else { $disable_remain = true; } if ($disable_automatic == true) { $template->set_var("disabled_automatic", "disabled='disabled'"); } else { $template->set_var("disabled_automatic", ""); } if ($data_permission->get_automatic() == true) { $template->set_var("checked_automatic", "checked='checked'"); if ($disable_automatic == true) { $template->set_var("hidden_automatic", "<input type='hidden' name='automatic' value='1' />"); } else { $template->set_var("hidden_automatic", ""); } } else { $template->set_var("checked_automatic", ""); $template->set_var("hidden_automatic", ""); } $permission_array = $data_permission->get_permission_array(); for ($i = 1; $i <= 4; $i++) { for ($j = 1; $j <= 4; $j++) { $checked_name = "checked_" . $i . "_" . $j; $disabled_name = "disabled_" . $i . "_" . $j; $hidden_name = "hidden_" . $i . "_" . $j; if ($i == 3 and $disable_project == true) { $template->set_var($disabled_name, "disabled='disabled'"); $disabled = true; } else { if (($j == 3 or $j == 4) and $disable_control == true) { $template->set_var($disabled_name, "disabled='disabled'"); $disabled = true; } else { if ($disable_remain == true) { $template->set_var($disabled_name, "disabled='disabled'"); $disabled = true; } else { $template->set_var($disabled_name, ""); $disabled = false; } } } if ($permission_array[$i][$j] == true) { $template->set_var($checked_name, "checked='checked'"); if ($disabled == true) { $template->set_var($hidden_name, "<input type='hidden' name='" . $checked_name . "' value='1' />"); } else { $template->set_var($hidden_name, ""); } } else { $template->set_var($checked_name, ""); $template->set_var($hidden_name, ""); } $disabled = false; } } $paramquery = $_GET; $paramquery['nav'] = "data"; unset($paramquery['action']); $params = http_build_query($paramquery, '', '&'); return $template->get_string(); }
public function get_list() { $page = 1; $template = new HTMLTemplate("base/list/list.html"); if ($this->display_header == true) { $template->set_var("display_header", true); } else { $template->set_var("display_header", false); } $head .= "<table class='ListTable'><thead><tr>"; foreach ($this->columns as $key => $value) { if ($value[3] == true) { $paramquery = $_GET; unset($paramquery['sortvalue']); unset($paramquery['sortmethod']); $params = http_build_query($paramquery, '', '&'); if ($value[2] != null) { $head .= "<th width='" . $value[2] . "' style='width:" . $value[2] . ";' class='" . $this->css_main_id . "Column' id='" . $this->css_main_id . "Column" . $value[1] . "'>" . "<a href='#'>" . $value[0] . "</a>" . " <a href='#'>" . "<img src='images/nosort.png' alt='' border='0' />" . "</a>" . "</th>"; } else { $head .= "<th class='" . $this->css_main_id . "Column' id='" . $this->css_main_id . "Column" . $value[1] . "'>" . "<a href='#'>" . $value[0] . "</a>" . " <a href='#'>" . "<img src='images/nosort.png' alt='' border='0' />" . "</a>" . "</th>"; } } else { if ($value[0]) { if ($value[2] != null) { $head .= "<th width='" . $value[2] . "' style='width:" . $value[2] . ";'>" . $value[0] . "</th>"; } else { $head .= "<th>" . $value[0] . "</th>"; } } else { if ($value[2] != null) { $head .= "<th width='" . $value[2] . "' style='width:" . $value[2] . ";'> </th>"; } else { $head .= "<th> </th>"; } } } } $head .= "</tr></thead>"; $template->set_var("top_left_text", ""); $template->set_var("top_right_text", ""); $template->set_var("head", $head); $template->set_var("ajax_handler", $this->ajax_handler); $template->set_var("ajax_run", $this->ajax_run); $template->set_var("ajax_count_run", $this->ajax_count_run); $template->set_var("argument_array", json_encode($this->argument_array)); $template->set_var("get_array", serialize($_GET)); $template->set_Var("css_main_id", $this->css_main_id); $template->set_var("entries_per_page", $this->entries_per_page); $template->set_var("column_array", json_encode($this->columns)); $template->set_var("list_div", "<tbody id='" . $this->css_main_id . "'></tbody></table>"); if ($this->display_footer == true) { $pagebar = "<div id='" . $this->css_main_id . "ActionSelect'></div><div class='ResultNextPageBar' id='" . $this->css_main_id . "PageBar'></div>"; $template->set_var("pagebar", $pagebar); } else { $template->set_var("pagebar", ""); } return $template->get_string(); }
/** * @param string $get_array * @return string * @throws ProjectIDMissingException */ public static function cancel($get_array) { if ($get_array) { $_GET = unserialize($get_array); } if ($_GET['project_id']) { $project = new Project($_GET['project_id']); if ($project->get_current_status_id() == 0) { $template = new HTMLTemplate("project/admin/reactivate_window.html"); $array['content_caption'] = "Reactivate Project"; $array['height'] = 200; $array['width'] = 400; $process_name = "reactivating"; } else { $template = new HTMLTemplate("project/admin/cancel_window.html"); $array['content_caption'] = "Cancel Project"; $array['height'] = 430; $array['width'] = 400; $process_name = "canceling"; } $array['continue_caption'] = "Yes"; $array['cancel_caption'] = "No"; $array['content'] = $template->get_string(); $array['container'] = "#ProjectCancelWindow"; $continue_handler_template = new JSTemplate("project/admin/js/cancel_continue_handler.js"); $continue_handler_template->set_var("session_id", $_GET['session_id']); $continue_handler_template->set_var("get_array", $get_array); $array['continue_handler'] = $continue_handler_template->get_string(); return json_encode($array); } else { throw new ProjectIDMissingException(); } }
/** * @param integer $page * @return string * @throws BaseAssistantRequestedPageNotExistsException */ public static function get_content($page) { global $session, $user; switch ($page) { case "0": $template = new HTMLTemplate("project/new_project_page_0.html"); return $template->get_string(); break; case "1": $template = new HTMLTemplate("project/new_project_page_1.html"); if ($session->read_value("PROJECT_TYPE") == 1 or $session->read_value("PROJECT_TYPE") == 2) { $project_organ_unit = $session->read_value("PROJECT_ORGANISATION_UNIT"); $template->set_var("organunit", true); $result = array(); $counter = 0; $organisation_unit_array = OrganisationUnit::list_entries(); if (is_array($organisation_unit_array) and count($organisation_unit_array) >= 1) { foreach ($organisation_unit_array as $key => $value) { $organisation_unit = new OrganisationUnit($value); if ($organisation_unit->is_permission($user->get_user_id()) and $organisation_unit->get_stores_data() == true) { $result[$counter]['value'] = $value; $result[$counter]['content'] = $organisation_unit->get_name(); if ($project_organ_unit == $value) { $result[$counter]['selected'] = "selected"; } else { $result[$counter]['selected'] = ""; } $result[$counter]['disabled'] = ""; $counter++; } } } if (!$result) { $result[$counter]['value'] = "0"; $result[$counter]['content'] = "NO ORGANISATION UNIT FOUND!"; $result[$counter]['selected'] = ""; $result[$counter]['disabled'] = "disabled='disabled'"; } $template->set_var("option", $result); } else { $project_toid = $session->read_value("PROJECT_TOID"); $template->set_var("organunit", false); $result = array(); $counter = 0; $project = new Project(null); $project_array = $project->get_project_tree(); if (is_array($project_array) and count($project_array) >= 1) { foreach ($project_array as $key => $value) { $project = new Project($value['id']); for ($i = 1; $i <= $value['layer']; $i++) { $pre_content .= " "; } $result[$counter]['value'] = $value['id']; $result[$counter]['content'] = $pre_content . "" . $project->get_name(); if ($project_toid == $value['id']) { $result[$counter]['selected'] = "selected"; } else { $result[$counter]['selected'] = ""; } $result[$counter]['disabled'] = ""; $counter++; unset($pre_content); } } else { $result[$counter]['value'] = "0"; $result[$counter]['content'] = "NO PROJECT FOUND!"; $result[$counter]['selected'] = ""; $result[$counter]['disabled'] = "disabled='disabled'"; } $template->set_var("option", $result); } return $template->get_string(); break; case "2": $project_name = $session->read_value("PROJECT_NAME"); $project_desc = $session->read_value("PROJECT_DESCRIPTION"); $template = new HTMLTemplate("project/new_project_page_2.html"); if ($project_name) { $template->set_var("project_name", $project_name); } else { $template->set_var("project_name", ""); } if ($project_desc) { $template->set_var("project_description", $project_desc); } else { $template->set_var("project_description", ""); } return $template->get_string(); break; case "3": $project_template = $session->read_value("PROJECT_TEMPLATE"); $template = new HTMLTemplate("project/new_project_page_3.html"); $result = array(); $counter = 0; $project_template_array = ProjectTemplateCat::list_entries(); if (is_array($project_template_array)) { foreach ($project_template_array as $key => $value) { $project_template_cat = new ProjectTemplateCat($value); $result[$counter]['value'] = "0"; $result[$counter]['content'] = $project_template_cat->get_name(); $result[$counter]['selected'] = ""; $result[$counter]['disabled'] = "disabled='disabled'"; $counter++; $project_template_sub_array = ProjectTemplate::list_entries_by_cat_id($value); if (is_array($project_template_sub_array)) { foreach ($project_template_sub_array as $sub_key => $sub_value) { $project_sub_template = new ProjectTemplate($sub_value); if (($session->read_value("PROJECT_TYPE") == 1 or $session->read_value("PROJECT_TYPE") == 3) and $project_sub_template->get_parent_template() == false) { $result[$counter]['value'] = $sub_value; $result[$counter]['content'] = " " . $project_sub_template->get_name(); if ($project_template == $sub_value) { $result[$counter]['selected'] = "selected"; } else { $result[$counter]['selected'] = ""; } $result[$counter]['disabled'] = ""; $counter++; } elseif (($session->read_value("PROJECT_TYPE") == 2 or $session->read_value("PROJECT_TYPE") == 4) and $project_sub_template->get_parent_template() == true) { $result[$counter]['value'] = $sub_value; $result[$counter]['content'] = " " . $project_sub_template->get_name(); if ($project_template == $sub_value) { $result[$counter]['selected'] = "selected"; } else { $result[$counter]['selected'] = ""; } $result[$counter]['disabled'] = ""; $counter++; } } } unset($project_template_sub_array); } } else { $result[$counter]['value'] = "0"; $result[$counter]['content'] = "NO TEMPLATES FOUND!"; $result[$counter]['selected'] = ""; $result[$counter]['disabled'] = "disabled='disabled'"; } $template->set_var("option", $result); return $template->get_string(); break; case "4": $project_template = $session->read_value("PROJECT_TEMPLATE"); $project_template_data_type = $session->read_value("PROJECT_TEMPLATE_DATA_TYPE"); $project_template_data_array = $session->read_value("PROJECT_TEMPLATE_DATA_ARRAY"); $project_template_obj = new ProjectTemplate($project_template); $required_array = $project_template_obj->get_required_requirements(); if (is_array($required_array) and count($required_array) >= 1) { $value_type_id = 0; $sample_count = 0; $is_value = false; $is_sample = false; foreach ($required_array as $key => $value) { if ($value['xml_element'] == "item") { if ($value['type'] == "value") { $is_value = true; } } if ($value['xml_element'] == "type" and !$value['close'] and $is_value == true) { $value_type_id = $value['id']; } } if ($is_value == true) { $template = new HTMLTemplate("project/new_project_page_4_value.html"); require_once "core/modules/data/io/value_form.io.php"; $value_form_io = new ValueFormIO(null, $value_type_id, null, $project_template_data_array); $value_form_io->set_field_class("ProjectCreateAssistantField"); $template->set_var("content", $value_form_io->get_content()); $template->set_var("project_template_data_type_id", $value_type_id); return $template->get_string(); } else { $template = new HTMLTemplate("project/new_project_page_4_error.html"); return $template->get_string(); } } else { $template = new HTMLTemplate("project/new_project_page_4_error.html"); return $template->get_string(); } break; case "5": $template = new HTMLTemplate("project/new_project_page_5.html"); $project_template = new ProjectTemplate($session->read_value("PROJECT_TEMPLATE")); $template->set_var("project_name", $session->read_value("PROJECT_NAME")); $template->set_var("project_template", $project_template->get_name()); $template->set_var("project_description", $session->read_value("PROJECT_DESCRIPTION")); $template->set_var("content", ""); return $template->get_string(); break; default: throw new BaseAssistantRequestedPageNotExistsException(); break; } }
/** * @return string */ public static function start_test() { $template = new HTMLTemplate("base/batch/start_test_window.html"); $array['content_caption'] = "Start Test Batch(es)"; $array['height'] = 200; $array['width'] = 400; $array['continue_caption'] = "Start"; $array['cancel_caption'] = "Cancel"; $array['content'] = $template->get_string(); $array['container'] = "#BaseBatchTestStartWindow"; $continue_handler_template = new JSTemplate("base/batch/js/start_test.js"); $continue_handler_template->set_var("session_id", $_GET['session_id']); $array['continue_handler'] = $continue_handler_template->get_string(); return json_encode($array); }
/** * Reserved for further usage */ public static function empty_space() { $template = new HTMLTemplate("sample/home/summary/empty.html"); return $template->get_string(); }
/** * @param string $folder_id * @return string * @throws DataSecurityAccessDeniedException */ public static function add_file($folder_id) { $parent_folder = Folder::get_instance($folder_id); if ($parent_folder->is_write_access()) { $paramquery = array(); $unique_id = uniqid(); $paramquery['session_id'] = $_GET['session_id']; $paramquery['folder_id'] = $folder_id; $paramquery['unique_id'] = $unique_id; $params = http_build_query($paramquery); $template = new HTMLTemplate("data/file_upload_window.html"); $template->set_var("params", $params); $template->set_var("unique_id", $unique_id); $template->set_var("session_id", $_GET['session_id']); $button_handler_template = new JSTemplate("data/js/file_upload_window.js"); $button_handler = $button_handler_template->get_string(); $button_handler_caption = "Add"; $html_caption = "Add File"; $html = $template->get_string(); $additional_script_template = new JSTemplate("data/js/file_upload_window_additional.js"); $additional_script_template->set_var("session_id", $_GET['session_id']); $additional_script_template->set_var("unique_id", $unique_id); $additional_script = $additional_script_template->get_string(); $array = array("content" => $html, "content_caption" => $html_caption, "handler" => $button_handler, "handler_caption" => $button_handler_caption, "additional_script" => $additional_script); return json_encode($array); } else { throw new DataSecurityAccessDeniedException(); } }
/** * @param string $get_array * @param string $type_array * @return string * @throws ItemTypeRequiredException */ public static function add_as_item_window($get_array, $type_array, $folder_id) { global $regional; if ($get_array) { $_GET = unserialize($get_array); } if ($type_array) { $type_array = unserialize($type_array); } if (is_array($type_array) and count($type_array) == 1) { if (is_numeric($folder_id)) { $type_id = $type_array[0]; $template = new HTMLTemplate("data/value_add_item_window.html"); if ($_GET['parent'] and is_numeric($_GET['parent_id'])) { $array['container'] = "#ValueItemAddWindow" . $_GET['parent_key'] . "-" . $_GET['parent_id'] . "-" . $_GET['key']; } else { $array['container'] = "#ValueItemAddWindow" . $_GET['key']; } require_once "core/modules/data/io/value_form.io.php"; $value_form_io = new ValueFormIO(null, $type_id, $folder_id); $value_form_io->set_field_class("DataValueAddValues"); $template->set_var("value", $value_form_io->get_content()); $array['continue_caption'] = "Add"; $array['cancel_caption'] = "Cancel"; $array['content_caption'] = "Add Values"; $array['height'] = 350; $array['width'] = 400; $array['content'] = $template->get_string(); $continue_handler_template = new JSTemplate("data/js/value_add_item_window.js"); $continue_handler_template->set_var("session_id", $_GET['session_id']); $continue_handler_template->set_var("type_id", $type_id); $continue_handler_template->set_var("folder_id", $folder_id); $continue_handler_template->set_var("get_array", $get_array); $continue_handler_template->set_var("container_id", $array['container']); $array['continue_handler'] = $continue_handler_template->get_string(); $script_template = new JSTemplate("data/js/value_add_item_window_onclick.js"); $script_template->set_var("decimal_separator", $regional->get_decimal_separator()); $script_template->set_var("thousand_separator", $regional->get_thousand_separator()); $array['open_handler'] = $script_template->get_string(); return json_encode($array); } else { throw new FolderIDMissingException(); } } else { throw new ItemTypeRequiredException(); } }