'.$feedback.''; } /** * make_user_link() - Make a username reference into a link to that users User page on SF. * * @param string The username of the user to link. */ function make_user_link($username) { if (!strcasecmp($username,'Nobody') || !strcasecmp($username,'None')) { return $username; } else { return ''.$username.'' ; } } /** * html_feedback_top() - Show the feedback output at the bottom of the page. * * @param string The feedback. */ function html_feedback_bottom($feedback) { if (!$feedback) return ''; print '

'.$feedback.'

'; } /** * html_blankimage() - Show the blank spacer image. * * @param int The height of the image * @param int The width of the image */ function html_blankimage($height,$width) { return ''; } /** * html_dbimage() - Show an image that is stored in the database * * @param int The id of the image to show */ function html_dbimage($id, $args=0) { if (!$id) { return ''; } if (!$args) { $args = array(); } $sql="SELECT width,height,version ". "FROM db_images WHERE id='$id'"; $result=db_query($sql); $rows=db_numrows($result); if (!$result || $rows < 1) { return db_error(); } else { return html_image('/dbimage.php?id='.$id.'&v='.db_result($result,0,'version'),db_result($result,0,'width'),db_result($result,0,'height'),$args); } } /** * html_image() - Build an image tag of an image contained in $src * * @param string The source location of the image * @param int The width of the image * @param int The height of the image * @param array Any IMG tag parameters associated with this image (i.e. 'border', 'alt', etc...) * @param bool DEPRECATED */ function html_image($src,$width,$height,$args,$display=1) { global $sys_images_url,$sys_images_secure_url,$HTML; $s = ((session_issecure()) ? $sys_images_secure_url : $sys_images_url ); $return = (''); return $return; } /** * html_get_language_popup() - Pop up box of supported languages * * @param object BaseLanguage object * @param string The title of the popup box * @param string Which element of the box is to be selected */ function html_get_language_popup ($Language,$title='language_id',$selected='xzxzxz') { $res=$Language->getLanguages(); return html_build_select_box ($res,$title,$selected,false); } /** * html_get_timezone_popup() - Pop up box of supported Timezones * Assumes you have included Timezones array file * * @param string The title of the popup box * @param string Which element of the box is to be selected */ function html_get_timezone_popup ($title='timezone',$selected='xzxz') { global $TZs; if ($selected == 'xzxzxzx') { $r = file ('/etc/timezone'); $selected = str_replace ("\n", '', $r[0]); } return html_build_select_box_from_arrays ($TZs,$TZs,$title,$selected,false); } /** * html_build_select_box_from_array() - Takes one array, with the first array being the "id" * or value and the array being the text you want displayed. * * @param string The name you want assigned to this form element * @param string The value of the item that should be checked */ function html_build_select_box_from_array ($vals,$select_name,$checked_val='xzxz',$samevals = 0) { $return .= ' '; return $return; } /** * html_build_select_box_from_arrays() - Takes two arrays, with the first array being the "id" or value and the other * array being the text you want displayed. * * The infamous '100 row' has to do with the SQL Table joins done throughout all this code. * There must be a related row in users, categories, et , and by default that * row is 100, so almost every pop-up box has 100 as the default * Most tables in the database should therefore have a row with an id of 100 in it so that joins are successful * * @param array The ID or value * @param array Text to be displayed * @param string Name to assign to this form element * @param string The item that should be checked * @param bool Whether or not to show the '100 row' * @param string What to call the '100 row' defaults to none */ function html_build_select_box_from_arrays ($vals,$texts,$select_name,$checked_val='xzxz',$show_100=true,$text_100='None') { $return .= ' '; return $return; } /** * html_build_select_box() - Takes a result set, with the first column being the "id" or value and * the second column being the text you want displayed. * * @param int The result set * @param string Text to be displayed * @param string The item that should be checked * @param bool Whether or not to show the '100 row' * @param string What to call the '100 row'. Defaults to none. */ function html_build_select_box ($result, $name, $checked_val="xzxz",$show_100=true,$text_100='None') { return html_build_select_box_from_arrays (util_result_column_to_array($result,0),util_result_column_to_array($result,1),$name,$checked_val,$show_100,$text_100); } /** * html_build_multiple_select_box() - Takes a result set, with the first column being the "id" or value * and the second column being the text you want displayed. * * @param int The result set * @param string Text to be displayed * @param string The item that should be checked * @param int The size of this box * @param bool Whether or not to show the '100 row' */ function html_build_multiple_select_box ($result,$name,$checked_array,$size='8',$show_100=true) { $checked_count=count($checked_array); $return .= ' '; return $return; } /** * html_build_checkbox() - Render checkbox control * * @param name - name of control * @param value - value of control * @param checked - true if control should be checked * @return html code for checkbox control */ function html_build_checkbox($name, $value, $checked) { return ''; } /** * html_get_priority_color() - Return the color value for the index that was passed in * (defined in $sys_urlroot/themes//theme.php) * * @param int Index */ function html_get_priority_color ($index) { global $bgpri; /* make sure that index is of appropriate type and range */ $index = (int)$index; if ($index<1) { $index=1; } else if ($index>9) { $index=9; } //return "prior$index"; return $bgpri[$index]; } /** * build_priority_select_box() - Wrapper for html_build_priority_select_box() * * @see html_build_priority_select_box() */ function build_priority_select_box ($name='priority', $checked_val='5', $nochange=false) { echo html_build_priority_select_box ($name, $checked_val, $nochange); } /** * html_build_priority_select_box() - Return a select box of standard priorities. * The name of this select box is optional and so is the default checked value. * * @param string Name of the select box * @param string The value to be checked * @param bool Whether to make 'No Change' selected. */ function html_build_priority_select_box ($name='priority', $checked_val='5', $nochange=false) { ?> '.$options[$i]; } } /** * site_user_header() - everything required to handle security and * add navigation for user pages like /my/ and /account/ * * @param array Must contain $user_id */ function site_header($params) { GLOBAL $HTML; /* Check to see if active user Check to see if logged in */ echo $HTML->header($params); echo html_feedback_top($GLOBALS['feedback']); } /** * site_footer() - Show the HTML site footer. * * @param array Footer params array */ function site_footer($params) { GLOBAL $HTML; $HTML->footer($params); } /** * site_project_header() - everything required to handle * security and state checks for a project web page * * @param params array() must contain $toptab and $group */ function site_project_header($params) { GLOBAL $HTML; /* Check to see if active Check to see if project rather than foundry Check to see if private (if private check if user_ismember) */ $group_id=$params['group']; //get the project object $project =& group_get_object($group_id); if (!$project || !is_object($project)) { exit_error("GROUP PROBLEM","PROBLEM CREATING GROUP OBJECT"); } else if ($project->isError()) { exit_error("Group Problem",$project->getErrorMessage()); } //group is private if (!$project->isPublic()) { //if it's a private group, you must be a member of that group session_require(array('group'=>$group_id)); } //for dead projects must be member of admin project if (!$project->isActive()) { //only SF group can view non-active, non-holding groups session_require(array('group'=>'1')); } echo $HTML->header($params); echo html_feedback_top($GLOBALS['feedback']); // echo $HTML->project_tabs($params['toptab'],$params['group'],$params['tabtext']); } /** * site_project_footer() - currently a simple shim * that should be on every project page, rather than * a direct call to site_footer() or theme_footer() * * @param params array() empty */ function site_project_footer($params) { GLOBAL $HTML; echo html_feedback_bottom($GLOBALS['feedback']); echo $HTML->footer($params); } /** * site_user_header() - everything required to handle security and * add navigation for user pages like /my/ and /account/ * * @param params array() must contain $user_id */ function site_user_header($params) { GLOBAL $HTML,$Language; /* Check to see if active user Check to see if logged in */ echo $HTML->header($params); echo html_feedback_top($GLOBALS['feedback']); echo ($HTML->BeginSubMenu()); echo ($HTML->PrintSubMenu( array($Language->getText('menu','my_personal_page'), $Language->getText('menu','diary_notes'), $Language->getText('menu','account_maintenance')), array('/my/','/my/diary.php','/account/'))); plugin_hook ("usermenu", false) ; echo ($HTML->EndSubMenu()); } /** * site_user_footer() - currently a simple shim that should be on every user page, * rather than a direct call to site_footer() or theme_footer() * * @param params array() empty */ function site_user_footer($params) { GLOBAL $HTML; echo html_feedback_bottom($GLOBALS['feedback']); echo $HTML->footer($params); } /** * html_clean_hash_string() - Remove noise characters from hex hash string * * Thruout SourceForge, URLs with hexadecimal hash string parameters * are being sent via email to request confirmation of user actions. * It was found that some mail clients distort this hash, so we take * special steps to encode it in the way which help to preserve its * recognition. This routine * * @param hashstr required hash parameter as received from browser * @return pure hex string */ function html_clean_hash_string($hashstr) { if (substr($hashstr,0,1)=="_") { $hashstr = substr($hashstr, 1); } if (substr($hashstr, strlen($hashstr)-1, 1)==">") { $hashstr = substr($hashstr, 0, strlen($hashstr)-1); } return $hashstr; } ?>