".$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 " content; if($input_method != 6) { echo ""; } break; ############################################################################## # image editor case # ############################################################################## case "image_edit": $activedir = $HTTP_GET_VARS[activedir]; if(empty($activedir)) { $activedir = $settings[images_root]; } // generate clickable path $show_path = ""; if($settings[disable_browsing_below] == "yes") { $activedir2 = str_replace($settings[images_root],"",$activedir); $activepath = explode('/', $activedir2); $show_path .= "".$settings[images_root]."/"; for($i=0; $i"; } } else { $activepath = explode('/', $activedir); for($i=0; $i"; } } // generate subfolders select box $subfolders = ""; @chdir($activedir); $handle=opendir('.'); while ($folder = readdir($handle)) { if(is_dir($folder)) { $dirlist[] = $folder; } } closedir($handle); asort($dirlist); while (list ($key, $folder) = each ($dirlist)) { if (($folder != "..") && ($folder != ".") && ($folder != "_vti_cnf")) { $subfolders .= ""; } } // generate files selectbox $z = 0; // checking if any files were found $subfiles = ""; $handle=opendir('.'); while ($file = readdir($handle)) { if(is_file($file)) { $filelist[] = $file; $z++; } } closedir($handle); if($z>0) { asort($filelist); while (list ($key, $file) = each($filelist)) { if(eregi(".gif|.jpg|.png|.jpeg|.bmp",$file)) { if ($file != "." && $file != ".." && (!is_dir($file))) { $subfiles .= ""; } } } } if($HTTP_GET_VARS[w]=="edit") { $onload = " preData();"; $topflag = $lang[edit_image]; $buttons = "  "; } else { $onload = ""; $topflag = $lang[insert_image]; $buttons = "   "; } if($option[3] == 1) { $imageuploadlink = "".$lang[upload_new_image].""; } else { $imageuploadlink = "".$lang[upload_new_image].""; } echo << Edit image
$topflag $imageuploadlink $lang[close]
$lang[current_folder]: $show_path
$lang[locate_image]
$lang[subfolders]:
$lang[images]:
preview image
$lang[filename]
$lang[image_alt]
$lang[align]
$lang[border] px
$lang[vspace] / $lang[hspace] px / px
$lang[width] / $lang[height]
px / px
  $buttons
content; break; ############################################################################## # image detail case # ############################################################################## case "image_detail": global $HTTP_GET_VARS,$safemode; $delete_link = "".$lang[image_readonly].""; $on_load = "startUp()"; $image_name = $HTTP_GET_VARS[img]; $image_name = str_replace($protocol."://".$HTTP_HOST,".",$image_name); $rel_path = substr($image_name,0,(strrpos($image_name,"/")+1)); $get_name = substr($image_name,(strrpos($image_name,"/")+1),strlen($image_name)); @chdir($rel_path); // images can be deleted only with security set ON if($settings[security] == "1") { // find if this image is deletable if($safemode == "OFF") { if(file_exists($get_name)) { $dwarf = 1; } if(is_writable($get_name)) { $editable = 1; } else { $editable = 0; } } else { $perms = base_convert(fileperms($get_name), 10, 8); $wc = substr($perms, (strlen($perms) - 3)); if($wc == "666" || $wc == "777") { $editable = 1; } else { $editable = 0; } } if($editable == 1) { $delete_link = "".$lang[delete_image].""; } // delete filename if(isset($HTTP_GET_VARS[del]) && ($HTTP_GET_VARS[del] == 1)) { if(file_exists($get_name) == FALSE ) { $status = $lang[error].": ".$lang[cannot_del_file]." ".$get_name.", ".$lang[file_doesnt_exist]; $on_load = "endUp(0)"; } else { if(unlink($get_name)) { $status = $lang[image]." ".$lang[delete_success]; $on_load = "endUp(1)"; } else { $status = $lang[error].": ".$lang[cannot_del_file]." ".$get_name; $on_load = "endUp(0)"; } } } } echo << Image detail
$lang[detail_preview]:
$image_name
$lang[size]:  $lang[bytes] $delete_link
$lang[measures]:  x  px $lang[close_this_window]
content; break; ############################################################################## # image uploader case # ############################################################################## case "image_upload": global $HTTP_POST_VARS,$HTTP_POST_FILES; $activedir = $settings[images_root]; if(!$HTTP_POST_VARS[submit]) { $showform = 1; } if($HTTP_POST_VARS[submit]) { if($HTTP_POST_VARS[subfolder] == "") { $newimg = "".$activedir."/".$HTTP_POST_FILES[img][name].""; } else { $newimg = "".$activedir."/".$HTTP_POST_VARS[subfolder]."/".$HTTP_POST_FILES[img][name].""; } //image selection check if ($HTTP_POST_FILES[img][name] == "") { $error = 1; $errormes .= "".$lang['error'].": ".$lang['alert_no_image']." "; } // image size check if ($HTTP_POST_FILES[img][size] > $settings[max_img_size]) { $error = 1; $errormes .= "".$lang['error'].": ".$lang['alert_file_oversize']." "; } // image file type check against image file type array from config file $z = "stop"; foreach($settings[img_file_types] as $filetype) { if($HTTP_POST_FILES[img][type] == $filetype) { $z = "go"; } } if ($z == "go") { //checks if file exists if (file_exists($newimg) != FALSE ) { $error = 1; $errormes .= "".$lang['error'].": ".$lang['alert_file_exists']." "; } if (!copy($HTTP_POST_FILES[img][tmp_name], $newimg) != FALSE ) { $error = 1; $errormes .= "".$lang['error'].": ".$lang['alert_no_dir']." "; } else { chmod($newimg, 0777); } } else { $error = 1; $errormes .= "".$lang['error'].": ".$lang['alert_file_unaproved']." [?"; } } if($HTTP_GET_VARS[show] == "newfolder") { $showform = 0; $error = 0; $folder = 1; } if(isset($HTTP_POST_VARS[addfolder])) { if($HTTP_POST_VARS[foldername] != "") { @chdir($activedir); $dirName = $HTTP_POST_VARS[foldername]; if(file_exists($dirName) == FALSE ) { mkdir($dirName, 0777); $status = "".$lang['folder']." ".$dirName." ".$lang['created_success'].".
"; $folder = 0; } else { $folder = 1; $status = "".$lang['error'].": ".$lang['alert_no_folder']."
"; } } else { $folder = 1; $status = "".$lang['error'].": ".$lang['no_folder']." ".$dirName." ".$lang['no_folder_desc'].".
"; } } echo << $lang[upload_new_image]
$lang[insert_edit_image] $lang[upload_new_image] $lang[close]
content; if(isset($HTTP_POST_VARS[submit])) { if($error == 1) { echo "
".$errormes; } else { echo "

".$lang['file']." ".$HTTP_POST_FILES[img][name]." ".$lang['upload_success'].".


"; } } if(($error == 1) || ($showform == 1)) { echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
".$lang['upload_to_folder']."
".$lang['image']."
    
"; } if(isset($HTTP_POST_VARS[addfolder])) { echo $status; } if($folder == 1) { echo ""; echo ""; echo ""; echo ""; echo "
".$lang['new_folder_name'].":
 "; echo "   "; echo " 
"; } echo <<
content; break; ############################################################################## # link select case # ############################################################################## case "link_select": if($option[3] == 1) { $fileuploadlink = "".$lang[upload_file].""; } else { $fileuploadlink = "".$lang[upload_file].""; } echo << $lang[create_edit_link]
$lang[normal_link] $lang[link_to_file] $fileuploadlink $lang[close]
$lang[link_url]  « $lang[check_link]
$lang[link_alt]
$lang[link_target]
content; break; ############################################################################## # link to file case # ############################################################################## case "link_file": global $HTTP_POST_VARS, $HTTP_POST_FILES; $activedir = $HTTP_GET_VARS[activedir]; if (!IsSet($activedir)) { $activedir_show = $activedir; $activedir = $settings[files_root]; } else { $activedir_show = $activedir; $activedir = $settings[files_root]."/".$activedir.""; } if($option[3] == 1) { $fileuploadlink = "".$lang[upload_file].""; } else { $fileuploadlink = "".$lang[upload_file].""; } echo << $lang[create_edit_link]
$lang[normal_link] $lang[link_to_file] $fileuploadlink $lang[close]
$lang[current_folder]: $settings[files_root]/$activedir_show
$lang[locate_file]
$lang[subfolders]
$lang[files]:
$lang[link_url]  « $lang[check_link]
$lang[link_alt]
$lang[link_target]
content; break; ############################################################################## # file upload case # ############################################################################## case "file_upload": global $HTTP_POST_VARS,$HTTP_POST_FILES; $factivedir = $settings[files_root]; if(!isset($HTTP_POST_VARS[submit])) { $showform = 1; } if(isset($HTTP_POST_VARS[submit])) { if($subfolder=="") { $newimg = "".$factivedir."/".$HTTP_POST_FILES[filename][name].""; } else { $newimg = "".$factivedir."/".$subfolder."/".$HTTP_POST_FILES[filename][name].""; } //file selection check if ($HTTP_POST_FILES[filename][name] == "") { $error = 1; $errormes .= "".$lang['error'].": ".$lang['alert_no_image']." "; } // file size check if ($HTTP_POST_FILES[filename][size] > $settings[max_file_size]) { $error = 1; $errormes .= "".$lang['error'].": ".$lang['alert_file_oversize']." "; } // image file type check against image file type array from config file $build_condition = "("; $filename2check = $HTTP_POST_FILES[filename][name]; $filename_ext = strrchr($filename2check,"."); $z = 0; $n = (count($settings[mime_file_ext])-1); foreach($settings[mime_file_ext] as $mimeext) { if($mimeext != $filename_ext) { $z++; } } if ($z == $n) { //checks if file exists if (file_exists("$newimg") != FALSE ) { $error = 1; $errormes .= "".$lang['error'].": ".$lang['alert_file_exists']." "; } if (!copy($HTTP_POST_FILES[filename][tmp_name], $newimg) != FALSE ) { $error = 1; $errormes .= "".$lang['error'].": ".$lang['alert_no_dir']." "; } } else { $error = 1; $errormes .= "".$lang['error'].": ".$lang['alert_file_unaproved']." [?"; } } if($HTTP_GET_VARS[show] == "newfolder") { $showform = 0; $error = 0; $folder = 1; } if(isset($HTTP_POST_VARS[addfolder])) { if($HTTP_POST_VARS[foldername] != "") { @chdir($factivedir); $dirName = $HTTP_POST_VARS[foldername]; if(file_exists($dirName) == FALSE ) { mkdir($dirName, 0777); $status = "".$lang['folder']." ".$dirName." ".$lang['created_success'].".
"; $folder = 0; } else { $folder = 1; $status = "".$lang['error'].": ".$lang['alert_no_folder']."
"; } } else { $folder = 1; $status = "".$lang['error'].": ".$lang['no_folder']." ".$dirName." ".$lang['no_folder_desc'].".
"; } } echo << $lang[upload_file]
$lang[normal_link] $lang[link_to_file] $lang[upload_file] $lang[close]
content; if(isset($HTTP_POST_VARS[submit])) { if($error == 1) { echo $errormes; } else { echo "


".$lang['file']." ".$HTTP_POST_FILES[filename][name]." ".$lang['upload_success'].".


"; } } if(($error == 1) || ($showform == 1)) { echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
".$lang['upload_file'].""; if(isset($HTTP_POST_VARS[addfolder])) { echo " - ".$status; } echo"
".$lang['folder'].":   
".$lang['file'].": "; echo "
   "; echo ""; echo "
"; } if($folder == 1) { echo ""; echo ""; echo ""; echo ""; echo ""; echo "
".$lang['create_folder']."
".$lang['new_folder_name'].":
   "; echo " 
"; } echo <<
content; break; ############################################################################## # color picker case # ############################################################################## case "color_picker": if(!isset($which)) { $which = $HTTP_GET_VARS['which']; } if($which=="fg") { $display = $lang['foreground_color']; $function = "ChangeCol('Forecolor')"; $order = "Forecolor"; } else { $display = $lang['background_color']; $function = "ChangeCol('Backcolor')"; $order = "Backcolor"; } echo <<
 $display:
#
 < $lang[fav_colors]
 
content; break; ############################################################################## # table edit - # ############################################################################## case "table_edit": echo << HTMLeditbox - Table Management "; $headflag = $lang[edit_table]; } else { echo " OnLoad=\"setHeight();\">"; $headflag = $lang[create_table]; } echo <<
$headflag $lang[edit_cell] $lang[rows_columns] $lang[close]
$lang[num_of_cols]: $lang[num_of_rows]: $lang[table_width]:
$lang[cellspacing]: $lang[px] $lang[cellpadding]: $lang[px] $lang[table_height]:
 
$lang[back_color]: $lang[color] pick&see >
$lang[borders_all]: $lang[color]   - $lang[width]: $lang[px]  - $lang[style]:
$lang[border] - $lang[top]: $lang[color]   - $lang[width]: $lang[px]  - $lang[style]:
$lang[border] - $lang[right]: $lang[color]   - $lang[width]: $lang[px]  - $lang[style]:
$lang[border] - $lang[bottom]: $lang[color]   - $lang[width]: $lang[px]  - $lang[style]:
$lang[border] - $lang[left]: $lang[color]   - $lang[width]: $lang[px]  - $lang[style]:
$lang[table_align]:
content; if($HTTP_GET_VARS[tab] == "preload") { echo ""; } else { echo ""; } echo <<
content; break; ###################################################################### # table - edit cell # ###################################################################### case "table_cell": echo << HTMLeditbox - Table Management
$lang[create_table] $lang[edit_cell] $lang[rows_columns] $lang[close]
$lang[cell_width]: $lang[cell_height]:
$lang[vertical_alignment]: $lang[horizontal_alignment]:
$lang[row_span]: $lang[col_span]:
 
$lang[back_color]: $lang[color] pick&see >
$lang[borders_all]: $lang[color]   - $lang[width]: $lang[px]  - $lang[style]:
$lang[border] - $lang[top]: $lang[color]   - $lang[width]: $lang[px]  - $lang[style]:
$lang[border] - $lang[right]: $lang[color]   - $lang[width]: $lang[px]  - $lang[style]:
$lang[border] - $lang[bottom]: $lang[color]   - $lang[width]: $lang[px]  - $lang[style]:
$lang[border] - $lang[left]: $lang[color]   - $lang[width]: $lang[px]  - $lang[style]:
$lang[no_wrap]
content; break; ###################################################################### # table - table functions # ###################################################################### case "table_func": echo << HTMLeditbox - Table Management
$lang[create_table] $lang[edit_cell] $lang[rows_columns] $lang[close]

content; break; case "save2db": $dbworks = "save"; include($settings['app_dir'].'/inc/db_bridge.php'); break; case "save2file": $fileworks = "save"; include($settings['app_dir'].'/inc/file_bridge.php'); break; } ?>