'tc', 2 => 'sc', 3 => 'special', 4 => 'tc', 5 => NULL, 6 => 'marketing', ); // Committee images are specific to this script $workgroup_image_list = array( 'join-tc' => 'join_tc.gif', 'tc-page' => 'committee_button.gif', 'join-sc' => 'join_sc.gif', 'sc-page' => 'subcommittee_button.gif', 'join-group' => 'join-group.png', 'members-page' => 'members-page.png', ); /* BEGIN KAVI INIT CODE */ require_once getenv("PHP_DOTORG_INIT"); require_once $dotorg->php_lib . "/common/format_utils.inc"; require_once $dotorg->php_lib . "/base/workgroup/common/dbclasses/o_document_state.inc"; require_once $dotorg->php_lib . "/base/workgroup/common/dbclasses/o_folder.inc"; require_once $dotorg->php_lib . "/base/workgroup/common/dbclasses/o_workgroup.inc"; require_once $dotorg->php_lib . "/base/common/dbclasses/o_person.inc"; // Instantiate Kavi objects $workgroup = new oWorkGroup(); $workgroup_tbl = new oWorkGroupTable(); $person = new oPerson(); $person_tbl = new oPersonTable(); $_CLEAN['GET'] = clean($_GET); if (!isset($_CLEAN['GET']['wg_abbrev'])) { // Exit all further processing if we have no workgroup abbreviation // Send to committees page header($_SERVER["SERVER_PROTOCOL"] ." 302 Not Found"); header("Location: //www.oasis-open.org/committees"); exit(); } $wg_abbrev = $_CLEAN['GET']['wg_abbrev']; $result = $workgroup_tbl->retrieveObject("abbreviation='$wg_abbrev'", $workgroup); if (!$result || !$workgroup->isVisible($public_visibility)) { // Exit all further processing if we have an invalid workgroup abbreviation header($_SERVER["SERVER_PROTOCOL"] ." 404 Not Found"); header("Location: //www.oasis-open.org/page-not-found"); exit(); } /* END KAVI INIT CODE */ // If we haven't exited by now, we have a presumably valid workgroup objects // set a boolean switch that we can use throughout our logic $workgroup_is_active = ($workgroup->getValue('active') == 'true')? true : false; $workgroup_type_id = $workgroup->getValue('workgroup_type_id'); // Let's try to build our workgroup $workgroup_array = array( 'abbreviation' => $wg_abbrev, 'id' => $workgroup->getValue('id'), 'name' => $workgroup->getValue('name'), 'type_id' => $workgroup_type_id, 'type' => $workgroup_types[$workgroup_type_id], 'is_active' => $workgroup_is_active, 'join_button' => '', 'page_button' => '', 'type_abbreviation' => '', 'capped_type' => '', 'list_archive' => '', 'comment_archive' => '', 'path' => '', ); // Committee/Subcommittee differentiation defaults to TC $workgroup_array['join_button'] = $workgroup_image_list['join-tc']; $workgroup_array['page_button'] = $workgroup_image_list['tc-page']; $workgroup_array['type_abbreviation'] = "TC"; $workgroup_array['capped_type'] = $workgroup_array['type_abbreviation']; // Committee/Subcommittee differentiation: if SC, switch images and abbreviation if ($workgroup_array['type'] == "sc") { $workgroup_array['join_button'] = $workgroup_image_list['join-sc']; $workgroup_array['page_button'] = $workgroup_image_list['sc-page']; $workgroup_array['type_abbreviation'] = "SC"; $workgroup_array['capped_type'] = $workgroup_array['type_abbreviation']; // Workgroup is a subcommittee, so get its parent $oParent = $workgroup->getParent(); $workgroup_array['parent_name'] = $oParent->getValue('name'); $workgroup_array['parent_abbreviation'] = $oParent->getValue('abbreviation'); } // Marketing groups get no abbreviation for TC/SC // While Marketing groups have parents, we don't care about those (for now) if ($workgroup_array['type'] == "marketing") { $workgroup_array['join_button'] = $workgroup_image_list['join-group']; $workgroup_array['page_button'] = $workgroup_image_list['members-page']; $workgroup_array['type_abbreviation'] = "group"; $workgroup_array['capped_type'] = ucfirst($workgroup_array['type_abbreviation']); } // Special handling for Member Sections or Steering Committees if ($workgroup_array['type'] == 'special') { if (substr($workgroup_array['abbreviation'], -3) == '-ms' || substr($workgroup_array['abbreviation'], -3) == '-sc') { $workgroup_array['type'] = 'special-ms-sc'; } } $workgroup_array['list_archive'] = $wg_abbrev; // override with values from our LEGACY lookup if (isset($legacy_list_archives[$wg_abbrev])) { $workgroup_array['list_archive'] = $legacy_list_archives[$wg_abbrev]; } $workgroup_array['comment_archive'] = "{$wg_abbrev}-comment"; // figure out the archive location value for LEGACY exceptions if (isset($legacy_comment_list [$wg_abbrev])) { $workgroup_array['comment_archive'] = $legacy_comment_list [$wg_abbrev]; } // figure out the kavi workgroup path for legacy exceptions $workgroup_array['path'] = $wg_abbrev; if (isset($legacy_workgroup_path[$wg_abbrev])) { $workgroup_array['path'] = $legacy_workgroup_path[$wg_abbrev]; } /** * Create a nav that differentiates between our various types of groups * * @param Accepts the $workgroup array * * @returns an HTML-formatted list of links */ function generate_committee_nav_links($workgroup) { $links = array(); // Display link to parent TC if workgroup is a SC if ($workgroup['type'] == 'sc') { $links['parent'] = 'Parent TC Page'; } // Display Charter only if workgroup is a TC or a non-member section/non-steering committee special if ($workgroup['type'] == 'tc' || $workgroup['type'] == 'special' || $workgroup['type'] == 'marketing') { $charter = '/committees/'. $workgroup['abbreviation'] .'/charter.php'; if (file_exists($_SERVER['DOCUMENT_ROOT'] . $charter)) { $links['charter'] = 'Charter'; } } // Display Parent TC's IPR page link if workgroup is a SC if ($workgroup['type'] == 'tc') { $links['ipr'] = 'IPR Statement'; } elseif ($workgroup['type'] == 'sc') { $links['ipr'] = 'TC IPR Statement'; } // Display FAQ only if workgroup is a TC or a non-member section/non-steering committee special if ($workgroup['type'] == 'tc' || $workgroup['type'] == 'special') { $faq = '/committees/'. $workgroup['abbreviation'] .'/faq.php'; if (file_exists($_SERVER['DOCUMENT_ROOT'] . $faq)) { $links['faq'] = 'FAQ'; } if ($workgroup['abbreviation'] === "ubl") { $links['faq'] = 'FAQ'; } } // All active workgroups get membership pages if ($workgroup['is_active']) { $links['membership'] = 'Membership'; } if ($workgroup['type_id'] == '4') { $links['obligation'] = 'Obligated Members'; } // everyone gets an archive $links['archives'] = 'Email Archives'; // Display Comments Archive link only if workgroup is a TC or TAB if ($workgroup['type'] == 'tc' || $workgroup['abbreviation'] == 'tab') { $links['comments'] = 'Comments Archive'; } // everyone gets Docs and Schedule links $links['ballots'] = 'Ballots'; $links['documents'] = 'Documents'; $links['calendar'] = 'Schedule'; if ($workgroup['type'] == 'tc' || $workgroup['type'] == 'special' || $workgroup['type'] == 'marketing') { // Display Minutes only if workgroup is a TC or a non-member section/non-steering committee special // Hiding Minutes per Mary's request // $links['minutes'] = 'Minutes'; // Display Press page only if workgroup is a TC or a non-member section/non-steering committee special $press = '/committees/'. $workgroup['abbreviation'] . '/press.php'; if (file_exists($_SERVER['DOCUMENT_ROOT'] . $press)) { $links['press'] = 'Press'; } } // now output our links wrapped in presentation layer HTML and CSS $related_links_list = ""; foreach ($links as $k => $v) { $related_links_list .= <<
HTML; } return $related_links_list; } /** * Looks for a logo file and generates the appropriate HTML for display * * @param Accepts the $workgroup array and the base includes directory path * * @returns an HTML-formatted image */ function generate_logo($workgroup, $file_path) { $logo = NULL; $found_file = FALSE; $workgroup_abbreviation = $workgroup['abbreviation']; if ($workgroup['type'] == 'sc') { $workgroup_abbreviation = $workgroup['parent_abbreviation']; } $relative_path = "/committees/$workgroup_abbreviation/"; // If group has a logo, or is a subcommittee and parent has a logo, // generate the logo HTML $logo_image_dir = $file_path . $relative_path; $logo_pattern = '/^logo\.(png|jpe?g|gif)$/'; // open directory // look for file named logo.png|jpe?g|gif if ($handle = @opendir($logo_image_dir)) { while (false !== ($file = readdir($handle))) { if (preg_match($logo_pattern, $file, $matches)) { $logo_file = "logo.". $matches[1]; $found_file = TRUE; break; } } closedir($handle); } // CDN support; if the file is not available locally, try in the CDN if (!$found_file) { $host = $_SERVER['HTTP_HOST']; if (isset($_SERVER['HTTP_X_FORWARDED_HOST']) && !empty($_SERVER['HTTP_X_FORWARDED_HOST'])) { $host = $_SERVER['HTTP_X_FORWARDED_HOST']; } // We support limited types $logo_extension_pattern = array( "png", "jpeg", "jpg", "gif", ); foreach ($logo_extension_pattern as $extension) { $logo_file = "logo.". $extension; if (cdn_url_exists("https://". $host . $relative_path . $logo_file)) { $found_file = TRUE; break; } } } if ($found_file) { $logo = '