Admin Template functions library | > Script written by Matt Mecham | > Date started: 19th November 2003 | | > DBA Checked: Tue 25th May 2004 +-------------------------------------------------------------------------- */ class admin_template_functions { var $menu_fontchange = ""; var $menu_sizechange = ""; var $menu_backchange = ""; var $menu_fontcolor = ""; var $menu_widthchange = ""; var $menu_highchange = ""; var $default_css = ""; //----------------------------------------- // Constructor //----------------------------------------- function admin_template_functions() { $this->default_css = "font-family:Verdana;font-size:11pt;color:black;background-color:white;border:3px outset #555"; } //----------------------------------------- // Build generic editor //----------------------------------------- function build_generic_editor_area( $data ) { global $ibforums, $std, $DB; $return = ""; $return .= $this->html_build_editor_top(); $return .= "
   {$data['title']}
"; $return .= "
".$ibforums->adskin->form_textarea("txt{$data['textareaname']}", $data['textareainput'], $ibforums->vars['tx'], $ibforums->vars['ty'], 'none', "txt{$data['textareaname']}", $this->default_css )."
\n"; $return .= $this->html_build_editor_bottom(); return $return; } //----------------------------------------- // Build editor text area table //----------------------------------------- function build_editor_area( $html, $template=array(), $img="" ) { global $ibforums, $std, $DB; $return = ""; $template['func_data'] = str_replace( "'", ''', $template['func_data'] ); $spiffy_diffy = ""; $return .= "
   {$img}{$template['easy_name']} input['expand']}\")'>  
$spiffy_diffy
"; $return .= "
".$ibforums->adskin->form_textarea("txt{$template['suid']}", $html, $ibforums->vars['tx'], $ibforums->vars['ty'], 'none', "t{$template['suid']}", $this->default_css )."
\n"; $return .= "
"; return $return; } //----------------------------------------- // Build JS for floated window //----------------------------------------- function build_editor_area_floated($no_buttons=0) { global $ibforums, $std, $DB; $return = "
"; $return .= $this->html_build_editor_top(); $return .= "
"; if ( $no_buttons == 0 ) { $return .= " input['expand']}\")'> "; } $return .= "
"; $return .= "
".$ibforums->adskin->form_textarea("templatebit", $html, $ibforums->vars['tx'], $ibforums->vars['ty'], 'none', "templatebit", $this->default_css )."
\n"; $return .= "
"; $return .= " "; $return .= $this->html_build_editor_bottom(); $return .= "
"; $ibforums->html = $return; $ibforums->admin->print_popup(); } //----------------------------------------- // Build editor preferences menus //----------------------------------------- function build_editor_pref_menus() { global $ibforums, $std, $DB; $this->menu_fontchange = ""; $this->menu_sizechange = ""; $this->menu_backchange = ""; $this->menu_fontcolor = ""; $this->menu_widthchange = ""; $this->menu_highchange = ""; if ( $cookie = $std->my_getcookie( 'acpeditorprefs' ) ) { list( $font, $size, $bg, $fc, $width, $height ) = explode( "," ,$cookie ); $this->default_css = "font-family:$font;font-size:$size;color:$fc;background-color:$bg;width:$width;height:$height;border:3px outset #555"; $this->menu_fontchange = preg_replace( "/(option value='".preg_quote($font)."')/" , "\\1 selected='selected'", $this->menu_fontchange ); $this->menu_sizechange = preg_replace( "/(option value='".preg_quote($size)."')/" , "\\1 selected='selected'", $this->menu_sizechange ); $this->menu_backchange = preg_replace( "/(option value='".preg_quote($bg)."')/" , "\\1 selected='selected'", $this->menu_backchange ); $this->menu_fontcolor = preg_replace( "/(option value='".preg_quote($fc)."')/" , "\\1 selected='selected'", $this->menu_fontcolor ); $this->menu_widthchange = preg_replace( "/(option value='".preg_quote($width)."')/" , "\\1 selected='selected'", $this->menu_widthchange ); $this->menu_highchange = preg_replace( "/(option value='".preg_quote($height)."')/" , "\\1 selected='selected'", $this->menu_highchange ); } } function html_build_editor_top() { global $ibforums; $this->build_editor_pref_menus(); return "
Editor Preferences
"; } function html_build_editor_bottom() { return "
\n
"; } } ?>