/*************************************************************************** _editor.php ------------ product : HTMLeditbox version : 2.3 released : Thu Jun 15 2004 copyright : Copyright © 2001-2004 Labs4.com email : support@labs4.com website : http://www.labs4.com ***************************************************************************/ error_reporting (0); $settings = Array(); $settings['app_dir'] = "_i3"; // application files directory (no trailing slash) global $HTTP_GET_VARS,$HTTP_POST_VARS,$HTTP_SERVER_VARS,$PHP_SELF; if(isset($he_depth)) { $settings[editor_depth] = $he_depth; } else { $settings[editor_depth] = ""; } @include($settings[editor_depth].$settings[app_dir]."/inc/config.php"); @include($settings[editor_depth].$settings[app_dir]."/lang/lang_".$settings['language'].".php"); if(($settings['security'] == "1") && (!isset($he_variable))) { include($settings[editor_depth].$settings[app_dir].'/inc/security.php'); } $safemode = ini_get("safe_mode"); if($safemode == 1) { $safemode = "ON"; } elseif($safemode == 0) { $safemode = "OFF"; } // get protocol type - thanks to Robert Gruber (www.giskaard.com) $protocol = $HTTP_SERVER_VARS["HTTPS"] ? "https" : "http"; // get absolute path for replacing in relative links (IIS friendly) $full_path = $protocol.'://'.$HTTP_HOST.$PHP_SELF; if(!empty($HTTP_SERVER_VARS['QUERY_STRING'])) { $full_path .= '?'.$HTTP_SERVER_VARS['QUERY_STRING']; } $path_chunks = parse_url($full_path); $work_path = $path_chunks['scheme']."://".$path_chunks['host'].$path_chunks['path']; $abs_path = substr($work_path,0,strrpos($work_path,"/")); // editor size and settings for embedding $editor_width = "100%"; $editor_height = "100%"; $on_blur = ""; // get options from initial tag if(isset($HTTP_GET_VARS["options"])) { $optpack = $HTTP_GET_VARS["options"]; } // new in v.2.3 - multiple input methods // this weird workaround is here to enable $formname, $inputname, $id and other // variables in embedded forms, otherwise they get stolen by editor and generate // errors if(!isset($he_variable)) { // original form/textarea method if((isset($HTTP_GET_VARS["formname"])) && (isset($HTTP_GET_VARS["inputname"]))) { $formname = $HTTP_GET_VARS["formname"]; $inputname = $HTTP_GET_VARS["inputname"]; $input_method = 1; $title_entry = $inputname; // new DOM GetElementById method } elseif(isset($HTTP_GET_VARS["id"])) { $id = $HTTP_GET_VARS["id"]; $input_method = 2; $title_entry = $id; // direct database access method from link (GET) } elseif((isset($HTTP_GET_VARS["dbname"])) && (isset($HTTP_GET_VARS["dbtable"])) && (isset($HTTP_GET_VARS["dbfield"]))) { $input_method = 3; include($settings[app_dir].'/inc/db_bridge.php'); $title_entry = $dbfield; // direct database access method from form (POST) } elseif((isset($HTTP_POST_VARS["dbname"])) && (isset($HTTP_POST_VARS["dbtable"])) && (isset($HTTP_POST_VARS["dbfield"]))) { $input_method = 4; include($settings[app_dir].'/inc/db_bridge.php'); $title_entry = $HTTP_POST_VARS["dbfield"]; // static file editing } elseif(isset($HTTP_GET_VARS["filename"])) { $input_method = 5; include($settings['app_dir'].'/inc/file_bridge.php'); $title_entry = $HTTP_GET_VARS["filename"]; } // form embedded editor } else { $input_method = 6; $editor_width = $he_width; $editor_height = $he_height; $dynamic_textarea = "".$he_data.""; $optpack = $he_options; $on_blur = "onBlur=\"copyEmbedded();\""; if(isset($he_iconset)) { $settings[toolbar_img_dir] = $he_iconset; } } // on the fly settings - new from v 1 build 9 - see docs if($optpack == "") { // keep settings from config file } else { // use settings provided in init link // order of settings // 1. Local image selector 0 - 0ff / 1 - On // 2. Table functions 0 - Off / 1 - On // 3. File Functions 0 - Off / 1 - On // 4. Color Picker 0 - Off / 1 - On // 5. Font Settings 0 - Off / 1 - On // 6. Relative Paths 0 - Off / 1 - On // 7. Cascade Style Sheet - with path $optionsArray = split(',' , $optpack); $nn = 1; foreach($optionsArray as $value) { $option[$nn] = $value; $nn++; } } if(isset($HTTP_GET_VARS["op"])) { $op = $HTTP_GET_VARS["op"]; } elseif(isset($HTTP_POST_VARS["op"])) { $op = $HTTP_POST_VARS["op"]; } else { $op = ""; } switch($op) { ############################################################################## # default editor case # ############################################################################## default: if($input_method != 6) { echo << $settings[product_name] $settings[version] (language: $lang[language]) - $lang[editing_content] "$title_entry" $lang[field] content; } else { echo $dynamic_textarea; } include($settings[editor_depth].$settings['app_dir']."/js/core_js.php"); echo << content; include($settings[editor_depth].$settings['app_dir']."/inc/toolbar.php"); echo << content; if(($input_method == 3) || ($input_method == 4)) { echo ""; } elseif($input_method == 5) { echo ""; } else { echo ""; } echo << content; if($input_method != 6) { echo "