{caption}'; var $caption_footer = ''; var $auto_adjust_size = 0; var $adjust = ''; var $show_tabs = 1; Function ColorChangeIntensity($color,$intensity_offset) { if(preg_match('/^#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})$/', $color, $components) != 7) return($color); if(($red = intval(HexDec($components[1]) * (100 + $intensity_offset) / 100)) > 255) $red = 255; if(($green = intval(HexDec($components[2]) * (100 + $intensity_offset) / 100)) > 255) $green = 255; if(($blue = intval(HexDec($components[3]) * (100 + $intensity_offset) / 100)) > 255) $blue = 255; return(sprintf('#%02X%02X%02X', $red, $green, $blue)); } Function SetStyles() { $border=' border-width: '.strval($this->border_width).'px ;'; $page_border=' border-width: '.strval($this->page_border_width).'px ;'; $border_color=(strlen($this->border_color) ? $this->border_color : (strlen($this->foreground_color) ? $this->foreground_color : (strlen($this->background_color) ? $this->background_color : ''))); $lighter=(strlen($this->lighter_border_color) ? $this->lighter_border_color : (strlen($border_color) ? $this->ColorChangeIntensity($border_color, $this->color_offset) : '')); $darker=(strlen($this->darker_border_color) ? $this->darker_border_color : (strlen($border_color) ? $this->ColorChangeIntensity($border_color, -$this->color_offset) : '')); $nowrap=' white-space: nowrap ;'; switch($this->side) { case 'bottom': $page_style=' border-bottom-style: solid; border-bottom-color: '.$darker.'; border-top-style: none; border-left-style: solid; border-left-color: '.$lighter.'; border-right-style: solid; border-right-color: '.$darker.'; border-bottom-left-radius: {BORDERRADIUS} ; border-bottom-right-radius: {BORDERRADIUS} ; -moz-border-radius-bottomright: {BORDERRADIUS} ; -moz-border-radius-bottomleft: {BORDERRADIUS} ; -webkit-border-bottom-right-radius: {BORDERRADIUS} ; -webkit-border-bottom-left-radius: {BORDERRADIUS}'; $tab_style=' border-style: solid; border-bottom-color: '.$darker.'; border-top-color: '.$darker.'; border-left-color: '.$lighter.'; border-right-color: '.$darker.'; border-bottom-left-radius: {BORDERRADIUS} ; border-bottom-right-radius: {BORDERRADIUS} ; -moz-border-radius-bottomright: {BORDERRADIUS} ; -moz-border-radius-bottomleft: {BORDERRADIUS} ; -webkit-border-bottom-right-radius: {BORDERRADIUS} ; -webkit-border-bottom-left-radius: {BORDERRADIUS}'; $gap_style=' padding: 0px ; border-bottom-style: none; border-top-style: solid; border-top-color: '.$darker.'; border-left-style: none; border-right-style: none'; break; case 'top': default: $page_style=' border-top-style: solid; border-top-color: '.$lighter.'; border-bottom-style: none; border-left-style: solid; border-left-color: '.$lighter.'; border-right-style: solid; border-right-color: '.$darker.'; border-top-left-radius: {BORDERRADIUS} ; border-top-right-radius: {BORDERRADIUS} ; -moz-border-radius-topright: {BORDERRADIUS} ; -moz-border-radius-topleft: {BORDERRADIUS} ; -webkit-border-top-right-radius: {BORDERRADIUS} ; -webkit-border-top-left-radius: {BORDERRADIUS}'; $tab_style=' border-style: solid; border-top-color: '.$lighter.'; border-bottom-color: '.$lighter.'; border-left-color: '.$lighter.'; border-right-color: '.$darker.'; border-top-left-radius: {BORDERRADIUS} ; border-top-right-radius: {BORDERRADIUS} ; -moz-border-radius-topright: {BORDERRADIUS} ; -moz-border-radius-topleft: {BORDERRADIUS} ; -webkit-border-top-right-radius: {BORDERRADIUS} ; -webkit-border-top-left-radius: {BORDERRADIUS}'; $gap_style=' padding: 0px ; border-top-style: none; border-bottom-style: solid; border-bottom-color: '.$lighter.'; border-left-style: none; border-right-style: none'; break; } $this->styles=array( 'page'=>$page_border.$nowrap.str_replace('{BORDERRADIUS}',$this->border_radius.'px',$page_style), 'tab'=>$border.$nowrap.str_replace('{BORDERRADIUS}',$this->border_radius.'px',$tab_style), 'gap'=>$border.$nowrap.$gap_style, 'page_button'=>'border-width: 0px; font-weight: bold; background-color: inherit', 'tab_button'=>'border-width: 0px; background-color: inherit' ); } Function AddInput(&$form, $arguments) { if(!IsSet($arguments['Pages']) || GetType($arguments['Pages']) != 'array' || count(($arguments['Pages']))==0) return('it was not specified a valid list of pages to layout'); if(IsSet($arguments['AutoAdjustSize']) && $arguments['AutoAdjustSize']) $this->auto_adjust_size = 1; if(IsSet($arguments['ShowTabs']) && !$arguments['ShowTabs']) $this->show_tabs = 0; $this->pages = $arguments['Pages']; if(IsSet($arguments['CurrentPage'])) { $this->current_page = $arguments['CurrentPage']; if(!IsSet($this->pages[$this->current_page])) return($this->current_page.' is not a valid current page'); } else { Reset($this->pages); $this->current_page = Key($this->pages); } $this->tab = $this->GenerateInputID($form, $this->input, 'tab'); $this->button = $this->GenerateInputID($form, $this->input, 'button'); $this->page = $this->GenerateInputID($form, $this->input, 'page'); $this->switch = $this->GenerateInputID($form, $this->input, 'switch'); if($this->auto_adjust_size) $this->adjust = $this->GenerateInputID($form, $this->input, 'adjust'); $this->class = $this->GenerateInputID($form, $this->input, 'class'); if(strlen($error = $form->AddInput(array( 'TYPE'=>'hidden', 'ID'=>$this->page, 'NAME'=>$this->page, 'VALUE'=>$this->current_page, 'Accessible'=>1 )))) return($error); if(IsSet($arguments['PageClass'])) $this->page_class = $arguments['PageClass']; if(IsSet($arguments['TabClass'])) $this->tab_class = $arguments['TabClass']; if(IsSet($arguments['GapClass'])) $this->gap_class = $arguments['GapClass']; if(IsSet($arguments['PageButtonClass'])) $this->page_button_class = $arguments['PageButtonClass']; if(IsSet($arguments['TabButtonClass'])) $this->tab_button_class = $arguments['TabButtonClass']; $this->SetStyles(); $t = count($this->pages); for(Reset($this->pages), $p = 0; $p < $t; Next($this->pages), ++$p) { $page = Key($this->pages); if(strlen($page) == 0) return('it was specified a page with an empty name'); if(IsSet($this->pages[$page]['Caption']) && strlen($this->pages[$page]['Caption']) == 0) return('it was not specified a valid caption for page '.$page); if(IsSet($this->pages[$page]['Break'])) { switch($this->pages[$page]['Break']) { case 'before': case 'after': break; default: return('it was not specified a valid break mode for page '.$page); } } if(strlen($error = $form->AddInput(array( 'TYPE'=>'submit', 'ID'=>$this->button.$page, 'NAME'=>$this->button.$page, 'VALUE'=>(IsSet($this->pages[$page]['Name']) ? $this->pages[$page]['Name'] : $page), 'SubForm'=>(IsSet($this->pages[$page]['SubForm']) ? $this->pages[$page]['SubForm'] : $this->button.'_sub_form'), 'IgnoreAnonymousSubmitCheck'=>1, 'DisableResubmitCheck'=>1, 'ONMOUSEUP'=>'this.clicked = true', 'ONKEYDOWN'=>'this.clicked = (event.keyCode == 13)', 'ONCLICK'=>'if(!this.clicked) return false; this.clicked = false; '.$this->switch.'(this.form, '.$form->EncodeJavascriptString($page).'); return false;', 'Accessible'=>1 )))) return($error); } if(IsSet($arguments['FadePagesTime'])) { $time_type = GetType($this->fade_pages_time = $arguments['FadePagesTime']); if((strcmp($time_type,'double') && strcmp($time_type,'integer')) || $this->fade_pages_time < 0) return('it was not specified a valid fade pages time'); } if($this->fade_pages_time > 0 && strlen($error = $form->AddInput(array( 'TYPE'=>'custom', 'ID'=>$this->page.'animation', 'CustomClass'=>'form_animation_class', 'JavascriptPath'=>(IsSet($arguments['JavascriptPath']) ? $arguments['JavascriptPath'] : '') )))) return($error); return($form->ConnectFormToInput($this->input, 'ONERROR', 'SwitchPage', array('InputsPage'=>'Invalid'))); } Function AddInputPart(&$form) { $page_class = (strlen($this->page_class) ? $this->page_class : $this->class.'page'); $tab_class = (strlen($this->tab_class) ? $this->tab_class : $this->class.'tab'); $gap_class = (strlen($this->gap_class) ? $this->gap_class : $this->class.'gap'); $page_button_class = (strlen($this->page_button_class) ? $this->page_button_class : $this->class.'page_button'); $tab_button_class = (strlen($this->tab_button_class) ? $this->tab_button_class : $this->class.'tab_button'); $row_start = '