$Title
$Content
"; } else { $r = "
$Title
$Content
"; if (is_string($NewWindow)) { list($windowtitle, $windowoptions) = explode('~', $NewWindow); $r .= " "; } if (is_bool($NewWindow) && $NewWindow === true) { $r .= " "; } $r .= "
"; } if($Link2URL != "") { $r .= " "; } if($Link3URL != "") { if($Link3Target == "") $r .= " "; else $r .= " "; } if($Link4URL != "") { if($Link4Target == "") $r .= " "; else $r .= " "; } return $r; } function MakeErrorBox($Title, $Content) { global $ROOTURL; $r = "
$Title
$Content
"; return $r; } ///////////////////////////////////////////////////////////////////// class AdminForm { var $title; var $items; var $output; var $field; var $action; var $EXTRA; var $dontCloseForm; // Constructor function AdminForm() { $this->EXTRA = ""; $this->output = ""; $this->dontCloseForm = false; } function Raw($info) { $info=str_replace('$$$BAR$$$',"|",$info); $this->field=$info; } /////////////////////////////////// function TextArea($info) { $vars = explode(':', $info); $name = $vars[0]; $cols = $vars[1]; $rows = $vars[2]; $value = (isset($vars[3])) ? $vars[3] : ''; $extra = (isset($vars[4])) ? $vars[4] : ''; $value=trim(str_replace('$$COLON$$', ":", $value)); $this->field=''; $this->field.= MakeHelp($name); } /////////////////////////////////// function WYSIWYG($info){ $vars = explode(':', $info); $name = $vars[0]; $cols = $vars[1]; $rows = $vars[2]; $value = stripslashes($vars[3]); $extra = (isset($vars[4])) ? $vars[4] : ''; $value= str_replace('$$COLON$$', ":", $value); $value = str_replace("'", "\'", $value); $value = str_replace(chr(13), '', $value); $value = str_replace(chr(10), '\\n', $value); $value = eregi_replace("", "<\\/script>", $value); global $ROOTURL, $ROOTDIR; global $CURRENTADMIN; ob_start(); if (USING_DEVEDIT) { $value = stripslashes(str_replace('\\n', '', $value)); $ROOTDIR1 = str_replace($_SERVER["DOCUMENT_ROOT"], "", $ROOTDIR) . "admin/de"; $ROOTDIR2 = str_replace($_SERVER["DOCUMENT_ROOT"], "", $ROOTDIR) . "temp/images/" . $CURRENTADMIN['AdminID']; $user_image_dir = $ROOTDIR . 'temp/images/' . $CURRENTADMIN['AdminID']; if (!is_dir($user_image_dir)) { if (!mkdir($user_image_dir, 0755)) { } } include("de/class.devedit.php"); $myDE = new devedit; $myDE->SetName("myDevEditControl"); SetDevEditPath($ROOTDIR1); $myDE->SetLanguage(DE_AMERICAN); $myDE->SetPathType(DE_PATH_TYPE_FULL); $myDE->SetDocumentType(DE_DOC_TYPE_HTML_PAGE); $myDE->HideHelpButton(); $myDE->HideSaveButton(); $myDE->SetImageDisplayType(DE_IMAGE_TYPE_THUMBNAIL); $myDE->SetFlashDisplayType(DE_FLASH_TYPE_THUMBNAIL); $myDE->SetFlashPath($ROOTDIR2); $myDE->SetValue($value); $myDE->ShowControl("730", "500", $ROOTDIR2); $editor = ob_get_contents(); ob_end_clean(); $editor .= ''; } else { include(dirname(__FILE__) . "/../editor/editor1.html"); $editor = ob_get_contents(); ob_end_clean(); $editor = str_replace('%IMAGE_PATH%', $ROOTURL . 'admin/editor/images', $editor); $editor = str_replace('%EDITOR_PATH%', $ROOTURL . 'admin/editor/', $editor); // what are these???? $editor = str_replace('%INSERT_IMAGE_FILE%', $ROOTURL . 'admin/editor/insert_image.php', $editor); $editor = str_replace('%MODIFY_IMAGE_FILE%', $ROOTURL . 'admin/editor/insert_image.php', $editor); $editor = str_replace('insert_image.php', 'insert_image.php?UserID=' . $CURRENTADMIN['AdminID'], $editor); $editor = str_replace('%URL%', 'http://www.google.com/', $editor); $editor = str_replace('%WIDTH%', '500', $editor); $editor = str_replace('%HEIGHT%', '500', $editor); $http = (isset($_SERVER['HTTPS'])) ? 'https' : 'http'; $editor = str_replace('%HTTPSTR%', $http, $editor); $editor = str_replace('%FIELD_ID%', 'wysiwyg', $editor); $editor = str_replace('%CSS_CLASS%', '', $editor); $editor = str_replace('%VALUE%', $value, $editor); } $this->field = $editor; $this->field.= MakeHelp($name); } ////////////////////////////////// function TextBox($info) { $vars = explode(':', $info); $name = $vars[0]; $max = $vars[1]; $length = $vars[2]; $value = (isset($vars[3])) ? $vars[3] : ''; $readonly = (isset($vars[4])) ? $vars[4] : ''; $extra = (isset($vars[5])) ? $vars[5] : ''; $style = (isset($vars[6])) ? $vars[6] : 'field250'; $value=str_replace('$$COLON$$', ":", $value); $this->field=''; $this->field .= $extra; $this->field .= MakeHelp($name); } ////////////////////////////////// function Password($info) { $vals = explode(':', $info); $name = $vals[0]; $max = $vals[1]; $length = $vals[2]; $value = $vals[3]; $readonly = (isset($vals[4])) ? $vals[4] : ''; $value=str_replace('$$COLON$$', ":", $value); $this->field=''; $this->field.= MakeHelp($name); } ////////////////////////////////// function FileUpload($info) { $this->field=''; $this->field.= MakeHelp($info); } ////////////////////////////////// function CheckBoxes($info) { $this->field=''; $vals = explode(':', $info); $name = $vals[0]; $options = $vals[1]; $checkedfields = array(); if (isset($vals[2])) { $checkedfields = $vals[2]; $checkedfields = explode(',', $checkedfields); } $opts = explode(';', $options); $count = 0; foreach($opts as $option) { if (!$option) continue; $count++; list($value,$label) = explode('->', $option); $checked = (in_array($value, $checkedfields)) ? " CHECKED " : ""; $this->field .= '' . $label; if ($count % 4 == 0) $this->field .= '
'; } $this->field.= MakeHelp($name); } ////////////////////////////////// function CheckBox($info) { $this->field=''; $vars = explode(":",$info); $name = $vars[0]; $value = $vars[1]; $label = $vars[2]; $status = $vars[3]; $extra = (isset($vars[4])) ? $vars[4] : ''; $this->field.=''.$label; $this->field.= MakeHelp($name); } ////////////////////////////////// function SelectBox($info) { $vars = explode(':', $info); $name = $vars[0]; $size = $vars[1]; $list = $vars[2]; $selected = (isset($vars[3])) ? $vars[3] : ''; $extra = (isset($vars[4])) ? $vars[4] : ''; $moreExtra = (isset($vars[5])) ? $vars[5] : ''; if (strpos($selected, '~') !== false) { $selected = explode('~', $selected); } $this->field='' . $moreExtra; $this->field.= MakeHelp($name); } ////////////////////////////////// function RadioButtons($info) { $vars = explode(':', $info); $name = $vars[0]; $default = $vars[1]; $options = $vars[2]; $this->field = ''; $options = explode(';', $options); foreach($options as $opt) { list($id, $desc) = explode('->', $opt); $this->field .= ''; } $this->field .= '
field .= ' CHECKED'; $this->field .= '>  ' . $desc . '  '; $this->field .= MakeHelp($name.$id); $this->field .= '
'; } function DateBoxes($info) { $vars = explode(':', $info); $name = $vars[0]; $order = $vars[1]; if ($order == '' || strpos($order, ',' === false)) { $order = 'day,month,year'; } $order = explode(',', $order); if (strpos($vars[2], '/') !== false) { $split = explode('/', $vars[2]); $c = 0; foreach($order as $o) { if ($o == 'day') $dd = $split[$c]; if ($o == 'month') $mm = $split[$c]; if ($o == 'year') $yy = $split[$c]; $c++; } } else { $dd = (isset($vars[2])) ? $vars[2] : 1; $mm = (isset($vars[3])) ? $vars[3] : 1; $yy = (isset($vars[4])) ? $vars[4] : 1970; } $types = (isset($vars[5])) ? $vars[5] : 0; $default_type = (isset($vars[6])) ? $vars[6] : 'ignore'; $MonthsOfYear=array( 1=>"Jan", 2=>"Feb", 3=>"Mar", 4=>"Apr", 5=>"May", 6=>"Jun", 7=>"Jul", 8=>"Aug", 9=>"Sep", 10=>"Oct", 11=>"Nov", 12=>"Dec" ); $this->field = ''; if ($types) { $this->field .= ''; } $daylist = ''; $monthlist =''; $yearlist =''; foreach($order as $o) { switch($o) { case 'day': $this->field .= str_replace('_whichone', '_start', $daylist); break; case 'month': $this->field .= str_replace('_whichone', '_start', $monthlist); break; case 'year': $this->field .= str_replace('_whichone', '_start', $yearlist); break; } } if ($types) { $this->field .= ' AND '; foreach($order as $o) { switch($o) { case 'day': $this->field .= str_replace('_whichone', '_end', $daylist); break; case 'month': $this->field .= str_replace('_whichone', '_end', $monthlist); break; case 'year': $this->field .= str_replace('_whichone', '_end', $yearlist); break; } } } $this->field.= MakeHelp($name); } ////////////////////////////////// function DateBoxSearch($info) { global $ROOTURL; $vars = explode(':', $info); $name = $vars[0]; $order = $vars[1]; if ($order == '' || (strpos($order, ',') === false)) { $order = 'day,month,year'; } $order = explode(',', $order); $default_values = (isset($vars[2])) ? $vars[2] : ''; if (strpos($default_values, ',') === false) { $dd_start = $mm_start = $dd_end = $mm_end = 1; $yy_start = $yy_end = date('Y'); $default_type = 'ignore'; $enable = ''; } else { list($dd_start,$mm_start,$yy_start,$dd_end,$mm_end,$yy_end,$default_type,$enable) = explode(',', $default_values); } $MonthsOfYear=array( 1=>"Jan", 2=>"Feb", 3=>"Mar", 4=>"Apr", 5=>"May", 6=>"Jun", 7=>"Jul", 8=>"Aug", 9=>"Sep", 10=>"Oct", 11=>"Nov", 12=>"Dec" ); $display = ($enable == 'on') ? '' : 'none'; $this->field = '
Yes, filter by date ' . MakeHelp($name) . '
   '; $this->field .= '
'; $daylist = ''; $monthlist =''; $yearlist =''; foreach($order as $o) { switch($o) { case 'day': $this->field .= str_replace('_whichone', '_start', $daylist); break; case 'month': $this->field .= str_replace('_whichone', '_start', $monthlist); break; case 'year': $this->field .= str_replace('_whichone', '_start', $yearlist); break; } } $daylist = ''; $monthlist =''; $yearlist =''; $display_two = ($enable == 'on' && $default_type == 'between') ? '' : 'none'; $this->field .= '
 AND '; foreach($order as $o) { switch($o) { case 'day': $this->field .= str_replace('_whichone', '_end', $daylist); break; case 'month': $this->field .= str_replace('_whichone', '_end', $monthlist); break; case 'year': $this->field .= str_replace('_whichone', '_end', $yearlist); break; } } $this->field.= "
"; } ////////////////////////////////// function DateTimeBoxes($info) { list($name, $time) = explode(':', $info); $dateinfo = getdate($time); $MonthsOfYear=array( 1=>"Jan", 2=>"Feb", 3=>"Mar", 4=>"Apr", 5=>"May", 6=>"Jun", 7=>"Jul", 8=>"Aug", 9=>"Sep", 10=>"Oct", 11=>"Nov", 12=>"Dec" ); $DaysOfMonth=array( 1=>"1st", 2=>"2nd", 3=>"3rd", 4=>"4th", 5=>"5th", 6=>"6th", 7=>"7th", 8=>"8th", 9=>"9th", 10=>"10th", 11=>"11th", 12=>"12th", 13=>"13th", 14=>"14th", 15=>"15th", 16=>"16th", 17=>"17th", 18=>"18th", 19=>"19th", 20=>"20th", 21=>"21st", 22=>"22nd", 23=>"23rd", 24=>"24th", 25=>"25th", 26=>"26th", 27=>"27th", 28=>"28th", 29=>"29th", 30=>"30th", 31=>"31st" ); $this->field=''; $this->field.=''; $this->field .= '  Date:'; $this->field.=''; $this->field.=''; $this->field.= MakeHelp($name); } ////////////////////////////////// function SubmitButton($info) { $vars = explode(':', $info); $label = $vars[0]; $extra = (isset($vars[1])) ? $vars[1] : ''; $cancelData = (isset($vars[2])) ? $vars[2] : ''; $extra=str_replace('$$COLON$$',":",$extra); $this->field = ''; // Should we output a cancel button? if($extra != "") { $arrCancel = explode("-", $extra); $cancelMsg = (isset($arrCancel[2])) ? $arrCancel[2] : 'Are you sure you wish to cancel?'; if(is_array($arrCancel) && sizeof($arrCancel) > 1) { $this->field .= '  '; } } $this->field .= ''; $this->field .= '
 '; } ////////////////////////////////// function Button($info) { $label = $extra = ""; list($label,$extra)=explode(":",$info); $extra=str_replace('$$COLON$$',":",$extra); $this->field='
 '; } ////////////////////////////////// function Hidden($info) { list($name,$value)=explode(":",$info); $this->field=''; } ////////////////////////////////// function Spacer($info) { $this->field=''.$info.''; } ////////////////////////////////// function Number($info) { $vars = explode(':', $info); $name = $vars[0]; $max = $vars[1]; $length = $vars[2]; $value = (isset($vars[3])) ? $vars[3] : ''; $readonly = (isset($vars[4])) ? $vars[4] : ''; $extra = (isset($vars[5])) ? $vars[5] : ''; $value=str_replace('$$COLON$$', ":", $value); if($readonly) $this->field=''; else $this->field=''; $this->field .= $extra; $this->field .= MakeHelp($name); } ////////////////////////////////// function MakeForm($BlockHeading = "") { GLOBAL $items, $FORM_REQUIRED_ITEM, $FORM_NOT_REQUIRED_ITEM; $need_attachment_header = false; $form_heading = ''; if($BlockHeading != "") { $form_heading .= ''; $form_heading .= ''; $form_heading .= ''; } $add_end = true; $whole_form_output = $submit_button = ''; foreach($this->items as $name=>$info) { if ($name<0 || $name=="0") { $name=""; } else { if ($name != $FORM_NOT_REQUIRED_ITEM.' ') $name.=": "; } // we have to limit it, in case (in javascript) there is a || for " or " or something else in the text... list($InputType, $Fields) = explode('|', $info, 2); if ($add_end) { if ($InputType != 'hidden') { $whole_form_output.=''; } } } $form_header = ''; if(!is_numeric(strpos($this->action, "DEADLINK"))) { $form_header = 'EXTRA.' name="'.$this->title.'" action="'.$this->action.'" method="post"'; if ($need_attachment_header) $form_header .= ' enctype="multipart/form-data"'; $form_header .= '>'; } $form_output = $form_header . $submit_button . $form_heading . $whole_form_output; $form_output .= "
'; $form_heading .= '  ' . $BlockHeading; $form_heading .= '
'.$name.''; } } else { $whole_form_output .= "  "; $add_end = true; } if (strpos($Fields, '$$$BAR$$$') !== false) { $Fields = str_replace('$$$BAR$$$', '', $Fields); $add_end = false; } switch($InputType) { case 'raw': $this->Raw($Fields); break; case 'textarea': $this->TextArea($Fields); break; case 'wysiwyg': $this->WYSIWYG($Fields); break; case 'textfield': $this->TextBox($Fields); break; case 'password': $this->Password($Fields); break; case 'checkboxes': $this->CheckBoxes($Fields); break; case 'checkbox': $this->CheckBox($Fields); break; case 'select': $this->SelectBox($Fields); break; case 'radio': $this->RadioButtons($Fields); break; case 'hidden': $this->Hidden($Fields); break; case 'spacer': $this->Spacer($Fields); break; case 'submit': $this->SubmitButton($Fields); $display = true; if (strpos($Fields, '|') !== false) { list($Fields, $extra) = explode('|', $Fields); if ($extra == 'once') $display = false; } $vars = explode(':', $Fields); $label = $vars[0]; $submit_button = ''; if ($label != 'Proceed' && $display) { $submit_button = $this->field; } if ($submit_button != '' || $label == 'Proceed' || !$display) { $this->field = '
' . $this->field; } break; case 'button': $this->Button($Fields); break; case 'dateboxes': case 'datebox': $this->DateBoxes($Fields); break; case 'dateboxsearch': $this->DateBoxSearch($Fields); break; case 'datetimeboxes': $this->DateTimeBoxes($Fields); break; case 'file': $file_uploads = ini_get('file_uploads'); if (strtolower($file_uploads) == 'off') $file_uploads = false; if (!$file_uploads) break; if ($file_uploads) $need_attachment_header = true; $this->FileUpload($Fields); break; case 'number': $this->Number($Fields); break; } $whole_form_output.=$this->field; if ($add_end) { if ($InputType != 'hidden') { $whole_form_output.='
"; if(!is_numeric(strpos($this->action, "DEADLINK")) && $this->dontCloseForm != true) $form_output .= ""; $this->output = $form_output; } } function MakeHelp($ControlName) { global $HELP_ITEMS; global $ROOTURL; $output = ""; $r = rand(1, 10000); if(isset($HELP_ITEMS[$ControlName]) && $HELP_ITEMS[$ControlName]['Title'] != '') { $title = $HELP_ITEMS[$ControlName]['Title']; $content = $HELP_ITEMS[$ControlName]['Content']; $output = ''; } return $output; } ///////////////////////////////////////////////////////////////////// function MakeBox($BoxTitle,$BoxContent,$Width="100%",$Separator="
") { GLOBAL $t,$boxes; $key=rand(10,1000); $boxes[$key]=$BoxTitle; $OUT='
'.$BoxTitle.'
'.$BoxContent.'

'; return $OUT; } ///////////////////////////////////////////////////////////////////// function MakePopup($url,$width,$height,$title,$args="",$argvals="") { GLOBAL $OUTPUT; srand(mktime()); $url=MakeAdminLink($url); $PopUpName=$title.rand(); $FuncName=$title."Pop".rand(); $OUTPUT.=""; return "javascript: $FuncName($argvals)"; } ///////////////////////////////////////////////////////////////////// function MakeLink($url,$title='',$confirm=0,$raw=0, $target="") { if($raw!=1){$url=MakeAdminLink($url);} if($confirm){ GLOBAL $OUTPUT; srand((double) microtime() * 1000000); $FuncName="ConfirmLink".rand(); $OUTPUT.=""; return ''.$title.''; }else{ if($target == "") return ''.$title.''; else return ''.$title.''; } } function MakeConfirmBox($url,$title='',$msg='Are you sure?') { $url=MakeAdminLink($url); GLOBAL $OUTPUT; srand((double) microtime() * 1000000); $FuncName="ConfirmLink".rand(); $OUTPUT.=""; return ''.$title.''; } ?>